executor 1.3.0-beta.5 → 1.4.0-beta.2
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/bin/executor +53 -0
- package/package.json +6 -20
- package/postinstall.cjs +102 -0
- package/README.md +0 -395
- package/bin/deno-subprocess-worker.mjs +0 -205
- package/bin/emscripten-module.wasm +0 -0
- package/bin/executor.js +0 -42
- package/bin/executor.mjs +0 -367200
- package/bin/keyring.linux-x64-gnu-62qs1shy.node +0 -0
- package/bin/keyring.linux-x64-musl-n4e0vcy6.node +0 -0
- package/bin/sandbox-worker.mjs +0 -5850
- package/node_modules/@1password/sdk/README.md +0 -146
- package/node_modules/@1password/sdk/dist/client.d.ts +0 -14
- package/node_modules/@1password/sdk/dist/client.js +0 -19
- package/node_modules/@1password/sdk/dist/client_builder.d.ts +0 -8
- package/node_modules/@1password/sdk/dist/client_builder.js +0 -36
- package/node_modules/@1password/sdk/dist/configuration.d.ts +0 -23
- package/node_modules/@1password/sdk/dist/configuration.js +0 -58
- package/node_modules/@1password/sdk/dist/core.d.ts +0 -92
- package/node_modules/@1password/sdk/dist/core.js +0 -119
- package/node_modules/@1password/sdk/dist/environments.d.ts +0 -19
- package/node_modules/@1password/sdk/dist/environments.js +0 -53
- package/node_modules/@1password/sdk/dist/errors.d.ts +0 -9
- package/node_modules/@1password/sdk/dist/errors.js +0 -36
- package/node_modules/@1password/sdk/dist/groups.d.ts +0 -19
- package/node_modules/@1password/sdk/dist/groups.js +0 -54
- package/node_modules/@1password/sdk/dist/items.d.ts +0 -89
- package/node_modules/@1password/sdk/dist/items.js +0 -216
- package/node_modules/@1password/sdk/dist/items_files.d.ts +0 -40
- package/node_modules/@1password/sdk/dist/items_files.js +0 -116
- package/node_modules/@1password/sdk/dist/items_shares.d.ts +0 -32
- package/node_modules/@1password/sdk/dist/items_shares.js +0 -95
- package/node_modules/@1password/sdk/dist/sdk.d.ts +0 -14
- package/node_modules/@1password/sdk/dist/sdk.js +0 -45
- package/node_modules/@1password/sdk/dist/secrets.d.ts +0 -36
- package/node_modules/@1password/sdk/dist/secrets.js +0 -107
- package/node_modules/@1password/sdk/dist/shared_lib_core.d.ts +0 -16
- package/node_modules/@1password/sdk/dist/shared_lib_core.js +0 -177
- package/node_modules/@1password/sdk/dist/types.d.ts +0 -769
- package/node_modules/@1password/sdk/dist/types.js +0 -260
- package/node_modules/@1password/sdk/dist/vaults.d.ts +0 -83
- package/node_modules/@1password/sdk/dist/vaults.js +0 -209
- package/node_modules/@1password/sdk/dist/version.d.ts +0 -2
- package/node_modules/@1password/sdk/dist/version.js +0 -6
- package/node_modules/@1password/sdk/package.json +0 -47
- package/node_modules/@1password/sdk-core/nodejs/core.d.ts +0 -18
- package/node_modules/@1password/sdk-core/nodejs/core.js +0 -798
- package/node_modules/@1password/sdk-core/nodejs/core_bg.wasm +0 -0
- package/node_modules/@1password/sdk-core/nodejs/core_bg.wasm.d.ts +0 -20
- package/node_modules/@1password/sdk-core/package.json +0 -16
- package/resources/web/assets/c-BIGW1oBm.js +0 -1
- package/resources/web/assets/cpp-BRuaLJcg.js +0 -1
- package/resources/web/assets/csharp-COcwbKMJ.js +0 -1
- package/resources/web/assets/css-DPfMkruS.js +0 -1
- package/resources/web/assets/diff-D97Zzqfu.js +0 -1
- package/resources/web/assets/dockerfile-BcOcwvcX.js +0 -1
- package/resources/web/assets/go-CxLEBnE3.js +0 -1
- package/resources/web/assets/graphql-ChdNCCLP.js +0 -1
- package/resources/web/assets/highlighted-body-TPN3WLV5-46YyTVIj.js +0 -1
- package/resources/web/assets/html-GMplVEZG.js +0 -1
- package/resources/web/assets/http-jrhK8wxY.js +0 -1
- package/resources/web/assets/index-CRuElBS1.js +0 -1
- package/resources/web/assets/index-vE9OfFSV.js +0 -10
- package/resources/web/assets/java-CylS5w8V.js +0 -1
- package/resources/web/assets/javascript-wDzz0qaB.js +0 -1
- package/resources/web/assets/json-Cp-IABpG.js +0 -1
- package/resources/web/assets/jsonc-Des-eS-w.js +0 -1
- package/resources/web/assets/jsx-g9-lgVsj.js +0 -1
- package/resources/web/assets/kotlin-BdnUsdx6.js +0 -1
- package/resources/web/assets/log-2UxHyX5q.js +0 -1
- package/resources/web/assets/markdown-Cvjx9yec.js +0 -1
- package/resources/web/assets/mermaid-O7DHMXV3-C705YdCO.js +0 -394
- package/resources/web/assets/mermaid-O7DHMXV3-CQK1gbuD.css +0 -1
- package/resources/web/assets/php-Dhbhpdrm.js +0 -1
- package/resources/web/assets/proto-C7zT0LnQ.js +0 -1
- package/resources/web/assets/python-B6aJPvgy.js +0 -1
- package/resources/web/assets/ruby-xesJ3fNi.js +0 -1
- package/resources/web/assets/rust-B1yitclQ.js +0 -1
- package/resources/web/assets/shellscript-Yzrsuije.js +0 -1
- package/resources/web/assets/sql-BLtJtn59.js +0 -1
- package/resources/web/assets/swift-D82vCrfD.js +0 -1
- package/resources/web/assets/toml-vGWfd6FD.js +0 -1
- package/resources/web/assets/tsx-COt5Ahok.js +0 -1
- package/resources/web/assets/typescript-BPQ3VLAy.js +0 -1
- package/resources/web/assets/vitesse-dark-D0r3Knsf.js +0 -1
- package/resources/web/assets/xml-sdJ4AIDG.js +0 -1
- package/resources/web/assets/yaml-Buea-lGh.js +0 -1
- package/resources/web/index.html +0 -24
|
@@ -1,394 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/css-DPfMkruS.js","assets/graphql-ChdNCCLP.js","assets/typescript-BPQ3VLAy.js","assets/jsx-g9-lgVsj.js","assets/tsx-COt5Ahok.js","assets/ruby-xesJ3fNi.js","assets/sql-BLtJtn59.js","assets/cpp-BRuaLJcg.js","assets/c-BIGW1oBm.js","assets/shellscript-Yzrsuije.js","assets/yaml-Buea-lGh.js","assets/php-Dhbhpdrm.js","assets/json-Cp-IABpG.js","assets/http-jrhK8wxY.js","assets/highlighted-body-TPN3WLV5-46YyTVIj.js","assets/index-CRuElBS1.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as rT,j as f,b as sK,r as aK,_ as Le}from"./index-CRuElBS1.js";function oK(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function p1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xt=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(Xt||{});function Uj({update:e,notify:t,unwatched:n}){return{link:r,unlink:s,propagate:a,checkDirty:o,shallowPropagate:i};function r(u,l,d){const h=l.depsTail;if(h!==void 0&&h.dep===u)return;const m=h!==void 0?h.nextDep:l.deps;if(m!==void 0&&m.dep===u){m.version=d,l.depsTail=m;return}const p=u.subsTail;if(p!==void 0&&p.version===d&&p.sub===l)return;const y=l.depsTail=u.subsTail={version:d,dep:u,sub:l,prevDep:h,nextDep:m,prevSub:p,nextSub:void 0};m!==void 0&&(m.prevDep=y),h!==void 0?h.nextDep=y:l.deps=y,p!==void 0?p.nextSub=y:u.subs=y}function s(u,l=u.sub){const d=u.dep,h=u.prevDep,m=u.nextDep,p=u.nextSub,y=u.prevSub;return m!==void 0?m.prevDep=h:l.depsTail=h,h!==void 0?h.nextDep=m:l.deps=m,p!==void 0?p.prevSub=y:d.subsTail=y,y!==void 0?y.nextSub=p:(d.subs=p)===void 0&&n(d),m}function a(u){let l=u.nextSub,d;e:do{const h=u.sub;let m=h.flags;if(m&60?m&12?m&4?!(m&48)&&c(u,h)?(h.flags=m|40,m&=1):m=0:h.flags=m&-9|32:m=0:h.flags=m|32,m&2&&t(h),m&1){const p=h.subs;if(p!==void 0){const y=(u=p).nextSub;y!==void 0&&(d={value:l,prev:d},l=y);continue}}if((u=l)!==void 0){l=u.nextSub;continue}for(;d!==void 0;)if(u=d.value,d=d.prev,u!==void 0){l=u.nextSub;continue e}break}while(!0)}function o(u,l){let d,h=0,m=!1;e:do{const p=u.dep,y=p.flags;if(l.flags&16)m=!0;else if((y&17)===17){if(e(p)){const g=p.subs;g.nextSub!==void 0&&i(g),m=!0}}else if((y&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(d={value:u,prev:d}),u=p.deps,l=p,++h;continue}if(!m){const g=u.nextDep;if(g!==void 0){u=g;continue}}for(;h--;){const g=l.subs,b=g.nextSub!==void 0;if(b?(u=d.value,d=d.prev):u=g,m){if(e(l)){b&&i(g),l=u.sub;continue}m=!1}else l.flags&=-33;l=u.sub;const x=u.nextDep;if(x!==void 0){u=x;continue e}}return m}while(!0)}function i(u){do{const l=u.sub,d=l.flags;(d&48)===32&&(l.flags=d|16,(d&6)===2&&t(l))}while((u=u.nextSub)!==void 0)}function c(u,l){let d=l.depsTail;for(;d!==void 0;){if(d===u)return!0;d=d.prevDep}return!1}}let sT=0,ic=0,oh=0;const _o=[],{link:UUe,unlink:zj,propagate:zUe,checkDirty:iK,shallowPropagate:HUe}=Uj({update(e){return e.depsTail!==void 0?dK(e):fK(e)},notify(e){let t=oh,n=t;do if(_o[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(oh=t;n<--t;){const r=_o[n];_o[n++]=_o[t],_o[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,g1(e)):pK.call(e)}});function cK(){return sT}function uK(){++sT}function lK(){--sT||mK()}function dK(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,g1(e)}}function fK(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function hK(e){const t=e.flags;if(t&16||t&32&&iK(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,g1(e)}}else e.flags=2}function mK(){try{for(;ic<oh;){const e=_o[ic];_o[ic++]=void 0,hK(e)}}finally{for(;ic<oh;){const e=_o[ic];_o[ic++]=void 0,e.flags|=10}ic=0,oh=0}}function pK(){this.depsTail=void 0,this.flags=0,g1(this);const e=this.subs;e!==void 0&&zj(e)}function g1(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=zj(n,e)}function aT(e,t,n){const r=typeof e=="object",s=r?e:void 0;return{next:(r?e.next:e)?.bind(s),error:(r?e.error:t)?.bind(s),complete:(r?e.complete:n)?.bind(s)}}const nw=[];let Ib=0;const{link:AA,unlink:gK,propagate:bK,checkDirty:Hj,shallowPropagate:NA}=Uj({update(e){return e._update()},notify(e){nw[rw++]=e,e.flags&=~Xt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Xt.Mutable|Xt.Dirty,my(e))}});let Bp=0,rw=0,Ma;function my(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=gK(n,e)}function qj(){if(!(cK()>0)){for(;Bp<rw;){const e=nw[Bp];nw[Bp++]=void 0,e.notify()}Bp=0,rw=0}}function Vj(e,t){const n=typeof e=="function",r=e,s={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?Xt.None:Xt.Mutable,get(){return Ma!==void 0&&AA(s,Ma,Ib),s._snapshot},subscribe(a){const o=aT(a),i={current:!1},c=yK(()=>{s.get(),i.current?o.next?.(s._snapshot):i.current=!0});return{unsubscribe:()=>{c.stop()}}},_update(a){const o=Ma,i=Object.is;if(n)Ma=s,++Ib,s.depsTail=void 0;else if(a===void 0)return!1;n&&(s.flags=Xt.Mutable|Xt.RecursedCheck);try{const c=s._snapshot,u=typeof a=="function"?a(c):a===void 0&&n?r(c):a;return c===void 0||!i(c,u)?(s._snapshot=u,!0):!1}finally{Ma=o,n&&(s.flags&=~Xt.RecursedCheck),my(s)}}};return n?(s.flags=Xt.Mutable|Xt.Dirty,s.get=function(){const a=s.flags;if(a&Xt.Dirty||a&Xt.Pending&&Hj(s.deps,s)){if(s._update()){const o=s.subs;o!==void 0&&NA(o)}}else a&Xt.Pending&&(s.flags=a&~Xt.Pending);return Ma!==void 0&&AA(s,Ma,Ib),s._snapshot}):s.set=function(a){if(s._update(a)){const o=s.subs;o!==void 0&&(bK(o),NA(o),qj())}},s}function yK(e){const t=()=>{const r=Ma;Ma=n,++Ib,n.depsTail=void 0,n.flags=Xt.Watching|Xt.RecursedCheck;try{return e()}finally{Ma=r,n.flags&=~Xt.RecursedCheck,my(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Xt.Watching|Xt.RecursedCheck,notify(){const r=this.flags;r&Xt.Dirty||r&Xt.Pending&&Hj(this.deps,this)?t():this.flags=Xt.Watching},stop(){this.flags=Xt.None,this.depsTail=void 0,my(this)}};return t(),n}let xK=class{constructor(t){this.atom=Vj(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(aT(t))}};class kK{constructor(t){this.atom=Vj(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(aT(t))}}function vK(e){return typeof e=="function"?new kK(e):new xK(e)}function SK(e){try{uK(),e()}finally{lK(),qj()}}const ki="__TSR_index",RA="popstate",PA="beforeunload";function wK(e){let t=e.getLocation();const n=new Set,r=o=>{t=e.getLocation(),n.forEach(i=>i({location:t,action:o}))},s=o=>{e.notifyOnIndexChange??!0?r(o):t=e.getLocation()},a=async({task:o,navigateOpts:i,...c})=>{if(i?.ignoreBlocker??!1){o();return}const l=e.getBlockers?.()??[],d=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&l.length&&d)for(const h of l){const m=py(c.path,c.state);if(await h.blockerFn({currentLocation:t,nextLocation:m,action:c.type})){e.onBlocked?.();return}}o()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:o=>(n.add(o),()=>{n.delete(o)}),push:(o,i,c)=>{const u=t.state[ki];i=OA(u+1,i),a({task:()=>{e.pushState(o,i),r({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:o,state:i})},replace:(o,i,c)=>{const u=t.state[ki];i=OA(u,i),a({task:()=>{e.replaceState(o,i),r({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:o,state:i})},go:(o,i)=>{a({task:()=>{e.go(o),s({type:"GO",index:o})},navigateOpts:i,type:"GO"})},back:o=>{a({task:()=>{e.back(o?.ignoreBlocker??!1),s({type:"BACK"})},navigateOpts:o,type:"BACK"})},forward:o=>{a({task:()=>{e.forward(o?.ignoreBlocker??!1),s({type:"FORWARD"})},navigateOpts:o,type:"FORWARD"})},canGoBack:()=>t.state[ki]!==0,createHref:o=>e.createHref(o),block:o=>{if(!e.setBlockers)return()=>{};const i=e.getBlockers?.()??[];return e.setBlockers([...i,o]),()=>{const c=e.getBlockers?.()??[];e.setBlockers?.(c.filter(u=>u!==o))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function OA(e,t){t||(t={});const n=oT();return{...t,key:n,__TSR_key:n,[ki]:e}}function _K(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let s=[];const a=()=>s,o=A=>s=A,i=(A=>A),c=(()=>py(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const A=oT();t.history.replaceState({[ki]:0,key:A,__TSR_key:A},"")}let u=c(),l,d=!1,h=!1,m=!1,p=!1;const y=()=>u;let g,b;const x=()=>{g&&(T._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,"",g.href),T._ignoreSubscribers=!1,g=void 0,b=void 0,l=void 0)},k=(A,L,R)=>{const j=i(L);b||(l=u),u=py(L,R),g={href:j,state:R,isPush:g?.isPush||A==="push"},b||(b=Promise.resolve().then(()=>x()))},_=A=>{u=c(),T.notify({type:A})},S=async()=>{if(h){h=!1;return}const A=c(),L=A.state[ki]-u.state[ki],R=L===1,j=L===-1,F=!R&&!j||d;d=!1;const K=F?"GO":j?"BACK":"FORWARD",Y=F?{type:"GO",index:L}:{type:j?"BACK":"FORWARD"};if(m)m=!1;else{const W=a();if(typeof document<"u"&&W.length){for(const J of W)if(await J.blockerFn({currentLocation:u,nextLocation:A,action:K})){h=!0,t.history.go(1),T.notify(Y);return}}}u=c(),T.notify(Y)},w=A=>{if(p){p=!1;return}let L=!1;const R=a();if(typeof document<"u"&&R.length)for(const j of R){const F=j.enableBeforeUnload??!0;if(F===!0){L=!0;break}if(typeof F=="function"&&F()===!0){L=!0;break}}if(L)return A.preventDefault(),A.returnValue=""},T=wK({getLocation:y,getLength:()=>t.history.length,pushState:(A,L)=>k("push",A,L),replaceState:(A,L)=>k("replace",A,L),back:A=>(A&&(m=!0),p=!0,t.history.back()),forward:A=>{A&&(m=!0),p=!0,t.history.forward()},go:A=>{d=!0,t.history.go(A)},createHref:A=>i(A),flush:x,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(PA,w,{capture:!0}),t.removeEventListener(RA,S)},onBlocked:()=>{l&&u!==l&&(u=l)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(PA,w,{capture:!0}),t.addEventListener(RA,S),t.history.pushState=function(...A){const L=n.apply(t.history,A);return T._ignoreSubscribers||_("PUSH"),L},t.history.replaceState=function(...A){const L=r.apply(t.history,A);return T._ignoreSubscribers||_("REPLACE"),L},T}function EK(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function py(e,t){const n=EK(e),r=n.indexOf("#"),s=n.indexOf("?"),a=oT();return{href:n,pathname:n.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:n.length),hash:r>-1?n.substring(r):"",search:s>-1?n.slice(s,r===-1?void 0:r):"",state:t||{[ki]:0,key:a,__TSR_key:a}}}function oT(){return(Math.random()+1).toString(36).substring(7)}const TK=!1;function ih(e){let t;return SK(()=>{t=e()}),t}function Hh(e){return e[e.length-1]}function CK(e){return typeof e=="function"}function di(e,t){return CK(e)?e(t):e}const IK=Object.prototype.hasOwnProperty,LA=Object.prototype.propertyIsEnumerable;function ls(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=t,s=MA(e)&&MA(r);if(!s&&!(gy(e)&&gy(r)))return r;const a=s?e:$A(e);if(!a)return r;const o=s?r:$A(r);if(!o)return r;const i=a.length,c=o.length,u=s?new Array(c):{};let l=0;for(let d=0;d<c;d++){const h=s?d:o[d],m=e[h],p=r[h];if(m===p){u[h]=m,(s?d<i:IK.call(e,h))&&l++;continue}if(m===null||p===null||typeof m!="object"||typeof p!="object"){u[h]=p;continue}const y=ls(m,p,n+1);u[h]=y,y===m&&l++}return i===c&&l===i?e:u}function $A(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!LA.call(e,s))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const s of n){if(!LA.call(e,s))return!1;r.push(s)}return r}function gy(e){if(!jA(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!jA(n)||!n.hasOwnProperty("isPrototypeOf"))}function jA(e){return Object.prototype.toString.call(e)==="[object Object]"}function MA(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function qc(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,s=e.length;r<s;r++)if(!qc(e[r],t[r],n))return!1;return!0}if(gy(e)&&gy(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const o in t)if((!r||t[o]!==void 0)&&!qc(e[o],t[o],n))return!1;return!0}let s=0;if(!r)s=Object.keys(e).length;else for(const o in e)e[o]!==void 0&&s++;let a=0;for(const o in t)if((!r||t[o]!==void 0)&&(a++,a>s||!qc(e[o],t[o],n)))return!1;return s===a}return!1}function Hl(e){let t,n;const r=new Promise((s,a)=>{t=s,n=a});return r.status="pending",r.resolve=s=>{r.status="resolved",r.value=s,t(s),e?.(s)},r.reject=s=>{r.status="rejected",n(s)},r}function qh(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function AK(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function DA(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return AK(t)}const NK=["http:","https:","mailto:","tel:"];function by(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function uf(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",s;for(;(s=t.exec(e))!==null;)r+=DA(e.slice(n,s.index))+s[0],n=t.lastIndex;r=r+DA(n?e.slice(n):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function RK(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var PK="Invariant failed";function Pi(e,t){if(!e)throw new Error(PK)}function yy(e){const t=new Map;let n,r;const s=a=>{a.next&&(a.prev?(a.prev.next=a.next,a.next.prev=a.prev,a.next=void 0,r&&(r.next=a,a.prev=r)):(a.next.prev=void 0,n=a.next,a.next=void 0,r&&(a.prev=r,r.next=a)),r=a)};return{get(a){const o=t.get(a);if(o)return s(o),o.value},set(a,o){if(t.size>=e&&n){const c=n;t.delete(c.key),c.next&&(n=c.next,c.next.prev=void 0),c===r&&(r=void 0)}const i=t.get(a);if(i)i.value=o,s(i);else{const c={key:a,value:o,prev:r};r&&(r.next=c),r=c,n||(n=c),t.set(a,c)}},clear(){t.clear(),n=void 0,r=void 0}}}const ql=0,tu=1,nu=2,Vh=3,Pc=4,Gj=5;function OK(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function iT(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),s=r===-1?e.length:r,a=e.substring(t,s);if(!a||!a.includes("$"))return n[0]=ql,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n;if(a==="$"){const i=e.length;return n[0]=nu,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}if(a.charCodeAt(0)===36)return n[0]=tu,n[1]=t,n[2]=t+1,n[3]=s,n[4]=s,n[5]=s,n;const o=OK(a);if(o){const[i,c]=o,u=a.charCodeAt(i+1);if(u===45){if(i+2<a.length&&a.charCodeAt(i+2)===36){const l=i+3,d=c;if(l<d)return n[0]=Vh,n[1]=t+i,n[2]=t+l,n[3]=t+d,n[4]=t+c+1,n[5]=s,n}}else if(u===36){const l=i+1,d=i+2;return d===c?(n[0]=nu,n[1]=t+i,n[2]=t+l,n[3]=t+d,n[4]=t+c+1,n[5]=e.length,n):(n[0]=tu,n[1]=t+i,n[2]=t+d,n[3]=t+c,n[4]=t+c+1,n[5]=s,n)}}return n[0]=ql,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n}function b1(e,t,n,r,s,a,o){o?.(n);let i=r;{const c=n.fullPath??n.from,u=c.length,l=n.options?.caseSensitive??e,d=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;i<u;){const m=iT(c,i,t);let p;const y=i,g=m[5];switch(i=g+1,a++,m[0]){case ql:{const x=c.substring(m[2],m[3]);if(l){const k=s.static?.get(x);if(k)p=k;else{s.static??=new Map;const _=Oc(n.fullPath??n.from);_.parent=s,_.depth=a,p=_,s.static.set(x,_)}}else{const k=x.toLowerCase(),_=s.staticInsensitive?.get(k);if(_)p=_;else{s.staticInsensitive??=new Map;const S=Oc(n.fullPath??n.from);S.parent=s,S.depth=a,p=S,s.staticInsensitive.set(k,S)}}break}case tu:{const x=c.substring(y,m[1]),k=c.substring(m[4],g),_=l&&!!(x||k),S=x?_?x:x.toLowerCase():void 0,w=k?_?k:k.toLowerCase():void 0,T=!d&&s.dynamic?.find(A=>!A.skipOnParamError&&A.caseSensitive===_&&A.prefix===S&&A.suffix===w);if(T)p=T;else{const A=zk(tu,n.fullPath??n.from,_,S,w);p=A,A.depth=a,A.parent=s,s.dynamic??=[],s.dynamic.push(A)}break}case Vh:{const x=c.substring(y,m[1]),k=c.substring(m[4],g),_=l&&!!(x||k),S=x?_?x:x.toLowerCase():void 0,w=k?_?k:k.toLowerCase():void 0,T=!d&&s.optional?.find(A=>!A.skipOnParamError&&A.caseSensitive===_&&A.prefix===S&&A.suffix===w);if(T)p=T;else{const A=zk(Vh,n.fullPath??n.from,_,S,w);p=A,A.parent=s,A.depth=a,s.optional??=[],s.optional.push(A)}break}case nu:{const x=c.substring(y,m[1]),k=c.substring(m[4],g),_=l&&!!(x||k),S=x?_?x:x.toLowerCase():void 0,w=k?_?k:k.toLowerCase():void 0,T=zk(nu,n.fullPath??n.from,_,S,w);p=T,T.parent=s,T.depth=a,s.wildcard??=[],s.wildcard.push(T)}}s=p}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const m=Oc(n.fullPath??n.from);m.kind=Gj,m.parent=s,a++,m.depth=a,s.pathless??=[],s.pathless.push(m),s=m}const h=(n.path||!n.children)&&!n.isRoot;if(h&&c.endsWith("/")){const m=Oc(n.fullPath??n.from);m.kind=Pc,m.parent=s,a++,m.depth=a,s.index=m,s=m}s.parse=n.options?.params?.parse??null,s.skipOnParamError=d,s.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,h&&!s.route&&(s.route=n,s.fullPath=n.fullPath??n.from)}if(n.children)for(const c of n.children)b1(e,t,c,i,s,a,o)}function Uk(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function ii(e){if(e.pathless)for(const t of e.pathless)ii(t);if(e.static)for(const t of e.static.values())ii(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())ii(t);if(e.dynamic?.length){e.dynamic.sort(Uk);for(const t of e.dynamic)ii(t)}if(e.optional?.length){e.optional.sort(Uk);for(const t of e.optional)ii(t)}if(e.wildcard?.length){e.wildcard.sort(Uk);for(const t of e.wildcard)ii(t)}}function Oc(e){return{kind:ql,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function zk(e,t,n,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:s}}function LK(e,t){const n=Oc("/"),r=new Uint16Array(6);for(const s of e)b1(!1,r,s,1,n,0);ii(n),t.masksTree=n,t.flatCache=yy(1e3)}function $K(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=cT(e,t.masksTree);return t.flatCache.set(e,r),r}function jK(e,t,n,r,s){e||="/",r||="/";const a=t?`case\0${e}`:e;let o=s.singleCache.get(a);if(!o){o=Oc("/");const i=new Uint16Array(6);b1(t,i,{from:e},1,o,0),s.singleCache.set(a,o)}return cT(r,o,n)}function MK(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,s=t.matchCache.get(r);if(s!==void 0)return s;e||="/";let a;try{a=cT(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)a=null;else throw o}return a&&(a.branch=BK(a.route)),t.matchCache.set(r,a),a}function DK(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function FK(e,t=!1,n){const r=Oc(e.fullPath),s=new Uint16Array(6),a={},o={};let i=0;return b1(t,s,e,1,r,0,u=>{if(n?.(u,i),Pi(!(u.id in a),`Duplicate routes found with id: ${String(u.id)}`),a[u.id]=u,i!==0&&u.path){const l=DK(u.fullPath);(!o[l]||u.fullPath.endsWith("/"))&&(o[l]=u)}i++}),ii(r),{processedTree:{segmentTree:r,singleCache:yy(1e3),matchCache:yy(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function cT(e,t,n=!1){const r=e.split("/"),s=zK(e,r,t,n);if(!s)return null;const[a]=Kj(e,r,s);return{route:s.node.route,rawParams:a,parsedParams:s.parsedParams}}function Kj(e,t,n){const r=UK(n.node);let s=null;const a={};let o=n.extract?.part??0,i=n.extract?.node??0,c=n.extract?.path??0,u=n.extract?.segment??0;for(;i<r.length;o++,i++,c++,u++){const l=r[i];if(l.kind===Pc)break;if(l.kind===Gj){u--,o--,c--;continue}const d=t[o],h=c;if(d&&(c+=d.length),l.kind===tu){s??=n.node.fullPath.split("/");const m=s[u],p=l.prefix?.length??0;if(m.charCodeAt(p)===123){const g=l.suffix?.length??0,b=m.substring(p+2,m.length-g-1),x=d.substring(p,d.length-g);a[b]=decodeURIComponent(x)}else{const g=m.substring(1);a[g]=decodeURIComponent(d)}}else if(l.kind===Vh){if(n.skipped&1<<i){o--,c=h-1;continue}s??=n.node.fullPath.split("/");const m=s[u],p=l.prefix?.length??0,y=l.suffix?.length??0,g=m.substring(p+3,m.length-y-1),b=l.suffix||l.prefix?d.substring(p,d.length-y):d;b&&(a[g]=decodeURIComponent(b))}else if(l.kind===nu){const m=l,p=e.substring(h+(m.prefix?.length??0),e.length-(m.suffix?.length??0)),y=decodeURIComponent(p);a["*"]=y,a._splat=y;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:i,path:c,segment:u}]}function BK(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function UK(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function zK(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const s=!Hh(t),a=s&&e!=="/",o=t.length-(s?1:0),i=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let c=null,u=null,l=null;for(;i.length;){const d=i.pop(),{node:h,index:m,skipped:p,depth:y,statics:g,dynamics:b,optionals:x}=d;let{extract:k,rawParams:_,parsedParams:S}=d;if(h.skipOnParamError){if(!Hk(e,t,d))continue;_=d.rawParams,k=d.extract,S=d.parsedParams}r&&h.route&&h.kind!==Pc&&lf(u,d)&&(u=d);const w=m===o;if(w&&(h.route&&!a&&lf(l,d)&&(l=d),!h.optional&&!h.wildcard&&!h.index&&!h.pathless))continue;const T=w?void 0:t[m];let A;if(w&&h.index){const L={node:h.index,index:m,skipped:p,depth:y+1,statics:g,dynamics:b,optionals:x,extract:k,rawParams:_,parsedParams:S};let R=!0;if(h.index.skipOnParamError&&(Hk(e,t,L)||(R=!1)),R){if(g===o&&!b&&!x&&!p)return L;lf(l,L)&&(l=L)}}if(h.wildcard&&lf(c,d))for(const L of h.wildcard){const{prefix:R,suffix:j}=L;if(R&&(w||!(L.caseSensitive?T:A??=T.toLowerCase()).startsWith(R)))continue;if(j){if(w)continue;const K=t.slice(m).join("/").slice(-j.length);if((L.caseSensitive?K:K.toLowerCase())!==j)continue}const F={node:L,index:o,skipped:p,depth:y,statics:g,dynamics:b,optionals:x,extract:k,rawParams:_,parsedParams:S};if(!(L.skipOnParamError&&!Hk(e,t,F))){c=F;break}}if(h.optional){const L=p|1<<y,R=y+1;for(let j=h.optional.length-1;j>=0;j--){const F=h.optional[j];i.push({node:F,index:m,skipped:L,depth:R,statics:g,dynamics:b,optionals:x,extract:k,rawParams:_,parsedParams:S})}if(!w)for(let j=h.optional.length-1;j>=0;j--){const F=h.optional[j],{prefix:K,suffix:Y}=F;if(K||Y){const W=F.caseSensitive?T:A??=T.toLowerCase();if(K&&!W.startsWith(K)||Y&&!W.endsWith(Y))continue}i.push({node:F,index:m+1,skipped:p,depth:R,statics:g,dynamics:b,optionals:x+1,extract:k,rawParams:_,parsedParams:S})}}if(!w&&h.dynamic&&T)for(let L=h.dynamic.length-1;L>=0;L--){const R=h.dynamic[L],{prefix:j,suffix:F}=R;if(j||F){const K=R.caseSensitive?T:A??=T.toLowerCase();if(j&&!K.startsWith(j)||F&&!K.endsWith(F))continue}i.push({node:R,index:m+1,skipped:p,depth:y+1,statics:g,dynamics:b+1,optionals:x,extract:k,rawParams:_,parsedParams:S})}if(!w&&h.staticInsensitive){const L=h.staticInsensitive.get(A??=T.toLowerCase());L&&i.push({node:L,index:m+1,skipped:p,depth:y+1,statics:g+1,dynamics:b,optionals:x,extract:k,rawParams:_,parsedParams:S})}if(!w&&h.static){const L=h.static.get(T);L&&i.push({node:L,index:m+1,skipped:p,depth:y+1,statics:g+1,dynamics:b,optionals:x,extract:k,rawParams:_,parsedParams:S})}if(h.pathless){const L=y+1;for(let R=h.pathless.length-1;R>=0;R--){const j=h.pathless[R];i.push({node:j,index:m,skipped:p,depth:L,statics:g,dynamics:b,optionals:x,extract:k,rawParams:_,parsedParams:S})}}}if(l&&c)return lf(c,l)?l:c;if(l)return l;if(c)return c;if(r&&u){let d=u.index;for(let m=0;m<u.index;m++)d+=t[m].length;const h=d===e.length?"/":e.slice(d);return u.rawParams??={},u.rawParams["**"]=decodeURIComponent(h),u}return null}function Hk(e,t,n){try{const[r,s]=Kj(e,t,n);n.rawParams=r,n.extract=s;const a=n.node.parse(r);return n.parsedParams=Object.assign({},n.parsedParams,a),!0}catch{return null}}function lf(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Pc)>(e.node.kind===Pc)||t.node.kind===Pc==(e.node.kind===Pc)&&t.depth>e.depth))):!0}function Ab(e){return uT(e.filter(t=>t!==void 0).join("/"))}function uT(e){return e.replace(/\/{2,}/g,"/")}function Wj(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function vi(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function Yj(e){return vi(Wj(e))}function xy(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function HK(e,t,n){return xy(e,n)===xy(t,n)}function qK({base:e,to:t,trailingSlash:n="never",cache:r}){const s=t.startsWith("/"),a=!s&&t===".";let o;if(r){o=s?t:a?e:e+"\0"+t;const d=r.get(o);if(d)return d}let i;if(a)i=e.split("/");else if(s)i=t.split("/");else{for(i=e.split("/");i.length>1&&Hh(i)==="";)i.pop();const d=t.split("/");for(let h=0,m=d.length;h<m;h++){const p=d[h];p===""?h?h===m-1&&i.push(p):i=[p]:p===".."?i.pop():p==="."||i.push(p)}}i.length>1&&(Hh(i)===""?n==="never"&&i.pop():n==="always"&&i.push(""));let c,u="";for(let d=0;d<i.length;d++){d>0&&(u+="/");const h=i[d];if(!h)continue;c=iT(h,0,c);const m=c[0];if(m===ql){u+=h;continue}const p=c[5],y=h.substring(0,c[1]),g=h.substring(c[4],p),b=h.substring(c[2],c[3]);m===tu?u+=y||g?`${y}{$${b}}${g}`:`$${b}`:m===nu?u+=y||g?`${y}{$}${g}`:"$":u+=`${y}{-$${b}}${g}`}u=uT(u);const l=u||"/";return o&&r&&r.set(o,l),l}function VK(e){const t=new Map(e.map(s=>[encodeURIComponent(s),s])),n=Array.from(t.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return s=>s.replace(r,a=>t.get(a)??a)}function qk(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>BA(s,n)).join("/"):BA(r,n)}function FA({path:e,params:t,decoder:n,...r}){let s=!1;const a={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:a,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:a,isMissingParams:s};const o=e.length;let i=0,c,u="";for(;i<o;){const d=i;c=iT(e,d,c);const h=c[5];if(i=h+1,d===h)continue;const m=c[0];if(m===ql){u+="/"+e.substring(d,h);continue}if(m===nu){const p=t._splat;a._splat=p,a["*"]=p;const y=e.substring(d,c[1]),g=e.substring(c[4],h);if(!p){s=!0,(y||g)&&(u+="/"+y+g);continue}const b=qk("_splat",t,n);u+="/"+y+b+g;continue}if(m===tu){const p=e.substring(c[2],c[3]);!s&&!(p in t)&&(s=!0),a[p]=t[p];const y=e.substring(d,c[1]),g=e.substring(c[4],h),b=qk(p,t,n)??"undefined";u+="/"+y+b+g;continue}if(m===Vh){const p=e.substring(c[2],c[3]),y=t[p];if(y==null)continue;a[p]=y;const g=e.substring(d,c[1]),b=e.substring(c[4],h),x=qk(p,t,n)??"";u+="/"+g+x+b;continue}}return e.endsWith("/")&&(u+="/"),{usedParams:a,interpolatedPath:u||"/",isMissingParams:s}}function BA(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function Qr(e){return!!e?.isNotFound}function GK(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const sw="tsr-scroll-restoration-v1_3",KK=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function WK(){const e=GK();if(!e)return null;const t=e.getItem(sw);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=di(r,n)||n;try{e.setItem(sw,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Up=WK(),YK=e=>e.state.__TSR_key||e.href;function JK(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let ky=!1;function QK({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:s,location:a}){let o;try{o=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(u){console.error(u);return}const i=t||window.history.state?.__TSR_key,c=o[i];ky=!0;e:{if(r&&c&&Object.keys(c).length>0){for(const d in c){const h=c[d];if(d==="window")window.scrollTo({top:h.scrollY,left:h.scrollX,behavior:n});else if(d){const m=document.querySelector(d);m&&(m.scrollLeft=h.scrollX,m.scrollTop=h.scrollY)}}break e}const u=(a??window.location).hash.split("#",2)[1];if(u){const d=window.history.state?.__hashScrollIntoViewOptions??!0;if(d){const h=document.getElementById(u);h&&h.scrollIntoView(d)}break e}const l={top:0,left:0,behavior:n};if(window.scrollTo(l),s)for(const d of s){if(d==="window")continue;const h=typeof d=="function"?d():document.querySelector(d);h&&h.scrollTo(l)}}ky=!1}function XK(e,t){if(!Up||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Up))return;e.isScrollRestorationSetup=!0,ky=!1;const r=e.options.getScrollRestorationKey||YK;window.history.scrollRestoration="manual";const s=a=>{if(ky||!e.isScrollRestoring)return;let o="";if(a.target===document||a.target===window)o="window";else{const c=a.target.getAttribute("data-scroll-restoration-id");c?o=`[data-scroll-restoration-id="${c}"]`:o=JK(a.target)}const i=r(e.state.location);Up.set(c=>{const u=c[i]||={},l=u[o]||={};if(o==="window")l.scrollX=window.scrollX||0,l.scrollY=window.scrollY||0;else if(o){const d=document.querySelector(o);d&&(l.scrollX=d.scrollLeft||0,l.scrollY=d.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",KK(s,100),!0),e.subscribe("onRendered",a=>{const o=r(a.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(QK({storageKey:sw,key:o,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Up.set(i=>(i[o]||={},i)))})}function ZK(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function eW(e,t=String){const n=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&n.set(r,t(s))}return n.toString()}function Vk(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function tW(e){const t=new URLSearchParams(e),n={};for(const[r,s]of t.entries()){const a=n[r];a==null?n[r]=Vk(s):Array.isArray(a)?a.push(Vk(s)):n[r]=[a,Vk(s)]}return n}const nW=sW(JSON.parse),rW=aW(JSON.stringify,JSON.parse);function sW(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=tW(t);for(const r in n){const s=n[r];if(typeof s=="string")try{n[r]=e(s)}catch{}}return n}}function aW(e,t){const n=typeof t=="function";function r(s){if(typeof s=="object"&&s!==null)try{return e(s)}catch{}else if(n&&typeof s=="string")try{return t(s),e(s)}catch{}return s}return s=>{const a=eW(s,r);return a?`?${a}`:""}}const Os="__root__";function oW(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function ps(e){return e instanceof Response&&!!e.options}const aw=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},y1=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Il=(e,t,n=!0)=>{const r={...e.router.options.context??{}},s=n?t:t-1;for(let a=0;a<=s;a++){const o=e.matches[a];if(!o)continue;const i=e.router.getMatch(o.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},UA=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(o=>o.routeId===e.router.routeTree.id),s=r>=0?r:0;let a=n?e.matches.findIndex(o=>o.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=s);for(let o=a;o>=0;o--){const i=e.matches[o];if(e.router.looseRoutesById[i.routeId].options.notFoundComponent)return o}return n?a:s},fi=(e,t,n)=>{if(!(!ps(n)&&!Qr(n)))throw ps(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:ps(n)?"redirected":r.status==="pending"?"success":r.status,context:Il(e,t.index),isFetching:!1,error:n})),Qr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),ps(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},Jj=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,df=(e,t,n,r)=>{const{id:s,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,fi(e,e.router.getMatch(s),n);try{o.options.onError?.(n)}catch(i){n=i,fi(e,e.router.getMatch(s),n)}e.updateMatch(s,i=>(i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,i._nonReactive.loadPromise?.resolve(),{...i,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!ps(n)&&!Qr(n)&&(e.serialError??=n)},Qj=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const s=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!y1(e,t)&&(n.options.loader||n.options.beforeLoad||Zj(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const o=setTimeout(()=>{aw(e)},s);r._nonReactive.pendingTimeout=o}},iW=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Qj(e,t,n,r);const s=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&fi(e,a,a.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(s):s()},cW=(e,t,n,r)=>{const s=e.router.getMatch(t),a=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Hl(()=>{a?.resolve()});const{paramsError:o,searchError:i}=s;o&&df(e,n,o,"PARSE_PARAMS"),i&&df(e,n,i,"VALIDATE_SEARCH"),Qj(e,t,r,s);const c=new AbortController;let u=!1;const l=()=>{u||(u=!0,e.updateMatch(t,_=>({..._,isFetching:"beforeLoad",fetchCount:_.fetchCount+1,abortController:c})))},d=()=>{s._nonReactive.beforeLoadPromise?.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,_=>({..._,isFetching:!1}))};if(!r.options.beforeLoad){ih(()=>{l(),d()});return}s._nonReactive.beforeLoadPromise=Hl();const h={...Il(e,n,!1),...s.__routeContext},{search:m,params:p,cause:y}=s,g=y1(e,t),b={search:m,abortController:c,params:p,preload:g,context:h,location:e.location,navigate:_=>e.router.navigate({..._,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?"preload":y,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},x=_=>{if(_===void 0){ih(()=>{l(),d()});return}(ps(_)||Qr(_))&&(l(),df(e,n,_,"BEFORE_LOAD")),ih(()=>{l(),e.updateMatch(t,S=>({...S,__beforeLoadContext:_})),d()})};let k;try{if(k=r.options.beforeLoad(b),qh(k))return l(),k.catch(_=>{df(e,n,_,"BEFORE_LOAD")}).then(x)}catch(_){l(),df(e,n,_,"BEFORE_LOAD")}x(k)},uW=(e,t)=>{const{id:n,routeId:r}=e.matches[t],s=e.router.looseRoutesById[r],a=()=>i(),o=()=>cW(e,n,t,s),i=()=>{if(Jj(e,n))return;const c=iW(e,n,s);return qh(c)?c.then(o):o()};return a()},lW=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const s={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(s),n.options.scripts?.(s),n.options.headers?.(s)]).then(([a,o,i])=>{const c=a?.meta,u=a?.links,l=a?.scripts,d=a?.styles;return{meta:c,links:u,headScripts:l,headers:i,scripts:o,styles:d}})},Xj=(e,t,n,r,s)=>{const a=t[r-1],{params:o,loaderDeps:i,abortController:c,cause:u}=e.router.getMatch(n),l=Il(e,r),d=y1(e,n);return{params:o,deps:i,preload:!!d,parentMatchPromise:a,abortController:c,context:l,location:e.location,navigate:h=>e.router.navigate({...h,_fromLocation:e.location}),cause:d?"preload":u,route:s,...e.router.options.additionalContext}},zA=async(e,t,n,r,s)=>{try{const a=e.router.getMatch(n);try{(!(TK??e.router.isServer)||a.ssr===!0)&&vy(s);const o=s.options.loader?.(Xj(e,t,n,r,s)),i=s.options.loader&&qh(o);if((i||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,l=>({...l,isFetching:"loader"})),s.options.loader){const l=i?await o:o;fi(e,e.router.getMatch(n),l),l!==void 0&&e.updateMatch(n,d=>({...d,loaderData:l}))}s._lazyPromise&&await s._lazyPromise;const u=a._nonReactive.minPendingPromise;u&&await u,s._componentsPromise&&await s._componentsPromise,e.updateMatch(n,l=>({...l,error:void 0,context:Il(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(o){let i=o;if(i?.name==="AbortError"){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,u=>({...u,status:u.status==="pending"?"success":u.status,isFetching:!1,context:Il(e,r)}));return}const c=a._nonReactive.minPendingPromise;c&&await c,Qr(o)&&await s.options.notFoundComponent?.preload?.(),fi(e,e.router.getMatch(n),o);try{s.options.onError?.(o)}catch(u){i=u,fi(e,e.router.getMatch(n),u)}e.updateMatch(n,u=>({...u,error:i,context:Il(e,r),status:"error",isFetching:!1}))}}catch(a){const o=e.router.getMatch(n);o&&(o._nonReactive.loaderPromise=void 0),fi(e,o,a)}},dW=async(e,t,n)=>{async function r(d,h,m,p){const y=Date.now()-h.updatedAt,g=d?p.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:p.options.staleTime??e.router.options.defaultStaleTime??0,b=p.options.shouldReload,x=typeof b=="function"?b(Xj(e,t,s,n,p)):b,{status:k,invalid:_}=m;o=k==="success"&&(_||(x??y>g)),d&&p.options.preload===!1||(o&&!e.sync?(i=!0,(async()=>{try{await zA(e,t,s,n,p);const S=e.router.getMatch(s);S._nonReactive.loaderPromise?.resolve(),S._nonReactive.loadPromise?.resolve(),S._nonReactive.loaderPromise=void 0}catch(S){ps(S)&&await e.router.navigate(S.options)}})()):(k!=="success"||o&&e.sync)&&await zA(e,t,s,n,p))}const{id:s,routeId:a}=e.matches[n];let o=!1,i=!1;const c=e.router.looseRoutesById[a];if(!Jj(e,s)){const d=e.router.getMatch(s),h=y1(e,s);if(d._nonReactive.loaderPromise){if(d.status==="success"&&!e.sync&&!d.preload)return d;await d._nonReactive.loaderPromise;const m=e.router.getMatch(s),p=m._nonReactive.error||m.error;p&&fi(e,m,p),m.status==="pending"&&await r(h,d,m,c)}else{const m=h&&!e.router.state.matches.some(y=>y.id===s),p=e.router.getMatch(s);p._nonReactive.loaderPromise=Hl(),m!==p.preload&&e.updateMatch(s,y=>({...y,preload:m})),await r(h,d,p,c)}}const u=e.router.getMatch(s);i||(u._nonReactive.loaderPromise?.resolve(),u._nonReactive.loadPromise?.resolve()),clearTimeout(u._nonReactive.pendingTimeout),u._nonReactive.pendingTimeout=void 0,i||(u._nonReactive.loaderPromise=void 0),u._nonReactive.dehydrated=void 0;const l=i?u.isFetching:!1;return l!==u.isFetching||u.invalid!==!1?(e.updateMatch(s,d=>({...d,isFetching:l,invalid:!1})),e.router.getMatch(s)):u};async function HA(e){const t=e,n=[];t.router.state.matches.some(h=>h._forcePending)&&aw(t);let r;for(let h=0;h<t.matches.length;h++){try{const m=uW(t,h);qh(m)&&await m}catch(m){if(ps(m))throw m;if(Qr(m))r=m;else if(!t.preload)throw m;break}if(t.serialError)break}const s=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?UA(t,r):void 0,o=r&&t.preload?0:a!==void 0?Math.min(a+1,s):s;let i,c;for(let h=0;h<o;h++)n.push(dW(t,n,h));try{await Promise.all(n)}catch{const h=await Promise.allSettled(n);for(const m of h){if(m.status!=="rejected")continue;const p=m.reason;if(ps(p))throw p;Qr(p)?i??=p:c??=p}if(c!==void 0)throw c}const u=i??(r&&!t.preload?r:void 0);let l=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!u&&r&&t.preload)return t.matches;if(u){const h=UA(t,u);Pi(h!==void 0);const m=t.matches[h],p=t.router.looseRoutesById[m.routeId],y=t.router.options?.defaultNotFoundComponent;!p.options.notFoundComponent&&y&&(p.options.notFoundComponent=y),u.routeId=m.routeId;const g=m.routeId===t.router.routeTree.id;t.updateMatch(m.id,b=>({...b,...g?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:u},isFetching:!1})),l=h,await vy(p)}else if(!t.preload){const h=t.matches[0];h.globalNotFound||t.router.getMatch(h.id)?.globalNotFound&&t.updateMatch(h.id,p=>({...p,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const h=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await vy(h)}for(let h=0;h<=l;h++){const m=t.matches[h],{id:p,routeId:y}=m,g=t.router.looseRoutesById[y];try{const b=lW(t,p,g);if(b){const x=await b;t.updateMatch(p,k=>({...k,...x}))}}catch(b){console.error(`Error executing head for route ${y}:`,b)}}const d=aw(t);if(qh(d)&&await d,u)throw u;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}async function vy(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const r of eM){const s=e.options[r]?.preload;s&&n.push(s())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function Zj(e){for(const t of eM)if(e.options[t]?.preload)return!0;return!1}const eM=["component","errorComponent","pendingComponent","notFoundComponent"];function fW(e){return{input:({url:t})=>{for(const n of e)t=ow(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=tM(e[n],t);return t}}}function hW(e){const t=Yj(e.basepath),n=`/${t}`,r=`${n}/`,s=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:o})=>{const i=e.caseSensitive?o.pathname:o.pathname.toLowerCase();return i===s?o.pathname="/":i.startsWith(a)&&(o.pathname=o.pathname.slice(n.length)),o},output:({url:o})=>(o.pathname=Ab(["/",t,o.pathname]),o)}}function ow(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function tM(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Vc(e){const t=e.resolvedLocation,n=e.location,r=t?.pathname!==n.pathname,s=t?.href!==n.href,a=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:r,hrefChanged:s,hashChanged:a}}function mW(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}class pW{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{const r=this.options,s=this.basepath??r?.basepath??"/",a=this.basepath===void 0,o=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=VK(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=_K()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let h;this.resolvePathCache=yy(1e3),h=this.buildRouteTree(),this.setRoutes(h)}!this.__store&&this.latestLocation&&(this.__store=vK(bW(this.latestLocation)),XK(this));let i=!1;const c=this.options.basepath??"/",u=this.options.rewrite;if(a||s!==c||o!==u){this.basepath=c;const h=[],m=Yj(c);m&&m!=="/"&&h.push(hW({basepath:c})),u&&h.push(u),this.rewrite=h.length===0?void 0:h.length===1?h[0]:fW(h),this.history&&this.updateLatestLocation(),i=!0}i&&this.__store&&this.__store.setState(h=>({...h,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=FK(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&LK(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const s={eventType:n,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const s=({pathname:c,search:u,hash:l,href:d,state:h})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const x=this.options.parseSearch(u),k=this.options.stringifySearch(x);return{href:c+k+l,publicHref:d,pathname:uf(c).path,external:!1,searchStr:k,search:ls(r?.search,x),hash:uf(l.slice(1)).path,state:ls(r?.state,h)}}const m=new URL(d,this.origin),p=ow(this.rewrite,m),y=this.options.parseSearch(p.search),g=this.options.stringifySearch(y);return p.search=g,{href:p.href.replace(p.origin,""),publicHref:d,pathname:uf(p.pathname).path,external:!!this.rewrite&&p.origin!==this.origin,searchStr:g,search:ls(r?.search,y),hash:uf(p.hash.slice(1)).path,state:ls(r?.state,h)}},a=s(n),{__tempLocation:o,__tempKey:i}=a.state;if(o&&(!i||i===this.tempLocationKey)){const c=s(o);return c.state.key=a.state.key,c.state.__TSR_key=a.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:a}}return a},this.resolvePathWithBase=(n,r)=>qK({base:n,to:uT(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,s)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},s):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>yW({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(a=>a.status==="pending"),r=this.state.matches.filter(a=>a.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...r]).forEach(a=>{this.cancelMatch(a.id)})},this.buildLocation=n=>{const r=(a={})=>{const o=a._fromLocation||this.pendingBuiltLocation||this.latestLocation,i=this.matchRoutesLightweight(o);a.from;const c=a.unsafeRelative==="path"?o.pathname:a.from??i.fullPath,u=this.resolvePathWithBase(c,"."),l=i.search,d={...i.params},h=a.to?this.resolvePathWithBase(u,`${a.to}`):this.resolvePathWithBase(u,"."),m=a.params===!1||a.params===null?{}:(a.params??!0)===!0?d:Object.assign(d,di(a.params,d)),p=this.getMatchedRoutes(h);let y=p.matchedRoutes;if((!p.foundRoute||p.foundRoute.path!=="/"&&p.routeParams["**"])&&this.options.notFoundRoute&&(y=[...y,this.options.notFoundRoute]),Object.keys(m).length>0)for(const j of y){const F=j.options.params?.stringify??j.options.stringifyParams;if(F)try{Object.assign(m,F(m))}catch{}}const b=n.leaveParams?h:uf(FA({path:h,params:m,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let x=l;if(n._includeValidateSearch&&this.options.search?.strict){const j={};y.forEach(F=>{if(F.options.validateSearch)try{Object.assign(j,Nb(F.options.validateSearch,{...j,...x}))}catch{}}),x=j}x=xW({search:x,dest:a,destRoutes:y,_includeValidateSearch:n._includeValidateSearch}),x=ls(l,x);const k=this.options.stringifySearch(x),_=a.hash===!0?o.hash:a.hash?di(a.hash,o.hash):void 0,S=_?`#${_}`:"";let w=a.state===!0?o.state:a.state?di(a.state,o.state):{};w=ls(o.state,w);const T=`${b}${k}${S}`;let A,L,R=!1;if(this.rewrite){const j=new URL(T,this.origin),F=tM(this.rewrite,j);A=j.href.replace(j.origin,""),F.origin!==this.origin?(L=F.href,R=!0):L=F.pathname+F.search+F.hash}else A=RK(T),L=A;return{publicHref:L,href:A,pathname:b,search:x,searchStr:k,state:w,hash:_??"",external:R,unmaskOnReload:a.unmaskOnReload}},s=(a={},o)=>{const i=r(a);let c=o?r(o):void 0;if(!c){const u={};if(this.options.routeMasks){const l=$K(i.pathname,this.processedTree);if(l){Object.assign(u,l.rawParams);const{from:d,params:h,...m}=l.route,p=h===!1||h===null?{}:(h??!0)===!0?u:Object.assign(u,di(h,u));o={from:n.from,...m,params:p},c=r(o)}}}return c&&(i.maskedLocation=c),i};return n.mask?s(n,{from:n.from,...n.mask}):s(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...s})=>{const a=()=>{const c=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];c.forEach(l=>{s.state[l]=this.latestLocation.state[l]});const u=qc(s.state,this.latestLocation.state);return c.forEach(l=>{delete s.state[l]}),u},o=vi(this.latestLocation.href)===vi(s.href),i=this.commitLocationPromise;if(this.commitLocationPromise=Hl(()=>{i?.resolve()}),o&&a())this.load();else{let{maskedLocation:c,hashScrollIntoView:u,...l}=s;c&&(l={...c,state:{...c.state,__tempKey:void 0,__tempLocation:{...l,search:l.searchStr,state:{...l.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(l.unmaskOnReload??this.options.unmaskOnReload??!1)&&(l.state.__tempKey=this.tempLocationKey)),l.state.__hashScrollIntoViewOptions=u??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[s.replace?"replace":"push"](l.publicHref,l.state,{ignoreBlocker:r})}return this.resetNextScroll=s.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:s,viewTransition:a,ignoreBlocker:o,href:i,...c}={})=>{if(i){const d=this.history.location.state.__TSR_index,h=py(i,{__TSR_index:n?d:d+1}),m=new URL(h.pathname,this.origin),p=ow(this.rewrite,m);c.to=p.pathname,c.search=this.options.parseSearch(h.search),c.hash=h.hash.slice(1)}const u=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=u;const l=this.commitLocation({...u,viewTransition:a,replace:n,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:o});return Promise.resolve().then(()=>{this.pendingBuiltLocation===u&&(this.pendingBuiltLocation=void 0)}),l},this.navigate=async({to:n,reloadDocument:r,href:s,publicHref:a,...o})=>{let i=!1;if(s)try{new URL(`${s}`),i=!0}catch{}if(i&&!r&&(r=!0),r){if(n!==void 0||!s){const u=this.buildLocation({to:n,...o});s=s??u.publicHref,a=a??u.publicHref}const c=!i&&a?a:s;if(by(c,this.protocolAllowlist))return Promise.resolve();if(!o.ignoreBlocker){const l=this.history.getBlockers?.()??[];for(const d of l)if(d?.blockerFn&&await d.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return o.replace?window.location.replace(c):window.location.href=c,Promise.resolve()}return this.buildAndCommitLocation({...o,href:s,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:r.cachedMatches.filter(s=>!n.some(a=>a.id===s.id))}))},this.load=async n=>{let r,s,a;for(a=new Promise(i=>{this.startTransition(async()=>{try{this.beforeLoad();const c=this.latestLocation,u=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Vc({resolvedLocation:u,location:c})}),this.emit({type:"onBeforeLoad",...Vc({resolvedLocation:u,location:c})}),await HA({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:c,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let l=[],d=[],h=[],m=[];ih(()=>{this.__store.setState(p=>{const y=p.matches,g=p.pendingMatches||p.matches;return l=y.filter(b=>!g.some(x=>x.id===b.id)),d=y.filter(b=>!g.some(x=>x.routeId===b.routeId)),h=g.filter(b=>!y.some(x=>x.routeId===b.routeId)),m=g.filter(b=>y.some(x=>x.routeId===b.routeId)),{...p,isLoading:!1,loadedAt:Date.now(),matches:g,pendingMatches:void 0,cachedMatches:[...p.cachedMatches,...l.filter(b=>b.status!=="error"&&b.status!=="notFound"&&b.status!=="redirected")]}}),this.clearExpiredCache()}),[[d,"onLeave"],[h,"onEnter"],[m,"onStay"]].forEach(([p,y])=>{p.forEach(g=>{this.looseRoutesById[g.routeId].options[y]?.(g)})})})})}})}catch(c){ps(c)?(r=c,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):Qr(c)&&(s=c),this.__store.setState(u=>({...u,statusCode:r?r.status:s?404:u.matches.some(l=>l.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===a&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),i()})}),this.latestLoadPromise=a,await a;this.latestLoadPromise&&a!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.__store.state.matches.some(i=>i.status==="error")&&(o=500),o!==void 0&&this.__store.setState(i=>({...i,statusCode:o}))},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const a=this.latestLocation,o=this.state.resolvedLocation,i=typeof r.types=="function"?r.types(Vc({resolvedLocation:o,location:a})):r.types;if(i===!1){n();return}s={update:n,types:i}}else s=n;document.startViewTransition(s)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const s=this.state.pendingMatches?.some(a=>a.id===n)?"pendingMatches":this.state.matches.some(a=>a.id===n)?"matches":this.state.cachedMatches.some(a=>a.id===n)?"cachedMatches":"";s&&(s==="cachedMatches"?this.__store.setState(a=>({...a,cachedMatches:mW(a.cachedMatches.map(o=>o.id===n?r(o):o))})):this.__store.setState(a=>({...a,[s]:a[s]?.map(o=>o.id===n?r(o):o)})))})},this.getMatch=n=>{const r=s=>s.id===n;return this.state.cachedMatches.find(r)??this.state.pendingMatches?.find(r)??this.state.matches.find(r)},this.invalidate=n=>{const r=s=>n?.filter?.(s)??!0?{...s,invalid:!0,...n?.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s;return this.__store.setState(s=>({...s,matches:s.matches.map(r),cachedMatches:s.cachedMatches.map(r),pendingMatches:s.pendingMatches?.map(r)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const s=n.options._builtLocation??this.buildLocation(n.options),a=this.getParsedLocationHref(s);n.options.href=a,n.headers.set("Location",a)}else if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const a=s.pathname+s.search+s.hash;n.options.href=a,n.headers.set("Location",a)}}catch{}if(n.options.href&&!n.options._builtLocation&&by(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.__store.setState(s=>({...s,cachedMatches:s.cachedMatches.filter(a=>!r(a))})):this.__store.setState(s=>({...s,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=r=>{const s=this.looseRoutesById[r.routeId];if(!s.options.loader)return!0;const a=(r.preload?s.options.preloadGcTime??this.options.defaultPreloadGcTime:s.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=a};this.clearCache({filter:n})},this.loadRouteChunk=vy,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let s=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const a=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(i=>i.id)),o=new Set([...a,...this.state.cachedMatches.map(i=>i.id)]);ih(()=>{s.forEach(i=>{o.has(i.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,i]}))})});try{return s=await HA({router:this,matches:s,location:r,preload:!0,updateMatch:(i,c)=>{a.has(i)?s=s.map(u=>u.id===i?c(u):u):this.updateMatch(i,c)}}),s}catch(i){if(ps(i))return i.options.reloadDocument?void 0:await this.preloadRoute({...i.options,_fromLocation:r});Qr(i)||console.error(i);return}},this.matchRoute=(n,r)=>{const s={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},a=this.buildLocation(s);if(r?.pending&&this.state.status!=="pending")return!1;const i=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,c=jK(a.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,i.pathname,this.processedTree);return!c||n.params&&!qc(c.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?qc(i.search,a.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??rW,parseSearch:t.parseSearch??nW,protocolAllowlist:t.protocolAllowlist??NK}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:n,processedTree:r}){this.routesById=t,this.routesByPath=n,this.processedTree=r;const s=this.options.notFoundRoute;s&&(s.init({originalIndex:99999999999}),this.routesById[s.id]=s)}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,n){const r=this.getMatchedRoutes(t.pathname),{foundRoute:s,routeParams:a,parsedParams:o}=r;let{matchedRoutes:i}=r,c=!1;(s?s.path!=="/"&&a["**"]:vi(t.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:c=!0);const u=c?vW(this.options.notFoundMode,i):void 0,l=new Array(i.length),d=new Map(this.state.matches.map(h=>[h.routeId,h]));for(let h=0;h<i.length;h++){const m=i[h],p=l[h-1];let y,g,b;{const Y=p?.search??t.search,W=p?._strictSearch??void 0;try{const J=Nb(m.options.validateSearch,{...Y})??void 0;y={...Y,...J},g={...W,...J},b=void 0}catch(J){let ae=J;if(J instanceof Sy||(ae=new Sy(J.message,{cause:J})),n?.throwOnError)throw ae;y=Y,g={},b=ae}}const x=m.options.loaderDeps?.({search:y})??"",k=x?JSON.stringify(x):"",{interpolatedPath:_,usedParams:S}=FA({path:m.fullPath,params:a,decoder:this.pathParamsDecoder,server:this.isServer}),w=m.id+_+k,T=this.getMatch(w),A=d.get(m.id),L=T?._strictParams??S;let R;if(!T)try{qA(m,S,o,L)}catch(Y){if(Qr(Y)||ps(Y)?R=Y:R=new gW(Y.message,{cause:Y}),n?.throwOnError)throw R}Object.assign(a,L);const j=A?"stay":"enter";let F;if(T)F={...T,cause:j,params:A?.params??a,_strictParams:L,search:ls(A?A.search:T.search,y),_strictSearch:g};else{const Y=m.options.loader||m.options.beforeLoad||m.lazyFn||Zj(m)?"pending":"success";F={id:w,ssr:m.options.ssr,index:h,routeId:m.id,params:A?.params??a,_strictParams:L,pathname:_,updatedAt:Date.now(),search:A?ls(A.search,y):y,_strictSearch:g,searchError:void 0,status:Y,isFetching:!1,error:void 0,paramsError:R,__routeContext:void 0,_nonReactive:{loadPromise:Hl()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:j,loaderDeps:A?ls(A.loaderDeps,x):x,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}n?.preload||(F.globalNotFound=u===m.id),F.searchError=b;const K=this.getParentContext(p);F.context={...K,...F.__routeContext,...F.__beforeLoadContext},l[h]=F}for(let h=0;h<l.length;h++){const m=l[h],p=this.looseRoutesById[m.routeId],y=this.getMatch(m.id),g=d.get(m.routeId);if(m.params=g?ls(g.params,a):a,!y){const b=l[h-1],x=this.getParentContext(b);if(p.options.context){const k={deps:m.loaderDeps,params:m.params,context:x??{},location:t,navigate:_=>this.navigate({..._,_fromLocation:t}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:l,routeId:p.id};m.__routeContext=p.options.context(k)??void 0}m.context={...x,...m.__routeContext,...m.__beforeLoadContext}}}return l}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:r,parsedParams:s}=this.getMatchedRoutes(t.pathname),a=Hh(n),o={...t.search};for(const l of n)try{Object.assign(o,Nb(l.options.validateSearch,o))}catch{}const i=Hh(this.state.matches),c=i&&i.routeId===a.id&&t.pathname===this.state.location.pathname;let u;if(c)u=i.params;else{const l={...r};for(const d of n)try{qA(d,r,s??{},l)}catch{}u=l}return{matchedRoutes:n,fullPath:a.fullPath,search:o,params:u}}}class Sy extends Error{}class gW extends Error{}function bW(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Nb(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Sy("Async validation not supported");if(n.issues)throw new Sy(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function yW({pathname:e,routesById:t,processedTree:n}){const r={},s=vi(e);let a,o;const i=MK(s,n,!0);return i&&(a=i.route,Object.assign(r,i.rawParams),o=Object.assign({},i.parsedParams)),{matchedRoutes:i?.branch||[t[Os]],routeParams:r,foundRoute:a,parsedParams:o}}function xW({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return kW(n)(e,t,r??!1)}function kW(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const s of e){if("search"in s.options)s.options.search?.middlewares&&t.middlewares.push(...s.options.search.middlewares);else if(s.options.preSearchFilters||s.options.postSearchFilters){const a=({search:o,next:i})=>{let c=o;"preSearchFilters"in s.options&&s.options.preSearchFilters&&(c=s.options.preSearchFilters.reduce((l,d)=>d(l),o));const u=i(c);return"postSearchFilters"in s.options&&s.options.postSearchFilters?s.options.postSearchFilters.reduce((l,d)=>d(l),u):u};t.middlewares.push(a)}if(s.options.validateSearch){const a=({search:o,next:i})=>{const c=i(o);if(!t._includeValidateSearch)return c;try{return{...c,...Nb(s.options.validateSearch,c)??void 0}}catch{return c}};t.middlewares.push(a)}}const n=({search:s})=>{const a=t.dest;return a.search?a.search===!0?s:di(a.search,s):{}};t.middlewares.push(n);const r=(s,a,o)=>{if(s>=o.length)return a;const i=o[s];return i({search:a,next:u=>r(s+1,u,o)})};return function(a,o,i){return t.dest=o,t._includeValidateSearch=i,r(0,a,t.middlewares)}}function vW(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return Os}function qA(e,t,n,r){const s=e.options.params?.parse??e.options.parseParams;if(s)if(e.options.skipRouteOnParseError)for(const a in t)a in n&&(r[a]=n[a]);else{const a=s(r);Object.assign(r,a)}}const SW="Error preloading route! ☝️";class nM{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const r=this.options,s=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),s?this._path=Os:this.parentRoute||Pi(!1);let a=s?Os:r?.path;a&&a!=="/"&&(a=Wj(a));const o=r?.id||a;let i=s?Os:Ab([this.parentRoute.id===Os?"":this.parentRoute.id,o]);a===Os&&(a="/"),i!==Os&&(i=Ab(["/",i]));const c=i===Os?"/":Ab([this.parentRoute.fullPath,a]);this._path=a,this._id=i,this._fullPath=c,this._to=vi(c)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>oW({from:this.fullPath,...n}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class wW extends nM{constructor(t){super(t)}}var E=rT();const Vl=p1(E),rM=oK({__proto__:null,default:Vl},[E]),zp=typeof window<"u"?E.useLayoutEffect:E.useEffect;function Gk(e){const t=E.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function _W(e,t,n={},r={}){E.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const s=new IntersectionObserver(([a])=>{t(a)},n);return s.observe(e.current),()=>{s.disconnect()}},[t,n,r.disabled,e])}function EW(e){const t=E.useRef(null);return E.useImperativeHandle(e,()=>t.current,[]),t}function lT(e){const t=e.errorComponent??dT;return f.jsx(TW,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?E.createElement(t,{error:n,reset:r}):e.children})}class TW extends E.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function dT({error:e}){const[t,n]=E.useState(!1);return f.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),f.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),f.jsx("div",{style:{height:".25rem"}}),t?f.jsx("div",{children:f.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?f.jsx("code",{children:e.message}):null})}):null]})}function CW({children:e,fallback:t=null}){return sM()?f.jsx(Vl.Fragment,{children:e}):f.jsx(Vl.Fragment,{children:t})}function sM(){return Vl.useSyncExternalStore(IW,()=>!0,()=>!1)}function IW(){return()=>{}}var Kk={exports:{}},Wk={},Yk={exports:{}},Jk={};var VA;function AW(){if(VA)return Jk;VA=1;var e=rT();function t(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function i(d,h){var m=h(),p=r({inst:{value:m,getSnapshot:h}}),y=p[0].inst,g=p[1];return a(function(){y.value=m,y.getSnapshot=h,c(y)&&g({inst:y})},[d,m,h]),s(function(){return c(y)&&g({inst:y}),d(function(){c(y)&&g({inst:y})})},[d]),o(m),m}function c(d){var h=d.getSnapshot;d=d.value;try{var m=h();return!n(d,m)}catch{return!0}}function u(d,h){return h()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:i;return Jk.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,Jk}var GA;function aM(){return GA||(GA=1,Yk.exports=AW()),Yk.exports}var KA;function NW(){if(KA)return Wk;KA=1;var e=rT(),t=aM();function n(u,l){return u===l&&(u!==0||1/u===1/l)||u!==u&&l!==l}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,i=e.useMemo,c=e.useDebugValue;return Wk.useSyncExternalStoreWithSelector=function(u,l,d,h,m){var p=a(null);if(p.current===null){var y={hasValue:!1,value:null};p.current=y}else y=p.current;p=i(function(){function b(w){if(!x){if(x=!0,k=w,w=h(w),m!==void 0&&y.hasValue){var T=y.value;if(m(T,w))return _=T}return _=w}if(T=_,r(k,w))return T;var A=h(w);return m!==void 0&&m(T,A)?(k=w,T):(k=w,_=A)}var x=!1,k,_,S=d===void 0?null:d;return[function(){return b(l())},S===null?void 0:function(){return b(S())}]},[l,d,h,m]);var g=s(u,p[0],p[1]);return o(function(){y.hasValue=!0,y.value=g},[g]),c(g),g},Wk}var WA;function RW(){return WA||(WA=1,Kk.exports=NW()),Kk.exports}var oM=RW();function PW(e,t){return e===t}function OW(e,t,n=PW){const r=E.useCallback(o=>{if(!e)return()=>{};const{unsubscribe:i}=e.subscribe(o);return i},[e]),s=E.useCallback(()=>e?.get(),[e]);return oM.useSyncExternalStoreWithSelector(r,s,s,t,n)}const iM=E.createContext(null);function Ts(e){const t=E.useContext(iM);return e?.warn,t}function Xr(e){const t=Ts({warn:e?.router===void 0}),n=e?.router||t,r=E.useRef(void 0);return OW(n.__store,s=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const a=ls(r.current,e.select(s));return r.current=a,a}return e.select(s)}return s})}const x1=E.createContext(void 0),LW=E.createContext(void 0);function Ja(e){const t=E.useContext(e.from?LW:x1);return Xr({select:r=>{const s=r.matches.find(a=>e.from?e.from===a.routeId:a.id===t);if(Pi(!((e.shouldThrow??!0)&&!s),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),s!==void 0)return e.select?e.select(s):s},structuralSharing:e.structuralSharing})}function fT(e){return Ja({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function hT(e){const{select:t,...n}=e;return Ja({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function mT(e){return Ja({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function pT(e){return Ja({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Gl(e){const t=Ts();return E.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var wu=sK();function $W(e,t){const n=Ts(),r=EW(t),{activeProps:s,inactiveProps:a,activeOptions:o,to:i,preload:c,preloadDelay:u,hashScrollIntoView:l,replace:d,startTransition:h,resetScroll:m,viewTransition:p,children:y,target:g,disabled:b,style:x,className:k,onClick:_,onBlur:S,onFocus:w,onMouseEnter:T,onMouseLeave:A,onTouchStart:L,ignoreBlocker:R,params:j,search:F,hash:K,state:Y,mask:W,reloadDocument:J,unsafeRelative:ae,from:ge,_fromLocation:le,...I}=e,U=sM(),V=Xr({select:te=>{const ue=te.matches[te.matches.length-1];return{search:ue?.search,hash:te.location.hash,path:ue?.pathname}},structuralSharing:!0}),N=e.from,P=E.useMemo(()=>({...e,from:N}),[n,V,N,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),D=E.useMemo(()=>n.buildLocation({...P}),[n,P]),Q=D.maskedLocation?D.maskedLocation.publicHref:D.publicHref,pe=D.maskedLocation?D.maskedLocation.external:D.external,ce=E.useMemo(()=>UW(Q,pe,n.history,b),[b,pe,Q,n.history]),Ee=E.useMemo(()=>{if(ce?.external)return by(ce.href,n.protocolAllowlist)?void 0:ce.href;if(!zW(i)&&!(typeof i!="string"||i.indexOf(":")===-1))try{return new URL(i),by(i,n.protocolAllowlist)?void 0:i}catch{}},[i,ce,n.protocolAllowlist]),Ne=Xr({select:te=>{if(Ee)return!1;if(o?.exact){if(!HK(te.location.pathname,D.pathname,n.basepath))return!1}else{const ue=xy(te.location.pathname,n.basepath),$e=xy(D.pathname,n.basepath);if(!(ue.startsWith($e)&&(ue.length===$e.length||ue[$e.length]==="/")))return!1}return(o?.includeSearch??!0)&&!qc(te.location.search,D.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?U&&te.location.hash===D.hash:!0}}),G=Ne?di(s,{})??jW:Qk,X=Ne?Qk:di(a,{})??Qk,ee=[k,G.className,X.className].filter(Boolean).join(" "),oe=(x||G.style||X.style)&&{...x,...G.style,...X.style},[be,Oe]=E.useState(!1),fe=E.useRef(!1),ve=e.reloadDocument||Ee?!1:c??n.options.defaultPreload,ze=u??n.options.defaultPreloadDelay??0,Se=E.useCallback(()=>{n.preloadRoute({...P,_builtLocation:D}).catch(te=>{console.warn(te),console.warn(SW)})},[n,P,D]),re=E.useCallback(te=>{te?.isIntersecting&&Se()},[Se]);_W(r,re,BW,{disabled:!!b||ve!=="viewport"}),E.useEffect(()=>{fe.current||!b&&ve==="render"&&(Se(),fe.current=!0)},[b,Se,ve]);const Ie=te=>{const ue=te.currentTarget.getAttribute("target"),$e=g!==void 0?g:ue;if(!b&&!HW(te)&&!te.defaultPrevented&&(!$e||$e==="_self")&&te.button===0){te.preventDefault(),wu.flushSync(()=>{Oe(!0)});const we=n.subscribe("onResolved",()=>{we(),Oe(!1)});n.navigate({...P,replace:d,resetScroll:m,hashScrollIntoView:l,startTransition:h,viewTransition:p,ignoreBlocker:R})}};if(Ee)return{...I,ref:r,href:Ee,...y&&{children:y},...g&&{target:g},...b&&{disabled:b},...x&&{style:x},...k&&{className:k},..._&&{onClick:_},...S&&{onBlur:S},...w&&{onFocus:w},...T&&{onMouseEnter:T},...A&&{onMouseLeave:A},...L&&{onTouchStart:L}};const We=te=>{if(b||ve!=="intent")return;if(!ze){Se();return}const ue=te.currentTarget;if(ff.has(ue))return;const $e=setTimeout(()=>{ff.delete(ue),Se()},ze);ff.set(ue,$e)},Ft=te=>{b||ve!=="intent"||Se()},an=te=>{if(b||!ve||!ze)return;const ue=te.currentTarget,$e=ff.get(ue);$e&&(clearTimeout($e),ff.delete(ue))};return{...I,...G,...X,href:ce?.href,ref:r,onClick:Uu([_,Ie]),onBlur:Uu([S,an]),onFocus:Uu([w,We]),onMouseEnter:Uu([T,We]),onMouseLeave:Uu([A,an]),onTouchStart:Uu([L,Ft]),disabled:!!b,target:g,...oe&&{style:oe},...ee&&{className:ee},...b&&MW,...Ne&&DW,...U&&be&&FW}}const Qk={},jW={className:"active"},MW={role:"link","aria-disabled":!0},DW={"data-status":"active","aria-current":"page"},FW={"data-transitioning":"transitioning"},ff=new WeakMap,BW={rootMargin:"100px"},Uu=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function UW(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function zW(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const bs=E.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:s,...a}=$W(r,t),o=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;if(!n){const{disabled:i,...c}=a;return E.createElement("a",c,o)}return E.createElement(n,a,o)});function HW(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class qW extends nM{constructor(t){super(t),this.useMatch=n=>Ja({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ja({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>pT({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>mT({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>hT({...n,from:this.id}),this.useLoaderData=n=>fT({...n,from:this.id}),this.useNavigate=()=>Gl({from:this.fullPath}),this.Link=Vl.forwardRef((n,r)=>f.jsx(bs,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function wd(e){return new qW(e)}class VW extends wW{constructor(t){super(t),this.useMatch=n=>Ja({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ja({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>pT({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>mT({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>hT({...n,from:this.id}),this.useLoaderData=n=>fT({...n,from:this.id}),this.useNavigate=()=>Gl({from:this.fullPath}),this.Link=Vl.forwardRef((n,r)=>f.jsx(bs,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function GW(e){return new VW(e)}function YA(e){return typeof e=="object"?new JA(e,{silent:!0}).createRoute(e):new JA(e,{silent:!0}).createRoute}class JA{constructor(t,n){this.path=t,this.createRoute=r=>{const s=wd(r);return s.isRoot=!1,s},this.silent=n?.silent}}class QA{constructor(t){this.useMatch=n=>Ja({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ja({from:this.options.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>pT({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>mT({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>hT({...n,from:this.options.id}),this.useLoaderData=n=>fT({...n,from:this.options.id}),this.useNavigate=()=>{const n=Ts();return Gl({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function XA(e){return typeof e=="object"?new QA(e):t=>new QA({id:e,...t})}function KW(){const e=Ts(),t=E.useRef({router:e,mounted:!1}),[n,r]=E.useState(!1),{hasPendingMatches:s,isLoading:a}=Xr({select:d=>({isLoading:d.isLoading,hasPendingMatches:d.matches.some(h=>h.status==="pending")}),structuralSharing:!0}),o=Gk(a),i=a||n||s,c=Gk(i),u=a||s,l=Gk(u);return e.startTransition=d=>{r(!0),E.startTransition(()=>{d(),r(!1)})},E.useEffect(()=>{const d=e.history.subscribe(e.load),h=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return vi(e.latestLocation.publicHref)!==vi(h.publicHref)&&e.commitLocation({...h,replace:!0}),()=>{d()}},[e,e.history]),zp(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(h){console.error(h)}})()},[e]),zp(()=>{o&&!a&&e.emit({type:"onLoad",...Vc(e.state)})},[o,e,a]),zp(()=>{l&&!u&&e.emit({type:"onBeforeRouteMount",...Vc(e.state)})},[u,l,e]),zp(()=>{if(c&&!i){const d=Vc(e.state);e.emit({type:"onResolved",...d}),e.__store.setState(h=>({...h,status:"idle",resolvedLocation:h.location})),d.hrefChanged&&ZK(e)}},[i,c,e]),null}function WW(e){const t=Xr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return f.jsx(lT,{getResetKey:()=>t,onCatch:(n,r)=>{if(Qr(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(Qr(n))return e.fallback?.(n);throw n},children:e.children})}function YW(){return f.jsx("p",{children:"Not Found"})}function ol(e){return f.jsx(f.Fragment,{children:e.children})}function cM(e,t,n){return t.options.notFoundComponent?f.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?f.jsx(e.options.defaultNotFoundComponent,{...n}):f.jsx(YW,{})}function JW(){return Ts().isScrollRestoring,null}const uM=E.memo(function({matchId:t}){const n=Ts(),r=Xr({select:y=>{const g=y.matches.findIndex(x=>x.id===t),b=y.matches[g];return Pi(b),{routeId:b.routeId,ssr:b.ssr,_displayPending:b._displayPending,resetKey:y.loadedAt,parentRouteId:y.matches[g-1]?.routeId}},structuralSharing:!0}),s=n.routesById[r.routeId],a=s.options.pendingComponent??n.options.defaultPendingComponent,o=a?f.jsx(a,{}):null,i=s.options.errorComponent??n.options.defaultErrorComponent,c=s.options.onCatch??n.options.defaultOnCatch,u=s.isRoot?s.options.notFoundComponent??n.options.notFoundRoute?.options.component:s.options.notFoundComponent,l=r.ssr===!1||r.ssr==="data-only",d=(!s.isRoot||s.options.wrapInSuspense||l)&&(s.options.wrapInSuspense??a??(s.options.errorComponent?.preload||l))?E.Suspense:ol,h=i?lT:ol,m=u?WW:ol,p=s.isRoot?s.options.shellComponent??ol:ol;return f.jsxs(p,{children:[f.jsx(x1.Provider,{value:t,children:f.jsx(d,{fallback:o,children:f.jsx(h,{getResetKey:()=>r.resetKey,errorComponent:i||dT,onCatch:(y,g)=>{if(Qr(y))throw y;c?.(y,g)},children:f.jsx(m,{fallback:y=>{if(!u||y.routeId&&y.routeId!==r.routeId||!y.routeId&&!s.isRoot)throw y;return E.createElement(u,y)},children:l||r._displayPending?f.jsx(CW,{fallback:o,children:f.jsx(ZA,{matchId:t})}):f.jsx(ZA,{matchId:t})})})})}),r.parentRouteId===Os&&n.options.scrollRestoration?f.jsxs(f.Fragment,{children:[f.jsx(QW,{}),f.jsx(JW,{})]}):null]})});function QW(){const e=Ts(),t=E.useRef(void 0);return f.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Vc(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const ZA=E.memo(function({matchId:t}){const n=Ts(),{match:r,key:s,routeId:a}=Xr({select:c=>{const u=c.matches.find(p=>p.id===t),l=u.routeId,h=(n.routesById[l].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:l,loaderDeps:u.loaderDeps,params:u._strictParams,search:u._strictSearch});return{key:h?JSON.stringify(h):void 0,routeId:l,match:{id:u.id,status:u.status,error:u.error,invalid:u.invalid,_forcePending:u._forcePending,_displayPending:u._displayPending}}},structuralSharing:!0}),o=n.routesById[a],i=E.useMemo(()=>{const c=o.options.component??n.options.defaultComponent;return c?f.jsx(c,{},s):f.jsx(lM,{})},[s,o.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const c=o.options.pendingMinMs??n.options.defaultPendingMinMs;if(c){const u=n.getMatch(r.id);if(u&&!u._nonReactive.minPendingPromise){const l=Hl();u._nonReactive.minPendingPromise=l,setTimeout(()=>{l.resolve(),u._nonReactive.minPendingPromise=void 0},c)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return Pi(Qr(r.error)),cM(n,o,r.error);if(r.status==="redirected")throw Pi(ps(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return i}),lM=E.memo(function(){const t=Ts(),n=E.useContext(x1),r=Xr({select:u=>u.matches.find(l=>l.id===n)?.routeId}),s=t.routesById[r],a=Xr({select:u=>{const d=u.matches.find(h=>h.id===n);return Pi(d),d.globalNotFound}}),o=Xr({select:u=>{const l=u.matches,d=l.findIndex(h=>h.id===n);return l[d+1]?.id}}),i=t.options.defaultPendingComponent?f.jsx(t.options.defaultPendingComponent,{}):null;if(a)return cM(t,s,void 0);if(!o)return null;const c=f.jsx(uM,{matchId:o});return r===Os?f.jsx(E.Suspense,{fallback:i,children:c}):c});function XW(){const e=Ts(),n=e.routesById[Os].options.pendingComponent??e.options.defaultPendingComponent,r=n?f.jsx(n,{}):null,s=typeof document<"u"&&e.ssr?ol:E.Suspense,a=f.jsxs(s,{fallback:r,children:[f.jsx(KW,{}),f.jsx(ZW,{})]});return e.options.InnerWrap?f.jsx(e.options.InnerWrap,{children:a}):a}function ZW(){const e=Ts(),t=Xr({select:s=>s.matches[0]?.id}),n=Xr({select:s=>s.loadedAt}),r=t?f.jsx(uM,{matchId:t}):null;return f.jsx(x1.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:f.jsx(lT,{getResetKey:()=>n,errorComponent:dT,onCatch:void 0,children:r})})}function eY(){const e=Ts();return Xr({select:t=>[t.location.href,t.resolvedLocation?.href,t.status],structuralSharing:!0}),E.useCallback(t=>{const{pending:n,caseSensitive:r,fuzzy:s,includeSearch:a,...o}=t;return e.matchRoute(o,{pending:n,caseSensitive:r,fuzzy:s,includeSearch:a})},[e])}const tY=e=>new nY(e);class nY extends pW{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=YA,globalThis.createLazyFileRoute=XA):typeof window<"u"&&(window.createFileRoute=YA,window.createLazyFileRoute=XA);function rY({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=f.jsx(iM.Provider,{value:e,children:t});return e.options.Wrap?f.jsx(e.options.Wrap,{children:r}):r}function sY({router:e,...t}){return f.jsx(rY,{router:e,...t,children:f.jsx(XW,{})})}function aY(e){return Xr({select:t=>t.location})}const oY=e=>typeof e=="function",O=function(e,t){if(typeof e=="function")return function(){return e(arguments)?t.apply(this,arguments):n=>t(n,...arguments)};switch(e){case 0:case 1:throw new RangeError(`Invalid arity ${e}`);case 2:return function(n,r){return arguments.length>=2?t(n,r):function(s){return t(s,n)}};case 3:return function(n,r,s){return arguments.length>=3?t(n,r,s):function(a){return t(a,n,r)}};case 4:return function(n,r,s,a){return arguments.length>=4?t(n,r,s,a):function(o){return t(o,n,r,s)}};case 5:return function(n,r,s,a,o){return arguments.length>=5?t(n,r,s,a,o):function(i){return t(i,n,r,s,a)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);const n=arguments;return function(r){return t(r,...n)}}}},Qe=e=>e,k1=e=>()=>e,eN=k1(!0),Po=k1(!1),dM=k1(void 0),Kl=dM;function B(e,t,n,r,s,a,o,i,c){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return s(r(n(t(e))));case 6:return a(s(r(n(t(e)))));case 7:return o(a(s(r(n(t(e))))));case 8:return i(o(a(s(r(n(t(e)))))));case 9:return c(i(o(a(s(r(n(t(e))))))));default:{let u=arguments[0];for(let l=1;l<arguments.length;l++)u=arguments[l](u);return u}}}const tN="effect/GlobalValue";let hf;const Ve=(e,t)=>(hf||(globalThis[tN]??=new Map,hf=globalThis[tN]),hf.has(e)||hf.set(e,t()),hf.get(e)),jn=e=>typeof e=="string",ba=e=>typeof e=="number",ru=e=>typeof e=="boolean",v1=e=>typeof e=="bigint",iw=e=>typeof e=="symbol",_d=oY,iY=e=>e===void 0,cY=e=>!1,gT=e=>typeof e=="object"&&e!==null,ya=e=>gT(e)||_d(e),Be=O(2,(e,t)=>ya(e)&&t in e),fM=O(2,(e,t)=>Be(e,"_tag")&&e._tag===t),zu=e=>e==null,uY=e=>e!=null,lY=e=>e instanceof Uint8Array,dY=e=>e instanceof Date,hM=e=>typeof e=="string"||Be(e,Symbol.iterator),Gh=e=>gT(e)&&!Array.isArray(e),fY=e=>Be(e,"then")&&_d(e.then),S1=e=>`BUG: ${e} - please report an issue at https://github.com/Effect-TS/effect/issues`;let mM=class pM{self;called=!1;constructor(t){this.self=t}next(t){return this.called?{value:t,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(t){return{value:t,done:!0}}throw(t){throw t}[Symbol.iterator](){return new pM(this.self)}};const hY=335903614,mY=4150755663,pY=1481765933,gY=1284865837,bY=9007199254740992,yY=134217728;class xY{_state;constructor(t,n,r,s){return zu(n)&&zu(t)?(n=Math.random()*4294967295>>>0,t=0):zu(n)&&(n=t,t=0),zu(s)&&zu(r)?(s=this._state?this._state[3]:mY,r=this._state?this._state[2]:hY):zu(s)&&(s=r,r=0),this._state=new Int32Array([0,0,r>>>0,((s||0)|1)>>>0]),this._next(),nN(this._state,this._state[0],this._state[1],t>>>0,n>>>0),this._next(),this}getState(){return[this._state[0],this._state[1],this._state[2],this._state[3]]}setState(t){this._state[0]=t[0],this._state[1]=t[1],this._state[2]=t[2],this._state[3]=t[3]|1}integer(t){return Math.round(this.number()*Number.MAX_SAFE_INTEGER)%t}number(){const t=(this._next()&67108863)*1,n=(this._next()&134217727)*1;return(t*yY+n)/bY}_next(){const t=this._state[0]>>>0,n=this._state[1]>>>0;kY(this._state,t,n,pY,gY),nN(this._state,this._state[0],this._state[1],this._state[2],this._state[3]);let r=t>>>18,s=(n>>>18|t<<14)>>>0;r=(r^t)>>>0,s=(s^n)>>>0;const a=(s>>>27|r<<5)>>>0,o=t>>>27,i=(-o>>>0&31)>>>0;return(a>>>o|a<<i)>>>0}}function kY(e,t,n,r,s){let a=(n>>>16)*(s&65535)>>>0,o=(n&65535)*(s>>>16)>>>0,i=(n&65535)*(s&65535)>>>0,c=(n>>>16)*(s>>>16)+((o>>>16)+(a>>>16))>>>0;o=o<<16>>>0,i=i+o>>>0,i>>>0<o>>>0&&(c=c+1>>>0),a=a<<16>>>0,i=i+a>>>0,i>>>0<a>>>0&&(c=c+1>>>0),c=c+Math.imul(n,r)>>>0,c=c+Math.imul(t,s)>>>0,e[0]=c,e[1]=i}function nN(e,t,n,r,s){let a=t+r>>>0;const o=n+s>>>0;o>>>0<n>>>0&&(a=a+1|0),e[0]=a,e[1]=o}const cw=Symbol.for("effect/Utils/YieldWrap");class $m{#e;constructor(t){this.#e=t}[cw](){return this.#e}}function vY(e){if(typeof e=="object"&&e!==null&&cw in e)return e[cw]();throw new Error(S1("yieldWrapGet"))}const As=Ve("effect/Utils/isStructuralRegion",()=>({enabled:!1,tester:void 0})),gM={effect_internal_function:e=>e()},SY={effect_internal_function:e=>e()},wY=gM.effect_internal_function(()=>new Error().stack)?.includes("effect_internal_function")===!0,ir=wY?gM.effect_internal_function:SY.effect_internal_function,Xk=Ve(Symbol.for("effect/Hash/randomHashCache"),()=>new WeakMap),Xe=Symbol.for("effect/Hash"),Pe=e=>{if(As.enabled===!0)return 0;switch(typeof e){case"number":return yT(e);case"bigint":return Wt(e.toString(10));case"boolean":return Wt(String(e));case"symbol":return Wt(String(e));case"string":return Wt(e);case"undefined":return Wt("undefined");case"function":case"object":return e===null?Wt("null"):e instanceof Date?Number.isNaN(e.getTime())?Wt("Invalid Date"):Pe(e.toISOString()):e instanceof URL?Pe(e.href):_Y(e)?e[Xe]():bT(e);default:throw new Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},bT=e=>(Xk.has(e)||Xk.set(e,yT(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER))),Xk.get(e)),tt=e=>t=>t*53^e,w1=e=>e&3221225471|e>>>1&1073741824,_Y=e=>Be(e,Xe),yT=e=>{if(e!==e||e===1/0)return 0;let t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)t^=e/=4294967295;return w1(t)},Wt=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return w1(t)},EY=(e,t)=>{let n=12289;for(let r=0;r<t.length;r++)n^=B(Wt(t[r]),tt(Pe(e[t[r]])));return w1(n)},bM=e=>EY(e,Object.keys(e)),Ed=e=>{let t=6151;for(let n=0;n<e.length;n++)t=B(t,tt(Pe(e[n])));return w1(t)},Mt=function(){if(arguments.length===1){const n=arguments[0];return function(r){return Object.defineProperty(n,Xe,{value(){return r},enumerable:!1}),r}}const e=arguments[0],t=arguments[1];return Object.defineProperty(e,Xe,{value(){return t},enumerable:!1}),t},Ze=Symbol.for("effect/Equal");function Fe(){return arguments.length===1?e=>wy(e,arguments[0]):wy(arguments[0],arguments[1])}function wy(e,t){if(e===t)return!0;const n=typeof e;if(n!==typeof t)return!1;if(n==="object"||n==="function"){if(e!==null&&t!==null){if(Kh(e)&&Kh(t))return Pe(e)===Pe(t)&&e[Ze](t)?!0:As.enabled&&As.tester?As.tester(e,t):!1;if(e instanceof Date&&t instanceof Date){const r=e.getTime(),s=t.getTime();return r===s||Number.isNaN(r)&&Number.isNaN(s)}else if(e instanceof URL&&t instanceof URL)return e.href===t.href}if(As.enabled){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((r,s)=>wy(r,t[s]));if(Object.getPrototypeOf(e)===Object.prototype&&Object.getPrototypeOf(t)===Object.prototype){const r=Object.keys(e),s=Object.keys(t);if(r.length===s.length){for(const a of r)if(!(a in t&&wy(e[a],t[a])))return As.tester?As.tester(e,t):!1;return!0}}return As.tester?As.tester(e,t):!1}}return As.enabled&&As.tester?As.tester(e,t):!1}const Kh=e=>Be(e,Ze),xT=()=>Fe,xt=Symbol.for("nodejs.util.inspect.custom"),en=e=>{try{if(Be(e,"toJSON")&&_d(e.toJSON)&&e.toJSON.length===0)return e.toJSON();if(Array.isArray(e))return e.map(en)}catch{return{}}return kT(e)},Zk="[Circular]";function TY(e){try{return e.toISOString()}catch{return"Invalid Date"}}function CY(e){try{const t=e.toString();return typeof t=="string"?t:String(t)}catch{return"[toString threw]"}}function jm(e){return jn(e)?JSON.stringify(e):String(e)}function Uo(e,t){const n=new WeakSet,r=(o,i)=>{const c=o?.constructor;return c&&c!==Object.prototype.constructor&&c.name?`${c.name}(${i})`:i},s=o=>{try{return Reflect.ownKeys(o)}catch{return["[ownKeys threw]"]}};function a(o,i=0){if(Array.isArray(o))return n.has(o)?Zk:(n.add(o),`[${o.map(c=>a(c,i)).join(",")}]`);if(dY(o))return TY(o);if(Be(o,"toString")&&_d(o.toString)&&o.toString!==Object.prototype.toString&&o.toString!==Array.prototype.toString){const c=CY(o);return o instanceof Error&&o.cause?`${c} (cause: ${a(o.cause,i)})`:c}if(jn(o))return JSON.stringify(o);if(ba(o)||o==null||ru(o)||iw(o))return String(o);if(v1(o))return String(o)+"n";if(o instanceof Set||o instanceof Map)return n.has(o)?Zk:(n.add(o),`${o.constructor.name}(${a(Array.from(o),i)})`);if(ya(o)){if(n.has(o))return Zk;n.add(o);const c=s(o);{const u=`{${c.map(l=>`${jm(l)}:${a(o[l],i)}`).join(",")}}`;return r(o,u)}}return String(o)}return a(e,0)}const zt=e=>JSON.stringify(e,null,2),_1={toJSON(){return en(this)},[xt](){return this.toJSON()},toString(){return zt(this.toJSON())}};let IY=class{[xt](){return this.toJSON()}toString(){return zt(this.toJSON())}};const Wl=(e,t=2)=>{if(typeof e=="string")return e;try{return typeof e=="object"?yM(e,t):String(e)}catch{return String(e)}},yM=(e,t)=>{let n=[];const r=JSON.stringify(e,(s,a)=>typeof a=="object"&&a!==null?n.includes(a)?void 0:n.push(a)&&(Gc.fiberRefs!==void 0&&xM(a)?a[E1](Gc.fiberRefs):a):a,t);return n=void 0,r},E1=Symbol.for("effect/Inspectable/Redactable"),xM=e=>typeof e=="object"&&e!==null&&E1 in e,Gc=Ve("effect/Inspectable/redactableState",()=>({fiberRefs:void 0})),AY=(e,t)=>{const n=Gc.fiberRefs;Gc.fiberRefs=e;try{return t()}finally{Gc.fiberRefs=n}},kT=e=>xM(e)&&Gc.fiberRefs!==void 0?e[E1](Gc.fiberRefs):e,je=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let r=0,s=t.length;r<s;r++)n=t[r](n);return n}}},ch="Async",T1="Commit",Qn="Failure",Rb="OnFailure",_y="OnSuccess",Ey="OnSuccessAndFailure",Xn="Success",kM="Sync",NY="Tag",Td="UpdateRuntimeFlags",Ty="While",uh="Iterator",vM="WithRuntime",Pb="Yield",vT="RevertFlags";let RY="3.19.19";const ST=()=>RY,PY=Symbol.for("effect/Effect"),OY=Symbol.for("effect/Stream"),LY=Symbol.for("effect/Sink"),$Y=Symbol.for("effect/Channel"),Yl={_R:e=>e,_E:e=>e,_A:e=>e,_V:ST()},jY={_A:e=>e,_In:e=>e,_L:e=>e,_E:e=>e,_R:e=>e},MY={_Env:e=>e,_InErr:e=>e,_InElem:e=>e,_InDone:e=>e,_OutErr:e=>e,_OutElem:e=>e,_OutDone:e=>e},Mm={[PY]:Yl,[OY]:Yl,[LY]:jY,[$Y]:MY,[Ze](e){return this===e},[Xe](){return Mt(this,bT(this))},[Symbol.iterator](){return new mM(new $m(this))},pipe(){return je(this,arguments)}},C1={[Xe](){return Mt(this,bM(this))},[Ze](e){const t=Object.keys(this),n=Object.keys(e);if(t.length!==n.length)return!1;for(const r of t)if(!(r in e&&Fe(this[r],e[r])))return!1;return!0}},Dm={...Mm,_op:T1},DY={...Dm,...C1},FY=(function(){function e(){}return e.prototype=Dm,e})(),SM=Symbol.for("effect/Option"),wM={...Mm,[SM]:{_A:e=>e},[xt](){return this.toJSON()},toString(){return zt(this.toJSON())}},BY=Object.assign(Object.create(wM),{_tag:"Some",_op:"Some",[Ze](e){return _M(e)&&TM(e)&&Fe(this.value,e.value)},[Xe](){return Mt(this,tt(Pe(this._tag))(Pe(this.value)))},toJSON(){return{_id:"Option",_tag:this._tag,value:en(this.value)}}}),UY=Pe("None"),zY=Object.assign(Object.create(wM),{_tag:"None",_op:"None",[Ze](e){return _M(e)&&EM(e)},[Xe](){return UY},toJSON(){return{_id:"Option",_tag:this._tag}}}),_M=e=>Be(e,SM),EM=e=>e._tag==="None",TM=e=>e._tag==="Some",I1=Object.create(zY),Wh=e=>{const t=Object.create(BY);return t.value=e,t},CM=Symbol.for("effect/Context/Tag"),Cy=Symbol.for("effect/Context/Reference"),HY="effect/STM",qY=Symbol.for(HY),wT={...Mm,_op:"Tag",[qY]:Yl,[CM]:{_Service:e=>e,_Identifier:e=>e},toString(){return zt(this.toJSON())},toJSON(){return{_id:"Tag",key:this.key,stack:this.stack}},[xt](){return this.toJSON()},of(e){return e},context(e){return RM(this,e)}},VY={...wT,[Cy]:Cy},GY=e=>{const t=Error.stackTraceLimit;Error.stackTraceLimit=2;const n=new Error;Error.stackTraceLimit=t;const r=Object.create(wT);return Object.defineProperty(r,"stack",{get(){return n.stack}}),r.key=e,r},KY=e=>()=>{const t=Error.stackTraceLimit;Error.stackTraceLimit=2;const n=new Error;Error.stackTraceLimit=t;function r(){}return Object.setPrototypeOf(r,wT),r.key=e,Object.defineProperty(r,"stack",{get(){return n.stack}}),r},WY=()=>(e,t)=>{const n=Error.stackTraceLimit;Error.stackTraceLimit=2;const r=new Error;Error.stackTraceLimit=n;function s(){}return Object.setPrototypeOf(s,VY),s.key=e,s.defaultValue=t.defaultValue,Object.defineProperty(s,"stack",{get(){return r.stack}}),s},IM=Symbol.for("effect/Context"),YY={[IM]:{_Services:e=>e},[Ze](e){if(AM(e)&&this.unsafeMap.size===e.unsafeMap.size){for(const t of this.unsafeMap.keys())if(!e.unsafeMap.has(t)||!Fe(this.unsafeMap.get(t),e.unsafeMap.get(t)))return!1;return!0}return!1},[Xe](){return Mt(this,yT(this.unsafeMap.size))},pipe(){return je(this,arguments)},toString(){return zt(this.toJSON())},toJSON(){return{_id:"Context",services:Array.from(this.unsafeMap).map(en)}},[xt](){return this.toJSON()}},Oi=e=>{const t=Object.create(YY);return t.unsafeMap=e,t},JY=e=>{const t=new Error(`Service not found${e.key?`: ${String(e.key)}`:""}`);if(e.stack){const n=e.stack.split(`
|
|
3
|
-
`);if(n.length>2){const r=n[2].match(/at (.*)/);r&&(t.message=t.message+` (defined at ${r[1]})`)}}if(t.stack){const n=t.stack.split(`
|
|
4
|
-
`);n.splice(1,3),t.stack=n.join(`
|
|
5
|
-
`)}return t},AM=e=>Be(e,IM),QY=e=>Be(e,CM),NM=e=>Be(e,Cy),XY=Oi(new Map),ZY=()=>XY,RM=(e,t)=>Oi(new Map([[e.key,t]])),eJ=O(3,(e,t,n)=>{const r=new Map(e.unsafeMap);return r.set(t.key,n),Oi(r)}),ev=Ve("effect/Context/defaultValueCache",()=>new Map),A1=e=>{if(ev.has(e.key))return ev.get(e.key);const t=e.defaultValue();return ev.set(e.key,t),t},tJ=(e,t)=>e.unsafeMap.has(t.key)?e.unsafeMap.get(t.key):A1(t),PM=O(2,(e,t)=>{if(!e.unsafeMap.has(t.key)){if(Cy in t)return A1(t);throw JY(t)}return e.unsafeMap.get(t.key)}),nJ=PM,rJ=O(3,(e,t,n)=>e.unsafeMap.has(t.key)?e.unsafeMap.get(t.key):NM(t)?A1(t):n()),sJ=O(2,(e,t)=>e.unsafeMap.has(t.key)?Wh(e.unsafeMap.get(t.key)):NM(t)?Wh(A1(t)):I1),aJ=O(2,(e,t)=>{const n=new Map(e.unsafeMap);for(const[r,s]of t.unsafeMap)n.set(r,s);return Oi(n)}),oJ=(...e)=>{const t=new Map;for(let n=0;n<e.length;n++)e[n].unsafeMap.forEach((r,s)=>{t.set(s,r)});return Oi(t)},Hi=GY,iJ=Oi,cJ=AM,OM=QY,xa=ZY,_T=RM,ds=eJ,fa=nJ,mf=rJ,LM=PM,qi=sJ,Zr=aJ,uJ=oJ,br=KY,_u=WY,ET=e=>(t,n)=>t===n||e(t,n),lJ=O(2,(e,t)=>ET((n,r)=>e(t(n),t(r)))),dJ=e=>ET((t,n)=>{if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!e(t[r],n[r]))return!1;return!0}),TT=Symbol.for("effect/Either"),$M={...Mm,[TT]:{_R:e=>e},[xt](){return this.toJSON()},toString(){return zt(this.toJSON())}},fJ=Object.assign(Object.create($M),{_tag:"Right",_op:"Right",[Ze](e){return CT(e)&&jM(e)&&Fe(this.right,e.right)},[Xe](){return tt(Pe(this._tag))(Pe(this.right))},toJSON(){return{_id:"Either",_tag:this._tag,right:en(this.right)}}}),hJ=Object.assign(Object.create($M),{_tag:"Left",_op:"Left",[Ze](e){return CT(e)&&IT(e)&&Fe(this.left,e.left)},[Xe](){return tt(Pe(this._tag))(Pe(this.left))},toJSON(){return{_id:"Either",_tag:this._tag,left:en(this.left)}}}),CT=e=>Be(e,TT),IT=e=>e._tag==="Left",jM=e=>e._tag==="Right",mJ=e=>{const t=Object.create(hJ);return t.left=e,t},pJ=e=>{const t=Object.create(fJ);return t.right=e,t},gJ=e=>IT(e)?I1:Wh(e.right),bJ=TT,nt=pJ,Ye=mJ,yJ=e=>{if(_d(e))try{return nt(e())}catch(t){return Ye(t)}else try{return nt(e.try())}catch(t){return Ye(e.catch(t))}},xJ=CT,ar=IT,Ua=jM,kJ=O(2,(e,t)=>ar(e)?Ye(t(e.left)):nt(e.right)),vJ=O(2,(e,t)=>Ua(e)?nt(t(e.right)):Ye(e.left)),Yr=O(2,(e,{onLeft:t,onRight:n})=>ar(e)?t(e.left):n(e.right)),SJ=Yr({onLeft:Qe,onRight:Qe}),MM=O(2,(e,t)=>{if(Ua(e))return e.right;throw t(e.left)}),DM=MM(()=>new Error("getOrThrow called on a Left")),FM=e=>e.length>0,BM=e=>(t,n)=>t===n?0:e(t,n),wJ=BM((e,t)=>e<t?-1:1),UM=O(2,(e,t)=>BM((n,r)=>e(t(n),t(r)))),_J=e=>O(2,(t,n)=>e(t,n)===1),EJ=Symbol.for("effect/Option"),ye=()=>I1,Ce=Wh,Cn=EM,Et=TM,yn=O(2,(e,{onNone:t,onSome:n})=>Cn(e)?t():n(e.value)),TJ=gJ,Yt=O(2,(e,t)=>Cn(e)?t():e.value),Ga=O(2,(e,t)=>Cn(e)?t():e),CJ=O(2,(e,t)=>Cn(e)?Ce(t()):e),Cd=e=>e==null?ye():Ce(e),jr=Yt(dM),IJ=e=>(...t)=>{try{return Ce(e(...t))}catch{return ye()}},zM=O(2,(e,t)=>{if(Et(e))return e.value;throw t()}),AJ=zM(()=>new Error("getOrThrow called on a None")),Jr=O(2,(e,t)=>Cn(e)?ye():Ce(t(e.value))),Vi=O(2,(e,t)=>Cn(e)?ye():t(e.value)),HM=O(2,(e,t)=>Cn(e)?ye():Cd(t(e.value))),NJ=Vi,qM=O(2,(e,t)=>NJ(e,n=>t(n)?Wh(n):I1)),RJ=e=>O(2,(t,n)=>Cn(t)?!1:e(t.value,n)),PJ=xT(),OJ=RJ(PJ),LJ=O(2,(e,t)=>Cn(e)?!1:t(e.value)),$J=(...e)=>e,jJ=()=>({}),MJ=e=>VM(e).length===0,DJ=O(2,(e,t)=>Object.prototype.hasOwnProperty.call(e,t)),pl=O(2,(e,t)=>{const n={...e};for(const r of VM(e))n[r]=t(e[r],r);return n}),VM=e=>Object.keys(e),FJ=O(3,(e,t,n)=>({...e,[t]:n})),N1=e=>new Array(e),BJ=O(2,(e,t)=>{const n=Math.max(1,Math.floor(e)),r=new Array(n);for(let s=0;s<n;s++)r[s]=t(s);return r}),Ct=e=>Array.isArray(e)?e:Array.from(e),UJ=e=>Array.isArray(e)?e:[e],zJ=O(2,(e,{onEmpty:t,onNonEmpty:n})=>sn(e)?n(e):t()),HJ=O(2,(e,{onEmpty:t,onNonEmpty:n})=>sn(e)?n(zr(e),su(e)):t()),Iy=O(2,(e,t)=>[t,...e]),qJ=O(2,(e,t)=>[...e,t]),AT=O(2,(e,t)=>Ct(e).concat(Ct(t))),VJ=Array.isArray,GJ=e=>e.length===0,KJ=GJ,Al=FM,sn=FM,GM=(e,t)=>e<0||e>=t.length,WJ=(e,t)=>Math.floor(Math.min(Math.max(0,e),t.length)),YJ=O(2,(e,t)=>{const n=Math.floor(t);return GM(n,e)?ye():Ce(e[n])}),KM=O(2,(e,t)=>{const n=Math.floor(t);if(GM(n,e))throw new Error(`Index ${n} out of bounds`);return e[n]}),lh=YJ(0),zr=KM(0),JJ=e=>sn(e)?Ce(WM(e)):ye(),WM=e=>e[e.length-1],su=e=>e.slice(1),QJ=(e,t)=>{let n=0;for(const r of e){if(!t(r,n))break;n++}return n},XJ=O(2,(e,t)=>YM(e,QJ(e,t))),ZJ=O(2,(e,t)=>{const n=Ct(e);return n.slice(WJ(t,n),n.length)}),rN=e=>Array.from(e).reverse(),Yh=O(2,(e,t)=>{const n=Array.from(e);return n.sort(t),n}),sN=O(2,(e,t)=>eQ(e,t,$J)),eQ=O(3,(e,t,n)=>{const r=Ct(e),s=Ct(t);if(sn(r)&&sn(s)){const a=[n(zr(r),zr(s))],o=Math.min(r.length,s.length);for(let i=1;i<o;i++)a[i]=n(r[i],s[i]);return a}return[]}),tQ=xT(),YM=O(2,(e,t)=>{const n=Array.from(e),r=Math.floor(t);return sn(n)?r>=1?nQ(n,r):[[],n]:[n,[]]}),nQ=O(2,(e,t)=>{const n=Math.max(1,Math.floor(t));return n>=e.length?[Hf(e),[]]:[Iy(e.slice(1,n),zr(e)),e.slice(n)]}),Hf=e=>e.slice(),rQ=O(3,(e,t,n)=>{const r=Ct(e),s=Ct(t);return sn(r)?sn(s)?XM(n)(AT(r,s)):r:s}),Ob=O(2,(e,t)=>rQ(e,t,tQ)),Li=()=>[],na=e=>[e],Kc=O(2,(e,t)=>e.map(t)),Ay=O(2,(e,t)=>{if(KJ(e))return[];const n=[];for(let r=0;r<e.length;r++){const s=t(e[r],r);for(let a=0;a<s.length;a++)n.push(s[a])}return n}),JM=Ay(Qe),QM=O(2,(e,t)=>{const n=Ct(e),r=[];for(let s=0;s<n.length;s++){const a=t(n[s],s);Et(a)&&r.push(a.value)}return r}),sQ=O(2,(e,t)=>{const n=Ct(e),r=[];for(let s=0;s<n.length;s++)t(n[s],s)&&r.push(n[s]);return r}),NT=O(3,(e,t,n)=>Ct(e).reduce((r,s,a)=>n(r,s,a),t)),aN=(e,t)=>{const n=[];let r=e,s;for(;Et(s=t(r));){const[a,o]=s.value;n.push(a),r=o}return n},R1=dJ,XM=O(2,(e,t)=>{const n=Ct(e);if(sn(n)){const r=[zr(n)],s=su(n);for(const a of s)r.every(o=>!t(a,o))&&r.push(a);return r}return[]}),aQ=e=>XM(e,xT()),Id=O(2,(e,t)=>Ct(e).join(t)),ZM=Symbol.for("effect/Chunk");function oQ(e,t,n,r,s){for(let a=t;a<Math.min(e.length,t+s);a++)n[r+a-t]=e[a];return n}const eD=[],iQ=e=>ET((t,n)=>t.length===n.length&&Us(t).every((r,s)=>e(r,Si(n,s)))),cQ=iQ(Fe),uQ={[ZM]:{_A:e=>e},toString(){return zt(this.toJSON())},toJSON(){return{_id:"Chunk",values:Us(this).map(en)}},[xt](){return this.toJSON()},[Ze](e){return RT(e)&&cQ(this,e)},[Xe](){return Mt(this,Ed(Us(this)))},[Symbol.iterator](){switch(this.backing._tag){case"IArray":return this.backing.array[Symbol.iterator]();case"IEmpty":return eD[Symbol.iterator]();default:return Us(this)[Symbol.iterator]()}},pipe(){return je(this,arguments)}},on=e=>{const t=Object.create(uQ);switch(t.backing=e,e._tag){case"IEmpty":{t.length=0,t.depth=0,t.left=t,t.right=t;break}case"IConcat":{t.length=e.left.length+e.right.length,t.depth=1+Math.max(e.left.depth,e.right.depth),t.left=e.left,t.right=e.right;break}case"IArray":{t.length=e.array.length,t.depth=0,t.left=ra,t.right=ra;break}case"ISingleton":{t.length=1,t.depth=0,t.left=ra,t.right=ra;break}case"ISlice":{t.length=e.length,t.depth=e.chunk.depth+1,t.left=ra,t.right=ra;break}}return t},RT=e=>Be(e,ZM),ra=on({_tag:"IEmpty"}),pr=()=>ra,tv=(...e)=>fQ(e),In=e=>on({_tag:"ISingleton",a:e}),Jl=e=>RT(e)?e:Or(Ct(e)),uw=(e,t,n)=>{switch(e.backing._tag){case"IArray":{oQ(e.backing.array,0,t,n,e.length);break}case"IConcat":{uw(e.left,t,n),uw(e.right,t,n+e.left.length);break}case"ISingleton":{t[n]=e.backing.a;break}case"ISlice":{let r=0,s=n;for(;r<e.length;)t[s]=Si(e,r),r+=1,s+=1;break}}},lQ=e=>{switch(e.backing._tag){case"IEmpty":return eD;case"IArray":return e.backing.array;default:{const t=new Array(e.length);return uw(e,t,0),e.backing={_tag:"IArray",array:t},e.left=ra,e.right=ra,e.depth=0,t}}},Us=lQ,dQ=e=>{switch(e.backing._tag){case"IEmpty":case"ISingleton":return e;case"IArray":return on({_tag:"IArray",array:rN(e.backing.array)});case"IConcat":return on({_tag:"IConcat",left:Do(e.backing.right),right:Do(e.backing.left)});case"ISlice":return Or(rN(Us(e)))}},Do=dQ,tD=O(2,(e,t)=>t<0||t>=e.length?ye():Ce(Si(e,t))),Or=e=>e.length===0?pr():e.length===1?In(e[0]):on({_tag:"IArray",array:e}),fQ=e=>Or(e),Si=O(2,(e,t)=>{switch(e.backing._tag){case"IEmpty":throw new Error("Index out of bounds");case"ISingleton":{if(t!==0)throw new Error("Index out of bounds");return e.backing.a}case"IArray":{if(t>=e.length||t<0)throw new Error("Index out of bounds");return e.backing.array[t]}case"IConcat":return t<e.left.length?Si(e.left,t):Si(e.right,t-e.left.length);case"ISlice":return Si(e.backing.chunk,t+e.backing.offset)}}),lw=O(2,(e,t)=>_n(e,In(t))),Tr=O(2,(e,t)=>_n(In(t),e)),Ny=O(2,(e,t)=>{if(t<=0)return ra;if(t>=e.length)return e;switch(e.backing._tag){case"ISlice":return on({_tag:"ISlice",chunk:e.backing.chunk,length:t,offset:e.backing.offset});case"IConcat":return t>e.left.length?on({_tag:"IConcat",left:e.left,right:Ny(e.right,t-e.left.length)}):Ny(e.left,t);default:return on({_tag:"ISlice",chunk:e,offset:0,length:t})}}),hi=O(2,(e,t)=>{if(t<=0)return e;if(t>=e.length)return ra;switch(e.backing._tag){case"ISlice":return on({_tag:"ISlice",chunk:e.backing.chunk,offset:e.backing.offset+t,length:e.backing.length-t});case"IConcat":return t>e.left.length?hi(e.right,t-e.left.length):on({_tag:"IConcat",left:hi(e.left,t),right:e.right});default:return on({_tag:"ISlice",chunk:e,offset:t,length:e.length-t})}}),_n=O(2,(e,t)=>{if(e.backing._tag==="IEmpty")return t;if(t.backing._tag==="IEmpty")return e;const n=t.depth-e.depth;if(Math.abs(n)<=1)return on({_tag:"IConcat",left:e,right:t});if(n<-1)if(e.left.depth>=e.right.depth){const r=_n(e.right,t);return on({_tag:"IConcat",left:e.left,right:r})}else{const r=_n(e.right.right,t);if(r.depth===e.depth-3){const s=on({_tag:"IConcat",left:e.right.left,right:r});return on({_tag:"IConcat",left:e.left,right:s})}else{const s=on({_tag:"IConcat",left:e.left,right:e.right.left});return on({_tag:"IConcat",left:s,right:r})}}else if(t.right.depth>=t.left.depth){const r=_n(e,t.left);return on({_tag:"IConcat",left:r,right:t.right})}else{const r=_n(e,t.left.left);if(r.depth===t.depth-3){const s=on({_tag:"IConcat",left:r,right:t.left.right});return on({_tag:"IConcat",left:s,right:t.right})}else{const s=on({_tag:"IConcat",left:t.left.right,right:t.right});return on({_tag:"IConcat",left:r,right:s})}}}),PT=O(2,(e,t)=>Or(sQ(e,t))),OT=e=>e.length===0,Fo=e=>e.length>0,LT=tD(0),$T=e=>Si(e,0),za=$T,hQ=e=>tD(e,e.length-1),mQ=O(2,(e,t)=>e.backing._tag==="ISingleton"?In(t(e.backing.a,0)):Or(B(Us(e),Kc((n,r)=>t(n,r))))),Co=e=>hi(e,1),pQ=O(2,(e,t)=>hi(e,e.length-t)),gQ=NT,au=5,jT=Math.pow(2,au),bQ=jT-1,yQ=jT/2,xQ=jT/4;function kQ(e){return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,e+=e>>16,e&127}function Ql(e,t){return t>>>e&bQ}function gl(e){return 1<<e}function nD(e,t){return kQ(e&t-1)}const vQ=(e,t)=>({value:e,previous:t});function Nl(e,t,n,r){let s=r;if(!e){const a=r.length;s=new Array(a);for(let o=0;o<a;++o)s[o]=r[o]}return s[t]=n,s}function rD(e,t,n){const r=n.length-1;let s=0,a=0,o=n;if(e)s=a=t;else for(o=new Array(r);s<t;)o[a++]=n[s++];for(++s;s<=r;)o[a++]=n[s++];return e&&(o.length=r),o}function SQ(e,t,n,r){const s=r.length;if(e){let c=s;for(;c>=t;)r[c--]=r[c];return r[t]=n,r}let a=0,o=0;const i=new Array(s+1);for(;a<t;)i[o++]=r[a++];for(i[t]=n;a<s;)i[++o]=r[a++];return i}class $i{_tag="EmptyNode";modify(t,n,r,s,a,o){const i=r(ye());return Cn(i)?new $i:(++o.value,new Wc(t,s,a,i))}}function la(e){return fM(e,"EmptyNode")}function wQ(e){return la(e)||e._tag==="LeafNode"||e._tag==="CollisionNode"}function P1(e,t){return la(e)?!1:t===e.edit}class Wc{edit;hash;key;value;_tag="LeafNode";constructor(t,n,r,s){this.edit=t,this.hash=n,this.key=r,this.value=s}modify(t,n,r,s,a,o){if(Fe(a,this.key)){const c=r(this.value);return c===this.value?this:Cn(c)?(--o.value,new $i):P1(this,t)?(this.value=c,this):new Wc(t,s,a,c)}const i=r(ye());return Cn(i)?this:(++o.value,sD(t,n,this.hash,this,s,new Wc(t,s,a,i)))}}class MT{edit;hash;children;_tag="CollisionNode";constructor(t,n,r){this.edit=t,this.hash=n,this.children=r}modify(t,n,r,s,a,o){if(s===this.hash){const c=P1(this,t),u=this.updateCollisionList(c,t,this.hash,this.children,r,a,o);return u===this.children?this:u.length>1?new MT(t,this.hash,u):u[0]}const i=r(ye());return Cn(i)?this:(++o.value,sD(t,n,this.hash,this,s,new Wc(t,s,a,i)))}updateCollisionList(t,n,r,s,a,o,i){const c=s.length;for(let l=0;l<c;++l){const d=s[l];if("key"in d&&Fe(o,d.key)){const h=d.value,m=a(h);return m===h?s:Cn(m)?(--i.value,rD(t,l,s)):Nl(t,l,new Wc(n,r,o,m),s)}}const u=a(ye());return Cn(u)?s:(++i.value,Nl(t,c,new Wc(n,r,o,u),s))}}class Xl{edit;mask;children;_tag="IndexedNode";constructor(t,n,r){this.edit=t,this.mask=n,this.children=r}modify(t,n,r,s,a,o){const i=this.mask,c=this.children,u=Ql(n,s),l=gl(u),d=nD(i,l),h=i&l,m=P1(this,t);if(!h){const x=new $i().modify(t,n+au,r,s,a,o);return x?c.length>=yQ?EQ(t,u,x,i,c):new Xl(t,i|l,SQ(m,d,x,c)):this}const p=c[d],y=p.modify(t,n+au,r,s,a,o);if(p===y)return this;let g=i,b;if(la(y)){if(g&=~l,!g)return new $i;if(c.length<=2&&wQ(c[d^1]))return c[d^1];b=rD(m,d,c)}else b=Nl(m,d,y,c);return m?(this.mask=g,this.children=b,this):new Xl(t,g,b)}}class DT{edit;size;children;_tag="ArrayNode";constructor(t,n,r){this.edit=t,this.size=n,this.children=r}modify(t,n,r,s,a,o){let i=this.size;const c=this.children,u=Ql(n,s),l=c[u],d=(l||new $i).modify(t,n+au,r,s,a,o);if(l===d)return this;const h=P1(this,t);let m;if(la(l)&&!la(d))++i,m=Nl(h,u,d,c);else if(!la(l)&&la(d)){if(--i,i<=xQ)return _Q(t,i,u,c);m=Nl(h,u,new $i,c)}else m=Nl(h,u,d,c);return h?(this.size=i,this.children=m,this):new DT(t,i,m)}}function _Q(e,t,n,r){const s=new Array(t-1);let a=0,o=0;for(let i=0,c=r.length;i<c;++i)if(i!==n){const u=r[i];u&&!la(u)&&(s[a++]=u,o|=1<<i)}return new Xl(e,o,s)}function EQ(e,t,n,r,s){const a=[];let o=r,i=0;for(let c=0;o;++c)o&1&&(a[c]=s[i++]),o>>>=1;return a[t]=n,new DT(e,i+1,a)}function TQ(e,t,n,r,s,a){if(n===s)return new MT(e,n,[a,r]);const o=Ql(t,n),i=Ql(t,s);if(o===i)return c=>new Xl(e,gl(o)|gl(i),[c]);{const c=o<i?[r,a]:[a,r];return new Xl(e,gl(o)|gl(i),c)}}function sD(e,t,n,r,s,a){let o,i=t;for(;;){const c=TQ(e,i,n,r,s,a);if(typeof c=="function")o=vQ(c,o),i=i+au;else{let u=c;for(;o!=null;)u=o.value(u),o=o.previous;return u}}}const aD="effect/HashMap",dw=Symbol.for(aD),CQ={[dw]:dw,[Symbol.iterator](){return new O1(this,(e,t)=>[e,t])},[Xe](){let e=Pe(aD);for(const t of this)e^=B(Pe(t[0]),tt(Pe(t[1])));return Mt(this,e)},[Ze](e){if(NQ(e)){if(e._size!==this._size)return!1;for(const t of this){const n=B(e,BT(t[0],Pe(t[0])));if(Cn(n))return!1;if(!Fe(t[1],n.value))return!1}return!0}return!1},toString(){return zt(this.toJSON())},toJSON(){return{_id:"HashMap",values:Array.from(this).map(en)}},[xt](){return this.toJSON()},pipe(){return je(this,arguments)}},FT=(e,t,n,r)=>{const s=Object.create(CQ);return s._editable=e,s._edit=t,s._root=n,s._size=r,s};class O1{map;f;v;constructor(t,n){this.map=t,this.f=n,this.v=oD(this.map._root,this.f,void 0)}next(){if(Cn(this.v))return{done:!0,value:void 0};const t=this.v.value;return this.v=Ry(t.cont),{done:!1,value:t.value}}[Symbol.iterator](){return new O1(this.map,this.f)}}const Ry=e=>e?iD(e[0],e[1],e[2],e[3],e[4]):ye(),oD=(e,t,n=void 0)=>{switch(e._tag){case"LeafNode":return Et(e.value)?Ce({value:t(e.key,e.value.value),cont:n}):Ry(n);case"CollisionNode":case"ArrayNode":case"IndexedNode":{const r=e.children;return iD(r.length,r,0,t,n)}default:return Ry(n)}},iD=(e,t,n,r,s)=>{for(;n<e;){const a=t[n++];if(a&&!la(a))return oD(a,r,[e,t,n,r,s])}return Ry(s)},IQ=FT(!1,0,new $i,0),L1=()=>IQ,AQ=e=>{const t=uD(L1());for(const n of e)Jh(t,n[0],n[1]);return $Q(t)},NQ=e=>Be(e,dw),RQ=e=>e&&la(e._root),PQ=O(2,(e,t)=>BT(e,t,Pe(t))),BT=O(3,(e,t,n)=>{let r=e._root,s=0;for(;;)switch(r._tag){case"LeafNode":return Fe(t,r.key)?r.value:ye();case"CollisionNode":{if(n===r.hash){const a=r.children;for(let o=0,i=a.length;o<i;++o){const c=a[o];if("key"in c&&Fe(t,c.key))return c.value}}return ye()}case"IndexedNode":{const a=Ql(s,n),o=gl(a);if(r.mask&o){r=r.children[nD(r.mask,o)],s+=au;break}return ye()}case"ArrayNode":{if(r=r.children[Ql(s,n)],r){s+=au;break}return ye()}default:return ye()}}),OQ=O(2,(e,t)=>Et(BT(e,t,Pe(t)))),Jh=O(3,(e,t,n)=>UT(e,t,()=>Ce(n))),LQ=O(3,(e,t,n)=>e._editable?(e._root=t,e._size=n,e):t===e._root?e:FT(e._editable,e._edit,t,n)),cD=e=>new O1(e,t=>t),fw=e=>e._size,uD=e=>FT(!0,e._edit+1,e._root,e._size),$Q=e=>(e._editable=!1,e),UT=O(3,(e,t,n)=>jQ(e,t,Pe(t),n)),jQ=O(4,(e,t,n,r)=>{const s={value:e._size},a=e._root.modify(e._editable?e._edit:NaN,0,r,n,t,s);return B(e,LQ(a,s.value))}),oN=O(2,(e,t)=>UT(e,t,ye)),MQ=O(2,(e,t)=>$1(e,L1(),(n,r,s)=>Jh(n,s,t(r,s)))),lD=O(2,(e,t)=>$1(e,void 0,(n,r,s)=>t(r,s))),$1=O(3,(e,t,n)=>{const r=e._root;if(r._tag==="LeafNode")return Et(r.value)?n(t,r.value.value,r.key):t;if(r._tag==="EmptyNode")return t;const s=[r.children];let a;for(;a=s.pop();)for(let o=0,i=a.length;o<i;){const c=a[o++];c&&!la(c)&&(c._tag==="LeafNode"?Et(c.value)&&(t=n(t,c.value.value,c.key)):s.push(c.children))}return t}),dD="effect/HashSet",hw=Symbol.for(dD),DQ={[hw]:hw,[Symbol.iterator](){return cD(this._keyMap)},[Xe](){return Mt(this,tt(Pe(this._keyMap))(Pe(dD)))},[Ze](e){return FQ(e)?fw(this._keyMap)===fw(e._keyMap)&&Fe(this._keyMap,e._keyMap):!1},toString(){return zt(this.toJSON())},toJSON(){return{_id:"HashSet",values:Array.from(this).map(en)}},[xt](){return this.toJSON()},pipe(){return je(this,arguments)}},j1=e=>{const t=Object.create(DQ);return t._keyMap=e,t},FQ=e=>Be(e,hw),BQ=j1(L1()),M1=()=>BQ,UQ=e=>{const t=zT(M1());for(const n of e)Qh(t,n);return HT(t)},zQ=(...e)=>{const t=zT(M1());for(const n of e)Qh(t,n);return HT(t)},HQ=O(2,(e,t)=>OQ(e._keyMap,t)),qQ=e=>fw(e._keyMap),zT=e=>j1(uD(e._keyMap)),HT=e=>(e._keyMap._editable=!1,e),fD=O(2,(e,t)=>{const n=zT(e);return t(n),HT(n)}),Qh=O(2,(e,t)=>e._keyMap._editable?(Jh(t,!0)(e._keyMap),e):j1(Jh(t,!0)(e._keyMap))),hD=O(2,(e,t)=>e._keyMap._editable?(oN(t)(e._keyMap),e):j1(oN(t)(e._keyMap))),VQ=O(2,(e,t)=>fD(e,n=>{for(const r of t)hD(n,r)})),GQ=O(2,(e,t)=>fD(M1(),n=>{KQ(e,r=>Qh(n,r));for(const r of t)Qh(n,r)})),KQ=O(2,(e,t)=>lD(e._keyMap,(n,r)=>t(r))),WQ=O(3,(e,t,n)=>$1(e._keyMap,t,(r,s,a)=>n(r,a))),ou=M1,YQ=UQ,qT=zQ,mD=HQ,VT=qQ,dh=Qh,pD=hD,iN=VQ,Xh=GQ,Zh=WQ,Ad="Die",iu="Empty",Eu="Fail",Nd="Interrupt",Zl="Parallel",ed="Sequential",gD="effect/Cause",bD=Symbol.for(gD),JQ={_E:e=>e},Rd={[bD]:JQ,[Xe](){return B(Pe(gD),tt(Pe(iX(this))),Mt(this))},[Ze](e){return QQ(e)&&oX(this,e)},pipe(){return je(this,arguments)},toJSON(){switch(this._tag){case"Empty":return{_id:"Cause",_tag:this._tag};case"Die":return{_id:"Cause",_tag:this._tag,defect:en(this.defect)};case"Interrupt":return{_id:"Cause",_tag:this._tag,fiberId:this.fiberId.toJSON()};case"Fail":return{_id:"Cause",_tag:this._tag,failure:en(this.error)};case"Sequential":case"Parallel":return{_id:"Cause",_tag:this._tag,left:en(this.left),right:en(this.right)}}},toString(){return Pd(this)},[xt](){return this.toJSON()}},ji=(()=>{const e=Object.create(Rd);return e._tag=iu,e})(),cu=e=>{const t=Object.create(Rd);return t._tag=Eu,t.error=e,t},zs=e=>{const t=Object.create(Rd);return t._tag=Ad,t.defect=e,t},oa=e=>{const t=Object.create(Rd);return t._tag=Nd,t.fiberId=e,t},Mi=(e,t)=>{const n=Object.create(Rd);return n._tag=Zl,n.left=e,n.right=t,n},vr=(e,t)=>{const n=Object.create(Rd);return n._tag=ed,n.left=e,n.right=t,n},QQ=e=>Be(e,bD),XQ=e=>e._tag===iu,ZQ=e=>e._tag===Eu,yD=e=>e._tag===Ad,eX=e=>e._tag===iu?!0:td(e,!0,(t,n)=>{switch(n._tag){case iu:return Ce(t);case Ad:case Eu:case Nd:return Ce(!1);default:return ye()}}),xD=e=>Et(nX(e)),D1=e=>F1(void 0,uX)(e),tX=e=>Do(td(e,pr(),(t,n)=>n._tag===Eu?Ce(B(t,Tr(n.error))):ye())),kD=e=>Do(td(e,pr(),(t,n)=>n._tag===Ad?Ce(B(t,Tr(n.defect))):ye())),GT=e=>td(e,ou(),(t,n)=>n._tag===Nd?Ce(B(t,dh(n.fiberId))):ye()),vD=e=>KT(e,t=>t._tag===Eu?Ce(t.error):ye()),SD=e=>{const t=vD(e);switch(t._tag){case"None":return nt(e);case"Some":return Ye(t.value)}},nX=e=>KT(e,t=>t._tag===Nd?Ce(t.fiberId):ye()),cN=e=>WT(e,{onEmpty:ji,onFail:()=>ji,onDie:zs,onInterrupt:oa,onSequential:vr,onParallel:Mi}),rX=e=>WT(e,{onEmpty:ji,onFail:zs,onDie:zs,onInterrupt:oa,onSequential:vr,onParallel:Mi}),sX=O(2,(e,t)=>aX(e,n=>cu(t(n)))),aX=O(2,(e,t)=>WT(e,{onEmpty:ji,onFail:n=>t(n),onDie:n=>zs(n),onInterrupt:n=>oa(n),onSequential:(n,r)=>vr(n,r),onParallel:(n,r)=>Mi(n,r)})),oX=(e,t)=>{let n=In(e),r=In(t);for(;Fo(n)&&Fo(r);){const[s,a]=B(za(n),td([ou(),pr()],([c,u],l)=>{const[d,h]=mw(l);return Ce([B(c,Xh(d)),B(u,_n(h))])})),[o,i]=B(za(r),td([ou(),pr()],([c,u],l)=>{const[d,h]=mw(l);return Ce([B(c,Xh(d)),B(u,_n(h))])}));if(!Fe(s,o))return!1;n=a,r=i}return!0},iX=e=>cX(In(e),pr()),cX=(e,t)=>{for(;;){const[n,r]=B(e,NT([ou(),pr()],([a,o],i)=>{const[c,u]=mw(i);return[B(a,Xh(c)),B(o,_n(u))]})),s=VT(n)>0?B(t,Tr(n)):t;if(OT(r))return Do(s);e=r,t=s}throw new Error(S1("Cause.flattenCauseLoop"))},KT=O(2,(e,t)=>{const n=[e];for(;n.length>0;){const r=n.pop(),s=t(r);switch(s._tag){case"None":{switch(r._tag){case ed:case Zl:{n.push(r.right),n.push(r.left);break}}break}case"Some":return s}}return ye()}),mw=e=>{let t=e;const n=[];let r=ou(),s=pr();for(;t!==void 0;)switch(t._tag){case iu:{if(n.length===0)return[r,s];t=n.pop();break}case Eu:{if(r=dh(r,tv(t._tag,t.error)),n.length===0)return[r,s];t=n.pop();break}case Ad:{if(r=dh(r,tv(t._tag,t.defect)),n.length===0)return[r,s];t=n.pop();break}case Nd:{if(r=dh(r,tv(t._tag,t.fiberId)),n.length===0)return[r,s];t=n.pop();break}case ed:{switch(t.left._tag){case iu:{t=t.right;break}case ed:{t=vr(t.left.left,vr(t.left.right,t.right));break}case Zl:{t=Mi(vr(t.left.left,t.right),vr(t.left.right,t.right));break}default:{s=Tr(s,t.right),t=t.left;break}}break}case Zl:{n.push(t.right),t=t.left;break}}throw new Error(S1("Cause.evaluateCauseLoop"))},uX={emptyCase:eN,failCase:Po,dieCase:Po,interruptCase:eN,sequentialCase:(e,t,n)=>t&&n,parallelCase:(e,t,n)=>t&&n},uN="SequentialCase",lN="ParallelCase",WT=O(2,(e,{onDie:t,onEmpty:n,onFail:r,onInterrupt:s,onParallel:a,onSequential:o})=>F1(e,void 0,{emptyCase:()=>n,failCase:(i,c)=>r(c),dieCase:(i,c)=>t(c),interruptCase:(i,c)=>s(c),sequentialCase:(i,c,u)=>o(c,u),parallelCase:(i,c,u)=>a(c,u)})),td=O(3,(e,t,n)=>{let r=t,s=e;const a=[];for(;s!==void 0;){const o=n(r,s);switch(r=Et(o)?o.value:r,s._tag){case ed:{a.push(s.right),s=s.left;break}case Zl:{a.push(s.right),s=s.left;break}default:{s=void 0;break}}s===void 0&&a.length>0&&(s=a.pop())}return r}),F1=O(3,(e,t,n)=>{const r=[e],s=[];for(;r.length>0;){const o=r.pop();switch(o._tag){case iu:{s.push(nt(n.emptyCase(t)));break}case Eu:{s.push(nt(n.failCase(t,o.error)));break}case Ad:{s.push(nt(n.dieCase(t,o.defect)));break}case Nd:{s.push(nt(n.interruptCase(t,o.fiberId)));break}case ed:{r.push(o.right),r.push(o.left),s.push(Ye({_tag:uN}));break}case Zl:{r.push(o.right),r.push(o.left),s.push(Ye({_tag:lN}));break}}}const a=[];for(;s.length>0;){const o=s.pop();switch(o._tag){case"Left":{switch(o.left._tag){case uN:{const i=a.pop(),c=a.pop(),u=n.sequentialCase(t,i,c);a.push(u);break}case lN:{const i=a.pop(),c=a.pop(),u=n.parallelCase(t,i,c);a.push(u);break}}break}case"Right":{a.push(o.right);break}}}if(a.length===0)throw new Error("BUG: Cause.reduceWithContext - please report an issue at https://github.com/Effect-TS/effect/issues");return a.pop()}),Pd=(e,t)=>D1(e)?"All fibers interrupted without errors.":_D(e).map(function(n){return t?.renderErrorCause!==!0||n.cause===void 0?n.stack:`${n.stack} {
|
|
6
|
-
${wD(n.cause," ")}
|
|
7
|
-
}`}).join(`
|
|
8
|
-
`),wD=(e,t)=>{const n=e.stack.split(`
|
|
9
|
-
`);let r=`${t}[cause]: ${n[0]}`;for(let s=1,a=n.length;s<a;s++)r+=`
|
|
10
|
-
${t}${n[s]}`;return e.cause&&(r+=` {
|
|
11
|
-
${wD(e.cause,`${t} `)}
|
|
12
|
-
${t}}`),r};class Py extends globalThis.Error{span=void 0;constructor(t){const n=typeof t=="object"&&t!==null,r=Error.stackTraceLimit;Error.stackTraceLimit=1,super(lX(t),n&&"cause"in t&&typeof t.cause<"u"?{cause:new Py(t.cause)}:void 0),this.message===""&&(this.message="An error has occurred"),Error.stackTraceLimit=r,this.name=t instanceof Error?t.name:"Error",n&&(nd in t&&(this.span=t[nd]),Object.keys(t).forEach(s=>{s in this||(this[s]=t[s])})),this.stack=fX(`${this.name}: ${this.message}`,t instanceof Error&&t.stack?t.stack:"",this.span)}}const lX=e=>{if(typeof e=="string")return e;if(typeof e=="object"&&e!==null&&e instanceof Error)return e.message;try{if(Be(e,"toString")&&_d(e.toString)&&e.toString!==Object.prototype.toString&&e.toString!==globalThis.Array.prototype.toString)return e.toString()}catch{}return yM(e)},dX=/\((.*)\)/g,Oy=Ve("effect/Tracer/spanToTrace",()=>new WeakMap),fX=(e,t,n)=>{const r=[e],s=t.startsWith(e)?t.slice(e.length).split(`
|
|
13
|
-
`):t.split(`
|
|
14
|
-
`);for(let a=1;a<s.length;a++){if(s[a].includes(" at new BaseEffectError")||s[a].includes(" at new YieldableError")){a++;continue}if(s[a].includes("Generator.next")||s[a].includes("effect_internal_function"))break;r.push(s[a].replace(/at .*effect_instruction_i.*\((.*)\)/,"at $1").replace(/EffectPrimitive\.\w+/,"<anonymous>"))}if(n){let a=n,o=0;for(;a&&a._tag==="Span"&&o<10;){const i=Oy.get(a);if(typeof i=="function"){const c=i();if(typeof c=="string"){const u=c.matchAll(dX);let l=!1;for(const[,d]of u)l=!0,r.push(` at ${a.name} (${d})`);l||r.push(` at ${a.name} (${c.replace(/^at /,"")})`)}else r.push(` at ${a.name}`)}else r.push(` at ${a.name}`);a=jr(a.parent),o++}}return r.join(`
|
|
15
|
-
`)},nd=Symbol.for("effect/SpanAnnotation"),_D=e=>F1(e,void 0,{emptyCase:()=>[],dieCase:(t,n)=>[new Py(n)],failCase:(t,n)=>[new Py(n)],interruptCase:()=>[],parallelCase:(t,n,r)=>[...n,...r],sequentialCase:(t,n,r)=>[...n,...r]}),pw=Symbol.for("effect/Duration"),ED=BigInt(0),dN=BigInt(24),Hp=BigInt(60),gw=BigInt(1e3),fN=BigInt(1e6),hN=BigInt(1e9),hX=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,qs=e=>{if(TD(e))return e;if(ba(e))return sd(e);if(v1(e))return nv(e);if(Array.isArray(e)&&e.length===2&&e.every(ba))return e[0]===-1/0||e[1]===-1/0||Number.isNaN(e[0])||Number.isNaN(e[1])?rd:e[0]===1/0||e[1]===1/0?bX:nv(BigInt(Math.round(e[0]*1e9))+BigInt(Math.round(e[1])));if(jn(e)){const t=hX.exec(e);if(t){const[n,r,s]=t,a=Number(r);switch(s){case"nano":case"nanos":return nv(BigInt(r));case"micro":case"micros":return yX(BigInt(r));case"milli":case"millis":return sd(a);case"second":case"seconds":return ID(a);case"minute":case"minutes":return xX(a);case"hour":case"hours":return kX(a);case"day":case"days":return vX(a);case"week":case"weeks":return SX(a)}}}throw new Error("Invalid DurationInput")},mN={_tag:"Millis",millis:0},mX={_tag:"Infinity"},pX={[pw]:pw,[Xe](){return Mt(this,bM(this.value))},[Ze](e){return TD(e)&&AX(this,e)},toString(){return`Duration(${RX(this)})`},toJSON(){switch(this.value._tag){case"Millis":return{_id:"Duration",_tag:"Millis",millis:this.value.millis};case"Nanos":return{_id:"Duration",_tag:"Nanos",hrtime:_X(this)};case"Infinity":return{_id:"Duration",_tag:"Infinity"}}},[xt](){return this.toJSON()},pipe(){return je(this,arguments)}},to=e=>{const t=Object.create(pX);return ba(e)?isNaN(e)||e<=0?t.value=mN:Number.isFinite(e)?Number.isInteger(e)?t.value={_tag:"Millis",millis:e}:t.value={_tag:"Nanos",nanos:BigInt(Math.round(e*1e6))}:t.value=mX:e<=ED?t.value=mN:t.value={_tag:"Nanos",nanos:e},t},TD=e=>Be(e,pw),CD=e=>e.value._tag!=="Infinity",gX=e=>{switch(e.value._tag){case"Millis":return e.value.millis===0;case"Nanos":return e.value.nanos===ED;case"Infinity":return!1}},rd=to(0),bX=to(1/0),nv=e=>to(e),yX=e=>to(e*gw),sd=e=>to(e),ID=e=>to(e*1e3),xX=e=>to(e*6e4),kX=e=>to(e*36e5),vX=e=>to(e*864e5),SX=e=>to(e*6048e5),Ly=e=>EX(e,{onMillis:t=>t,onNanos:t=>Number(t)/1e6}),wX=e=>{const t=qs(e);switch(t.value._tag){case"Infinity":throw new Error("Cannot convert infinite duration to nanos");case"Nanos":return t.value.nanos;case"Millis":return BigInt(Math.round(t.value.millis*1e6))}},_X=e=>{const t=qs(e);switch(t.value._tag){case"Infinity":return[1/0,0];case"Nanos":return[Number(t.value.nanos/hN),Number(t.value.nanos%hN)];case"Millis":return[Math.floor(t.value.millis/1e3),Math.round(t.value.millis%1e3*1e6)]}},EX=O(2,(e,t)=>{const n=qs(e);switch(n.value._tag){case"Nanos":return t.onNanos(n.value.nanos);case"Infinity":return t.onMillis(1/0);case"Millis":return t.onMillis(n.value.millis)}}),YT=O(3,(e,t,n)=>{const r=qs(e),s=qs(t);if(r.value._tag==="Infinity"||s.value._tag==="Infinity")return n.onMillis(Ly(r),Ly(s));if(r.value._tag==="Nanos"||s.value._tag==="Nanos"){const a=r.value._tag==="Nanos"?r.value.nanos:BigInt(Math.round(r.value.millis*1e6)),o=s.value._tag==="Nanos"?s.value.nanos:BigInt(Math.round(s.value.millis*1e6));return n.onNanos(a,o)}return n.onMillis(r.value.millis,s.value.millis)}),TX=(e,t)=>YT(e,t,{onMillis:(n,r)=>n===r,onNanos:(n,r)=>n===r}),CX=O(2,(e,t)=>YT(e,t,{onMillis:(n,r)=>n<=r,onNanos:(n,r)=>n<=r})),IX=O(2,(e,t)=>YT(e,t,{onMillis:(n,r)=>n>=r,onNanos:(n,r)=>n>=r})),AX=O(2,(e,t)=>TX(qs(e),qs(t))),NX=e=>{const t=qs(e);if(t.value._tag==="Infinity")return{days:1/0,hours:1/0,minutes:1/0,seconds:1/0,millis:1/0,nanos:1/0};const n=wX(t),r=n/fN,s=r/gw,a=s/Hp,o=a/Hp,i=o/dN;return{days:Number(i),hours:Number(o%dN),minutes:Number(a%Hp),seconds:Number(s%Hp),millis:Number(r%gw),nanos:Number(n%fN)}},RX=e=>{const t=qs(e);if(t.value._tag==="Infinity")return"Infinity";if(gX(t))return"0";const n=NX(t),r=[];return n.days!==0&&r.push(`${n.days}d`),n.hours!==0&&r.push(`${n.hours}h`),n.minutes!==0&&r.push(`${n.minutes}m`),n.seconds!==0&&r.push(`${n.seconds}s`),n.millis!==0&&r.push(`${n.millis}ms`),n.nanos!==0&&r.push(`${n.nanos}ns`),r.join(" ")},pN=Symbol.for("effect/MutableRef"),PX={[pN]:pN,toString(){return zt(this.toJSON())},toJSON(){return{_id:"MutableRef",current:en(this.current)}},[xt](){return this.toJSON()},pipe(){return je(this,arguments)}},Fm=e=>{const t=Object.create(PX);return t.current=e,t},OX=O(3,(e,t,n)=>Fe(t,e.current)?(e.current=n,!0):!1),On=e=>e.current,Bm=O(2,(e,t)=>(e.current=t,e)),B1="effect/FiberId",uu=Symbol.for(B1),ad="None",bw="Runtime",yw="Composite",LX=Wt(`${B1}-${ad}`);let $X=class{[uu]=uu;_tag=ad;id=-1;startTimeMillis=-1;[Xe](){return LX}[Ze](t){return JT(t)&&t._tag===ad}toString(){return zt(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag}}[xt](){return this.toJSON()}};class AD{id;startTimeMillis;[uu]=uu;_tag=bw;constructor(t,n){this.id=t,this.startTimeMillis=n}[Xe](){return Mt(this,Wt(`${B1}-${this._tag}-${this.id}-${this.startTimeMillis}`))}[Ze](t){return JT(t)&&t._tag===bw&&this.id===t.id&&this.startTimeMillis===t.startTimeMillis}toString(){return zt(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag,id:this.id,startTimeMillis:this.startTimeMillis}}[xt](){return this.toJSON()}}let jX=class{left;right;[uu]=uu;_tag=yw;constructor(t,n){this.left=t,this.right=n}_hash;[Xe](){return B(Wt(`${B1}-${this._tag}`),tt(Pe(this.left)),tt(Pe(this.right)),Mt(this))}[Ze](t){return JT(t)&&t._tag===yw&&Fe(this.left,t.left)&&Fe(this.right,t.right)}toString(){return zt(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag,left:en(this.left),right:en(this.right)}}[xt](){return this.toJSON()}};const ND=new $X,JT=e=>Be(e,uu),RD=O(2,(e,t)=>e._tag===ad?t:t._tag===ad?e:new jX(e,t)),MX=e=>B(e,Zh(ND,(t,n)=>RD(n)(t))),$y=e=>{switch(e._tag){case ad:return ou();case bw:return qT(e.id);case yw:return B($y(e.left),Xh($y(e.right)))}},gN=Ve(Symbol.for("effect/Fiber/Id/_fiberCounter"),()=>Fm(0)),DX=(e,t)=>new AD(e,t),PD=e=>Array.from($y(e)).map(n=>`#${n}`).join(","),FX=()=>{const e=On(gN);return B(gN,Bm(e+1)),new AD(e,Date.now())},ys=ND,fh=RD,BX=MX,OD=$y,UX=DX,zX=PD,LD=FX,U1=L1,HX=AQ,qX=RQ,$D=PQ,jD=Jh,MD=cD,VX=UT,GX=MQ,KX=lD,DD=$1,em=Symbol.for("effect/List"),xw=e=>Ct(e),WX=e=>lJ(R1(e),xw),YX=WX(Fe),JX={[em]:em,_tag:"Cons",toString(){return zt(this.toJSON())},toJSON(){return{_id:"List",_tag:"Cons",values:xw(this).map(en)}},[xt](){return this.toJSON()},[Ze](e){return BD(e)&&this._tag===e._tag&&YX(this,e)},[Xe](){return Mt(this,Ed(xw(this)))},[Symbol.iterator](){let e=!1,t=this;return{next(){if(e)return this.return();if(t._tag==="Nil")return e=!0,this.return();const n=t.head;return t=t.tail,{done:e,value:n}},return(n){return e||(e=!0),{done:!0,value:n}}}},pipe(){return je(this,arguments)}},jy=(e,t)=>{const n=Object.create(JX);return n.head=e,n.tail=t,n},QX=Wt("Nil"),XX={[em]:em,_tag:"Nil",toString(){return zt(this.toJSON())},toJSON(){return{_id:"List",_tag:"Nil"}},[xt](){return this.toJSON()},[Xe](){return QX},[Ze](e){return BD(e)&&this._tag===e._tag},[Symbol.iterator](){return{next(){return{done:!0,value:void 0}}}},pipe(){return je(this,arguments)}},FD=Object.create(XX),BD=e=>Be(e,em),Oo=e=>e._tag==="Nil",ZX=e=>e._tag==="Cons",eZ=()=>FD,lu=(e,t)=>jy(e,t),od=eZ,QT=e=>jy(e,FD),tZ=O(2,(e,t)=>rZ(t,e)),nZ=O(2,(e,t)=>lu(t,e)),rZ=O(2,(e,t)=>{if(Oo(e))return t;if(Oo(t))return e;{const n=jy(t.head,e);let r=n,s=t.tail;for(;!Oo(s);){const a=jy(s.head,e);r.tail=a,r=a,s=s.tail}return n}}),sZ=O(3,(e,t,n)=>{let r=t,s=e;for(;!Oo(s);)r=n(r,s.head),s=s.tail;return r}),aZ=e=>{let t=od(),n=e;for(;!Oo(n);)t=nZ(t,n.head),n=n.tail;return t},oZ=Object.assign(Object.create(Array.prototype),{[Xe](){return Mt(this,Ed(this))},[Ze](e){return Array.isArray(e)&&this.length===e.length?this.every((t,n)=>Fe(t,e[n])):!1}}),Um=(function(){function e(t){t&&Object.assign(this,t)}return e.prototype=C1,e})(),iZ=e=>Object.assign(Object.create(C1),e),cZ=Symbol.for("effect/DifferContextPatch");function bN(e){return e}const zm={...Um.prototype,[cZ]:{_Value:bN,_Patch:bN}},uZ=Object.assign(Object.create(zm),{_tag:"Empty"}),lZ=Object.create(uZ),UD=()=>lZ,dZ=Object.assign(Object.create(zm),{_tag:"AndThen"}),fZ=(e,t)=>{const n=Object.create(dZ);return n.first=e,n.second=t,n},hZ=Object.assign(Object.create(zm),{_tag:"AddService"}),mZ=(e,t)=>{const n=Object.create(hZ);return n.key=e,n.service=t,n},pZ=Object.assign(Object.create(zm),{_tag:"RemoveService"}),gZ=e=>{const t=Object.create(pZ);return t.key=e,t},bZ=Object.assign(Object.create(zm),{_tag:"UpdateService"}),yZ=(e,t)=>{const n=Object.create(bZ);return n.key=e,n.update=t,n},xZ=(e,t)=>{const n=new Map(e.unsafeMap);let r=UD();for(const[s,a]of t.unsafeMap.entries())if(n.has(s)){const o=n.get(s);n.delete(s),Fe(o,a)||(r=Lb(yZ(s,()=>a))(r))}else n.delete(s),r=Lb(mZ(s,a))(r);for(const[s]of n.entries())r=Lb(gZ(s))(r);return r},Lb=O(2,(e,t)=>fZ(e,t)),kZ=O(2,(e,t)=>{if(e._tag==="Empty")return t;let n=!1,r=In(e);const s=new Map(t.unsafeMap);for(;Fo(r);){const o=za(r),i=Co(r);switch(o._tag){case"Empty":{r=i;break}case"AddService":{s.set(o.key,o.service),r=i;break}case"AndThen":{r=Tr(Tr(i,o.second),o.first);break}case"RemoveService":{s.delete(o.key),r=i;break}case"UpdateService":{s.set(o.key,o.update(s.get(o.key))),n=!0,r=i;break}}}if(!n)return Oi(s);const a=new Map;for(const[o]of t.unsafeMap)s.has(o)&&(a.set(o,s.get(o)),s.delete(o));for(const[o,i]of s)a.set(o,i);return Oi(a)}),vZ=Symbol.for("effect/DifferHashSetPatch");function rv(e){return e}const z1={...Um.prototype,[vZ]:{_Value:rv,_Key:rv,_Patch:rv}},SZ=Object.assign(Object.create(z1),{_tag:"Empty"}),wZ=Object.create(SZ),zD=()=>wZ,_Z=Object.assign(Object.create(z1),{_tag:"AndThen"}),EZ=(e,t)=>{const n=Object.create(_Z);return n.first=e,n.second=t,n},TZ=Object.assign(Object.create(z1),{_tag:"Add"}),CZ=e=>{const t=Object.create(TZ);return t.value=e,t},IZ=Object.assign(Object.create(z1),{_tag:"Remove"}),AZ=e=>{const t=Object.create(IZ);return t.value=e,t},NZ=(e,t)=>{const[n,r]=Zh([e,zD()],([s,a],o)=>mD(o)(s)?[pD(o)(s),a]:[s,kw(CZ(o))(a)])(t);return Zh(r,(s,a)=>kw(AZ(a))(s))(n)},kw=O(2,(e,t)=>EZ(e,t)),RZ=O(2,(e,t)=>{if(e._tag==="Empty")return t;let n=t,r=In(e);for(;Fo(r);){const s=za(r),a=Co(r);switch(s._tag){case"Empty":{r=a;break}case"AndThen":{r=Tr(s.first)(Tr(s.second)(a));break}case"Add":{n=dh(s.value)(n),r=a;break}case"Remove":n=pD(s.value)(n),r=a}}return n}),PZ=Symbol.for("effect/DifferReadonlyArrayPatch");function yN(e){return e}const Hm={...Um.prototype,[PZ]:{_Value:yN,_Patch:yN}},OZ=Object.assign(Object.create(Hm),{_tag:"Empty"}),LZ=Object.create(OZ),HD=()=>LZ,$Z=Object.assign(Object.create(Hm),{_tag:"AndThen"}),jZ=(e,t)=>{const n=Object.create($Z);return n.first=e,n.second=t,n},MZ=Object.assign(Object.create(Hm),{_tag:"Append"}),DZ=e=>{const t=Object.create(MZ);return t.values=e,t},FZ=Object.assign(Object.create(Hm),{_tag:"Slice"}),BZ=(e,t)=>{const n=Object.create(FZ);return n.from=e,n.until=t,n},UZ=Object.assign(Object.create(Hm),{_tag:"Update"}),zZ=(e,t)=>{const n=Object.create(UZ);return n.index=e,n.patch=t,n},HZ=e=>{let t=0,n=HD();for(;t<e.oldValue.length&&t<e.newValue.length;){const r=e.oldValue[t],s=e.newValue[t],a=e.differ.diff(r,s);Fe(a,e.differ.empty)||(n=$b(n,zZ(t,a))),t=t+1}return t<e.oldValue.length&&(n=$b(n,BZ(0,t))),t<e.newValue.length&&(n=$b(n,DZ(ZJ(t)(e.newValue)))),n},$b=O(2,(e,t)=>jZ(e,t)),qZ=O(3,(e,t,n)=>{if(e._tag==="Empty")return t;let r=t.slice(),s=na(e);for(;Al(s);){const a=zr(s),o=su(s);switch(a._tag){case"Empty":{s=o;break}case"AndThen":{o.unshift(a.first,a.second),s=o;break}case"Append":{for(const i of a.values)r.push(i);s=o;break}case"Slice":{r=r.slice(a.from,a.until),s=o;break}case"Update":{r[a.index]=n.patch(a.patch,r[a.index]),s=o;break}}}return r}),VZ=Symbol.for("effect/Differ"),GZ={[VZ]:{_P:Qe,_V:Qe},pipe(){return je(this,arguments)}},Od=e=>{const t=Object.create(GZ);return t.empty=e.empty,t.diff=e.diff,t.combine=e.combine,t.patch=e.patch,t},KZ=()=>Od({empty:UD(),combine:(e,t)=>Lb(t)(e),diff:(e,t)=>xZ(e,t),patch:(e,t)=>kZ(t)(e)}),WZ=()=>Od({empty:zD(),combine:(e,t)=>kw(t)(e),diff:(e,t)=>NZ(e,t),patch:(e,t)=>RZ(t)(e)}),YZ=e=>Od({empty:HD(),combine:(t,n)=>$b(t,n),diff:(t,n)=>HZ({oldValue:t,newValue:n,differ:e}),patch:(t,n)=>qZ(t,n,e)}),qD=()=>JZ((e,t)=>t),JZ=e=>Od({empty:Qe,combine:(t,n)=>t===Qe?n:n===Qe?t:r=>n(t(r)),diff:(t,n)=>Fe(t,n)?Qe:k1(n),patch:(t,n)=>e(n,t(n))}),tm=255,VD=8,vw=e=>e&tm,Sw=e=>e>>VD&tm,qm=(e,t)=>(e&tm)+((t&e&tm)<<VD),QZ=qm(0,0),XZ=e=>qm(e,e),ZZ=e=>qm(e,0),eee=O(2,(e,t)=>qm(vw(e)&~t,Sw(e))),tee=O(2,(e,t)=>e|t),nee=e=>~e>>>0&tm,ree=0,Tu=1,see=2,GD=4,ww=16,KD=32,aee=e=>H1(e,KD),oee=O(2,(e,t)=>e&~t),iee=O(2,(e,t)=>e|t),ci=e=>WD(e)&&!uee(e),WD=e=>H1(e,Tu),H1=O(2,(e,t)=>(e&t)!==0),YD=(...e)=>e.reduce((t,n)=>t|n,0),cee=YD(ree),xN=e=>H1(e,GD),uee=e=>H1(e,ww),wi=O(2,(e,t)=>qm(e^t,t)),Rl=O(2,(e,t)=>e&(nee(vw(t))|Sw(t))|vw(t)&Sw(t)),kN=Od({empty:QZ,diff:(e,t)=>wi(e,t),combine:(e,t)=>tee(t)(e),patch:(e,t)=>Rl(t,e)}),lee=XZ,JD=ZZ,vN=eee,QD=(e,t)=>({_tag:"Par",left:e,right:t}),qp=(e,t)=>({_tag:"Seq",left:e,right:t}),dee=e=>{let t=QT(e),n=od();for(;;){const[r,s]=sZ(t,[XD(),od()],([a,o],i)=>{const[c,u]=fee(i);return[bee(a,c),tZ(o,u)]});if(n=hee(n,r),Oo(s))return aZ(n);t=s}throw new Error("BUG: BlockedRequests.flatten - please report an issue at https://github.com/Effect-TS/effect/issues")},fee=e=>{let t=e,n=XD(),r=od(),s=od();for(;;)switch(t._tag){case"Empty":{if(Oo(r))return[n,s];t=r.head,r=r.tail;break}case"Par":{r=lu(t.right,r),t=t.left;break}case"Seq":{const a=t.left,o=t.right;switch(a._tag){case"Empty":{t=o;break}case"Par":{const i=a.left,c=a.right;t=QD(qp(i,o),qp(c,o));break}case"Seq":{const i=a.left,c=a.right;t=qp(i,qp(c,o));break}case"Single":{t=a,s=lu(o,s);break}}break}case"Single":{if(n=gee(n,t),Oo(r))return[n,s];t=r.head,r=r.tail;break}}throw new Error("BUG: BlockedRequests.step - please report an issue at https://github.com/Effect-TS/effect/issues")},hee=(e,t)=>{if(Oo(e))return QT(sv(t));if(yee(t))return e;const n=_ee(e.head),r=xee(t);return n.length===1&&r.length===1&&Fe(n[0],r[0])?lu(wee(e.head,sv(t)),e.tail):lu(sv(t),e)},mee=Symbol.for("effect/RequestBlock/RequestBlockParallel"),pee={_R:e=>e};class XT{map;[mee]=pee;constructor(t){this.map=t}}const XD=()=>new XT(U1()),gee=(e,t)=>new XT(VX(e.map,t.dataSource,n=>CJ(Jr(n,lw(t.blockedRequest)),()=>In(t.blockedRequest)))),bee=(e,t)=>new XT(DD(e.map,t.map,(n,r,s)=>jD(n,s,yn($D(n,s),{onNone:()=>r,onSome:a=>_n(r,a)})))),yee=e=>qX(e.map),xee=e=>Array.from(MD(e.map)),sv=e=>See(GX(e.map,t=>In(t))),kee=Symbol.for("effect/RequestBlock/RequestBlockSequential"),vee={_R:e=>e};class ZD{map;[kee]=vee;constructor(t){this.map=t}}const See=e=>new ZD(e),wee=(e,t)=>new ZD(DD(t.map,e.map,(n,r,s)=>jD(n,s,yn($D(n,s),{onNone:()=>pr(),onSome:a=>_n(a,r)})))),_ee=e=>Array.from(MD(e.map)),Eee=e=>Array.from(e.map),Vm="Pending",q1="Done",Tee="effect/Deferred",Cee=Symbol.for(Tee),Iee={_E:e=>e,_A:e=>e},Aee=e=>({_tag:Vm,joiners:e}),e6=e=>({_tag:q1,effect:e});class Gm{self;called=!1;constructor(t){this.self=t}next(t){return this.called?{value:t,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(t){return{value:t,done:!0}}throw(t){throw t}[Symbol.iterator](){return new Gm(this.self)}}const t6=(e,t)=>{const n=new An("Blocked");return n.effect_instruction_i0=e,n.effect_instruction_i1=t,n},Nee=e=>{const t=new An("RunBlocked");return t.effect_instruction_i0=e,t},du=Symbol.for("effect/Effect");class Ree{patch;op;_op=vT;constructor(t,n){this.patch=t,this.op=n}}class An{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[du]=Yl;constructor(t){this._op=t}[Ze](t){return this===t}[Xe](){return Mt(this,bT(this))}pipe(){return je(this,arguments)}toJSON(){return{_id:"Effect",_op:this._op,effect_instruction_i0:en(this.effect_instruction_i0),effect_instruction_i1:en(this.effect_instruction_i1),effect_instruction_i2:en(this.effect_instruction_i2)}}toString(){return zt(this.toJSON())}[xt](){return this.toJSON()}[Symbol.iterator](){return new Gm(new $m(this))}}class n6{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[du]=Yl;constructor(t){this._op=t,this._tag=t}[Ze](t){return ex(t)&&t._op==="Failure"&&Fe(this.effect_instruction_i0,t.effect_instruction_i0)}[Xe](){return B(Wt(this._tag),tt(Pe(this.effect_instruction_i0)),Mt(this))}get cause(){return this.effect_instruction_i0}pipe(){return je(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,cause:this.cause.toJSON()}}toString(){return zt(this.toJSON())}[xt](){return this.toJSON()}[Symbol.iterator](){return new Gm(new $m(this))}}class r6{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[du]=Yl;constructor(t){this._op=t,this._tag=t}[Ze](t){return ex(t)&&t._op==="Success"&&Fe(this.effect_instruction_i0,t.effect_instruction_i0)}[Xe](){return B(Wt(this._tag),tt(Pe(this.effect_instruction_i0)),Mt(this))}get value(){return this.effect_instruction_i0}pipe(){return je(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,value:en(this.value)}}toString(){return zt(this.toJSON())}[xt](){return this.toJSON()}[Symbol.iterator](){return new Gm(new $m(this))}}const zo=e=>Be(e,du),St=e=>{const t=new An(vM);return t.effect_instruction_i0=e,t},s6=O(3,(e,t,n)=>va(r=>he(e,s=>he(_i(st(()=>r(t(s)))),a=>st(()=>n(s,a)).pipe(Vs({onFailure:o=>{switch(a._tag){case Qn:return Bn(vr(a.effect_instruction_i0,o));case Xn:return Bn(o)}},onSuccess:()=>a})))))),Hr=O(2,(e,t)=>he(e,()=>Ae(t))),Gs=e=>Hr(e,void 0),a6=function(){const e=new An(T1);switch(arguments.length){case 2:{e.effect_instruction_i0=arguments[0],e.commit=arguments[1];break}case 3:{e.effect_instruction_i0=arguments[0],e.effect_instruction_i1=arguments[1],e.commit=arguments[2];break}case 4:{e.effect_instruction_i0=arguments[0],e.effect_instruction_i1=arguments[1],e.effect_instruction_i2=arguments[2],e.commit=arguments[3];break}default:throw new Error(S1("you're not supposed to end up here"))}return e},My=(e,t=ys)=>{const n=new An(ch);let r;return n.effect_instruction_i0=s=>{r=e(s)},n.effect_instruction_i1=t,Wm(n,s=>zo(r)?r:$t)},mi=(e,t=ys)=>st(()=>My(e,t)),ka=(e,t=ys)=>a6(e,function(){let n,r;function s(c){n?n(c):r===void 0&&(r=c)}const a=new An(ch);a.effect_instruction_i0=c=>{n=c,r&&c(r)},a.effect_instruction_i1=t;let o,i;return this.effect_instruction_i0.length!==1?(i=new AbortController,o=ir(()=>this.effect_instruction_i0(s,i.signal))):o=ir(()=>this.effect_instruction_i0(s)),o||i?Wm(a,c=>(i&&i.abort(),o??$t)):a}),o6=O(2,(e,t)=>{const n=new An(Rb);return n.effect_instruction_i0=e,n.effect_instruction_i1=t,n}),nm=O(2,(e,t)=>Bo(e,{onFailure:t,onSuccess:Ae})),SN=Symbol.for("effect/OriginalAnnotation"),ZT=(e,t)=>Et(t)?new Proxy(e,{has(n,r){return r===nd||r===SN||r in n},get(n,r){return r===nd?t.value:r===SN?e:n[r]}}):e,pi=e=>ya(e)&&!(nd in e)?St(t=>Bn(zs(ZT(e,mC(t))))):Bn(zs(e)),i6=e=>c6(()=>zs(new lte(e))),id=e=>Bo(e,{onFailure:t=>Ae(Ye(t)),onSuccess:t=>Ae(nt(t))}),_i=e=>u6(e,{onFailure:Ot,onSuccess:Lt}),mn=e=>ya(e)&&!(nd in e)?St(t=>Bn(cu(ZT(e,mC(t))))):Bn(cu(e)),V1=e=>he(ke(e),mn),Bn=e=>{const t=new n6(Qn);return t.effect_instruction_i0=e,t},c6=e=>he(ke(e),Bn),G1=St(e=>Ae(e.id())),Km=e=>St(t=>e(t.id())),he=O(2,(e,t)=>{const n=new An(_y);return n.effect_instruction_i0=e,n.effect_instruction_i1=t,n}),Pee=e=>{const t=new An("OnStep");return t.effect_instruction_i0=e,t},K1=e=>he(e,Qe),u6=O(2,(e,t)=>Vs(e,{onFailure:n=>Ae(t.onFailure(n)),onSuccess:n=>Ae(t.onSuccess(n))})),Vs=O(2,(e,t)=>{const n=new An(Ey);return n.effect_instruction_i0=e,n.effect_instruction_i1=t.onFailure,n.effect_instruction_i2=t.onSuccess,n}),Bo=O(2,(e,t)=>Vs(e,{onFailure:n=>{if(kD(n).length>0)return Bn(rX(n));const s=tX(n);return s.length>0?t.onFailure($T(s)):Bn(n)},onSuccess:t.onSuccess})),Io=O(2,(e,t)=>st(()=>{const n=Ct(e),r=N1(n.length);let s=0;return Hr(rC({while:()=>s<n.length,body:()=>t(n[s],s),step:a=>{r[s++]=a}}),r)})),W1=O(2,(e,t)=>st(()=>{const n=Ct(e);let r=0;return rC({while:()=>r<n.length,body:()=>t(n[r],r),step:()=>{r++}})})),ko=he(G1,e=>l6(e)),l6=e=>Bn(oa(e)),eC=e=>{const t=new An(Td);return t.effect_instruction_i0=lee(Tu),t.effect_instruction_i1=()=>e,t},d6=O(2,(e,t)=>va(n=>he(_i(n(e)),r=>I6(t,r)))),ot=O(2,(e,t)=>he(e,n=>ke(()=>t(n)))),f6=O(2,(e,t)=>Bo(e,{onFailure:n=>V1(()=>t.onFailure(n)),onSuccess:n=>ke(()=>t.onSuccess(n))})),Y1=O(2,(e,t)=>Vs(e,{onFailure:n=>{const r=SD(n);switch(r._tag){case"Left":return V1(()=>t(r.left));case"Right":return Bn(r.right)}},onSuccess:Ae})),fu=O(2,(e,t)=>va(n=>Vs(n(e),{onFailure:r=>{const s=Ot(r);return Vs(t(s),{onFailure:a=>Ot(vr(r,a)),onSuccess:()=>s})},onSuccess:r=>{const s=Lt(r);return un(t(s),s)}}))),Wm=O(2,(e,t)=>fu(e,tx({onFailure:n=>D1(n)?Gs(t(GT(n))):$t,onSuccess:()=>$t}))),Oee=e=>Lee(e,Qe),Lee=O(2,(e,t)=>Bo(e,{onFailure:n=>pi(t(n)),onSuccess:Ae})),$ee=St((e,t)=>Ae(t.runtimeFlags)),Ae=e=>{const t=new r6(Xn);return t.effect_instruction_i0=e,t},st=e=>{const t=new An(T1);return t.commit=e,t},ke=e=>{const t=new An(kM);return t.effect_instruction_i0=e,t},tC=O(e=>e.length===3||e.length===2&&!(ya(e[1])&&"onlyEffect"in e[1]),(e,t)=>he(e,n=>{const r=typeof t=="function"?t(n):t;return zo(r)?Hr(r,n):fY(r)?My(s=>{r.then(a=>s(Ae(n)),a=>s(mn(new uC(a,"An unknown error occurred in Effect.tap"))))}):Ae(n)})),jee=e=>St(t=>{const n=t.getFiberRef(Tw),r=B(n,Yt(()=>t.scope()));return e(Ld(Tw,Ce(r)))}),Ym=e=>{const t=new An(Td);return t.effect_instruction_i0=JD(Tu),t.effect_instruction_i1=()=>e,t},va=e=>a6(e,function(){const t=new An(Td);return t.effect_instruction_i0=JD(Tu),t.effect_instruction_i1=n=>WD(n)?ir(()=>this.effect_instruction_i0(eC)):ir(()=>this.effect_instruction_i0(Ym)),t}),$t=Ae(void 0),h6=e=>{const t=new An(Td);return t.effect_instruction_i0=e,t.effect_instruction_i1=void 0,t},nC=O(2,(e,t)=>he(t,n=>n?B(e,ot(Ce)):Ae(ye()))),rC=e=>{const t=new An(Ty);return t.effect_instruction_i0=e.while,t.effect_instruction_i1=e.body,t.effect_instruction_i2=e.step,t},_w=e=>st(()=>{const t=new An(uh);return t.effect_instruction_i0=e(),t}),m6=function(){const e=arguments.length===1?arguments[0]:arguments[1].bind(arguments[0]);return _w(()=>e(B))},p6=(e,...t)=>Object.defineProperty(t.length===0?function(...n){return _w(()=>e.apply(this,n))}:function(...n){let r=_w(()=>e.apply(this,n));for(const s of t)r=s(r,...n);return r},"length",{value:e.length,configurable:!0}),Mee=O(2,(e,t)=>{const n=new An(Td);return n.effect_instruction_i0=t,n.effect_instruction_i1=()=>e,n}),sC=e=>{const t=new An(Pb);return typeof e?.priority<"u"?tte(t,e.priority):t},J1=O(2,(e,t)=>he(e,n=>ot(t,r=>[n,r]))),Q1=O(2,(e,t)=>he(e,n=>Hr(t,n))),un=O(2,(e,t)=>he(e,()=>t)),g6=O(3,(e,t,n)=>he(e,r=>ot(t,s=>n(r,s)))),Dee=mi(()=>{const e=setInterval(()=>{},2147483647);return ke(()=>clearInterval(e))}),aC=e=>he(G1,t=>B(e,rm(t))),rm=O(2,(e,t)=>he(e.interruptAsFork(t),()=>e.await)),Fee={_tag:"All",syslog:0,label:"ALL",ordinal:Number.MIN_SAFE_INTEGER,pipe(){return je(this,arguments)}},Bee={_tag:"Fatal",syslog:2,label:"FATAL",ordinal:5e4,pipe(){return je(this,arguments)}},Uee={_tag:"Error",syslog:3,label:"ERROR",ordinal:4e4,pipe(){return je(this,arguments)}},b6={_tag:"Warning",syslog:4,label:"WARN",ordinal:3e4,pipe(){return je(this,arguments)}},y6={_tag:"Info",syslog:6,label:"INFO",ordinal:2e4,pipe(){return je(this,arguments)}},x6={_tag:"Debug",syslog:7,label:"DEBUG",ordinal:1e4,pipe(){return je(this,arguments)}},zee={_tag:"Trace",syslog:7,label:"TRACE",ordinal:0,pipe(){return je(this,arguments)}},Hee={_tag:"None",syslog:7,label:"OFF",ordinal:Number.MAX_SAFE_INTEGER,pipe(){return je(this,arguments)}},qee="effect/FiberRef",Vee=Symbol.for(qee),Gee={_A:e=>e},oC=e=>St(t=>Lt(t.getFiberRef(e))),X1=O(2,(e,t)=>he(oC(e),t)),wN=O(2,(e,t)=>Kee(e,()=>[void 0,t])),Kee=O(2,(e,t)=>St(n=>{const[r,s]=t(n.getFiberRef(e));return n.setFiberRef(e,s),Ae(r)})),Ld=O(3,(e,t,n)=>s6(Q1(oC(t),wN(t,n)),()=>e,r=>wN(t,r))),Wee=O(3,(e,t,n)=>X1(t,r=>Ld(e,t,n(r)))),zn=(e,t)=>$d(e,{differ:qD(),fork:t?.fork??Qe,join:t?.join}),Yee=e=>{const t=WZ();return $d(e,{differ:t,fork:t.empty})},Jee=e=>{const t=YZ(qD());return $d(e,{differ:t,fork:t.empty})},k6=e=>{const t=KZ();return $d(e,{differ:t,fork:t.empty})},$d=(e,t)=>({...Dm,[Vee]:Gee,initial:e,commit(){return oC(this)},diff:(r,s)=>t.differ.diff(r,s),combine:(r,s)=>t.differ.combine(r,s),patch:r=>s=>t.differ.patch(r,s),fork:t.fork,join:t.join??((r,s)=>s)}),Qee=e=>$d(e,{differ:kN,fork:kN.empty}),no=Ve(Symbol.for("effect/FiberRef/currentContext"),()=>k6(xa())),jd=Ve(Symbol.for("effect/FiberRef/currentSchedulingPriority"),()=>zn(0)),v6=Ve(Symbol.for("effect/FiberRef/currentMaxOpsBeforeYield"),()=>zn(2048)),Xee=Ve(Symbol.for("effect/FiberRef/currentLogAnnotation"),()=>zn(U1())),Zee=Ve(Symbol.for("effect/FiberRef/currentLogLevel"),()=>zn(y6)),ete=Ve(Symbol.for("effect/FiberRef/currentLogSpan"),()=>zn(od())),tte=O(2,(e,t)=>Ld(e,jd,t)),nte=Ve(Symbol.for("effect/FiberRef/currentConcurrency"),()=>zn("unbounded")),rte=Ve(Symbol.for("effect/FiberRef/currentRequestBatching"),()=>zn(!0)),ste=Ve(Symbol.for("effect/FiberRef/currentUnhandledErrorLogLevel"),()=>zn(Ce(x6))),ate=Ve(Symbol.for("effect/FiberRef/versionMismatchErrorLogLevel"),()=>zn(Ce(b6))),Ew=Ve(Symbol.for("effect/FiberRef/currentMetricLabels"),()=>Jee(Li())),Tw=Ve(Symbol.for("effect/FiberRef/currentForkScopeOverride"),()=>zn(ye(),{fork:()=>ye(),join:(e,t)=>e})),Vp=Ve(Symbol.for("effect/FiberRef/currentInterruptedCause"),()=>zn(ji,{fork:()=>ji,join:(e,t)=>e})),S6=Ve(Symbol.for("effect/FiberRef/currentTracerEnabled"),()=>zn(!0)),w6=Ve(Symbol.for("effect/FiberRef/currentTracerTiming"),()=>zn(!0)),ote=Ve(Symbol.for("effect/FiberRef/currentTracerSpanAnnotations"),()=>zn(U1())),ite=Ve(Symbol.for("effect/FiberRef/currentTracerSpanLinks"),()=>zn(pr())),_N=Symbol.for("effect/Scope"),EN=Symbol.for("effect/CloseableScope"),_6=(e,t)=>e.addFinalizer(()=>Gs(t)),Dy=(e,t)=>e.addFinalizer(t),Cw=(e,t)=>e.close(t),Eo=(e,t)=>e.fork(t),cte=e=>ute(Qe)(e),ute=O(2,(e,t)=>{const n=B(e,vD,Jr(t));switch(n._tag){case"None":return B(kD(e),LT,yn({onNone:()=>{const r=Ct(GT(e)).flatMap(s=>Ct(OD(s)).map(a=>`#${a}`));return new dte(r?`Interrupted by fibers: ${r.join(", ")}`:void 0)},onSome:Qe}));case"Some":return n.value}}),iC=(function(){class e extends globalThis.Error{commit(){return mn(this)}toJSON(){const n={...this};return this.message&&(n.message=this.message),this.cause&&(n.cause=this.cause),n}[xt](){return this.toString!==globalThis.Error.prototype.toString?this.stack?`${this.toString()}
|
|
16
|
-
${this.stack.split(`
|
|
17
|
-
`).slice(1).join(`
|
|
18
|
-
`)}`:this.toString():"Bun"in globalThis?Pd(cu(this),{renderErrorCause:!0}):this}}return Object.assign(e.prototype,DY),e})(),cC=(e,t)=>{class n extends iC{_tag=t}return Object.assign(n.prototype,e),n.prototype.name=t,n},TN=Symbol.for("effect/Cause/errors/RuntimeException"),lte=cC({[TN]:TN},"RuntimeException"),Iw=Symbol.for("effect/Cause/errors/InterruptedException"),dte=cC({[Iw]:Iw},"InterruptedException"),fte=e=>Be(e,Iw),CN=Symbol.for("effect/Cause/errors/NoSuchElement"),Z1=cC({[CN]:CN},"NoSuchElementException"),IN=Symbol.for("effect/Cause/errors/UnknownException"),uC=(function(){class e extends iC{_tag="UnknownException";error;constructor(n,r){super(r??"An unknown error occurred",{cause:n}),this.error=n}}return Object.assign(e.prototype,{[IN]:IN,name:"UnknownException"}),e})(),ex=e=>zo(e)&&"_tag"in e&&(e._tag==="Success"||e._tag==="Failure"),E6=e=>e._tag==="Failure",hte=e=>e._tag==="Success",jb=O(2,(e,t)=>{switch(e._tag){case Qn:return Ot(e.effect_instruction_i0);case Xn:return Lt(t)}}),av=e=>jb(e,void 0),Pl=(e,t)=>yte(e,t?.parallel?Mi:vr),T6=e=>Ot(zs(e)),sm=e=>Ot(cu(e)),Ot=e=>{const t=new n6(Qn);return t.effect_instruction_i0=e,t},mte=O(2,(e,t)=>{switch(e._tag){case Qn:return Ot(e.effect_instruction_i0);case Xn:return t(e.effect_instruction_i0)}}),pte=e=>B(e,mte(Qe)),gte=e=>Ot(oa(e)),Mb=O(2,(e,t)=>{switch(e._tag){case Qn:return Ot(e.effect_instruction_i0);case Xn:return Lt(t(e.effect_instruction_i0))}}),tx=O(2,(e,{onFailure:t,onSuccess:n})=>{switch(e._tag){case Qn:return t(e.effect_instruction_i0);case Xn:return n(e.effect_instruction_i0)}}),Aw=O(2,(e,{onFailure:t,onSuccess:n})=>{switch(e._tag){case Qn:return t(e.effect_instruction_i0);case Xn:return n(e.effect_instruction_i0)}}),Lt=e=>{const t=new r6(Xn);return t.effect_instruction_i0=e,t},Sr=Lt(void 0),bte=O(2,(e,t)=>lC(e,t,{onSuccess:(n,r)=>[n,r],onFailure:vr})),C6=O(2,(e,t)=>lC(e,t,{onSuccess:(n,r)=>r,onFailure:vr})),lC=O(3,(e,t,{onFailure:n,onSuccess:r})=>{switch(e._tag){case Qn:switch(t._tag){case Xn:return Ot(e.effect_instruction_i0);case Qn:return Ot(n(e.effect_instruction_i0,t.effect_instruction_i0))}case Xn:switch(t._tag){case Xn:return Lt(r(e.effect_instruction_i0,t.effect_instruction_i0));case Qn:return Ot(t.effect_instruction_i0)}}}),yte=(e,t)=>{const n=Jl(e);return Fo(n)?B(Co(n),NT(B(za(n),Mb(In)),(r,s)=>B(r,lC(s,{onSuccess:(a,o)=>B(a,Tr(o)),onFailure:t}))),Mb(Do),Mb(r=>Us(r)),Ce):ye()},nx=e=>({...Dm,[Cee]:Iee,state:Fm(Aee([])),commit(){return Di(this)},blockingOn:e}),rx=()=>he(G1,e=>xte(e)),xte=e=>ke(()=>nx(e)),Di=e=>mi(t=>{const n=On(e.state);switch(n._tag){case q1:return t(n.effect);case Vm:return n.joiners.push(t),vte(e,t)}},e.blockingOn),sx=O(2,(e,t)=>ke(()=>{const n=On(e.state);switch(n._tag){case q1:return!1;case Vm:{Bm(e.state,e6(t));for(let r=0,s=n.joiners.length;r<s;r++)n.joiners[r](t);return!0}}})),I6=O(2,(e,t)=>sx(e,t)),A6=O(2,(e,t)=>sx(e,Bn(t))),N6=O(2,(e,t)=>sx(e,l6(t))),kte=e=>ke(()=>On(e.state)._tag===q1),dC=O(2,(e,t)=>sx(e,Ae(t))),ax=(e,t)=>{const n=On(e.state);if(n._tag===Vm){Bm(e.state,e6(t));for(let r=0,s=n.joiners.length;r<s;r++)n.joiners[r](t)}},vte=(e,t)=>ke(()=>{const n=On(e.state);if(n._tag===Vm){const r=n.joiners.indexOf(t);r>=0&&n.joiners.splice(r,1)}}),Ste=St(e=>Lt(e.currentContext)),fC=()=>Ste,Cu=e=>he(fC(),e),ox=O(2,(e,t)=>Ld(no,t)(e)),hC=O(2,(e,t)=>Wee(no,n=>Zr(n,t))(e)),R6=O(2,(e,t)=>Cu(n=>ox(e,t(n)))),mC=e=>{const t=e.currentSpan;return t!==void 0&&t._tag==="Span"?Ce(t):ye()},wte={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:BigInt(0),endTime:BigInt(0),exit:Sr},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},_te=e=>Object.assign(Object.create(wte),e),Ete="effect/Clock",AN=Symbol.for(Ete),Md=Hi("effect/Clock"),Tte=2**31-1,NN={unsafeSchedule(e,t){const n=Ly(t);if(n>Tte)return Po;let r=!1;const s=setTimeout(()=>{r=!0,e()},n);return()=>(clearTimeout(s),!r)}},RN=(function(){const e=BigInt(1e6);if(typeof performance>"u"||typeof performance.now!="function")return()=>BigInt(Date.now())*e;let t;return()=>(t===void 0&&(t=BigInt(Date.now())*e-BigInt(Math.round(performance.now()*1e6))),t+BigInt(Math.round(performance.now()*1e6)))})(),Cte=(function(){const e=typeof process=="object"&&"hrtime"in process&&typeof process.hrtime.bigint=="function"?process.hrtime:void 0;if(!e)return RN;const t=RN()-e.bigint();return()=>t+e.bigint()})();class Ite{[AN]=AN;unsafeCurrentTimeMillis(){return Date.now()}unsafeCurrentTimeNanos(){return Cte()}currentTimeMillis=ke(()=>this.unsafeCurrentTimeMillis());currentTimeNanos=ke(()=>this.unsafeCurrentTimeNanos());scheduler(){return Ae(NN)}sleep(t){return ka(n=>{const r=NN.unsafeSchedule(()=>n($t),t);return Gs(ke(r))})}}const Ate=()=>new Ite,cd=wJ,Fy=e=>e.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&"),P6="And",O6="Or",L6="InvalidData",$6="MissingData",j6="SourceUnavailable",M6="Unsupported",Nte="effect/ConfigError",PN=Symbol.for(Nte),Dd={_tag:"ConfigError",[PN]:PN},D6=(e,t)=>{const n=Object.create(Dd);return n._op=P6,n.left=e,n.right=t,Object.defineProperty(n,"toString",{enumerable:!1,value(){return`${this.left} and ${this.right}`}}),Object.defineProperty(n,"message",{enumerable:!1,get(){return this.toString()}}),n},F6=(e,t)=>{const n=Object.create(Dd);return n._op=O6,n.left=e,n.right=t,Object.defineProperty(n,"toString",{enumerable:!1,value(){return`${this.left} or ${this.right}`}}),Object.defineProperty(n,"message",{enumerable:!1,get(){return this.toString()}}),n},Rte=(e,t,n={pathDelim:"."})=>{const r=Object.create(Dd);return r._op=L6,r.path=e,r.message=t,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`(Invalid data at ${B(this.path,Id(n.pathDelim))}: "${this.message}")`}}),r},hu=(e,t,n={pathDelim:"."})=>{const r=Object.create(Dd);return r._op=$6,r.path=e,r.message=t,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`(Missing data at ${B(this.path,Id(n.pathDelim))}: "${this.message}")`}}),r},Pte=(e,t,n,r={pathDelim:"."})=>{const s=Object.create(Dd);return s._op=j6,s.path=e,s.message=t,s.cause=n,Object.defineProperty(s,"toString",{enumerable:!1,value(){return`(Source unavailable at ${B(this.path,Id(r.pathDelim))}: "${this.message}")`}}),s},Ote=(e,t,n={pathDelim:"."})=>{const r=Object.create(Dd);return r._op=M6,r.path=e,r.message=t,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`(Unsupported operation at ${B(this.path,Id(n.pathDelim))}: "${this.message}")`}}),r},Lc=O(2,(e,t)=>{switch(e._op){case P6:return D6(Lc(e.left,t),Lc(e.right,t));case O6:return F6(Lc(e.left,t),Lc(e.right,t));case L6:return Rte([...t,...e.path],e.message);case $6:return hu([...t,...e.path],e.message);case j6:return Pte([...t,...e.path],e.message,e.cause);case M6:return Ote([...t,...e.path],e.message)}}),Lte={_tag:"Empty"},ov=O(2,(e,t)=>{let n=QT(t),r=e;for(;ZX(n);){const s=n.head;switch(s._tag){case"Empty":{n=n.tail;break}case"AndThen":{n=lu(s.first,lu(s.second,n.tail));break}case"MapName":{r=Kc(r,s.f),n=n.tail;break}case"Nested":{r=Iy(r,s.name),n=n.tail;break}case"Unnested":{if(B(lh(r),OJ(s.name)))r=su(r),n=n.tail;else return Ye(hu(r,`Expected ${s.name} to be in path in ConfigProvider#unnested`));break}}}return nt(r)}),$te="Constant",jte="Fail",Mte="Fallback",Dte="Described",Fte="Lazy",Bte="MapOrFail",Ute="Nested",zte="Primitive",Hte="Sequence",qte="HashMap",Vte="ZipWith";var ON={};const By=(e,t)=>[...e,...t],Gte="effect/ConfigProvider",LN=Symbol.for(Gte),Kte=Hi("effect/ConfigProvider"),Wte="effect/ConfigProviderFlat",$N=Symbol.for(Wte),Yte=e=>({[LN]:LN,pipe(){return je(this,arguments)},...e}),Jte=e=>({[$N]:$N,patch:e.patch,load:(t,n,r=!0)=>e.load(t,n,r),enumerateChildren:e.enumerateChildren}),Qte=e=>Yte({load:t=>he(Ns(e,Li(),t,!1),n=>yn(lh(n),{onNone:()=>mn(hu(Li(),`Expected a single value having structure: ${t}`)),onSome:Ae})),flattened:e}),Xte=e=>{const{pathDelim:t,seqDelim:n}=Object.assign({},{pathDelim:"_",seqDelim:","},e),r=c=>B(c,Id(t)),s=c=>c.split(t),a=()=>typeof process<"u"&&"env"in process&&typeof ON=="object"?ON:{};return Qte(Jte({load:(c,u,l=!0)=>{const d=r(c),h=a(),m=d in h?Ce(h[d]):ye();return B(m,Y1(()=>hu(c,`Expected ${d} to exist in the process context`)),he(p=>rne(p,c,u,n,l)))},enumerateChildren:c=>ke(()=>{const u=a(),h=Object.keys(u).map(m=>s(m.toUpperCase())).filter(m=>{for(let p=0;p<c.length;p++){const y=B(c,KM(p)),g=m[p];if(g===void 0||y!==g)return!1}return!0}).flatMap(m=>m.slice(c.length,c.length+1));return YQ(h)}),patch:Lte}))},Zte=(e,t,n,r)=>{const s=aN(n.length,c=>c>=r.length?ye():Ce([e(c),c+1])),a=aN(r.length,c=>c>=n.length?ye():Ce([t(c),c+1])),o=By(n,s),i=By(r,a);return[o,i]},ene=(e,t)=>{let n=t;if(n._tag==="Nested"){const r=e.slice();for(;n._tag==="Nested";)r.push(n.name),n=n.config;return r}return e},Ns=(e,t,n,r)=>{const s=n;switch(s._tag){case $te:return Ae(na(s.value));case Dte:return st(()=>Ns(e,t,s.config,r));case jte:return mn(hu(t,s.message));case Mte:return B(st(()=>Ns(e,t,s.first,r)),nm(a=>s.condition(a)?B(Ns(e,t,s.second,r),nm(o=>mn(F6(a,o)))):mn(a)));case Fte:return st(()=>Ns(e,t,s.config(),r));case Bte:return st(()=>B(Ns(e,t,s.original,r),he(Io(a=>B(s.mapOrFail(a),Y1(Lc(ene(t,s.original))))))));case Ute:return st(()=>Ns(e,By(t,na(s.name)),s.config,r));case zte:return B(ov(t,e.patch),he(a=>B(e.load(a,s,r),he(o=>{if(o.length===0){const i=B(JJ(a),Yt(()=>"<n/a>"));return mn(hu([],`Expected ${s.description} with name ${i}`))}return Ae(o)}))));case Hte:return B(ov(t,e.patch),he(a=>B(e.enumerateChildren(a),he(ane),he(o=>o.length===0?st(()=>ot(Ns(e,t,s.config,!0),na)):B(Io(o,i=>Ns(e,qJ(t,`[${i}]`),s.config,!0)),ot(i=>{const c=JM(i);return c.length===0?na(Li()):na(c)}))))));case qte:return st(()=>B(ov(t,e.patch),he(a=>B(e.enumerateChildren(a),he(o=>B(o,Io(i=>Ns(e,By(a,na(i)),s.valueConfig,r)),ot(i=>i.length===0?na(U1()):B(sne(i),Kc(c=>HX(sN(Ct(o),c)))))))))));case Vte:return st(()=>B(Ns(e,t,s.left,r),id,he(a=>B(Ns(e,t,s.right,r),id,he(o=>{if(ar(a)&&ar(o))return mn(D6(a.left,o.left));if(ar(a)&&Ua(o))return mn(a.left);if(Ua(a)&&ar(o))return mn(o.left);if(Ua(a)&&Ua(o)){const i=B(t,Id(".")),c=tne(t,i),[u,l]=Zte(c,c,B(a.right,Kc(nt)),B(o.right,Kc(nt)));return B(u,sN(l),Io(([d,h])=>B(J1(d,h),ot(([m,p])=>s.zip(m,p)))))}throw new Error("BUG: ConfigProvider.fromFlatLoop - please report an issue at https://github.com/Effect-TS/effect/issues")})))))}},tne=(e,t)=>n=>Ye(hu(e,`The element at index ${n} in a sequence at path "${t}" was missing`)),nne=(e,t)=>e.split(new RegExp(`\\s*${Fy(t)}\\s*`)),rne=(e,t,n,r,s)=>s?B(nne(e,r),Io(a=>n.parse(a.trim())),Y1(Lc(t))):B(n.parse(e),f6({onFailure:Lc(t),onSuccess:na})),sne=e=>Object.keys(e[0]).map(t=>e.map(n=>n[t])),ane=e=>B(Io(e,ine),f6({onFailure:()=>Li(),onSuccess:Yh(cd)}),id,ot(SJ)),one=/^(\[(\d+)\])$/,ine=e=>{const t=e.match(one);if(t!==null){const n=t[2];return B(n!==void 0&&n.length>0?Ce(n):ye(),Vi(cne))}return ye()},cne=e=>{const t=Number.parseInt(e);return Number.isNaN(t)?ye():Ce(t)},jN=Symbol.for("effect/Console"),B6=Hi("effect/Console"),une={[jN]:jN,assert(e,...t){return ke(()=>{console.assert(e,...t)})},clear:ke(()=>{console.clear()}),count(e){return ke(()=>{console.count(e)})},countReset(e){return ke(()=>{console.countReset(e)})},debug(...e){return ke(()=>{console.debug(...e)})},dir(e,t){return ke(()=>{console.dir(e,t)})},dirxml(...e){return ke(()=>{console.dirxml(...e)})},error(...e){return ke(()=>{console.error(...e)})},group(e){return e?.collapsed?ke(()=>console.groupCollapsed(e?.label)):ke(()=>console.group(e?.label))},groupEnd:ke(()=>{console.groupEnd()}),info(...e){return ke(()=>{console.info(...e)})},log(...e){return ke(()=>{console.log(...e)})},table(e,t){return ke(()=>{console.table(e,t)})},time(e){return ke(()=>console.time(e))},timeEnd(e){return ke(()=>console.timeEnd(e))},timeLog(e,...t){return ke(()=>{console.timeLog(e,...t)})},trace(...e){return ke(()=>{console.trace(...e)})},warn(...e){return ke(()=>{console.warn(...e)})},unsafe:console},lne="effect/Random",MN=Symbol.for(lne),dne=Hi("effect/Random");class fne{seed;[MN]=MN;PRNG;constructor(t){this.seed=t,this.PRNG=new xY(t)}get next(){return ke(()=>this.PRNG.number())}get nextBoolean(){return ot(this.next,t=>t>.5)}get nextInt(){return ke(()=>this.PRNG.integer(Number.MAX_SAFE_INTEGER))}nextRange(t,n){return ot(this.next,r=>(n-t)*r+t)}nextIntBetween(t,n){return ke(()=>this.PRNG.integer(n-t)+t)}shuffle(t){return hne(t,n=>this.nextIntBetween(0,n))}}const hne=(e,t)=>st(()=>B(ke(()=>Array.from(e)),he(n=>{const r=[];for(let s=n.length;s>=2;s=s-1)r.push(s);return B(r,W1(s=>B(t(s),ot(a=>mne(n,s-1,a)))),Hr(Jl(n)))}))),mne=(e,t,n)=>{const r=e[t];return e[t]=e[n],e[n]=r,e},pne=e=>new fne(Pe(e)),DN=Symbol.for("effect/Tracer"),gne=e=>({[DN]:DN,...e}),pC=Hi("effect/Tracer"),ix=Hi("effect/ParentSpan"),FN=(function(){const e="abcdef0123456789",t=e.length;return function(n){let r="";for(let s=0;s<n;s++)r+=e.charAt(Math.floor(Math.random()*t));return r}})();class bne{name;parent;context;startTime;kind;_tag="Span";spanId;traceId="native";sampled=!0;status;attributes;events=[];links;constructor(t,n,r,s,a,o){this.name=t,this.parent=n,this.context=r,this.startTime=a,this.kind=o,this.status={_tag:"Started",startTime:a},this.attributes=new Map,this.traceId=n._tag==="Some"?n.value.traceId:FN(32),this.spanId=FN(16),this.links=Array.from(s)}end(t,n){this.status={_tag:"Ended",endTime:t,exit:n,startTime:this.status.startTime}}attribute(t,n){this.attributes.set(t,n)}event(t,n,r){this.events.push([t,n,r??{}])}addLinks(t){this.links.push(...t)}}const yne=gne({span:(e,t,n,r,s,a)=>new bne(e,t,n,r,s,a),context:e=>e()}),xne=e=>{if(e?.captureStackTrace===!1)return e;if(e?.captureStackTrace!==void 0&&typeof e.captureStackTrace!="boolean")return e;const t=Error.stackTraceLimit;Error.stackTraceLimit=3;const n=new Error;Error.stackTraceLimit=t;let r=!1;return{...e,captureStackTrace:()=>{if(r!==!1)return r;if(n.stack!==void 0){const s=n.stack.split(`
|
|
19
|
-
`);if(s[3]!==void 0)return r=s[3].trim(),r}}}},Nw=_u()("effect/Tracer/DisablePropagation",{defaultValue:Po}),kne=B(xa(),ds(Md,Ate()),ds(B6,une),ds(dne,pne(Math.random())),ds(Kte,Xte()),ds(pC,yne)),ud=Ve(Symbol.for("effect/DefaultServices/currentServices"),()=>k6(kne)),vne=e=>{const t=qs(e);return U6(n=>n.sleep(t))},Sne=e=>St(t=>e(t.currentDefaultServices)),U6=e=>Sne(t=>e(t.unsafeMap.get(Md.key))),wne=U6(e=>e.currentTimeMillis),_ne=Mm,Ene=FY;let Fd=class extends Ene{};const z6="Sequential",H6="Parallel",Tne="ParallelN",Yc={_tag:z6},Rw={_tag:H6},Cne=e=>({_tag:Tne,parallelism:e}),Ine=e=>e._tag===z6,Ane=e=>e._tag===H6,Uy=Yc,Pw=Rw,Ow=Cne;function Nne(e){return new Fi(e)}function Rne(){return Nne(new Map)}const BN=Symbol.for("effect/FiberRefs");class Fi{locals;[BN]=BN;constructor(t){this.locals=t}pipe(){return je(this,arguments)}}const Pne=(e,t,n,r=!1)=>{const s=e;let a=t,o=n,i=r,c;for(;c===void 0;)if(sn(a)&&sn(o)){const u=zr(a)[0],l=su(a),d=zr(o)[0],h=zr(o)[1],m=su(o);u.startTimeMillis<d.startTimeMillis?(o=m,i=!0):u.startTimeMillis>d.startTimeMillis?a=l:u.id<d.id?(o=m,i=!0):u.id>d.id?a=l:c=[h,i]}else c=[s.initial,!0];return c},One=O(3,(e,t,n)=>{const r=new Map(e.locals);return n.locals.forEach((s,a)=>{const o=s[0][1];if(!s[0][0][Ze](t)){if(!r.has(a)){if(Fe(o,a.initial))return;r.set(a,[[t,a.join(a.initial,o)]]);return}const i=r.get(a),[c,u]=Pne(a,i,s);if(u){const l=a.diff(c,o),d=i[0][1],h=a.join(d,a.patch(l)(d));if(!Fe(d,h)){let m;const p=i[0][0];p[Ze](t)?m=[[p,h],...i.slice(1)]:m=[[t,h],...i],r.set(a,m)}}}}),new Fi(r)}),Lne=O(2,(e,t)=>{const n=new Map;return q6(e,n,t),new Fi(n)}),q6=(e,t,n)=>{e.locals.forEach((r,s)=>{const a=r[0][1],o=s.patch(s.fork)(a);Fe(a,o)?t.set(s,r):t.set(s,[[n,o],...r])})},V6=O(2,(e,t)=>{const n=new Map(e.locals);return n.delete(t),new Fi(n)}),G6=O(2,(e,t)=>e.locals.has(t)?Ce(zr(e.locals.get(t))[1]):ye()),am=O(2,(e,t)=>B(G6(e,t),Yt(()=>t.initial))),Lw=O(2,(e,{fiberId:t,fiberRef:n,value:r})=>{if(e.locals.size===0)return new Fi(new Map([[n,[[t,r]]]]));const s=new Map(e.locals);return $w(s,t,n,r),new Fi(s)}),$w=(e,t,n,r)=>{const s=e.get(n)??[];let a;if(sn(s)){const[o,i]=zr(s);if(o[Ze](t)){if(Fe(i,r))return;a=[[t,r],...s.slice(1)]}else a=[[t,r],...s]}else a=[[t,r]];e.set(n,a)},$ne=O(2,(e,{entries:t,forkAs:n})=>{if(e.locals.size===0)return new Fi(new Map(t));const r=new Map(e.locals);return n!==void 0&&q6(e,r,n),t.forEach(([s,a])=>{a.length===1?$w(r,a[0][0],s,a[0][1]):a.forEach(([o,i])=>{$w(r,o,s,i)})}),new Fi(r)}),UN=G6,K6=am,jne=$ne,Mne=Rne,W6="Empty",Y6="Add",J6="Remove",Q6="Update",X6="AndThen",Dne={_tag:W6},gC=(e,t)=>{const n=new Map(e.locals);let r=Dne;for(const[s,a]of t.locals.entries()){const o=zr(a)[1],i=n.get(s);if(i!==void 0){const c=zr(i)[1];Fe(c,o)||(r=iv({_tag:Q6,fiberRef:s,patch:s.diff(c,o)})(r))}else r=iv({_tag:Y6,fiberRef:s,value:o})(r);n.delete(s)}for(const[s]of n.entries())r=iv({_tag:J6,fiberRef:s})(r);return r},iv=O(2,(e,t)=>({_tag:X6,first:e,second:t})),Z6=O(3,(e,t,n)=>{let r=n,s=na(e);for(;sn(s);){const a=zr(s),o=su(s);switch(a._tag){case W6:{s=o;break}case Y6:{r=Lw(r,{fiberId:t,fiberRef:a.fiberRef,value:a.value}),s=o;break}case J6:{r=V6(r,a.fiberRef),s=o;break}case Q6:{const i=am(r,a.fiberRef);r=Lw(r,{fiberId:t,fiberRef:a.fiberRef,value:a.fiberRef.patch(a.patch)(i)}),s=o;break}case X6:{s=Iy(a.first)(Iy(a.second)(o));break}}}return r}),om=gC,im=Z6,cx="effect/FiberStatus",mu=Symbol.for(cx),zy="Done",zN="Running",HN="Suspended",Fne=Wt(`${cx}-${zy}`);let Bne=class{[mu]=mu;_tag=zy;[Xe](){return Fne}[Ze](t){return bC(t)&&t._tag===zy}};class Une{runtimeFlags;[mu]=mu;_tag=zN;constructor(t){this.runtimeFlags=t}[Xe](){return B(Pe(cx),tt(Pe(this._tag)),tt(Pe(this.runtimeFlags)),Mt(this))}[Ze](t){return bC(t)&&t._tag===zN&&this.runtimeFlags===t.runtimeFlags}}class zne{runtimeFlags;blockingOn;[mu]=mu;_tag=HN;constructor(t,n){this.runtimeFlags=t,this.blockingOn=n}[Xe](){return B(Pe(cx),tt(Pe(this._tag)),tt(Pe(this.runtimeFlags)),tt(Pe(this.blockingOn)),Mt(this))}[Ze](t){return bC(t)&&t._tag===HN&&this.runtimeFlags===t.runtimeFlags&&Fe(this.blockingOn,t.blockingOn)}}const Hne=new Bne,qne=e=>new Une(e),Vne=(e,t)=>new zne(e,t),bC=e=>Be(e,mu),Gne=e=>e._tag===zy,Kne=Hne,e5=qne,Wne=Vne,Yne=Gne,Jne=Fee,Qne=Bee,Xne=Uee,Zne=b6,ere=y6,tre=x6,nre=zee,rre=Hee,sre=B(cd,UM(e=>e.ordinal)),are=_J(sre),ore=e=>{switch(e){case"All":return Jne;case"Debug":return tre;case"Error":return Xne;case"Fatal":return Qne;case"Info":return ere;case"Trace":return nre;case"None":return rre;case"Warning":return Zne}},ire=Symbol.for("effect/Micro"),Hy=Symbol.for("effect/Micro/MicroExit"),qN=Symbol.for("effect/Micro/MicroCause"),cre={_E:Qe};class t5 extends globalThis.Error{_tag;traces;[qN];constructor(t,n,r){const s=`MicroCause.${t}`;let a,o,i;if(n instanceof globalThis.Error){a=`(${s}) ${n.name}`,o=n.message;const c=o.split(`
|
|
20
|
-
`).length;i=n.stack?`(${s}) ${n.stack.split(`
|
|
21
|
-
`).slice(0,c+3).join(`
|
|
22
|
-
`)}`:`${a}: ${o}`}else a=s,o=Wl(n,0),i=`${a}: ${o}`;r.length>0&&(i+=`
|
|
23
|
-
${r.join(`
|
|
24
|
-
`)}`),super(o),this._tag=t,this.traces=r,this[qN]=cre,this.name=a,this.stack=i}pipe(){return je(this,arguments)}toString(){return this.stack}[xt](){return this.stack}}class ure extends t5{defect;constructor(t,n=[]){super("Die",t,n),this.defect=t}}const lre=(e,t=[])=>new ure(e,t);let dre=class extends t5{constructor(t=[]){super("Interrupt","interrupted",t)}};const fre=(e=[])=>new dre(e),hre=e=>e._tag==="Interrupt",VN=Symbol.for("effect/Micro/MicroFiber"),mre={_A:Qe,_E:Qe};class pre{context;interruptible;[VN];_stack=[];_observers=[];_exit;_children;currentOpCount=0;constructor(t,n=!0){this.context=t,this.interruptible=n,this[VN]=mre}getRef(t){return tJ(this.context,t)}addObserver(t){return this._exit?(t(this._exit),Kl):(this._observers.push(t),()=>{const n=this._observers.indexOf(t);n>=0&&this._observers.splice(n,1)})}_interrupted=!1;unsafeInterrupt(){this._exit||(this._interrupted=!0,this.interruptible&&this.evaluate(SC))}unsafePoll(){return this._exit}evaluate(t){if(this._exit)return;if(this._yielded!==void 0){const s=this._yielded;this._yielded=void 0,s()}const n=this.runLoop(t);if(n===Gp)return;const r=GN.interruptChildren&&GN.interruptChildren(this);if(r!==void 0)return this.evaluate(Vy(r,()=>n));this._exit=n;for(let s=0;s<this._observers.length;s++)this._observers[s](n);this._observers.length=0}runLoop(t){let n=!1,r=t;this.currentOpCount=0;try{for(;;){if(this.currentOpCount++,!n&&this.getRef(wC).shouldYield(this)){n=!0;const s=r;r=Vy(kre,()=>s)}if(r=r[jw](this),r===Gp){const s=this._yielded;return Hy in s?(this._yielded=void 0,s):Gp}}}catch(s){return Be(r,jw)?Mw(s):Mw(`MicroFiber.runLoop: Not a valid effect: ${String(r)}`)}}getCont(t){for(;;){const n=this._stack.pop();if(!n)return;const r=n[qy]&&n[qy](this);if(r)return{[t]:r};if(n[t])return n}}_yielded=void 0;yieldWith(t){return this._yielded=t,Gp}children(){return this._children??=new Set}}const GN=Ve("effect/Micro/fiberMiddleware",()=>({interruptChildren:void 0})),n5=Symbol.for("effect/Micro/identifier"),Mn=Symbol.for("effect/Micro/args"),jw=Symbol.for("effect/Micro/evaluate"),ld=Symbol.for("effect/Micro/successCont"),Ol=Symbol.for("effect/Micro/failureCont"),qy=Symbol.for("effect/Micro/ensureCont"),Gp=Symbol.for("effect/Micro/Yield"),gre={_A:Qe,_E:Qe,_R:Qe},bre={..._ne,_op:"Micro",[ire]:gre,pipe(){return je(this,arguments)},[Symbol.iterator](){return new mM(new $m(this))},toJSON(){return{_id:"Micro",op:this[n5],...Mn in this?{args:this[Mn]}:void 0}},toString(){return zt(this)},[xt](){return zt(this)}};function yre(e){return Mw("Micro.evaluate: Not implemented")}const ux=e=>({...bre,[n5]:e.op,[jw]:e.eval??yre,[ld]:e.contA,[Ol]:e.contE,[qy]:e.ensure}),yC=e=>{const t=ux(e);return function(){const n=Object.create(t);return n[Mn]=e.single===!1?arguments:arguments[0],n}},r5=e=>{const t={...ux(e),[Hy]:Hy,_tag:e.op,get[e.prop](){return this[Mn]},toJSON(){return{_id:"MicroExit",_tag:e.op,[e.prop]:this[Mn]}},[Ze](n){return wre(n)&&n._tag===e.op&&Fe(this[Mn],n[Mn])},[Xe](){return Mt(this,tt(Wt(e.op))(Pe(this[Mn])))}};return function(n){const r=Object.create(t);return r[Mn]=n,r[ld]=void 0,r[Ol]=void 0,r[qy]=void 0,r}},xC=r5({op:"Success",prop:"value",eval(e){const t=e.getCont(ld);return t?t[ld](this[Mn],e):e.yieldWith(this)}}),s5=r5({op:"Failure",prop:"cause",eval(e){let t=e.getCont(Ol);for(;hre(this[Mn])&&t&&e.interruptible;)t=e.getCont(Ol);return t?t[Ol](this[Mn],e):e.yieldWith(this)}}),xre=yC({op:"Yield",eval(e){let t=!1;return e.getRef(wC).scheduleTask(()=>{t||e.evaluate(_re)},this[Mn]??0),e.yieldWith(()=>{t=!0})}}),kre=xre(0),vre=xC(void 0),kC=yC({op:"WithMicroFiber",eval(e){return this[Mn](e)}}),Vy=O(2,(e,t)=>{const n=Object.create(Sre);return n[Mn]=e,n[ld]=t,n}),Sre=ux({op:"OnSuccess",eval(e){return e._stack.push(this),this[Mn]}}),wre=e=>Be(e,Hy),a5=xC,vC=s5,SC=vC(fre()),Mw=e=>vC(lre(e)),_re=a5(void 0),Ere="setImmediate"in globalThis?globalThis.setImmediate:e=>setTimeout(e,0);class o5{tasks=[];running=!1;scheduleTask(t,n){this.tasks.push(t),this.running||(this.running=!0,Ere(this.afterScheduled))}afterScheduled=()=>{this.running=!1,this.runTasks()};runTasks(){const t=this.tasks;this.tasks=[];for(let n=0,r=t.length;n<r;n++)t[n]()}shouldYield(t){return t.currentOpCount>=t.getRef(Ire)}flush(){for(;this.tasks.length>0;)this.runTasks()}}const Tre=O(2,(e,t)=>kC(n=>{const r=n.context;return n.context=t(r),Rre(e,()=>(n.context=r,vre))})),Cre=O(2,(e,t)=>Tre(e,Zr(t)));class Ire extends _u()("effect/Micro/currentMaxOpsBeforeYield",{defaultValue:()=>2048}){}class wC extends _u()("effect/Micro/currentScheduler",{defaultValue:()=>new o5}){}const Are=O(2,(e,t)=>{const n=Object.create(Nre);return n[Mn]=e,n[ld]=t.onSuccess,n[Ol]=t.onFailure,n}),Nre=ux({op:"OnSuccessAndFailure",eval(e){return e._stack.push(this),this[Mn]}}),Rre=O(2,(e,t)=>Ore(n=>Are(n(e),{onFailure:r=>Vy(t(vC(r)),()=>s5(r)),onSuccess:r=>Vy(t(a5(r)),()=>xC(r))}))),i5=yC({op:"SetInterruptible",ensure(e){if(e.interruptible=this[Mn],e._interrupted&&e.interruptible)return()=>SC}}),Pre=e=>kC(t=>t.interruptible?e:(t.interruptible=!0,t._stack.push(i5(!1)),t._interrupted?SC:e)),Ore=e=>kC(t=>t.interruptible?(t.interruptible=!1,t._stack.push(i5(!0)),e(Pre)):e(Qe)),Lre=(e,t)=>{const n=new pre(wC.context(new o5));return n.evaluate(e),n},Gy=Symbol.for("effect/Readable"),c5=Symbol.for("effect/Ref"),u5={_A:e=>e};class $re extends Fd{ref;commit(){return this.get}[c5]=u5;[Gy]=Gy;constructor(t){super(),this.ref=t,this.get=ke(()=>On(this.ref))}get;modify(t){return ke(()=>{const n=On(this.ref),[r,s]=t(n);return n!==s&&Bm(s)(this.ref),r})}}const _C=e=>new $re(Fm(e)),Ky=e=>ke(()=>_C(e)),Ka=e=>e.get,Ll=O(2,(e,t)=>e.modify(()=>[void 0,t])),jre=O(2,(e,t)=>e.modify(n=>[n,t])),l5=O(2,(e,t)=>e.modify(t)),Wy=O(2,(e,t)=>e.modify(n=>[void 0,t(n)])),EC=Ky,Mre=Ka,Dre=jre,pf=l5,Fre=Ll,Bre=Wy;class d5{buckets=[];scheduleTask(t,n){const r=this.buckets.length;let s,a=0;for(;a<r&&this.buckets[a][0]<=n;a++)s=this.buckets[a];s&&s[0]===n?s[1].push(t):a===r?this.buckets.push([n,[t]]):this.buckets.splice(a,0,[n,[t]])}}class Ure{maxNextTickBeforeTimer;running=!1;tasks=new d5;constructor(t){this.maxNextTickBeforeTimer=t}starveInternal(t){const n=this.tasks.buckets;this.tasks.buckets=[];for(const[r,s]of n)for(let a=0;a<s.length;a++)s[a]();this.tasks.buckets.length===0?this.running=!1:this.starve(t)}starve(t=0){t>=this.maxNextTickBeforeTimer?setTimeout(()=>this.starveInternal(0),0):Promise.resolve(void 0).then(()=>this.starveInternal(t+1))}shouldYield(t){return t.currentOpCount>t.getFiberRef(v6)?t.getFiberRef(jd):!1}scheduleTask(t,n){this.tasks.scheduleTask(t,n),this.running||(this.running=!0,this.starve())}}const f5=Ve(Symbol.for("effect/Scheduler/defaultScheduler"),()=>new Ure(2048));class lx{tasks=new d5;deferred=!1;scheduleTask(t,n){this.deferred?f5.scheduleTask(t,n):this.tasks.scheduleTask(t,n)}shouldYield(t){return t.currentOpCount>t.getFiberRef(v6)?t.getFiberRef(jd):!1}flush(){for(;this.tasks.buckets.length>0;){const t=this.tasks.buckets;this.tasks.buckets=[];for(const[n,r]of t)for(let s=0;s<r.length;s++)r[s]()}this.deferred=!0}}const TC=Ve(Symbol.for("effect/FiberRef/currentScheduler"),()=>zn(f5)),h5=Ve(Symbol.for("effect/FiberRef/currentRequestMap"),()=>zn(new Map)),KN=(e,t,n,r)=>{switch(e){case void 0:return t();case"unbounded":return n();case"inherit":return X1(nte,s=>s==="unbounded"?n():s>1?r(s):t());default:return e>1?r(e):t()}},zre=vne,Hre=wne,qre=Md,m5=e=>e.replace(/[\s="]/g,"_"),Vre=e=>t=>`${m5(t.label)}=${e-t.startTime}ms`,p5="effect/MetricLabel",Dw=Symbol.for(p5);class Gre{key;value;[Dw]=Dw;_hash;constructor(t,n){this.key=t,this.value=n,this._hash=Wt(p5+this.key+this.value)}[Xe](){return this._hash}[Ze](t){return Wre(t)&&this.key===t.key&&this.value===t.value}pipe(){return je(this,arguments)}}const Kre=(e,t)=>new Gre(e,t),Wre=e=>Be(e,Dw),Yre=e=>ot(e,Ce),g5=e=>{let t,n;return typeof e=="function"?t=e:(t=e.try,n=e.catch),st(()=>{try{return Ae(ir(t))}catch(r){return mn(n?ir(()=>n(r)):new uC(r,"An unknown error occurred in Effect.try"))}})},Jre=e=>v5(e,y5,gC),Qre=e=>v5(e,J1(y5,$ee),([t,n],[r,s])=>[gC(t,r),wi(n,s)]),b5=O(2,(e,t)=>Bo(e,{onFailure:n=>Ae(t.onFailure(n)),onSuccess:n=>Ae(t.onSuccess(n))})),y5=St(e=>Ae(e.getFiberRefs())),Xre=e=>b5(e,{onFailure:Kl,onSuccess:Kl}),WN=O(2,(e,t)=>Vs(e,{onFailure:n=>c6(()=>t(n)),onSuccess:Ae})),Zre=e=>B(rx(),he(t=>B(Qre(e),d6(t),tse,ot(n=>un(n,B(Di(t),he(([r,s])=>Hr(J1(x5(r[0]),h6(r[1])),s)))))))),ese=e=>ot(e,t=>!t),tse=e=>ot(EC(!0),t=>Gs(nC(e,Dre(t,!1)))),x5=e=>cse((t,n)=>B(e,Z6(t,n))),nse=e=>e.length>=1?ka((t,n)=>{try{e(n).then(r=>t(Ae(r)),r=>t(pi(r)))}catch(r){t(pi(r))}}):ka(t=>{try{e().then(n=>t(Ae(n)),n=>t(pi(n)))}catch(n){t(pi(n))}}),k5=O(3,(e,t,n)=>Cu(r=>ox(e,ds(r,t,n)))),YN=O(3,(e,t,n)=>Cu(r=>he(n,s=>ox(e,B(r,ds(t,s)))))),rse=zre,sse=Ae(ye()),v5=O(3,(e,t,n)=>he(t,r=>he(e,s=>ot(t,a=>[n(r,a),s])))),ase=O(2,(e,t)=>Vs(e,{onFailure:n=>un(t(n),Bn(n)),onSuccess:Ae})),ose=e=>{let t,n;typeof e=="function"?t=e:(t=e.try,n=e.catch);const r=s=>n?V1(()=>n(s)):mn(new uC(s,"An unknown error occurred in Effect.tryPromise"));return t.length>=1?ka((s,a)=>{try{t(a).then(o=>s(Ae(o)),o=>s(r(o)))}catch(o){s(r(o))}}):ka(s=>{try{t().then(a=>s(Ae(a)),a=>s(r(a)))}catch(a){s(r(a))}})},ise=O(2,(e,t)=>he(e,n=>g5({try:()=>t.try(n),catch:t.catch}))),cse=e=>St(t=>(t.setFiberRefs(e(t.id(),t.getFiberRefs())),$t)),use=O(2,(e,t)=>st(()=>t()?ot(e,Ce):Ae(ye()))),lse=e=>new Proxy({},{get(t,n,r){return(...s)=>he(e,a=>a[n](...s))}}),S5=BigInt(0),w5=Vi(e=>fa(e.context,Nw)?e._tag==="Span"?w5(e.parent):ye():Ce(e)),dse=(e,t,n)=>{const r=!e.getFiberRef(S6)||n.context&&fa(n.context,Nw),s=e.getFiberRef(no),a=n.parent?Ce(n.parent):n.root?ye():w5(qi(s,ix));let o;if(r)o=_te({name:t,parent:a,context:ds(n.context??xa(),Nw,!0)});else{const i=e.getFiberRef(ud),c=fa(i,pC),u=fa(i,qre),l=e.getFiberRef(w6),d=e.getFiberRefs(),h=UN(d,ote),m=UN(d,ite),p=m._tag==="Some"?n.links!==void 0?[...Us(m.value),...n.links??[]]:Us(m.value):n.links??Li();o=c.span(t,a,n.context??xa(),p,l?u.unsafeCurrentTimeNanos():S5,n.kind??"internal",n),h._tag==="Some"&&KX(h.value,(y,g)=>o.attribute(g,y)),n.attributes!==void 0&&Object.entries(n.attributes).forEach(([y,g])=>o.attribute(y,g))}return typeof n.captureStackTrace=="function"&&Oy.set(o,n.captureStackTrace),o},fse=(e,t,n,r)=>ke(()=>{e.status._tag!=="Ended"&&(E6(t)&&Oy.has(e)&&e.attribute("code.stacktrace",Oy.get(e)()),e.end(r?n.unsafeCurrentTimeNanos():S5,t))}),hse=(e,...t)=>{const n=xne(t.length===1?void 0:t[0]),r=t[t.length-1];return St(s=>{const a=dse(s,e,n),o=s.getFiberRef(w6),i=fa(s.getFiberRef(ud),Md);return fu(r(a),c=>fse(a,c,i,o))})},mse=O(2,(e,t)=>k5(e,ix,t)),CC=E6,IC=hte,pse=Pl,gse=T6,Yy=sm,wr=Ot,bse=pte,yse=Mb,Ao=tx,fs=Lt,AC=Sr,JN=bte,cm=C6,NC="InterruptSignal",RC="Stateful",PC="Resume",OC="YieldNow",cv=e=>({_tag:NC,cause:e}),Db=e=>({_tag:RC,onFiber:e}),Hu=e=>({_tag:PC,effect:e}),xse=()=>({_tag:OC}),kse="effect/FiberScope",Jy=Symbol.for(kse);class vse{[Jy]=Jy;fiberId=ys;roots=new Set;add(t,n){this.roots.add(n),n.addObserver(()=>{this.roots.delete(n)})}}class Sse{fiberId;parent;[Jy]=Jy;constructor(t,n){this.fiberId=t,this.parent=n}add(t,n){this.parent.tell(Db(r=>{r.addChild(n),n.addObserver(()=>{r.removeChild(n)})}))}}const wse=e=>new Sse(e.id(),e),dx=Ve(Symbol.for("effect/FiberScope/Global"),()=>new vse),_se="effect/Fiber",Ese=Symbol.for(_se),Tse={_E:e=>e,_A:e=>e},Cse="effect/Fiber",Ise=Symbol.for(Cse),Ase=e=>e.await,Nse=e=>e.inheritAll,um=e=>Q1(K1(e.await),e.inheritAll);({...Dm});const ti="effect/FiberCurrent",Rse=()=>Cd(globalThis[ti]),Pse="effect/Logger",Ose=Symbol.for(Pse),Lse={_Message:e=>e,_Output:e=>e},LC=e=>({[Ose]:Lse,log:e,pipe(){return je(this,arguments)}}),$se=/^[^\s"=]*$/,jse=(e,t)=>({annotations:n,cause:r,date:s,fiberId:a,logLevel:o,message:i,spans:c})=>{const u=p=>p.match($se)?p:e(p),l=(p,y)=>`${m5(p)}=${u(y)}`,d=(p,y)=>" "+l(p,y);let h=l("timestamp",s.toISOString());h+=d("level",o.label),h+=d("fiber",PD(a));const m=UJ(i);for(let p=0;p<m.length;p++)h+=d("message",Wl(m[p],t));XQ(r)||(h+=d("cause",Pd(r,{renderErrorCause:!0})));for(const p of c)h+=" "+Vre(s.getTime())(p);for(const[p,y]of n)h+=d(p,Wl(y,t));return h},Mse=e=>`"${e.replace(/\\([\s\S])|(")/g,"\\$1$2")}"`,Dse=LC(jse(Mse)),Fse=typeof process=="object"&&process!==null&&typeof process.stdout=="object"&&process.stdout!==null;Fse&&process.stdout.isTTY;const _5="effect/MetricBoundaries",Fw=Symbol.for(_5);class Bse{values;[Fw]=Fw;constructor(t){this.values=t,this._hash=B(Wt(_5),tt(Ed(this.values)))}_hash;[Xe](){return this._hash}[Ze](t){return Use(t)&&Fe(this.values,t.values)}pipe(){return je(this,arguments)}}const Use=e=>Be(e,Fw),zse=e=>{const t=B(e,AT(In(Number.POSITIVE_INFINITY)),aQ);return new Bse(t)},Hse=e=>B(BJ(e.count-1,t=>e.start*Math.pow(e.factor,t)),Or,zse),qse="effect/MetricKeyType",E5=Symbol.for(qse),T5="effect/MetricKeyType/Counter",Bw=Symbol.for(T5),Vse="effect/MetricKeyType/Frequency",Gse=Symbol.for(Vse),Kse="effect/MetricKeyType/Gauge",Wse=Symbol.for(Kse),C5="effect/MetricKeyType/Histogram",Uw=Symbol.for(C5),Yse="effect/MetricKeyType/Summary",Jse=Symbol.for(Yse),I5={_In:e=>e,_Out:e=>e};class Qse{incremental;bigint;[E5]=I5;[Bw]=Bw;constructor(t,n){this.incremental=t,this.bigint=n,this._hash=Wt(T5)}_hash;[Xe](){return this._hash}[Ze](t){return A5(t)}pipe(){return je(this,arguments)}}class Xse{boundaries;[E5]=I5;[Uw]=Uw;constructor(t){this.boundaries=t,this._hash=B(Wt(C5),tt(Pe(this.boundaries)))}_hash;[Xe](){return this._hash}[Ze](t){return N5(t)&&Fe(this.boundaries,t.boundaries)}pipe(){return je(this,arguments)}}const Zse=e=>new Qse(e?.incremental??!1,e?.bigint??!1),eae=e=>new Xse(e),A5=e=>Be(e,Bw),tae=e=>Be(e,Gse),nae=e=>Be(e,Wse),N5=e=>Be(e,Uw),rae=e=>Be(e,Jse),sae="effect/MetricKey",R5=Symbol.for(sae),aae={_Type:e=>e},oae=R1(Fe);class $C{name;keyType;description;tags;[R5]=aae;constructor(t,n,r,s=[]){this.name=t,this.keyType=n,this.description=r,this.tags=s,this._hash=B(Wt(this.name+this.description),tt(Pe(this.keyType)),tt(Ed(this.tags)))}_hash;[Xe](){return this._hash}[Ze](t){return iae(t)&&this.name===t.name&&Fe(this.keyType,t.keyType)&&Fe(this.description,t.description)&&oae(this.tags,t.tags)}pipe(){return je(this,arguments)}}const iae=e=>Be(e,R5),cae=(e,t)=>new $C(e,Zse(t),Cd(t?.description)),uae=(e,t,n)=>new $C(e,eae(t),Cd(n)),lae=O(2,(e,t)=>t.length===0?e:new $C(e.name,e.keyType,e.description,Ob(e.tags,t))),QN=Symbol.for("effect/MutableHashMap"),dae={[QN]:QN,[Symbol.iterator](){return new jC(this)},toString(){return zt(this.toJSON())},toJSON(){return{_id:"MutableHashMap",values:Array.from(this).map(en)}},[xt](){return this.toJSON()},pipe(){return je(this,arguments)}};class jC{self;referentialIterator;bucketIterator;constructor(t){this.self=t,this.referentialIterator=t.referential[Symbol.iterator]()}next(){if(this.bucketIterator!==void 0)return this.bucketIterator.next();const t=this.referentialIterator.next();return t.done?(this.bucketIterator=new fae(this.self.buckets.values()),this.next()):t}[Symbol.iterator](){return new jC(this.self)}}class fae{backing;constructor(t){this.backing=t}currentBucket;next(){if(this.currentBucket===void 0){const n=this.backing.next();if(n.done)return n;this.currentBucket=n.value[Symbol.iterator]()}const t=this.currentBucket.next();return t.done?(this.currentBucket=void 0,this.next()):t}}const zw=()=>{const e=Object.create(dae);return e.referential=new Map,e.buckets=new Map,e.bucketsSize=0,e},So=O(2,(e,t)=>{if(Kh(t)===!1)return e.referential.has(t)?Ce(e.referential.get(t)):ye();const n=t[Xe](),r=e.buckets.get(n);return r===void 0?ye():hae(e,r,t)}),hae=(e,t,n,r=!1)=>{for(let s=0,a=t.length;s<a;s++)if(n[Ze](t[s][0])){const o=t[s][1];return r&&(t.splice(s,1),e.bucketsSize--),Ce(o)}return ye()},gf=O(2,(e,t)=>Et(So(e,t))),Ec=O(3,(e,t,n)=>{if(Kh(t)===!1)return e.referential.set(t,n),e;const r=t[Xe](),s=e.buckets.get(r);return s===void 0?(e.buckets.set(r,[[t,n]]),e.bucketsSize++,e):(P5(e,s,t),s.push([t,n]),e.bucketsSize++,e)}),P5=(e,t,n)=>{for(let r=0,s=t.length;r<s;r++)if(n[Ze](t[r][0])){t.splice(r,1),e.bucketsSize--;return}},mae=O(2,(e,t)=>{if(Kh(t)===!1)return e.referential.delete(t),e;const n=t[Xe](),r=e.buckets.get(n);return r===void 0||(P5(e,r,t),r.length===0&&e.buckets.delete(n)),e}),pae="effect/MetricState",Jm=Symbol.for(pae),O5="effect/MetricState/Counter",Hw=Symbol.for(O5),L5="effect/MetricState/Frequency",qw=Symbol.for(L5),$5="effect/MetricState/Gauge",Vw=Symbol.for($5),j5="effect/MetricState/Histogram",Gw=Symbol.for(j5),M5="effect/MetricState/Summary",Kw=Symbol.for(M5),Qm={_A:e=>e};class gae{count;[Jm]=Qm;[Hw]=Hw;constructor(t){this.count=t}[Xe](){return B(Pe(O5),tt(Pe(this.count)),Mt(this))}[Ze](t){return Cae(t)&&this.count===t.count}pipe(){return je(this,arguments)}}const bae=R1(Fe);class yae{occurrences;[Jm]=Qm;[qw]=qw;constructor(t){this.occurrences=t}_hash;[Xe](){return B(Wt(L5),tt(Ed(Ct(this.occurrences.entries()))),Mt(this))}[Ze](t){return Iae(t)&&bae(Ct(this.occurrences.entries()),Ct(t.occurrences.entries()))}pipe(){return je(this,arguments)}}class xae{value;[Jm]=Qm;[Vw]=Vw;constructor(t){this.value=t}[Xe](){return B(Pe($5),tt(Pe(this.value)),Mt(this))}[Ze](t){return Aae(t)&&this.value===t.value}pipe(){return je(this,arguments)}}class kae{buckets;count;min;max;sum;[Jm]=Qm;[Gw]=Gw;constructor(t,n,r,s,a){this.buckets=t,this.count=n,this.min=r,this.max=s,this.sum=a}[Xe](){return B(Pe(j5),tt(Pe(this.buckets)),tt(Pe(this.count)),tt(Pe(this.min)),tt(Pe(this.max)),tt(Pe(this.sum)),Mt(this))}[Ze](t){return Nae(t)&&Fe(this.buckets,t.buckets)&&this.count===t.count&&this.min===t.min&&this.max===t.max&&this.sum===t.sum}pipe(){return je(this,arguments)}}class vae{error;quantiles;count;min;max;sum;[Jm]=Qm;[Kw]=Kw;constructor(t,n,r,s,a,o){this.error=t,this.quantiles=n,this.count=r,this.min=s,this.max=a,this.sum=o}[Xe](){return B(Pe(M5),tt(Pe(this.error)),tt(Pe(this.quantiles)),tt(Pe(this.count)),tt(Pe(this.min)),tt(Pe(this.max)),tt(Pe(this.sum)),Mt(this))}[Ze](t){return Rae(t)&&this.error===t.error&&Fe(this.quantiles,t.quantiles)&&this.count===t.count&&this.min===t.min&&this.max===t.max&&this.sum===t.sum}pipe(){return je(this,arguments)}}const Sae=e=>new gae(e),wae=e=>new yae(e),_ae=e=>new xae(e),Eae=e=>new kae(e.buckets,e.count,e.min,e.max,e.sum),Tae=e=>new vae(e.error,e.quantiles,e.count,e.min,e.max,e.sum),Cae=e=>Be(e,Hw),Iae=e=>Be(e,qw),Aae=e=>Be(e,Vw),Nae=e=>Be(e,Gw),Rae=e=>Be(e,Kw),Pae="effect/MetricHook",Oae=Symbol.for(Pae),Lae={_In:e=>e,_Out:e=>e},Xm=e=>({[Oae]:Lae,pipe(){return je(this,arguments)},...e}),XN=BigInt(0),$ae=e=>{let t=e.keyType.bigint?XN:0;const n=e.keyType.incremental?e.keyType.bigint?s=>s>=XN:s=>s>=0:s=>!0,r=s=>{n(s)&&(t=t+s)};return Xm({get:()=>Sae(t),update:r,modify:r})},jae=e=>{const t=new Map;for(const r of e.keyType.preregisteredWords)t.set(r,0);const n=r=>{const s=t.get(r)??0;t.set(r,s+1)};return Xm({get:()=>wae(t),update:n,modify:n})},Mae=(e,t)=>{let n=t;return Xm({get:()=>_ae(n),update:r=>{n=r},modify:r=>{n=n+r}})},Dae=e=>{const t=e.keyType.boundaries.values,n=t.length,r=new Uint32Array(n+1),s=new Float64Array(n);let a=0,o=0,i=Number.MAX_VALUE,c=Number.MIN_VALUE;B(t,Yh(cd),Kc((d,h)=>{s[h]=d}));const u=d=>{let h=0,m=n;for(;h!==m;){const p=Math.floor(h+(m-h)/2),y=s[p];d<=y?m=p:h=p,m===h+1&&(d<=s[h]?m=h:h=m)}r[h]=r[h]+1,a=a+1,o=o+d,d<i&&(i=d),d>c&&(c=d)},l=()=>{const d=N1(n);let h=0;for(let m=0;m<n;m++){const p=s[m],y=r[m];h=h+y,d[m]=[p,h]}return d};return Xm({get:()=>Eae({buckets:l(),count:a,min:i,max:c,sum:o}),update:u,modify:u})},Fae=e=>{const{error:t,maxAge:n,maxSize:r,quantiles:s}=e.keyType,a=B(s,Yh(cd)),o=N1(r);let i=0,c=0,u=0,l=0,d=0;const h=p=>{const y=[];let g=0;for(;g!==r-1;){const b=o[g];if(b!=null){const[x,k]=b,_=sd(p-x);IX(_,rd)&&CX(_,n)&&y.push(k)}g=g+1}return Bae(t,a,Yh(y,cd))},m=(p,y)=>{if(r>0){i=i+1;const g=i%r;o[g]=[y,p]}l=c===0?p:Math.min(l,p),d=c===0?p:Math.max(d,p),c=c+1,u=u+p};return Xm({get:()=>Tae({error:t,quantiles:h(Date.now()),count:c,min:l,max:d,sum:u}),update:([p,y])=>m(p,y),modify:([p,y])=>m(p,y)})},Bae=(e,t,n)=>{const r=n.length;if(!sn(t))return Li();const s=t[0],a=t.slice(1),o=ZN(e,r,ye(),0,s,n),i=na(o);return a.forEach(c=>{i.push(ZN(e,r,o.value,o.consumed,c,o.rest))}),Kc(i,c=>[c.quantile,c.value])},ZN=(e,t,n,r,s,a)=>{let o=e,i=t,c=n,u=r,l=s,d=a,h=e,m=t,p=n,y=r,g=s,b=a;for(;;){if(!sn(d))return{quantile:l,value:ye(),consumed:u,rest:[]};if(l===1)return{quantile:l,value:Ce(WM(d)),consumed:u+d.length,rest:[]};const x=zr(d),k=XJ(d,A=>A===x),_=l*i,S=o/2*_,w=u+k[0].length,T=Math.abs(w-_);if(w<_-S){h=o,m=i,p=lh(d),y=w,g=l,b=k[1],o=h,i=m,c=p,u=y,l=g,d=b;continue}if(w>_+S){const A=Cn(c)?Ce(x):c;return{quantile:l,value:A,consumed:u,rest:d}}switch(c._tag){case"None":{h=o,m=i,p=lh(d),y=w,g=l,b=k[1],o=h,i=m,c=p,u=y,l=g,d=b;continue}case"Some":{const A=Math.abs(_-c.value);if(T<A){h=o,m=i,p=lh(d),y=w,g=l,b=k[1],o=h,i=m,c=p,u=y,l=g,d=b;continue}return{quantile:l,value:Ce(c.value),consumed:u,rest:d}}}}throw new Error("BUG: MetricHook.resolveQuantiles - please report an issue at https://github.com/Effect-TS/effect/issues")},Uae="effect/MetricPair",zae=Symbol.for(Uae),Hae={_Type:e=>e},qae=(e,t)=>({[zae]:Hae,metricKey:e,metricState:t,pipe(){return je(this,arguments)}}),Vae="effect/MetricRegistry",eR=Symbol.for(Vae);class Gae{[eR]=eR;map=zw();snapshot(){const t=[];for(const[n,r]of this.map)t.push(qae(n,r.get()));return t}get(t){const n=B(this.map,So(t),jr);if(n==null){if(A5(t.keyType))return this.getCounter(t);if(nae(t.keyType))return this.getGauge(t);if(tae(t.keyType))return this.getFrequency(t);if(N5(t.keyType))return this.getHistogram(t);if(rae(t.keyType))return this.getSummary(t);throw new Error("BUG: MetricRegistry.get - unknown MetricKeyType - please report an issue at https://github.com/Effect-TS/effect/issues")}else return n}getCounter(t){let n=B(this.map,So(t),jr);if(n==null){const r=$ae(t);B(this.map,gf(t))||B(this.map,Ec(t,r)),n=r}return n}getFrequency(t){let n=B(this.map,So(t),jr);if(n==null){const r=jae(t);B(this.map,gf(t))||B(this.map,Ec(t,r)),n=r}return n}getGauge(t){let n=B(this.map,So(t),jr);if(n==null){const r=Mae(t,t.keyType.bigint?BigInt(0):0);B(this.map,gf(t))||B(this.map,Ec(t,r)),n=r}return n}getHistogram(t){let n=B(this.map,So(t),jr);if(n==null){const r=Dae(t);B(this.map,gf(t))||B(this.map,Ec(t,r)),n=r}return n}getSummary(t){let n=B(this.map,So(t),jr);if(n==null){const r=Fae(t);B(this.map,gf(t))||B(this.map,Ec(t,r)),n=r}return n}}const Kae=()=>new Gae,Wae="effect/Metric",Yae=Symbol.for(Wae),Jae={_Type:e=>e,_In:e=>e,_Out:e=>e},tR=Ve(Symbol.for("effect/Metric/globalMetricRegistry"),()=>Kae()),D5=function(e,t,n,r){const s=Object.assign(a=>tC(a,o=>eoe(s,o)),{[Yae]:Jae,keyType:e,unsafeUpdate:t,unsafeValue:n,unsafeModify:r,register(){return this.unsafeValue([]),this},pipe(){return je(this,arguments)}});return s},fx=(e,t)=>F5(cae(e,t)),F5=e=>{let t;const n=new WeakMap,r=s=>{if(s.length===0)return t!==void 0||(t=tR.get(e)),t;let a=n.get(s);return a!==void 0||(a=tR.get(lae(e,s)),n.set(s,a)),a};return D5(e.keyType,(s,a)=>r(a).update(s),s=>r(s).get(),(s,a)=>r(a).modify(s))},Qae=(e,t,n)=>F5(uae(e,t,n)),Xae=O(3,(e,t,n)=>Zae(e,[Kre(t,n)])),Zae=O(2,(e,t)=>D5(e.keyType,(n,r)=>e.unsafeUpdate(n,Ob(t,r)),n=>e.unsafeValue(Ob(t,n)),(n,r)=>e.unsafeModify(n,Ob(t,r)))),eoe=O(2,(e,t)=>X1(Ew,n=>ke(()=>e.unsafeUpdate(t,n))));({...C1});const toe=O(2,(e,t)=>X1(h5,n=>ke(()=>{if(n.has(e)){const r=n.get(e);r.state.completed||(r.state.completed=!0,ax(r.result,t))}}))),noe="effect/Supervisor",hx=Symbol.for(noe),MC={_T:e=>e};class mx{underlying;value0;[hx]=MC;constructor(t,n){this.underlying=t,this.value0=n}get value(){return this.value0}onStart(t,n,r,s){this.underlying.onStart(t,n,r,s)}onEnd(t,n){this.underlying.onEnd(t,n)}onEffect(t,n){this.underlying.onEffect(t,n)}onSuspend(t){this.underlying.onSuspend(t)}onResume(t){this.underlying.onResume(t)}map(t){return new mx(this,B(this.value,ot(t)))}zip(t){return new px(this,t)}}class px{left;right;_tag="Zip";[hx]=MC;constructor(t,n){this.left=t,this.right=n}get value(){return J1(this.left.value,this.right.value)}onStart(t,n,r,s){this.left.onStart(t,n,r,s),this.right.onStart(t,n,r,s)}onEnd(t,n){this.left.onEnd(t,n),this.right.onEnd(t,n)}onEffect(t,n){this.left.onEffect(t,n),this.right.onEffect(t,n)}onSuspend(t){this.left.onSuspend(t),this.right.onSuspend(t)}onResume(t){this.left.onResume(t),this.right.onResume(t)}map(t){return new mx(this,B(this.value,ot(t)))}zip(t){return new px(this,t)}}const B5=e=>Be(e,hx)&&fM(e,"Zip");class roe{effect;[hx]=MC;constructor(t){this.effect=t}get value(){return this.effect}onStart(t,n,r,s){}onEnd(t,n){}onEffect(t,n){}onSuspend(t){}onResume(t){}map(t){return new mx(this,B(this.value,ot(t)))}zip(t){return new px(this,t)}onRun(t,n){return t()}}const soe=e=>new roe(e),gx=Ve("effect/Supervisor/none",()=>soe($t)),aoe=Od,U5="Empty",z5="AddSupervisor",H5="RemoveSupervisor",q5="AndThen",hh={_tag:U5},Fb=(e,t)=>({_tag:q5,first:e,second:t}),ooe=(e,t)=>ioe(t,In(e)),ioe=(e,t)=>{let n=e,r=t;for(;Fo(r);){const s=za(r);switch(s._tag){case U5:{r=Co(r);break}case z5:{n=n.zip(s.supervisor),r=Co(r);break}case H5:{n=Ww(n,s.supervisor),r=Co(r);break}case q5:{r=Tr(s.first)(Tr(s.second)(Co(r)));break}}}return n},Ww=(e,t)=>Fe(e,t)?gx:B5(e)?Ww(e.left,t).zip(Ww(e.right,t)):e,Qy=e=>Fe(e,gx)?ou():B5(e)?B(Qy(e.left),Xh(Qy(e.right))):qT(e),coe=(e,t)=>{if(Fe(e,t))return hh;const n=Qy(e),r=Qy(t),s=B(r,iN(n),Zh(hh,(o,i)=>Fb(o,{_tag:z5,supervisor:i}))),a=B(n,iN(r),Zh(hh,(o,i)=>Fb(o,{_tag:H5,supervisor:i})));return Fb(s,a)},uoe=aoe({empty:hh,patch:ooe,combine:Fb,diff:coe}),loe=fx("effect_fiber_started",{incremental:!0}),nR=fx("effect_fiber_active"),doe=fx("effect_fiber_successes",{incremental:!0}),foe=fx("effect_fiber_failures",{incremental:!0}),hoe=Xae(Qae("effect_fiber_lifetimes",Hse({start:.5,factor:2,count:35})),"time_unit","milliseconds"),bf="Continue",moe="Done",rR="Yield",poe={_E:e=>e,_A:e=>e},Kp=e=>{throw new Error(`BUG: FiberRuntime - ${Wl(e)} - please report an issue at https://github.com/Effect-TS/effect/issues`)},uo=Symbol.for("effect/internal/fiberRuntime/YieldedOp"),lo=Ve("effect/internal/fiberRuntime/yieldedOpChannel",()=>({currentOp:null})),yf={[_y]:(e,t,n)=>ir(()=>t.effect_instruction_i1(n)),OnStep:(e,t,n)=>Lt(Lt(n)),[Ey]:(e,t,n)=>ir(()=>t.effect_instruction_i2(n)),[vT]:(e,t,n)=>(e.patchRuntimeFlags(e.currentRuntimeFlags,t.patch),ci(e.currentRuntimeFlags)&&e.isInterrupted()?Ot(e.getInterruptedCause()):Lt(n)),[Ty]:(e,t,n)=>(ir(()=>t.effect_instruction_i2(n)),ir(()=>t.effect_instruction_i0())?(e.pushStack(t),ir(()=>t.effect_instruction_i1())):$t),[uh]:(e,t,n)=>{for(;;){const r=ir(()=>t.effect_instruction_i0.next(n));if(r.done)return Lt(r.value);const s=vY(r.value);if(ex(s)){if(s._tag==="Failure")return s}else return e.pushStack(t),s;n=s.value}}},goe={[NC]:(e,t,n,r)=>(e.processNewInterruptSignal(r.cause),ci(t)?Ot(r.cause):n),[PC]:(e,t,n,r)=>{throw new Error("It is illegal to have multiple concurrent run loops in a single fiber")},[RC]:(e,t,n,r)=>(r.onFiber(e,e5(t)),n),[OC]:(e,t,n,r)=>he(sC(),()=>n)},boe=e=>W1(dee(e),t=>Wa(Eee(t),([n,r])=>{const s=new Map,a=[];for(const i of r){a.push(Us(i));for(const c of i)s.set(c.request,c)}const o=a.flat();return Ld(Boe(n.runAll(a),o,()=>o.forEach(i=>{i.listeners.interrupted=!0})),h5,s)},!1,!1)),yoe=ST();class V5 extends Fd{[Ese]=Tse;[Ise]=poe;_fiberRefs;_fiberId;_queue=new Array;_children=null;_observers=new Array;_running=!1;_stack=[];_asyncInterruptor=null;_asyncBlockingOn=null;_exitValue=null;_steps=[];_isYielding=!1;currentRuntimeFlags;currentOpCount=0;currentSupervisor;currentScheduler;currentTracer;currentSpan;currentContext;currentDefaultServices;constructor(t,n,r){if(super(),this.currentRuntimeFlags=r,this._fiberId=t,this._fiberRefs=n,xN(r)){const s=this.getFiberRef(Ew);loe.unsafeUpdate(1,s),nR.unsafeUpdate(1,s)}this.refreshRefCache()}commit(){return um(this)}id(){return this._fiberId}resume(t){this.tell(Hu(t))}get status(){return this.ask((t,n)=>n)}get runtimeFlags(){return this.ask((t,n)=>Yne(n)?t.currentRuntimeFlags:n.runtimeFlags)}scope(){return wse(this)}get children(){return this.ask(t=>Array.from(t.getChildren()))}getChildren(){return this._children===null&&(this._children=new Set),this._children}getInterruptedCause(){return this.getFiberRef(Vp)}fiberRefs(){return this.ask(t=>t.getFiberRefs())}ask(t){return st(()=>{const n=nx(this._fiberId);return this.tell(Db((r,s)=>{ax(n,ke(()=>t(r,s)))})),Di(n)})}tell(t){this._queue.push(t),this._running||(this._running=!0,this.drainQueueLaterOnExecutor())}get await(){return ka(t=>{const n=r=>t(Ae(r));if(this._exitValue!==null){n(this._exitValue);return}return this.tell(Db((r,s)=>{r._exitValue!==null?n(this._exitValue):r.addObserver(n)})),ke(()=>this.tell(Db((r,s)=>{r.removeObserver(n)})))},this.id())}get inheritAll(){return St((t,n)=>{const r=t.id(),s=t.getFiberRefs(),a=n.runtimeFlags,o=this.getFiberRefs(),i=One(s,r,o);t.setFiberRefs(i);const c=t.getFiberRef(iR),u=B(wi(a,c),vN(Tu),vN(ww));return h6(u)})}get poll(){return ke(()=>Cd(this._exitValue))}unsafePoll(){return this._exitValue}interruptAsFork(t){return ke(()=>this.tell(cv(oa(t))))}unsafeInterruptAsFork(t){this.tell(cv(oa(t)))}addObserver(t){this._exitValue!==null?t(this._exitValue):this._observers.push(t)}removeObserver(t){this._observers=this._observers.filter(n=>n!==t)}getFiberRefs(){return this.setFiberRef(iR,this.currentRuntimeFlags),this._fiberRefs}unsafeDeleteFiberRef(t){this._fiberRefs=V6(this._fiberRefs,t)}getFiberRef(t){return this._fiberRefs.locals.has(t)?this._fiberRefs.locals.get(t)[0][1]:t.initial}setFiberRef(t,n){this._fiberRefs=Lw(this._fiberRefs,{fiberId:this._fiberId,fiberRef:t,value:n}),this.refreshRefCache()}refreshRefCache(){this.currentDefaultServices=this.getFiberRef(ud),this.currentTracer=this.currentDefaultServices.unsafeMap.get(pC.key),this.currentSupervisor=this.getFiberRef(Moe),this.currentScheduler=this.getFiberRef(TC),this.currentContext=this.getFiberRef(no),this.currentSpan=this.currentContext.unsafeMap.get(ix.key)}setFiberRefs(t){this._fiberRefs=t,this.refreshRefCache()}addChild(t){this.getChildren().add(t)}removeChild(t){this.getChildren().delete(t)}transferChildren(t){const n=this._children;if(this._children=null,n!==null&&n.size>0)for(const r of n)r._exitValue===null&&t.add(this.currentRuntimeFlags,r)}drainQueueOnCurrentThread(){let t=!0;for(;t;){let n=bf;const r=globalThis[ti];globalThis[ti]=this;try{for(;n===bf;)n=this._queue.length===0?moe:this.evaluateMessageWhileSuspended(this._queue.splice(0,1)[0])}finally{this._running=!1,globalThis[ti]=r}this._queue.length>0&&!this._running?(this._running=!0,n===rR?(this.drainQueueLaterOnExecutor(),t=!1):t=!0):t=!1}}drainQueueLaterOnExecutor(){this.currentScheduler.scheduleTask(this.run,this.getFiberRef(jd))}drainQueueWhileRunning(t,n){let r=n;for(;this._queue.length>0;){const s=this._queue.splice(0,1)[0];r=goe[s._tag](this,t,r,s)}return r}isInterrupted(){return!eX(this.getFiberRef(Vp))}addInterruptedCause(t){const n=this.getFiberRef(Vp);this.setFiberRef(Vp,vr(n,t))}processNewInterruptSignal(t){this.addInterruptedCause(t),this.sendInterruptSignalToAllChildren()}sendInterruptSignalToAllChildren(){if(this._children===null||this._children.size===0)return!1;let t=!1;for(const n of this._children)n.tell(cv(oa(this.id()))),t=!0;return t}interruptAllChildren(){if(this.sendInterruptSignalToAllChildren()){const t=this._children.values();this._children=null;let n=!1;return rC({while:()=>!n,body:()=>{const s=t.next();return s.done?ke(()=>{n=!0}):Gs(s.value.await)},step:()=>{}})}return null}reportExitValue(t){if(xN(this.currentRuntimeFlags)){const n=this.getFiberRef(Ew),r=this.id().startTimeMillis,s=Date.now();switch(hoe.unsafeUpdate(s-r,n),nR.unsafeUpdate(-1,n),t._tag){case Xn:{doe.unsafeUpdate(1,n);break}case Qn:{foe.unsafeUpdate(1,n);break}}}if(t._tag==="Failure"){const n=this.getFiberRef(ste);!D1(t.cause)&&n._tag==="Some"&&this.log("Fiber terminated with an unhandled error",t.cause,n)}}setExitValue(t){this._exitValue=t,this.reportExitValue(t);for(let n=this._observers.length-1;n>=0;n--)this._observers[n](t);this._observers=[]}getLoggers(){return this.getFiberRef(woe)}log(t,n,r){const s=Et(r)?r.value:this.getFiberRef(Zee),a=this.getFiberRef(xoe);if(are(a,s))return;const o=this.getFiberRef(ete),i=this.getFiberRef(Xee),c=this.getLoggers(),u=this.getFiberRefs();if(VT(c)>0){const l=fa(this.getFiberRef(ud),Md),d=new Date(l.unsafeCurrentTimeMillis());AY(u,()=>{for(const h of c)h.log({fiberId:this.id(),logLevel:s,message:t,cause:n,context:u,spans:o,annotations:i,date:d})})}}evaluateMessageWhileSuspended(t){switch(t._tag){case OC:return rR;case NC:return this.processNewInterruptSignal(t.cause),this._asyncInterruptor!==null&&(this._asyncInterruptor(Ot(t.cause)),this._asyncInterruptor=null),bf;case PC:return this._asyncInterruptor=null,this._asyncBlockingOn=null,this.evaluateEffect(t.effect),bf;case RC:return t.onFiber(this,this._exitValue!==null?Kne:Wne(this.currentRuntimeFlags,this._asyncBlockingOn)),bf;default:return Kp(t)}}evaluateEffect(t){this.currentSupervisor.onResume(this);try{let n=ci(this.currentRuntimeFlags)&&this.isInterrupted()?Ot(this.getInterruptedCause()):t;for(;n!==null;){const r=n,s=this.runLoop(r);if(s===uo){const a=lo.currentOp;lo.currentOp=null,a._op===Pb?aee(this.currentRuntimeFlags)?(this.tell(xse()),this.tell(Hu(Sr)),n=null):n=Sr:a._op===ch&&(n=null)}else{this.currentRuntimeFlags=B(this.currentRuntimeFlags,iee(ww));const a=this.interruptAllChildren();a!==null?n=he(a,()=>s):(this._queue.length===0?this.setExitValue(s):this.tell(Hu(s)),n=null)}}}finally{this.currentSupervisor.onSuspend(this)}}start(t){if(this._running)this.tell(Hu(t));else{this._running=!0;const n=globalThis[ti];globalThis[ti]=this;try{this.evaluateEffect(t)}finally{this._running=!1,globalThis[ti]=n,this._queue.length>0&&this.drainQueueLaterOnExecutor()}}}startFork(t){this.tell(Hu(t))}patchRuntimeFlags(t,n){const r=Rl(t,n);return globalThis[ti]=this,this.currentRuntimeFlags=r,r}initiateAsync(t,n){let r=!1;const s=a=>{r||(r=!0,this.tell(Hu(a)))};ci(t)&&(this._asyncInterruptor=s);try{n(s)}catch(a){s(Bn(zs(a)))}}pushStack(t){this._stack.push(t),t._op==="OnStep"&&this._steps.push({refs:this.getFiberRefs(),flags:this.currentRuntimeFlags})}popStack(){const t=this._stack.pop();if(t)return t._op==="OnStep"&&this._steps.pop(),t}getNextSuccessCont(){let t=this.popStack();for(;t;){if(t._op!==Rb)return t;t=this.popStack()}}getNextFailCont(){let t=this.popStack();for(;t;){if(t._op!==_y&&t._op!==Ty&&t._op!==uh)return t;t=this.popStack()}}[NY](t){return ke(()=>LM(this.currentContext,t))}Left(t){return mn(t.left)}None(t){return mn(new Z1)}Right(t){return Lt(t.right)}Some(t){return Lt(t.value)}Micro(t){return My(n=>{let r=n;const s=Lre(Cre(t,this.currentContext));return s.addObserver(a=>{if(a._tag==="Success")return r(Lt(a.value));switch(a.cause._tag){case"Interrupt":return r(Ot(oa(ys)));case"Fail":return r(mn(a.cause.error));case"Die":return r(pi(a.cause.defect))}}),My(a=>{r=o=>{a($t)},s.unsafeInterrupt()})})}[kM](t){const n=ir(()=>t.effect_instruction_i0()),r=this.getNextSuccessCont();return r!==void 0?(r._op in yf||Kp(r),yf[r._op](this,r,n)):(lo.currentOp=Lt(n),uo)}[Xn](t){const n=t,r=this.getNextSuccessCont();return r!==void 0?(r._op in yf||Kp(r),yf[r._op](this,r,n.effect_instruction_i0)):(lo.currentOp=n,uo)}[Qn](t){const n=t.effect_instruction_i0,r=this.getNextFailCont();if(r!==void 0)switch(r._op){case Rb:case Ey:return ci(this.currentRuntimeFlags)&&this.isInterrupted()?Ot(cN(n)):ir(()=>r.effect_instruction_i1(n));case"OnStep":return ci(this.currentRuntimeFlags)&&this.isInterrupted()?Ot(cN(n)):Lt(Ot(n));case vT:return this.patchRuntimeFlags(this.currentRuntimeFlags,r.patch),ci(this.currentRuntimeFlags)&&this.isInterrupted()?Ot(vr(n,this.getInterruptedCause())):Ot(n);default:Kp(r)}else return lo.currentOp=Ot(n),uo}[vM](t){return ir(()=>t.effect_instruction_i0(this,e5(this.currentRuntimeFlags)))}Blocked(t){const n=this.getFiberRefs(),r=this.currentRuntimeFlags;if(this._steps.length>0){const s=[],a=this._steps[this._steps.length-1];let o=this.popStack();for(;o&&o._op!=="OnStep";)s.push(o),o=this.popStack();this.setFiberRefs(a.refs),this.currentRuntimeFlags=a.flags;const i=om(a.refs,n),c=wi(a.flags,r);return Lt(t6(t.effect_instruction_i0,St(u=>{for(;s.length>0;)u.pushStack(s.pop());return u.setFiberRefs(im(u.id(),u.getFiberRefs())(i)),u.currentRuntimeFlags=Rl(c)(u.currentRuntimeFlags),t.effect_instruction_i1})))}return va(s=>he(DC(Nee(t.effect_instruction_i0)),()=>s(t.effect_instruction_i1)))}RunBlocked(t){return boe(t.effect_instruction_i0)}[Td](t){const n=t.effect_instruction_i0,r=this.currentRuntimeFlags,s=Rl(r,n);if(ci(s)&&this.isInterrupted())return Ot(this.getInterruptedCause());if(this.patchRuntimeFlags(this.currentRuntimeFlags,n),t.effect_instruction_i1){const a=wi(s,r);return this.pushStack(new Ree(a,t)),ir(()=>t.effect_instruction_i1(r))}else return Sr}[_y](t){return this.pushStack(t),t.effect_instruction_i0}OnStep(t){return this.pushStack(t),t.effect_instruction_i0}[Rb](t){return this.pushStack(t),t.effect_instruction_i0}[Ey](t){return this.pushStack(t),t.effect_instruction_i0}[ch](t){return this._asyncBlockingOn=t.effect_instruction_i1,this.initiateAsync(this.currentRuntimeFlags,t.effect_instruction_i0),lo.currentOp=t,uo}[Pb](t){return this._isYielding=!1,lo.currentOp=t,uo}[Ty](t){const n=t.effect_instruction_i0,r=t.effect_instruction_i1;return n()?(this.pushStack(t),r()):Sr}[uh](t){return yf[uh](this,t,void 0)}[T1](t){return ir(()=>t.commit())}runLoop(t){let n=t;for(this.currentOpCount=0;;){if((this.currentRuntimeFlags&see)!==0&&this.currentSupervisor.onEffect(this,n),this._queue.length>0&&(n=this.drainQueueWhileRunning(this.currentRuntimeFlags,n)),!this._isYielding){this.currentOpCount+=1;const r=this.currentScheduler.shouldYield(this);if(r!==!1){this._isYielding=!0,this.currentOpCount=0;const s=n;n=he(sC({priority:r}),()=>s)}}try{if(n=this.currentTracer.context(()=>{if(yoe!==n[du]._V){const r=this.getFiberRef(ate);if(r._tag==="Some"){const s=n[du]._V;this.log(`Executing an Effect versioned ${s} with a Runtime of version ${ST()}, you may want to dedupe the effect dependencies, you can use the language service plugin to detect this at compile time: https://github.com/Effect-TS/language-service`,ji,r)}}return this[n._op](n)},this),n===uo){const r=lo.currentOp;return r._op===Pb||r._op===ch?uo:(lo.currentOp=null,r._op===Xn||r._op===Qn?r:Ot(zs(r)))}}catch(r){n!==uo&&!Be(n,"_op")||!(n._op in this)?n=i6(`Not a valid effect: ${Wl(n)}`):fte(r)?n=Ot(vr(zs(r),oa(ys))):n=pi(r)}}}run=()=>{this.drainQueueOnCurrentThread()}}const xoe=Ve("effect/FiberRef/currentMinimumLogLevel",()=>zn(ore("Info"))),koe=e=>LC(t=>{const n=K6(t.context,ud);fa(n,B6).unsafe.log(e.log(t))}),voe=Ve(Symbol.for("effect/Logger/defaultLogger"),()=>koe(Dse)),Soe=Ve(Symbol.for("effect/Logger/tracerLogger"),()=>LC(({annotations:e,cause:t,context:n,fiberId:r,logLevel:s,message:a})=>{const o=qi(am(n,no),ix);if(o._tag==="None"||o.value._tag==="ExternalSpan")return;const i=LM(am(n,ud),Md),c={};for(const[u,l]of e)c[u]=l;c["effect.fiberId"]=zX(r),c["effect.logLevel"]=s.label,t!==null&&t._tag!=="Empty"&&(c["effect.cause"]=Pd(t,{renderErrorCause:!0})),o.value.event(Wl(Array.isArray(a)&&a.length===1?a[0]:a),i.unsafeCurrentTimeNanos(),c)})),woe=Ve(Symbol.for("effect/FiberRef/currentLoggers"),()=>Yee(qT(voe,Soe))),_oe=O(e=>zo(e[0]),(e,t)=>Ym(tC(e,n=>Eoe(r=>t(n,r))))),Eoe=e=>St(t=>{const n=t.getFiberRefs(),r=oee(t.currentRuntimeFlags,Tu);return he(Q5,s=>Dy(s,a=>St(o=>{const i=o.getFiberRefs(),c=o.currentRuntimeFlags,u=om(i,n),l=wi(c,r),d=om(n,i);return o.setFiberRefs(im(u,o.id(),n)),lm(Mee(e(a),l),ke(()=>{o.setFiberRefs(im(d,o.id(),o.getFiberRefs()))}))})))}),Toe=e=>{if(Array.isArray(e)||hM(e))return[e,ye()];const t=Object.keys(e),n=t.length;return[t.map(r=>e[r]),Ce(r=>{const s={};for(let a=0;a<n;a++)s[t[a]]=r[a];return s})]},Coe=(e,t,n)=>{const r=[];for(const s of e)r.push(id(s));return he(dd(r,Qe,{concurrency:n?.concurrency,batching:n?.batching,concurrentFinalizers:n?.concurrentFinalizers}),s=>{const a=ye(),o=s.length,i=new Array(o),c=new Array(o);let u=!1;for(let l=0;l<o;l++){const d=s[l];d._tag==="Left"?(i[l]=Ce(d.left),u=!0):(c[l]=d.right,i[l]=a)}return u?t._tag==="Some"?mn(t.value(i)):mn(i):n?.discard?$t:t._tag==="Some"?Ae(t.value(c)):Ae(c)})},Ioe=(e,t,n)=>{const r=[];for(const s of e)r.push(id(s));return n?.discard?dd(r,Qe,{concurrency:n?.concurrency,batching:n?.batching,discard:!0,concurrentFinalizers:n?.concurrentFinalizers}):ot(dd(r,Qe,{concurrency:n?.concurrency,batching:n?.batching,concurrentFinalizers:n?.concurrentFinalizers}),s=>t._tag==="Some"?t.value(s):s)},G5=(e,t)=>{const[n,r]=Toe(e);return t?.mode==="validate"?Coe(n,r,t):t?.mode==="either"?Ioe(n,r,t):t?.discard!==!0&&r._tag==="Some"?ot(dd(n,Qe,t),r.value):dd(n,Qe,t)},dd=O(e=>hM(e[0]),(e,t,n)=>St(r=>{const s=n?.batching===!0||n?.batching==="inherit"&&r.getFiberRef(rte);return n?.discard?KN(n.concurrency,()=>qu(Uy,n?.concurrentFinalizers)(a=>s?Wa(e,(o,i)=>a(t(o,i)),!0,!1,1):W1(e,(o,i)=>a(t(o,i)))),()=>qu(Pw,n?.concurrentFinalizers)(a=>Wa(e,(o,i)=>a(t(o,i)),s,!1)),a=>qu(Ow(a),n?.concurrentFinalizers)(o=>Wa(e,(i,c)=>o(t(i,c)),s,!1,a))):KN(n?.concurrency,()=>qu(Uy,n?.concurrentFinalizers)(a=>s?Yw(e,1,(o,i)=>a(t(o,i)),!0):Io(e,(o,i)=>a(t(o,i)))),()=>qu(Pw,n?.concurrentFinalizers)(a=>K5(e,(o,i)=>a(t(o,i)),s)),a=>qu(Ow(a),n?.concurrentFinalizers)(o=>Yw(e,a,(i,c)=>o(t(i,c)),s)))})),K5=(e,t,n)=>st(()=>{const r=Ct(e),s=new Array(r.length);return un(Wa(r,(o,i)=>he(t(o,i),c=>ke(()=>s[i]=c)),n,!1),Ae(s))}),Wa=(e,t,n,r,s)=>va(a=>jee(o=>St(i=>{let c=Array.from(e).reverse(),u=c.length;if(u===0)return $t;let l=0,d=!1;const h=s?Math.min(c.length,s):c.length,m=new Set,p=new Array,y=()=>m.forEach(A=>{A.currentScheduler.scheduleTask(()=>{A.unsafeInterruptAsFork(i.id())},0)}),g=new Array,b=new Array,x=new Array,k=()=>{const A=p.filter(({exit:L})=>L._tag==="Failure").sort((L,R)=>L.index<R.index?-1:L.index===R.index?0:1).map(({exit:L})=>L);return A.length===0&&A.push(Sr),A},_=(A,L=!1)=>{const R=Ym(o(A)),j=Aoe(R,i,i.currentRuntimeFlags,dx);return i.currentScheduler.scheduleTask(()=>{L&&j.unsafeInterruptAsFork(i.id()),j.resume(R)},0),j},S=()=>{r||(u-=c.length,c=[]),d=!0,y()},w=n?Pee:_i,T=_(ka(A=>{const L=(j,F)=>{j._op==="Blocked"?x.push(j):(p.push({index:F,exit:j}),j._op==="Failure"&&!d&&S())},R=()=>{if(c.length>0){const j=c.pop();let F=l++;const K=()=>{const ae=c.pop();return F=l++,he(sC(),()=>he(w(a(t(ae,F))),Y))},Y=ae=>c.length>0&&(L(ae,F),c.length>0)?K():Ae(ae),W=he(w(a(t(j,F))),Y),J=_(W);g.push(J),m.add(J),d&&J.currentScheduler.scheduleTask(()=>{J.unsafeInterruptAsFork(i.id())},0),J.addObserver(ae=>{let ge;if(ae._op==="Failure"?ge=ae:ge=ae.effect_instruction_i0,b.push(J),m.delete(J),L(ge,F),p.length===u)A(Ae(Yt(Pl(k(),{parallel:!0}),()=>Sr)));else if(x.length+p.length===u){const le=k(),I=x.map(U=>U.effect_instruction_i0).reduce(QD);A(Ae(t6(I,Wa([Yt(Pl(le,{parallel:!0}),()=>Sr),...x.map(U=>U.effect_instruction_i1)],U=>U,n,!0,s))))}else R()})}};for(let j=0;j<h;j++)R()}));return Gs(fu(K1(a(um(T))),tx({onFailure:A=>{S();const L=x.length+1,R=Math.min(typeof s=="number"?s:x.length,x.length),j=Array.from(x);return ka(F=>{let K=0,Y=0;const W=(ae,ge)=>le=>{K++,K===L&&F(Lt(Ot(A))),j.length>0&&ge&&J()},J=()=>{_(j.pop(),!0).addObserver(W(Y,!0)),Y++};T.addObserver(W(Y,!1)),Y++;for(let ae=0;ae<R;ae++)J()})},onSuccess:()=>Io(b,A=>A.inheritAll)})))}))),Yw=(e,t,n,r)=>st(()=>{const s=Ct(e),a=new Array(s.length);return un(Wa(s,(i,c)=>ot(n(i,c),u=>a[c]=u),r,!1,t),Ae(a))}),DC=e=>Noe(e,dx),W5=(e,t,n,r=null)=>{const s=Xy(e,t,n,r);return s.resume(e),s},Aoe=(e,t,n,r=null)=>Xy(e,t,n,r),Xy=(e,t,n,r=null)=>{const s=LD(),a=t.getFiberRefs(),o=Lne(a,s),i=new V5(s,o,n),c=am(o,no),u=i.currentSupervisor;return u.onStart(c,e,Ce(t),i),i.addObserver(d=>u.onEnd(d,i)),(r!==null?r:B(t.getFiberRef(Tw),Yt(()=>t.scope()))).add(n,i),i},Noe=(e,t)=>St((n,r)=>Ae(W5(e,n,r.runtimeFlags,t))),sR=e=>Cu(t=>yn(qi(t,Gi),{onNone:()=>e,onSome:n=>{switch(n.strategy._tag){case"Parallel":return e;case"Sequential":case"ParallelN":return he(Eo(n,Pw),r=>ep(e,r))}}})),aR=e=>t=>Cu(n=>yn(qi(n,Gi),{onNone:()=>t,onSome:r=>r.strategy._tag==="ParallelN"&&r.strategy.parallelism===e?t:he(Eo(r,Ow(e)),s=>ep(t,s))})),qu=(e,t)=>n=>Cu(r=>yn(qi(r,Gi),{onNone:()=>n(Qe),onSome:s=>{if(t===!0){const a=e._tag==="Parallel"?sR:e._tag==="Sequential"?oR:aR(e.parallelism);switch(s.strategy._tag){case"Parallel":return a(n(sR));case"Sequential":return a(n(oR));case"ParallelN":return a(n(aR(s.strategy.parallelism)))}}else return n(Qe)}})),Y5=e=>he(Gi,e),J5=e=>he(FC(),t=>fu(e(t),n=>t.close(n))),oR=e=>Cu(t=>yn(qi(t,Gi),{onNone:()=>e,onSome:n=>{switch(n.strategy._tag){case"Sequential":return e;case"Parallel":case"ParallelN":return he(Eo(n,Uy),r=>ep(e,r))}}})),Roe=O(e=>zo(e[1]),(e,t,n)=>Zm(e,t,(r,s)=>[r,s],n)),Poe=O(e=>zo(e[1]),(e,t,n)=>n?.concurrent!==!0&&(n?.batching===void 0||n.batching===!1)?Q1(e,t):Zm(e,t,(r,s)=>r,n)),Ooe=O(e=>zo(e[1]),(e,t,n)=>n?.concurrent!==!0&&(n?.batching===void 0||n.batching===!1)?un(e,t):Zm(e,t,(r,s)=>s,n)),Zm=O(e=>zo(e[1]),(e,t,n,r)=>ot(G5([e,t],{concurrency:r?.concurrent?2:1,batching:r?.batching,concurrentFinalizers:r?.concurrentFinalizers}),([s,a])=>n(s,a))),Gi=Hi("effect/Scope"),Q5=Gi,Loe=(e,t)=>{e.state._tag==="Open"&&e.state.finalizers.set({},t)},$oe={[_N]:_N,[EN]:EN,pipe(){return je(this,arguments)},fork(e){return ke(()=>{const t=X5(e);if(this.state._tag==="Closed")return t.state=this.state,t;const n={},r=s=>t.close(s);return this.state.finalizers.set(n,r),Loe(t,s=>ke(()=>{this.state._tag==="Open"&&this.state.finalizers.delete(n)})),t})},close(e){return st(()=>{if(this.state._tag==="Closed")return $t;const t=Array.from(this.state.finalizers.values()).reverse();return this.state={_tag:"Closed",exit:e},t.length===0?$t:Ine(this.strategy)?B(Io(t,n=>_i(n(e))),he(n=>B(Pl(n),Jr(av),Yt(()=>Sr)))):Ane(this.strategy)?B(K5(t,n=>_i(n(e)),!1),he(n=>B(Pl(n,{parallel:!0}),Jr(av),Yt(()=>Sr)))):B(Yw(t,this.strategy.parallelism,n=>_i(n(e)),!1),he(n=>B(Pl(n,{parallel:!0}),Jr(av),Yt(()=>Sr))))})},addFinalizer(e){return st(()=>this.state._tag==="Closed"?e(this.state.exit):(this.state.finalizers.set({},e),$t))}},X5=(e=Yc)=>{const t=Object.create($oe);return t.strategy=e,t.state={_tag:"Open",finalizers:new Map},t},FC=(e=Yc)=>ke(()=>X5(e)),ep=O(2,(e,t)=>R6(e,Zr(_T(Gi,t)))),joe=e=>$d(e,{differ:uoe,fork:hh}),iR=Qee(cee),Moe=joe(gx),Z5=O(3,(e,t,n)=>Foe(e,t,{onSelfWin:(r,s)=>he(r.await,a=>{switch(a._tag){case Xn:return he(r.inheritAll,()=>n.onSelfDone(a,s));case Qn:return n.onSelfDone(a,s)}}),onOtherWin:(r,s)=>he(r.await,a=>{switch(a._tag){case Xn:return he(r.inheritAll,()=>n.onOtherDone(a,s));case Qn:return n.onOtherDone(a,s)}})})),Doe=O(2,(e,t)=>Km(n=>Z5(e,t,{onSelfDone:(r,s)=>Aw(r,{onFailure:a=>B(um(s),WN(o=>Mi(a,o))),onSuccess:a=>B(s,rm(n),Hr(a))}),onOtherDone:(r,s)=>Aw(r,{onFailure:a=>B(um(s),WN(o=>Mi(o,a))),onSuccess:a=>B(s,rm(n),Hr(a))})}))),Foe=O(3,(e,t,n)=>St((r,s)=>{const a=s.runtimeFlags,o=Fm(!0),i=Xy(e,r,a,n.selfScope),c=Xy(t,r,a,n.otherScope);return ka(u=>{i.addObserver(()=>cR(i,c,n.onSelfWin,o,u)),c.addObserver(()=>cR(c,i,n.onOtherWin,o,u)),i.startFork(e),c.startFork(t)},fh(i.id(),c.id()))})),cR=(e,t,n,r,s)=>{OX(!0,!1)(r)&&s(n(e,t))},lm=O(2,(e,t)=>va(n=>Vs(n(e),{onFailure:r=>Vs(t,{onFailure:s=>Bn(vr(r,s)),onSuccess:()=>Bn(r)}),onSuccess:r=>Hr(t,r)}))),Boe=(e,t,n)=>Km(r=>he(he(DC(eC(e)),s=>ka(a=>{const o=t.map(u=>u.listeners.count),i=()=>{o.every(u=>u===0)&&t.every(u=>u.result.state.current._tag==="Pending"?!0:!!(u.result.state.current._tag==="Done"&&ex(u.result.state.current.effect)&&u.result.state.current.effect._tag==="Failure"&&xD(u.result.state.current.effect.cause)))&&(c.forEach(u=>u()),n?.(),a(aC(s)))};s.addObserver(u=>{c.forEach(l=>l()),a(u)});const c=t.map((u,l)=>{const d=h=>{o[l]=h,i()};return u.listeners.addObserver(d),()=>u.listeners.removeObserver(d)});return i(),ke(()=>{c.forEach(u=>u())})})),()=>st(()=>{const s=t.flatMap(a=>a.state.completed?[]:[a]);return W1(s,a=>toe(a.request,gte(r)))}))),Uoe=ji,e4=cu,Jw=zs,t4=oa,zoe=Mi,Hoe=ZQ,qoe=yD,Zy=xD,Voe=D1,Goe=GT,Koe=SD,Woe=sX,n4=cte,Yoe=F1,Bd=Z1,BC=Pd,Joe="effect/ScheduleInterval",e0=Symbol.for(Joe),r4={[e0]:e0,startMillis:0,endMillis:0},s4=(e,t)=>e>t?r4:{[e0]:e0,startMillis:e,endMillis:t},Qoe=O(2,(e,t)=>Xoe(e,t)===e),Xoe=O(2,(e,t)=>e.endMillis<=t.startMillis?e:t.endMillis<=e.startMillis?t:e.startMillis<t.startMillis?e:t.startMillis<e.startMillis?t:e.endMillis<=t.endMillis?e:t),Zoe=e=>e.startMillis>=e.endMillis,eie=O(2,(e,t)=>{const n=Math.max(e.startMillis,t.startMillis),r=Math.min(e.endMillis,t.endMillis);return s4(n,r)}),tie=e=>s4(e,Number.POSITIVE_INFINITY),a4=r4,nie=Qoe,rie=Zoe,sie=eie,aie=tie,oie="effect/ScheduleIntervals",uR=Symbol.for(oie),o4=e=>({[uR]:uR,intervals:e}),iie=O(2,(e,t)=>cie(e.intervals,t.intervals,pr())),cie=(e,t,n)=>{let r=e,s=t,a=n;for(;Fo(r)&&Fo(s);){const o=B(za(r),sie(za(s))),i=rie(o)?a:B(a,Tr(o));B(za(r),nie(za(s)))?r=Co(r):s=Co(s),a=i}return o4(Do(a))},Qw=e=>B(e.intervals,LT,Yt(()=>a4)).startMillis,uie=e=>B(e.intervals,LT,Yt(()=>a4)).endMillis,lie=O(2,(e,t)=>Qw(e)<Qw(t)),die=e=>Fo(e.intervals),fie=o4,hie=iie,mie=Qw,lR=uie,pie=lie,gie=die,UC="Continue",i4="Done",bie=e=>({_tag:UC,intervals:e}),yie=e=>({_tag:UC,intervals:fie(In(e))}),xie={_tag:i4},kie=e=>e._tag===UC,vie=e=>e._tag===i4,Sie=bie,wie=yie,dm=xie,dR=kie,t0=vie,_ie=Gi,n0=_6,Eie=Dy,r0=Cw,Tie=ep,c4=Eo,u4=FC;class Cie{permits;waiters=new Set;taken=0;constructor(t){this.permits=t}get free(){return this.permits-this.taken}take=t=>mi(n=>{if(this.free<t){const r=()=>{this.free<t||(this.waiters.delete(r),n(st(()=>this.free<t?this.take(t):(this.taken+=t,Ae(t)))))};return this.waiters.add(r),ke(()=>{this.waiters.delete(r)})}n(st(()=>this.free<t?this.take(t):(this.taken+=t,Ae(t))))});updateTakenUnsafe(t,n){return this.taken=n(this.taken),this.waiters.size>0&&t.getFiberRef(TC).scheduleTask(()=>{const r=this.waiters.values();let s=r.next();for(;s.done===!1&&this.free>0;)s.value(),s=r.next()},t.getFiberRef(jd)),Ae(this.free)}updateTaken(t){return St(n=>this.updateTakenUnsafe(n,t))}resize=t=>Gs(St(n=>(this.permits=t,this.free<0?$t:this.updateTakenUnsafe(n,r=>r))));release=t=>this.updateTaken(n=>n-t);releaseAll=this.updateTaken(t=>0);withPermits=t=>n=>va(r=>he(r(this.take(t)),s=>lm(r(n),this.release(s))));withPermitsIfAvailable=t=>n=>va(r=>st(()=>this.free<t?sse:(this.taken+=t,lm(r(Yre(n)),this.release(t)))))}const zC=e=>new Cie(e),Iie=e=>ke(()=>zC(e));class Aie extends Fd{isOpen;waiters=[];scheduled=!1;constructor(t){super(),this.isOpen=t}commit(){return this.await}unsafeSchedule(t){return this.scheduled||this.waiters.length===0||(this.scheduled=!0,t.currentScheduler.scheduleTask(this.flushWaiters,t.getFiberRef(jd))),$t}flushWaiters=()=>{this.scheduled=!1;const t=this.waiters;this.waiters=[];for(let n=0;n<t.length;n++)t[n](Sr)};open=St(t=>this.isOpen?$t:(this.isOpen=!0,this.unsafeSchedule(t)));unsafeOpen(){this.isOpen||(this.isOpen=!0,this.flushWaiters())}release=St(t=>this.isOpen?$t:this.unsafeSchedule(t));await=mi(t=>this.isOpen?t($t):(this.waiters.push(t),ke(()=>{const n=this.waiters.indexOf(t);n!==-1&&this.waiters.splice(n,1)})));unsafeClose(){this.isOpen=!1}close=ke(()=>{this.isOpen=!1});whenOpen=t=>un(this.await,t)}const Nie=e=>new Aie(e??!1),Rie=O(2,(e,t)=>St((n,r)=>{const s=t,a=W5(e,n,r.runtimeFlags,dx);if(s.state._tag==="Open"){const o=()=>Km(c=>Fe(c,a.id())?$t:Gs(aC(a))),i={};s.state.finalizers.set(i,o),a.addObserver(()=>{s.state._tag!=="Closed"&&s.state.finalizers.delete(i)})}else a.unsafeInterruptAsFork(n.id());return Ae(a)})),Pie="effect/Ref/SynchronizedRef",Oie=Symbol.for(Pie),Lie={_A:e=>e};class $ie extends Fd{ref;withLock;[Oie]=Lie;[c5]=u5;[Gy]=Gy;constructor(t,n){super(),this.ref=t,this.withLock=n,this.get=Ka(this.ref)}get;commit(){return this.get}modify(t){return this.modifyEffect(n=>Ae(t(n)))}modifyEffect(t){return this.withLock(B(he(Ka(this.ref),t),he(([n,r])=>Hr(Ll(this.ref,r),n))))}}const jie=e=>ke(()=>l4(e)),l4=e=>{const t=_C(e),n=zC(1);return new $ie(t,n.withPermits(1))},Mie=Symbol.for("effect/ManagedRuntime"),Die="Fresh",Fie="FromEffect",Bie="Scoped",Uie="Suspend",zie="Provide",d4="ProvideMerge",Hie="MergeAll",f4=Ase,qie=Rse,fR=Nse,Ei=aC,HC=rm,hR=um,Ud=e=>function(){if(arguments.length===1){const t=arguments[0];return(n,...r)=>e(t,n,...r)}return e.apply(this,arguments)},tp=Ud((e,t,n)=>{const r=LD(),s=[[no,[[r,e.context]]]];n?.scheduler&&s.push([TC,[[r,n.scheduler]]]);let a=jne(e.fiberRefs,{entries:s,forkAs:r});n?.updateRefs&&(a=n.updateRefs(a,r));const o=new V5(r,a,e.runtimeFlags);let i=t;n?.scope&&(i=he(c4(n.scope,Yc),u=>un(_6(u,Km(l=>Fe(l,o.id())?$t:rm(o,l))),fu(t,l=>r0(u,l)))));const c=o.currentSupervisor;return c!==gx&&(c.onStart(e.context,i,ye(),o),o.addObserver(u=>c.onEnd(u,o))),dx.add(e.runtimeFlags,o),n?.immediate===!1?o.resume(i):o.start(i),o}),h4=Ud((e,t,n={})=>{const r=tp(e,t,n);return n.onExit&&r.addObserver(s=>{n.onExit(s)}),(s,a)=>h4(e)(B(r,HC(s??ys)),{...a,onExit:a?.onExit?o=>a.onExit(bse(o)):void 0})}),m4=Ud((e,t)=>{const n=Wie(e)(t);if(n._tag==="Failure")throw p4(n.effect_instruction_i0);return n.effect_instruction_i0});class Vie extends Error{fiber;_tag="AsyncFiberException";constructor(t){super(`Fiber #${t.id().id} cannot be resolved synchronously. This is caused by using runSync on an effect that performs async work`),this.fiber=t,this.name=this._tag,this.stack=this.message}}const Gie=e=>{const t=Error.stackTraceLimit;Error.stackTraceLimit=0;const n=new Vie(e);return Error.stackTraceLimit=t,n},uv=Symbol.for("effect/Runtime/FiberFailure"),Wp=Symbol.for("effect/Runtime/FiberFailure/Cause");class Kie extends Error{[uv];[Wp];constructor(t){const n=_D(t)[0];super(n?.message||"An error has occurred"),this[uv]=uv,this[Wp]=t,this.name=n?`(FiberFailure) ${n.name}`:"FiberFailure",n?.stack&&(this.stack=n.stack)}toJSON(){return{_id:"FiberFailure",cause:this[Wp].toJSON()}}toString(){return"(FiberFailure) "+Pd(this[Wp],{renderErrorCause:!0})}[xt](){return this.toString()}}const p4=e=>{const t=Error.stackTraceLimit;Error.stackTraceLimit=0;const n=new Kie(e);return Error.stackTraceLimit=t,n},g4=e=>{const t=e;switch(t._op){case"Failure":case"Success":return t;case"Left":return sm(t.left);case"Right":return Lt(t.right);case"Some":return Lt(t.value);case"None":return sm(new Z1)}},Wie=Ud((e,t)=>{const n=g4(t);if(n)return n;const r=new lx,s=tp(e)(t,{scheduler:r});r.flush();const a=s.unsafePoll();return a||T6(ZT(Gie(s),mC(s)))}),Yie=Ud((e,t,n)=>b4(e,t,n).then(r=>{switch(r._tag){case Xn:return r.effect_instruction_i0;case Qn:throw p4(r.effect_instruction_i0)}})),b4=Ud((e,t,n)=>new Promise(r=>{const s=g4(t);s&&r(s);const a=tp(e)(t);a.addObserver(o=>{r(o)}),n?.signal!==void 0&&(n.signal.aborted?a.unsafeInterruptAsFork(a.id()):n.signal.addEventListener("abort",()=>{a.unsafeInterruptAsFork(a.id())},{once:!0}))}));class y4{context;runtimeFlags;fiberRefs;constructor(t,n,r){this.context=t,this.runtimeFlags=n,this.fiberRefs=r}pipe(){return je(this,arguments)}}const x4=e=>new y4(e.context,e.runtimeFlags,e.fiberRefs),Jie=()=>St((e,t)=>Ae(new y4(e.getFiberRef(no),t.runtimeFlags,e.getFiberRefs()))),Qie=YD(Tu,KD,GD),pu=x4({context:xa(),runtimeFlags:Qie,fiberRefs:Mne()}),Xie=tp(pu),Zie=Yie(pu),ece=b4(pu),tce=m4(pu),nce=O(2,(e,t)=>e.modifyEffect(t)),rce="effect/Layer",k4=Symbol.for(rce),sce={_RIn:e=>e,_E:e=>e,_ROut:e=>e},gu={[k4]:sce,pipe(){return je(this,arguments)}},ace="effect/Layer/MemoMap",lv=Symbol.for(ace),oce=_u()("effect/Layer/CurrentMemoMap",{defaultValue:()=>uce()}),ice=e=>Be(e,k4),cce=e=>e._op_layer===Die;class v4{ref;[lv];constructor(t){this.ref=t,this[lv]=lv}getOrElseMemoize(t,n){return B(nce(this.ref,r=>{const s=r.get(t);if(s!==void 0){const[a,o]=s,i=B(a,he(([c,u])=>B(x5(c),Hr(u))),fu(tx({onFailure:()=>$t,onSuccess:()=>Dy(n,o)})));return Ae([i,r])}return B(Ky(0),he(a=>B(rx(),he(o=>B(Ky(()=>$t),ot(i=>{const c=va(l=>B(FC(),he(d=>B(l(he(E4(t,d,!0),h=>Jre(h(this)))),_i,he(h=>{switch(h._tag){case Qn:return B(A6(o,h.effect_instruction_i0),un(Cw(d,h)),un(Bn(h.effect_instruction_i0)));case Xn:return B(Ll(i,m=>B(Cw(d,m),nC(l5(a,p=>[p===1,p-1])),Gs)),un(Wy(a,m=>m+1)),un(Dy(n,m=>B(ke(()=>r.delete(t)),un(Ka(i)),he(p=>p(m))))),un(dC(o,h.effect_instruction_i0)),Hr(h.effect_instruction_i0[1]))}}))))),u=[B(Di(o),fu(Aw({onFailure:()=>$t,onSuccess:()=>Wy(a,l=>l+1)}))),l=>B(Ka(i),he(d=>d(l)))];return[c,cce(t)?r:r.set(t,u)]}))))))}),K1)}}const S4=st(()=>ot(jie(new Map),e=>new v4(e))),uce=()=>new v4(l4(new Map)),w4=O(2,(e,t)=>he(S4,n=>_4(e,n,t))),_4=O(3,(e,t,n)=>he(E4(e,n),r=>k5(r(t),oce,t))),E4=(e,t,n=!1)=>{const r=e;switch(r._op_layer){case"Locally":return ke(()=>s=>r.f(s.getOrElseMemoize(r.self,t)));case"ExtendScope":return ke(()=>s=>Y5(a=>s.getOrElseMemoize(r.layer,a)));case"Fold":return ke(()=>s=>B(s.getOrElseMemoize(r.layer,t),Vs({onFailure:a=>s.getOrElseMemoize(r.failureK(a),t),onSuccess:a=>s.getOrElseMemoize(r.successK(a),t)})));case"Fresh":return ke(()=>s=>B(r.layer,w4(t)));case"FromEffect":return ke(n?()=>s=>r.effect:()=>s=>s.getOrElseMemoize(e,t));case"Provide":return ke(()=>s=>B(s.getOrElseMemoize(r.first,t),he(a=>B(s.getOrElseMemoize(r.second,t),ox(a)))));case"Scoped":return ke(n?()=>s=>ep(r.effect,t):()=>s=>s.getOrElseMemoize(e,t));case"Suspend":return ke(()=>s=>s.getOrElseMemoize(r.evaluate(),t));case"ProvideMerge":return ke(()=>s=>B(s.getOrElseMemoize(r.first,t),g6(s.getOrElseMemoize(r.second,t),r.zipK)));case"ZipWith":return m6(function*(){const s=yield*Eo(t,Rw),a=yield*Eo(s,Yc),o=yield*Eo(s,Yc);return i=>B(i.getOrElseMemoize(r.first,a),Zm(i.getOrElseMemoize(r.second,o),r.zipK,{concurrent:!0}))});case"MergeAll":{const s=r.layers;return ot(Eo(t,Rw),a=>o=>{const i=new Array(s.length);return ot(Wa(s,p6(function*(c,u){const l=yield*Eo(a,Yc),d=yield*o.getOrElseMemoize(c,l);i[u]=d}),!1,!1),()=>uJ(...i))})}}},lce=()=>T4(fC()),dce=O(2,(e,t)=>{const n=OM(e),r=n?e:t;return T4(ot(n?t:e,a=>_T(r,a)))});function T4(e){const t=Object.create(gu);return t._op_layer=Fie,t.effect=e,t}const C4=(...e)=>{const t=Object.create(gu);return t._op_layer=Hie,t.layers=e,t},fce=O(2,(e,t)=>{const n=OM(e),r=n?e:t;return hce(ot(n?t:e,a=>_T(r,a)))}),hce=e=>{const t=Object.create(gu);return t._op_layer=Bie,t.effect=e,t},mce=e=>{const t=Object.create(gu);return t._op_layer=Uie,t.evaluate=e,t},I4=O(2,(e,t)=>mce(()=>{const n=Object.create(gu);return n._op_layer=zie,n.first=Object.create(gu,{_op_layer:{value:d4,enumerable:!0},first:{value:lce(),enumerable:!0},second:{value:Array.isArray(t)?C4(...t):t},zipK:{value:(r,s)=>B(r,Zr(s))}}),n.second=e,n})),pce=O(2,(e,t)=>{const n=Object.create(gu);return n._op_layer=d4,n.first=t,n.second=I4(e,t),n.zipK=(r,s)=>B(r,Zr(s)),n}),mR=O(2,(e,t)=>J5(n=>he(w4(t,n),r=>hC(e,r)))),pR=O(2,(e,t)=>{const n=om(pu.fiberRefs,t.fiberRefs),r=wi(pu.runtimeFlags,t.runtimeFlags);return va(s=>St(a=>{const o=a.getFiberRef(no),i=a.getFiberRefs(),c=im(a.id(),i)(n),u=a.currentRuntimeFlags,l=Rl(r)(u),d=om(c,i),h=wi(l,u);return a.setFiberRefs(c),a.currentRuntimeFlags=l,lm(hC(s(e),Zr(o,t.context)),St(m=>(m.setFiberRefs(im(m.id(),m.getFiberRefs())(d)),m.currentRuntimeFlags=Rl(h)(m.currentRuntimeFlags),$t)))}))}),gce=O(2,(e,t)=>Array.isArray(t)?mR(e,C4(...t)):ice(t)?mR(e,t):cJ(t)?hC(e,t):Mie in t?he(t.runtimeEffect,n=>pR(e,n)):pR(e,t)),Yp=iZ,gR=e=>bce(e.slice(0)),bce=e=>Object.setPrototypeOf(e,oZ),A4=Um,yce=Um,qC=(function(){const e=Symbol.for("effect/Data/Error/plainArgs");return{BaseEffectError:class extends iC{constructor(n){super(n?.message,n?.cause?{cause:n.cause}:void 0),n&&(Object.assign(this,n),Object.defineProperty(this,e,{value:n,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}.BaseEffectError})(),np=e=>{const t={BaseEffectError:class extends qC{_tag=e}};return t.BaseEffectError.prototype.name=e,t.BaseEffectError},xce="effect/Schedule",N4=Symbol.for(xce),kce=e=>Be(e,N4),vce="effect/ScheduleDriver",Sce=Symbol.for(vce),Xw={start:0,now:0,input:void 0,output:void 0,elapsed:rd,elapsedSincePrevious:rd,recurrence:0},bR=_u()("effect/Schedule/CurrentIterationMetadata",{defaultValue:()=>Xw}),wce={_Out:e=>e,_In:e=>e,_R:e=>e},_ce={_Out:e=>e,_In:e=>e,_R:e=>e};class Ece{initial;step;[N4]=wce;constructor(t,n){this.initial=t,this.step=n}pipe(){return je(this,arguments)}}const yR=(e,t,n,r)=>Wy(e,s=>s.recurrence===0?{now:t,input:n,output:r,recurrence:s.recurrence+1,elapsed:rd,elapsedSincePrevious:rd,start:t}:{now:t,input:n,output:r,recurrence:s.recurrence+1,elapsed:sd(t-s.start),elapsedSincePrevious:sd(t-s.now),start:s.start});class Tce{schedule;ref;[Sce]=_ce;constructor(t,n){this.schedule=t,this.ref=n}get state(){return ot(Ka(this.ref),t=>t[1])}get last(){return he(Ka(this.ref),([t,n])=>{switch(t._tag){case"None":return V1(()=>new Z1);case"Some":return Ae(t.value)}})}iterationMeta=_C(Xw);get reset(){return Ll(this.ref,[ye(),this.schedule.initial]).pipe(Q1(Ll(this.iterationMeta,Xw)))}next(t){return B(ot(Ka(this.ref),n=>n[1]),he(n=>B(Hre,he(r=>B(st(()=>this.schedule.step(r,t,n)),he(([s,a,o])=>{const i=Ll(this.ref,[Ce(a),s]);if(t0(o))return i.pipe(un(mn(ye())));const c=mie(o.intervals)-r;if(c<=0)return i.pipe(un(yR(this.iterationMeta,r,t,a)),Hr(a));const u=sd(c);return B(i,un(yR(this.iterationMeta,r,t,a)),un(rse(u)),Hr(a))}))))))}}const rp=(e,t)=>new Ece(e,t),Cce=O(2,(e,t)=>VC(e,(n,r)=>ke(()=>t(n,r)))),VC=O(2,(e,t)=>rp(e.initial,(n,r,s)=>he(e.step(n,r,s),([a,o,i])=>t0(i)?Ae([a,o,dm]):ot(t(r,o),c=>c?[a,o,i]:[a,o,dm])))),Ice=e=>B(Ky([ye(),e.initial]),ot(t=>new Tce(e,t))),Ace=O(2,(e,t)=>Nce(e,t,hie)),Nce=O(3,(e,t,n)=>rp([e.initial,t.initial],(r,s,a)=>B(g6(e.step(r,s,a[0]),t.step(r,s,a[1]),(o,i)=>[o,i]),he(([[o,i,c],[u,l,d]])=>dR(c)&&dR(d)?Zw(e,t,s,o,i,c.intervals,u,l,d.intervals,n):Ae([[o,u],[i,l],dm]))))),Zw=(e,t,n,r,s,a,o,i,c,u)=>{const l=u(a,c);return gie(l)?Ae([[r,o],[s,i],Sie(l)]):B(a,pie(c))?he(e.step(lR(a),n,r),([d,h,m])=>t0(m)?Ae([[d,o],[h,i],dm]):Zw(e,t,n,d,h,m.intervals,o,i,c,u)):he(t.step(lR(c),n,o),([d,h,m])=>t0(m)?Ae([[r,d],[s,h],dm]):Zw(e,t,n,r,s,a,d,h,m.intervals,u))},Rce=O(2,(e,t)=>Pce(e,n=>ke(()=>t(n)))),Pce=O(2,(e,t)=>rp(e.initial,(n,r,s)=>he(e.step(n,r,s),([a,o,i])=>ot(t(o),c=>[a,c,i])))),Oce=e=>rp(e.initial,(t,n,r)=>B(e.step(t,n,r),ot(([s,a,o])=>[s,n,o]))),Lce=e=>Dce(P4,t=>t<e),$ce=(e,t)=>rp(e,(n,r,s)=>ke(()=>[t(s),s,wie(aie(n))])),jce=O(2,(e,t)=>VC(e,(n,r)=>ese(t(n)))),Mce=O(2,(e,t)=>VC(e,(n,r)=>t(n))),Dce=O(2,(e,t)=>Cce(e,(n,r)=>t(r))),Bb=Symbol.for("effect/Schedule/ScheduleDefect");class Fce{error;[Bb];constructor(t){this.error=t,this[Bb]=Bb}}const Bce=e=>Be(e,Bb),xR=e=>nm(e,t=>pi(new Fce(t))),Uce=e=>yn(KT(e,t=>yD(t)&&Bce(t.defect)?Ce(t.defect):ye()),{onNone:()=>e,onSome:t=>cu(t.error)}),zce=e=>o6(e,t=>Bn(Uce(t))),kR=O(2,(e,t)=>qce(e,t,(n,r)=>mn(n))),Hce=O(2,(e,t)=>{if(kce(t))return kR(e,t);const n=t.schedule??Oce(P4),r=t.while?Mce(n,o=>{const i=t.while(o);return typeof i=="boolean"?Ae(i):xR(i)}):n,s=t.until?jce(r,o=>{const i=t.until(o);return typeof i=="boolean"?Ae(i):xR(i)}):r,a=t.times?Ace(s,Lce(t.times)).pipe(Rce(o=>o[0])):s;return zce(kR(e,a))}),qce=O(3,(e,t,n)=>he(Ice(t),r=>Bo(e,{onFailure:s=>n(s,ye()),onSuccess:s=>R4(YN(e,bR,Ka(r.iterationMeta)),r,(a,o)=>YN(n(a,o),bR,Ka(r.iterationMeta)),s)}))),R4=(e,t,n,r)=>Bo(t.next(r),{onFailure:()=>Oee(t.last),onSuccess:s=>Bo(e,{onFailure:a=>n(a,Ce(s)),onSuccess:a=>R4(e,t,n,a)})}),P4=$ce(0,e=>e+1),Ha=rx,Mr=Di,Vce=I6,Gce=A6,e_=kte,No=dC,Kce=ax,vR=Symbol.for("effect/MutableList"),Wce={[vR]:vR,[Symbol.iterator](){let e=!1,t=this.head;return{next(){if(e)return this.return();if(t==null)return e=!0,this.return();const n=t.value;return t=t.next,{done:e,value:n}},return(n){return e||(e=!0),{done:!0,value:n}}}},toString(){return zt(this.toJSON())},toJSON(){return{_id:"MutableList",values:Array.from(this).map(en)}},[xt](){return this.toJSON()},pipe(){return je(this,arguments)}},Yce=e=>({value:e,removed:!1,prev:void 0,next:void 0}),Jce=()=>{const e=Object.create(Wce);return e.head=void 0,e.tail=void 0,e._length=0,e},O4=e=>GC(e)===0,GC=e=>e._length,Qce=O(2,(e,t)=>{const n=Yce(t);return e.head===void 0&&(e.head=n),e.tail===void 0||(e.tail.next=n,n.prev=e.tail),e.tail=n,e._length+=1,e}),Xce=e=>{const t=e.head;if(t!==void 0)return Zce(e,t),t.value},Zce=(e,t)=>{t.removed||(t.removed=!0,t.prev!==void 0&&t.next!==void 0?(t.prev.next=t.next,t.next.prev=t.prev):t.prev!==void 0?(e.tail=t.prev,t.prev.next=void 0):t.next!==void 0?(e.head=t.next,t.next.prev=void 0):(e.tail=void 0,e.head=void 0),e._length>0&&(e._length-=1))},SR=Symbol.for("effect/MutableQueue"),Gr=Symbol.for("effect/mutable/MutableQueue/Empty"),eue={[SR]:SR,[Symbol.iterator](){return Array.from(this.queue)[Symbol.iterator]()},toString(){return zt(this.toJSON())},toJSON(){return{_id:"MutableQueue",values:Array.from(this).map(en)}},[xt](){return this.toJSON()},pipe(){return je(this,arguments)}},L4=e=>{const t=Object.create(eue);return t.queue=Jce(),t.capacity=e,t},tue=e=>L4(e),KC=()=>L4(void 0),WC=e=>GC(e.queue),t_=e=>O4(e.queue),nue=e=>e.capacity===void 0?1/0:e.capacity,fm=O(2,(e,t)=>{const n=GC(e.queue);return e.capacity!==void 0&&n===e.capacity?!1:(Qce(t)(e.queue),!0)}),$4=O(2,(e,t)=>{const n=t[Symbol.iterator]();let r,s=pr(),a=!0;for(;a&&(r=n.next())&&!r.done;)a=fm(r.value)(e);for(;r!=null&&!r.done;)s=Tr(r.value)(s),r=n.next();return Do(s)}),Ti=O(2,(e,t)=>O4(e.queue)?t:Xce(e.queue)),YC=O(2,(e,t)=>{let n=pr(),r=0;for(;r<t;){const s=Ti(Gr)(e);if(s===Gr)break;n=Tr(s)(n),r+=1}return Do(n)}),n_=du,Ki=zo,dv=Zre,rue=G5,Ya=dd,s0=ka,a0=St,ro=mn,ha=Bn,sue=i6,$l=m6,Ub=Dee,aue=nse,Kt=Ae,pn=st,Bt=ke,bt=$t,j4=nm,JC=o6,oue=Xre,iue=g5,cue=ise,mh=ose,kc=ko,ia=eC,uue=Wm,qf=Ym,o0=va,fv=Hr,QC=Gs,It=ot,XC=Y1,i0=_oe,lue=s6,bl=lm,bx=Q5,due=Y5,r_=J5,fue=Km,hue=DC,Jc=Rie,M4=fC,D4=R6,c0=gce,mue=lse,Vu=id,lr=_i,F4=d6,pue=use,Ue=he,il=K1,hv=Doe,B4=Z5,U4=tC,z4=ase,wR=Hce,gue=Ld,bue=b5,s_=u6,ca=Vs,yue=Bo,sp=Jie,xue=zC,kue=Iie,vue=Nie,yx=Xie,Sue=Zie,wue=ece,Hs=tce,u0=Roe,ZC=Poe,cr=Ooe,xx=Zm,_ue=hse,Eue=mse,H4=p6,kx=tp,Tue=m4,Cue=h4,vx=pu,eI=x4,a_=Symbol.for("effect/FiberHandle"),Iue=e=>Be(e,a_),Aue={[a_]:a_,toString(){return zt(this.toJSON())},toJSON(){return{_id:"FiberHandle",state:this.state}},[xt](){return this.toJSON()},pipe(){return je(this,arguments)}},Nue=e=>{const t=Object.create(Aue);return t.state={_tag:"Open",fiber:void 0},t.deferred=e,t},Rue=()=>i0(It(Ha(),e=>Nue(e)),e=>a0(t=>{const n=e.state;return n._tag==="Closed"?bt:(e.state={_tag:"Closed"},n.fiber?F4(QC(HC(n.fiber,fh(t.id(),zb))),e.deferred):Vce(e.deferred,AC))})),Pue=()=>Ue(Rue(),e=>$ue(e)()),q4=-1,zb=UX(q4,0),Oue=Yoe(void 0,{emptyCase:Po,failCase:Po,dieCase:Po,interruptCase:(e,t)=>mD(OD(t),q4),sequentialCase:(e,t,n)=>t||n,parallelCase:(e,t,n)=>t||n}),Lue=O(e=>Iue(e[0]),(e,t,n)=>{if(e.state._tag==="Closed"){t.unsafeInterruptAsFork(fh(n?.interruptAs??ys,zb));return}else if(e.state.fiber!==void 0){if(n?.onlyIfMissing===!0){t.unsafeInterruptAsFork(fh(n?.interruptAs??ys,zb));return}else if(e.state.fiber===t)return;e.state.fiber.unsafeInterruptAsFork(fh(n?.interruptAs??ys,zb)),e.state.fiber=void 0}e.state.fiber=t,t.addObserver(r=>{e.state._tag==="Open"&&t===e.state.fiber&&(e.state.fiber=void 0),CC(r)&&(n?.propagateInterruption===!0?!Oue(r.cause):!Voe(r.cause))&&Kce(e.deferred,r)})}),_R=(function(){let e;return()=>(e===void 0&&(e=yx(kc)),e)})(),$ue=e=>()=>It(sp(),t=>{const n=kx(t);return(r,s)=>{if(e.state._tag==="Closed")return _R();if(e.state.fiber!==void 0&&s?.onlyIfMissing===!0)return _R();const a=n(r,s);return Lue(e,a,s),a}}),jue=dce,V4=fce,G4=I4,mv=pce,Mue=S4,ER=_4,tI=zn,K4=no,Due=S6,Fue="effect/QueueEnqueue",Bue=Symbol.for(Fue),Uue="effect/QueueDequeue",zue=Symbol.for(Uue),Hue="effect/QueueStrategy",W4=Symbol.for(Hue),que="effect/BackingQueue",Vue=Symbol.for(que),Y4={_A:e=>e},Gue={_A:e=>e},Kue={_In:e=>e},Wue={_Out:e=>e};class Yue extends Fd{queue;takers;shutdownHook;shutdownFlag;strategy;[Bue]=Kue;[zue]=Wue;constructor(t,n,r,s,a){super(),this.queue=t,this.takers=n,this.shutdownHook=r,this.shutdownFlag=s,this.strategy=a}pipe(){return je(this,arguments)}commit(){return this.take}capacity(){return this.queue.capacity()}get size(){return st(()=>nm(this.unsafeSize(),()=>ko))}unsafeSize(){return On(this.shutdownFlag)?ye():Ce(this.queue.length()-WC(this.takers)+this.strategy.surplusSize())}get isEmpty(){return ot(this.size,t=>t<=0)}get isFull(){return ot(this.size,t=>t>=this.capacity())}get shutdown(){return Ym(St(t=>(B(this.shutdownFlag,Bm(!0)),B(Wa(jl(this.takers),n=>N6(n,t.id()),!1,!1),un(this.strategy.shutdown),nC(dC(this.shutdownHook,void 0)),Gs))))}get isShutdown(){return ke(()=>On(this.shutdownFlag))}get awaitShutdown(){return Di(this.shutdownHook)}isActive(){return!On(this.shutdownFlag)}unsafeOffer(t){if(On(this.shutdownFlag))return!1;let n;if(this.queue.length()===0){const s=B(this.takers,Ti(Gr));s!==Gr?(Qc(s,t),n=!0):n=!1}else n=!1;if(n)return!0;const r=this.queue.offer(t);return yl(this.strategy,this.queue,this.takers),r}offer(t){return st(()=>{if(On(this.shutdownFlag))return ko;let n;if(this.queue.length()===0){const s=B(this.takers,Ti(Gr));s!==Gr?(Qc(s,t),n=!0):n=!1}else n=!1;if(n)return Ae(!0);const r=this.queue.offer(t);return yl(this.strategy,this.queue,this.takers),r?Ae(!0):this.strategy.handleSurplus([t],this.queue,this.takers,this.shutdownFlag)})}offerAll(t){return st(()=>{if(On(this.shutdownFlag))return ko;const n=Ct(t),r=this.queue.length()===0?Ct(dle(this.takers,n.length)):Li,[s,a]=B(n,YM(r.length));for(let i=0;i<r.length;i++){const c=r[i],u=s[i];Qc(c,u)}if(a.length===0)return Ae(!0);const o=this.queue.offerAll(a);return yl(this.strategy,this.queue,this.takers),OT(o)?Ae(!0):this.strategy.handleSurplus(o,this.queue,this.takers,this.shutdownFlag)})}get take(){return St(t=>{if(On(this.shutdownFlag))return ko;const n=this.queue.poll(Gr);if(n!==Gr)return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),Ae(n);{const r=nx(t.id());return B(st(()=>(B(this.takers,fm(r)),yl(this.strategy,this.queue,this.takers),On(this.shutdownFlag)?ko:Di(r))),Wm(()=>ke(()=>fle(this.takers,r))))}})}get takeAll(){return st(()=>On(this.shutdownFlag)?ko:ke(()=>{const t=this.queue.pollUpTo(Number.POSITIVE_INFINITY);return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),Jl(t)}))}takeUpTo(t){return st(()=>On(this.shutdownFlag)?ko:ke(()=>{const n=this.queue.pollUpTo(t);return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),Jl(n)}))}takeBetween(t,n){return st(()=>J4(this,t,n,pr()))}}const J4=(e,t,n,r)=>n<t?Ae(r):B(ale(e,n),he(s=>{const a=t-s.length;return a===1?B(o_(e),ot(o=>B(r,_n(s),lw(o)))):a>1?B(o_(e),he(o=>J4(e,a-1,n-s.length-1,B(r,_n(s),lw(o))))):Ae(B(r,_n(s)))})),Jue=e=>B(ke(()=>tue(e)),he(t=>Q4(X4(t),ile()))),Que=()=>B(ke(()=>KC()),he(e=>Q4(X4(e),cle()))),Xue=(e,t,n,r,s)=>new Yue(e,t,n,r,s),Q4=(e,t)=>B(rx(),ot(n=>Xue(e,KC(),n,Fm(!1),t)));class Zue{mutable;[Vue]=Gue;constructor(t){this.mutable=t}poll(t){return Ti(this.mutable,t)}pollUpTo(t){return YC(this.mutable,t)}offerAll(t){return $4(this.mutable,t)}offer(t){return fm(this.mutable,t)}capacity(){return nue(this.mutable)}length(){return WC(this.mutable)}}const X4=e=>new Zue(e),ele=e=>e.size,tle=e=>e.isShutdown,nle=e=>e.shutdown,rle=O(2,(e,t)=>e.offer(t)),sle=O(2,(e,t)=>e.unsafeOffer(t)),o_=e=>e.take,ale=O(2,(e,t)=>e.takeUpTo(t)),ole=O(3,(e,t,n)=>e.takeBetween(t,n)),ile=()=>new ule,cle=()=>new lle;class ule{[W4]=Y4;putters=KC();surplusSize(){return WC(this.putters)}onCompleteTakersWithEmptyQueue(t){for(;!t_(this.putters)&&!t_(t);){const n=Ti(t,void 0),r=Ti(this.putters,void 0);r[2]&&Qc(r[1],!0),Qc(n,r[0])}}get shutdown(){return B(G1,he(t=>B(ke(()=>jl(this.putters)),he(n=>Wa(n,([r,s,a])=>a?B(N6(s,t),Gs):$t,!1,!1)))))}handleSurplus(t,n,r,s){return St(a=>{const o=nx(a.id());return B(st(()=>(this.unsafeOffer(t,o),this.unsafeOnQueueEmptySpace(n,r),yl(this,n,r),On(s)?ko:Di(o))),Wm(()=>ke(()=>this.unsafeRemove(o))))})}unsafeOnQueueEmptySpace(t,n){let r=!0;for(;r&&(t.capacity()===Number.POSITIVE_INFINITY||t.length()<t.capacity());){const s=B(this.putters,Ti(Gr));if(s===Gr)r=!1;else{const a=t.offer(s[0]);a&&s[2]?Qc(s[1],!0):a||l0(this.putters,B(jl(this.putters),Tr(s))),yl(this,t,n)}}}unsafeOffer(t,n){const r=Ct(t);for(let s=0;s<r.length;s++){const a=r[s];s===r.length-1?B(this.putters,fm([a,n,!0])):B(this.putters,fm([a,n,!1]))}}unsafeRemove(t){l0(this.putters,B(jl(this.putters),PT(([,n])=>n!==t)))}}class lle{[W4]=Y4;surplusSize(){return 0}get shutdown(){return $t}onCompleteTakersWithEmptyQueue(){}handleSurplus(t,n,r,s){return Ae(!1)}unsafeOnQueueEmptySpace(t,n){}}const Qc=(e,t)=>ax(e,Ae(t)),l0=(e,t)=>B(e,$4(t)),jl=e=>B(e,YC(Number.POSITIVE_INFINITY)),dle=(e,t)=>B(e,YC(t)),fle=(e,t)=>{l0(e,B(jl(e),PT(n=>t!==n)))},yl=(e,t,n)=>{let r=!0;for(;r&&t.length()!==0;){const s=B(n,Ti(Gr));if(s!==Gr){const a=t.poll(Gr);a!==Gr?(Qc(s,a),e.unsafeOnQueueEmptySpace(t,n)):l0(n,B(jl(n),Tr(s))),r=!0}else r=!1}r&&t.length()===0&&!t_(n)&&e.onCompleteTakersWithEmptyQueue(n)},hle=O(2,(e,t)=>e.publish(t)),mle=hle,Z4=Jue,ple=Que,gle=ele,ble=tle,d0=nle,Gu=rle,yle=sle,TR=o_,xle=ole,eF="Continue",kle="Close",vle="Yield",Sle="effect/ChannelChildExecutorDecision",CR=Symbol.for(Sle),wle={[CR]:CR},tF=e=>{const t=Object.create(wle);return t._tag=eF,t},Hb="ContinuationK",_le="ContinuationFinalizer",nF=Symbol.for("effect/ChannelContinuation"),rF={_Env:e=>e,_InErr:e=>e,_InElem:e=>e,_InDone:e=>e,_OutErr:e=>e,_OutDone:e=>e,_OutErr2:e=>e,_OutElem:e=>e,_OutDone2:e=>e};class sF{onSuccess;onHalt;_tag=Hb;[nF]=rF;constructor(t,n){this.onSuccess=t,this.onHalt=n}onExit(t){return CC(t)?this.onHalt(t.cause):this.onSuccess(t.value)}}class Ele{finalizer;_tag=_le;[nF]=rF;constructor(t){this.finalizer=t}}const aF="PullAfterNext",Tle="PullAfterAllEnqueued",Cle="effect/ChannelUpstreamPullStrategy",Ile=Symbol.for(Cle),Ale={_A:e=>e},Nle={[Ile]:Ale},oF=e=>{const t=Object.create(Nle);return t._tag=aF,t.emitSeparator=e,t},iF="BracketOut",cF="Bridge",nI="ConcatAll",uF="Emit",lF="Ensuring",dF="Fail",fF="Fold",hF="FromEffect",mF="PipeTo",Rle="Provide",pF="Read",gF="Succeed",bF="SucceedNow",yF="Suspend",Ple="effect/Channel",xF=Symbol.for(Ple),Ole={_Env:e=>e,_InErr:e=>e,_InElem:e=>e,_InDone:e=>e,_OutErr:e=>e,_OutElem:e=>e,_OutDone:e=>e},ns={[xF]:Ole,pipe(){return je(this,arguments)}},kF=e=>Be(e,xF)||Ki(e),Lle=O(2,(e,t)=>{const n=Object.create(ns);return n._tag=iF,n.acquire=()=>e,n.finalizer=t,n}),vF=(e,t,n)=>{const r=Object.create(ns);return r._tag=nI,r.combineInners=t,r.combineAll=n,r.onPull=()=>oF(ye()),r.onEmit=()=>tF,r.value=()=>e,r.k=Qe,r},$le=O(4,(e,t,n,r)=>{const s=Object.create(ns);return s._tag=nI,s.combineInners=n,s.combineAll=r,s.onPull=()=>oF(ye()),s.onEmit=()=>tF,s.value=()=>e,s.k=t,s}),SF=O(2,(e,t)=>{const n=Object.create(ns);return n._tag=cF,n.input=t,n.channel=e,n}),jle=O(2,(e,t)=>{const n=Object.create(ns);return n._tag=lF,n.channel=e,n.finalizer=t,n}),rI=e=>xs(e4(e)),xs=e=>Mle(()=>e),Mle=e=>{const t=Object.create(ns);return t._tag=dF,t.error=e,t},En=O(2,(e,t)=>{const n=Object.create(ns);return n._tag=fF,n.channel=e,n.k=new sF(t,xs),n}),Lr=e=>{const t=Object.create(ns);return t._tag=hF,t.effect=()=>e,t},ma=O(2,(e,t)=>{const n=Object.create(ns);return n._tag=mF,n.left=()=>e,n.right=()=>t,n}),wF=e=>zd({onInput:e.onInput,onFailure:t=>Yr(Koe(t),{onLeft:e.onFailure,onRight:xs}),onDone:e.onDone}),zd=e=>{const t=Object.create(ns);return t._tag=pF,t.more=e.onInput,t.done=new sF(e.onDone,e.onFailure),t},_F=e=>aI(()=>e),hm=e=>{const t=Object.create(ns);return t._tag=bF,t.terminal=e,t},sI=e=>{const t=Object.create(ns);return t._tag=yF,t.channel=e,t},aI=e=>{const t=Object.create(ns);return t._tag=gF,t.evaluate=e,t},Ho=hm(void 0),fr=e=>{const t=Object.create(ns);return t._tag=uF,t.out=e,t},ap="Done",op="Emit",Hd="FromEffect",ip="Read",Dle=Symbol.for("effect/ChannelState"),Fle={_E:e=>e,_R:e=>e},Sx={[Dle]:Fle},Ku=()=>{const e=Object.create(Sx);return e._tag=ap,e},pv=()=>{const e=Object.create(Sx);return e._tag=op,e},xf=e=>{const t=Object.create(Sx);return t._tag=Hd,t.effect=e,t},gv=(e,t,n,r)=>{const s=Object.create(Sx);return s._tag=ip,s.upstream=e,s.onEffect=t,s.onEmit=n,s.onDone=r,s},f0=e=>e._tag===Hd,Ble=e=>f0(e)?e.effect:bt,IR=e=>f0(e)?oue(e.effect):void 0,EF="PullFromChild",i_="PullFromUpstream",c_="DrainChildExecutors",TF="Emit";class Jp{childExecutor;parentSubexecutor;onEmit;_tag=EF;constructor(t,n,r){this.childExecutor=t,this.parentSubexecutor=n,this.onEmit=r}close(t){const n=this.childExecutor.close(t),r=this.parentSubexecutor.close(t);return n!==void 0&&r!==void 0?xx(lr(n),lr(r),(s,a)=>B(s,cm(a))):n!==void 0?n:r!==void 0?r:void 0}enqueuePullFromChild(t){return this}}class Tc{upstreamExecutor;createChild;lastDone;activeChildExecutors;combineChildResults;combineWithChildResult;onPull;onEmit;_tag=i_;constructor(t,n,r,s,a,o,i,c){this.upstreamExecutor=t,this.createChild=n,this.lastDone=r,this.activeChildExecutors=s,this.combineChildResults=a,this.combineWithChildResult=o,this.onPull=i,this.onEmit=c}close(t){const n=this.upstreamExecutor.close(t),s=[...this.activeChildExecutors.map(a=>a!==void 0?a.childExecutor.close(t):void 0),n].reduce((a,o)=>a!==void 0&&o!==void 0?xx(a,lr(o),(i,c)=>cm(i,c)):a!==void 0?a:o!==void 0?lr(o):void 0,void 0);return s}enqueuePullFromChild(t){return new Tc(this.upstreamExecutor,this.createChild,this.lastDone,[...this.activeChildExecutors,t],this.combineChildResults,this.combineWithChildResult,this.onPull,this.onEmit)}}class xl{upstreamExecutor;lastDone;activeChildExecutors;upstreamDone;combineChildResults;combineWithChildResult;onPull;_tag=c_;constructor(t,n,r,s,a,o,i){this.upstreamExecutor=t,this.lastDone=n,this.activeChildExecutors=r,this.upstreamDone=s,this.combineChildResults=a,this.combineWithChildResult=o,this.onPull=i}close(t){const n=this.upstreamExecutor.close(t),s=[...this.activeChildExecutors.map(a=>a!==void 0?a.childExecutor.close(t):void 0),n].reduce((a,o)=>a!==void 0&&o!==void 0?xx(a,lr(o),(i,c)=>cm(i,c)):a!==void 0?a:o!==void 0?lr(o):void 0,void 0);return s}enqueuePullFromChild(t){return new xl(this.upstreamExecutor,this.lastDone,[...this.activeChildExecutors,t],this.upstreamDone,this.combineChildResults,this.combineWithChildResult,this.onPull)}}class bv{value;next;_tag=TF;constructor(t,n){this.value=t,this.next=n}close(t){const n=this.next.close(t);return n}enqueuePullFromChild(t){return this}}const Ule="Pulled",zle="NoUpstream",Hle="effect/ChannelUpstreamPullRequest",qle=Symbol.for(Hle),Vle={_A:e=>e},CF={[qle]:Vle},AR=e=>{const t=Object.create(CF);return t._tag=Ule,t.value=e,t},Gle=e=>{const t=Object.create(CF);return t._tag=zle,t.activeDownstreamCount=e,t};class $c{_activeSubexecutor=void 0;_cancelled=void 0;_closeLastSubstream=void 0;_currentChannel;_done=void 0;_doneStack=[];_emitted=void 0;_executeCloseLastSubstream;_input=void 0;_inProgressFinalizer=void 0;_providedEnv;constructor(t,n,r){this._currentChannel=t,this._executeCloseLastSubstream=r,this._providedEnv=n}run(){let t;for(;t===void 0;)if(this._cancelled!==void 0)t=this.processCancellation();else if(this._activeSubexecutor!==void 0)t=this.runSubexecutor();else try{if(this._currentChannel===void 0)t=Ku();else switch(Ki(this._currentChannel)&&(this._currentChannel=Lr(this._currentChannel)),this._currentChannel._tag){case iF:{t=this.runBracketOut(this._currentChannel);break}case cF:{const n=this._currentChannel.input;if(this._currentChannel=this._currentChannel.channel,this._input!==void 0){const r=this._input;this._input=void 0;const s=()=>Ue(n.awaitRead(),()=>pn(()=>{const a=r.run();switch(a._tag){case ap:return Ao(r.getDone(),{onFailure:o=>n.error(o),onSuccess:o=>n.done(o)});case op:return Ue(n.emit(r.getEmit()),()=>s());case Hd:return ca(a.effect,{onFailure:o=>n.error(o),onSuccess:()=>s()});case ip:return oI(a,()=>s(),o=>n.error(o))}}));t=xf(Ue(hue(ia(s())),a=>Bt(()=>this.addFinalizer(o=>Ue(Ei(a),()=>pn(()=>{const i=this.restorePipe(o,r);return i!==void 0?i:bt}))))))}break}case nI:{const n=new $c(this._currentChannel.value(),this._providedEnv,s=>Bt(()=>{const a=this._closeLastSubstream===void 0?bt:this._closeLastSubstream;this._closeLastSubstream=B(a,cr(s))}));n._input=this._input;const r=this._currentChannel;this._activeSubexecutor=new Tc(n,s=>r.k(s),void 0,[],(s,a)=>r.combineInners(s,a),(s,a)=>r.combineAll(s,a),s=>r.onPull(s),s=>r.onEmit(s)),this._closeLastSubstream=void 0,this._currentChannel=void 0;break}case uF:{this._emitted=this._currentChannel.out,this._currentChannel=this._activeSubexecutor!==void 0?void 0:Ho,t=pv();break}case lF:{this.runEnsuring(this._currentChannel);break}case dF:{t=this.doneHalt(this._currentChannel.error());break}case fF:{this._doneStack.push(this._currentChannel.k),this._currentChannel=this._currentChannel.channel;break}case hF:{const n=this._providedEnv===void 0?this._currentChannel.effect():B(this._currentChannel.effect(),c0(this._providedEnv));t=xf(ca(n,{onFailure:r=>{const s=this.doneHalt(r);return s!==void 0&&f0(s)?s.effect:bt},onSuccess:r=>{const s=this.doneSucceed(r);return s!==void 0&&f0(s)?s.effect:bt}}));break}case mF:{const n=this._input,r=new $c(this._currentChannel.left(),this._providedEnv,s=>this._executeCloseLastSubstream(s));r._input=n,this._input=r,this.addFinalizer(s=>{const a=this.restorePipe(s,n);return a!==void 0?a:bt}),this._currentChannel=this._currentChannel.right();break}case Rle:{const n=this._providedEnv;this._providedEnv=this._currentChannel.context(),this._currentChannel=this._currentChannel.inner,this.addFinalizer(()=>Bt(()=>{this._providedEnv=n}));break}case pF:{const n=this._currentChannel;t=gv(this._input,Qe,r=>{try{this._currentChannel=n.more(r)}catch(s){this._currentChannel=n.done.onExit(gse(s))}},r=>{const s=a=>n.done.onExit(a);this._currentChannel=s(r)});break}case gF:{t=this.doneSucceed(this._currentChannel.evaluate());break}case bF:{t=this.doneSucceed(this._currentChannel.terminal);break}case yF:{this._currentChannel=this._currentChannel.channel();break}}}catch(n){this._currentChannel=xs(Jw(n))}return t}getDone(){return this._done}getEmit(){return this._emitted}cancelWith(t){this._cancelled=t}clearInProgressFinalizer(){this._inProgressFinalizer=void 0}storeInProgressFinalizer(t){this._inProgressFinalizer=t}popAllFinalizers(t){const n=[];let r=this._doneStack.pop();for(;r;)r._tag==="ContinuationFinalizer"&&n.push(r.finalizer),r=this._doneStack.pop();const s=n.length===0?bt:xv(n,t);return this.storeInProgressFinalizer(s),s}popNextFinalizers(){const t=[];for(;this._doneStack.length!==0;){const n=this._doneStack[this._doneStack.length-1];if(n._tag===Hb)return t;t.push(n),this._doneStack.pop()}return t}restorePipe(t,n){const r=this._input;return this._input=n,r!==void 0?r.close(t):bt}close(t){let n;const r=this._inProgressFinalizer;r!==void 0&&(n=B(r,bl(Bt(()=>this.clearInProgressFinalizer()))));let s;const a=this.popAllFinalizers(t);a!==void 0&&(s=B(a,bl(Bt(()=>this.clearInProgressFinalizer()))));const o=this._activeSubexecutor===void 0?void 0:this._activeSubexecutor.close(t);if(!(o===void 0&&n===void 0&&s===void 0))return B(lr(yv(o)),u0(lr(yv(n))),u0(lr(yv(s))),It(([[i,c],u])=>B(i,cm(c),cm(u))),qf,Ue(i=>pn(()=>i)))}doneSucceed(t){if(this._doneStack.length===0)return this._done=fs(t),this._currentChannel=void 0,Ku();const n=this._doneStack[this._doneStack.length-1];if(n._tag===Hb){this._doneStack.pop(),this._currentChannel=n.onSuccess(t);return}const r=this.popNextFinalizers();if(this._doneStack.length===0)return this._doneStack=r.reverse(),this._done=fs(t),this._currentChannel=void 0,Ku();const s=xv(r.map(o=>o.finalizer),fs(t));this.storeInProgressFinalizer(s);const a=B(s,bl(Bt(()=>this.clearInProgressFinalizer())),qf,Ue(()=>Bt(()=>this.doneSucceed(t))));return xf(a)}doneHalt(t){if(this._doneStack.length===0)return this._done=wr(t),this._currentChannel=void 0,Ku();const n=this._doneStack[this._doneStack.length-1];if(n._tag===Hb){this._doneStack.pop();try{this._currentChannel=n.onHalt(t)}catch(o){this._currentChannel=xs(Jw(o))}return}const r=this.popNextFinalizers();if(this._doneStack.length===0)return this._doneStack=r.reverse(),this._done=wr(t),this._currentChannel=void 0,Ku();const s=xv(r.map(o=>o.finalizer),wr(t));this.storeInProgressFinalizer(s);const a=B(s,bl(Bt(()=>this.clearInProgressFinalizer())),qf,Ue(()=>Bt(()=>this.doneHalt(t))));return xf(a)}processCancellation(){return this._currentChannel=void 0,this._done=this._cancelled,this._cancelled=void 0,Ku()}runBracketOut(t){const n=qf(ca(this.provide(t.acquire()),{onFailure:r=>Bt(()=>{this._currentChannel=xs(r)}),onSuccess:r=>Bt(()=>{this.addFinalizer(s=>this.provide(t.finalizer(r,s))),this._currentChannel=fr(r)})}));return xf(n)}provide(t){return this._providedEnv===void 0?t:B(t,c0(this._providedEnv))}runEnsuring(t){this.addFinalizer(t.finalizer),this._currentChannel=t.channel}addFinalizer(t){this._doneStack.push(new Ele(t))}runSubexecutor(){const t=this._activeSubexecutor;switch(t._tag){case EF:return this.pullFromChild(t.childExecutor,t.parentSubexecutor,t.onEmit,t);case i_:return this.pullFromUpstream(t);case c_:return this.drainChildExecutors(t);case TF:return this._emitted=t.value,this._activeSubexecutor=t.next,pv()}}replaceSubexecutor(t){this._currentChannel=void 0,this._activeSubexecutor=t}finishWithExit(t){const n=Ao(t,{onFailure:r=>this.doneHalt(r),onSuccess:r=>this.doneSucceed(r)});return this._activeSubexecutor=void 0,n===void 0?bt:Ble(n)}finishSubexecutorWithCloseEffect(t,...n){this.addFinalizer(()=>B(n,Ya(s=>B(Bt(()=>s(t)),Ue(a=>a!==void 0?a:bt)),{discard:!0})));const r=B(t,Ao({onFailure:s=>this.doneHalt(s),onSuccess:s=>this.doneSucceed(s)}));return this._activeSubexecutor=void 0,r}applyUpstreamPullStrategy(t,n,r){switch(r._tag){case aF:{const s=!t||n.some(a=>a!==void 0);return[r.emitSeparator,s?[void 0,...n]:n]}case Tle:{const s=!t||n.some(a=>a!==void 0);return[r.emitSeparator,s?[...n,void 0]:n]}}}pullFromChild(t,n,r,s){return gv(t,Qe,a=>{const o=r(a);switch(o._tag){case eF:break;case kle:{this.finishWithDoneValue(t,n,o.value);break}case vle:{const i=n.enqueuePullFromChild(s);this.replaceSubexecutor(i);break}}this._activeSubexecutor=new bv(a,this._activeSubexecutor)},Ao({onFailure:a=>{const o=this.handleSubexecutorFailure(t,n,a);return o===void 0?void 0:IR(o)},onSuccess:a=>{this.finishWithDoneValue(t,n,a)}}))}finishWithDoneValue(t,n,r){const s=n;switch(s._tag){case i_:{const a=new Tc(s.upstreamExecutor,s.createChild,s.lastDone!==void 0?s.combineChildResults(s.lastDone,r):r,s.activeChildExecutors,s.combineChildResults,s.combineWithChildResult,s.onPull,s.onEmit);this._closeLastSubstream=t.close(fs(r)),this.replaceSubexecutor(a);break}case c_:{const a=new xl(s.upstreamExecutor,s.lastDone!==void 0?s.combineChildResults(s.lastDone,r):r,s.activeChildExecutors,s.upstreamDone,s.combineChildResults,s.combineWithChildResult,s.onPull);this._closeLastSubstream=t.close(fs(r)),this.replaceSubexecutor(a);break}}}handleSubexecutorFailure(t,n,r){return this.finishSubexecutorWithCloseEffect(wr(r),s=>n.close(s),s=>t.close(s))}pullFromUpstream(t){if(t.activeChildExecutors.length===0)return this.performPullFromUpstream(t);const n=t.activeChildExecutors[0],r=new Tc(t.upstreamExecutor,t.createChild,t.lastDone,t.activeChildExecutors.slice(1),t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit);if(n===void 0)return this.performPullFromUpstream(r);this.replaceSubexecutor(new Jp(n.childExecutor,r,n.onEmit))}performPullFromUpstream(t){return gv(t.upstreamExecutor,n=>{const r=this._closeLastSubstream===void 0?bt:this._closeLastSubstream;return this._closeLastSubstream=void 0,B(this._executeCloseLastSubstream(r),cr(n))},n=>{if(this._closeLastSubstream!==void 0){const o=this._closeLastSubstream;return this._closeLastSubstream=void 0,B(this._executeCloseLastSubstream(o),It(()=>{const i=new $c(t.createChild(n),this._providedEnv,this._executeCloseLastSubstream);i._input=this._input;const[c,u]=this.applyUpstreamPullStrategy(!1,t.activeChildExecutors,t.onPull(AR(n)));this._activeSubexecutor=new Jp(i,new Tc(t.upstreamExecutor,t.createChild,t.lastDone,u,t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit),t.onEmit),Et(c)&&(this._activeSubexecutor=new bv(c.value,this._activeSubexecutor))}))}const r=new $c(t.createChild(n),this._providedEnv,this._executeCloseLastSubstream);r._input=this._input;const[s,a]=this.applyUpstreamPullStrategy(!1,t.activeChildExecutors,t.onPull(AR(n)));this._activeSubexecutor=new Jp(r,new Tc(t.upstreamExecutor,t.createChild,t.lastDone,a,t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit),t.onEmit),Et(s)&&(this._activeSubexecutor=new bv(s.value,this._activeSubexecutor))},n=>{if(t.activeChildExecutors.some(a=>a!==void 0)){const a=new xl(t.upstreamExecutor,t.lastDone,[void 0,...t.activeChildExecutors],t.upstreamExecutor.getDone(),t.combineChildResults,t.combineWithChildResult,t.onPull);if(this._closeLastSubstream!==void 0){const o=this._closeLastSubstream;return this._closeLastSubstream=void 0,B(this._executeCloseLastSubstream(o),It(()=>this.replaceSubexecutor(a)))}this.replaceSubexecutor(a);return}const r=this._closeLastSubstream,s=this.finishSubexecutorWithCloseEffect(B(n,yse(a=>t.combineWithChildResult(t.lastDone,a))),()=>r,a=>t.upstreamExecutor.close(a));return s===void 0?void 0:IR(s)})}drainChildExecutors(t){if(t.activeChildExecutors.length===0){const a=this._closeLastSubstream;return a!==void 0&&this.addFinalizer(()=>Kt(a)),this.finishSubexecutorWithCloseEffect(t.upstreamDone,()=>a,o=>t.upstreamExecutor.close(o))}const n=t.activeChildExecutors[0],r=t.activeChildExecutors.slice(1);if(n===void 0){const[a,o]=this.applyUpstreamPullStrategy(!0,r,t.onPull(Gle(r.reduce((i,c)=>c!==void 0?i+1:i,0))));return this.replaceSubexecutor(new xl(t.upstreamExecutor,t.lastDone,o,t.upstreamDone,t.combineChildResults,t.combineWithChildResult,t.onPull)),Et(a)?(this._emitted=a.value,pv()):void 0}const s=new xl(t.upstreamExecutor,t.lastDone,r,t.upstreamDone,t.combineChildResults,t.combineWithChildResult,t.onPull);this.replaceSubexecutor(new Jp(n.childExecutor,s,n.onEmit))}}const yv=e=>e!==void 0?e:bt,xv=(e,t)=>B(Ya(e,n=>lr(n(t))),It(n=>B(pse(n),Yt(()=>AC))),Ue(n=>pn(()=>n))),oI=(e,t,n)=>{const r=[e],s=()=>{const a=r.pop();if(a===void 0||a.upstream===void 0)return sue("Unexpected end of input for channel execution");const o=a.upstream.run();switch(o._tag){case op:{const i=a.onEmit(a.upstream.getEmit());return r.length===0?i===void 0?pn(t):B(i,ca({onFailure:n,onSuccess:t})):i===void 0?pn(()=>s()):B(i,ca({onFailure:n,onSuccess:()=>s()}))}case ap:{const i=a.onDone(a.upstream.getDone());return r.length===0?i===void 0?pn(t):B(i,ca({onFailure:n,onSuccess:t})):i===void 0?pn(()=>s()):B(i,ca({onFailure:n,onSuccess:()=>s()}))}case Hd:return r.push(a),B(a.onEffect(o.effect),JC(i=>pn(()=>{const c=a.onDone(wr(i));return c===void 0?bt:c})),ca({onFailure:n,onSuccess:()=>s()}));case ip:return r.push(a),r.push(o),pn(()=>s())}};return s()},Kle=O(2,(e,t)=>{const n=(r,s,a)=>lue(Bt(()=>new $c(e,void 0,Qe)),o=>pn(()=>qb(o.run(),o).pipe(F4(r),cr(Mr(r)),ZC(Mr(s)))),(o,i)=>{const c=o.close(i);return c===void 0?bt:z4(c,u=>n0(a,ha(u)))});return o0(r=>rue([c4(t,Uy),Ha(),Ha()]).pipe(Ue(([s,a,o])=>r(n(a,o,s)).pipe(Jc(t),Ue(i=>t.addFinalizer(c=>{const u=CC(c)?Goe(c.cause):void 0;return e_(a).pipe(Ue(l=>l?No(o,void 0).pipe(cr(f4(i)),cr(fR(i))):No(o,void 0).pipe(cr(u&&VT(u)>0?HC(i,BX(u)):Ei(i)),cr(fR(i)))))}).pipe(cr(r(Mr(a)))))))))}),qb=(e,t)=>{const n=e;switch(n._tag){case Hd:return B(n.effect,Ue(()=>qb(t.run(),t)));case op:return qb(t.run(),t);case ap:return pn(()=>t.getDone());case ip:return oI(n,()=>qb(t.run(),t),ha)}},Wle="Done",Yle="Await",Jle="effect/ChannelMergeDecision",Qle=Symbol.for(Jle),Xle={[Qle]:{_R:e=>e,_E0:e=>e,_Z0:e=>e,_E:e=>e,_Z:e=>e}},NR=e=>{const t=Object.create(Xle);return t._tag=Yle,t.f=e,t},IF="BothRunning",AF="LeftDone",NF="RightDone",Zle="effect/ChannelMergeState",RR=Symbol.for(Zle),iI={[RR]:RR},kv=(e,t)=>{const n=Object.create(iI);return n._tag=IF,n.left=e,n.right=t,n},PR=e=>{const t=Object.create(iI);return t._tag=AF,t.f=e,t},OR=e=>{const t=Object.create(iI);return t._tag=NF,t.f=e,t},RF="BackPressure",PF="BufferSliding",ede="effect/ChannelMergeStrategy",LR=Symbol.for(ede),OF={[LR]:LR},tde=e=>{const t=Object.create(OF);return t._tag=RF,t},nde=e=>{const t=Object.create(OF);return t._tag=PF,t},rde=O(2,(e,{onBackPressure:t,onBufferSliding:n})=>{switch(e._tag){case RF:return t();case PF:return n()}}),cl="Empty",Vf="Emit",Gf="Error",Kf="Done",LF=e=>({_tag:cl,notifyProducer:e}),vv=e=>({_tag:Vf,notifyConsumers:e}),sde=e=>({_tag:Gf,cause:e}),ade=e=>({_tag:Kf,done:e});class ode{ref;constructor(t){this.ref=t}awaitRead(){return il(pf(this.ref,t=>t._tag===cl?[Mr(t.notifyProducer),t]:[bt,t]))}get close(){return fue(t=>this.error(t4(t)))}done(t){return il(pf(this.ref,n=>{switch(n._tag){case cl:return[Mr(n.notifyProducer),n];case Vf:return[Ya(n.notifyConsumers,r=>No(r,Ye(t)),{discard:!0}),ade(t)];case Gf:return[kc,n];case Kf:return[kc,n]}}))}emit(t){return Ue(Ha(),n=>il(pf(this.ref,r=>{switch(r._tag){case cl:return[Mr(r.notifyProducer),r];case Vf:{const s=r.notifyConsumers[0],a=r.notifyConsumers.slice(1);if(s!==void 0)return[No(s,nt(t)),a.length===0?LF(n):vv(a)];throw new Error("Bug: Channel.SingleProducerAsyncInput.emit - Queue was empty! please report an issue at https://github.com/Effect-TS/effect/issues")}case Gf:return[kc,r];case Kf:return[kc,r]}})))}error(t){return il(pf(this.ref,n=>{switch(n._tag){case cl:return[Mr(n.notifyProducer),n];case Vf:return[Ya(n.notifyConsumers,r=>Gce(r,t),{discard:!0}),sde(t)];case Gf:return[kc,n];case Kf:return[kc,n]}}))}get take(){return this.takeWith(t=>wr(Woe(t,Ye)),t=>fs(t),t=>Yy(nt(t)))}takeWith(t,n,r){return Ue(Ha(),s=>il(pf(this.ref,a=>{switch(a._tag){case cl:return[cr(No(a.notifyProducer,void 0),s_(Mr(s),{onFailure:t,onSuccess:Yr({onLeft:r,onRight:n})})),vv([s])];case Vf:return[s_(Mr(s),{onFailure:t,onSuccess:Yr({onLeft:r,onRight:n})}),vv([...a.notifyConsumers,s])];case Gf:return[Kt(t(a.cause)),a];case Kf:return[Kt(r(a.done)),a]}})))}}const $F=()=>B(Ha(),Ue(e=>EC(LF(e))),It(e=>new ode(e))),u_=O(2,(e,t)=>$le(e,t,()=>{},()=>{})),ide=e=>{const t=zd({onInput:()=>t,onFailure:xs,onDone:_F});return ma(e,t)},jF=O(2,(e,t)=>jle(e,()=>t)),cde=e=>En(e,Qe),cI=e=>Ci(e.takeWith(xs,t=>En(fr(t),()=>cI(e)),_F)),MF=O(2,(e,t)=>En(e,n=>aI(()=>t(n)))),DF=O(2,(e,t)=>{const n=wF({onInput:r=>En(fr(t(r)),()=>n),onFailure:rI,onDone:hm});return ma(e,n)}),ude=e=>t=>lde(e)(t,Kl),lde=({bufferSize:e=16,concurrency:t,mergeStrategy:n=tde()})=>(r,s)=>zF(a=>$l(function*(){const o=t==="unbounded"?Number.MAX_SAFE_INTEGER:t,i=yield*$F(),c=cI(i),u=yield*Z4(e);yield*n0(a,d0(u));const l=yield*ple();yield*n0(a,d0(l));const d=yield*EC(ye()),h=yield*Ha(),m=(yield*kue(o)).withPermits,p=yield*Ml(ma(c,r),a);function y(b){return b.pipe(Ue(Yr({onLeft:x=>Kt(Ce(x)),onRight:x=>fv(Gu(u,Kt(nt(x))),ye())})),wR({until:x=>Et(x)}),Ue(x=>Bre(d,yn({onNone:()=>Ce(x.value),onSome:k=>Ce(s(k,x.value))}))),JC(x=>Zy(x)?ha(x):Gu(u,ha(x)).pipe(cr(No(h,void 0)),QC)))}yield*p.pipe(ca({onFailure:b=>Gu(u,ha(b)).pipe(cr(Kt(!1))),onSuccess:Yr({onLeft:b=>B4(ia(Mr(h)),ia(m(o)(bt)),{onSelfDone:(x,k)=>fv(Ei(k),!1),onOtherDone:(x,k)=>cr(Ei(k),Mre(d).pipe(Ue(yn({onNone:()=>Gu(u,Kt(Ye(b))),onSome:_=>Gu(u,Kt(Ye(s(_,b))))})),fv(!1)))}),onRight:b=>rde(n,{onBackPressure:()=>$l(function*(){const x=yield*Ha(),k=r_(S=>Ml(ma(c,b),S).pipe(Ue(w=>hv(lr(y(w)),lr(ia(Mr(h))))),Ue(Qe)));return yield*No(x,void 0).pipe(cr(k),m(1),Jc(a)),yield*Mr(x),!(yield*e_(h))}),onBufferSliding:()=>$l(function*(){const x=yield*Ha(),k=yield*Ha(),_=yield*gle(l);yield*TR(l).pipe(Ue(T=>No(T,void 0)),pue(()=>_>=o)),yield*Gu(l,x);const S=r_(T=>Ml(ma(c,b),T).pipe(Ue(A=>lr(y(A)).pipe(hv(lr(ia(Mr(h)))),hv(lr(ia(Mr(x)))))),Ue(Qe)));return yield*No(k,void 0).pipe(cr(S),m(1),Jc(a)),yield*Mr(k),!(yield*e_(h))})})})}),wR({while:b=>b}),Jc(a));const g=B(TR(u),il,s_({onFailure:xs,onSuccess:Yr({onLeft:hm,onRight:b=>En(fr(b),()=>g)})}),Ci);return SF(g,i)})),FF=O(3,(e,t,n)=>ude(n)(DF(e,t))),dde=O(2,(e,t)=>{function n(r){return $l(function*(){const s=yield*$F(),a=cI(s),o=yield*Ml(ma(a,e),r),i=yield*Ml(ma(a,t.other),r);function c(l,d,h){return(m,p,y)=>{function g(b){const x=b;return x._tag===Wle?Kt(Lr(cr(Ei(d),x.effect))):It(f4(d),Ao({onFailure:k=>Lr(x.f(wr(k))),onSuccess:Yr({onLeft:k=>Lr(x.f(fs(k))),onRight:k=>uI(fr(k),u(y(x.f)))})}))}return Ao(l,{onFailure:b=>g(m(wr(b))),onSuccess:Yr({onLeft:b=>g(m(fs(b))),onRight:b=>Kt(En(fr(b),()=>En(Lr(Jc(ia(h),r)),x=>u(p(x,d)))))})})}}function u(l){switch(l._tag){case IF:{const d=ia(hR(l.left)),h=ia(hR(l.right));return Ci(B4(d,h,{onSelfDone:(m,p)=>cr(Ei(p),c(m,l.right,o)(t.onSelfDone,kv,y=>PR(y))),onOtherDone:(m,p)=>cr(Ei(p),c(m,l.left,i)(t.onOtherDone,(y,g)=>kv(g,y),y=>OR(y)))}))}case AF:return Ci(It(lr(i),Ao({onFailure:d=>Lr(l.f(wr(d))),onSuccess:Yr({onLeft:d=>Lr(l.f(fs(d))),onRight:d=>En(fr(d),()=>u(PR(l.f)))})})));case NF:return Ci(It(lr(o),Ao({onFailure:d=>Lr(l.f(wr(d))),onSuccess:Yr({onLeft:d=>Lr(l.f(fs(d))),onRight:d=>En(fr(d),()=>u(OR(l.f)))})})))}}return Lr(a0(l=>{const d=a0(p=>(p.transferChildren(l.scope()),bt)),h=ia(o).pipe(bl(d),Jc(r)),m=ia(i).pipe(bl(d),Jc(r));return xx(h,m,(p,y)=>kv(p,y))})).pipe(En(u),SF(s))})}return zF(n)}),fde=O(2,(e,t)=>sI(()=>{let n;const r=wF({onInput:a=>En(fr(a),()=>r),onFailure:a=>(n=yde(a),xs(Jw(n))),onDone:hm}),s=zd({onInput:a=>B(fr(a),En(()=>s)),onFailure:a=>qoe(a)&&xde(a.defect)&&Fe(a.defect,n)?rI(a.defect.error):xs(a),onDone:hm});return ma(ma(ma(e,r),t),s)})),hde=e=>r_(t=>Kle(e,t)),BF=e=>hde(ide(e)),UF=e=>Ci(o0(t=>It(u4(),n=>Lle(z4(t(Tie(e,n)),r=>r0(n,wr(r))),(r,s)=>r0(n,s))))),mde=e=>gde(It(bx,t=>En(Lr(e(t)),fr))),pde=e=>Ue(bx,t=>Ml(e,t)),Ml=O(2,(e,t)=>u0(Bt(()=>new $c(e,void 0,Qe)),sp()).pipe(U4(([n,r])=>Eie(t,s=>{const a=n.close(s);return a!==void 0?c0(a,r):bt})),qf,It(([n])=>pn(()=>l_(n.run(),n))))),l_=(e,t)=>{const n=e;switch(n._tag){case ap:return Ao(t.getDone(),{onFailure:ha,onSuccess:r=>Kt(Ye(r))});case op:return Kt(nt(t.getEmit()));case Hd:return B(n.effect,Ue(()=>l_(t.run(),t)));case ip:return oI(n,()=>l_(t.run(),t),r=>ha(r))}},Ci=e=>cde(Lr(e)),gde=e=>vF(UF(e),(t,n)=>t,(t,n)=>t),zF=e=>vF(mde(e),(t,n)=>t,(t,n)=>t),HF=e=>qF(0,e.length,e),qF=(e,t,n)=>e===t?Ho:B(fr(B(n,Si(e))),En(()=>qF(e+1,t,n))),bde=O(e=>kF(e[1]),(e,t,n)=>n?.concurrent?dde(e,{other:t,onSelfDone:r=>NR(s=>pn(()=>JN(r,s))),onOtherDone:r=>NR(s=>pn(()=>JN(s,r)))}):En(e,r=>MF(t,s=>[r,s]))),uI=O(e=>kF(e[1]),(e,t,n)=>n?.concurrent?MF(bde(e,t,{concurrent:!0}),r=>r[1]):En(e,()=>t)),d_=Symbol.for("effect/Channel/ChannelException"),yde=e=>({_tag:"ChannelException",[d_]:d_,error:e}),xde=e=>Be(e,d_),kde=Symbol.for("effect/Sink"),vde={_A:e=>e,_In:e=>e,_L:e=>e,_E:e=>e,_R:e=>e};class lI{channel;[kde]=vde;constructor(t){this.channel=t}pipe(){return je(this,arguments)}}const Sde=e=>{const t=zd({onInput:n=>B(Lr(Ya(n,r=>e(r),{discard:!0})),En(()=>t)),onFailure:xs,onDone:()=>Ho});return new lI(t)},wde=e=>{const t=zd({onInput:n=>B(Lr(e(n)),En(()=>t)),onFailure:xs,onDone:()=>Ho});return new lI(t)},_de=e=>new lI(Lr(e)),VF=e=>Ki(e)?VF(_de(e)):e.channel,Ede=()=>ro(ye()),Tde=e=>XC(ha(e),Ce),Cde="effect/Stream",dI=Symbol.for(Cde),Ide={_R:e=>e,_E:e=>e,_A:e=>e};class Sa{channel;[dI]=Ide;constructor(t){this.channel=t}pipe(){return je(this,arguments)}}const wx=e=>Be(e,dI)||Ki(e),Ade=4096,GF=O(2,(e,t)=>new Sa(B(Fs(e),jF(t)))),Nde=e=>YF(ro(Ce(e))),Rde=e=>WF(ha(e)),Pde=O(2,(e,t)=>Dde(e,PT(t))),KF=O(e=>wx(e[0]),(e,t,n)=>{const r=n?.bufferSize??16;return n?.switch?$R(n?.concurrency,()=>jR(e,1,r,t),s=>jR(e,s,r,t)):$R(n?.concurrency,()=>new Sa(u_(Fs(e),s=>B(s,mQ(a=>Fs(t(a))),gQ(Ho,(a,o)=>B(a,uI(o)))))),s=>new Sa(B(Fs(e),u_(HF),FF(a=>Fs(t(a)),n))))}),$R=(e,t,n)=>{switch(e){case void 0:return t();case"unbounded":return n(Number.MAX_SAFE_INTEGER);default:return e>1?n(e):t()}},jR=O(4,(e,t,n,r)=>new Sa(B(Fs(e),u_(HF),FF(s=>Fs(r(s)),{concurrency:t,mergeStrategy:nde(),bufferSize:n})))),Ode=O(e=>wx(e[0]),(e,t)=>KF(e,Qe,t)),Lde=e=>new Sa(e),Fs=e=>{if("channel"in e)return e.channel;if(Ki(e))return Fs(WF(e));throw new TypeError("Expected a Stream.")},$de=e=>new Sa(OT(e)?Ho:fr(e)),WF=e=>B(e,XC(Ce),YF),YF=e=>new Sa(Ci(bue(e,{onFailure:yn({onNone:()=>Ho,onSome:rI}),onSuccess:t=>fr(In(t))}))),jde=(e,t)=>B(xle(e,1,t?.maxChunkSize??Ade),JC(n=>B(ble(e),Ue(r=>r&&Zy(n)?Ede():Tde(n)))),JF,t?.shutdown?GF(d0(e)):Qe),Mde=(...e)=>{const t=e.length===1?e[0].evaluate:e[0],n=e.length===1?e[0].onError:e[1],r=e.length===1?e[0].releaseLockOnEnd===!0:!1;return ZF(It(i0(Bt(()=>t().getReader()),s=>r?Bt(()=>s.releaseLock()):aue(()=>s.cancel())),s=>Fde(Ue(mh({try:()=>s.read(),catch:a=>Ce(n(a))}),({done:a,value:o})=>a?ro(ye()):Kt(o)))))},Dde=O(2,(e,t)=>new Sa(B(Fs(e),DF(t)))),JF=e=>Gde(e,t=>B(It(t,n=>Ce([n,t])),j4(yn({onNone:()=>Kt(ye()),onSome:ro})))),Fde=e=>JF(B(e,It(In))),QF=O(2,(e,t)=>Fs(e).pipe(fde(VF(t)),BF)),Bde=O(2,(e,t)=>QF(e,Sde(t))),Ude=O(2,(e,t)=>QF(e,wde(t))),zde=e=>new Sa(jF(UF(B(e,It(In))),bt)),Hde=e=>$de(In(e)),XF=e=>new Sa(sI(()=>Fs(e()))),qde=O(e=>wx(e[0]),(e,t)=>It(sp(),n=>Vde(e,n,t))),Vde=O(e=>wx(e[0]),(e,t,n)=>{const r=kx(t);let s,a;const o=vue(!1);return new ReadableStream({start(i){a=r(Ude(e,c=>c.length===0?bt:o.whenOpen(Bt(()=>{o.unsafeClose();for(const u of c)i.enqueue(u);s(),s=void 0})))),a.addObserver(c=>{try{c._tag==="Failure"?i.error(n4(c.cause)):i.close()}catch{}})},pull(){return new Promise(i=>{s=i,Hs(o.open)})},cancel(){if(a)return Sue(QC(Ei(a)))}},n?.strategy)}),Gde=(e,t)=>XF(()=>{const n=r=>Ci(It(t(r),yn({onNone:()=>Ho,onSome:([s,a])=>En(fr(s),()=>n(a))})));return new Sa(n(e))}),ZF=e=>Ode(zde(e)),MR=Symbol.for("effect/Mailbox"),DR=Symbol.for("effect/Mailbox/ReadonlyMailbox"),Cc=pr(),FR=Lt(Cc),Qp=Lt(!1),Xp=Lt(!0),BR=[Cc,!0];class Kde extends Fd{scheduler;capacity;strategy;[MR]=MR;[DR]=DR;state={_tag:"Open",takers:new Set,offers:new Set,awaiters:new Set};messages=[];messagesChunk=pr();constructor(t,n,r){super(),this.scheduler=t,this.capacity=n,this.strategy=r}offer(t){return st(()=>{if(this.state._tag!=="Open")return Qp;if(this.messages.length+this.messagesChunk.length>=this.capacity)switch(this.strategy){case"dropping":return Qp;case"suspend":return this.capacity<=0&&this.state.takers.size>0?(this.messages.push(t),this.releaseTaker(),Xp):this.offerRemainingSingle(t);case"sliding":return this.unsafeTake(),this.messages.push(t),Xp}return this.messages.push(t),this.scheduleReleaseTaker(),Xp})}unsafeOffer(t){return this.state._tag!=="Open"?!1:this.messages.length+this.messagesChunk.length>=this.capacity?this.strategy==="sliding"?(this.unsafeTake(),this.messages.push(t),!0):this.capacity<=0&&this.state.takers.size>0?(this.messages.push(t),this.releaseTaker(),!0):!1:(this.messages.push(t),this.scheduleReleaseTaker(),!0)}offerAll(t){return st(()=>{if(this.state._tag!=="Open")return Ae(Jl(t));const n=this.unsafeOfferAllArray(t);return n.length===0?FR:this.strategy==="dropping"?Ae(Or(n)):this.offerRemainingArray(n)})}unsafeOfferAll(t){return Or(this.unsafeOfferAllArray(t))}unsafeOfferAllArray(t){if(this.state._tag!=="Open")return Ct(t);if(this.capacity===Number.POSITIVE_INFINITY||this.strategy==="sliding")return this.messages.length>0&&(this.messagesChunk=_n(this.messagesChunk,Or(this.messages))),this.strategy==="sliding"?this.messagesChunk=this.messagesChunk.pipe(_n(Jl(t)),pQ(this.capacity)):RT(t)?this.messagesChunk=_n(this.messagesChunk,t):this.messages=Ct(t),this.scheduleReleaseTaker(),[];const n=this.capacity<=0?this.state.takers.size:this.capacity-this.messages.length-this.messagesChunk.length;if(n===0)return Ct(t);const r=[];let s=0;for(const a of t)s<n?this.messages.push(a):r.push(a),s++;return this.scheduleReleaseTaker(),r}fail(t){return this.done(sm(t))}failCause(t){return this.done(Ot(t))}unsafeDone(t){return this.state._tag!=="Open"?!1:this.state.offers.size===0&&this.messages.length===0&&this.messagesChunk.length===0?(this.finalize(t),!0):(this.state={...this.state,_tag:"Closing",exit:t},!0)}shutdown=ke(()=>{if(this.state._tag==="Done")return!0;this.messages=[],this.messagesChunk=Cc;const t=this.state.offers;if(this.finalize(this.state._tag==="Open"?Sr:this.state.exit),t.size>0){for(const n of t)n._tag==="Single"?n.resume(Qp):n.resume(Lt(Or(n.remaining.slice(n.offset))));t.clear()}return!0});done(t){return ke(()=>this.unsafeDone(t))}end=this.done(Sr);clear=st(()=>{if(this.state._tag==="Done")return jb(this.state.exit,Cc);const t=this.unsafeTakeAll();return this.releaseCapacity(),Ae(t)});takeAll=st(()=>{if(this.state._tag==="Done")return jb(this.state.exit,BR);const t=this.unsafeTakeAll();return t.length===0?un(this.awaitTake,this.takeAll):Ae([t,this.releaseCapacity()])});takeN(t){return st(()=>{if(this.state._tag==="Done")return jb(this.state.exit,BR);if(t<=0)return Ae([Cc,!1]);t=Math.min(t,this.capacity);let n;if(t<=this.messagesChunk.length)n=Ny(this.messagesChunk,t),this.messagesChunk=hi(this.messagesChunk,t);else if(t<=this.messages.length+this.messagesChunk.length)this.messagesChunk=_n(this.messagesChunk,Or(this.messages)),this.messages=[],n=Ny(this.messagesChunk,t),this.messagesChunk=hi(this.messagesChunk,t);else return un(this.awaitTake,this.takeN(t));return Ae([n,this.releaseCapacity()])})}unsafeTake(){if(this.state._tag==="Done")return C6(this.state.exit,sm(new Bd));let t;if(this.messagesChunk.length>0)t=$T(this.messagesChunk),this.messagesChunk=hi(this.messagesChunk,1);else if(this.messages.length>0)t=this.messages[0],this.messagesChunk=hi(Or(this.messages),1),this.messages=[];else return this.capacity<=0&&this.state.offers.size>0?(this.capacity=1,this.releaseCapacity(),this.capacity=0,this.messages.length>0?Lt(this.messages.pop()):void 0):void 0;return this.releaseCapacity(),Lt(t)}take=st(()=>this.unsafeTake()??un(this.awaitTake,this.take));await=mi(t=>this.state._tag==="Done"?t(this.state.exit):(this.state.awaiters.add(t),ke(()=>{this.state._tag!=="Done"&&this.state.awaiters.delete(t)})));unsafeSize(){const t=this.messages.length+this.messagesChunk.length;return this.state._tag==="Done"?ye():Ce(t)}size=ke(()=>this.unsafeSize());commit(){return this.takeAll}pipe(){return je(this,arguments)}toJSON(){return{_id:"effect/Mailbox",state:this.state._tag,size:this.unsafeSize().toJSON()}}toString(){return zt(this)}[xt](){return zt(this)}offerRemainingSingle(t){return mi(n=>{if(this.state._tag!=="Open")return n(Qp);const r={_tag:"Single",message:t,resume:n};return this.state.offers.add(r),ke(()=>{this.state._tag==="Open"&&this.state.offers.delete(r)})})}offerRemainingArray(t){return mi(n=>{if(this.state._tag!=="Open")return n(Lt(Or(t)));const r={_tag:"Array",remaining:t,offset:0,resume:n};return this.state.offers.add(r),ke(()=>{this.state._tag==="Open"&&this.state.offers.delete(r)})})}releaseCapacity(){if(this.state._tag==="Done")return this.state.exit._tag==="Success";if(this.state.offers.size===0)return this.state._tag==="Closing"&&this.messages.length===0&&this.messagesChunk.length===0?(this.finalize(this.state.exit),this.state.exit._tag==="Success"):!1;let t=this.capacity-this.messages.length-this.messagesChunk.length;for(const n of this.state.offers){if(t===0)return!1;if(n._tag==="Single")this.messages.push(n.message),t--,n.resume(Xp),this.state.offers.delete(n);else{for(;n.offset<n.remaining.length;n.offset++){if(t===0)return!1;this.messages.push(n.remaining[n.offset]),t--}n.resume(FR),this.state.offers.delete(n)}}return!1}awaitTake=mi(t=>this.state._tag==="Done"?t(this.state.exit):(this.state.takers.add(t),ke(()=>{this.state._tag!=="Done"&&this.state.takers.delete(t)})));scheduleRunning=!1;scheduleReleaseTaker(){this.scheduleRunning||(this.scheduleRunning=!0,this.scheduler.scheduleTask(this.releaseTaker,0))}releaseTaker=()=>{if(this.scheduleRunning=!1,this.state._tag!=="Done"&&this.state.takers.size!==0){for(const t of this.state.takers)if(this.state.takers.delete(t),t(Sr),this.messages.length+this.messagesChunk.length===0)break}};unsafeTakeAll(){if(this.messagesChunk.length>0){const t=this.messages.length>0?_n(this.messagesChunk,Or(this.messages)):this.messagesChunk;return this.messagesChunk=Cc,this.messages=[],t}else if(this.messages.length>0){const t=Or(this.messages);return this.messages=[],t}else if(this.state._tag!=="Done"&&this.state.offers.size>0)return this.capacity=1,this.releaseCapacity(),this.capacity=0,In(this.messages.pop());return Cc}finalize(t){if(this.state._tag==="Done")return;const n=this.state;this.state={_tag:"Done",exit:t};for(const r of n.takers)r(t);n.takers.clear();for(const r of n.awaiters)r(t);n.awaiters.clear()}}const Wde=e=>St(t=>Ae(new Kde(t.currentScheduler,typeof e=="number"?e:e?.capacity??Number.POSITIVE_INFINITY,typeof e=="number"?"suspend":e?.strategy??"suspend"))),Yde=e=>{const t=En(e.takeAll,([n,r])=>r?n.length===0?Ho:fr(n):uI(fr(n),t));return t},Jde=e=>Lde(Yde(e)),Qde=Wde,Xde=Jde,Sv=dI,e8=GF,Zde=Nde,efe=Rde,tfe=Pde,nfe=KF,t8=Fs,rfe=jde,sfe=Mde,afe=Bde,ofe=Hde,ife=XF,cfe=qde,n8=ZF;class cp extends br("@effect/experimental/Reactivity")(){}const ufe=Bt(()=>{const e=new Map,t=i=>{if(Array.isArray(i))for(let c=0;c<i.length;c++){const u=e.get(f_(i[c]));if(u!==void 0)for(const l of u)l()}else{const c=i;for(const u in c){const l=s8(u,c[u]);for(let h=0;h<l.length;h++){const m=e.get(l[h]);if(m!==void 0)for(const p of m)p()}const d=e.get(u);if(d!==void 0)for(const h of d)h()}}},n=i=>Bt(()=>t(i)),r=(i,c)=>ZC(c,n(i)),s=(i,c)=>{const u=Array.isArray(i)?i.map(f_):dfe(i);for(let l=0;l<u.length;l++){let d=e.get(u[l]);d===void 0&&(d=new Set,e.set(u[l],d)),d.add(c)}return()=>{for(let l=0;l<u.length;l++){const d=e.get(u[l]);d.delete(c),d.size===0&&e.delete(u[l])}}},a=(i,c)=>$l(function*(){const u=yield*bx,l=yield*Qde(),d=yield*Pue();let h=!1,m=!1;const p=b=>{b._tag==="Failure"?l.unsafeDone(wr(b.cause)):l.unsafeOffer(b.value),m?(m=!1,d(c).addObserver(p)):h=!1};function y(){if(h){m=!0;return}h=!0,d(c).addObserver(p)}const g=s(i,y);return yield*n0(u,Bt(g)),y(),l}),o=(i,c)=>a(i,c).pipe(It(Xde),n8);return cp.of({mutation:r,query:a,stream:o,unsafeInvalidate:t,invalidate:n,unsafeRegister:s})}),r8=O(2,(e,t)=>Ue(cp,n=>n.mutation(t,e))),lfe=e=>Ue(cp,t=>t.invalidate(e)),wv=V4(cp,ufe);function f_(e){return typeof e=="string"?e:Pe(e)}const s8=(e,t)=>{const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=`${e}:${f_(t[r])}`;return n},dfe=e=>{const t=[];for(const n in e){t.push(n);for(const r of s8(n,e[n]))t.push(r)}return t},a8="effect/Redacted",Vb=Ve("effect/Redacted/redactedRegistry",()=>new WeakMap),o8=Symbol.for(a8),ffe={[o8]:{_A:e=>e},pipe(){return je(this,arguments)},toString(){return"<redacted>"},toJSON(){return"<redacted>"},[xt](){return"<redacted>"},[Xe](){return B(Pe(a8),tt(Pe(Vb.get(this))),Mt(this))},[Ze](e){return hfe(e)&&Fe(Vb.get(this),Vb.get(e))}},hfe=e=>Be(e,o8),mfe=e=>{const t=Object.create(ffe);return Vb.set(t,e),t},i8=(e,t)=>{switch(t._tag){case"StringKeyword":case"TemplateLiteral":return Object.keys(e);case"SymbolKeyword":return Object.getOwnPropertySymbols(e);case"Refinement":return i8(e,t.from)}},c8=e=>{let t=!1,n;return()=>(t||(n=e(),t=!0),n)},fI=e=>Array.isArray(e),pfe=e=>!Array.isArray(e),UR=e=>`[${jm(e)}]`,u8=e=>fI(e)?e.map(UR).join(""):UR(e),Ks=(e,t,n,r)=>{let s=e;return n&&sn(n)&&(s+=`
|
|
25
|
-
at path: ${u8(n)}`),t!==void 0&&(s+=`
|
|
26
|
-
details: ${t}`),r&&(s+=`
|
|
27
|
-
schema (${r._tag}): ${r}`),s},gfe=(e,t,n)=>Ks("Unsupported schema",e,t,n),l8=(e,t,n)=>Ks("Missing annotation",e,t,n),zR=(e,t)=>l8('Generating a JSON Schema for this schema requires a "jsonSchema" annotation',e,t),bfe=(e,t)=>l8('Generating a JSON Schema for this schema requires an "identifier" annotation',e,t),yfe=e=>Ks("Generating a JSON Schema for post-rest elements is not currently supported. You're welcome to contribute by submitting a Pull Request",void 0,e),xfe=(e,t)=>Ks("Unsupported key",`Cannot encode ${jm(e)} key to JSON Schema`,t),d8=(e,t,n)=>Ks("Unsupported schema or overlapping types",`cannot extend ${e} with ${t}`,n),HR=e=>gfe(void 0,void 0,e),kfe=e=>Ks("Unsupported key schema",void 0,void 0,e),vfe=e=>Ks("Unsupported literal",`literal value: ${Uo(e)}`),qR=e=>Ks("Duplicate index signature",`${e} index signature`),Sfe=Ks("Unsupported index signature parameter","An index signature parameter type must be `string`, `symbol`, a template literal type or a refinement of the previous types"),wfe=Ks("Invalid element","A required element cannot follow an optional element. ts(1257)"),VR=e=>Ks("Duplicate property signature transformation",`Duplicate key ${Uo(e)}`),f8=e=>Ks("Duplicate property signature",`Duplicate key ${Uo(e)}`),_fe=Symbol.for("effect/SchemaId/Int"),Efe=Symbol.for("effect/SchemaId/MinLength"),Tfe=Symbol.for("effect/annotation/TypeConstructor"),h8=Symbol.for("effect/annotation/Brand"),hI=Symbol.for("effect/annotation/SchemaId"),m8=Symbol.for("effect/annotation/Message"),mI=Symbol.for("effect/annotation/MissingMessage"),qd=Symbol.for("effect/annotation/Identifier"),Cs=Symbol.for("effect/annotation/Title"),Dl=Symbol.for("effect/annotation/AutoTitle"),Wi=Symbol.for("effect/annotation/Description"),pI=Symbol.for("effect/annotation/Examples"),gI=Symbol.for("effect/annotation/Default"),bI=Symbol.for("effect/annotation/JSONSchema"),p8=Symbol.for("effect/annotation/Arbitrary"),g8=Symbol.for("effect/annotation/Pretty"),b8=Symbol.for("effect/annotation/Equivalence"),Cfe=Symbol.for("effect/annotation/Documentation"),y8=Symbol.for("effect/annotation/Concurrency"),x8=Symbol.for("effect/annotation/Batching"),k8=Symbol.for("effect/annotation/ParseIssueTitle"),v8=Symbol.for("effect/annotation/ParseOptions"),S8=Symbol.for("effect/annotation/DecodingFallback"),h0=Symbol.for("effect/annotation/Surrogate"),Ife=Symbol.for("effect/annotation/StableFilter"),tr=O(2,(e,t)=>Object.prototype.hasOwnProperty.call(e.annotations,t)?Ce(e.annotations[t]):ye()),w8=tr(h8),Afe=tr(m8),Nfe=tr(mI),yI=tr(Cs),_8=tr(Dl),up=tr(qd),xI=tr(Wi),Rfe=tr(pI),Pfe=tr(gI),E8=tr(bI),Ofe=tr(y8),Lfe=tr(x8),$fe=tr(k8),jfe=tr(v8),Mfe=tr(S8),_x=tr(h0),Dfe=tr(Ife),Ffe=e=>LJ(Dfe(e),t=>t===!0),T8=Symbol.for("effect/annotation/JSONIdentifier"),Bfe=tr(T8),C8=e=>Ga(Bfe(e),()=>up(e)),Ufe=Symbol.for("effect/schema/ParseJson");class Ex{typeParameters;decodeUnknown;encodeUnknown;annotations;_tag="Declaration";constructor(t,n,r,s={}){this.typeParameters=t,this.decodeUnknown=n,this.encodeUnknown=r,this.annotations=s}toString(){return Yt(Qa(this),()=>"<declaration schema>")}toJSON(){return{_tag:this._tag,typeParameters:this.typeParameters.map(t=>t.toJSON()),annotations:kn(this.annotations)}}}const Is=e=>t=>t._tag===e,zfe=Is("Declaration");let m0=class{literal;annotations;_tag="Literal";constructor(t,n={}){this.literal=t,this.annotations=n}toString(){return Yt(Qa(this),()=>Uo(this.literal))}toJSON(){return{_tag:this._tag,literal:v1(this.literal)?String(this.literal):this.literal,annotations:kn(this.annotations)}}};const ph=Is("Literal"),Hfe=new m0(null);class qfe{symbol;annotations;_tag="UniqueSymbol";constructor(t,n={}){this.symbol=t,this.annotations=n}toString(){return Yt(Qa(this),()=>Uo(this.symbol))}toJSON(){return{_tag:this._tag,symbol:String(this.symbol),annotations:kn(this.annotations)}}}class Vfe{annotations;_tag="UndefinedKeyword";constructor(t={}){this.annotations=t}toString(){return qo(this)}toJSON(){return{_tag:this._tag,annotations:kn(this.annotations)}}}const mm=new Vfe({[Cs]:"undefined"});class Gfe{annotations;_tag="VoidKeyword";constructor(t={}){this.annotations=t}toString(){return qo(this)}toJSON(){return{_tag:this._tag,annotations:kn(this.annotations)}}}const Kfe=new Gfe({[Cs]:"void"}),Wfe=Is("VoidKeyword");class Yfe{annotations;_tag="NeverKeyword";constructor(t={}){this.annotations=t}toString(){return qo(this)}toJSON(){return{_tag:this._tag,annotations:kn(this.annotations)}}}const lp=new Yfe({[Cs]:"never"}),I8=Is("NeverKeyword");class Jfe{annotations;_tag="UnknownKeyword";constructor(t={}){this.annotations=t}toString(){return qo(this)}toJSON(){return{_tag:this._tag,annotations:kn(this.annotations)}}}const A8=new Jfe({[Cs]:"unknown"});class Qfe{annotations;_tag="AnyKeyword";constructor(t={}){this.annotations=t}toString(){return qo(this)}toJSON(){return{_tag:this._tag,annotations:kn(this.annotations)}}}const Xfe=new Qfe({[Cs]:"any"});class Zfe{annotations;_tag="StringKeyword";constructor(t={}){this.annotations=t}toString(){return qo(this)}toJSON(){return{_tag:this._tag,annotations:kn(this.annotations)}}}const p0=new Zfe({[Cs]:"string",[Wi]:"a string"}),h_=Is("StringKeyword");class ehe{annotations;_tag="NumberKeyword";constructor(t={}){this.annotations=t}toString(){return qo(this)}toJSON(){return{_tag:this._tag,annotations:kn(this.annotations)}}}const g0=new ehe({[Cs]:"number",[Wi]:"a number"}),GR=Is("NumberKeyword");class the{annotations;_tag="BooleanKeyword";constructor(t={}){this.annotations=t}toString(){return qo(this)}toJSON(){return{_tag:this._tag,annotations:kn(this.annotations)}}}const b0=new the({[Cs]:"boolean",[Wi]:"a boolean"}),KR=Is("BooleanKeyword");class nhe{annotations;_tag="SymbolKeyword";constructor(t={}){this.annotations=t}toString(){return qo(this)}toJSON(){return{_tag:this._tag,annotations:kn(this.annotations)}}}const rhe=new nhe({[Cs]:"symbol",[Wi]:"a symbol"}),she=Is("SymbolKeyword");let dp=class{type;annotations;constructor(t,n={}){this.type=t,this.annotations=n}toJSON(){return{type:this.type.toJSON(),annotations:kn(this.annotations)}}toString(){return String(this.type)}};class Iu extends dp{isOptional;constructor(t,n,r={}){super(t,r),this.isOptional=n}toJSON(){return{type:this.type.toJSON(),isOptional:this.isOptional,annotations:kn(this.annotations)}}toString(){return String(this.type)+(this.isOptional?"?":"")}}const kI=e=>e.map(t=>t.type);class Tx{elements;rest;isReadonly;annotations;_tag="TupleType";constructor(t,n,r,s={}){this.elements=t,this.rest=n,this.isReadonly=r,this.annotations=s;let a=!1,o=!1;for(const i of t)if(i.isOptional)a=!0;else if(a){o=!0;break}if(o||a&&n.length>1)throw new Error(wfe)}toString(){return Yt(Qa(this),()=>ahe(this))}toJSON(){return{_tag:this._tag,elements:this.elements.map(t=>t.toJSON()),rest:this.rest.map(t=>t.toJSON()),isReadonly:this.isReadonly,annotations:kn(this.annotations)}}}const ahe=e=>{const t=e.elements.map(String).join(", ");return HJ(e.rest,{onEmpty:()=>`readonly [${t}]`,onNonEmpty:(n,r)=>{const s=String(n),a=s.includes(" | ")?`(${s})`:s;if(r.length>0){const o=r.map(String).join(", ");return e.elements.length>0?`readonly [${t}, ...${a}[], ${o}]`:`readonly [...${a}[], ${o}]`}else return e.elements.length>0?`readonly [${t}, ...${a}[]]`:`ReadonlyArray<${s}>`}})};class Kn extends Iu{name;isReadonly;constructor(t,n,r,s,a){super(n,r,a),this.name=t,this.isReadonly=s}toString(){return(this.isReadonly?"readonly ":"")+String(this.name)+(this.isOptional?"?":"")+": "+this.type}toJSON(){return{name:String(this.name),type:this.type.toJSON(),isOptional:this.isOptional,isReadonly:this.isReadonly,annotations:kn(this.annotations)}}}const N8=e=>{switch(e._tag){case"StringKeyword":case"SymbolKeyword":case"TemplateLiteral":return!0;case"Refinement":return N8(e.from)}return!1};class fp{type;isReadonly;parameter;constructor(t,n,r){if(this.type=n,this.isReadonly=r,N8(t))this.parameter=t;else throw new Error(Sfe)}toString(){return(this.isReadonly?"readonly ":"")+`[x: ${this.parameter}]: ${this.type}`}toJSON(){return{parameter:this.parameter.toJSON(),type:this.type.toJSON(),isReadonly:this.isReadonly}}}class Lo{annotations;_tag="TypeLiteral";propertySignatures;indexSignatures;constructor(t,n,r={}){this.annotations=r;const s={};for(let o=0;o<t.length;o++){const i=t[o].name;if(Object.prototype.hasOwnProperty.call(s,i))throw new Error(f8(i));s[i]=null}const a={string:!1,symbol:!1};for(let o=0;o<n.length;o++){const i=F8(n[o].parameter);if(h_(i)){if(a.string)throw new Error(qR("string"));a.string=!0}else if(she(i)){if(a.symbol)throw new Error(qR("symbol"));a.symbol=!0}}this.propertySignatures=t,this.indexSignatures=n}toString(){return Yt(Qa(this),()=>ohe(this))}toJSON(){return{_tag:this._tag,propertySignatures:this.propertySignatures.map(t=>t.toJSON()),indexSignatures:this.indexSignatures.map(t=>t.toJSON()),annotations:kn(this.annotations)}}}const WR=e=>e.map(String).join("; "),ohe=e=>{if(e.propertySignatures.length>0){const t=e.propertySignatures.map(String).join("; ");return e.indexSignatures.length>0?`{ ${t}; ${WR(e.indexSignatures)} }`:`{ ${t} }`}else return e.indexSignatures.length>0?`{ ${WR(e.indexSignatures)} }`:"{}"},m_=Is("TypeLiteral"),ihe=Yh(UM(cd,e=>{switch(e._tag){case"AnyKeyword":return 0;case"UnknownKeyword":return 1;case"ObjectKeyword":return 2;case"StringKeyword":case"NumberKeyword":case"BooleanKeyword":case"BigIntKeyword":case"SymbolKeyword":return 3}return 4})),che={string:"StringKeyword",number:"NumberKeyword",boolean:"BooleanKeyword",bigint:"BigIntKeyword"},R8=e=>Ay(e,t=>Cx(t)?R8(t.types):[t]),uhe=e=>{const t=ihe(e),n=[],r={},s=[];for(const a of t)switch(a._tag){case"NeverKeyword":break;case"AnyKeyword":return[Xfe];case"UnknownKeyword":return[A8];case"ObjectKeyword":case"UndefinedKeyword":case"VoidKeyword":case"StringKeyword":case"NumberKeyword":case"BooleanKeyword":case"BigIntKeyword":case"SymbolKeyword":{r[a._tag]||(r[a._tag]=a,n.push(a));break}case"Literal":{const o=typeof a.literal;switch(o){case"string":case"number":case"bigint":case"boolean":{const i=che[o];!r[i]&&!s.includes(a.literal)&&(s.push(a.literal),n.push(a));break}case"object":{s.includes(a.literal)||(s.push(a.literal),n.push(a));break}}break}case"UniqueSymbol":{!r.SymbolKeyword&&!s.includes(a.symbol)&&(s.push(a.symbol),n.push(a));break}case"TupleType":{r.ObjectKeyword||n.push(a);break}case"TypeLiteral":{a.propertySignatures.length===0&&a.indexSignatures.length===0?r["{}"]||(r["{}"]=a,n.push(a)):r.ObjectKeyword||n.push(a);break}default:n.push(a)}return n};let ur=class p_{types;annotations;static make=(t,n)=>vI(t)?new p_(t,n):t.length===1?t[0]:lp;static unify=(t,n)=>p_.make(uhe(R8(t)),n);_tag="Union";constructor(t,n={}){this.types=t,this.annotations=n}toString(){return Yt(Qa(this),()=>this.types.map(String).join(" | "))}toJSON(){return{_tag:this._tag,types:this.types.map(t=>t.toJSON()),annotations:kn(this.annotations)}}};const lhe=(e,t)=>e.map(t),vI=e=>e.length>1,Cx=Is("Union"),_v=Ve(Symbol.for("effect/Schema/AST/toJSONMemoMap"),()=>new WeakMap);class fd{f;annotations;_tag="Suspend";constructor(t,n={}){this.f=t,this.annotations=n,this.f=c8(t)}toString(){return Qa(this).pipe(Ga(()=>Vi(IJ(this.f)(),t=>Qa(t))),Yt(()=>"<suspended schema>"))}toJSON(){const t=this.f();let n=_v.get(t);return n||(_v.set(t,{_tag:this._tag}),n={_tag:this._tag,ast:t.toJSON(),annotations:kn(this.annotations)},_v.set(t,n),n)}}const P8=Is("Suspend");let SI=class{from;filter;annotations;_tag="Refinement";constructor(t,n,r={}){this.from=t,this.filter=n,this.annotations=r}toString(){return up(this).pipe(Yt(()=>yn(B8(this),{onNone:()=>`{ ${this.from} | filter }`,onSome:t=>Xc(this.from)?String(this.from)+" & "+t:t})))}toJSON(){return{_tag:this._tag,from:this.from.toJSON(),annotations:kn(this.annotations)}}};const Xc=Is("Refinement"),Ev={};let gi=class{from;to;transformation;annotations;_tag="Transformation";constructor(t,n,r,s={}){this.from=t,this.to=n,this.transformation=r,this.annotations=s}toString(){return Yt(Qa(this),()=>`(${String(this.from)} <-> ${String(this.to)})`)}toJSON(){return{_tag:this._tag,from:this.from.toJSON(),to:this.to.toJSON(),annotations:kn(this.annotations)}}};const O8=Is("Transformation");class L8{decode;encode;_tag="FinalTransformation";constructor(t,n){this.decode=t,this.encode=n}}const dhe=e=>t=>t._tag===e;class fhe{_tag="ComposeTransformation"}const $8=new fhe;let hhe=class{from;to;decode;encode;constructor(t,n,r,s){this.from=t,this.to=n,this.decode=r,this.encode=s}};const mhe=e=>e.decode===Qe&&e.encode===Qe;class g_{propertySignatureTransformations;_tag="TypeLiteralTransformation";constructor(t){this.propertySignatureTransformations=t;const n={},r={};for(const s of t){const a=s.from;if(n[a])throw new Error(VR(a));n[a]=!0;const o=s.to;if(r[o])throw new Error(VR(o));r[o]=!0}}}const b_=dhe("TypeLiteralTransformation"),Vd=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={...e.annotations};delete r[qd];const s={...r,...t},a=_x(e);return Et(a)&&(s[h0]=Vd(a.value,t)),n.annotations.value=s,Object.create(Object.getPrototypeOf(e),n)},phe="[\\s\\S]*?",ghe="[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?",j8=(e,t)=>{switch(e._tag){case"Literal":return Fy(String(e.literal));case"StringKeyword":return phe;case"NumberKeyword":return ghe;case"TemplateLiteral":return M8(e);case"Union":return e.types.map(n=>j8(n)).join("|")}},bhe=(e,t,n,r)=>Cx(e)?`(${t})`:t,M8=(e,t,n)=>{let r="";if(e.head!==""){const s=Fy(e.head);r+=s}for(const s of e.spans){const a=j8(s.type);if(r+=bhe(s.type,a),s.literal!==""){const o=Fy(s.literal);r+=o}}return r},y_=e=>new RegExp(`^${M8(e)}$`),YR=(e,t)=>{const n=[],r=[],s=a=>{switch(a._tag){case"NeverKeyword":break;case"StringKeyword":case"SymbolKeyword":case"TemplateLiteral":case"Refinement":r.push(new fp(a,t,!0));break;case"Literal":if(jn(a.literal)||ba(a.literal))n.push(new Kn(a.literal,t,!1,!0));else throw new Error(vfe(a.literal));break;case"Enums":{for(const[o,i]of a.enums)n.push(new Kn(i,t,!1,!0));break}case"UniqueSymbol":n.push(new Kn(a.symbol,t,!1,!0));break;case"Union":a.types.forEach(s);break;default:throw new Error(kfe(a))}};return s(e),{propertySignatures:n,indexSignatures:r}},Tv=e=>ur.make([e,mm]),Wf=(e,t)=>{switch(e._tag){case"TupleType":return new Tx(e.elements.map(n=>new Iu(Tv(n.type),!0)),zJ(e.rest,{onEmpty:()=>e.rest,onNonEmpty:n=>[new dp(ur.make([...kI(n),mm]))]}),e.isReadonly);case"TypeLiteral":return new Lo(e.propertySignatures.map(n=>new Kn(n.name,Tv(n.type),!0,n.isReadonly,n.annotations)),e.indexSignatures.map(n=>new fp(n.parameter,Tv(n.type),n.isReadonly)));case"Union":return ur.make(e.types.map(n=>Wf(n)));case"Suspend":return new fd(()=>Wf(e.f()));case"Declaration":case"Refinement":throw new Error(HR(e));case"Transformation":{if(b_(e.transformation)&&e.transformation.propertySignatureTransformations.every(mhe))return new gi(Wf(e.from),Wf(e.to),e.transformation);throw new Error(HR(e))}}return e},D8=e=>t=>{let n;for(const r of e)Object.prototype.hasOwnProperty.call(t.annotations,r)&&(n===void 0&&(n={}),n[r]=t.annotations[r]);return n},yhe=e=>t=>{const n={...t.annotations};for(const r of e)delete n[r];return n},xhe=D8([pI,gI,bI,p8,g8,b8]),wn=e=>{switch(e._tag){case"Declaration":{const t=Ls(e.typeParameters,wn);return t===e.typeParameters?e:new Ex(t,e.decodeUnknown,e.encodeUnknown,e.annotations)}case"TupleType":{const t=Ls(e.elements,s=>{const a=wn(s.type);return a===s.type?s:new Iu(a,s.isOptional)}),n=kI(e.rest),r=Ls(n,wn);return t===e.elements&&r===n?e:new Tx(t,r.map(s=>new dp(s)),e.isReadonly,e.annotations)}case"TypeLiteral":{const t=Ls(e.propertySignatures,r=>{const s=wn(r.type);return s===r.type?r:new Kn(r.name,s,r.isOptional,r.isReadonly)}),n=Ls(e.indexSignatures,r=>{const s=wn(r.type);return s===r.type?r:new fp(r.parameter,s,r.isReadonly)});return t===e.propertySignatures&&n===e.indexSignatures?e:new Lo(t,n,e.annotations)}case"Union":{const t=Ls(e.types,wn);return t===e.types?e:ur.make(t,e.annotations)}case"Suspend":return new fd(()=>wn(e.f()),e.annotations);case"Refinement":{const t=wn(e.from);return t===e.from?e:new SI(t,e.filter,e.annotations)}case"Transformation":{const t=xhe(e);return wn(t!==void 0?Vd(e.to,t):e.to)}}return e};function Ls(e,t){let n=!1;const r=N1(e.length);for(let s=0;s<e.length;s++){const a=e[s],o=t(a);o!==a&&(n=!0),r[s]=o}return n?r:e}const x_=e=>{switch(e._tag){case"Transformation":return e.from;case"Refinement":return x_(e.from);case"Suspend":return x_(e.f())}},Pa=(e,t)=>{switch(e._tag){case"Declaration":{const n=Ls(e.typeParameters,r=>Pa(r));return n===e.typeParameters?e:new Ex(n,e.decodeUnknown,e.encodeUnknown)}case"TupleType":{const n=Ls(e.elements,a=>{const o=Pa(a.type);return o===a.type?a:new Iu(o,a.isOptional)}),r=kI(e.rest),s=Ls(r,a=>Pa(a));return n===e.elements&&s===r?e:new Tx(n,s.map(a=>new dp(a)),e.isReadonly)}case"TypeLiteral":{const n=Ls(e.propertySignatures,s=>{const a=Pa(s.type);return a===s.type?s:new Kn(s.name,a,s.isOptional,s.isReadonly)}),r=Ls(e.indexSignatures,s=>{const a=Pa(s.type);return a===s.type?s:new fp(s.parameter,a,s.isReadonly)});return n===e.propertySignatures&&r===e.indexSignatures?e:new Lo(n,r)}case"Union":{const n=Ls(e.types,r=>Pa(r));return n===e.types?e:ur.make(n)}case"Suspend":{let n;const r=C8(e);return Et(r)&&(n={[T8]:`${r.value}Encoded`}),new fd(()=>Pa(e.f()),n)}case"Refinement":return Pa(e.from);case"Transformation":return Pa(e.from)}return e},y0=e=>Pa(e),kn=e=>{const t={};for(const n of Object.getOwnPropertySymbols(e))t[String(n)]=e[n];return t},F8=e=>{switch(e._tag){case"StringKeyword":case"SymbolKeyword":case"TemplateLiteral":return e;case"Refinement":return F8(e.from)}},khe=(e,t)=>new gi(e,t,$8),qo=e=>Yt(Qa(e),()=>e._tag);function vhe(e){return yn(w8(e),{onNone:()=>"",onSome:t=>t.map(n=>` & Brand<${Uo(n)}>`).join("")})}const B8=e=>yI(e).pipe(Ga(()=>xI(e)),Ga(()=>_8(e)),Jr(t=>t+vhe(e))),Qa=e=>Ga(up(e),()=>B8(e)),She=(e,t,n)=>{switch(e._tag){case"UndefinedKeyword":return lp;case"Union":{const r=[];let s=!1;for(const a of e.types){const o=t(a);o?(s=!0,I8(o)||r.push(o)):r.push(a)}if(s)return ur.make(r);break}case"Suspend":return t(e.f());case"Transformation":return n(e)}};class rr{path;actual;issue;_tag="Pointer";constructor(t,n,r){this.path=t,this.actual=n,this.issue=r}}class JR{actual;message;_tag="Unexpected";constructor(t,n){this.actual=t,this.message=n}}class kf{ast;message;_tag="Missing";actual=void 0;constructor(t,n){this.ast=t,this.message=n}}class dn{ast;actual;issues;output;_tag="Composite";constructor(t,n,r,s){this.ast=t,this.actual=n,this.issues=r,this.output=s}}class Cv{ast;actual;kind;issue;_tag="Refinement";constructor(t,n,r,s){this.ast=t,this.actual=n,this.kind=r,this.issue=s}}class Iv{ast;actual;kind;issue;_tag="Transformation";constructor(t,n,r,s){this.ast=t,this.actual=n,this.kind=r,this.issue=s}}class dr{ast;actual;message;_tag="Type";constructor(t,n,r){this.ast=t,this.actual=n,this.message=r}}class k_{ast;actual;message;_tag="Forbidden";constructor(t,n,r){this.ast=t,this.actual=n,this.message=r}}const QR=Symbol.for("effect/Schema/ParseErrorTypeId");class whe extends np("ParseError"){[QR]=QR;get message(){return this.toString()}toString(){return bh.formatIssueSync(this.issue)}toJSON(){return{_id:"ParseError",message:this.toString()}}[xt](){return this.toJSON()}}const wI=e=>new whe({issue:e}),gs=nt,jc=Ye,XR=yJ,$r=xJ,da=O(2,(e,t)=>$r(e)?Yr(e,{onLeft:Ye,onRight:t}):Ue(e,t)),or=O(2,(e,t)=>$r(e)?vJ(e,t):It(e,t)),gh=O(2,(e,t)=>$r(e)?kJ(e,t):XC(e,t)),U8=O(2,(e,t)=>$r(e)?Yr(e,{onLeft:t,onRight:nt}):j4(e,t)),Ix=(e,t)=>t===void 0||ba(t)?e:e===void 0?t:{...e,...t},z8=(e,t,n)=>{const r=Gn(e,t);return(s,a)=>r(s,Ix(n,a))},H8=(e,t,n)=>{const r=z8(e,t,n);return(s,a)=>MM(r(s,a),wI)},q8=(e,t,n)=>{const r=z8(e,t,n);return(s,a)=>TJ(r(s,a))},V8=(e,t,n)=>{const r=Gn(e,t);return(s,a)=>r(s,{...Ix(n,a),isEffectAllowed:!0})},_I=(e,t)=>H8(e.ast,!0,t),G8=(e,t)=>V8(e.ast,!0,t),K8=(e,t)=>V8(e.ast,!1,t),Ax=(e,t)=>H8(wn(e.ast),!0,t),_he=(e,t)=>{const n=Gn(wn(e.ast),!0);return(r,s)=>Ua(n(r,{exact:!0,...Ix(t,s)}))},Ehe=Ve(Symbol.for("effect/ParseResult/decodeMemoMap"),()=>new WeakMap),The=Ve(Symbol.for("effect/ParseResult/encodeMemoMap"),()=>new WeakMap),Gn=(e,t)=>{const n=t?Ehe:The,r=n.get(e);if(r)return r;const s=Che(e,t),a=jfe(e),o=Et(a)?(u,l)=>s(u,Ix(l,a.value)):s,i=Mfe(e),c=t&&Et(i)?(u,l)=>Jf(U8(o(u,l),i.value),e,u,l):o;return n.set(e,c),c},Av=e=>jr(Ofe(e)),Nv=e=>jr(Lfe(e)),Che=(e,t)=>{switch(e._tag){case"Refinement":if(t){const n=Gn(e.from,!0);return(r,s)=>{s=s??Ev;const a=s?.errors==="all",o=da(U8(n(r,s),i=>{const c=new Cv(e,r,"From",i);return a&&Ffe(e)&&Q8(i)?yn(e.filter(r,s,e),{onNone:()=>Ye(c),onSome:u=>Ye(new dn(e,r,[c,new Cv(e,r,"Predicate",u)]))}):Ye(c)}),i=>yn(e.filter(i,s,e),{onNone:()=>nt(i),onSome:c=>Ye(new Cv(e,r,"Predicate",c))}));return Jf(o,e,r,s)}}else{const n=Gn(wn(e),!0),r=Gn(W8(e.from),!1);return(s,a)=>Jf(da(n(s,a),o=>r(o,a)),e,s,a)}case"Transformation":{const n=Nhe(e.transformation,t),r=t?Gn(e.from,!0):Gn(e.to,!1),s=t?Gn(e.to,!0):Gn(e.from,!1);return(a,o)=>Jf(da(gh(r(a,o),i=>new Iv(e,a,t?"Encoded":"Type",i)),i=>da(gh(n(i,o??Ev,e,a),c=>new Iv(e,a,"Transformation",c)),c=>gh(s(c,o),u=>new Iv(e,a,t?"Type":"Encoded",u)))),e,a,o)}case"Declaration":{const n=t?e.decodeUnknown(...e.typeParameters):e.encodeUnknown(...e.typeParameters);return(r,s)=>Jf(n(r,s??Ev,e),e,r,s)}case"Literal":return os(e,n=>n===e.literal);case"UniqueSymbol":return os(e,n=>n===e.symbol);case"UndefinedKeyword":return os(e,iY);case"NeverKeyword":return os(e,cY);case"UnknownKeyword":case"AnyKeyword":case"VoidKeyword":return nt;case"StringKeyword":return os(e,jn);case"NumberKeyword":return os(e,ba);case"BooleanKeyword":return os(e,ru);case"BigIntKeyword":return os(e,v1);case"SymbolKeyword":return os(e,iw);case"ObjectKeyword":return os(e,ya);case"Enums":return os(e,n=>e.enums.some(([r,s])=>s===n));case"TemplateLiteral":{const n=y_(e);return os(e,r=>jn(r)&&n.test(r))}case"TupleType":{const n=e.elements.map(u=>Gn(u.type,t)),r=e.rest.map(u=>Gn(u.type,t));let s=e.elements.filter(u=>!u.isOptional);e.rest.length>0&&(s=s.concat(e.rest.slice(1)));const a=s.length,o=e.elements.length>0?e.elements.map((u,l)=>l).join(" | "):"never",i=Av(e),c=Nv(e);return(u,l)=>{if(!VJ(u))return Ye(new dr(e,u));const d=l?.errors==="all",h=[];let m=0;const p=[],y=u.length;for(let k=y;k<=a-1;k++){const _=new rr(k,u,new kf(s[k-y]));if(d){h.push([m++,_]);continue}else return Ye(new dn(e,u,_,p))}if(e.rest.length===0)for(let k=e.elements.length;k<=y-1;k++){const _=new rr(k,u,new JR(u[k],`is unexpected, expected: ${o}`));if(d){h.push([m++,_]);continue}else return Ye(new dn(e,u,_,p))}let g=0,b;for(;g<n.length;g++)if(y<g+1){if(e.elements[g].isOptional)continue}else{const k=n[g],_=k(u[g],l);if($r(_)){if(ar(_)){const S=new rr(g,u,_.left);if(d){h.push([m++,S]);continue}else return Ye(new dn(e,u,S,Zs(p)))}p.push([m++,_.right])}else{const S=m++,w=g;b||(b=[]),b.push(({es:T,output:A})=>Ue(Vu(_),L=>{if(ar(L)){const R=new rr(w,u,L.left);return d?(T.push([S,R]),bt):Ye(new dn(e,u,R,Zs(A)))}return A.push([S,L.right]),bt}))}}if(sn(r)){const[k,..._]=r;for(;g<y-_.length;g++){const S=k(u[g],l);if($r(S))if(ar(S)){const w=new rr(g,u,S.left);if(d){h.push([m++,w]);continue}else return Ye(new dn(e,u,w,Zs(p)))}else p.push([m++,S.right]);else{const w=m++,T=g;b||(b=[]),b.push(({es:A,output:L})=>Ue(Vu(S),R=>{if(ar(R)){const j=new rr(T,u,R.left);return d?(A.push([w,j]),bt):Ye(new dn(e,u,j,Zs(L)))}else return L.push([w,R.right]),bt}))}}for(let S=0;S<_.length;S++)if(g+=S,!(y<g+1)){const w=_[S](u[g],l);if($r(w)){if(ar(w)){const T=new rr(g,u,w.left);if(d){h.push([m++,T]);continue}else return Ye(new dn(e,u,T,Zs(p)))}p.push([m++,w.right])}else{const T=m++,A=g;b||(b=[]),b.push(({es:L,output:R})=>Ue(Vu(w),j=>{if(ar(j)){const F=new rr(A,u,j.left);return d?(L.push([T,F]),bt):Ye(new dn(e,u,F,Zs(R)))}return R.push([T,j.right]),bt}))}}}const x=({es:k,output:_})=>Al(k)?Ye(new dn(e,u,Zs(k),Zs(_))):nt(Zs(_));if(b&&b.length>0){const k=b;return pn(()=>{const _={es:Hf(h),output:Hf(p)};return Ue(Ya(k,S=>S(_),{concurrency:i,batching:c,discard:!0}),()=>x(_))})}return x({output:p,es:h})}}case"TypeLiteral":{if(e.propertySignatures.length===0&&e.indexSignatures.length===0)return os(e,uY);const n=[],r={},s=[];for(const l of e.propertySignatures)n.push([Gn(l.type,t),l]),r[l.name]=null,s.push(l.name);const a=e.indexSignatures.map(l=>[Gn(l.parameter,t),Gn(l.type,t),l.parameter]),o=ur.make(e.indexSignatures.map(l=>l.parameter).concat(s.map(l=>iw(l)?new qfe(l):new m0(l)))),i=Gn(o,t),c=Av(e),u=Nv(e);return(l,d)=>{if(!Gh(l))return Ye(new dr(e,l));const h=d?.errors==="all",m=[];let p=0;const y=d?.onExcessProperty==="error",g=d?.onExcessProperty==="preserve",b={};let x;if(y||g){x=Reflect.ownKeys(l);for(const w of x){const T=i(w,d);if($r(T)&&ar(T))if(y){const A=new rr(w,l,new JR(l[w],`is unexpected, expected: ${String(o)}`));if(h){m.push([p++,A]);continue}else return Ye(new dn(e,l,A,b))}else b[w]=l[w]}}let k;const _=d?.exact===!0;for(let w=0;w<n.length;w++){const T=n[w][1],A=T.name,L=Object.prototype.hasOwnProperty.call(l,A);if(!L){if(T.isOptional)continue;if(_){const F=new rr(A,l,new kf(T));if(h){m.push([p++,F]);continue}else return Ye(new dn(e,l,F,b))}}const R=n[w][0],j=R(l[A],d);if($r(j)){if(ar(j)){const F=new rr(A,l,L?j.left:new kf(T));if(h){m.push([p++,F]);continue}else return Ye(new dn(e,l,F,b))}b[A]=j.right}else{const F=p++,K=A;k||(k=[]),k.push(({es:Y,output:W})=>Ue(Vu(j),J=>{if(ar(J)){const ae=new rr(K,l,L?J.left:new kf(T));return h?(Y.push([F,ae]),bt):Ye(new dn(e,l,ae,W))}return W[K]=J.right,bt}))}}for(let w=0;w<a.length;w++){const T=a[w],A=T[0],L=T[1],R=i8(l,T[2]);for(const j of R){const F=A(j,d);if($r(F)&&Ua(F)){const K=L(l[j],d);if($r(K))if(ar(K)){const Y=new rr(j,l,K.left);if(h){m.push([p++,Y]);continue}else return Ye(new dn(e,l,Y,b))}else Object.prototype.hasOwnProperty.call(r,j)||(b[j]=K.right);else{const Y=p++,W=j;k||(k=[]),k.push(({es:J,output:ae})=>Ue(Vu(K),ge=>{if(ar(ge)){const le=new rr(W,l,ge.left);return h?(J.push([Y,le]),bt):Ye(new dn(e,l,le,ae))}else return Object.prototype.hasOwnProperty.call(r,j)||(ae[j]=ge.right),bt}))}}}}const S=({es:w,output:T})=>{if(Al(w))return Ye(new dn(e,l,Zs(w),T));if(d?.propertyOrder==="original"){const A=x||Reflect.ownKeys(l);for(const R of s)A.indexOf(R)===-1&&A.push(R);const L={};for(const R of A)Object.prototype.hasOwnProperty.call(T,R)&&(L[R]=T[R]);return nt(L)}return nt(T)};if(k&&k.length>0){const w=k;return pn(()=>{const T={es:Hf(m),output:Object.assign({},b)};return Ue(Ya(w,A=>A(T),{concurrency:c,batching:u,discard:!0}),()=>S(T))})}return S({es:m,output:b})}}case"Union":{const n=Ihe(e.types,t),r=Reflect.ownKeys(n.keys),s=r.length,a=e.types.length,o=new Map;for(let u=0;u<a;u++)o.set(e.types[u],Gn(e.types[u],t));const i=Av(e)??1,c=Nv(e);return(u,l)=>{const d=[];let h=0,m=[];if(s>0)if(gT(u))for(let g=0;g<s;g++){const b=r[g],x=n.keys[b].buckets;if(Object.prototype.hasOwnProperty.call(u,b)){const k=String(u[b]);if(Object.prototype.hasOwnProperty.call(x,k))m=m.concat(x[k]);else{const{candidates:_,literals:S}=n.keys[b],w=ur.make(S),T=_.length===a?new Lo([new Kn(b,w,!1,!0)],[]):ur.make(_);d.push([h++,new dn(T,u,new rr(b,u,new dr(w,u[b])))])}}else{const{candidates:k,literals:_}=n.keys[b],S=new Kn(b,ur.make(_),!1,!0),w=k.length===a?new Lo([S],[]):ur.make(k);d.push([h++,new dn(w,u,new rr(b,u,new kf(S)))])}}else{const g=n.candidates.length===a?e:ur.make(n.candidates);d.push([h++,new dr(g,u)])}n.otherwise.length>0&&(m=m.concat(n.otherwise));let p;for(let g=0;g<m.length;g++){const b=m[g],x=o.get(b)(u,l);if($r(x)&&(!p||p.length===0)){if(Ua(x))return x;d.push([h++,x.left])}else{const k=h++;p||(p=[]),p.push(_=>pn(()=>"finalResult"in _?bt:Ue(Vu(x),S=>(Ua(S)?_.finalResult=S:_.es.push([k,S.left]),bt))))}}const y=g=>Al(g)?g.length===1&&g[0][1]._tag==="Type"?Ye(g[0][1]):Ye(new dn(e,u,Zs(g))):Ye(new dr(e,u));if(p&&p.length>0){const g=p;return pn(()=>{const b={es:Hf(d)};return Ue(Ya(g,x=>x(b),{concurrency:i,batching:c,discard:!0}),()=>"finalResult"in b?b.finalResult:y(b.es))})}return y(d)}}case"Suspend":{const n=c8(()=>Gn(e.f(),t));return(r,s)=>n()(r,s)}}},os=(e,t)=>n=>t(n)?nt(n):Ye(new dr(e,n)),Yf=(e,t)=>{switch(e._tag){case"Declaration":{const n=_x(e);if(Et(n))return Yf(n.value,t);break}case"TypeLiteral":{const n=[];for(let r=0;r<e.propertySignatures.length;r++){const s=e.propertySignatures[r],a=t?y0(s.type):wn(s.type);ph(a)&&!s.isOptional&&n.push([s.name,a])}return n}case"TupleType":{const n=[];for(let r=0;r<e.elements.length;r++){const s=e.elements[r],a=t?y0(s.type):wn(s.type);ph(a)&&!s.isOptional&&n.push([r,a])}return n}case"Refinement":return Yf(e.from,t);case"Suspend":return Yf(e.f(),t);case"Transformation":return Yf(t?e.from:e.to,t)}return[]},Ihe=(e,t)=>{const n={},r=[],s=[];for(let a=0;a<e.length;a++){const o=e[a],i=Yf(o,t);if(i.length>0){s.push(o);for(let c=0;c<i.length;c++){const[u,l]=i[c],d=String(l.literal);n[u]=n[u]||{buckets:{},literals:[],candidates:[]};const h=n[u].buckets;if(Object.prototype.hasOwnProperty.call(h,d)){if(c<i.length-1)continue;h[d].push(o),n[u].literals.push(l),n[u].candidates.push(o)}else{h[d]=[o],n[u].literals.push(l),n[u].candidates.push(o);break}}}else r.push(o)}return{keys:n,otherwise:r,candidates:s}},W8=e=>Xc(e)?W8(e.from):e,Jf=(e,t,n,r)=>{if(r?.isEffectAllowed===!0||$r(e))return e;const s=new lx,a=yx(e,{scheduler:s});s.flush();const o=a.unsafePoll();if(o){if(IC(o))return nt(o.value);const i=o.cause;return Hoe(i)?Ye(i.error):Ye(new k_(t,n,BC(i)))}return Ye(new k_(t,n,"cannot be be resolved synchronously, this is caused by using runSync on an effect that performs async work"))},Ahe=([e],[t])=>e>t?1:e<t?-1:0;function Zs(e){return e.sort(Ahe).map(t=>t[1])}const Nhe=(e,t)=>{switch(e._tag){case"FinalTransformation":return t?e.decode:e.encode;case"ComposeTransformation":return nt;case"TypeLiteralTransformation":return n=>{let r=nt(n);for(const s of e.propertySignatureTransformations){const[a,o]=t?[s.from,s.to]:[s.to,s.from],i=t?s.decode:s.encode;r=or(r,u=>{const l=i(Object.prototype.hasOwnProperty.call(u,a)?Ce(u[a]):ye());return delete u[a],Et(l)&&(u[o]=l.value),u})}return r}}},Rr=(e,t=[])=>({value:e,forest:t}),bh={formatIssue:e=>or(ul(e),Rhe),formatIssueSync:e=>{const t=bh.formatIssue(e);return $r(t)?DM(t):Hs(t)},formatError:e=>bh.formatIssue(e.issue),formatErrorSync:e=>bh.formatIssueSync(e.issue)},Rhe=e=>e.value+Y8(`
|
|
28
|
-
`,e.forest),Y8=(e,t)=>{let n="";const r=t.length;let s;for(let a=0;a<r;a++){s=t[a];const o=a===r-1;n+=e+(o?"└":"├")+"─ "+s.value,n+=Y8(e+(r>1&&!o?"│ ":" "),s.forest)}return n},Phe=e=>{switch(e){case"Encoded":return"Encoded side transformation failure";case"Transformation":return"Transformation process failure";case"Type":return"Type side transformation failure"}},Ohe=e=>{switch(e){case"From":return"From side refinement failure";case"Predicate":return"Predicate refinement failure"}},J8=e=>"ast"in e?Ce(e.ast):ye(),v_=nt(void 0),Lhe=e=>J8(e).pipe(Vi(Afe),yn({onNone:()=>v_,onSome:t=>{const n=t(e);return jn(n)?nt({message:n,override:!1}):Ki(n)?It(n,r=>({message:r,override:!1})):jn(n.message)?nt({message:n.message,override:n.override}):It(n.message,r=>({message:r,override:n.override}))}})),EI=e=>t=>t._tag===e,Q8=EI("Composite"),ZR=EI("Refinement"),eP=EI("Transformation"),Ii=e=>da(Lhe(e),t=>t!==void 0?!t.override&&(Q8(e)||ZR(e)&&e.kind==="From"||eP(e)&&e.kind!=="Transformation")?eP(e)||ZR(e)?Ii(e.issue):v_:nt(t.message):v_),X8=e=>J8(e).pipe(Vi($fe),HM(t=>t(e)),jr);function $he(e){return xI(e).pipe(Ga(()=>yI(e)),Ga(()=>_8(e)),Ga(()=>up(e)),Yt(()=>`{ ${e.from} | filter }`))}function jhe(e){return e.message!==void 0?e.message:`Expected ${Xc(e.ast)?$he(e.ast):String(e.ast)}, actual ${Uo(e.actual)}`}const Z8=e=>or(Ii(e),t=>t??X8(e)??jhe(e)),Zp=e=>X8(e)??String(e.ast),eB=e=>e.message??"is forbidden",tB=e=>e.message??"is unexpected",nB=e=>{const t=Nfe(e.ast);if(Et(t)){const n=t.value();return jn(n)?nt(n):n}return nt(e.message??"is missing")},ul=e=>{switch(e._tag){case"Type":return or(Z8(e),Rr);case"Forbidden":return nt(Rr(Zp(e),[Rr(eB(e))]));case"Unexpected":return nt(Rr(tB(e)));case"Missing":return or(nB(e),Rr);case"Transformation":return da(Ii(e),t=>t!==void 0?nt(Rr(t)):or(ul(e.issue),n=>Rr(Zp(e),[Rr(Phe(e.kind),[n])])));case"Refinement":return da(Ii(e),t=>t!==void 0?nt(Rr(t)):or(ul(e.issue),n=>Rr(Zp(e),[Rr(Ohe(e.kind),[n])])));case"Pointer":return or(ul(e.issue),t=>Rr(u8(e.path),[t]));case"Composite":return da(Ii(e),t=>{if(t!==void 0)return nt(Rr(t));const n=Zp(e);return fI(e.issues)?or(Ya(e.issues,ul),r=>Rr(n,r)):or(ul(e.issues),r=>Rr(n,[r]))})}},cc=(e,t,n)=>({_tag:e,path:t,message:n}),yh={formatIssue:e=>ll(e,void 0,[]),formatIssueSync:e=>{const t=yh.formatIssue(e);return $r(t)?DM(t):Hs(t)},formatError:e=>yh.formatIssue(e.issue),formatErrorSync:e=>yh.formatIssueSync(e.issue)},ll=(e,t,n)=>{const r=e._tag;switch(r){case"Type":return or(Z8(e),s=>[cc(t??r,n,s)]);case"Forbidden":return nt([cc(r,n,eB(e))]);case"Unexpected":return nt([cc(r,n,tB(e))]);case"Missing":return or(nB(e),s=>[cc(r,n,s)]);case"Pointer":return ll(e.issue,void 0,n.concat(e.path));case"Composite":return da(Ii(e),s=>s!==void 0?nt([cc(r,n,s)]):fI(e.issues)?or(Ya(e.issues,a=>ll(a,void 0,n)),JM):ll(e.issues,void 0,n));case"Refinement":return da(Ii(e),s=>s!==void 0?nt([cc(r,n,s)]):ll(e.issue,e.kind==="Predicate"?r:void 0,n));case"Transformation":return da(Ii(e),s=>s!==void 0?nt([cc(r,n,s)]):ll(e.issue,e.kind==="Transformation"?r:void 0,n))}},tP=mfe,Mhe=O(e=>ya(e[0]),(e,...t)=>{const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}),rB=O(e=>ya(e[0]),(e,...t)=>{const n={...e};for(const r of t)delete n[r];return n}),hd=Symbol.for("effect/Schema");function Nt(e){return class{[hd]=S_;static ast=e;static annotations(n){return Nt(Ca(this.ast,n))}static pipe(){return je(this,arguments)}static toString(){return String(e)}static Type;static Encoded;static Context;static[hd]=S_}}const S_={_A:e=>e,_I:e=>e,_R:e=>e},nP=e=>IC(e)?e.value:Dhe(BC(e.cause)),Dhe=e=>({issues:[{message:e}]}),Fhe=e=>It(yh.formatIssue(e),t=>({issues:t.map(n=>({path:n.path,message:n.message}))})),Yi=(e,t)=>{const n=G8(e,{errors:"all"});return class extends Nt(e.ast){static"~standard"={version:1,vendor:"effect",validate(s){const a=new lx,o=yx(yue(n(s,t),{onFailure:Fhe,onSuccess:c=>Kt({value:c})}),{scheduler:a});a.flush();const i=o.unsafePoll();return i?nP(i):new Promise(c=>{o.addObserver(u=>{c(nP(u))})})}}}},rP={typeConstructor:Tfe,schemaId:hI,message:m8,missingMessage:mI,identifier:qd,title:Cs,description:Wi,examples:pI,default:gI,documentation:Cfe,jsonSchema:bI,arbitrary:p8,pretty:g8,equivalence:b8,concurrency:y8,batching:x8,parseIssueTitle:k8,parseOptions:v8,decodingFallback:S8},Au=e=>{if(!e)return{};const t={...e};for(const n in rP)if(n in e){const r=rP[n];t[r]=e[n],delete t[n]}return t},Ca=(e,t)=>Vd(e,Au(t)),Bhe=e=>Nt(y0(e.ast)),sP=e=>Nt(wn(e.ast)),vf=(e,t)=>{const n=K8(e,t);return(r,s)=>gh(n(r,s),wI)},Uhe=(e,t)=>{const n=G8(e,t);return(r,s)=>gh(n(r,s),wI)},zhe=Uhe,Xa=e=>Be(e,hd)&&ya(e[hd]);function Hhe(e){return vI(e)?ur.make(lhe(e,t=>new m0(t))):new m0(e[0])}function sB(e,t=Hhe(e)){return class extends Nt(t){static annotations(r){return sB(this.literals,Ca(this.ast,r))}static literals=[...e]}}function ie(...e){return sn(e)?sB(e):pm}const qhe=(e,t,n)=>TI(e,new Ex(e.map(r=>r.ast),(...r)=>t.decode(...r.map(Nt)),(...r)=>t.encode(...r.map(Nt)),Au(n))),Vhe=(e,t)=>{const n=()=>(s,a,o)=>e(s)?gs(s):jc(new dr(o,s)),r=n;return TI([],new Ex([],n,r,Au(t)))};function TI(e,t){return class extends Nt(t){static annotations(r){return TI(this.typeParameters,Ca(this.ast,r))}static typeParameters=[...e]}}const CI=function(){if(Array.isArray(arguments[0])){const n=arguments[0],r=arguments[1],s=arguments[2];return qhe(n,r,s)}const e=arguments[0],t=arguments[1];return Vhe(e,t)};class Ghe extends Nt(mm){}class Khe extends Nt(Kfe){}class Nx extends Nt(Hfe){}class pm extends Nt(lp){}class Tn extends Nt(A8){}class Whe extends Nt(rhe){}class C extends Nt(p0){}class it extends Nt(g0){}class Ke extends Nt(b0){}const Yhe=e=>ur.make(e.map(t=>t.ast));function aB(e,t=Yhe(e)){return class extends Nt(t){static annotations(r){return aB(this.members,Ca(this.ast,r))}static members=[...e]}}function tn(...e){return vI(e)?aB(e):sn(e)?e[0]:pm}const ne=e=>tn(e,Nx),Jhe=e=>tn(e,Ghe),Qhe=(e,t)=>new Tx(e.map(n=>Xa(n)?new Iu(n.ast,!1):n.ast),t.map(n=>Xa(n)?new dp(n.ast):n.ast),!0);function x0(e,t,n=Qhe(e,t)){return class extends Nt(n){static annotations(s){return x0(this.elements,this.rest,Ca(this.ast,s))}static elements=[...e];static rest=[...t]}}function Xhe(...e){return Array.isArray(e[0])?x0(e[0],e.slice(1)):x0(e,[])}function oB(e,t){return class extends x0([],[e],t){static annotations(r){return oB(this.value,Ca(this.ast,r))}static value=e}}const _e=e=>oB(e),w_=e=>e?'"?:"':'":"';class Rx extends Iu{isReadonly;defaultValue;_tag="PropertySignatureDeclaration";constructor(t,n,r,s,a){super(t,n,s),this.isReadonly=r,this.defaultValue=a}toString(){const t=w_(this.isOptional),n=String(this.type);return`PropertySignature<${t}, ${n}, never, ${t}, ${n}>`}}class iB extends Iu{isReadonly;defaultValue;constructor(t,n,r,s,a){super(t,n,s),this.isReadonly=r,this.defaultValue=a}}const Zhe=e=>e===void 0?"never":jn(e)?JSON.stringify(e):String(e);class cB{from;to;decode;encode;_tag="PropertySignatureTransformation";constructor(t,n,r,s){this.from=t,this.to=n,this.decode=r,this.encode=s}toString(){return`PropertySignature<${w_(this.to.isOptional)}, ${this.to.type}, ${Zhe(this.from.fromKey)}, ${w_(this.from.isOptional)}, ${this.from.type}>`}}const uB=(e,t)=>{switch(e._tag){case"PropertySignatureDeclaration":return new Rx(e.type,e.isOptional,e.isReadonly,{...e.annotations,...t},e.defaultValue);case"PropertySignatureTransformation":return new cB(e.from,new iB(e.to.type,e.to.isOptional,e.to.isReadonly,{...e.to.annotations,...t},e.to.defaultValue),e.decode,e.encode)}},lB=Symbol.for("effect/PropertySignature"),II=e=>Be(e,lB);class Px{ast;[hd];[lB]=null;_TypeToken;_Key;_EncodedToken;_HasDefault;constructor(t){this.ast=t}pipe(){return je(this,arguments)}annotations(t){return new Px(uB(this.ast,Au(t)))}toString(){return String(this.ast)}}const aP=e=>new Px(e);class Ox extends Px{from;constructor(t,n){super(t),this.from=n}annotations(t){return new Ox(uB(this.ast,Au(t)),this.from)}}const xh=e=>new Ox(new Rx(e.ast,!1,!0,{},void 0),e),dB=O(2,(e,t)=>{const n=e.ast;switch(n._tag){case"PropertySignatureDeclaration":return aP(new Rx(n.type,n.isOptional,n.isReadonly,n.annotations,t));case"PropertySignatureTransformation":return aP(new cB(n.from,new iB(n.to.type,n.to.isOptional,n.to.isReadonly,n.to.annotations,t),n.decode,n.encode))}}),H=e=>{const t=e.ast===mm||e.ast===lp?mm:Jhe(e).ast;return new Ox(new Rx(t,!0,!0,{},void 0),e)},eme=D8([mI]),tme=(e,t)=>{const n=Reflect.ownKeys(e),r=[];if(n.length>0){const a=[],o=[],i=[];for(let c=0;c<n.length;c++){const u=n[c],l=e[u];if(II(l)){const d=l.ast;switch(d._tag){case"PropertySignatureDeclaration":{const h=d.type,m=d.isOptional,p=d.annotations;a.push(new Kn(u,h,m,!0,eme(d))),o.push(new Kn(u,wn(h),m,!0,p)),r.push(new Kn(u,h,m,!0,p));break}case"PropertySignatureTransformation":{const h=d.from.fromKey??u;a.push(new Kn(h,d.from.type,d.from.isOptional,!0,d.from.annotations)),o.push(new Kn(u,d.to.type,d.to.isOptional,!0,d.to.annotations)),i.push(new hhe(h,u,d.decode,d.encode));break}}}else a.push(new Kn(u,l.ast,!1,!0)),o.push(new Kn(u,wn(l.ast),!1,!0)),r.push(new Kn(u,l.ast,!1,!0))}if(sn(i)){const c=[],u=[];for(const l of t){const{indexSignatures:d,propertySignatures:h}=YR(l.key.ast,l.value.ast);h.forEach(m=>{a.push(m),o.push(new Kn(m.name,wn(m.type),m.isOptional,m.isReadonly,m.annotations))}),d.forEach(m=>{c.push(m),u.push(new fp(m.parameter,wn(m.type),m.isReadonly))})}return new gi(new Lo(a,c,{[Dl]:"Struct (Encoded side)"}),new Lo(o,u,{[Dl]:"Struct (Type side)"}),new g_(i))}}const s=[];for(const a of t){const{indexSignatures:o,propertySignatures:i}=YR(a.key.ast,a.value.ast);i.forEach(c=>r.push(c)),o.forEach(c=>s.push(c))}return new Lo(r,s)},fB=(e,t)=>{const n=Reflect.ownKeys(e);for(const r of n){const s=e[r];if(t[r]===void 0&&II(s)){const a=s.ast,o=a._tag==="PropertySignatureDeclaration"?a.defaultValue:a.to.defaultValue;o!==void 0&&(t[r]=o())}}return t};function AI(e,t,n=tme(e,t)){return class extends Nt(n){static annotations(s){return AI(this.fields,this.records,Ca(this.ast,s))}static fields={...e};static records=[...t];static make=(s,a)=>{const o=fB(e,{...s});return Lx(a)?o:Ax(this)(o)};static pick(...s){return q(Mhe(e,...s))}static omit(...s){return q(rB(e,...s))}}}function q(e,...t){return AI(e,t)}const nme=e=>ie(e).pipe(xh,dB(()=>e)),rme=(e,t)=>q({_tag:nme(e),...t});function hB(e,t,n){return class extends AI({},[{key:e,value:t}],n){static annotations(s){return hB(e,t,Ca(this.ast,s))}static key=e;static value=t}}const yt=e=>hB(e.key,e.value);function mB(e,t){return class extends Nt(t){static annotations(r){return mB(this.from,Ca(this.ast,r))}static make=(r,s)=>Lx(s)?r:Ax(this)(r);static from=e}}const nn=(e,t)=>n=>{const r=yn(w8(n.ast),{onNone:()=>[e],onSome:a=>[...a,e]}),s=Vd(n.ast,Au({[h8]:r,...t}));return mB(n,s)},hp=e=>Nt(Wf(e.ast)),Sf=(e,t,n)=>{if(m_(e)&&m_(t)){const r=[...e.propertySignatures];for(const s of t.propertySignatures){const a=s.name,o=r.findIndex(i=>i.name===a);if(o===-1)r.push(s);else{const{isOptional:i,type:c}=r[o];r[o]=new Kn(a,k0(c,s.type,n.concat(a)),i,!0)}}return new Lo(r,e.indexSignatures.concat(t.indexSignatures))}throw new Error(d8(e,t,n))},sme=yhe([qd]),wf=(e,t)=>t.map(n=>new SI(n,e.filter,sme(e))),k0=(e,t,n)=>ur.make(yo([e],[t],n)),uc=e=>Cx(e)?e.types:[e],yo=(e,t,n)=>Ay(e,r=>Ay(t,s=>{switch(s._tag){case"Literal":{if(jn(s.literal)&&h_(r)||ba(s.literal)&&GR(r)||ru(s.literal)&&KR(r))return[s];break}case"StringKeyword":{if(s===p0){if(h_(r)||ph(r)&&jn(r.literal))return[r];if(Xc(r))return wf(r,yo(uc(r.from),[s],n))}else if(r===p0)return[s];break}case"NumberKeyword":{if(s===g0){if(GR(r)||ph(r)&&ba(r.literal))return[r];if(Xc(r))return wf(r,yo(uc(r.from),[s],n))}else if(r===g0)return[s];break}case"BooleanKeyword":{if(s===b0){if(KR(r)||ph(r)&&ru(r.literal))return[r];if(Xc(r))return wf(r,yo(uc(r.from),[s],n))}else if(r===b0)return[s];break}case"Union":return yo(uc(r),s.types,n);case"Suspend":return[new fd(()=>k0(r,s.f(),n))];case"Refinement":return wf(s,yo(uc(r),uc(s.from),n));case"TypeLiteral":{switch(r._tag){case"Union":return yo(r.types,[s],n);case"Suspend":return[new fd(()=>k0(r.f(),s,n))];case"Refinement":return wf(r,yo(uc(r.from),[s],n));case"TypeLiteral":return[Sf(r,s,n)];case"Transformation":{const a=r.transformation,o=Sf(r.from,s,n),i=Sf(r.to,wn(s),n);switch(a._tag){case"TypeLiteralTransformation":return[new gi(o,i,new g_(a.propertySignatureTransformations))];case"ComposeTransformation":return[new gi(o,i,$8)];case"FinalTransformation":return[new gi(o,i,new L8((c,u,l,d)=>or(a.decode(c,u,l,d),h=>({...c,...h})),(c,u,l,d)=>or(a.encode(c,u,l,d),h=>({...c,...h}))))]}}}break}case"Transformation":{if(O8(r)){if(b_(s.transformation)&&b_(r.transformation))return[new gi(Sf(r.from,s.from,n),Sf(r.to,s.to,n),new g_(s.transformation.propertySignatureTransformations.concat(r.transformation.propertySignatureTransformations)))]}else return yo([s],[r],n);break}}throw new Error(d8(r,s,n))})),Cr=O(2,(e,t)=>Nt(k0(e.ast,t.ast,[]))),kl=O(e=>Xa(e[1]),(e,t)=>NI(e,t,khe(e.ast,t.ast))),pB=e=>Nt(new fd(()=>e().ast)),gB=Symbol.for("effect/SchemaId/Refine");function bB(e,t,n){return class extends Nt(n){static annotations(s){return bB(this.from,this.filter,Ca(this.ast,s))}static[gB]=e;static from=e;static filter=t;static make=(s,a)=>Lx(a)?s:Ax(this)(s)}}const oP=(e,t,n)=>{if(ru(e))return e?ye():Ce(new dr(t,n));if(jn(e))return Ce(new dr(t,n,e));if(e!==void 0){if("_tag"in e)return Ce(e);const r=new dr(t,n,e.message);return Ce(sn(e.path)?new rr(e.path,n,r):r)}return ye()},ame=(e,t,n)=>{if(pfe(e))return oP(e,t,n);if(sn(e)){const r=QM(e,s=>oP(s,t,n));if(sn(r))return Ce(r.length===1?r[0]:new dn(t,n,r))}return ye()};function yB(e,t){return n=>{function r(a,o,i){return ame(e(a,o,i),i,a)}const s=new SI(n.ast,r,Au(t));return bB(n,r,s)}}function NI(e,t,n){return class extends Nt(n){static annotations(s){return NI(this.from,this.to,Ca(this.ast,s))}static from=e;static to=t}}const md=O(e=>Xa(e[0])&&Xa(e[1]),(e,t,n)=>NI(e,t,new gi(e.ast,t.ast,new L8(n.decode,n.encode)))),Nu=O(e=>Xa(e[0])&&Xa(e[1]),(e,t,n)=>md(e,t,{strict:!0,decode:(r,s,a,o)=>gs(n.decode(r,o)),encode:(r,s,a,o)=>gs(n.encode(r,o))})),ome=Symbol.for("effect/SchemaId/Trimmed"),ime=e=>t=>t.pipe(yB(n=>n===n.trim(),{schemaId:ome,title:"trimmed",description:"a string with no leading or trailing whitespace",jsonSchema:{pattern:"^\\S[\\s\\S]*\\S$|^\\S$|^$"},...e})),cme=Efe,ume=(e,t)=>n=>n.pipe(yB(r=>r.length>=e,{schemaId:cme,title:`minLength(${e})`,description:`a string at least ${e} character(s) long`,jsonSchema:{minLength:e},...t})),lme=e=>ume(1,{title:"nonEmptyString",description:"a non empty string",...e});class dme extends C.pipe(ime({identifier:"Trimmed"})){}class fme extends Nu(C.annotations({description:"a string that will be trimmed"}),dme,{strict:!0,decode:t=>t.trim(),encode:Qe}).annotations({identifier:"Trim"}){}const hme=(e,t)=>{const n=Symbol.keyFor(e);return n===void 0?jc(new dr(t,e,`Unable to encode a unique symbol ${String(e)} into a string`)):gs(n)},mme=e=>gs(Symbol.for(e));class pme extends CI(lY,{typeConstructor:{_tag:"Uint8Array"},identifier:"Uint8ArrayFromSelf",pretty:()=>t=>`new Uint8Array(${JSON.stringify(Array.from(t))})`,arbitrary:()=>t=>t.uint8Array(),equivalence:()=>R1(Fe)}){}const gme=e=>Xa(e)||II(e),xB=e=>Reflect.ownKeys(e).every(t=>gme(e[t])),RI=e=>"fields"in e?e.fields:RI(e[gB]),kB=e=>xB(e)?q(e):Xa(e)?e:q(RI(e)),vB=e=>xB(e)?e:RI(e),bme=e=>dB(xh(ie(e)),()=>e),Gd=e=>(t,n,r)=>{class s extends qC{}s.prototype.name=t;const a=vB(n),o=kB(n),i={_tag:bme(t)},c=Gb(i,a),u="message"in c;class l extends Kb({kind:"TaggedError",identifier:t,schema:Cr(o,q(i)),fields:c,Base:s,annotations:r,disableToString:!0}){static _tag=t}return u||Object.defineProperty(l.prototype,"message",{get(){return`{ ${Reflect.ownKeys(a).map(d=>`${jm(d)}: ${Uo(this[d])}`).join(", ")} }`},enumerable:!1,configurable:!0}),l},Gb=(e,t)=>{const n={...e};for(const r of Reflect.ownKeys(t)){if(r in e)throw new Error(f8(r));n[r]=t[r]}return n};function Lx(e){return ru(e)?e:e?.disableValidation??!1}const iP=Ve("effect/Schema/astCache",()=>new WeakMap),yme=e=>e===void 0?[]:Array.isArray(e)?e:[e],Kb=({Base:e,annotations:t,disableToString:n,fields:r,identifier:s,kind:a,schema:o})=>{const i=Symbol.for(`effect/Schema/${a}/${s}`),[c,u,l]=yme(t),d=sP(o),h=d.annotations({identifier:s,...c}),m=d.annotations({[Dl]:`${s} (Type side)`,...c}),p=o.annotations({[Dl]:`${s} (Constructor)`,...c}),y=o.annotations({[Dl]:`${s} (Encoded side)`,...l}),g=o.annotations({...l,...c,...u}),b=k=>Be(k,i)&&_he(m)(k),x=class extends e{constructor(k={},_=!1){k={...k},delete k._tag,k=fB(r,k),Lx(_)||(k=Ax(p)(k)),super(k,!0)}static[hd]=S_;static get ast(){let k=iP.get(this);if(k)return k;const _=CI([o],{decode:()=>(S,w,T)=>S instanceof this||b(S)?gs(S):jc(new dr(T,S)),encode:()=>(S,w)=>S instanceof this?gs(S):or(K8(m)(S,w),T=>new this(T,!0))},{identifier:s,pretty:S=>w=>`${s}(${S(w)})`,arbitrary:S=>w=>S(w).map(T=>new this(T)),equivalence:Qe,[h0]:h.ast,...c});return k=Nu(y,_,{strict:!0,decode:S=>new this(S,!0),encode:Qe}).annotations({[h0]:g.ast,...u}).ast,iP.set(this,k),k}static pipe(){return je(this,arguments)}static annotations(k){return Nt(this.ast).annotations(k)}static toString(){return`(${String(y)} <-> ${s})`}static make(...k){return new this(...k)}static fields={...r};static identifier=s;static extend(k){return(_,S)=>{const w=vB(_),T=kB(_),A=Gb(r,w);return Kb({kind:a,identifier:k,schema:Cr(o,T),fields:A,Base:this,annotations:S})}}static transformOrFail(k){return(_,S,w)=>{const T=Gb(r,_);return Kb({kind:a,identifier:k,schema:md(o,sP(q(T)),S),fields:T,Base:this,annotations:w})}}static transformOrFailFrom(k){return(_,S,w)=>{const T=Gb(r,_);return Kb({kind:a,identifier:k,schema:md(Bhe(o),q(T),S),fields:T,Base:this,annotations:w})}}get[i](){return i}};return n!==!0&&Object.defineProperty(x.prototype,"toString",{value(){return`${s}({ ${Reflect.ownKeys(r).map(k=>`${jm(k)}: ${Uo(this[k])}`).join(", ")} })`},configurable:!0,writable:!0}),x},cP=rme("symbol",{key:C}).annotations({description:"an object to be decoded into a globally shared symbol"}),xme=md(cP,Whe,{strict:!0,decode:e=>mme(e.key),encode:(e,t,n)=>or(hme(e,n),r=>cP.make({key:r}))});class kme extends tn(C,it,xme).annotations({identifier:"PropertyKey"}){}class vme extends q({_tag:xh(ie("Pointer","Unexpected","Missing","Composite","Refinement","Transformation","Type","Forbidden")).annotations({description:"The tag identifying the type of parse issue"}),path:xh(_e(kme)).annotations({description:"The path to the property where the issue occurred"}),message:xh(C).annotations({description:"A descriptive message explaining the issue"})}).annotations({identifier:"ArrayFormatterIssue",description:"Represents an issue returned by the ArrayFormatter formatter"}){}const SB=(e,t)=>{class n extends qC{_tag=t}return n.prototype[e]=e,n.prototype.name=t,n},Sme=ma,wme=zd,_me=BF,Eme=sI,uP=aI,Tme=pde,wB=Symbol.for("effect/Subscribable"),_B=e=>Be(e,wB),Cme="effect/SubscriptionRef",Ime=Symbol.for(Cme),Ame=O(2,(e,t)=>B(Fre(e.ref,t),ZC(mle(e.pubsub,t)),e.semaphore.withPermits(1))),__=Ime,lP=Ame,Nme="~effect-atom/atom/Result",$x={[Nme]:{E:Qe,A:Qe},pipe(){return je(this,arguments)},[Ze](e){if(this._tag!==e._tag||this.waiting!==e.waiting)return!1;switch(this._tag){case"Initial":return!0;case"Success":return Fe(this.value,e.value);case"Failure":return Fe(this.cause,e.cause)}},[Xe](){const e=Wt(`${this._tag}:${this.waiting}`);return this._tag==="Initial"?Mt(this,e):Mt(this,tt(e)(this._tag==="Success"?Pe(this.value):Pe(this.cause)))}},EB=(e,t)=>e._tag==="Success"?bu(e.value):mp(e.cause,{previous:t}),PI=e=>e._tag==="None"?Ai(!0):jx(e.value),Rme=e=>e._tag!=="Initial",Ai=(e=!1)=>{const t=Object.create($x);return t._tag="Initial",t.waiting=e,t},Ss=e=>e._tag==="Success",bu=(e,t)=>{const n=Object.create($x);return n._tag="Success",n.value=e,n.waiting=t?.waiting??!1,n.timestamp=t?.timestamp??Date.now(),n},Kd=e=>e._tag==="Failure",Pme=(e,t)=>{const n=Object.create($x);return n._tag="Failure",n.cause=e,n.previousSuccess=t?.previousSuccess??ye(),n.waiting=t?.waiting??!1,n},mp=(e,t)=>Pme(e,{previousSuccess:Vi(t.previous,n=>Ss(n)?Ce(n):Kd(n)?n.previousSuccess:ye()),waiting:t.waiting}),Ome=(e,t)=>mp(e4(e),t),jx=(e,t)=>{if(e.waiting)return t?.touch?Lme(e):e;const n=Object.assign(Object.create($x),e);return n.waiting=!0,n},Lme=e=>Ss(e)?bu(e.value,{waiting:e.waiting}):e,Qf=(e,t)=>e._tag==="Failure"?mp(e.cause,{previous:t,waiting:e.waiting}):e,TB=e=>e._tag==="Success"?Ce(e.value):e._tag==="Failure"?Jr(e.previousSuccess,t=>t.value):ye(),E_=e=>zM(TB(e),()=>new Bd("Result.getOrThrow: no value found")),v0=e=>{switch(e._tag){case"Success":return fs(e.value);case"Failure":return wr(e.cause);default:return Yy(new Bd)}},$me={immediate:!0},jme=e=>{e()},Rv="~effect-atom/atom/Registry",Mme=e=>new Dme(e?.initialValues,e?.scheduleTask,e?.timeoutResolution,e?.defaultIdleTTL),T_="~effect-atom/atom/Atom/Serializable",_f=e=>T_ in e?e[T_].key:e;class Dme{scheduleTask;defaultIdleTTL;[Rv];timeoutResolution;constructor(t,n=a=>queueMicrotask(a),r,s){if(this.scheduleTask=n,this.defaultIdleTTL=s,this[Rv]=Rv,r===void 0&&s!==void 0?this.timeoutResolution=Math.round(s/2):this.timeoutResolution=r??1e3,t!==void 0)for(const[a,o]of t)this.ensureNode(a).setValue(o)}nodes=new Map;preloadedSerializable=new Map;timeoutBuckets=new Map;nodeTimeoutBucket=new Map;disposed=!1;getNodes(){return this.nodes}get(t){return this.ensureNode(t).value()}set(t,n){t.write(this.ensureNode(t).writeContext,n)}setSerializable(t,n){this.preloadedSerializable.set(t,n)}modify(t,n){const r=this.ensureNode(t),s=n(r.value());return t.write(r.writeContext,s[1]),s[0]}update(t,n){const r=this.ensureNode(t);t.write(r.writeContext,n(r.value()))}refresh=t=>{t.refresh!==void 0?t.refresh(this.refresh):this.invalidateAtom(t)};subscribe(t,n,r){const s=this.ensureNode(t);r?.immediate&&n(s.value());const a=s.subscribe(function(){n(s._value)});return()=>{a(),s.canBeRemoved&&this.scheduleNodeRemoval(s)}}mount(t){return this.subscribe(t,Kl,$me)}atomHasTtl(t){return!t.keepAlive&&t.idleTTL!==0&&(t.idleTTL!==void 0||this.defaultIdleTTL!==void 0)}ensureNode(t){const n=_f(t);let r=this.nodes.get(n);if(r===void 0?(r=this.createNode(t),this.nodes.set(n,r)):this.atomHasTtl(t)&&this.removeNodeTimeout(r),typeof n=="string"&&this.preloadedSerializable.has(n)){const s=this.preloadedSerializable.get(n);this.preloadedSerializable.delete(n);const a=t[T_].decode(s);r.setValue(a)}return r}createNode(t){if(this.disposed)throw new Error(`Cannot access Atom ${t}: registry is disposed`);return t.keepAlive||this.scheduleAtomRemoval(t),new Fme(this,t)}invalidateAtom=t=>{this.ensureNode(t).invalidate()};scheduleAtomRemoval(t){this.scheduleTask(()=>{const n=this.nodes.get(_f(t));n!==void 0&&n.canBeRemoved&&this.removeNode(n)})}scheduleNodeRemoval(t){this.scheduleTask(()=>{t.canBeRemoved&&this.removeNode(t)})}removeNode(t){this.atomHasTtl(t.atom)?this.setNodeTimeout(t):(this.nodes.delete(_f(t.atom)),t.remove())}setNodeTimeout(t){if(this.nodeTimeoutBucket.has(t))return;let n=t.atom.idleTTL??this.defaultIdleTTL;if(this.#e!==null&&(n-=this.#e,n<=0)){this.nodes.delete(_f(t.atom)),t.remove();return}const r=Math.ceil(n/this.timeoutResolution)*this.timeoutResolution,s=Date.now()+r,a=s-s%this.timeoutResolution+this.timeoutResolution;let o=this.timeoutBuckets.get(a);o===void 0&&(o=[new Set,setTimeout(()=>this.sweepBucket(a),a-Date.now())],this.timeoutBuckets.set(a,o)),o[0].add(t),this.nodeTimeoutBucket.set(t,a)}removeNodeTimeout(t){const n=this.nodeTimeoutBucket.get(t);if(n===void 0)return;this.nodeTimeoutBucket.delete(t),this.scheduleNodeRemoval(t);const[r,s]=this.timeoutBuckets.get(n);r.delete(t),r.size===0&&(clearTimeout(s),this.timeoutBuckets.delete(n))}#e=null;sweepBucket(t){const n=this.timeoutBuckets.get(t)[0];this.timeoutBuckets.delete(t),n.forEach(r=>{this.nodeTimeoutBucket.delete(r),r.canBeRemoved&&(this.nodes.delete(_f(r.atom)),this.#e=r.atom.idleTTL??this.defaultIdleTTL,r.remove(),this.#e=null)})}reset(){this.timeoutBuckets.forEach(([,t])=>clearTimeout(t)),this.timeoutBuckets.clear(),this.nodeTimeoutBucket.clear(),this.nodes.forEach(t=>t.remove()),this.nodes.clear()}dispose(){this.disposed=!0,this.reset()}}var vl;(function(e){e[e.alive=1]="alive",e[e.initialized=2]="initialized",e[e.waitingForValue=4]="waitingForValue"})(vl||(vl={}));var sa;(function(e){e[e.uninitialized=5]="uninitialized",e[e.stale=7]="stale",e[e.valid=3]="valid",e[e.removed=0]="removed"})(sa||(sa={}));let Fme=class{registry;atom;constructor(t,n){this.registry=t,this.atom=n,this.writeContext=new Hme(t,this)}state=sa.uninitialized;lifetime;writeContext;parents=[];previousParents;children=[];listeners=new Set;skipInvalidation=!1;get canBeRemoved(){return!this.atom.keepAlive&&this.listeners.size===0&&this.children.length===0&&this.state!==0}_value=void 0;value(){if((this.state&vl.waitingForValue)!==0){this.lifetime=zme(this);const t=this.atom.read(this.lifetime);if((this.state&vl.waitingForValue)!==0&&this.setValue(t),this.previousParents){const n=this.previousParents;this.previousParents=void 0;for(let r=0;r<n.length;r++)n[r].removeChild(this),n[r].canBeRemoved&&this.registry.scheduleNodeRemoval(n[r])}}return this._value}valueOption(){return(this.state&vl.initialized)===0?ye():Ce(this._value)}setValue(t){if((this.state&vl.initialized)===0){this.state=sa.valid,this._value=t,Sn.phase===qa.collect?Sn.notify.add(this):this.notify();return}this.state=sa.valid,!Fe(this._value,t)&&(this._value=t,this.skipInvalidation?this.skipInvalidation=!1:this.invalidateChildren(),this.listeners.size>0&&(Sn.phase===qa.collect?Sn.notify.add(this):this.notify()))}addParent(t){if(this.parents.push(t),this.previousParents!==void 0){const n=this.previousParents.indexOf(t);n!==-1&&(this.previousParents[n]=this.previousParents[this.previousParents.length-1],this.previousParents.pop()===void 0&&(this.previousParents=void 0))}t.children.indexOf(this)===-1&&(t.children.push(this),t.skipInvalidation&&(t.skipInvalidation=!1))}removeChild(t){const n=this.children.indexOf(t);n!==-1&&(this.children[n]=this.children[this.children.length-1],this.children.pop())}invalidate(){this.state===sa.valid&&(this.state=sa.stale,this.disposeLifetime()),Sn.phase===qa.collect?Sn.stale.push(this):this.atom.lazy&&this.listeners.size===0&&!Bme(this.children)?(this.invalidateChildren(),this.skipInvalidation=!0):this.value()}invalidateChildren(){if(this.children.length===0)return;const t=this.children;this.children=[];for(let n=0;n<t.length;n++)t[n].invalidate()}notify(){this.listeners.forEach(jme),Sn.phase===qa.commit&&Sn.notify.delete(this)}disposeLifetime(){this.lifetime!==void 0&&(this.lifetime.dispose(),this.lifetime=void 0),this.parents.length!==0&&(this.previousParents=this.parents,this.parents=[])}remove(){if(this.state=sa.removed,this.listeners.clear(),this.lifetime===void 0||(this.disposeLifetime(),this.previousParents===void 0))return;const t=this.previousParents;this.previousParents=void 0;for(let n=0;n<t.length;n++)t[n].removeChild(this),t[n].canBeRemoved&&this.registry.removeNode(t[n])}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}};function Bme(e){if(e.length===0)return!1;let t=e,n,r=0;for(;t!==void 0;){for(let s=0,a=t.length;s<a;s++){const o=t[s];if(!o.atom.lazy||o.listeners.size>0)return!0;o.children.length>0&&(n===void 0?n=[o.children]:n.push(o.children))}t=n?.[r++]}return!1}const sr=e=>new Error(`Cannot use context of disposed Atom: ${e}`),Ume={get registry(){return this.node.registry},addFinalizer(e){if(this.disposed)throw sr(this.node.atom);this.finalizers??=[],this.finalizers.push(e)},get(e){if(this.disposed)throw sr(this.node.atom);const t=this.node.registry.ensureNode(e);return this.node.addParent(t),t.value()},result(e,t){if(this.disposed)throw sr(this.node.atom);if(this.isFn)return this.resultOnce(e,t);const n=this.get(e);if(t?.suspendOnWaiting&&n.waiting)return Ub;switch(n._tag){case"Initial":return Ub;case"Failure":return wr(n.cause);case"Success":return Kt(n.value)}},resultOnce(e,t){if(this.disposed)throw sr(this.node.atom);return s0(n=>{const r=this.once(e);if(r._tag!=="Initial"&&!(t?.suspendOnWaiting&&r.waiting))return n(v0(r));const s=this.node.registry.subscribe(e,a=>{a._tag==="Initial"||t?.suspendOnWaiting&&a.waiting||(s(),n(v0(a)))},{immediate:!1});return Bt(s)})},setResult(e,t){if(this.disposed)throw sr(this.node.atom);return this.node.registry.set(e,t),this.resultOnce(e,{suspendOnWaiting:!0})},some(e){if(this.disposed)throw sr(this.node.atom);if(this.isFn)return this.someOnce(e);const t=this.get(e);return t._tag==="None"?Ub:Kt(t.value)},someOnce(e){if(this.disposed)throw sr(this.node.atom);return s0(t=>{const n=this.once(e);if(Et(n))return t(Kt(n.value));const r=this.node.registry.subscribe(e,s=>{Cn(s)||(r(),t(Kt(s.value)))},{immediate:!1});return Bt(r)})},once(e){if(this.disposed)throw sr(this.node.atom);return this.node.registry.get(e)},self(){if(this.disposed)throw sr(this.node.atom);return this.node.valueOption()},refresh(e){if(this.disposed)throw sr(this.node.atom);this.node.registry.refresh(e)},refreshSelf(){if(this.disposed)throw sr(this.node.atom);this.node.invalidate()},mount(e){if(this.disposed)throw sr(this.node.atom);this.addFinalizer(this.node.registry.mount(e))},subscribe(e,t,n){if(this.disposed)throw sr(this.node.atom);this.addFinalizer(this.node.registry.subscribe(e,t,n))},setSelf(e){if(this.disposed)throw sr(this.node.atom);this.node.setValue(e)},set(e,t){if(this.disposed)throw sr(this.node.atom);this.node.registry.set(e,t)},stream(e,t){if(this.disposed)throw sr(this.node.atom);return B(i0(Z4(t?.bufferSize??16),d0),U4(n=>i0(Bt(()=>this.node.registry.subscribe(e,r=>{yle(n,r)},{immediate:t?.withoutInitialValue!==!0})),r=>Bt(r))),It(n=>rfe(n)),n8)},streamResult(e,t){return B(this.stream(e,t),tfe(Rme),nfe(n=>n._tag==="Success"?ofe(n.value):efe(n.cause)))},dispose(){if(this.disposed=!0,this.finalizers===void 0)return;const e=this.finalizers;this.finalizers=void 0;for(let t=e.length-1;t>=0;t--)e[t]()}},zme=e=>{function t(n){if(t.disposed)throw sr(n);if(t.isFn)return e.registry.get(n);const r=e.registry.ensureNode(n),s=r.value();return e.addParent(r),s}return Object.setPrototypeOf(t,Ume),t.isFn=!1,t.disposed=!1,t.finalizers=void 0,t.node=e,t};class Hme{registry;node;constructor(t,n){this.registry=t,this.node=n}get(t){return this.registry.get(t)}set(t,n){return this.registry.set(t,n)}setSelf(t){return this.node.setValue(t)}refreshSelf(){return this.node.invalidate()}}var qa;(function(e){e[e.disabled=0]="disabled",e[e.collect=1]="collect",e[e.commit=2]="commit"})(qa||(qa={}));const Sn=Ve("@effect-atom/atom/Registry/batchState",()=>({phase:qa.disabled,depth:0,stale:[],notify:new Set}));function qme(e){Sn.phase=qa.collect,Sn.depth++;try{if(e(),Sn.depth===1){for(let t=0;t<Sn.stale.length;t++)CB(Sn.stale[t]);Sn.phase=qa.commit;for(const t of Sn.notify)t.notify();Sn.notify.clear()}}finally{Sn.depth--,Sn.depth===0&&(Sn.phase=qa.disabled,Sn.stale=[])}}function CB(e){if(e.state!==sa.valid){for(let t=0;t<e.parents.length;t++){const n=e.parents[t];n.state!==sa.valid&&CB(n)}e.state!==sa.valid&&e.value()}}const Vme=e=>{const t=e;switch(t._tag){case"Failure":case"Success":return t;case"Left":return Yy(t.left);case"Right":return fs(t.right);case"Some":return fs(t.value);case"None":return Yy(new Bd)}},OI=e=>{const t=kx(e);return(n,r,s=!1)=>{const a=Vme(n);if(a){r(a);return}const o=new lx,i=t(n,{scheduler:o});o.flush();const c=i.unsafePoll();if(c){r(c);return}i.addObserver(r);function u(){i.removeObserver(r),s||i.unsafeInterruptAsFork(ys)}return u}},Gme="~effect-atom/atom/Registry",Kme=e=>Be(e,Gme),IB=Mme;class AB extends br("@effect/atom/Registry/CurrentRegistry")(){}const Wme=O(e=>Kme(e[0]),(e,t,n)=>{const r=n?.suspendOnWaiting??!1;return s0(s=>{const a=e.get(t);if(a._tag!=="Initial"&&!(r&&a.waiting))return s(v0(a));const o=e.subscribe(t,i=>{i._tag!=="Initial"&&!(r&&i.waiting)&&(s(v0(i)),o())});return Bt(o)})}),C_="~effect-atom/atom/Atom",I_="~effect-atom/atom/Atom/Writable",NB=O(2,(e,t)=>{const n=qs(t),r=CD(n);return Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,keepAlive:!r,idleTTL:r?Ly(n):void 0})}),gm=NB(0),LI={[C_]:C_,pipe(){return je(this,arguments)},toJSON(){return{_id:"Atom",keepAlive:this.keepAlive,lazy:this.lazy,label:this.label}},toString(){return zt(this)},[xt](){return this.toJSON()}},Yme={...LI,atom(e,t){const n=PB(e,t);return Va(r=>{const s=r.self(),a=r(this);return a._tag!=="Success"?Qf(a,s):n(r,a.value)})},fn(e,t){return arguments.length===0?(n,r)=>dP(this,n,r):dP(this,e,t)},pull(e,t){const n=gm(S0(0)),r=Va(s=>{const a=s.self(),o=s(this);return o._tag!=="Success"?Qf(o,a):kh(s,ope(s,n,e,t),Ai(!0),o.value)});return ipe(n,r)},subscriptionRef(e){return tpe(gm(Va(t=>{const n=t.self(),r=t(this);if(r._tag!=="Success")return Qf(r,n);const s=typeof e=="function"?e(t):e;return __ in s?s:kh(t,s,Ai(!0),r.value)})),(t,n)=>{const r=E_(t(this));return mP(t,n,r)})},subscribable(e){return npe(Va(t=>{const n=t.self(),r=t(this);if(r._tag!=="Success")return Qf(r,n);const s=typeof e=="function"?e(t):e;return _B(s)?s:kh(t,s,Ai(!0),r.value)}),(t,n)=>{const r=E_(t(this));return mP(t,n,r)})}},dP=(e,t,n)=>{const[r,s,a]=spe(n?.reactivityKeys?(o,i)=>{const c=t(o,i);return Ki(c)?r8(c,n.reactivityKeys):e8(c,lfe(n.reactivityKeys))}:t,n);return pp(o=>{o.get(a);const i=o.self(),c=o.get(e);return c._tag!=="Success"?Qf(c,i):r(o,c.value)},s)},Jme={...LI,[I_]:I_},Qme=e=>I_ in e,Va=(e,t)=>{const n=Object.create(LI);return n.keepAlive=!1,n.lazy=!0,n.read=e,n.refresh=t,n},pp=(e,t,n)=>{const r=Object.create(Jme);return r.keepAlive=!1,r.lazy=!0,r.read=e,r.write=t,r.refresh=n,r};function Xme(e,t){e.setSelf(t)}const RB=(e,t)=>{const n=PB(e,t);return C_ in n?n:Va(n)},fP=e=>EJ in e||bJ in e,PB=(e,t)=>{if(typeof e=="function"&&!Ki(e)&&!(Sv in e)){const n=e;return function(r,s){const a=n(r);if(ya(a)){if(fP(a))return a;if(n_ in a)return A_(r,a,t,s);if(Sv in a)return hP(r,a,t,s)}return a}}else if(ya(e)){if(fP(e))return S0(e);if(n_ in e)return function(n,r){return A_(n,e,t,r)};if(Sv in e)return function(n,r){return hP(n,e,t,r)}}return S0(e)},S0=e=>pp(function(t){return e},Xme),A_=(e,t,n,r)=>{const s=n?.initialValue!==void 0?bu(n.initialValue):Ai();return kh(e,t,s,r,n?.uninterruptible)};function kh(e,t,n,r=vx,s=!1){const a=e.self(),o=Hs(u4());e.addFinalizer(()=>{yx(r0(o,AC))});const i=new Map(r.context.unsafeMap);i.set(_ie.key,o),i.set(AB.key,e.registry);const c=eI({context:iJ(i),fiberRefs:r.fiberRefs,runtimeFlags:r.runtimeFlags});let u,l=!1;const d=OI(c)(t,function(h){u=EB(h,a),l&&e.setSelf(u)},s);return l=!0,d!==void 0&&e.addFinalizer(d),u!==void 0?u:a._tag==="Some"?PI(a):jx(n)}const Zme=e=>{let t=wv;function n(s){const a=Object.create(Yme);a.keepAlive=!1,a.lazy=!0,a.refresh=void 0,a.factory=n;const o=jI(Va(typeof s=="function"?i=>mv(s(i),t):()=>mv(s,t)));return a.layer=o,a.read=function(c){const u=c(o),l=Ue(Ue(bx,d=>ER(u,e.memoMap,d)),d=>c0(sp(),d));return A_(c,l,{uninterruptible:!0})},a}n.memoMap=e.memoMap,n.addGlobalLayer=s=>{t=mv(t,G4(s,wv))};const r=gm(RB(due(s=>ER(wv,e.memoMap,s)).pipe(It(fa(cp)))));return n.withReactivity=s=>a=>cpe(a,o=>{const i=E_(o(r));return o.addFinalizer(i.unsafeRegister(s,()=>{o.refresh(a)})),o.subscribe(a,c=>o.setSelf(c)),o.once(a)}),n},epe=Ve("@effect-atom/atom/Atom/defaultMemoMap",()=>Hs(Mue)),OB=Ve("@effect-atom/atom/Atom/defaultContext",()=>Zme({memoMap:epe}));OB.withReactivity;const hP=(e,t,n,r)=>{const s=n?.initialValue!==void 0?bu(n.initialValue):Ai();return $I(e,t,s,r)};function $I(e,t,n,r=vx){const s=e.self(),a=wme({onInput(c){return Eme(()=>{const u=hQ(c);return u._tag==="Some"&&e.setSelf(bu(u.value,{waiting:!0})),a})},onFailure(c){return uP(()=>{e.setSelf(mp(c,{previous:e.self()}))})},onDone(c){return uP(()=>{B(e.self(),Vi(TB),yn({onNone:()=>e.setSelf(Ome(new Bd,{previous:e.self()})),onSome:u=>e.setSelf(bu(u))}))})}}),o=eI({context:ds(r.context,AB,e.registry),fiberRefs:r.fiberRefs,runtimeFlags:r.runtimeFlags}),i=OI(o)(_me(Sme(t8(t),a)),Kl,!1);return i!==void 0&&e.addFinalizer(i),s._tag==="Some"?PI(s):jx(n)}const mP=(e,t,n=vx)=>wB in t?(e.addFinalizer(t.changes.pipe(afe(r=>(e.setSelf(r),bt)),Cue(n))),Tue(n)(t.get)):t._tag!=="Success"?t:$I(e,t.value.changes,Ai(!0),n),tpe=(e,t)=>{function n(r,s){const a=r.get(e);__ in a?Hs(lP(a,s)):Ss(a)&&Hs(lP(a.value,s))}return pp(r=>{const s=r(e);return __ in s||Ss(s)?t(r,s):s},n)},npe=(e,t)=>Va(n=>{const r=n(e);return _B(r)||Ss(r)?t(n,r):r}),rpe=Symbol.for("@effect-atom/atom/Atom/Reset"),Pv=Symbol.for("@effect-atom/atom/Atom/Interrupt");function spe(e,t){const n=gm(S0([0,void 0])),r=t?.initialValue!==void 0?bu(t.initialValue):Ai(),s=t?.concurrent?gm(Va(i=>{const c=new Set;return i.addFinalizer(()=>c.forEach(u=>u.unsafeInterruptAsFork(ys))),c})):void 0;function a(i,c){const u=s?i(s):void 0;i.isFn=!0;const[l,d]=i.get(n);if(l===0)return r;if(d===Pv)return mp(t4(ys),{previous:i.self()});let h=e(d,i);if(n_ in h){if(u){const m=h;h=Ue(sp(),p=>{const y=kx(p,m);u.add(y);const g=Array.from(u);return y.addObserver(()=>u.delete(y)),ape(g)})}return kh(i,h,r,c,!1)}return $I(i,h,r,c)}function o(i,c){upe(()=>{c===rpe?i.set(n,[0,void 0]):c===Pv?i.set(n,[i.get(n)[0]+1,Pv]):i.set(n,[i.get(n)[0]+1,c]),i.refreshSelf()})}return[a,o,n]}const ape=e=>s0(t=>{let n=0,r,s;function a(i,c=!1){i._tag==="Failure"?r=r?zoe(i.cause,r):i.cause:r||(s=i),n++,c||o()}function o(){for(;n<e.length;){const i=e[n],c=i.unsafePoll();if(!c)return i.addObserver(a);a(c,!0)}t(r?wr(r):s||wr(Uoe))}return o(),Bt(()=>{n<e.length&&e[n].removeObserver(a)})}),ope=(e,t,n,r)=>Ue(Tme(t8(typeof n=="function"?n(e):n)),s=>{const a=xue(1),o=AJ(qie()),i=o.currentContext;let c=pr();const u=Ue(gue(pn(()=>s),K4,i),Yr({onLeft:()=>{const m=Us(c);return Al(m)?Kt({done:!0,items:m}):ro(new Bd("Atom.pull: no items"))},onRight(m){let p;r?.disableAccumulation?p=m:(p=_n(c,m),c=p);const y=Us(p);return Al(y)?Kt({done:!1,items:y}):u}})),l=a.withPermits(1)(u),d=OI(eI({context:i,fiberRefs:o.getFiberRefs(),runtimeFlags:vx.runtimeFlags})),h=new Set;return e.addFinalizer(()=>{for(const m of h)m()}),e.once(t),e.subscribe(t,()=>{e.setSelf(PI(e.self()));let m;m=d(l,p=>{m&&h.delete(m);const y=EB(p,e.self()),g=h.size>0;e.setSelf(g?jx(y):y)}),m&&h.add(m)}),u}),ipe=(e,t)=>pp(t.read,function(n,r){n.set(e,n.get(e)+1)}),pP=typeof WeakRef>"u"||typeof FinalizationRegistry>"u"?e=>{const t=zw();return function(n){const r=So(t,n);if(r._tag==="Some")return r.value;const s=e(n);return Ec(t,n,s),s}}:e=>{const t=zw(),n=new FinalizationRegistry(r=>{mae(t,r)});return function(r){const s=So(t,r).pipe(HM(o=>o.deref()));if(s._tag==="Some")return s.value;const a=e(r);return Ec(t,r,new WeakRef(a)),n.register(a,r),a}},jI=e=>Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,keepAlive:!0}),cpe=O(2,(e,t)=>Qme(e)?pp(t,function(n,r){n.set(e,r)},e.refresh??function(n){n(e)}):Va(t,e.refresh??function(n){n(e)})),upe=qme,gP="~effect-atom/atom/Atom/ServerValue",lpe=O(2,(e,t)=>gP in e?e[gP](n=>t.get(n)):t.get(e)),Wb=Symbol.for("@effect/platform/HttpApiSchema/AnnotationMultipart"),Yb=Symbol.for("@effect/platform/HttpApiSchema/AnnotationMultipartStream"),vh=Symbol.for("@effect/platform/HttpApiSchema/AnnotationStatus"),Jb=Symbol.for("@effect/platform/HttpApiSchema/AnnotationEmptyDecodeable"),Sh=Symbol.for("@effect/platform/HttpApiSchema/AnnotationEncoding"),wh=Symbol.for("@effect/platform/HttpApiSchema/AnnotationParam"),LB=e=>{const t={};return vh in e&&(t[vh]=e[vh]),Jb in e&&(t[Jb]=e[Jb]),Sh in e&&(t[Sh]=e[Sh]),wh in e&&(t[wh]=e[wh]),Wb in e&&(t[Wb]=e[Wb]),Yb in e&&(t[Yb]=e[Yb]),t},dpe=e=>e._tag==="Transformation"?{...e.to.annotations,...e.annotations}:e.annotations,gp=(e,t)=>dpe(e)[t],$B=(e,t)=>gp(e,vh)??t,jB=e=>gp(e,Jb)??!1,fpe=e=>gp(e,Wb),hpe=e=>gp(e,Yb),mpe={kind:"Json",contentType:"application/json"},bp=(e,t=mpe)=>gp(e,Sh)??t,ppe=e=>(e._tag==="PropertySignatureTransformation"?e.to.annotations:e.annotations)[wh]?.name,wa=e=>{const t=rB(e,"status");return e.status!==void 0&&(t[vh]=e.status),t},N_=e=>{switch(e._tag){case"VoidKeyword":return!0;case"Transformation":return N_(e.from);case"Suspend":return N_(e.f());default:return!1}},gpe=e=>$B(e,N_(e)?204:200),Ov=e=>$B(e,500),R_=e=>{function t(r){if(Cx(r))for(const s of r.types)t(s);else n.push(r)}const n=[];return t(e),n},MB=(e,t)=>ur.make(Array.from(new Set([...R_(e),...R_(t)]))),Ni=(e,t)=>Nt(MB(e.ast,t.ast)),gn=O(2,(e,t)=>{const n={[wh]:{name:e,schema:t}};if(Xa(t)){const r=up(t.ast);Et(r)&&(n[qd]=r.value)}return t.annotations(n)}),bpe=e=>Khe.annotations(wa({status:e})),P_=bpe(204),ype=e=>{switch(e){case"Json":return"application/json";case"UrlParams":return"application/x-www-form-urlencoded";case"Uint8Array":return"application/octet-stream";case"Text":return"text/plain"}},xpe=O(2,(e,t)=>e.annotations({[Sh]:{kind:t.kind,contentType:t.contentType??ype(t.kind)},...t.kind==="Uint8Array"?{jsonSchema:{type:"string",format:"binary"}}:void 0})),DB=e=>xpe(C,{kind:"Text",...e});class kpe extends vme.annotations({identifier:"Issue",description:"Represents an error encountered while parsing a value to match the schema"}){}class w0 extends Gd()("HttpApiDecodeError",{issues:_e(kpe),message:C},wa({status:400,description:"The request did not match the expected schema"})){static fromParseError(t){return yh.formatError(t).pipe(u0(bh.formatError(t)),It(([n,r])=>new w0({issues:n,message:r})))}static refailParseError(t){return Ue(w0.fromParseError(t),ro)}}const bP=Symbol.for("@effect/platform/HttpApi"),vpe={[bP]:bP,pipe(){return je(this,arguments)},add(e){return ni({identifier:this.identifier,groups:FJ(this.groups,e.identifier,e),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},addHttpApi(e){const t={...this.groups};for(const n in e.groups){const r=e.groups[n].annotateContext(xa());r.annotations=Zr(e.annotations,r.annotations),r.middlewares=new Set([...e.middlewares,...r.middlewares]),t[n]=r}return ni({identifier:this.identifier,groups:t,errorSchema:Ni(this.errorSchema,e.errorSchema),annotations:this.annotations,middlewares:this.middlewares})},addError(e,t){return ni({identifier:this.identifier,groups:this.groups,errorSchema:Ni(this.errorSchema,t?.status?e.annotations(wa({status:t.status})):e),annotations:this.annotations,middlewares:this.middlewares})},prefix(e){return ni({identifier:this.identifier,groups:pl(this.groups,t=>t.prefix(e)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},middleware(e){return ni({identifier:this.identifier,groups:this.groups,errorSchema:Ni(this.errorSchema,e.failure),annotations:this.annotations,middlewares:new Set([...this.middlewares,e])})},annotate(e,t){return ni({identifier:this.identifier,groups:this.groups,errorSchema:this.errorSchema,annotations:ds(this.annotations,e,t),middlewares:this.middlewares})},annotateContext(e){return ni({identifier:this.identifier,groups:this.groups,errorSchema:this.errorSchema,annotations:Zr(this.annotations,e),middlewares:this.middlewares})}},ni=e=>{function t(){}return Object.setPrototypeOf(t,vpe),t.groups=e.groups,t.errorSchema=e.errorSchema,t.annotations=e.annotations,t.middlewares=e.middlewares,t},yp=e=>ni({groups:new Map,errorSchema:w0,annotations:xa(),middlewares:new Set}),FB=(e,t)=>{const n=eg(e.errorSchema.ast,new Map,Ov),r=Object.values(e.groups);for(const s of r){const a=eg(s.errorSchema.ast,n,Ov),o=Zr(e.annotations,s.annotations);t.onGroup({group:s,mergedAnnotations:o});const i=Object.values(s.endpoints);for(const c of i){if(t.predicate&&!t.predicate({endpoint:c,group:s}))continue;const u=eg(c.errorSchema.ast,a,Ov);t.onEndpoint({group:s,endpoint:c,middleware:new Set([...s.middlewares,...c.middlewares]),mergedAnnotations:Zr(o,c.annotations),payloads:c.payloadSchema._tag==="Some"?wpe(c.payloadSchema.value.ast):Spe,successes:eg(c.successSchema.ast,new Map,gpe),errors:u})}}},Spe=new Map,eg=(e,t,n)=>{const r=new Map(t);function s(a){if(I8(a))return;const o=LB(e.annotations);MJ(o)||(a=Vd(a,{...o,...a.annotations}));const i=n(a),c=jB(a),u=r.get(i);r.set(i,{description:(u?u.description:ye()).pipe(Ga(()=>_pe(a))),ast:(u?u.ast:ye()).pipe(Jr(l=>MB(l,a)),Ga(()=>!c&&Wfe(y0(a))?ye():Ce(a)))})}return R_(e).forEach(s),r},wpe=e=>{const t=new Map;function n(r){if(r._tag==="NeverKeyword")return;r=Vd(r,{...LB(e.annotations),...r.annotations});const s=bp(r),a=fpe(r)||hpe(r)?"multipart/form-data":s.contentType,o=t.get(a);o===void 0?t.set(a,{encoding:s,ast:r}):o.ast=ur.make([o.ast,r])}if(e._tag==="Union")for(const r of e.types)n(r);else n(e);return t},_pe=e=>{const t="to"in e?{...e.to.annotations,...e.annotations}:e.annotations;return Cd(t[Wi]??t[qd])};class Epe extends br("@effect/platform/HttpApi/AdditionalSchemas")(){}const Ru=e=>{const t=BB(e),n=[];for(let r=0;r<t.length;r++)if(Array.isArray(t[r][0])){const[s,a]=t[r];n.push([`${s[0]}[${s.slice(1).join("][")}]`,a])}else n.push(t[r]);return n},BB=e=>{const t=Symbol.iterator in e?Ct(e):Object.entries(e),n=[];for(const[r,s]of t)if(Array.isArray(s))for(let a=0;a<s.length;a++)s[a]!==void 0&&n.push([r,String(s[a])]);else if(typeof s=="object"){const a=BB(s);for(const[o,i]of a)n.push([[r,...typeof o=="string"?[o]:o],i])}else s!==void 0&&n.push([r,String(s)]);return n},UB=_e(Xhe(C,C)).annotations({identifier:"UrlParams"}),Tpe=[],Cpe=O(2,(e,t)=>{const n=Ru(t),r=new Set;for(let s=0;s<n.length;s++)r.add(n[s][0]);for(let s=0;s<e.length;s++)r.has(e[s][0])||n.push(e[s]);return n}),Ipe=O(2,(e,t)=>AT(e,Ru(t))),Ape=(e,t,n)=>{try{const r=new URL(e,Npe());for(let s=0;s<t.length;s++){const[a,o]=t[s];o!==void 0&&r.searchParams.append(a,o)}return n._tag==="Some"&&(r.hash=n.value),nt(r)}catch(r){return Ye(r)}},zB=e=>new URLSearchParams(e).toString(),Npe=()=>{if("location"in globalThis&&globalThis.location!==void 0&&globalThis.location.origin!==void 0&&globalThis.location.pathname!==void 0)return location.origin+location.pathname},Rpe=e=>{const t=Object.create(null);for(const[n,r]of e){const s=t[n];s===void 0?t[n]=r:typeof s=="string"?t[n]=[s,r]:s.push(r)}return{...t}},Ppe=Nu(C,UB,{decode(e){return Ru(new URLSearchParams(e))},encode(e){return zB(e)}}),Ope=e=>Nu(UB,e,{decode(t){return Rpe(t)},encode(t){return Ru(t)}}),Lpe=e=>kl(Ppe,Ope(e)),Qb=Symbol.for("@effect/platform/HttpBody");class MI{[Qb];constructor(){this[Qb]=Qb}[xt](){return this.toJSON()}toString(){return zt(this)}}class $pe extends MI{_tag="Empty";toJSON(){return{_id:"@effect/platform/HttpBody",_tag:"Empty"}}}const jpe=new $pe;class Mpe extends MI{body;contentType;_tag="Uint8Array";constructor(t,n){super(),this.body=t,this.contentType=n}get contentLength(){return this.body.length}toJSON(){return{_id:"@effect/platform/HttpBody",_tag:"Uint8Array",body:this.contentType.startsWith("text/")||this.contentType.endsWith("json")?new TextDecoder().decode(this.body):`Uint8Array(${this.body.length})`,contentType:this.contentType,contentLength:this.contentLength}}}const HB=(e,t)=>new Mpe(e,t??"application/octet-stream"),Dpe=new TextEncoder,qB=(e,t)=>HB(Dpe.encode(e),t??"text/plain"),Fpe=(e,t)=>qB(zB(e),t??"application/x-www-form-urlencoded");class Bpe extends MI{formData;_tag="FormData";constructor(t){super(),this.formData=t}toJSON(){return{_id:"@effect/platform/HttpBody",_tag:"FormData",formData:this.formData}}}const Upe=e=>new Bpe(e),zpe=Qb,Hpe=e=>Be(e,zpe),qpe=HB,yP=qB,Vpe=Fpe,xP=Symbol.for("@effect/platform/Cookies"),kP=Symbol.for("@effect/platform/Cookies/Cookie"),Gpe={[xP]:xP,..._1,toJSON(){return{_id:"@effect/platform/Cookies",cookies:pl(this.cookies,e=>e.toJSON())}},pipe(){return je(this,arguments)}},Kpe=e=>{const t=Object.create(Gpe);return t.cookies=e,t},Wpe=e=>{const t={};for(const n of e)t[n.name]=n;return Kpe(t)},Ype=e=>{const t=typeof e=="string"?[e]:e,n=[];for(const r of t){const s=Jpe(r.trim());Et(s)&&n.push(s.value)}return Wpe(n)};function Jpe(e){const t=e.split(";").map(i=>i.trim()).filter(i=>i!=="");if(t.length===0)return ye();const n=t[0].indexOf("=");if(n===-1)return ye();const r=t[0].slice(0,n);if(!Qpe.test(r))return ye();const s=t[0].slice(n+1),a=Xpe(s);if(t.length===1)return Ce(Object.assign(Object.create(vP),{name:r,value:a,valueEncoded:s}));const o={};for(let i=1;i<t.length;i++){const c=t[i],u=c.indexOf("="),l=u===-1?c:c.slice(0,u).trim(),d=u===-1?void 0:c.slice(u+1).trim();switch(l.toLowerCase()){case"domain":{if(d===void 0)break;const h=d.trim().replace(/^\./,"");h&&(o.domain=h);break}case"expires":{if(d===void 0)break;const h=new Date(d);isNaN(h.getTime())||(o.expires=h);break}case"max-age":{if(d===void 0)break;const h=parseInt(d,10);isNaN(h)||(o.maxAge=ID(h));break}case"path":{if(d===void 0)break;d[0]==="/"&&(o.path=d);break}case"priority":{if(d===void 0)break;switch(d.toLowerCase()){case"low":o.priority="low";break;case"medium":o.priority="medium";break;case"high":o.priority="high";break}break}case"httponly":{o.httpOnly=!0;break}case"secure":{o.secure=!0;break}case"partitioned":{o.partitioned=!0;break}case"samesite":{if(d===void 0)break;switch(d.toLowerCase()){case"lax":o.sameSite="lax";break;case"strict":o.sameSite="strict";break;case"none":o.sameSite="none";break}break}}}return Ce(Object.assign(Object.create(vP),{name:r,value:a,valueEncoded:s,options:Object.keys(o).length>0?o:void 0}))}const Qpe=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,vP={[kP]:kP,..._1,toJSON(){return{_id:"@effect/platform/Cookies/Cookie",name:this.name,value:this.value,options:this.options}}},Xpe=e=>{try{return decodeURIComponent(e)}catch{return e}},SP=Symbol.for("@effect/platform/Headers"),bm=Object.assign(Object.create(null),{[SP]:SP,[E1](e){return L_(this,K6(e,GB))}}),Mx=e=>Object.assign(Object.create(bm),e),VB=Object.create(bm),DI=e=>{if(e===void 0)return VB;if(Symbol.iterator in e){const n=Object.create(bm);for(const[r,s]of e)n[r.toLowerCase()]=s;return n}const t=Object.create(bm);for(const[n,r]of Object.entries(e))Array.isArray(r)?t[n.toLowerCase()]=r.join(", "):r!==void 0&&(t[n.toLowerCase()]=r);return t},Zpe=e=>Object.setPrototypeOf(e,bm),O_=O(3,(e,t,n)=>{const r=Mx(e);return r[t.toLowerCase()]=n,r}),ege=O(2,(e,t)=>Mx({...e,...DI(t)})),tge=O(2,(e,t)=>{const n=Mx(e);return Object.assign(n,t),n}),nge=O(2,(e,t)=>{const n=Mx(e),r=s=>{if(typeof s=="string"){const a=s.toLowerCase();a in e&&delete n[a]}else for(const a in e)s.test(a)&&delete n[a]};if(Array.isArray(t))for(let s=0;s<t.length;s++)r(t[s]);else r(t);return n}),L_=O(2,(e,t)=>{const n={...e},r=s=>{if(typeof s=="string"){const a=s.toLowerCase();a in e&&(n[a]=tP(e[a]))}else for(const a in e)s.test(a)&&(n[a]=tP(e[a]))};if(Array.isArray(t))for(let s=0;s<t.length;s++)r(t[s]);else r(t);return n}),GB=Ve("@effect/platform/Headers/currentRedactedNames",()=>tI(["authorization","cookie","set-cookie","x-api-key"])),rge=Symbol.for("@effect/platform/HttpClientError"),KB=rge;class WB extends SB(KB,"RequestError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return this.description?`${this.reason}: ${this.description} (${this.methodAndUrl})`:`${this.reason} error (${this.methodAndUrl})`}}class vo extends SB(KB,"ResponseError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){const t=`${this.response.status} ${this.methodAndUrl}`;return this.description?`${this.reason}: ${this.description} (${t})`:`${this.reason} error (${t})`}}const _h=Symbol.for("@effect/platform/HttpIncomingMessage"),sge=(e,t)=>{const n=e.headers["content-type"]??"";let r;if(n.includes("application/json"))try{r=Hs(e.json)}catch{}else if(n.includes("text/")||n.includes("urlencoded"))try{r=Hs(e.text)}catch{}const s={...t,headers:kT(e.headers),remoteAddress:e.remoteAddress.toJSON()};return r!==void 0&&(s.body=r),s},age=e=>Zpe({b3:`${e.traceId}-${e.spanId}-${e.sampled?"1":"0"}${e.parent._tag==="Some"?`-${e.parent.value.spanId}`:""}`,traceparent:`00-${e.traceId}-${e.spanId}-${e.sampled?"01":"00"}`}),wP=Symbol.for("@effect/platform/HttpClientRequest"),oge={[wP]:wP,..._1,toJSON(){return{_id:"@effect/platform/HttpClientRequest",method:this.method,url:this.url,urlParams:this.urlParams,hash:this.hash,headers:kT(this.headers),body:this.body.toJSON()}},pipe(){return je(this,arguments)}};function _a(e,t,n,r,s,a){const o=Object.create(oge);return o.method=e,o.url=t,o.urlParams=n,o.hash=r,o.headers=s,o.body=a,o}const ige=_a("GET","",Tpe,ye(),VB,jpe),Ji=e=>(t,n)=>pge(ige,{method:e,url:t,...n??void 0}),cge=Ji("GET"),uge=Ji("POST"),lge=Ji("PUT"),dge=Ji("PATCH"),fge=Ji("DELETE"),hge=Ji("HEAD"),mge=Ji("OPTIONS"),pge=O(2,(e,t)=>{let n=e;return t.method&&(n=yge(n,t.method)),t.url&&(n=JB(n,t.url)),t.headers&&(n=FI(n,t.headers)),t.urlParams&&(n=QB(n,t.urlParams)),t.hash&&(n=vge(n,t.hash)),t.body&&(n=BI(n,t.body)),t.accept&&(n=YB(n,t.accept)),t.acceptJson&&(n=bge(n)),n}),gge=O(3,(e,t,n)=>_a(e.method,e.url,e.urlParams,e.hash,O_(e.headers,t,n),e.body)),FI=O(2,(e,t)=>_a(e.method,e.url,e.urlParams,e.hash,ege(e.headers,t),e.body)),YB=O(2,(e,t)=>gge(e,"Accept",t)),bge=YB("application/json"),yge=O(2,(e,t)=>_a(t,e.url,e.urlParams,e.hash,e.headers,e.body)),JB=O(2,(e,t)=>{if(typeof t=="string")return _a(e.method,t,e.urlParams,e.hash,e.headers,e.body);const n=new URL(t.toString()),r=Ru(n.searchParams),s=n.hash?Ce(n.hash.slice(1)):ye();return n.search="",n.hash="",_a(e.method,n.toString(),r,s,e.headers,e.body)}),xge=O(2,(e,t)=>_a(e.method,t.endsWith("/")&&e.url.startsWith("/")?t+e.url.slice(1):t+e.url,e.urlParams,e.hash,e.headers,e.body)),kge=O(2,(e,t)=>_a(e.method,e.url,Ipe(e.urlParams,t),e.hash,e.headers,e.body)),QB=O(2,(e,t)=>_a(e.method,e.url,Cpe(e.urlParams,t),e.hash,e.headers,e.body)),vge=O(2,(e,t)=>_a(e.method,e.url,e.urlParams,Ce(t),e.headers,e.body)),BI=O(2,(e,t)=>{let n=e.headers;if(t._tag==="Empty"||t._tag==="FormData")n=nge(n,["Content-type","Content-length"]);else{const r=t.contentType;r&&(n=O_(n,"content-type",r));const s=t.contentLength;s&&(n=O_(n,"content-length",s.toString()))}return _a(e.method,e.url,e.urlParams,e.hash,n,t)}),Sge=O(2,(e,t)=>BI(e,Upe(t))),Eh=Symbol.for("@effect/platform/HttpClientResponse"),wge=(e,t)=>new _ge(e,t);class _ge extends IY{request;source;[_h];[Eh];constructor(t,n){super(),this.request=t,this.source=n,this[_h]=_h,this[Eh]=Eh}toJSON(){return sge(this,{_id:"@effect/platform/HttpClientResponse",request:this.request.toJSON(),status:this.status})}get status(){return this.source.status}get headers(){return DI(this.source.headers)}cachedCookies;get cookies(){return this.cachedCookies?this.cachedCookies:this.cachedCookies=Ype(this.source.headers.getSetCookie())}get remoteAddress(){return ye()}get stream(){return this.source.body?sfe(()=>this.source.body,t=>new vo({request:this.request,response:this,reason:"Decode",cause:t})):Zde(new vo({request:this.request,response:this,reason:"EmptyBody",description:"can not create stream from empty body"}))}get json(){return cue(this.text,{try:t=>t===""?null:JSON.parse(t),catch:t=>new vo({request:this.request,response:this,reason:"Decode",cause:t})})}textBody;get text(){return this.textBody??=mh({try:()=>this.source.text(),catch:t=>new vo({request:this.request,response:this,reason:"Decode",cause:t})}).pipe(dv,Hs)}get urlParamsBody(){return Ue(this.text,t=>iue({try:()=>Ru(new URLSearchParams(t)),catch:n=>new vo({request:this.request,response:this,reason:"Decode",cause:n})}))}formDataBody;get formData(){return this.formDataBody??=mh({try:()=>this.source.formData(),catch:t=>new vo({request:this.request,response:this,reason:"Decode",cause:t})}).pipe(dv,Hs)}arrayBufferBody;get arrayBuffer(){return this.arrayBufferBody??=mh({try:()=>this.source.arrayBuffer(),catch:t=>new vo({request:this.request,response:this,reason:"Decode",cause:t})}).pipe(dv,Hs)}}const Ege=O(2,(e,t)=>{const n=e.status;return t[n]?t[n](e):n>=200&&n<300&&t["2xx"]?t["2xx"](e):n>=300&&n<400&&t["3xx"]?t["3xx"](e):n>=400&&n<500&&t["4xx"]?t["4xx"](e):n>=500&&n<600&&t["5xx"]?t["5xx"](e):t.orElse(e)}),Tge=e=>`http.request.header.${e}`,Cge="http.request.method",Ige=e=>`http.response.header.${e}`,Age="http.response.status_code",Nge="server.address",Rge="server.port",Pge="url.full",Oge="url.path",Lge="url.scheme",$ge="url.query",_P=Symbol.for("@effect/platform/HttpClient"),UI=Hi("@effect/platform/HttpClient"),jge=Ve(Symbol.for("@effect/platform/HttpClient/tracerDisabledWhen"),()=>tI(Po)),Mge=Ve(Symbol.for("@effect/platform/HttpClient/currentTracerPropagation"),()=>tI(!0)),Dge=_u()("@effect/platform/HttpClient/SpanNameGenerator",{defaultValue:()=>e=>`http.client ${e.method}`}),Fge={[_P]:_P,pipe(){return je(this,arguments)},..._1,toJSON(){return{_id:"@effect/platform/HttpClient"}},get(e,t){return this.execute(cge(e,t))},head(e,t){return this.execute(hge(e,t))},post(e,t){return this.execute(uge(e,t))},put(e,t){return this.execute(lge(e,t))},patch(e,t){return this.execute(dge(e,t))},del(e,t){return this.execute(fge(e,t))},options(e,t){return this.execute(mge(e,t))}},zI=(e,t)=>{const n=Object.create(Fge);return n.preprocess=t,n.postprocess=e,n.execute=function(r){return e(t(r))},n},_0=Ve("@effect/platform/HttpClient/responseRegistry",()=>{if("FinalizationRegistry"in globalThis&&globalThis.FinalizationRegistry){const t=new FinalizationRegistry(n=>{n.abort()});return{register(n,r){t.register(n,r,n)},unregister(n){t.unregister(n)}}}const e=new Map;return{register(t,n){e.set(t,setTimeout(()=>n.abort(),5e3))},unregister(t){const n=e.get(t);n!==void 0&&(clearTimeout(n),e.delete(t))}}}),Bge=Ve("@effect/platform/HttpClient/scopedRequests",()=>new WeakMap),Uge=e=>zI(t=>Ue(t,n=>a0(r=>{const s=Bge.get(n),a=s??new AbortController,o=Ape(n.url,n.urlParams,n.hash);if(o._tag==="Left")return ro(new WB({request:n,reason:"InvalidUrl",cause:o.left}));const i=o.right;if(!r.getFiberRef(Due)||r.getFiberRef(jge)(n)){const l=e(n,i,a.signal,r);return s?l:o0(d=>ca(d(l),{onSuccess(h){return _0.register(h,a),Kt(new EP(h,a))},onFailure(h){return Zy(h)&&a.abort(),ha(h)}}))}const u=fa(r.currentContext,Dge);return _ue(u(n),{kind:"client",captureStackTrace:!1},l=>{l.attribute(Cge,n.method),l.attribute(Nge,i.origin),i.port!==""&&l.attribute(Rge,+i.port),l.attribute(Pge,i.toString()),l.attribute(Oge,i.pathname),l.attribute(Lge,i.protocol.slice(0,-1));const d=i.search.slice(1);d!==""&&l.attribute($ge,d);const h=r.getFiberRef(GB),m=L_(n.headers,h);for(const p in m)l.attribute(Tge(p),String(m[p]));return n=r.getFiberRef(Mge)?FI(n,age(l)):n,o0(p=>p(e(n,i,a.signal,r)).pipe(Eue(l),ca({onSuccess:y=>{l.attribute(Age,y.status);const g=L_(y.headers,h);for(const b in g)l.attribute(Ige(b),String(g[b]));return s?Kt(y):(_0.register(y,a),Kt(new EP(y,a)))},onFailure(y){return!s&&Zy(y)&&a.abort(),ha(y)}})))})})),Kt);class EP{original;controller;constructor(t,n){this.original=t,this.controller=n}[Eh]=Eh;[_h]=_h;applyInterrupt(t){return pn(()=>(_0.unregister(this.original),uue(t,()=>Bt(()=>{this.controller.abort()}))))}get request(){return this.original.request}get status(){return this.original.status}get headers(){return this.original.headers}get cookies(){return this.original.cookies}get remoteAddress(){return this.original.remoteAddress}get formData(){return this.applyInterrupt(this.original.formData)}get text(){return this.applyInterrupt(this.original.text)}get json(){return this.applyInterrupt(this.original.json)}get urlParamsBody(){return this.applyInterrupt(this.original.urlParamsBody)}get arrayBuffer(){return this.applyInterrupt(this.original.arrayBuffer)}get stream(){return ife(()=>(_0.unregister(this.original),e8(this.original.stream,Bt(()=>{this.controller.abort()}))))}toJSON(){return this.original.toJSON()}[xt](){return this.original[xt]()}}const{del:pze,execute:gze,get:bze,head:yze,options:xze,patch:kze,post:vze,put:Sze}=mue(UI),zge=O(2,(e,t)=>{const n=e;return zI(r=>t(n.postprocess(r)),n.preprocess)}),Hge=O(2,(e,t)=>{const n=e;return zI(n.postprocess,r=>It(n.preprocess(r),t))}),qge=e=>jue(UI,Ue(M4(),t=>It(e,n=>zge(n,D4(r=>Zr(t,r)))))),Vge=UI,Gge=Hge,Kge=Ji,Wge=FI,Yge=JB,Jge=xge,Qge=QB,Xge=kge,Zge=BI,ebe=Sge,tbe=Ege,$_=e=>e!=="GET"&&e!=="HEAD"&&e!=="OPTIONS",nbe=(e,t)=>$l(function*(){const n=yield*M4(),r=t.httpClient.pipe(t?.baseUrl===void 0?Qe:Gge(Jge(t.baseUrl.toString())));FB(e,{predicate:t?.predicate,onGroup(s){t.onGroup?.(s)},onEndpoint(s){const{endpoint:a,errors:o,successes:i}=s,c=obe(a.path),u={orElse:lbe},l=tbe(u);o.forEach(({ast:g},b)=>{if(g._tag==="None"){u[b]=dbe;return}const x=TP(g.value);u[b]=k=>Ue(x(k),ro)}),i.forEach(({ast:g},b)=>{u[b]=g._tag==="None"?fbe:TP(g.value)});const d=a.pathSchema.pipe(Jr(vf)),h=a.payloadSchema.pipe(Jr(g=>$_(a.method)?vf(mbe(g)):vf(g))),m=a.headersSchema.pipe(Jr(vf)),p=a.urlParamsSchema.pipe(Jr(vf)),y=H4(function*(g){let b=Kge(a.method)(a.path);if(g&&g.path){const _=d._tag==="Some"?yield*d.value(g.path):g.path;b=Yge(b,c(_))}if(g&&g.payload instanceof FormData)b=ebe(b,g.payload);else if(h._tag==="Some")if($_(a.method)){const _=yield*h.value(g.payload);b=Zge(b,_)}else{const _=yield*h.value(g.payload);b=Qge(b,_)}m._tag==="Some"&&(b=Wge(b,yield*m.value(g.headers))),p._tag==="Some"&&(b=Xge(b,yield*p.value(g.urlParams)));const x=yield*r.execute(b),k=yield*t.transformResponse===void 0?l(x):t.transformResponse(l(x));return g?.withResponse===!0?[k,x]:k},D4(g=>Zr(n,g)));t.onEndpoint({...s,endpointFn:y})}})}),rbe=(e,t)=>Ue(Vge,n=>sbe(e,{...t,httpClient:t?.transformClient?t.transformClient(n):n})),sbe=(e,t)=>{const n={};return nbe(e,{...t,onGroup({group:r}){r.topLevel||(n[r.identifier]={})},onEndpoint({endpoint:r,endpointFn:s,group:a}){(a.topLevel?n:n[a.identifier])[r.name]=s}}).pipe(It(()=>n))},abe=/:(\w+)\??/g,obe=e=>{const t=e.split(abe),n=t.length;return n===1?r=>e:r=>{let s=t[0];for(let a=1;a<n;a++)a%2===0?s+=t[a]:s+=r[t[a]];return s}},TP=e=>{const t=bp(e),n=zhe(XB(e,t));return r=>Ue(r.arrayBuffer,n)},ibe=Nu(Tn,pme,{decode(e){return new Uint8Array(e)},encode(e){return e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}}),j_=Nu(Tn,C,{decode(e){return new TextDecoder().decode(e)},encode(e){const t=new TextEncoder().encode(e);return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}}),cbe=md(C,Tn,{strict:!0,decode:(e,t,n)=>e===""?gs(void 0):XR({try:()=>JSON.parse(e),catch:()=>new dr(n,e,"Could not parse JSON")}),encode:(e,t,n)=>e===void 0?gs(""):XR({try:()=>JSON.stringify(e),catch:()=>new dr(n,e,"Could not encode as JSON")})}),ube=kl(j_,cbe),XB=(e,t)=>{if(e._tag==="Union")return tn(...e.types.map(r=>XB(r,bp(r,t))));const n=Nt(e);switch(t.kind){case"Json":return kl(ube,n);case"UrlParams":return kl(j_,Lpe(n));case"Uint8Array":return kl(ibe,n);case"Text":return kl(j_,n)}},lbe=e=>ro(new vo({reason:"Decode",request:e.request,response:e})),dbe=e=>ro(new vo({reason:"StatusCode",request:e.request,response:e})),fbe=e=>bt,hbe=CI(Hpe),mbe=e=>{const t=e.ast._tag==="Union"?e.ast.types:[e.ast];return tn(...t.map(pbe))},Lv=Ve("@effect/platform/HttpApiClient/bodyFromPayloadCache",()=>new WeakMap),pbe=e=>{if(Lv.has(e))return Lv.get(e);const t=Nt(e),n=bp(e),r=md(hbe,t,{decode(s,a,o){return jc(new k_(o,s,"encode only schema"))},encode(s,a,o){switch(n.kind){case"Json":try{return gs(yP(JSON.stringify(s),n.contentType))}catch{return jc(new dr(o,s,"Could not encode as JSON"))}case"Text":return typeof s!="string"?jc(new dr(o,s,"Expected a string")):gs(yP(s,n.contentType));case"UrlParams":return gs(Vpe(Ru(s)));case"Uint8Array":return s instanceof Uint8Array?gs(qpe(s,n.contentType)):jc(new dr(o,s,"Expected a Uint8Array"))}}});return Lv.set(e,r),r},gbe=e=>{if(Array.isArray(e))return gR(e);const t=Object.create(yce.prototype);for(const n in e){const r=e[n];Array.isArray(r)&&(t[n]=gR(r))}return t},bbe=()=>(e,t)=>{const n=br(e)();n.layer=V4(n,rbe(t.api,t)).pipe(G4(t.httpClient));const r=t.runtime??OB;n.runtime=r(n.layer);const s=pP(({endpoint:o,group:i,withResponse:c})=>n.runtime.fn()(H4(function*(u){const d=(yield*n)[i][o]({...u,withResponse:c});return yield*u.reactivityKeys?r8(d,u.reactivityKeys):d})));n.mutation=(o,i,c)=>s(new ybe({group:o,endpoint:i,withResponse:c?.withResponse??!1}));const a=pP(o=>{let i=n.runtime.atom(Ue(n,c=>c[o.group][o.endpoint](o)));return o.timeToLive&&(i=CD(o.timeToLive)?NB(i,o.timeToLive):jI(i)),o.reactivityKeys?n.runtime.factory.withReactivity(o.reactivityKeys)(i):i});return n.query=(o,i,c)=>a(new xbe({group:o,endpoint:i,path:c.path&&Yp(c.path),urlParams:c.urlParams&&Yp(c.urlParams),payload:c.payload&&Yp(c.payload),headers:c.headers&&Yp(c.headers),withResponse:c.withResponse??!1,reactivityKeys:c.reactivityKeys?gbe(c.reactivityKeys):void 0,timeToLive:c.timeToLive?qs(c.timeToLive):void 0})),n};class ybe extends A4{[Ze](t){return this.group===t.group&&this.endpoint===t.endpoint&&this.withResponse===t.withResponse}[Xe](){return B(Wt(`${this.group}/${this.endpoint}/${this.withResponse}`),Mt(this))}}class xbe extends A4{[Ze](t){return this.group===t.group&&this.endpoint===t.endpoint&&Fe(this.path,t.path)&&Fe(this.urlParams,t.urlParams)&&Fe(this.payload,t.payload)&&Fe(this.headers,t.headers)&&Fe(this.withResponse,t.withResponse)&&Fe(this.reactivityKeys,t.reactivityKeys)&&Fe(this.timeToLive,t.timeToLive)}[Xe](){return B(Wt(`${this.group}/${this.endpoint}`),tt(Pe(this.path)),tt(Pe(this.urlParams)),tt(Pe(this.payload)),tt(Pe(this.headers)),tt(Pe(this.withResponse)),tt(Pe(this.reactivityKeys)),tt(Pe(this.timeToLive)),Mt(this))}}const kbe=(e,t)=>{const n=t.definitionPath??"#/$defs/",r=i=>n+i,s=t.target??"jsonSchema7",a=t.topLevelReferenceStrategy??"keep";return fn(e,t.definitions,"handle-identifier",[],{getRef:r,target:s,topLevelReferenceStrategy:a,additionalPropertiesStrategy:"strict"},"handle-annotation","handle-errors")},Th={$id:"/schemas/never",not:{}},vc={$id:"/schemas/any"},ZB={$id:"/schemas/unknown"},eU={$id:"/schemas/void"},vbe={$id:"/schemas/object",anyOf:[{type:"object"},{type:"array"}]},Sbe={$id:"/schemas/%7B%7D",anyOf:[{type:"object"},{type:"array"}]};function tU(e){if(e!==void 0)return jr(xI(e))}function nU(e){if(e!==void 0)return jr(yI(e))}function rU(e){return e!==void 0?Pfe(e):ye()}function wbe(e,t){return q8(e,!1)(t)}function sU(e){if(e!==void 0)return jr(Rfe(e))}function _be(e,t){const n=q8(e,!1),r=QM(t,s=>n(s).pipe(qM(E0)));return r.length>0?r:void 0}function CP(e,t,n){if(t!==void 0)switch(e._tag){case"StringKeyword":return t!==p0.annotations[n]?t:void 0;case"NumberKeyword":return t!==g0.annotations[n]?t:void 0;case"BooleanKeyword":return t!==b0.annotations[n]?t:void 0}return t}function E0(e,t=new Set){if(e===null||typeof e=="string"||typeof e=="number"||typeof e=="boolean")return!0;if(Array.isArray(e)||typeof e=="object"){if(t.has(e))return!1;t.add(e);try{if(Array.isArray(e))return e.every(r=>E0(r,t));const n=Object.getPrototypeOf(e);return n!==null&&n!==Object.prototype||Object.getOwnPropertySymbols(e).length>0?!1:Object.values(e).every(r=>E0(r,t))}finally{t.delete(e)}}return!1}function aU(e,t,n,r,s){const a={};if(t!==void 0&&(a.description=t),n!==void 0&&(a.title=n),Et(r)){const o=wbe(e,r.value);Et(o)&&E0(o.value)&&(a.default=o.value)}if(s!==void 0){const o=_be(e,s);o!==void 0&&(a.examples=o)}if(Object.keys(a).length!==0)return a}function $v(e,t){return aU(e,tU(t),nU(t),rU(t),sU(t))}function oU(e){return aU(e,CP(e,tU(e),Wi),CP(e,nU(e),Cs),rU(e),sU(e))}function jv(e,t){return t?"$ref"in e?{allOf:[e],...t}:{...e,...t}:e}const T0=e=>{if(Cn(E8(e)))return She(e,T0,t=>T0(t.from))},Ebe=e=>e.annotations[hI]===Ufe,Tbe=(e,t)=>Xc(e)&&e.annotations[hI]===_fe?"type"in t&&t.type!=="integer":"type"in t||"oneOf"in t||"anyOf"in t||"$ref"in t,Cbe=(e,t,n)=>{const r={...e,...oU(n),...t};r.allOf??=[];const s=(a,o)=>{a in t&&a in e&&(r.allOf.unshift({[a]:e[a]}),r.allOf=r.allOf.filter(o))};return s("minLength",a=>a.minLength>t.minLength),s("maxLength",a=>a.maxLength<t.maxLength),s("pattern",a=>a.pattern!==t.pattern),s("minItems",a=>a.minItems>t.minItems),s("maxItems",a=>a.maxItems<t.maxItems),s("minimum",a=>a.minimum>t.minimum),s("maximum",a=>a.maximum<t.maximum),s("exclusiveMinimum",a=>a.exclusiveMinimum>t.exclusiveMinimum),s("exclusiveMaximum",a=>a.exclusiveMaximum<t.exclusiveMaximum),s("multipleOf",a=>a.multipleOf!==t.multipleOf),r.allOf.length===0&&delete r.allOf,r};function Ibe(e){switch(e.target){case"jsonSchema7":return!1;case"jsonSchema2019-09":case"jsonSchema2020-12":case"openApi3.1":return!0}}function Abe(e){switch(e.additionalPropertiesStrategy){case"allow":return!0;case"strict":return!1}}function Ht(e,t){return iU(e,oU(t))}function iU(e,t){return t===void 0||Object.keys(t).length===0?e:"$ref"in e?{allOf:[e],...t}:{...e,...t}}function M_(e){const t=jr(C8(e));if(t===void 0){if(P8(e))return M_(e.f());if(O8(e)&&m_(e.from)&&zfe(e.to)){const n=e.to,r=_x(n);if(Et(r))return M_(n)}}return t}function fn(e,t,n,r,s,a,o){if(n==="handle-identifier"&&(s.topLevelReferenceStrategy!=="skip"||P8(e))){const c=M_(e);if(c!==void 0){const u=c.replace(/~/ig,"~0").replace(/\//ig,"~1"),l={$ref:s.getRef(u)};return DJ(t,c)||(t[c]=l,t[c]=fn(e,t,"ignore-identifier",r,s,"handle-annotation",o)),l}}if(a==="handle-annotation"){const c=E8(e);if(Et(c)){const u=c.value;if(Tbe(e,u))return e._tag==="Declaration"?Ht(u,e):u;if(e._tag==="Refinement"){const l=x_(e);return l===void 0?Cbe(fn(e.from,t,n,r,s,"handle-annotation",o),u,e):fn(l,t,n,r,s,"handle-annotation",o)}else return{...fn(e,t,n,r,s,"ignore-annotation",o),...u}}}const i=_x(e);if(Et(i))return fn(i.value,t,n,r,s,"handle-annotation",o);switch(e._tag){case"Declaration":case"UndefinedKeyword":case"BigIntKeyword":case"UniqueSymbol":case"SymbolKeyword":{if(o==="ignore-errors")return Ht(vc,e);throw new Error(zR(r,e))}case"Suspend":{if(n==="handle-identifier"){if(o==="ignore-errors")return Ht(vc,e);throw new Error(bfe(r,e))}return fn(e.f(),t,"ignore-identifier",r,s,"handle-annotation",o)}case"NeverKeyword":return Ht(Th,e);case"VoidKeyword":return Ht(eU,e);case"UnknownKeyword":return Ht(ZB,e);case"AnyKeyword":return Ht(vc,e);case"ObjectKeyword":return Ht(vbe,e);case"StringKeyword":return Ht({type:"string"},e);case"NumberKeyword":return Ht({type:"number"},e);case"BooleanKeyword":return Ht({type:"boolean"},e);case"Literal":{const c=e.literal;if(c===null)return Ht({type:"null"},e);if(jn(c))return Ht({type:"string",enum:[c]},e);if(ba(c))return Ht({type:"number",enum:[c]},e);if(ru(c))return Ht({type:"boolean",enum:[c]},e);if(o==="ignore-errors")return Ht(vc,e);throw new Error(zR(r,e))}case"Enums":{const c=e.enums.map(u=>({type:ba(u[1])?"number":"string",title:u[0],enum:[u[1]]}));return c.length>=1?Ht({$comment:"/schemas/enums",anyOf:c},e):Ht(Th,e)}case"TupleType":{const c=e.elements.map((m,p)=>jv(fn(m.type,t,"handle-identifier",r.concat(p),s,"handle-annotation",o),$v(m.type,m))),u=e.rest.map(m=>jv(fn(m.type,t,"handle-identifier",r,s,"handle-annotation",o),$v(m.type,m))),l={type:"array"},d=e.elements.length;d>0&&(l.minItems=d-e.elements.filter(m=>m.isOptional).length,s.target==="jsonSchema7"?l.items=c:l.prefixItems=c);const h=u.length;if(h>0){const m=u[0];if(h===1&&e.elements.every(y=>y.type===e.rest[0].type)?s.target==="jsonSchema7"?l.items=m:(l.items=m,delete l.prefixItems):s.target==="jsonSchema7"?l.additionalItems=m:l.items=m,h>1){if(o==="ignore-errors")return Ht(vc,e);throw new Error(yfe(r))}}else d>0?s.target==="jsonSchema7"?l.additionalItems=!1:l.items=!1:l.maxItems=0;return Ht(l,e)}case"TypeLiteral":{if(e.propertySignatures.length===0&&e.indexSignatures.length===0)return Ht(Sbe,e);const c={type:"object",required:[],properties:{},additionalProperties:Abe(s)};let u,l;for(const d of e.indexSignatures){const h=T0(d.type)??d.type,m=d.parameter;switch(m._tag){case"StringKeyword":{c.additionalProperties=fn(h,t,"handle-identifier",r,s,"handle-annotation",o);break}case"TemplateLiteral":{u=fn(h,t,"handle-identifier",r,s,"handle-annotation",o),l={type:"string",pattern:y_(m).source};break}case"Refinement":{u=fn(h,t,"handle-identifier",r,s,"handle-annotation",o),l=fn(m,t,"handle-identifier",r,s,"handle-annotation",o);break}case"SymbolKeyword":{const p=r.concat("[symbol]");c.additionalProperties=fn(h,t,"handle-identifier",p,s,"handle-annotation",o),l=fn(m,t,"handle-identifier",p,s,"handle-annotation",o);break}}}for(let d=0;d<e.propertySignatures.length;d++){const h=e.propertySignatures[d],m=h.name;if(jn(m)){const p=T0(h.type),y=p??h.type;c.properties[m]=jv(fn(y,t,"handle-identifier",r.concat(h.name),s,"handle-annotation",o),$v(y,h)),!h.isOptional&&p===void 0&&c.required.push(m)}else{if(o==="ignore-errors")return Ht(vc,e);throw new Error(xfe(m,r))}}return u!==void 0&&(delete c.additionalProperties,c.patternProperties={"":u}),l!==void 0&&(c.propertyNames=l),Ht(c,e)}case"Union":{const c=e.types.map(l=>fn(l,t,"handle-identifier",r,s,"handle-annotation",o)),u=Lbe(c);switch(u.length){case 0:return Th;case 1:return Ht(u[0],e);default:return Ht({anyOf:u},e)}}case"Refinement":return fn(e.from,t,n,r,s,"handle-annotation",o);case"TemplateLiteral":{const c=y_(e);return Ht({type:"string",title:String(e),description:"a template literal",pattern:c.source},e)}case"Transformation":{if(Ebe(e.from)){const u={type:"string",contentMediaType:"application/json"};return Ibe(s)&&(u.contentSchema=fn(e.to,t,n,r,s,"handle-annotation",o)),u}const c=fn(e.from,t,n,r,s,"handle-annotation",o);if(e.transformation._tag==="TypeLiteralTransformation"&&IP(c)){const u=fn(e.to,{},"ignore-identifier",r,s,"handle-annotation","ignore-errors");if(IP(u))for(const l of e.transformation.propertySignatureTransformations){const d=l.to,h=l.from;if(jn(d)&&jn(h)){const m=u.properties[d];if(Gh(m)){const p=c.properties[h];if(Gh(p)){const y={};jn(m.title)&&(y.title=m.title),jn(m.description)&&(y.description=m.description),Array.isArray(m.examples)&&(y.examples=m.examples),Object.hasOwn(m,"default")&&m.default!==void 0&&(y.default=m.default),c.properties[h]=iU(p,y)}}}}}return Ht(c,e)}}}function IP(e){return Gh(e)&&e.type==="object"&&Gh(e.properties)}function Nbe(e){return e===Th||Be(e,"$id")&&e.$id===Th.$id&&Object.keys(e).length===3&&e.title===lp.annotations[Cs]}function Rbe(e){return"$id"in e&&e.$id===vc.$id}function Pbe(e){return"$id"in e&&e.$id===ZB.$id}function Obe(e){return"$id"in e&&e.$id===eU.$id}function AP(e){return Be(e,"enum")&&"type"in e&&Object.keys(e).length===2}function Lbe(e){const t=[];for(const n of e)if(!Nbe(n)){if(Rbe(n)||Pbe(n)||Obe(n))return[n];if(AP(n)&&t.length>0){const r=t[t.length-1];if(AP(r)&&r.type===n.type){t[t.length-1]={type:r.type,enum:[...r.enum,...n.enum]};continue}}t.push(n)}return t}var NP=aK();function cU(e){NP.unstable_scheduleCallback(NP.unstable_LowPriority,e)}const xp=E.createContext(IB({scheduleTask:cU,defaultIdleTTL:400})),$be=e=>{const t=E.useRef(null);return t.current===null&&(t.current={registry:IB({scheduleTask:e.scheduleTask??cU,initialValues:e.initialValues,timeoutResolution:e.timeoutResolution,defaultIdleTTL:e.defaultIdleTTL})}),E.useEffect(()=>(t.current?.timeout!==void 0&&clearTimeout(t.current.timeout),()=>{t.current.timeout=setTimeout(()=>{t.current?.registry.dispose(),t.current=null},500)}),[t]),E.createElement(xp.Provider,{value:t.current.registry},e?.children)},RP=Ve("@effect-atom/atom-react/storeRegistry",()=>new WeakMap);function jbe(e,t){let n=RP.get(e);n===void 0&&(n=new WeakMap,RP.set(e,n));const r=n.get(t);if(r!==void 0)return r;const s={subscribe(a){return e.subscribe(t,a)},snapshot(){return e.get(t)},getServerSnapshot(){return lpe(t,e)}};return n.set(t,s),s}function Mbe(e,t){const n=jbe(e,t);return E.useSyncExternalStore(n.subscribe,n.snapshot,n.getServerSnapshot)}const Qi=(e,t)=>{const n=E.useContext(xp);return Mbe(n,e)};function uU(e,t){E.useEffect(()=>e.mount(t),[t,e])}function Dbe(e,t,n){return n?.mode==="promise"||n?.mode==="promiseExit"?E.useCallback(r=>{e.set(t,r);const s=wue(Wme(e,t,{suspendOnWaiting:!0}));return n.mode==="promise"?s.then(Fbe):s},[e,t,n.mode]):E.useCallback(r=>{e.set(t,typeof r=="function"?r(e.get(t)):r)},[e,t])}const Fbe=e=>{if(IC(e))return e.value;throw n4(e.cause)},Dt=(e,t)=>{const n=E.useContext(xp);return uU(n,e),Dbe(n,e,t)},Bbe=e=>{const t=E.useContext(xp);return uU(t,e),E.useCallback(()=>{t.refresh(e)},[t,e])},Ube="@effect/platform/FetchHttpClient/Fetch",zbe="@effect/platform/FetchHttpClient/FetchOptions",Hbe=Uge((e,t,n,r)=>{const s=r.getFiberRef(K4),a=s.unsafeMap.get(Ube)??globalThis.fetch,o=s.unsafeMap.get(zbe)??{},i=o.headers?tge(DI(o.headers),e.headers):e.headers,c=u=>It(mh({try:()=>a(t,{...o,method:e.method,headers:i,body:u,duplex:e.body._tag==="Stream"?"half":void 0,signal:n}),catch:l=>new WB({request:e,reason:"Transport",cause:l})}),l=>wge(e,l));switch(e.body._tag){case"Raw":case"Uint8Array":return c(e.body.body);case"FormData":return c(e.body.formData);case"Stream":return Ue(cfe(e.body.stream),c)}return c(void 0)}),qbe=qge(Kt(Hbe)),Vbe=qbe,Gbe=Symbol.for("@effect/platform/HttpApiMiddleware/Security"),PP=e=>Be(e,Gbe),Kbe=e=>e.endsWith("/")?e.slice(0,-1):e,Wbe=O(2,(e,t)=>(t=Kbe(t),e==="/"?t:t+e)),Ybe=Wbe,Jbe=(e,t)=>kbe(e,{definitions:t.defs,definitionPath:t.defsPath??"#/components/schemas/",target:"openApi3.1",topLevelReferenceStrategy:t.topLevelReferenceStrategy});class lU extends br("@effect/platform/OpenApi/Identifier")(){}class Xb extends br("@effect/platform/OpenApi/Title")(){}class dU extends br("@effect/platform/OpenApi/Version")(){}class Ch extends br("@effect/platform/OpenApi/Description")(){}class fU extends br("@effect/platform/OpenApi/License")(){}class D_ extends br("@effect/platform/OpenApi/ExternalDocs")(){}class hU extends br("@effect/platform/OpenApi/Servers")(){}class mU extends br("@effect/platform/OpenApi/Format")(){}class F_ extends br("@effect/platform/OpenApi/Summary")(){}class pU extends br("@effect/platform/OpenApi/Deprecated")(){}class Zb extends br("@effect/platform/OpenApi/Override")(){}class B_ extends _u()("@effect/platform/OpenApi/Exclude",{defaultValue:Po}){}class ey extends br("@effect/platform/OpenApi/Transform")(){}const Qbe=e=>{const t=Object.entries(e);return n=>{let r=xa();for(const[s,a]of t)n[s]!==void 0&&(r=ds(r,a,n[s]));return r}},Xbe=Qbe({identifier:lU,title:Xb,version:dU,description:Ch,license:fU,summary:F_,deprecated:pU,externalDocs:D_,servers:hU,format:mU,override:Zb,exclude:B_,transform:ey}),OP=Ve("@effect/platform/OpenApi/apiCache",()=>new WeakMap);function qn(e,t,n){const r=qi(e,t);Et(r)&&n(r.value)}const Zbe=(e,t)=>{const n=OP.get(e);if(n!==void 0)return n;const r={};let s={openapi:"3.1.0",info:{title:mf(e.annotations,Xb,()=>"Api"),version:mf(e.annotations,dU,()=>"0.0.1")},paths:{},components:{schemas:r,securitySchemes:{}},security:[],tags:[]};function a(i){return Jbe(i,{defs:r})}function o(i,c){s.components.securitySchemes[i]===void 0&&(s.components.securitySchemes[i]=eye(c))}return qn(e.annotations,Epe,i=>{i.forEach(c=>a(c.ast))}),qn(e.annotations,Ch,i=>{s.info.description=i}),qn(e.annotations,fU,i=>{s.info.license=i}),qn(e.annotations,F_,i=>{s.info.summary=i}),qn(e.annotations,hU,i=>{s.servers=[...i]}),e.middlewares.forEach(i=>{if(PP(i))for(const[c,u]of Object.entries(i.security))o(c,u),s.security.push({[c]:[]})}),FB(e,{onGroup({group:i}){if(fa(i.annotations,B_))return;let c={name:mf(i.annotations,Xb,()=>i.identifier)};qn(i.annotations,Ch,u=>{c.description=u}),qn(i.annotations,D_,u=>{c.externalDocs=u}),qn(i.annotations,Zb,u=>{Object.assign(c,u)}),qn(i.annotations,ey,u=>{c=u(c)}),s.tags.push(c)},onEndpoint({endpoint:i,errors:c,group:u,mergedAnnotations:l,middleware:d,payloads:h,successes:m}){if(fa(l,B_))return;let p={tags:[mf(u.annotations,Xb,()=>u.identifier)],operationId:mf(i.annotations,lU,()=>u.topLevel?i.name:`${u.identifier}.${i.name}`),parameters:[],security:[],responses:{}};function y(_,S){for(const[w,{ast:T,description:A}]of _)p.responses[w]||(p.responses[w]={description:Yt(A,S)},T.pipe(qM(L=>!jB(L)),Jr(L=>{const R=bp(L);p.responses[w].content={[R.contentType]:{schema:a(L)}}})))}function g(_,S){if(Et(_)){const w=a(_.value.ast);"properties"in w&&Object.entries(w.properties).forEach(([T,A])=>{p.parameters.push({name:T,in:S,schema:A,required:w.required.includes(T),...A.description!==void 0?{description:A.description}:void 0})})}}qn(i.annotations,Ch,_=>{p.description=_}),qn(i.annotations,F_,_=>{p.summary=_}),qn(i.annotations,pU,_=>{p.deprecated=_}),qn(i.annotations,D_,_=>{p.externalDocs=_}),d.forEach(_=>{if(PP(_))for(const[S,w]of Object.entries(_.security))o(S,w),p.security.push({[S]:[]})});const b=$_(i.method);if(b&&h.size>0){const _={};h.forEach(({ast:S},w)=>{_[w]={schema:a(S)}}),p.requestBody={content:_,required:!0}}g(i.pathSchema,"path"),b||g(i.payloadSchema,"query"),g(i.headersSchema,"header"),g(i.urlParamsSchema,"query"),y(m,()=>"Success"),y(c,()=>"Error");const x=i.path.replace(/:(\w+)\??/g,"{$1}"),k=i.method.toLowerCase();s.paths[x]||(s.paths[x]={}),qn(i.annotations,Zb,_=>{Object.assign(p,_)}),qn(i.annotations,ey,_=>{p=_(p)}),s.paths[x][k]=p}}),qn(e.annotations,Zb,i=>{Object.assign(s,i)}),qn(e.annotations,ey,i=>{s=i(s)}),OP.set(e,s),s},eye=e=>{const t={};switch(qn(e.annotations,Ch,n=>{t.description=n}),e._tag){case"Basic":return{...t,type:"http",scheme:"basic"};case"Bearer":{const n=qi(e.annotations,mU).pipe(Jr(r=>({bearerFormat:r})),jr);return{...t,type:"http",scheme:"bearer",...n}}case"ApiKey":return{...t,type:"apiKey",name:e.key,in:e.in}}},LP=Symbol.for("@effect/platform/HttpApiEndpoint"),tye={[LP]:LP,pipe(){return je(this,arguments)},addSuccess(e,t){return e=t?.status?e.annotations(wa({status:t.status})):e,Ps({...this,successSchema:this.successSchema===P_?e:Ni(this.successSchema,e)})},addError(e,t){return Ps({...this,errorSchema:Ni(this.errorSchema,t?.status?e.annotations(wa({status:t.status})):e)})},setPayload(e){return Ps({...this,payloadSchema:Ce(e)})},setPath(e){return Ps({...this,pathSchema:Ce(e)})},setUrlParams(e){return Ps({...this,urlParamsSchema:Ce(e)})},setHeaders(e){return Ps({...this,headersSchema:Ce(e)})},prefix(e){return Ps({...this,path:Ybe(this.path,e)})},middleware(e){return Ps({...this,errorSchema:Ni(this.errorSchema,e.failure),middlewares:new Set([...this.middlewares,e])})},annotate(e,t){return Ps({...this,annotations:ds(this.annotations,e,t)})},annotateContext(e){return Ps({...this,annotations:Zr(this.annotations,e)})}},Ps=e=>Object.assign(Object.create(tye),e),kp=e=>(t,...n)=>n.length===1?Ps({name:t,path:n[0],method:e,pathSchema:ye(),urlParamsSchema:ye(),payloadSchema:ye(),headersSchema:ye(),successSchema:P_,errorSchema:pm,annotations:xa(),middlewares:new Set}):(r,...s)=>{let a=r[0].replace(":","::"),o=ye();if(s.length>0){const i={};for(let c=0;c<s.length;c++){const u=s[c],l=ppe(u.ast)??String(c),d=u.ast._tag==="PropertySignatureTransformation"&&u.ast.from.isOptional||u.ast._tag==="PropertySignatureDeclaration"&&u.ast.isOptional;i[l]=u,a+=`:${l}${d?"?":""}${r[c+1].replace(":","::")}`}o=Ce(q(i))}return Ps({name:t,path:a,method:e,pathSchema:o,urlParamsSchema:ye(),payloadSchema:ye(),headersSchema:ye(),successSchema:P_,errorSchema:pm,annotations:xa(),middlewares:new Set})},Jn=kp("GET"),Dn=kp("POST"),Dx=kp("PUT"),U_=kp("PATCH"),Bi=kp("DELETE"),$P=Symbol.for("@effect/platform/HttpApiGroup"),nye={[$P]:$P,add(e){return Oa({identifier:this.identifier,topLevel:this.topLevel,endpoints:{...this.endpoints,[e.name]:e},errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},addError(e,t){return Oa({identifier:this.identifier,topLevel:this.topLevel,endpoints:this.endpoints,errorSchema:Ni(this.errorSchema,t?.status?e.annotations(wa({status:t.status})):e),annotations:this.annotations,middlewares:this.middlewares})},prefix(e){return Oa({identifier:this.identifier,topLevel:this.topLevel,endpoints:pl(this.endpoints,t=>t.prefix(e)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},middleware(e){return Oa({identifier:this.identifier,topLevel:this.topLevel,endpoints:this.endpoints,errorSchema:Ni(this.errorSchema,e.failure),annotations:this.annotations,middlewares:new Set([...this.middlewares,e])})},middlewareEndpoints(e){return Oa({identifier:this.identifier,topLevel:this.topLevel,endpoints:pl(this.endpoints,t=>t.middleware(e)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},annotateContext(e){return Oa({identifier:this.identifier,topLevel:this.topLevel,endpoints:this.endpoints,errorSchema:this.errorSchema,annotations:Zr(this.annotations,e),middlewares:this.middlewares})},annotate(e,t){return Oa({identifier:this.identifier,topLevel:this.topLevel,endpoints:this.endpoints,errorSchema:this.errorSchema,annotations:ds(this.annotations,e,t),middlewares:this.middlewares})},annotateEndpointsContext(e){return Oa({identifier:this.identifier,topLevel:this.topLevel,endpoints:pl(this.endpoints,t=>t.annotateContext(e)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},annotateEndpoints(e,t){return Oa({identifier:this.identifier,topLevel:this.topLevel,endpoints:pl(this.endpoints,n=>n.annotate(e,t)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},pipe(){return je(this,arguments)}},Oa=e=>{function t(){}return Object.setPrototypeOf(t,nye),Object.assign(t,e)},Xi=(e,t)=>Oa({identifier:e,topLevel:!1,endpoints:jJ(),errorSchema:pm,annotations:xa(),middlewares:new Set}),gU=fme.pipe(lme()),rye=H(gU),sye=q({code:gU,interactionMode:H(ie("live","live_form","detach"))}),aye=q({responseJson:H(C),interactionMode:H(ie("live","live_form","detach"))}),At=it,oye=q({inputTypePreview:H(C),outputTypePreview:H(C),inputSchema:H(Tn),outputSchema:H(Tn),exampleInput:H(Tn),exampleOutput:H(Tn)}),HI=q({path:C,sourceKey:C,description:H(C),interaction:H(tn(ie("auto"),ie("required"))),elicitation:H(Tn),contract:H(oye),pluginKind:H(C),pluginData:H(Tn)}),iye=q({namespace:C,displayName:H(C),toolCount:H(it)});var tg={exports:{}},Mv={},fo={},lc={},Dv={},Fv={},Bv={},jP;function C0(){return jP||(jP=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(x){if(super(),!e.IDENTIFIER.test(x))throw new Error("CodeGen: name must be a valid identifier");this.str=x}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(x){super(),this._items=typeof x=="string"?[x]:x}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const x=this._items[0];return x===""||x==='""'}get str(){var x;return(x=this._str)!==null&&x!==void 0?x:this._str=this._items.reduce((k,_)=>`${k}${_}`,"")}get names(){var x;return(x=this._names)!==null&&x!==void 0?x:this._names=this._items.reduce((k,_)=>(_ instanceof n&&(k[_.str]=(k[_.str]||0)+1),k),{})}}e._Code=r,e.nil=new r("");function s(b,...x){const k=[b[0]];let _=0;for(;_<x.length;)i(k,x[_]),k.push(b[++_]);return new r(k)}e._=s;const a=new r("+");function o(b,...x){const k=[m(b[0])];let _=0;for(;_<x.length;)k.push(a),i(k,x[_]),k.push(a,m(b[++_]));return c(k),new r(k)}e.str=o;function i(b,x){x instanceof r?b.push(...x._items):x instanceof n?b.push(x):b.push(d(x))}e.addCodeArg=i;function c(b){let x=1;for(;x<b.length-1;){if(b[x]===a){const k=u(b[x-1],b[x+1]);if(k!==void 0){b.splice(x-1,3,k);continue}b[x++]="+"}x++}}function u(b,x){if(x==='""')return b;if(b==='""')return x;if(typeof b=="string")return x instanceof n||b[b.length-1]!=='"'?void 0:typeof x!="string"?`${b.slice(0,-1)}${x}"`:x[0]==='"'?b.slice(0,-1)+x.slice(1):void 0;if(typeof x=="string"&&x[0]==='"'&&!(b instanceof n))return`"${b}${x.slice(1)}`}function l(b,x){return x.emptyStr()?b:b.emptyStr()?x:o`${b}${x}`}e.strConcat=l;function d(b){return typeof b=="number"||typeof b=="boolean"||b===null?b:m(Array.isArray(b)?b.join(","):b)}function h(b){return new r(m(b))}e.stringify=h;function m(b){return JSON.stringify(b).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=m;function p(b){return typeof b=="string"&&e.IDENTIFIER.test(b)?new r(`.${b}`):s`[${b}]`}e.getProperty=p;function y(b){if(typeof b=="string"&&e.IDENTIFIER.test(b))return new r(`${b}`);throw new Error(`CodeGen: invalid export name: ${b}, use explicit $id name mapping`)}e.getEsmExportName=y;function g(b){return new r(b.toString())}e.regexpCode=g})(Bv)),Bv}var Uv={},MP;function DP(){return MP||(MP=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=C0();class n extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var r;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class s{constructor({prefixes:u,parent:l}={}){this._names={},this._prefixes=u,this._parent=l}toName(u){return u instanceof t.Name?u:this.name(u)}name(u){return new t.Name(this._newName(u))}_newName(u){const l=this._names[u]||this._nameGroup(u);return`${u}${l.index++}`}_nameGroup(u){var l,d;if(!((d=(l=this._parent)===null||l===void 0?void 0:l._prefixes)===null||d===void 0)&&d.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}}e.Scope=s;class a extends t.Name{constructor(u,l){super(l),this.prefix=u}setValue(u,{property:l,itemIndex:d}){this.value=u,this.scopePath=(0,t._)`.${new t.Name(l)}[${d}]`}}e.ValueScopeName=a;const o=(0,t._)`\n`;class i extends s{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?o:t.nil}}get(){return this._scope}name(u){return new a(u,this._newName(u))}value(u,l){var d;if(l.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const h=this.toName(u),{prefix:m}=h,p=(d=l.key)!==null&&d!==void 0?d:l.ref;let y=this._values[m];if(y){const x=y.get(p);if(x)return x}else y=this._values[m]=new Map;y.set(p,h);const g=this._scope[m]||(this._scope[m]=[]),b=g.length;return g[b]=l.ref,h.setValue(l,{property:m,itemIndex:b}),h}getValue(u,l){const d=this._values[u];if(d)return d.get(l)}scopeRefs(u,l=this._values){return this._reduceValues(l,d=>{if(d.scopePath===void 0)throw new Error(`CodeGen: name "${d}" has no value`);return(0,t._)`${u}${d.scopePath}`})}scopeCode(u=this._values,l,d){return this._reduceValues(u,h=>{if(h.value===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return h.value.code},l,d)}_reduceValues(u,l,d={},h){let m=t.nil;for(const p in u){const y=u[p];if(!y)continue;const g=d[p]=d[p]||new Map;y.forEach(b=>{if(g.has(b))return;g.set(b,r.Started);let x=l(b);if(x){const k=this.opts.es5?e.varKinds.var:e.varKinds.const;m=(0,t._)`${m}${k} ${b} = ${x};${this.opts._n}`}else if(x=h?.(b))m=(0,t._)`${m}${x}${this.opts._n}`;else throw new n(b);g.set(b,r.Completed)})}return m}}e.ValueScope=i})(Uv)),Uv}var FP;function ct(){return FP||(FP=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=C0(),n=DP();var r=C0();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var s=DP();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class a{optimizeNodes(){return this}optimizeNames(P,D){return this}}class o extends a{constructor(P,D,Q){super(),this.varKind=P,this.name=D,this.rhs=Q}render({es5:P,_n:D}){const Q=P?n.varKinds.var:this.varKind,pe=this.rhs===void 0?"":` = ${this.rhs}`;return`${Q} ${this.name}${pe};`+D}optimizeNames(P,D){if(P[this.name.str])return this.rhs&&(this.rhs=Y(this.rhs,P,D)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class i extends a{constructor(P,D,Q){super(),this.lhs=P,this.rhs=D,this.sideEffects=Q}render({_n:P}){return`${this.lhs} = ${this.rhs};`+P}optimizeNames(P,D){if(!(this.lhs instanceof t.Name&&!P[this.lhs.str]&&!this.sideEffects))return this.rhs=Y(this.rhs,P,D),this}get names(){const P=this.lhs instanceof t.Name?{}:{...this.lhs.names};return K(P,this.rhs)}}class c extends i{constructor(P,D,Q,pe){super(P,Q,pe),this.op=D}render({_n:P}){return`${this.lhs} ${this.op}= ${this.rhs};`+P}}class u extends a{constructor(P){super(),this.label=P,this.names={}}render({_n:P}){return`${this.label}:`+P}}class l extends a{constructor(P){super(),this.label=P,this.names={}}render({_n:P}){return`break${this.label?` ${this.label}`:""};`+P}}class d extends a{constructor(P){super(),this.error=P}render({_n:P}){return`throw ${this.error};`+P}get names(){return this.error.names}}class h extends a{constructor(P){super(),this.code=P}render({_n:P}){return`${this.code};`+P}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(P,D){return this.code=Y(this.code,P,D),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class m extends a{constructor(P=[]){super(),this.nodes=P}render(P){return this.nodes.reduce((D,Q)=>D+Q.render(P),"")}optimizeNodes(){const{nodes:P}=this;let D=P.length;for(;D--;){const Q=P[D].optimizeNodes();Array.isArray(Q)?P.splice(D,1,...Q):Q?P[D]=Q:P.splice(D,1)}return P.length>0?this:void 0}optimizeNames(P,D){const{nodes:Q}=this;let pe=Q.length;for(;pe--;){const ce=Q[pe];ce.optimizeNames(P,D)||(W(P,ce.names),Q.splice(pe,1))}return Q.length>0?this:void 0}get names(){return this.nodes.reduce((P,D)=>F(P,D.names),{})}}class p extends m{render(P){return"{"+P._n+super.render(P)+"}"+P._n}}class y extends m{}class g extends p{}g.kind="else";class b extends p{constructor(P,D){super(D),this.condition=P}render(P){let D=`if(${this.condition})`+super.render(P);return this.else&&(D+="else "+this.else.render(P)),D}optimizeNodes(){super.optimizeNodes();const P=this.condition;if(P===!0)return this.nodes;let D=this.else;if(D){const Q=D.optimizeNodes();D=this.else=Array.isArray(Q)?new g(Q):Q}if(D)return P===!1?D instanceof b?D:D.nodes:this.nodes.length?this:new b(J(P),D instanceof b?[D]:D.nodes);if(!(P===!1||!this.nodes.length))return this}optimizeNames(P,D){var Q;if(this.else=(Q=this.else)===null||Q===void 0?void 0:Q.optimizeNames(P,D),!!(super.optimizeNames(P,D)||this.else))return this.condition=Y(this.condition,P,D),this}get names(){const P=super.names;return K(P,this.condition),this.else&&F(P,this.else.names),P}}b.kind="if";class x extends p{}x.kind="for";class k extends x{constructor(P){super(),this.iteration=P}render(P){return`for(${this.iteration})`+super.render(P)}optimizeNames(P,D){if(super.optimizeNames(P,D))return this.iteration=Y(this.iteration,P,D),this}get names(){return F(super.names,this.iteration.names)}}class _ extends x{constructor(P,D,Q,pe){super(),this.varKind=P,this.name=D,this.from=Q,this.to=pe}render(P){const D=P.es5?n.varKinds.var:this.varKind,{name:Q,from:pe,to:ce}=this;return`for(${D} ${Q}=${pe}; ${Q}<${ce}; ${Q}++)`+super.render(P)}get names(){const P=K(super.names,this.from);return K(P,this.to)}}class S extends x{constructor(P,D,Q,pe){super(),this.loop=P,this.varKind=D,this.name=Q,this.iterable=pe}render(P){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(P)}optimizeNames(P,D){if(super.optimizeNames(P,D))return this.iterable=Y(this.iterable,P,D),this}get names(){return F(super.names,this.iterable.names)}}class w extends p{constructor(P,D,Q){super(),this.name=P,this.args=D,this.async=Q}render(P){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(P)}}w.kind="func";class T extends m{render(P){return"return "+super.render(P)}}T.kind="return";class A extends p{render(P){let D="try"+super.render(P);return this.catch&&(D+=this.catch.render(P)),this.finally&&(D+=this.finally.render(P)),D}optimizeNodes(){var P,D;return super.optimizeNodes(),(P=this.catch)===null||P===void 0||P.optimizeNodes(),(D=this.finally)===null||D===void 0||D.optimizeNodes(),this}optimizeNames(P,D){var Q,pe;return super.optimizeNames(P,D),(Q=this.catch)===null||Q===void 0||Q.optimizeNames(P,D),(pe=this.finally)===null||pe===void 0||pe.optimizeNames(P,D),this}get names(){const P=super.names;return this.catch&&F(P,this.catch.names),this.finally&&F(P,this.finally.names),P}}class L extends p{constructor(P){super(),this.error=P}render(P){return`catch(${this.error})`+super.render(P)}}L.kind="catch";class R extends p{render(P){return"finally"+super.render(P)}}R.kind="finally";class j{constructor(P,D={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...D,_n:D.lines?`
|
|
29
|
-
`:""},this._extScope=P,this._scope=new n.Scope({parent:P}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(P){return this._scope.name(P)}scopeName(P){return this._extScope.name(P)}scopeValue(P,D){const Q=this._extScope.value(P,D);return(this._values[Q.prefix]||(this._values[Q.prefix]=new Set)).add(Q),Q}getScopeValue(P,D){return this._extScope.getValue(P,D)}scopeRefs(P){return this._extScope.scopeRefs(P,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(P,D,Q,pe){const ce=this._scope.toName(D);return Q!==void 0&&pe&&(this._constants[ce.str]=Q),this._leafNode(new o(P,ce,Q)),ce}const(P,D,Q){return this._def(n.varKinds.const,P,D,Q)}let(P,D,Q){return this._def(n.varKinds.let,P,D,Q)}var(P,D,Q){return this._def(n.varKinds.var,P,D,Q)}assign(P,D,Q){return this._leafNode(new i(P,D,Q))}add(P,D){return this._leafNode(new c(P,e.operators.ADD,D))}code(P){return typeof P=="function"?P():P!==t.nil&&this._leafNode(new h(P)),this}object(...P){const D=["{"];for(const[Q,pe]of P)D.length>1&&D.push(","),D.push(Q),(Q!==pe||this.opts.es5)&&(D.push(":"),(0,t.addCodeArg)(D,pe));return D.push("}"),new t._Code(D)}if(P,D,Q){if(this._blockNode(new b(P)),D&&Q)this.code(D).else().code(Q).endIf();else if(D)this.code(D).endIf();else if(Q)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(P){return this._elseNode(new b(P))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(b,g)}_for(P,D){return this._blockNode(P),D&&this.code(D).endFor(),this}for(P,D){return this._for(new k(P),D)}forRange(P,D,Q,pe,ce=this.opts.es5?n.varKinds.var:n.varKinds.let){const Ee=this._scope.toName(P);return this._for(new _(ce,Ee,D,Q),()=>pe(Ee))}forOf(P,D,Q,pe=n.varKinds.const){const ce=this._scope.toName(P);if(this.opts.es5){const Ee=D instanceof t.Name?D:this.var("_arr",D);return this.forRange("_i",0,(0,t._)`${Ee}.length`,Ne=>{this.var(ce,(0,t._)`${Ee}[${Ne}]`),Q(ce)})}return this._for(new S("of",pe,ce,D),()=>Q(ce))}forIn(P,D,Q,pe=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(P,(0,t._)`Object.keys(${D})`,Q);const ce=this._scope.toName(P);return this._for(new S("in",pe,ce,D),()=>Q(ce))}endFor(){return this._endBlockNode(x)}label(P){return this._leafNode(new u(P))}break(P){return this._leafNode(new l(P))}return(P){const D=new T;if(this._blockNode(D),this.code(P),D.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(T)}try(P,D,Q){if(!D&&!Q)throw new Error('CodeGen: "try" without "catch" and "finally"');const pe=new A;if(this._blockNode(pe),this.code(P),D){const ce=this.name("e");this._currNode=pe.catch=new L(ce),D(ce)}return Q&&(this._currNode=pe.finally=new R,this.code(Q)),this._endBlockNode(L,R)}throw(P){return this._leafNode(new d(P))}block(P,D){return this._blockStarts.push(this._nodes.length),P&&this.code(P).endBlock(D),this}endBlock(P){const D=this._blockStarts.pop();if(D===void 0)throw new Error("CodeGen: not in self-balancing block");const Q=this._nodes.length-D;if(Q<0||P!==void 0&&Q!==P)throw new Error(`CodeGen: wrong number of nodes: ${Q} vs ${P} expected`);return this._nodes.length=D,this}func(P,D=t.nil,Q,pe){return this._blockNode(new w(P,D,Q)),pe&&this.code(pe).endFunc(),this}endFunc(){return this._endBlockNode(w)}optimize(P=1){for(;P-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(P){return this._currNode.nodes.push(P),this}_blockNode(P){this._currNode.nodes.push(P),this._nodes.push(P)}_endBlockNode(P,D){const Q=this._currNode;if(Q instanceof P||D&&Q instanceof D)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${D?`${P.kind}/${D.kind}`:P.kind}"`)}_elseNode(P){const D=this._currNode;if(!(D instanceof b))throw new Error('CodeGen: "else" without "if"');return this._currNode=D.else=P,this}get _root(){return this._nodes[0]}get _currNode(){const P=this._nodes;return P[P.length-1]}set _currNode(P){const D=this._nodes;D[D.length-1]=P}}e.CodeGen=j;function F(N,P){for(const D in P)N[D]=(N[D]||0)+(P[D]||0);return N}function K(N,P){return P instanceof t._CodeOrName?F(N,P.names):N}function Y(N,P,D){if(N instanceof t.Name)return Q(N);if(!pe(N))return N;return new t._Code(N._items.reduce((ce,Ee)=>(Ee instanceof t.Name&&(Ee=Q(Ee)),Ee instanceof t._Code?ce.push(...Ee._items):ce.push(Ee),ce),[]));function Q(ce){const Ee=D[ce.str];return Ee===void 0||P[ce.str]!==1?ce:(delete P[ce.str],Ee)}function pe(ce){return ce instanceof t._Code&&ce._items.some(Ee=>Ee instanceof t.Name&&P[Ee.str]===1&&D[Ee.str]!==void 0)}}function W(N,P){for(const D in P)N[D]=(N[D]||0)-(P[D]||0)}function J(N){return typeof N=="boolean"||typeof N=="number"||N===null?!N:(0,t._)`!${V(N)}`}e.not=J;const ae=U(e.operators.AND);function ge(...N){return N.reduce(ae)}e.and=ge;const le=U(e.operators.OR);function I(...N){return N.reduce(le)}e.or=I;function U(N){return(P,D)=>P===t.nil?D:D===t.nil?P:(0,t._)`${V(P)} ${N} ${V(D)}`}function V(N){return N instanceof t.Name?N:(0,t._)`(${N})`}})(Fv)),Fv}var ut={},BP;function pt(){if(BP)return ut;BP=1,Object.defineProperty(ut,"__esModule",{value:!0}),ut.checkStrictMode=ut.getErrorPath=ut.Type=ut.useFunc=ut.setEvaluated=ut.evaluatedPropsToName=ut.mergeEvaluated=ut.eachItem=ut.unescapeJsonPointer=ut.escapeJsonPointer=ut.escapeFragment=ut.unescapeFragment=ut.schemaRefOrVal=ut.schemaHasRulesButRef=ut.schemaHasRules=ut.checkUnknownRules=ut.alwaysValidSchema=ut.toHash=void 0;const e=ct(),t=C0();function n(S){const w={};for(const T of S)w[T]=!0;return w}ut.toHash=n;function r(S,w){return typeof w=="boolean"?w:Object.keys(w).length===0?!0:(s(S,w),!a(w,S.self.RULES.all))}ut.alwaysValidSchema=r;function s(S,w=S.schema){const{opts:T,self:A}=S;if(!T.strictSchema||typeof w=="boolean")return;const L=A.RULES.keywords;for(const R in w)L[R]||_(S,`unknown keyword: "${R}"`)}ut.checkUnknownRules=s;function a(S,w){if(typeof S=="boolean")return!S;for(const T in S)if(w[T])return!0;return!1}ut.schemaHasRules=a;function o(S,w){if(typeof S=="boolean")return!S;for(const T in S)if(T!=="$ref"&&w.all[T])return!0;return!1}ut.schemaHasRulesButRef=o;function i({topSchemaRef:S,schemaPath:w},T,A,L){if(!L){if(typeof T=="number"||typeof T=="boolean")return T;if(typeof T=="string")return(0,e._)`${T}`}return(0,e._)`${S}${w}${(0,e.getProperty)(A)}`}ut.schemaRefOrVal=i;function c(S){return d(decodeURIComponent(S))}ut.unescapeFragment=c;function u(S){return encodeURIComponent(l(S))}ut.escapeFragment=u;function l(S){return typeof S=="number"?`${S}`:S.replace(/~/g,"~0").replace(/\//g,"~1")}ut.escapeJsonPointer=l;function d(S){return S.replace(/~1/g,"/").replace(/~0/g,"~")}ut.unescapeJsonPointer=d;function h(S,w){if(Array.isArray(S))for(const T of S)w(T);else w(S)}ut.eachItem=h;function m({mergeNames:S,mergeToName:w,mergeValues:T,resultToName:A}){return(L,R,j,F)=>{const K=j===void 0?R:j instanceof e.Name?(R instanceof e.Name?S(L,R,j):w(L,R,j),j):R instanceof e.Name?(w(L,j,R),R):T(R,j);return F===e.Name&&!(K instanceof e.Name)?A(L,K):K}}ut.mergeEvaluated={props:m({mergeNames:(S,w,T)=>S.if((0,e._)`${T} !== true && ${w} !== undefined`,()=>{S.if((0,e._)`${w} === true`,()=>S.assign(T,!0),()=>S.assign(T,(0,e._)`${T} || {}`).code((0,e._)`Object.assign(${T}, ${w})`))}),mergeToName:(S,w,T)=>S.if((0,e._)`${T} !== true`,()=>{w===!0?S.assign(T,!0):(S.assign(T,(0,e._)`${T} || {}`),y(S,T,w))}),mergeValues:(S,w)=>S===!0?!0:{...S,...w},resultToName:p}),items:m({mergeNames:(S,w,T)=>S.if((0,e._)`${T} !== true && ${w} !== undefined`,()=>S.assign(T,(0,e._)`${w} === true ? true : ${T} > ${w} ? ${T} : ${w}`)),mergeToName:(S,w,T)=>S.if((0,e._)`${T} !== true`,()=>S.assign(T,w===!0?!0:(0,e._)`${T} > ${w} ? ${T} : ${w}`)),mergeValues:(S,w)=>S===!0?!0:Math.max(S,w),resultToName:(S,w)=>S.var("items",w)})};function p(S,w){if(w===!0)return S.var("props",!0);const T=S.var("props",(0,e._)`{}`);return w!==void 0&&y(S,T,w),T}ut.evaluatedPropsToName=p;function y(S,w,T){Object.keys(T).forEach(A=>S.assign((0,e._)`${w}${(0,e.getProperty)(A)}`,!0))}ut.setEvaluated=y;const g={};function b(S,w){return S.scopeValue("func",{ref:w,code:g[w.code]||(g[w.code]=new t._Code(w.code))})}ut.useFunc=b;var x;(function(S){S[S.Num=0]="Num",S[S.Str=1]="Str"})(x||(ut.Type=x={}));function k(S,w,T){if(S instanceof e.Name){const A=w===x.Num;return T?A?(0,e._)`"[" + ${S} + "]"`:(0,e._)`"['" + ${S} + "']"`:A?(0,e._)`"/" + ${S}`:(0,e._)`"/" + ${S}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return T?(0,e.getProperty)(S).toString():"/"+l(S)}ut.getErrorPath=k;function _(S,w,T=S.opts.strictSchema){if(T){if(w=`strict mode: ${w}`,T===!0)throw new Error(w);S.self.logger.warn(w)}}return ut.checkStrictMode=_,ut}var ng={},UP;function Ia(){if(UP)return ng;UP=1,Object.defineProperty(ng,"__esModule",{value:!0});const e=ct(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return ng.default=t,ng}var zP;function Fx(){return zP||(zP=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=ct(),n=pt(),r=Ia();e.keywordError={message:({keyword:g})=>(0,t.str)`must pass "${g}" keyword validation`},e.keyword$DataError={message:({keyword:g,schemaType:b})=>b?(0,t.str)`"${g}" keyword must be ${b} ($data)`:(0,t.str)`"${g}" keyword is invalid ($data)`};function s(g,b=e.keywordError,x,k){const{it:_}=g,{gen:S,compositeRule:w,allErrors:T}=_,A=d(g,b,x);k??(w||T)?c(S,A):u(_,(0,t._)`[${A}]`)}e.reportError=s;function a(g,b=e.keywordError,x){const{it:k}=g,{gen:_,compositeRule:S,allErrors:w}=k,T=d(g,b,x);c(_,T),S||w||u(k,r.default.vErrors)}e.reportExtraError=a;function o(g,b){g.assign(r.default.errors,b),g.if((0,t._)`${r.default.vErrors} !== null`,()=>g.if(b,()=>g.assign((0,t._)`${r.default.vErrors}.length`,b),()=>g.assign(r.default.vErrors,null)))}e.resetErrorsCount=o;function i({gen:g,keyword:b,schemaValue:x,data:k,errsCount:_,it:S}){if(_===void 0)throw new Error("ajv implementation error");const w=g.name("err");g.forRange("i",_,r.default.errors,T=>{g.const(w,(0,t._)`${r.default.vErrors}[${T}]`),g.if((0,t._)`${w}.instancePath === undefined`,()=>g.assign((0,t._)`${w}.instancePath`,(0,t.strConcat)(r.default.instancePath,S.errorPath))),g.assign((0,t._)`${w}.schemaPath`,(0,t.str)`${S.errSchemaPath}/${b}`),S.opts.verbose&&(g.assign((0,t._)`${w}.schema`,x),g.assign((0,t._)`${w}.data`,k))})}e.extendErrors=i;function c(g,b){const x=g.const("err",b);g.if((0,t._)`${r.default.vErrors} === null`,()=>g.assign(r.default.vErrors,(0,t._)`[${x}]`),(0,t._)`${r.default.vErrors}.push(${x})`),g.code((0,t._)`${r.default.errors}++`)}function u(g,b){const{gen:x,validateName:k,schemaEnv:_}=g;_.$async?x.throw((0,t._)`new ${g.ValidationError}(${b})`):(x.assign((0,t._)`${k}.errors`,b),x.return(!1))}const l={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function d(g,b,x){const{createErrors:k}=g.it;return k===!1?(0,t._)`{}`:h(g,b,x)}function h(g,b,x={}){const{gen:k,it:_}=g,S=[m(_,x),p(g,x)];return y(g,b,S),k.object(...S)}function m({errorPath:g},{instancePath:b}){const x=b?(0,t.str)`${g}${(0,n.getErrorPath)(b,n.Type.Str)}`:g;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,x)]}function p({keyword:g,it:{errSchemaPath:b}},{schemaPath:x,parentSchema:k}){let _=k?b:(0,t.str)`${b}/${g}`;return x&&(_=(0,t.str)`${_}${(0,n.getErrorPath)(x,n.Type.Str)}`),[l.schemaPath,_]}function y(g,{params:b,message:x},k){const{keyword:_,data:S,schemaValue:w,it:T}=g,{opts:A,propertyName:L,topSchemaRef:R,schemaPath:j}=T;k.push([l.keyword,_],[l.params,typeof b=="function"?b(g):b||(0,t._)`{}`]),A.messages&&k.push([l.message,typeof x=="function"?x(g):x]),A.verbose&&k.push([l.schema,w],[l.parentSchema,(0,t._)`${R}${j}`],[r.default.data,S]),L&&k.push([l.propertyName,L])}})(Dv)),Dv}var HP;function cye(){if(HP)return lc;HP=1,Object.defineProperty(lc,"__esModule",{value:!0}),lc.boolOrEmptySchema=lc.topBoolOrEmptySchema=void 0;const e=Fx(),t=ct(),n=Ia(),r={message:"boolean schema is false"};function s(i){const{gen:c,schema:u,validateName:l}=i;u===!1?o(i,!1):typeof u=="object"&&u.$async===!0?c.return(n.default.data):(c.assign((0,t._)`${l}.errors`,null),c.return(!0))}lc.topBoolOrEmptySchema=s;function a(i,c){const{gen:u,schema:l}=i;l===!1?(u.var(c,!1),o(i)):u.var(c,!0)}lc.boolOrEmptySchema=a;function o(i,c){const{gen:u,data:l}=i,d={gen:u,keyword:"false schema",data:l,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:i};(0,e.reportError)(d,r,void 0,c)}return lc}var nr={},dc={},qP;function bU(){if(qP)return dc;qP=1,Object.defineProperty(dc,"__esModule",{value:!0}),dc.getRules=dc.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function n(s){return typeof s=="string"&&t.has(s)}dc.isJSONType=n;function r(){const s={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...s,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},s.number,s.string,s.array,s.object],post:{rules:[]},all:{},keywords:{}}}return dc.getRules=r,dc}var ho={},VP;function yU(){if(VP)return ho;VP=1,Object.defineProperty(ho,"__esModule",{value:!0}),ho.shouldUseRule=ho.shouldUseGroup=ho.schemaHasRulesForType=void 0;function e({schema:r,self:s},a){const o=s.RULES.types[a];return o&&o!==!0&&t(r,o)}ho.schemaHasRulesForType=e;function t(r,s){return s.rules.some(a=>n(r,a))}ho.shouldUseGroup=t;function n(r,s){var a;return r[s.keyword]!==void 0||((a=s.definition.implements)===null||a===void 0?void 0:a.some(o=>r[o]!==void 0))}return ho.shouldUseRule=n,ho}var GP;function I0(){if(GP)return nr;GP=1,Object.defineProperty(nr,"__esModule",{value:!0}),nr.reportTypeError=nr.checkDataTypes=nr.checkDataType=nr.coerceAndCheckDataType=nr.getJSONTypes=nr.getSchemaTypes=nr.DataType=void 0;const e=bU(),t=yU(),n=Fx(),r=ct(),s=pt();var a;(function(x){x[x.Correct=0]="Correct",x[x.Wrong=1]="Wrong"})(a||(nr.DataType=a={}));function o(x){const k=i(x.type);if(k.includes("null")){if(x.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!k.length&&x.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');x.nullable===!0&&k.push("null")}return k}nr.getSchemaTypes=o;function i(x){const k=Array.isArray(x)?x:x?[x]:[];if(k.every(e.isJSONType))return k;throw new Error("type must be JSONType or JSONType[]: "+k.join(","))}nr.getJSONTypes=i;function c(x,k){const{gen:_,data:S,opts:w}=x,T=l(k,w.coerceTypes),A=k.length>0&&!(T.length===0&&k.length===1&&(0,t.schemaHasRulesForType)(x,k[0]));if(A){const L=p(k,S,w.strictNumbers,a.Wrong);_.if(L,()=>{T.length?d(x,k,T):g(x)})}return A}nr.coerceAndCheckDataType=c;const u=new Set(["string","number","integer","boolean","null"]);function l(x,k){return k?x.filter(_=>u.has(_)||k==="array"&&_==="array"):[]}function d(x,k,_){const{gen:S,data:w,opts:T}=x,A=S.let("dataType",(0,r._)`typeof ${w}`),L=S.let("coerced",(0,r._)`undefined`);T.coerceTypes==="array"&&S.if((0,r._)`${A} == 'object' && Array.isArray(${w}) && ${w}.length == 1`,()=>S.assign(w,(0,r._)`${w}[0]`).assign(A,(0,r._)`typeof ${w}`).if(p(k,w,T.strictNumbers),()=>S.assign(L,w))),S.if((0,r._)`${L} !== undefined`);for(const j of _)(u.has(j)||j==="array"&&T.coerceTypes==="array")&&R(j);S.else(),g(x),S.endIf(),S.if((0,r._)`${L} !== undefined`,()=>{S.assign(w,L),h(x,L)});function R(j){switch(j){case"string":S.elseIf((0,r._)`${A} == "number" || ${A} == "boolean"`).assign(L,(0,r._)`"" + ${w}`).elseIf((0,r._)`${w} === null`).assign(L,(0,r._)`""`);return;case"number":S.elseIf((0,r._)`${A} == "boolean" || ${w} === null
|
|
30
|
-
|| (${A} == "string" && ${w} && ${w} == +${w})`).assign(L,(0,r._)`+${w}`);return;case"integer":S.elseIf((0,r._)`${A} === "boolean" || ${w} === null
|
|
31
|
-
|| (${A} === "string" && ${w} && ${w} == +${w} && !(${w} % 1))`).assign(L,(0,r._)`+${w}`);return;case"boolean":S.elseIf((0,r._)`${w} === "false" || ${w} === 0 || ${w} === null`).assign(L,!1).elseIf((0,r._)`${w} === "true" || ${w} === 1`).assign(L,!0);return;case"null":S.elseIf((0,r._)`${w} === "" || ${w} === 0 || ${w} === false`),S.assign(L,null);return;case"array":S.elseIf((0,r._)`${A} === "string" || ${A} === "number"
|
|
32
|
-
|| ${A} === "boolean" || ${w} === null`).assign(L,(0,r._)`[${w}]`)}}}function h({gen:x,parentData:k,parentDataProperty:_},S){x.if((0,r._)`${k} !== undefined`,()=>x.assign((0,r._)`${k}[${_}]`,S))}function m(x,k,_,S=a.Correct){const w=S===a.Correct?r.operators.EQ:r.operators.NEQ;let T;switch(x){case"null":return(0,r._)`${k} ${w} null`;case"array":T=(0,r._)`Array.isArray(${k})`;break;case"object":T=(0,r._)`${k} && typeof ${k} == "object" && !Array.isArray(${k})`;break;case"integer":T=A((0,r._)`!(${k} % 1) && !isNaN(${k})`);break;case"number":T=A();break;default:return(0,r._)`typeof ${k} ${w} ${x}`}return S===a.Correct?T:(0,r.not)(T);function A(L=r.nil){return(0,r.and)((0,r._)`typeof ${k} == "number"`,L,_?(0,r._)`isFinite(${k})`:r.nil)}}nr.checkDataType=m;function p(x,k,_,S){if(x.length===1)return m(x[0],k,_,S);let w;const T=(0,s.toHash)(x);if(T.array&&T.object){const A=(0,r._)`typeof ${k} != "object"`;w=T.null?A:(0,r._)`!${k} || ${A}`,delete T.null,delete T.array,delete T.object}else w=r.nil;T.number&&delete T.integer;for(const A in T)w=(0,r.and)(w,m(A,k,_,S));return w}nr.checkDataTypes=p;const y={message:({schema:x})=>`must be ${x}`,params:({schema:x,schemaValue:k})=>typeof x=="string"?(0,r._)`{type: ${x}}`:(0,r._)`{type: ${k}}`};function g(x){const k=b(x);(0,n.reportError)(k,y)}nr.reportTypeError=g;function b(x){const{gen:k,data:_,schema:S}=x,w=(0,s.schemaRefOrVal)(x,S,"type");return{gen:k,keyword:"type",data:_,schema:S.type,schemaCode:w,schemaValue:w,parentSchema:S,params:{},it:x}}return nr}var Ef={},KP;function uye(){if(KP)return Ef;KP=1,Object.defineProperty(Ef,"__esModule",{value:!0}),Ef.assignDefaults=void 0;const e=ct(),t=pt();function n(s,a){const{properties:o,items:i}=s.schema;if(a==="object"&&o)for(const c in o)r(s,c,o[c].default);else a==="array"&&Array.isArray(i)&&i.forEach((c,u)=>r(s,u,c.default))}Ef.assignDefaults=n;function r(s,a,o){const{gen:i,compositeRule:c,data:u,opts:l}=s;if(o===void 0)return;const d=(0,e._)`${u}${(0,e.getProperty)(a)}`;if(c){(0,t.checkStrictMode)(s,`default is ignored for: ${d}`);return}let h=(0,e._)`${d} === undefined`;l.useDefaults==="empty"&&(h=(0,e._)`${h} || ${d} === null || ${d} === ""`),i.if(h,(0,e._)`${d} = ${(0,e.stringify)(o)}`)}return Ef}var ea={},Rt={},WP;function Aa(){if(WP)return Rt;WP=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.validateUnion=Rt.validateArray=Rt.usePattern=Rt.callValidateCode=Rt.schemaProperties=Rt.allSchemaProperties=Rt.noPropertyInData=Rt.propertyInData=Rt.isOwnProperty=Rt.hasPropFunc=Rt.reportMissingProp=Rt.checkMissingProp=Rt.checkReportMissingProp=void 0;const e=ct(),t=pt(),n=Ia(),r=pt();function s(x,k){const{gen:_,data:S,it:w}=x;_.if(l(_,S,k,w.opts.ownProperties),()=>{x.setParams({missingProperty:(0,e._)`${k}`},!0),x.error()})}Rt.checkReportMissingProp=s;function a({gen:x,data:k,it:{opts:_}},S,w){return(0,e.or)(...S.map(T=>(0,e.and)(l(x,k,T,_.ownProperties),(0,e._)`${w} = ${T}`)))}Rt.checkMissingProp=a;function o(x,k){x.setParams({missingProperty:k},!0),x.error()}Rt.reportMissingProp=o;function i(x){return x.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}Rt.hasPropFunc=i;function c(x,k,_){return(0,e._)`${i(x)}.call(${k}, ${_})`}Rt.isOwnProperty=c;function u(x,k,_,S){const w=(0,e._)`${k}${(0,e.getProperty)(_)} !== undefined`;return S?(0,e._)`${w} && ${c(x,k,_)}`:w}Rt.propertyInData=u;function l(x,k,_,S){const w=(0,e._)`${k}${(0,e.getProperty)(_)} === undefined`;return S?(0,e.or)(w,(0,e.not)(c(x,k,_))):w}Rt.noPropertyInData=l;function d(x){return x?Object.keys(x).filter(k=>k!=="__proto__"):[]}Rt.allSchemaProperties=d;function h(x,k){return d(k).filter(_=>!(0,t.alwaysValidSchema)(x,k[_]))}Rt.schemaProperties=h;function m({schemaCode:x,data:k,it:{gen:_,topSchemaRef:S,schemaPath:w,errorPath:T},it:A},L,R,j){const F=j?(0,e._)`${x}, ${k}, ${S}${w}`:k,K=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,T)],[n.default.parentData,A.parentData],[n.default.parentDataProperty,A.parentDataProperty],[n.default.rootData,n.default.rootData]];A.opts.dynamicRef&&K.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const Y=(0,e._)`${F}, ${_.object(...K)}`;return R!==e.nil?(0,e._)`${L}.call(${R}, ${Y})`:(0,e._)`${L}(${Y})`}Rt.callValidateCode=m;const p=(0,e._)`new RegExp`;function y({gen:x,it:{opts:k}},_){const S=k.unicodeRegExp?"u":"",{regExp:w}=k.code,T=w(_,S);return x.scopeValue("pattern",{key:T.toString(),ref:T,code:(0,e._)`${w.code==="new RegExp"?p:(0,r.useFunc)(x,w)}(${_}, ${S})`})}Rt.usePattern=y;function g(x){const{gen:k,data:_,keyword:S,it:w}=x,T=k.name("valid");if(w.allErrors){const L=k.let("valid",!0);return A(()=>k.assign(L,!1)),L}return k.var(T,!0),A(()=>k.break()),T;function A(L){const R=k.const("len",(0,e._)`${_}.length`);k.forRange("i",0,R,j=>{x.subschema({keyword:S,dataProp:j,dataPropType:t.Type.Num},T),k.if((0,e.not)(T),L)})}}Rt.validateArray=g;function b(x){const{gen:k,schema:_,keyword:S,it:w}=x;if(!Array.isArray(_))throw new Error("ajv implementation error");if(_.some(R=>(0,t.alwaysValidSchema)(w,R))&&!w.opts.unevaluated)return;const A=k.let("valid",!1),L=k.name("_valid");k.block(()=>_.forEach((R,j)=>{const F=x.subschema({keyword:S,schemaProp:j,compositeRule:!0},L);k.assign(A,(0,e._)`${A} || ${L}`),x.mergeValidEvaluated(F,L)||k.if((0,e.not)(A))})),x.result(A,()=>x.reset(),()=>x.error(!0))}return Rt.validateUnion=b,Rt}var YP;function lye(){if(YP)return ea;YP=1,Object.defineProperty(ea,"__esModule",{value:!0}),ea.validateKeywordUsage=ea.validSchemaType=ea.funcKeywordCode=ea.macroKeywordCode=void 0;const e=ct(),t=Ia(),n=Aa(),r=Fx();function s(h,m){const{gen:p,keyword:y,schema:g,parentSchema:b,it:x}=h,k=m.macro.call(x.self,g,b,x),_=u(p,y,k);x.opts.validateSchema!==!1&&x.self.validateSchema(k,!0);const S=p.name("valid");h.subschema({schema:k,schemaPath:e.nil,errSchemaPath:`${x.errSchemaPath}/${y}`,topSchemaRef:_,compositeRule:!0},S),h.pass(S,()=>h.error(!0))}ea.macroKeywordCode=s;function a(h,m){var p;const{gen:y,keyword:g,schema:b,parentSchema:x,$data:k,it:_}=h;c(_,m);const S=!k&&m.compile?m.compile.call(_.self,b,x,_):m.validate,w=u(y,g,S),T=y.let("valid");h.block$data(T,A),h.ok((p=m.valid)!==null&&p!==void 0?p:T);function A(){if(m.errors===!1)j(),m.modifying&&o(h),F(()=>h.error());else{const K=m.async?L():R();m.modifying&&o(h),F(()=>i(h,K))}}function L(){const K=y.let("ruleErrs",null);return y.try(()=>j((0,e._)`await `),Y=>y.assign(T,!1).if((0,e._)`${Y} instanceof ${_.ValidationError}`,()=>y.assign(K,(0,e._)`${Y}.errors`),()=>y.throw(Y))),K}function R(){const K=(0,e._)`${w}.errors`;return y.assign(K,null),j(e.nil),K}function j(K=m.async?(0,e._)`await `:e.nil){const Y=_.opts.passContext?t.default.this:t.default.self,W=!("compile"in m&&!k||m.schema===!1);y.assign(T,(0,e._)`${K}${(0,n.callValidateCode)(h,w,Y,W)}`,m.modifying)}function F(K){var Y;y.if((0,e.not)((Y=m.valid)!==null&&Y!==void 0?Y:T),K)}}ea.funcKeywordCode=a;function o(h){const{gen:m,data:p,it:y}=h;m.if(y.parentData,()=>m.assign(p,(0,e._)`${y.parentData}[${y.parentDataProperty}]`))}function i(h,m){const{gen:p}=h;p.if((0,e._)`Array.isArray(${m})`,()=>{p.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${m} : ${t.default.vErrors}.concat(${m})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,r.extendErrors)(h)},()=>h.error())}function c({schemaEnv:h},m){if(m.async&&!h.$async)throw new Error("async keyword in sync schema")}function u(h,m,p){if(p===void 0)throw new Error(`keyword "${m}" failed to compile`);return h.scopeValue("keyword",typeof p=="function"?{ref:p}:{ref:p,code:(0,e.stringify)(p)})}function l(h,m,p=!1){return!m.length||m.some(y=>y==="array"?Array.isArray(h):y==="object"?h&&typeof h=="object"&&!Array.isArray(h):typeof h==y||p&&typeof h>"u")}ea.validSchemaType=l;function d({schema:h,opts:m,self:p,errSchemaPath:y},g,b){if(Array.isArray(g.keyword)?!g.keyword.includes(b):g.keyword!==b)throw new Error("ajv implementation error");const x=g.dependencies;if(x?.some(k=>!Object.prototype.hasOwnProperty.call(h,k)))throw new Error(`parent schema must have dependencies of ${b}: ${x.join(",")}`);if(g.validateSchema&&!g.validateSchema(h[b])){const _=`keyword "${b}" value is invalid at path "${y}": `+p.errorsText(g.validateSchema.errors);if(m.validateSchema==="log")p.logger.error(_);else throw new Error(_)}}return ea.validateKeywordUsage=d,ea}var mo={},JP;function dye(){if(JP)return mo;JP=1,Object.defineProperty(mo,"__esModule",{value:!0}),mo.extendSubschemaMode=mo.extendSubschemaData=mo.getSubschema=void 0;const e=ct(),t=pt();function n(a,{keyword:o,schemaProp:i,schema:c,schemaPath:u,errSchemaPath:l,topSchemaRef:d}){if(o!==void 0&&c!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(o!==void 0){const h=a.schema[o];return i===void 0?{schema:h,schemaPath:(0,e._)`${a.schemaPath}${(0,e.getProperty)(o)}`,errSchemaPath:`${a.errSchemaPath}/${o}`}:{schema:h[i],schemaPath:(0,e._)`${a.schemaPath}${(0,e.getProperty)(o)}${(0,e.getProperty)(i)}`,errSchemaPath:`${a.errSchemaPath}/${o}/${(0,t.escapeFragment)(i)}`}}if(c!==void 0){if(u===void 0||l===void 0||d===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:u,topSchemaRef:d,errSchemaPath:l}}throw new Error('either "keyword" or "schema" must be passed')}mo.getSubschema=n;function r(a,o,{dataProp:i,dataPropType:c,data:u,dataTypes:l,propertyName:d}){if(u!==void 0&&i!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:h}=o;if(i!==void 0){const{errorPath:p,dataPathArr:y,opts:g}=o,b=h.let("data",(0,e._)`${o.data}${(0,e.getProperty)(i)}`,!0);m(b),a.errorPath=(0,e.str)`${p}${(0,t.getErrorPath)(i,c,g.jsPropertySyntax)}`,a.parentDataProperty=(0,e._)`${i}`,a.dataPathArr=[...y,a.parentDataProperty]}if(u!==void 0){const p=u instanceof e.Name?u:h.let("data",u,!0);m(p),d!==void 0&&(a.propertyName=d)}l&&(a.dataTypes=l);function m(p){a.data=p,a.dataLevel=o.dataLevel+1,a.dataTypes=[],o.definedProperties=new Set,a.parentData=o.data,a.dataNames=[...o.dataNames,p]}}mo.extendSubschemaData=r;function s(a,{jtdDiscriminator:o,jtdMetadata:i,compositeRule:c,createErrors:u,allErrors:l}){c!==void 0&&(a.compositeRule=c),u!==void 0&&(a.createErrors=u),l!==void 0&&(a.allErrors=l),a.jtdDiscriminator=o,a.jtdMetadata=i}return mo.extendSubschemaMode=s,mo}var Pr={},zv,QP;function xU(){return QP||(QP=1,zv=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,s,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(s=r;s--!==0;)if(!e(t[s],n[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[s]))return!1;for(s=r;s--!==0;){var o=a[s];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}),zv}var Hv={exports:{}},XP;function fye(){if(XP)return Hv.exports;XP=1;var e=Hv.exports=function(r,s,a){typeof s=="function"&&(a=s,s={}),a=s.cb||a;var o=typeof a=="function"?a:a.pre||function(){},i=a.post||function(){};t(s,o,i,r,"",r)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(r,s,a,o,i,c,u,l,d,h){if(o&&typeof o=="object"&&!Array.isArray(o)){s(o,i,c,u,l,d,h);for(var m in o){var p=o[m];if(Array.isArray(p)){if(m in e.arrayKeywords)for(var y=0;y<p.length;y++)t(r,s,a,p[y],i+"/"+m+"/"+y,c,i,m,o,y)}else if(m in e.propsKeywords){if(p&&typeof p=="object")for(var g in p)t(r,s,a,p[g],i+"/"+m+"/"+n(g),c,i,m,o,g)}else(m in e.keywords||r.allKeys&&!(m in e.skipKeywords))&&t(r,s,a,p,i+"/"+m,c,i,m,o)}a(o,i,c,u,l,d,h)}}function n(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}return Hv.exports}var ZP;function Bx(){if(ZP)return Pr;ZP=1,Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.getSchemaRefs=Pr.resolveUrl=Pr.normalizeId=Pr._getFullPath=Pr.getFullPath=Pr.inlineRef=void 0;const e=pt(),t=xU(),n=fye(),r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(y,g=!0){return typeof y=="boolean"?!0:g===!0?!o(y):g?i(y)<=g:!1}Pr.inlineRef=s;const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function o(y){for(const g in y){if(a.has(g))return!0;const b=y[g];if(Array.isArray(b)&&b.some(o)||typeof b=="object"&&o(b))return!0}return!1}function i(y){let g=0;for(const b in y){if(b==="$ref")return 1/0;if(g++,!r.has(b)&&(typeof y[b]=="object"&&(0,e.eachItem)(y[b],x=>g+=i(x)),g===1/0))return 1/0}return g}function c(y,g="",b){b!==!1&&(g=d(g));const x=y.parse(g);return u(y,x)}Pr.getFullPath=c;function u(y,g){return y.serialize(g).split("#")[0]+"#"}Pr._getFullPath=u;const l=/#\/?$/;function d(y){return y?y.replace(l,""):""}Pr.normalizeId=d;function h(y,g,b){return b=d(b),y.resolve(g,b)}Pr.resolveUrl=h;const m=/^[a-z_][-a-z0-9._]*$/i;function p(y,g){if(typeof y=="boolean")return{};const{schemaId:b,uriResolver:x}=this.opts,k=d(y[b]||g),_={"":k},S=c(x,k,!1),w={},T=new Set;return n(y,{allKeys:!0},(R,j,F,K)=>{if(K===void 0)return;const Y=S+j;let W=_[K];typeof R[b]=="string"&&(W=J.call(this,R[b])),ae.call(this,R.$anchor),ae.call(this,R.$dynamicAnchor),_[j]=W;function J(ge){const le=this.opts.uriResolver.resolve;if(ge=d(W?le(W,ge):ge),T.has(ge))throw L(ge);T.add(ge);let I=this.refs[ge];return typeof I=="string"&&(I=this.refs[I]),typeof I=="object"?A(R,I.schema,ge):ge!==d(Y)&&(ge[0]==="#"?(A(R,w[ge],ge),w[ge]=R):this.refs[ge]=Y),ge}function ae(ge){if(typeof ge=="string"){if(!m.test(ge))throw new Error(`invalid anchor "${ge}"`);J.call(this,`#${ge}`)}}}),w;function A(R,j,F){if(j!==void 0&&!t(R,j))throw L(F)}function L(R){return new Error(`reference "${R}" resolves to more than one schema`)}}return Pr.getSchemaRefs=p,Pr}var eO;function Ux(){if(eO)return fo;eO=1,Object.defineProperty(fo,"__esModule",{value:!0}),fo.getData=fo.KeywordCxt=fo.validateFunctionCode=void 0;const e=cye(),t=I0(),n=yU(),r=I0(),s=uye(),a=lye(),o=dye(),i=ct(),c=Ia(),u=Bx(),l=pt(),d=Fx();function h(G){if(S(G)&&(T(G),_(G))){g(G);return}m(G,()=>(0,e.topBoolOrEmptySchema)(G))}fo.validateFunctionCode=h;function m({gen:G,validateName:X,schema:ee,schemaEnv:oe,opts:be},Oe){be.code.es5?G.func(X,(0,i._)`${c.default.data}, ${c.default.valCxt}`,oe.$async,()=>{G.code((0,i._)`"use strict"; ${x(ee,be)}`),y(G,be),G.code(Oe)}):G.func(X,(0,i._)`${c.default.data}, ${p(be)}`,oe.$async,()=>G.code(x(ee,be)).code(Oe))}function p(G){return(0,i._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${G.dynamicRef?(0,i._)`, ${c.default.dynamicAnchors}={}`:i.nil}}={}`}function y(G,X){G.if(c.default.valCxt,()=>{G.var(c.default.instancePath,(0,i._)`${c.default.valCxt}.${c.default.instancePath}`),G.var(c.default.parentData,(0,i._)`${c.default.valCxt}.${c.default.parentData}`),G.var(c.default.parentDataProperty,(0,i._)`${c.default.valCxt}.${c.default.parentDataProperty}`),G.var(c.default.rootData,(0,i._)`${c.default.valCxt}.${c.default.rootData}`),X.dynamicRef&&G.var(c.default.dynamicAnchors,(0,i._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{G.var(c.default.instancePath,(0,i._)`""`),G.var(c.default.parentData,(0,i._)`undefined`),G.var(c.default.parentDataProperty,(0,i._)`undefined`),G.var(c.default.rootData,c.default.data),X.dynamicRef&&G.var(c.default.dynamicAnchors,(0,i._)`{}`)})}function g(G){const{schema:X,opts:ee,gen:oe}=G;m(G,()=>{ee.$comment&&X.$comment&&K(G),R(G),oe.let(c.default.vErrors,null),oe.let(c.default.errors,0),ee.unevaluated&&b(G),A(G),Y(G)})}function b(G){const{gen:X,validateName:ee}=G;G.evaluated=X.const("evaluated",(0,i._)`${ee}.evaluated`),X.if((0,i._)`${G.evaluated}.dynamicProps`,()=>X.assign((0,i._)`${G.evaluated}.props`,(0,i._)`undefined`)),X.if((0,i._)`${G.evaluated}.dynamicItems`,()=>X.assign((0,i._)`${G.evaluated}.items`,(0,i._)`undefined`))}function x(G,X){const ee=typeof G=="object"&&G[X.schemaId];return ee&&(X.code.source||X.code.process)?(0,i._)`/*# sourceURL=${ee} */`:i.nil}function k(G,X){if(S(G)&&(T(G),_(G))){w(G,X);return}(0,e.boolOrEmptySchema)(G,X)}function _({schema:G,self:X}){if(typeof G=="boolean")return!G;for(const ee in G)if(X.RULES.all[ee])return!0;return!1}function S(G){return typeof G.schema!="boolean"}function w(G,X){const{schema:ee,gen:oe,opts:be}=G;be.$comment&&ee.$comment&&K(G),j(G),F(G);const Oe=oe.const("_errs",c.default.errors);A(G,Oe),oe.var(X,(0,i._)`${Oe} === ${c.default.errors}`)}function T(G){(0,l.checkUnknownRules)(G),L(G)}function A(G,X){if(G.opts.jtd)return J(G,[],!1,X);const ee=(0,t.getSchemaTypes)(G.schema),oe=(0,t.coerceAndCheckDataType)(G,ee);J(G,ee,!oe,X)}function L(G){const{schema:X,errSchemaPath:ee,opts:oe,self:be}=G;X.$ref&&oe.ignoreKeywordsWithRef&&(0,l.schemaHasRulesButRef)(X,be.RULES)&&be.logger.warn(`$ref: keywords ignored in schema at path "${ee}"`)}function R(G){const{schema:X,opts:ee}=G;X.default!==void 0&&ee.useDefaults&&ee.strictSchema&&(0,l.checkStrictMode)(G,"default is ignored in the schema root")}function j(G){const X=G.schema[G.opts.schemaId];X&&(G.baseId=(0,u.resolveUrl)(G.opts.uriResolver,G.baseId,X))}function F(G){if(G.schema.$async&&!G.schemaEnv.$async)throw new Error("async schema in sync schema")}function K({gen:G,schemaEnv:X,schema:ee,errSchemaPath:oe,opts:be}){const Oe=ee.$comment;if(be.$comment===!0)G.code((0,i._)`${c.default.self}.logger.log(${Oe})`);else if(typeof be.$comment=="function"){const fe=(0,i.str)`${oe}/$comment`,ve=G.scopeValue("root",{ref:X.root});G.code((0,i._)`${c.default.self}.opts.$comment(${Oe}, ${fe}, ${ve}.schema)`)}}function Y(G){const{gen:X,schemaEnv:ee,validateName:oe,ValidationError:be,opts:Oe}=G;ee.$async?X.if((0,i._)`${c.default.errors} === 0`,()=>X.return(c.default.data),()=>X.throw((0,i._)`new ${be}(${c.default.vErrors})`)):(X.assign((0,i._)`${oe}.errors`,c.default.vErrors),Oe.unevaluated&&W(G),X.return((0,i._)`${c.default.errors} === 0`))}function W({gen:G,evaluated:X,props:ee,items:oe}){ee instanceof i.Name&&G.assign((0,i._)`${X}.props`,ee),oe instanceof i.Name&&G.assign((0,i._)`${X}.items`,oe)}function J(G,X,ee,oe){const{gen:be,schema:Oe,data:fe,allErrors:ve,opts:ze,self:Se}=G,{RULES:re}=Se;if(Oe.$ref&&(ze.ignoreKeywordsWithRef||!(0,l.schemaHasRulesButRef)(Oe,re))){be.block(()=>pe(G,"$ref",re.all.$ref.definition));return}ze.jtd||ge(G,X),be.block(()=>{for(const We of re.rules)Ie(We);Ie(re.post)});function Ie(We){(0,n.shouldUseGroup)(Oe,We)&&(We.type?(be.if((0,r.checkDataType)(We.type,fe,ze.strictNumbers)),ae(G,We),X.length===1&&X[0]===We.type&&ee&&(be.else(),(0,r.reportTypeError)(G)),be.endIf()):ae(G,We),ve||be.if((0,i._)`${c.default.errors} === ${oe||0}`))}}function ae(G,X){const{gen:ee,schema:oe,opts:{useDefaults:be}}=G;be&&(0,s.assignDefaults)(G,X.type),ee.block(()=>{for(const Oe of X.rules)(0,n.shouldUseRule)(oe,Oe)&&pe(G,Oe.keyword,Oe.definition,X.type)})}function ge(G,X){G.schemaEnv.meta||!G.opts.strictTypes||(le(G,X),G.opts.allowUnionTypes||I(G,X),U(G,G.dataTypes))}function le(G,X){if(X.length){if(!G.dataTypes.length){G.dataTypes=X;return}X.forEach(ee=>{N(G.dataTypes,ee)||D(G,`type "${ee}" not allowed by context "${G.dataTypes.join(",")}"`)}),P(G,X)}}function I(G,X){X.length>1&&!(X.length===2&&X.includes("null"))&&D(G,"use allowUnionTypes to allow union type keyword")}function U(G,X){const ee=G.self.RULES.all;for(const oe in ee){const be=ee[oe];if(typeof be=="object"&&(0,n.shouldUseRule)(G.schema,be)){const{type:Oe}=be.definition;Oe.length&&!Oe.some(fe=>V(X,fe))&&D(G,`missing type "${Oe.join(",")}" for keyword "${oe}"`)}}}function V(G,X){return G.includes(X)||X==="number"&&G.includes("integer")}function N(G,X){return G.includes(X)||X==="integer"&&G.includes("number")}function P(G,X){const ee=[];for(const oe of G.dataTypes)N(X,oe)?ee.push(oe):X.includes("integer")&&oe==="number"&&ee.push("integer");G.dataTypes=ee}function D(G,X){const ee=G.schemaEnv.baseId+G.errSchemaPath;X+=` at "${ee}" (strictTypes)`,(0,l.checkStrictMode)(G,X,G.opts.strictTypes)}class Q{constructor(X,ee,oe){if((0,a.validateKeywordUsage)(X,ee,oe),this.gen=X.gen,this.allErrors=X.allErrors,this.keyword=oe,this.data=X.data,this.schema=X.schema[oe],this.$data=ee.$data&&X.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,l.schemaRefOrVal)(X,this.schema,oe,this.$data),this.schemaType=ee.schemaType,this.parentSchema=X.schema,this.params={},this.it=X,this.def=ee,this.$data)this.schemaCode=X.gen.const("vSchema",Ne(this.$data,X));else if(this.schemaCode=this.schemaValue,!(0,a.validSchemaType)(this.schema,ee.schemaType,ee.allowUndefined))throw new Error(`${oe} value must be ${JSON.stringify(ee.schemaType)}`);("code"in ee?ee.trackErrors:ee.errors!==!1)&&(this.errsCount=X.gen.const("_errs",c.default.errors))}result(X,ee,oe){this.failResult((0,i.not)(X),ee,oe)}failResult(X,ee,oe){this.gen.if(X),oe?oe():this.error(),ee?(this.gen.else(),ee(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(X,ee){this.failResult((0,i.not)(X),void 0,ee)}fail(X){if(X===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(X),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(X){if(!this.$data)return this.fail(X);const{schemaCode:ee}=this;this.fail((0,i._)`${ee} !== undefined && (${(0,i.or)(this.invalid$data(),X)})`)}error(X,ee,oe){if(ee){this.setParams(ee),this._error(X,oe),this.setParams({});return}this._error(X,oe)}_error(X,ee){(X?d.reportExtraError:d.reportError)(this,this.def.error,ee)}$dataError(){(0,d.reportError)(this,this.def.$dataError||d.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,d.resetErrorsCount)(this.gen,this.errsCount)}ok(X){this.allErrors||this.gen.if(X)}setParams(X,ee){ee?Object.assign(this.params,X):this.params=X}block$data(X,ee,oe=i.nil){this.gen.block(()=>{this.check$data(X,oe),ee()})}check$data(X=i.nil,ee=i.nil){if(!this.$data)return;const{gen:oe,schemaCode:be,schemaType:Oe,def:fe}=this;oe.if((0,i.or)((0,i._)`${be} === undefined`,ee)),X!==i.nil&&oe.assign(X,!0),(Oe.length||fe.validateSchema)&&(oe.elseIf(this.invalid$data()),this.$dataError(),X!==i.nil&&oe.assign(X,!1)),oe.else()}invalid$data(){const{gen:X,schemaCode:ee,schemaType:oe,def:be,it:Oe}=this;return(0,i.or)(fe(),ve());function fe(){if(oe.length){if(!(ee instanceof i.Name))throw new Error("ajv implementation error");const ze=Array.isArray(oe)?oe:[oe];return(0,i._)`${(0,r.checkDataTypes)(ze,ee,Oe.opts.strictNumbers,r.DataType.Wrong)}`}return i.nil}function ve(){if(be.validateSchema){const ze=X.scopeValue("validate$data",{ref:be.validateSchema});return(0,i._)`!${ze}(${ee})`}return i.nil}}subschema(X,ee){const oe=(0,o.getSubschema)(this.it,X);(0,o.extendSubschemaData)(oe,this.it,X),(0,o.extendSubschemaMode)(oe,X);const be={...this.it,...oe,items:void 0,props:void 0};return k(be,ee),be}mergeEvaluated(X,ee){const{it:oe,gen:be}=this;oe.opts.unevaluated&&(oe.props!==!0&&X.props!==void 0&&(oe.props=l.mergeEvaluated.props(be,X.props,oe.props,ee)),oe.items!==!0&&X.items!==void 0&&(oe.items=l.mergeEvaluated.items(be,X.items,oe.items,ee)))}mergeValidEvaluated(X,ee){const{it:oe,gen:be}=this;if(oe.opts.unevaluated&&(oe.props!==!0||oe.items!==!0))return be.if(ee,()=>this.mergeEvaluated(X,i.Name)),!0}}fo.KeywordCxt=Q;function pe(G,X,ee,oe){const be=new Q(G,ee,X);"code"in ee?ee.code(be,oe):be.$data&&ee.validate?(0,a.funcKeywordCode)(be,ee):"macro"in ee?(0,a.macroKeywordCode)(be,ee):(ee.compile||ee.validate)&&(0,a.funcKeywordCode)(be,ee)}const ce=/^\/(?:[^~]|~0|~1)*$/,Ee=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Ne(G,{dataLevel:X,dataNames:ee,dataPathArr:oe}){let be,Oe;if(G==="")return c.default.rootData;if(G[0]==="/"){if(!ce.test(G))throw new Error(`Invalid JSON-pointer: ${G}`);be=G,Oe=c.default.rootData}else{const Se=Ee.exec(G);if(!Se)throw new Error(`Invalid JSON-pointer: ${G}`);const re=+Se[1];if(be=Se[2],be==="#"){if(re>=X)throw new Error(ze("property/index",re));return oe[X-re]}if(re>X)throw new Error(ze("data",re));if(Oe=ee[X-re],!be)return Oe}let fe=Oe;const ve=be.split("/");for(const Se of ve)Se&&(Oe=(0,i._)`${Oe}${(0,i.getProperty)((0,l.unescapeJsonPointer)(Se))}`,fe=(0,i._)`${fe} && ${Oe}`);return fe;function ze(Se,re){return`Cannot access ${Se} ${re} levels up, current level is ${X}`}}return fo.getData=Ne,fo}var rg={},tO;function qI(){if(tO)return rg;tO=1,Object.defineProperty(rg,"__esModule",{value:!0});class e extends Error{constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}return rg.default=e,rg}var sg={},nO;function zx(){if(nO)return sg;nO=1,Object.defineProperty(sg,"__esModule",{value:!0});const e=Bx();class t extends Error{constructor(r,s,a,o){super(o||`can't resolve reference ${a} from id ${s}`),this.missingRef=(0,e.resolveUrl)(r,s,a),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(r,this.missingRef))}}return sg.default=t,sg}var is={},rO;function Hx(){if(rO)return is;rO=1,Object.defineProperty(is,"__esModule",{value:!0}),is.resolveSchema=is.getCompilingSchema=is.resolveRef=is.compileSchema=is.SchemaEnv=void 0;const e=ct(),t=qI(),n=Ia(),r=Bx(),s=pt(),a=Ux();class o{constructor(b){var x;this.refs={},this.dynamicAnchors={};let k;typeof b.schema=="object"&&(k=b.schema),this.schema=b.schema,this.schemaId=b.schemaId,this.root=b.root||this,this.baseId=(x=b.baseId)!==null&&x!==void 0?x:(0,r.normalizeId)(k?.[b.schemaId||"$id"]),this.schemaPath=b.schemaPath,this.localRefs=b.localRefs,this.meta=b.meta,this.$async=k?.$async,this.refs={}}}is.SchemaEnv=o;function i(g){const b=l.call(this,g);if(b)return b;const x=(0,r.getFullPath)(this.opts.uriResolver,g.root.baseId),{es5:k,lines:_}=this.opts.code,{ownProperties:S}=this.opts,w=new e.CodeGen(this.scope,{es5:k,lines:_,ownProperties:S});let T;g.$async&&(T=w.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const A=w.scopeName("validate");g.validateName=A;const L={gen:w,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:w.scopeValue("schema",this.opts.code.source===!0?{ref:g.schema,code:(0,e.stringify)(g.schema)}:{ref:g.schema}),validateName:A,ValidationError:T,schema:g.schema,schemaEnv:g,rootId:x,baseId:g.baseId||x,schemaPath:e.nil,errSchemaPath:g.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let R;try{this._compilations.add(g),(0,a.validateFunctionCode)(L),w.optimize(this.opts.code.optimize);const j=w.toString();R=`${w.scopeRefs(n.default.scope)}return ${j}`,this.opts.code.process&&(R=this.opts.code.process(R,g));const K=new Function(`${n.default.self}`,`${n.default.scope}`,R)(this,this.scope.get());if(this.scope.value(A,{ref:K}),K.errors=null,K.schema=g.schema,K.schemaEnv=g,g.$async&&(K.$async=!0),this.opts.code.source===!0&&(K.source={validateName:A,validateCode:j,scopeValues:w._values}),this.opts.unevaluated){const{props:Y,items:W}=L;K.evaluated={props:Y instanceof e.Name?void 0:Y,items:W instanceof e.Name?void 0:W,dynamicProps:Y instanceof e.Name,dynamicItems:W instanceof e.Name},K.source&&(K.source.evaluated=(0,e.stringify)(K.evaluated))}return g.validate=K,g}catch(j){throw delete g.validate,delete g.validateName,R&&this.logger.error("Error compiling schema, function code:",R),j}finally{this._compilations.delete(g)}}is.compileSchema=i;function c(g,b,x){var k;x=(0,r.resolveUrl)(this.opts.uriResolver,b,x);const _=g.refs[x];if(_)return _;let S=h.call(this,g,x);if(S===void 0){const w=(k=g.localRefs)===null||k===void 0?void 0:k[x],{schemaId:T}=this.opts;w&&(S=new o({schema:w,schemaId:T,root:g,baseId:b}))}if(S!==void 0)return g.refs[x]=u.call(this,S)}is.resolveRef=c;function u(g){return(0,r.inlineRef)(g.schema,this.opts.inlineRefs)?g.schema:g.validate?g:i.call(this,g)}function l(g){for(const b of this._compilations)if(d(b,g))return b}is.getCompilingSchema=l;function d(g,b){return g.schema===b.schema&&g.root===b.root&&g.baseId===b.baseId}function h(g,b){let x;for(;typeof(x=this.refs[b])=="string";)b=x;return x||this.schemas[b]||m.call(this,g,b)}function m(g,b){const x=this.opts.uriResolver.parse(b),k=(0,r._getFullPath)(this.opts.uriResolver,x);let _=(0,r.getFullPath)(this.opts.uriResolver,g.baseId,void 0);if(Object.keys(g.schema).length>0&&k===_)return y.call(this,x,g);const S=(0,r.normalizeId)(k),w=this.refs[S]||this.schemas[S];if(typeof w=="string"){const T=m.call(this,g,w);return typeof T?.schema!="object"?void 0:y.call(this,x,T)}if(typeof w?.schema=="object"){if(w.validate||i.call(this,w),S===(0,r.normalizeId)(b)){const{schema:T}=w,{schemaId:A}=this.opts,L=T[A];return L&&(_=(0,r.resolveUrl)(this.opts.uriResolver,_,L)),new o({schema:T,schemaId:A,root:g,baseId:_})}return y.call(this,x,w)}}is.resolveSchema=m;const p=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(g,{baseId:b,schema:x,root:k}){var _;if(((_=g.fragment)===null||_===void 0?void 0:_[0])!=="/")return;for(const T of g.fragment.slice(1).split("/")){if(typeof x=="boolean")return;const A=x[(0,s.unescapeFragment)(T)];if(A===void 0)return;x=A;const L=typeof x=="object"&&x[this.opts.schemaId];!p.has(T)&&L&&(b=(0,r.resolveUrl)(this.opts.uriResolver,b,L))}let S;if(typeof x!="boolean"&&x.$ref&&!(0,s.schemaHasRulesButRef)(x,this.RULES)){const T=(0,r.resolveUrl)(this.opts.uriResolver,b,x.$ref);S=m.call(this,k,T)}const{schemaId:w}=this.opts;if(S=S||new o({schema:x,schemaId:w,root:k,baseId:b}),S.schema!==S.root.schema)return S}return is}const hye="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",mye="Meta-schema for $data reference (JSON AnySchema extension proposal)",pye="object",gye=["$data"],bye={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},yye=!1,xye={$id:hye,description:mye,type:pye,required:gye,properties:bye,additionalProperties:yye};var ag={},Tf={exports:{}},qv,sO;function kU(){if(sO)return qv;sO=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function n(h){let m="",p=0,y=0;for(y=0;y<h.length;y++)if(p=h[y].charCodeAt(0),p!==48){if(!(p>=48&&p<=57||p>=65&&p<=70||p>=97&&p<=102))return"";m+=h[y];break}for(y+=1;y<h.length;y++){if(p=h[y].charCodeAt(0),!(p>=48&&p<=57||p>=65&&p<=70||p>=97&&p<=102))return"";m+=h[y]}return m}const r=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function s(h){return h.length=0,!0}function a(h,m,p){if(h.length){const y=n(h);if(y!=="")m.push(y);else return p.error=!0,!1;h.length=0}return!0}function o(h){let m=0;const p={error:!1,address:"",zone:""},y=[],g=[];let b=!1,x=!1,k=a;for(let _=0;_<h.length;_++){const S=h[_];if(!(S==="["||S==="]"))if(S===":"){if(b===!0&&(x=!0),!k(g,y,p))break;if(++m>7){p.error=!0;break}_>0&&h[_-1]===":"&&(b=!0),y.push(":");continue}else if(S==="%"){if(!k(g,y,p))break;k=s}else{g.push(S);continue}}return g.length&&(k===s?p.zone=g.join(""):x?y.push(g.join("")):y.push(n(g))),p.address=y.join(""),p}function i(h){if(c(h,":")<2)return{host:h,isIPV6:!1};const m=o(h);if(m.error)return{host:h,isIPV6:!1};{let p=m.address,y=m.address;return m.zone&&(p+="%"+m.zone,y+="%25"+m.zone),{host:p,isIPV6:!0,escapedHost:y}}}function c(h,m){let p=0;for(let y=0;y<h.length;y++)h[y]===m&&p++;return p}function u(h){let m=h;const p=[];let y=-1,g=0;for(;g=m.length;){if(g===1){if(m===".")break;if(m==="/"){p.push("/");break}else{p.push(m);break}}else if(g===2){if(m[0]==="."){if(m[1]===".")break;if(m[1]==="/"){m=m.slice(2);continue}}else if(m[0]==="/"&&(m[1]==="."||m[1]==="/")){p.push("/");break}}else if(g===3&&m==="/.."){p.length!==0&&p.pop(),p.push("/");break}if(m[0]==="."){if(m[1]==="."){if(m[2]==="/"){m=m.slice(3);continue}}else if(m[1]==="/"){m=m.slice(2);continue}}else if(m[0]==="/"&&m[1]==="."){if(m[2]==="/"){m=m.slice(2);continue}else if(m[2]==="."&&m[3]==="/"){m=m.slice(3),p.length!==0&&p.pop();continue}}if((y=m.indexOf("/",1))===-1){p.push(m);break}else p.push(m.slice(0,y)),m=m.slice(y)}return p.join("")}function l(h,m){const p=m!==!0?escape:unescape;return h.scheme!==void 0&&(h.scheme=p(h.scheme)),h.userinfo!==void 0&&(h.userinfo=p(h.userinfo)),h.host!==void 0&&(h.host=p(h.host)),h.path!==void 0&&(h.path=p(h.path)),h.query!==void 0&&(h.query=p(h.query)),h.fragment!==void 0&&(h.fragment=p(h.fragment)),h}function d(h){const m=[];if(h.userinfo!==void 0&&(m.push(h.userinfo),m.push("@")),h.host!==void 0){let p=unescape(h.host);if(!t(p)){const y=i(p);y.isIPV6===!0?p=`[${y.escapedHost}]`:p=h.host}m.push(p)}return(typeof h.port=="number"||typeof h.port=="string")&&(m.push(":"),m.push(String(h.port))),m.length?m.join(""):void 0}return qv={nonSimpleDomain:r,recomposeAuthority:d,normalizeComponentEncoding:l,removeDotSegments:u,isIPv4:t,isUUID:e,normalizeIPv6:i,stringArrayToHexStripped:n},qv}var Vv,aO;function kye(){if(aO)return Vv;aO=1;const{isUUID:e}=kU(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function r(S){return n.indexOf(S)!==-1}function s(S){return S.secure===!0?!0:S.secure===!1?!1:S.scheme?S.scheme.length===3&&(S.scheme[0]==="w"||S.scheme[0]==="W")&&(S.scheme[1]==="s"||S.scheme[1]==="S")&&(S.scheme[2]==="s"||S.scheme[2]==="S"):!1}function a(S){return S.host||(S.error=S.error||"HTTP URIs must have a host."),S}function o(S){const w=String(S.scheme).toLowerCase()==="https";return(S.port===(w?443:80)||S.port==="")&&(S.port=void 0),S.path||(S.path="/"),S}function i(S){return S.secure=s(S),S.resourceName=(S.path||"/")+(S.query?"?"+S.query:""),S.path=void 0,S.query=void 0,S}function c(S){if((S.port===(s(S)?443:80)||S.port==="")&&(S.port=void 0),typeof S.secure=="boolean"&&(S.scheme=S.secure?"wss":"ws",S.secure=void 0),S.resourceName){const[w,T]=S.resourceName.split("?");S.path=w&&w!=="/"?w:void 0,S.query=T,S.resourceName=void 0}return S.fragment=void 0,S}function u(S,w){if(!S.path)return S.error="URN can not be parsed",S;const T=S.path.match(t);if(T){const A=w.scheme||S.scheme||"urn";S.nid=T[1].toLowerCase(),S.nss=T[2];const L=`${A}:${w.nid||S.nid}`,R=_(L);S.path=void 0,R&&(S=R.parse(S,w))}else S.error=S.error||"URN can not be parsed.";return S}function l(S,w){if(S.nid===void 0)throw new Error("URN without nid cannot be serialized");const T=w.scheme||S.scheme||"urn",A=S.nid.toLowerCase(),L=`${T}:${w.nid||A}`,R=_(L);R&&(S=R.serialize(S,w));const j=S,F=S.nss;return j.path=`${A||w.nid}:${F}`,w.skipEscape=!0,j}function d(S,w){const T=S;return T.uuid=T.nss,T.nss=void 0,!w.tolerant&&(!T.uuid||!e(T.uuid))&&(T.error=T.error||"UUID is not valid."),T}function h(S){const w=S;return w.nss=(S.uuid||"").toLowerCase(),w}const m={scheme:"http",domainHost:!0,parse:a,serialize:o},p={scheme:"https",domainHost:m.domainHost,parse:a,serialize:o},y={scheme:"ws",domainHost:!0,parse:i,serialize:c},g={scheme:"wss",domainHost:y.domainHost,parse:y.parse,serialize:y.serialize},k={http:m,https:p,ws:y,wss:g,urn:{scheme:"urn",parse:u,serialize:l,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:d,serialize:h,skipNormalize:!0}};Object.setPrototypeOf(k,null);function _(S){return S&&(k[S]||k[S.toLowerCase()])||void 0}return Vv={wsIsSecure:s,SCHEMES:k,isValidSchemeName:r,getSchemeHandler:_},Vv}var oO;function vye(){if(oO)return Tf.exports;oO=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:n,normalizeComponentEncoding:r,isIPv4:s,nonSimpleDomain:a}=kU(),{SCHEMES:o,getSchemeHandler:i}=kye();function c(g,b){return typeof g=="string"?g=h(p(g,b),b):typeof g=="object"&&(g=p(h(g,b),b)),g}function u(g,b,x){const k=x?Object.assign({scheme:"null"},x):{scheme:"null"},_=l(p(g,k),p(b,k),k,!0);return k.skipEscape=!0,h(_,k)}function l(g,b,x,k){const _={};return k||(g=p(h(g,x),x),b=p(h(b,x),x)),x=x||{},!x.tolerant&&b.scheme?(_.scheme=b.scheme,_.userinfo=b.userinfo,_.host=b.host,_.port=b.port,_.path=t(b.path||""),_.query=b.query):(b.userinfo!==void 0||b.host!==void 0||b.port!==void 0?(_.userinfo=b.userinfo,_.host=b.host,_.port=b.port,_.path=t(b.path||""),_.query=b.query):(b.path?(b.path[0]==="/"?_.path=t(b.path):((g.userinfo!==void 0||g.host!==void 0||g.port!==void 0)&&!g.path?_.path="/"+b.path:g.path?_.path=g.path.slice(0,g.path.lastIndexOf("/")+1)+b.path:_.path=b.path,_.path=t(_.path)),_.query=b.query):(_.path=g.path,b.query!==void 0?_.query=b.query:_.query=g.query),_.userinfo=g.userinfo,_.host=g.host,_.port=g.port),_.scheme=g.scheme),_.fragment=b.fragment,_}function d(g,b,x){return typeof g=="string"?(g=unescape(g),g=h(r(p(g,x),!0),{...x,skipEscape:!0})):typeof g=="object"&&(g=h(r(g,!0),{...x,skipEscape:!0})),typeof b=="string"?(b=unescape(b),b=h(r(p(b,x),!0),{...x,skipEscape:!0})):typeof b=="object"&&(b=h(r(b,!0),{...x,skipEscape:!0})),g.toLowerCase()===b.toLowerCase()}function h(g,b){const x={host:g.host,scheme:g.scheme,userinfo:g.userinfo,port:g.port,path:g.path,query:g.query,nid:g.nid,nss:g.nss,uuid:g.uuid,fragment:g.fragment,reference:g.reference,resourceName:g.resourceName,secure:g.secure,error:""},k=Object.assign({},b),_=[],S=i(k.scheme||x.scheme);S&&S.serialize&&S.serialize(x,k),x.path!==void 0&&(k.skipEscape?x.path=unescape(x.path):(x.path=escape(x.path),x.scheme!==void 0&&(x.path=x.path.split("%3A").join(":")))),k.reference!=="suffix"&&x.scheme&&_.push(x.scheme,":");const w=n(x);if(w!==void 0&&(k.reference!=="suffix"&&_.push("//"),_.push(w),x.path&&x.path[0]!=="/"&&_.push("/")),x.path!==void 0){let T=x.path;!k.absolutePath&&(!S||!S.absolutePath)&&(T=t(T)),w===void 0&&T[0]==="/"&&T[1]==="/"&&(T="/%2F"+T.slice(2)),_.push(T)}return x.query!==void 0&&_.push("?",x.query),x.fragment!==void 0&&_.push("#",x.fragment),_.join("")}const m=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function p(g,b){const x=Object.assign({},b),k={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let _=!1;x.reference==="suffix"&&(x.scheme?g=x.scheme+":"+g:g="//"+g);const S=g.match(m);if(S){if(k.scheme=S[1],k.userinfo=S[3],k.host=S[4],k.port=parseInt(S[5],10),k.path=S[6]||"",k.query=S[7],k.fragment=S[8],isNaN(k.port)&&(k.port=S[5]),k.host)if(s(k.host)===!1){const A=e(k.host);k.host=A.host.toLowerCase(),_=A.isIPV6}else _=!0;k.scheme===void 0&&k.userinfo===void 0&&k.host===void 0&&k.port===void 0&&k.query===void 0&&!k.path?k.reference="same-document":k.scheme===void 0?k.reference="relative":k.fragment===void 0?k.reference="absolute":k.reference="uri",x.reference&&x.reference!=="suffix"&&x.reference!==k.reference&&(k.error=k.error||"URI is not a "+x.reference+" reference.");const w=i(x.scheme||k.scheme);if(!x.unicodeSupport&&(!w||!w.unicodeSupport)&&k.host&&(x.domainHost||w&&w.domainHost)&&_===!1&&a(k.host))try{k.host=URL.domainToASCII(k.host.toLowerCase())}catch(T){k.error=k.error||"Host's domain name can not be converted to ASCII: "+T}(!w||w&&!w.skipNormalize)&&(g.indexOf("%")!==-1&&(k.scheme!==void 0&&(k.scheme=unescape(k.scheme)),k.host!==void 0&&(k.host=unescape(k.host))),k.path&&(k.path=escape(unescape(k.path))),k.fragment&&(k.fragment=encodeURI(decodeURIComponent(k.fragment)))),w&&w.parse&&w.parse(k,x)}else k.error=k.error||"URI can not be parsed.";return k}const y={SCHEMES:o,normalize:c,resolve:u,resolveComponent:l,equal:d,serialize:h,parse:p};return Tf.exports=y,Tf.exports.default=y,Tf.exports.fastUri=y,Tf.exports}var iO;function Sye(){if(iO)return ag;iO=1,Object.defineProperty(ag,"__esModule",{value:!0});const e=vye();return e.code='require("ajv/dist/runtime/uri").default',ag.default=e,ag}var cO;function wye(){return cO||(cO=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Ux();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=ct();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const r=qI(),s=zx(),a=bU(),o=Hx(),i=ct(),c=Bx(),u=I0(),l=pt(),d=xye,h=Sye(),m=(I,U)=>new RegExp(I,U);m.code="new RegExp";const p=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},b={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},x=200;function k(I){var U,V,N,P,D,Q,pe,ce,Ee,Ne,G,X,ee,oe,be,Oe,fe,ve,ze,Se,re,Ie,We,Ft,an;const te=I.strict,ue=(U=I.code)===null||U===void 0?void 0:U.optimize,$e=ue===!0||ue===void 0?1:ue||0,we=(N=(V=I.code)===null||V===void 0?void 0:V.regExp)!==null&&N!==void 0?N:m,Ge=(P=I.uriResolver)!==null&&P!==void 0?P:h.default;return{strictSchema:(Q=(D=I.strictSchema)!==null&&D!==void 0?D:te)!==null&&Q!==void 0?Q:!0,strictNumbers:(ce=(pe=I.strictNumbers)!==null&&pe!==void 0?pe:te)!==null&&ce!==void 0?ce:!0,strictTypes:(Ne=(Ee=I.strictTypes)!==null&&Ee!==void 0?Ee:te)!==null&&Ne!==void 0?Ne:"log",strictTuples:(X=(G=I.strictTuples)!==null&&G!==void 0?G:te)!==null&&X!==void 0?X:"log",strictRequired:(oe=(ee=I.strictRequired)!==null&&ee!==void 0?ee:te)!==null&&oe!==void 0?oe:!1,code:I.code?{...I.code,optimize:$e,regExp:we}:{optimize:$e,regExp:we},loopRequired:(be=I.loopRequired)!==null&&be!==void 0?be:x,loopEnum:(Oe=I.loopEnum)!==null&&Oe!==void 0?Oe:x,meta:(fe=I.meta)!==null&&fe!==void 0?fe:!0,messages:(ve=I.messages)!==null&&ve!==void 0?ve:!0,inlineRefs:(ze=I.inlineRefs)!==null&&ze!==void 0?ze:!0,schemaId:(Se=I.schemaId)!==null&&Se!==void 0?Se:"$id",addUsedSchema:(re=I.addUsedSchema)!==null&&re!==void 0?re:!0,validateSchema:(Ie=I.validateSchema)!==null&&Ie!==void 0?Ie:!0,validateFormats:(We=I.validateFormats)!==null&&We!==void 0?We:!0,unicodeRegExp:(Ft=I.unicodeRegExp)!==null&&Ft!==void 0?Ft:!0,int32range:(an=I.int32range)!==null&&an!==void 0?an:!0,uriResolver:Ge}}class _{constructor(U={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,U=this.opts={...U,...k(U)};const{es5:V,lines:N}=this.opts.code;this.scope=new i.ValueScope({scope:{},prefixes:y,es5:V,lines:N}),this.logger=F(U.logger);const P=U.validateFormats;U.validateFormats=!1,this.RULES=(0,a.getRules)(),S.call(this,g,U,"NOT SUPPORTED"),S.call(this,b,U,"DEPRECATED","warn"),this._metaOpts=R.call(this),U.formats&&A.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),U.keywords&&L.call(this,U.keywords),typeof U.meta=="object"&&this.addMetaSchema(U.meta),T.call(this),U.validateFormats=P}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:U,meta:V,schemaId:N}=this.opts;let P=d;N==="id"&&(P={...d},P.id=P.$id,delete P.$id),V&&U&&this.addMetaSchema(P,P[N],!1)}defaultMeta(){const{meta:U,schemaId:V}=this.opts;return this.opts.defaultMeta=typeof U=="object"?U[V]||U:void 0}validate(U,V){let N;if(typeof U=="string"){if(N=this.getSchema(U),!N)throw new Error(`no schema with key or ref "${U}"`)}else N=this.compile(U);const P=N(V);return"$async"in N||(this.errors=N.errors),P}compile(U,V){const N=this._addSchema(U,V);return N.validate||this._compileSchemaEnv(N)}compileAsync(U,V){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:N}=this.opts;return P.call(this,U,V);async function P(Ne,G){await D.call(this,Ne.$schema);const X=this._addSchema(Ne,G);return X.validate||Q.call(this,X)}async function D(Ne){Ne&&!this.getSchema(Ne)&&await P.call(this,{$ref:Ne},!0)}async function Q(Ne){try{return this._compileSchemaEnv(Ne)}catch(G){if(!(G instanceof s.default))throw G;return pe.call(this,G),await ce.call(this,G.missingSchema),Q.call(this,Ne)}}function pe({missingSchema:Ne,missingRef:G}){if(this.refs[Ne])throw new Error(`AnySchema ${Ne} is loaded but ${G} cannot be resolved`)}async function ce(Ne){const G=await Ee.call(this,Ne);this.refs[Ne]||await D.call(this,G.$schema),this.refs[Ne]||this.addSchema(G,Ne,V)}async function Ee(Ne){const G=this._loading[Ne];if(G)return G;try{return await(this._loading[Ne]=N(Ne))}finally{delete this._loading[Ne]}}}addSchema(U,V,N,P=this.opts.validateSchema){if(Array.isArray(U)){for(const Q of U)this.addSchema(Q,void 0,N,P);return this}let D;if(typeof U=="object"){const{schemaId:Q}=this.opts;if(D=U[Q],D!==void 0&&typeof D!="string")throw new Error(`schema ${Q} must be string`)}return V=(0,c.normalizeId)(V||D),this._checkUnique(V),this.schemas[V]=this._addSchema(U,N,V,P,!0),this}addMetaSchema(U,V,N=this.opts.validateSchema){return this.addSchema(U,V,!0,N),this}validateSchema(U,V){if(typeof U=="boolean")return!0;let N;if(N=U.$schema,N!==void 0&&typeof N!="string")throw new Error("$schema must be a string");if(N=N||this.opts.defaultMeta||this.defaultMeta(),!N)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const P=this.validate(N,U);if(!P&&V){const D="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(D);else throw new Error(D)}return P}getSchema(U){let V;for(;typeof(V=w.call(this,U))=="string";)U=V;if(V===void 0){const{schemaId:N}=this.opts,P=new o.SchemaEnv({schema:{},schemaId:N});if(V=o.resolveSchema.call(this,P,U),!V)return;this.refs[U]=V}return V.validate||this._compileSchemaEnv(V)}removeSchema(U){if(U instanceof RegExp)return this._removeAllSchemas(this.schemas,U),this._removeAllSchemas(this.refs,U),this;switch(typeof U){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const V=w.call(this,U);return typeof V=="object"&&this._cache.delete(V.schema),delete this.schemas[U],delete this.refs[U],this}case"object":{const V=U;this._cache.delete(V);let N=U[this.opts.schemaId];return N&&(N=(0,c.normalizeId)(N),delete this.schemas[N],delete this.refs[N]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(U){for(const V of U)this.addKeyword(V);return this}addKeyword(U,V){let N;if(typeof U=="string")N=U,typeof V=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),V.keyword=N);else if(typeof U=="object"&&V===void 0){if(V=U,N=V.keyword,Array.isArray(N)&&!N.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Y.call(this,N,V),!V)return(0,l.eachItem)(N,D=>W.call(this,D)),this;ae.call(this,V);const P={...V,type:(0,u.getJSONTypes)(V.type),schemaType:(0,u.getJSONTypes)(V.schemaType)};return(0,l.eachItem)(N,P.type.length===0?D=>W.call(this,D,P):D=>P.type.forEach(Q=>W.call(this,D,P,Q))),this}getKeyword(U){const V=this.RULES.all[U];return typeof V=="object"?V.definition:!!V}removeKeyword(U){const{RULES:V}=this;delete V.keywords[U],delete V.all[U];for(const N of V.rules){const P=N.rules.findIndex(D=>D.keyword===U);P>=0&&N.rules.splice(P,1)}return this}addFormat(U,V){return typeof V=="string"&&(V=new RegExp(V)),this.formats[U]=V,this}errorsText(U=this.errors,{separator:V=", ",dataVar:N="data"}={}){return!U||U.length===0?"No errors":U.map(P=>`${N}${P.instancePath} ${P.message}`).reduce((P,D)=>P+V+D)}$dataMetaSchema(U,V){const N=this.RULES.all;U=JSON.parse(JSON.stringify(U));for(const P of V){const D=P.split("/").slice(1);let Q=U;for(const pe of D)Q=Q[pe];for(const pe in N){const ce=N[pe];if(typeof ce!="object")continue;const{$data:Ee}=ce.definition,Ne=Q[pe];Ee&&Ne&&(Q[pe]=le(Ne))}}return U}_removeAllSchemas(U,V){for(const N in U){const P=U[N];(!V||V.test(N))&&(typeof P=="string"?delete U[N]:P&&!P.meta&&(this._cache.delete(P.schema),delete U[N]))}}_addSchema(U,V,N,P=this.opts.validateSchema,D=this.opts.addUsedSchema){let Q;const{schemaId:pe}=this.opts;if(typeof U=="object")Q=U[pe];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof U!="boolean")throw new Error("schema must be object or boolean")}let ce=this._cache.get(U);if(ce!==void 0)return ce;N=(0,c.normalizeId)(Q||N);const Ee=c.getSchemaRefs.call(this,U,N);return ce=new o.SchemaEnv({schema:U,schemaId:pe,meta:V,baseId:N,localRefs:Ee}),this._cache.set(ce.schema,ce),D&&!N.startsWith("#")&&(N&&this._checkUnique(N),this.refs[N]=ce),P&&this.validateSchema(U,!0),ce}_checkUnique(U){if(this.schemas[U]||this.refs[U])throw new Error(`schema with key or id "${U}" already exists`)}_compileSchemaEnv(U){if(U.meta?this._compileMetaSchema(U):o.compileSchema.call(this,U),!U.validate)throw new Error("ajv implementation error");return U.validate}_compileMetaSchema(U){const V=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,U)}finally{this.opts=V}}}_.ValidationError=r.default,_.MissingRefError=s.default,e.default=_;function S(I,U,V,N="error"){for(const P in I){const D=P;D in U&&this.logger[N](`${V}: option ${P}. ${I[D]}`)}}function w(I){return I=(0,c.normalizeId)(I),this.schemas[I]||this.refs[I]}function T(){const I=this.opts.schemas;if(I)if(Array.isArray(I))this.addSchema(I);else for(const U in I)this.addSchema(I[U],U)}function A(){for(const I in this.opts.formats){const U=this.opts.formats[I];U&&this.addFormat(I,U)}}function L(I){if(Array.isArray(I)){this.addVocabulary(I);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const U in I){const V=I[U];V.keyword||(V.keyword=U),this.addKeyword(V)}}function R(){const I={...this.opts};for(const U of p)delete I[U];return I}const j={log(){},warn(){},error(){}};function F(I){if(I===!1)return j;if(I===void 0)return console;if(I.log&&I.warn&&I.error)return I;throw new Error("logger must implement log, warn and error methods")}const K=/^[a-z_$][a-z0-9_$:-]*$/i;function Y(I,U){const{RULES:V}=this;if((0,l.eachItem)(I,N=>{if(V.keywords[N])throw new Error(`Keyword ${N} is already defined`);if(!K.test(N))throw new Error(`Keyword ${N} has invalid name`)}),!!U&&U.$data&&!("code"in U||"validate"in U))throw new Error('$data keyword must have "code" or "validate" function')}function W(I,U,V){var N;const P=U?.post;if(V&&P)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:D}=this;let Q=P?D.post:D.rules.find(({type:ce})=>ce===V);if(Q||(Q={type:V,rules:[]},D.rules.push(Q)),D.keywords[I]=!0,!U)return;const pe={keyword:I,definition:{...U,type:(0,u.getJSONTypes)(U.type),schemaType:(0,u.getJSONTypes)(U.schemaType)}};U.before?J.call(this,Q,pe,U.before):Q.rules.push(pe),D.all[I]=pe,(N=U.implements)===null||N===void 0||N.forEach(ce=>this.addKeyword(ce))}function J(I,U,V){const N=I.rules.findIndex(P=>P.keyword===V);N>=0?I.rules.splice(N,0,U):(I.rules.push(U),this.logger.warn(`rule ${V} is not defined`))}function ae(I){let{metaSchema:U}=I;U!==void 0&&(I.$data&&this.opts.$data&&(U=le(U)),I.validateSchema=this.compile(U,!0))}const ge={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function le(I){return{anyOf:[I,ge]}}})(Mv)),Mv}var og={},ig={},cg={},uO;function _ye(){if(uO)return cg;uO=1,Object.defineProperty(cg,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return cg.default=e,cg}var Qo={},lO;function VI(){if(lO)return Qo;lO=1,Object.defineProperty(Qo,"__esModule",{value:!0}),Qo.callRef=Qo.getValidate=void 0;const e=zx(),t=Aa(),n=ct(),r=Ia(),s=Hx(),a=pt(),o={keyword:"$ref",schemaType:"string",code(u){const{gen:l,schema:d,it:h}=u,{baseId:m,schemaEnv:p,validateName:y,opts:g,self:b}=h,{root:x}=p;if((d==="#"||d==="#/")&&m===x.baseId)return _();const k=s.resolveRef.call(b,x,m,d);if(k===void 0)throw new e.default(h.opts.uriResolver,m,d);if(k instanceof s.SchemaEnv)return S(k);return w(k);function _(){if(p===x)return c(u,y,p,p.$async);const T=l.scopeValue("root",{ref:x});return c(u,(0,n._)`${T}.validate`,x,x.$async)}function S(T){const A=i(u,T);c(u,A,T,T.$async)}function w(T){const A=l.scopeValue("schema",g.code.source===!0?{ref:T,code:(0,n.stringify)(T)}:{ref:T}),L=l.name("valid"),R=u.subschema({schema:T,dataTypes:[],schemaPath:n.nil,topSchemaRef:A,errSchemaPath:d},L);u.mergeEvaluated(R),u.ok(L)}}};function i(u,l){const{gen:d}=u;return l.validate?d.scopeValue("validate",{ref:l.validate}):(0,n._)`${d.scopeValue("wrapper",{ref:l})}.validate`}Qo.getValidate=i;function c(u,l,d,h){const{gen:m,it:p}=u,{allErrors:y,schemaEnv:g,opts:b}=p,x=b.passContext?r.default.this:n.nil;h?k():_();function k(){if(!g.$async)throw new Error("async schema referenced by sync schema");const T=m.let("valid");m.try(()=>{m.code((0,n._)`await ${(0,t.callValidateCode)(u,l,x)}`),w(l),y||m.assign(T,!0)},A=>{m.if((0,n._)`!(${A} instanceof ${p.ValidationError})`,()=>m.throw(A)),S(A),y||m.assign(T,!1)}),u.ok(T)}function _(){u.result((0,t.callValidateCode)(u,l,x),()=>w(l),()=>S(l))}function S(T){const A=(0,n._)`${T}.errors`;m.assign(r.default.vErrors,(0,n._)`${r.default.vErrors} === null ? ${A} : ${r.default.vErrors}.concat(${A})`),m.assign(r.default.errors,(0,n._)`${r.default.vErrors}.length`)}function w(T){var A;if(!p.opts.unevaluated)return;const L=(A=d?.validate)===null||A===void 0?void 0:A.evaluated;if(p.props!==!0)if(L&&!L.dynamicProps)L.props!==void 0&&(p.props=a.mergeEvaluated.props(m,L.props,p.props));else{const R=m.var("props",(0,n._)`${T}.evaluated.props`);p.props=a.mergeEvaluated.props(m,R,p.props,n.Name)}if(p.items!==!0)if(L&&!L.dynamicItems)L.items!==void 0&&(p.items=a.mergeEvaluated.items(m,L.items,p.items));else{const R=m.var("items",(0,n._)`${T}.evaluated.items`);p.items=a.mergeEvaluated.items(m,R,p.items,n.Name)}}}return Qo.callRef=c,Qo.default=o,Qo}var dO;function Eye(){if(dO)return ig;dO=1,Object.defineProperty(ig,"__esModule",{value:!0});const e=_ye(),t=VI(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return ig.default=n,ig}var ug={},lg={},fO;function Tye(){if(fO)return lg;fO=1,Object.defineProperty(lg,"__esModule",{value:!0});const e=ct(),t=e.operators,n={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},r={message:({keyword:a,schemaCode:o})=>(0,e.str)`must be ${n[a].okStr} ${o}`,params:({keyword:a,schemaCode:o})=>(0,e._)`{comparison: ${n[a].okStr}, limit: ${o}}`},s={keyword:Object.keys(n),type:"number",schemaType:"number",$data:!0,error:r,code(a){const{keyword:o,data:i,schemaCode:c}=a;a.fail$data((0,e._)`${i} ${n[o].fail} ${c} || isNaN(${i})`)}};return lg.default=s,lg}var dg={},hO;function Cye(){if(hO)return dg;hO=1,Object.defineProperty(dg,"__esModule",{value:!0});const e=ct(),n={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,e._)`{multipleOf: ${r}}`},code(r){const{gen:s,data:a,schemaCode:o,it:i}=r,c=i.opts.multipleOfPrecision,u=s.let("res"),l=c?(0,e._)`Math.abs(Math.round(${u}) - ${u}) > 1e-${c}`:(0,e._)`${u} !== parseInt(${u})`;r.fail$data((0,e._)`(${o} === 0 || (${u} = ${a}/${o}, ${l}))`)}};return dg.default=n,dg}var fg={},hg={},mO;function Iye(){if(mO)return hg;mO=1,Object.defineProperty(hg,"__esModule",{value:!0});function e(t){const n=t.length;let r=0,s=0,a;for(;s<n;)r++,a=t.charCodeAt(s++),a>=55296&&a<=56319&&s<n&&(a=t.charCodeAt(s),(a&64512)===56320&&s++);return r}return hg.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',hg}var pO;function Aye(){if(pO)return fg;pO=1,Object.defineProperty(fg,"__esModule",{value:!0});const e=ct(),t=pt(),n=Iye(),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:a,schemaCode:o}){const i=a==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${i} than ${o} characters`},params:({schemaCode:a})=>(0,e._)`{limit: ${a}}`},code(a){const{keyword:o,data:i,schemaCode:c,it:u}=a,l=o==="maxLength"?e.operators.GT:e.operators.LT,d=u.opts.unicode===!1?(0,e._)`${i}.length`:(0,e._)`${(0,t.useFunc)(a.gen,n.default)}(${i})`;a.fail$data((0,e._)`${d} ${l} ${c}`)}};return fg.default=s,fg}var mg={},gO;function Nye(){if(gO)return mg;gO=1,Object.defineProperty(mg,"__esModule",{value:!0});const e=Aa(),t=pt(),n=ct(),s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:a})=>(0,n.str)`must match pattern "${a}"`,params:({schemaCode:a})=>(0,n._)`{pattern: ${a}}`},code(a){const{gen:o,data:i,$data:c,schema:u,schemaCode:l,it:d}=a,h=d.opts.unicodeRegExp?"u":"";if(c){const{regExp:m}=d.opts.code,p=m.code==="new RegExp"?(0,n._)`new RegExp`:(0,t.useFunc)(o,m),y=o.let("valid");o.try(()=>o.assign(y,(0,n._)`${p}(${l}, ${h}).test(${i})`),()=>o.assign(y,!1)),a.fail$data((0,n._)`!${y}`)}else{const m=(0,e.usePattern)(a,u);a.fail$data((0,n._)`!${m}.test(${i})`)}}};return mg.default=s,mg}var pg={},bO;function Rye(){if(bO)return pg;bO=1,Object.defineProperty(pg,"__esModule",{value:!0});const e=ct(),n={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:s}){const a=r==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${a} than ${s} properties`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:s,data:a,schemaCode:o}=r,i=s==="maxProperties"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`Object.keys(${a}).length ${i} ${o}`)}};return pg.default=n,pg}var gg={},yO;function Pye(){if(yO)return gg;yO=1,Object.defineProperty(gg,"__esModule",{value:!0});const e=Aa(),t=ct(),n=pt(),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:a}})=>(0,t.str)`must have required property '${a}'`,params:({params:{missingProperty:a}})=>(0,t._)`{missingProperty: ${a}}`},code(a){const{gen:o,schema:i,schemaCode:c,data:u,$data:l,it:d}=a,{opts:h}=d;if(!l&&i.length===0)return;const m=i.length>=h.loopRequired;if(d.allErrors?p():y(),h.strictRequired){const x=a.parentSchema.properties,{definedProperties:k}=a.it;for(const _ of i)if(x?.[_]===void 0&&!k.has(_)){const S=d.schemaEnv.baseId+d.errSchemaPath,w=`required property "${_}" is not defined at "${S}" (strictRequired)`;(0,n.checkStrictMode)(d,w,d.opts.strictRequired)}}function p(){if(m||l)a.block$data(t.nil,g);else for(const x of i)(0,e.checkReportMissingProp)(a,x)}function y(){const x=o.let("missing");if(m||l){const k=o.let("valid",!0);a.block$data(k,()=>b(x,k)),a.ok(k)}else o.if((0,e.checkMissingProp)(a,i,x)),(0,e.reportMissingProp)(a,x),o.else()}function g(){o.forOf("prop",c,x=>{a.setParams({missingProperty:x}),o.if((0,e.noPropertyInData)(o,u,x,h.ownProperties),()=>a.error())})}function b(x,k){a.setParams({missingProperty:x}),o.forOf(x,c,()=>{o.assign(k,(0,e.propertyInData)(o,u,x,h.ownProperties)),o.if((0,t.not)(k),()=>{a.error(),o.break()})},t.nil)}}};return gg.default=s,gg}var bg={},xO;function Oye(){if(xO)return bg;xO=1,Object.defineProperty(bg,"__esModule",{value:!0});const e=ct(),n={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:s}){const a=r==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${a} than ${s} items`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:s,data:a,schemaCode:o}=r,i=s==="maxItems"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`${a}.length ${i} ${o}`)}};return bg.default=n,bg}var yg={},xg={},kO;function GI(){if(kO)return xg;kO=1,Object.defineProperty(xg,"__esModule",{value:!0});const e=xU();return e.code='require("ajv/dist/runtime/equal").default',xg.default=e,xg}var vO;function Lye(){if(vO)return yg;vO=1,Object.defineProperty(yg,"__esModule",{value:!0});const e=I0(),t=ct(),n=pt(),r=GI(),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:o,j:i}})=>(0,t.str)`must NOT have duplicate items (items ## ${i} and ${o} are identical)`,params:({params:{i:o,j:i}})=>(0,t._)`{i: ${o}, j: ${i}}`},code(o){const{gen:i,data:c,$data:u,schema:l,parentSchema:d,schemaCode:h,it:m}=o;if(!u&&!l)return;const p=i.let("valid"),y=d.items?(0,e.getSchemaTypes)(d.items):[];o.block$data(p,g,(0,t._)`${h} === false`),o.ok(p);function g(){const _=i.let("i",(0,t._)`${c}.length`),S=i.let("j");o.setParams({i:_,j:S}),i.assign(p,!0),i.if((0,t._)`${_} > 1`,()=>(b()?x:k)(_,S))}function b(){return y.length>0&&!y.some(_=>_==="object"||_==="array")}function x(_,S){const w=i.name("item"),T=(0,e.checkDataTypes)(y,w,m.opts.strictNumbers,e.DataType.Wrong),A=i.const("indices",(0,t._)`{}`);i.for((0,t._)`;${_}--;`,()=>{i.let(w,(0,t._)`${c}[${_}]`),i.if(T,(0,t._)`continue`),y.length>1&&i.if((0,t._)`typeof ${w} == "string"`,(0,t._)`${w} += "_"`),i.if((0,t._)`typeof ${A}[${w}] == "number"`,()=>{i.assign(S,(0,t._)`${A}[${w}]`),o.error(),i.assign(p,!1).break()}).code((0,t._)`${A}[${w}] = ${_}`)})}function k(_,S){const w=(0,n.useFunc)(i,r.default),T=i.name("outer");i.label(T).for((0,t._)`;${_}--;`,()=>i.for((0,t._)`${S} = ${_}; ${S}--;`,()=>i.if((0,t._)`${w}(${c}[${_}], ${c}[${S}])`,()=>{o.error(),i.assign(p,!1).break(T)})))}}};return yg.default=a,yg}var kg={},SO;function $ye(){if(SO)return kg;SO=1,Object.defineProperty(kg,"__esModule",{value:!0});const e=ct(),t=pt(),n=GI(),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:a})=>(0,e._)`{allowedValue: ${a}}`},code(a){const{gen:o,data:i,$data:c,schemaCode:u,schema:l}=a;c||l&&typeof l=="object"?a.fail$data((0,e._)`!${(0,t.useFunc)(o,n.default)}(${i}, ${u})`):a.fail((0,e._)`${l} !== ${i}`)}};return kg.default=s,kg}var vg={},wO;function jye(){if(wO)return vg;wO=1,Object.defineProperty(vg,"__esModule",{value:!0});const e=ct(),t=pt(),n=GI(),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:a})=>(0,e._)`{allowedValues: ${a}}`},code(a){const{gen:o,data:i,$data:c,schema:u,schemaCode:l,it:d}=a;if(!c&&u.length===0)throw new Error("enum must have non-empty array");const h=u.length>=d.opts.loopEnum;let m;const p=()=>m??(m=(0,t.useFunc)(o,n.default));let y;if(h||c)y=o.let("valid"),a.block$data(y,g);else{if(!Array.isArray(u))throw new Error("ajv implementation error");const x=o.const("vSchema",l);y=(0,e.or)(...u.map((k,_)=>b(x,_)))}a.pass(y);function g(){o.assign(y,!1),o.forOf("v",l,x=>o.if((0,e._)`${p()}(${i}, ${x})`,()=>o.assign(y,!0).break()))}function b(x,k){const _=u[k];return typeof _=="object"&&_!==null?(0,e._)`${p()}(${i}, ${x}[${k}])`:(0,e._)`${i} === ${_}`}}};return vg.default=s,vg}var _O;function Mye(){if(_O)return ug;_O=1,Object.defineProperty(ug,"__esModule",{value:!0});const e=Tye(),t=Cye(),n=Aye(),r=Nye(),s=Rye(),a=Pye(),o=Oye(),i=Lye(),c=$ye(),u=jye(),l=[e.default,t.default,n.default,r.default,s.default,a.default,o.default,i.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,u.default];return ug.default=l,ug}var Sg={},Wu={},EO;function vU(){if(EO)return Wu;EO=1,Object.defineProperty(Wu,"__esModule",{value:!0}),Wu.validateAdditionalItems=void 0;const e=ct(),t=pt(),r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:a}})=>(0,e.str)`must NOT have more than ${a} items`,params:({params:{len:a}})=>(0,e._)`{limit: ${a}}`},code(a){const{parentSchema:o,it:i}=a,{items:c}=o;if(!Array.isArray(c)){(0,t.checkStrictMode)(i,'"additionalItems" is ignored when "items" is not an array of schemas');return}s(a,c)}};function s(a,o){const{gen:i,schema:c,data:u,keyword:l,it:d}=a;d.items=!0;const h=i.const("len",(0,e._)`${u}.length`);if(c===!1)a.setParams({len:o.length}),a.pass((0,e._)`${h} <= ${o.length}`);else if(typeof c=="object"&&!(0,t.alwaysValidSchema)(d,c)){const p=i.var("valid",(0,e._)`${h} <= ${o.length}`);i.if((0,e.not)(p),()=>m(p)),a.ok(p)}function m(p){i.forRange("i",o.length,h,y=>{a.subschema({keyword:l,dataProp:y,dataPropType:t.Type.Num},p),d.allErrors||i.if((0,e.not)(p),()=>i.break())})}}return Wu.validateAdditionalItems=s,Wu.default=r,Wu}var wg={},Yu={},TO;function SU(){if(TO)return Yu;TO=1,Object.defineProperty(Yu,"__esModule",{value:!0}),Yu.validateTuple=void 0;const e=ct(),t=pt(),n=Aa(),r={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(a){const{schema:o,it:i}=a;if(Array.isArray(o))return s(a,"additionalItems",o);i.items=!0,!(0,t.alwaysValidSchema)(i,o)&&a.ok((0,n.validateArray)(a))}};function s(a,o,i=a.schema){const{gen:c,parentSchema:u,data:l,keyword:d,it:h}=a;y(u),h.opts.unevaluated&&i.length&&h.items!==!0&&(h.items=t.mergeEvaluated.items(c,i.length,h.items));const m=c.name("valid"),p=c.const("len",(0,e._)`${l}.length`);i.forEach((g,b)=>{(0,t.alwaysValidSchema)(h,g)||(c.if((0,e._)`${p} > ${b}`,()=>a.subschema({keyword:d,schemaProp:b,dataProp:b},m)),a.ok(m))});function y(g){const{opts:b,errSchemaPath:x}=h,k=i.length,_=k===g.minItems&&(k===g.maxItems||g[o]===!1);if(b.strictTuples&&!_){const S=`"${d}" is ${k}-tuple, but minItems or maxItems/${o} are not specified or different at path "${x}"`;(0,t.checkStrictMode)(h,S,b.strictTuples)}}}return Yu.validateTuple=s,Yu.default=r,Yu}var CO;function Dye(){if(CO)return wg;CO=1,Object.defineProperty(wg,"__esModule",{value:!0});const e=SU(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,e.validateTuple)(n,"items")};return wg.default=t,wg}var _g={},IO;function Fye(){if(IO)return _g;IO=1,Object.defineProperty(_g,"__esModule",{value:!0});const e=ct(),t=pt(),n=Aa(),r=vU(),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,e.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,e._)`{limit: ${o}}`},code(o){const{schema:i,parentSchema:c,it:u}=o,{prefixItems:l}=c;u.items=!0,!(0,t.alwaysValidSchema)(u,i)&&(l?(0,r.validateAdditionalItems)(o,l):o.ok((0,n.validateArray)(o)))}};return _g.default=a,_g}var Eg={},AO;function Bye(){if(AO)return Eg;AO=1,Object.defineProperty(Eg,"__esModule",{value:!0});const e=ct(),t=pt(),r={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:s,max:a}})=>a===void 0?(0,e.str)`must contain at least ${s} valid item(s)`:(0,e.str)`must contain at least ${s} and no more than ${a} valid item(s)`,params:({params:{min:s,max:a}})=>a===void 0?(0,e._)`{minContains: ${s}}`:(0,e._)`{minContains: ${s}, maxContains: ${a}}`},code(s){const{gen:a,schema:o,parentSchema:i,data:c,it:u}=s;let l,d;const{minContains:h,maxContains:m}=i;u.opts.next?(l=h===void 0?1:h,d=m):l=1;const p=a.const("len",(0,e._)`${c}.length`);if(s.setParams({min:l,max:d}),d===void 0&&l===0){(0,t.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(d!==void 0&&l>d){(0,t.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),s.fail();return}if((0,t.alwaysValidSchema)(u,o)){let k=(0,e._)`${p} >= ${l}`;d!==void 0&&(k=(0,e._)`${k} && ${p} <= ${d}`),s.pass(k);return}u.items=!0;const y=a.name("valid");d===void 0&&l===1?b(y,()=>a.if(y,()=>a.break())):l===0?(a.let(y,!0),d!==void 0&&a.if((0,e._)`${c}.length > 0`,g)):(a.let(y,!1),g()),s.result(y,()=>s.reset());function g(){const k=a.name("_valid"),_=a.let("count",0);b(k,()=>a.if(k,()=>x(_)))}function b(k,_){a.forRange("i",0,p,S=>{s.subschema({keyword:"contains",dataProp:S,dataPropType:t.Type.Num,compositeRule:!0},k),_()})}function x(k){a.code((0,e._)`${k}++`),d===void 0?a.if((0,e._)`${k} >= ${l}`,()=>a.assign(y,!0).break()):(a.if((0,e._)`${k} > ${d}`,()=>a.assign(y,!1).break()),l===1?a.assign(y,!0):a.if((0,e._)`${k} >= ${l}`,()=>a.assign(y,!0)))}}};return Eg.default=r,Eg}var Gv={},NO;function KI(){return NO||(NO=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=ct(),n=pt(),r=Aa();e.error={message:({params:{property:c,depsCount:u,deps:l}})=>{const d=u===1?"property":"properties";return(0,t.str)`must have ${d} ${l} when property ${c} is present`},params:({params:{property:c,depsCount:u,deps:l,missingProperty:d}})=>(0,t._)`{property: ${c},
|
|
33
|
-
missingProperty: ${d},
|
|
34
|
-
depsCount: ${u},
|
|
35
|
-
deps: ${l}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){const[u,l]=a(c);o(c,u),i(c,l)}};function a({schema:c}){const u={},l={};for(const d in c){if(d==="__proto__")continue;const h=Array.isArray(c[d])?u:l;h[d]=c[d]}return[u,l]}function o(c,u=c.schema){const{gen:l,data:d,it:h}=c;if(Object.keys(u).length===0)return;const m=l.let("missing");for(const p in u){const y=u[p];if(y.length===0)continue;const g=(0,r.propertyInData)(l,d,p,h.opts.ownProperties);c.setParams({property:p,depsCount:y.length,deps:y.join(", ")}),h.allErrors?l.if(g,()=>{for(const b of y)(0,r.checkReportMissingProp)(c,b)}):(l.if((0,t._)`${g} && (${(0,r.checkMissingProp)(c,y,m)})`),(0,r.reportMissingProp)(c,m),l.else())}}e.validatePropertyDeps=o;function i(c,u=c.schema){const{gen:l,data:d,keyword:h,it:m}=c,p=l.name("valid");for(const y in u)(0,n.alwaysValidSchema)(m,u[y])||(l.if((0,r.propertyInData)(l,d,y,m.opts.ownProperties),()=>{const g=c.subschema({keyword:h,schemaProp:y},p);c.mergeValidEvaluated(g,p)},()=>l.var(p,!0)),c.ok(p))}e.validateSchemaDeps=i,e.default=s})(Gv)),Gv}var Tg={},RO;function Uye(){if(RO)return Tg;RO=1,Object.defineProperty(Tg,"__esModule",{value:!0});const e=ct(),t=pt(),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:s})=>(0,e._)`{propertyName: ${s.propertyName}}`},code(s){const{gen:a,schema:o,data:i,it:c}=s;if((0,t.alwaysValidSchema)(c,o))return;const u=a.name("valid");a.forIn("key",i,l=>{s.setParams({propertyName:l}),s.subschema({keyword:"propertyNames",data:l,dataTypes:["string"],propertyName:l,compositeRule:!0},u),a.if((0,e.not)(u),()=>{s.error(!0),c.allErrors||a.break()})}),s.ok(u)}};return Tg.default=r,Tg}var Cg={},PO;function wU(){if(PO)return Cg;PO=1,Object.defineProperty(Cg,"__esModule",{value:!0});const e=Aa(),t=ct(),n=Ia(),r=pt(),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:o})=>(0,t._)`{additionalProperty: ${o.additionalProperty}}`},code(o){const{gen:i,schema:c,parentSchema:u,data:l,errsCount:d,it:h}=o;if(!d)throw new Error("ajv implementation error");const{allErrors:m,opts:p}=h;if(h.props=!0,p.removeAdditional!=="all"&&(0,r.alwaysValidSchema)(h,c))return;const y=(0,e.allSchemaProperties)(u.properties),g=(0,e.allSchemaProperties)(u.patternProperties);b(),o.ok((0,t._)`${d} === ${n.default.errors}`);function b(){i.forIn("key",l,w=>{!y.length&&!g.length?_(w):i.if(x(w),()=>_(w))})}function x(w){let T;if(y.length>8){const A=(0,r.schemaRefOrVal)(h,u.properties,"properties");T=(0,e.isOwnProperty)(i,A,w)}else y.length?T=(0,t.or)(...y.map(A=>(0,t._)`${w} === ${A}`)):T=t.nil;return g.length&&(T=(0,t.or)(T,...g.map(A=>(0,t._)`${(0,e.usePattern)(o,A)}.test(${w})`))),(0,t.not)(T)}function k(w){i.code((0,t._)`delete ${l}[${w}]`)}function _(w){if(p.removeAdditional==="all"||p.removeAdditional&&c===!1){k(w);return}if(c===!1){o.setParams({additionalProperty:w}),o.error(),m||i.break();return}if(typeof c=="object"&&!(0,r.alwaysValidSchema)(h,c)){const T=i.name("valid");p.removeAdditional==="failing"?(S(w,T,!1),i.if((0,t.not)(T),()=>{o.reset(),k(w)})):(S(w,T),m||i.if((0,t.not)(T),()=>i.break()))}}function S(w,T,A){const L={keyword:"additionalProperties",dataProp:w,dataPropType:r.Type.Str};A===!1&&Object.assign(L,{compositeRule:!0,createErrors:!1,allErrors:!1}),o.subschema(L,T)}}};return Cg.default=a,Cg}var Ig={},OO;function zye(){if(OO)return Ig;OO=1,Object.defineProperty(Ig,"__esModule",{value:!0});const e=Ux(),t=Aa(),n=pt(),r=wU(),s={keyword:"properties",type:"object",schemaType:"object",code(a){const{gen:o,schema:i,parentSchema:c,data:u,it:l}=a;l.opts.removeAdditional==="all"&&c.additionalProperties===void 0&&r.default.code(new e.KeywordCxt(l,r.default,"additionalProperties"));const d=(0,t.allSchemaProperties)(i);for(const g of d)l.definedProperties.add(g);l.opts.unevaluated&&d.length&&l.props!==!0&&(l.props=n.mergeEvaluated.props(o,(0,n.toHash)(d),l.props));const h=d.filter(g=>!(0,n.alwaysValidSchema)(l,i[g]));if(h.length===0)return;const m=o.name("valid");for(const g of h)p(g)?y(g):(o.if((0,t.propertyInData)(o,u,g,l.opts.ownProperties)),y(g),l.allErrors||o.else().var(m,!0),o.endIf()),a.it.definedProperties.add(g),a.ok(m);function p(g){return l.opts.useDefaults&&!l.compositeRule&&i[g].default!==void 0}function y(g){a.subschema({keyword:"properties",schemaProp:g,dataProp:g},m)}}};return Ig.default=s,Ig}var Ag={},LO;function Hye(){if(LO)return Ag;LO=1,Object.defineProperty(Ag,"__esModule",{value:!0});const e=Aa(),t=ct(),n=pt(),r=pt(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(a){const{gen:o,schema:i,data:c,parentSchema:u,it:l}=a,{opts:d}=l,h=(0,e.allSchemaProperties)(i),m=h.filter(_=>(0,n.alwaysValidSchema)(l,i[_]));if(h.length===0||m.length===h.length&&(!l.opts.unevaluated||l.props===!0))return;const p=d.strictSchema&&!d.allowMatchingProperties&&u.properties,y=o.name("valid");l.props!==!0&&!(l.props instanceof t.Name)&&(l.props=(0,r.evaluatedPropsToName)(o,l.props));const{props:g}=l;b();function b(){for(const _ of h)p&&x(_),l.allErrors?k(_):(o.var(y,!0),k(_),o.if(y))}function x(_){for(const S in p)new RegExp(_).test(S)&&(0,n.checkStrictMode)(l,`property ${S} matches pattern ${_} (use allowMatchingProperties)`)}function k(_){o.forIn("key",c,S=>{o.if((0,t._)`${(0,e.usePattern)(a,_)}.test(${S})`,()=>{const w=m.includes(_);w||a.subschema({keyword:"patternProperties",schemaProp:_,dataProp:S,dataPropType:r.Type.Str},y),l.opts.unevaluated&&g!==!0?o.assign((0,t._)`${g}[${S}]`,!0):!w&&!l.allErrors&&o.if((0,t.not)(y),()=>o.break())})})}}};return Ag.default=s,Ag}var Ng={},$O;function qye(){if($O)return Ng;$O=1,Object.defineProperty(Ng,"__esModule",{value:!0});const e=pt(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){const{gen:r,schema:s,it:a}=n;if((0,e.alwaysValidSchema)(a,s)){n.fail();return}const o=r.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),n.failResult(o,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};return Ng.default=t,Ng}var Rg={},jO;function Vye(){if(jO)return Rg;jO=1,Object.defineProperty(Rg,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Aa().validateUnion,error:{message:"must match a schema in anyOf"}};return Rg.default=t,Rg}var Pg={},MO;function Gye(){if(MO)return Pg;MO=1,Object.defineProperty(Pg,"__esModule",{value:!0});const e=ct(),t=pt(),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:s})=>(0,e._)`{passingSchemas: ${s.passing}}`},code(s){const{gen:a,schema:o,parentSchema:i,it:c}=s;if(!Array.isArray(o))throw new Error("ajv implementation error");if(c.opts.discriminator&&i.discriminator)return;const u=o,l=a.let("valid",!1),d=a.let("passing",null),h=a.name("_valid");s.setParams({passing:d}),a.block(m),s.result(l,()=>s.reset(),()=>s.error(!0));function m(){u.forEach((p,y)=>{let g;(0,t.alwaysValidSchema)(c,p)?a.var(h,!0):g=s.subschema({keyword:"oneOf",schemaProp:y,compositeRule:!0},h),y>0&&a.if((0,e._)`${h} && ${l}`).assign(l,!1).assign(d,(0,e._)`[${d}, ${y}]`).else(),a.if(h,()=>{a.assign(l,!0),a.assign(d,y),g&&s.mergeEvaluated(g,e.Name)})})}}};return Pg.default=r,Pg}var Og={},DO;function Kye(){if(DO)return Og;DO=1,Object.defineProperty(Og,"__esModule",{value:!0});const e=pt(),t={keyword:"allOf",schemaType:"array",code(n){const{gen:r,schema:s,it:a}=n;if(!Array.isArray(s))throw new Error("ajv implementation error");const o=r.name("valid");s.forEach((i,c)=>{if((0,e.alwaysValidSchema)(a,i))return;const u=n.subschema({keyword:"allOf",schemaProp:c},o);n.ok(o),n.mergeEvaluated(u)})}};return Og.default=t,Og}var Lg={},FO;function Wye(){if(FO)return Lg;FO=1,Object.defineProperty(Lg,"__esModule",{value:!0});const e=ct(),t=pt(),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:a})=>(0,e.str)`must match "${a.ifClause}" schema`,params:({params:a})=>(0,e._)`{failingKeyword: ${a.ifClause}}`},code(a){const{gen:o,parentSchema:i,it:c}=a;i.then===void 0&&i.else===void 0&&(0,t.checkStrictMode)(c,'"if" without "then" and "else" is ignored');const u=s(c,"then"),l=s(c,"else");if(!u&&!l)return;const d=o.let("valid",!0),h=o.name("_valid");if(m(),a.reset(),u&&l){const y=o.let("ifClause");a.setParams({ifClause:y}),o.if(h,p("then",y),p("else",y))}else u?o.if(h,p("then")):o.if((0,e.not)(h),p("else"));a.pass(d,()=>a.error(!0));function m(){const y=a.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);a.mergeEvaluated(y)}function p(y,g){return()=>{const b=a.subschema({keyword:y},h);o.assign(d,h),a.mergeValidEvaluated(b,d),g?o.assign(g,(0,e._)`${y}`):a.setParams({ifClause:y})}}}};function s(a,o){const i=a.schema[o];return i!==void 0&&!(0,t.alwaysValidSchema)(a,i)}return Lg.default=r,Lg}var $g={},BO;function Yye(){if(BO)return $g;BO=1,Object.defineProperty($g,"__esModule",{value:!0});const e=pt(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:r,it:s}){r.if===void 0&&(0,e.checkStrictMode)(s,`"${n}" without "if" is ignored`)}};return $g.default=t,$g}var UO;function Jye(){if(UO)return Sg;UO=1,Object.defineProperty(Sg,"__esModule",{value:!0});const e=vU(),t=Dye(),n=SU(),r=Fye(),s=Bye(),a=KI(),o=Uye(),i=wU(),c=zye(),u=Hye(),l=qye(),d=Vye(),h=Gye(),m=Kye(),p=Wye(),y=Yye();function g(b=!1){const x=[l.default,d.default,h.default,m.default,p.default,y.default,o.default,i.default,a.default,c.default,u.default];return b?x.push(t.default,r.default):x.push(e.default,n.default),x.push(s.default),x}return Sg.default=g,Sg}var jg={},Ju={},zO;function _U(){if(zO)return Ju;zO=1,Object.defineProperty(Ju,"__esModule",{value:!0}),Ju.dynamicAnchor=void 0;const e=ct(),t=Ia(),n=Hx(),r=VI(),s={keyword:"$dynamicAnchor",schemaType:"string",code:i=>a(i,i.schema)};function a(i,c){const{gen:u,it:l}=i;l.schemaEnv.root.dynamicAnchors[c]=!0;const d=(0,e._)`${t.default.dynamicAnchors}${(0,e.getProperty)(c)}`,h=l.errSchemaPath==="#"?l.validateName:o(i);u.if((0,e._)`!${d}`,()=>u.assign(d,h))}Ju.dynamicAnchor=a;function o(i){const{schemaEnv:c,schema:u,self:l}=i.it,{root:d,baseId:h,localRefs:m,meta:p}=c.root,{schemaId:y}=l.opts,g=new n.SchemaEnv({schema:u,schemaId:y,root:d,baseId:h,localRefs:m,meta:p});return n.compileSchema.call(l,g),(0,r.getValidate)(i,g)}return Ju.default=s,Ju}var Qu={},HO;function EU(){if(HO)return Qu;HO=1,Object.defineProperty(Qu,"__esModule",{value:!0}),Qu.dynamicRef=void 0;const e=ct(),t=Ia(),n=VI(),r={keyword:"$dynamicRef",schemaType:"string",code:a=>s(a,a.schema)};function s(a,o){const{gen:i,keyword:c,it:u}=a;if(o[0]!=="#")throw new Error(`"${c}" only supports hash fragment reference`);const l=o.slice(1);if(u.allErrors)d();else{const m=i.let("valid",!1);d(m),a.ok(m)}function d(m){if(u.schemaEnv.root.dynamicAnchors[l]){const p=i.let("_v",(0,e._)`${t.default.dynamicAnchors}${(0,e.getProperty)(l)}`);i.if(p,h(p,m),h(u.validateName,m))}else h(u.validateName,m)()}function h(m,p){return p?()=>i.block(()=>{(0,n.callRef)(a,m),i.let(p,!0)}):()=>(0,n.callRef)(a,m)}}return Qu.dynamicRef=s,Qu.default=r,Qu}var Mg={},qO;function Qye(){if(qO)return Mg;qO=1,Object.defineProperty(Mg,"__esModule",{value:!0});const e=_U(),t=pt(),n={keyword:"$recursiveAnchor",schemaType:"boolean",code(r){r.schema?(0,e.dynamicAnchor)(r,""):(0,t.checkStrictMode)(r.it,"$recursiveAnchor: false is ignored")}};return Mg.default=n,Mg}var Dg={},VO;function Xye(){if(VO)return Dg;VO=1,Object.defineProperty(Dg,"__esModule",{value:!0});const e=EU(),t={keyword:"$recursiveRef",schemaType:"string",code:n=>(0,e.dynamicRef)(n,n.schema)};return Dg.default=t,Dg}var GO;function Zye(){if(GO)return jg;GO=1,Object.defineProperty(jg,"__esModule",{value:!0});const e=_U(),t=EU(),n=Qye(),r=Xye(),s=[e.default,t.default,n.default,r.default];return jg.default=s,jg}var Fg={},Bg={},KO;function e0e(){if(KO)return Bg;KO=1,Object.defineProperty(Bg,"__esModule",{value:!0});const e=KI(),t={keyword:"dependentRequired",type:"object",schemaType:"object",error:e.error,code:n=>(0,e.validatePropertyDeps)(n)};return Bg.default=t,Bg}var Ug={},WO;function t0e(){if(WO)return Ug;WO=1,Object.defineProperty(Ug,"__esModule",{value:!0});const e=KI(),t={keyword:"dependentSchemas",type:"object",schemaType:"object",code:n=>(0,e.validateSchemaDeps)(n)};return Ug.default=t,Ug}var zg={},YO;function n0e(){if(YO)return zg;YO=1,Object.defineProperty(zg,"__esModule",{value:!0});const e=pt(),t={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:n,parentSchema:r,it:s}){r.contains===void 0&&(0,e.checkStrictMode)(s,`"${n}" without "contains" is ignored`)}};return zg.default=t,zg}var JO;function r0e(){if(JO)return Fg;JO=1,Object.defineProperty(Fg,"__esModule",{value:!0});const e=e0e(),t=t0e(),n=n0e(),r=[e.default,t.default,n.default];return Fg.default=r,Fg}var Hg={},qg={},QO;function s0e(){if(QO)return qg;QO=1,Object.defineProperty(qg,"__esModule",{value:!0});const e=ct(),t=pt(),n=Ia(),s={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:a})=>(0,e._)`{unevaluatedProperty: ${a.unevaluatedProperty}}`},code(a){const{gen:o,schema:i,data:c,errsCount:u,it:l}=a;if(!u)throw new Error("ajv implementation error");const{allErrors:d,props:h}=l;h instanceof e.Name?o.if((0,e._)`${h} !== true`,()=>o.forIn("key",c,g=>o.if(p(h,g),()=>m(g)))):h!==!0&&o.forIn("key",c,g=>h===void 0?m(g):o.if(y(h,g),()=>m(g))),l.props=!0,a.ok((0,e._)`${u} === ${n.default.errors}`);function m(g){if(i===!1){a.setParams({unevaluatedProperty:g}),a.error(),d||o.break();return}if(!(0,t.alwaysValidSchema)(l,i)){const b=o.name("valid");a.subschema({keyword:"unevaluatedProperties",dataProp:g,dataPropType:t.Type.Str},b),d||o.if((0,e.not)(b),()=>o.break())}}function p(g,b){return(0,e._)`!${g} || !${g}[${b}]`}function y(g,b){const x=[];for(const k in g)g[k]===!0&&x.push((0,e._)`${b} !== ${k}`);return(0,e.and)(...x)}}};return qg.default=s,qg}var Vg={},XO;function a0e(){if(XO)return Vg;XO=1,Object.defineProperty(Vg,"__esModule",{value:!0});const e=ct(),t=pt(),r={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:s}})=>(0,e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,e._)`{limit: ${s}}`},code(s){const{gen:a,schema:o,data:i,it:c}=s,u=c.items||0;if(u===!0)return;const l=a.const("len",(0,e._)`${i}.length`);if(o===!1)s.setParams({len:u}),s.fail((0,e._)`${l} > ${u}`);else if(typeof o=="object"&&!(0,t.alwaysValidSchema)(c,o)){const h=a.var("valid",(0,e._)`${l} <= ${u}`);a.if((0,e.not)(h),()=>d(h,u)),s.ok(h)}c.items=!0;function d(h,m){a.forRange("i",m,l,p=>{s.subschema({keyword:"unevaluatedItems",dataProp:p,dataPropType:t.Type.Num},h),c.allErrors||a.if((0,e.not)(h),()=>a.break())})}}};return Vg.default=r,Vg}var ZO;function o0e(){if(ZO)return Hg;ZO=1,Object.defineProperty(Hg,"__esModule",{value:!0});const e=s0e(),t=a0e(),n=[e.default,t.default];return Hg.default=n,Hg}var Gg={},Kg={},e3;function i0e(){if(e3)return Kg;e3=1,Object.defineProperty(Kg,"__esModule",{value:!0});const e=ct(),n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,e._)`{format: ${r}}`},code(r,s){const{gen:a,data:o,$data:i,schema:c,schemaCode:u,it:l}=r,{opts:d,errSchemaPath:h,schemaEnv:m,self:p}=l;if(!d.validateFormats)return;i?y():g();function y(){const b=a.scopeValue("formats",{ref:p.formats,code:d.code.formats}),x=a.const("fDef",(0,e._)`${b}[${u}]`),k=a.let("fType"),_=a.let("format");a.if((0,e._)`typeof ${x} == "object" && !(${x} instanceof RegExp)`,()=>a.assign(k,(0,e._)`${x}.type || "string"`).assign(_,(0,e._)`${x}.validate`),()=>a.assign(k,(0,e._)`"string"`).assign(_,x)),r.fail$data((0,e.or)(S(),w()));function S(){return d.strictSchema===!1?e.nil:(0,e._)`${u} && !${_}`}function w(){const T=m.$async?(0,e._)`(${x}.async ? await ${_}(${o}) : ${_}(${o}))`:(0,e._)`${_}(${o})`,A=(0,e._)`(typeof ${_} == "function" ? ${T} : ${_}.test(${o}))`;return(0,e._)`${_} && ${_} !== true && ${k} === ${s} && !${A}`}}function g(){const b=p.formats[c];if(!b){S();return}if(b===!0)return;const[x,k,_]=w(b);x===s&&r.pass(T());function S(){if(d.strictSchema===!1){p.logger.warn(A());return}throw new Error(A());function A(){return`unknown format "${c}" ignored in schema at path "${h}"`}}function w(A){const L=A instanceof RegExp?(0,e.regexpCode)(A):d.code.formats?(0,e._)`${d.code.formats}${(0,e.getProperty)(c)}`:void 0,R=a.scopeValue("formats",{key:c,ref:A,code:L});return typeof A=="object"&&!(A instanceof RegExp)?[A.type||"string",A.validate,(0,e._)`${R}.validate`]:["string",A,R]}function T(){if(typeof b=="object"&&!(b instanceof RegExp)&&b.async){if(!m.$async)throw new Error("async format in sync schema");return(0,e._)`await ${_}(${o})`}return typeof k=="function"?(0,e._)`${_}(${o})`:(0,e._)`${_}.test(${o})`}}}};return Kg.default=n,Kg}var t3;function c0e(){if(t3)return Gg;t3=1,Object.defineProperty(Gg,"__esModule",{value:!0});const t=[i0e().default];return Gg.default=t,Gg}var fc={},n3;function u0e(){return n3||(n3=1,Object.defineProperty(fc,"__esModule",{value:!0}),fc.contentVocabulary=fc.metadataVocabulary=void 0,fc.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],fc.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),fc}var r3;function l0e(){if(r3)return og;r3=1,Object.defineProperty(og,"__esModule",{value:!0});const e=Eye(),t=Mye(),n=Jye(),r=Zye(),s=r0e(),a=o0e(),o=c0e(),i=u0e(),c=[r.default,e.default,t.default,(0,n.default)(!0),o.default,i.metadataVocabulary,i.contentVocabulary,s.default,a.default];return og.default=c,og}var Wg={},Cf={},s3;function d0e(){if(s3)return Cf;s3=1,Object.defineProperty(Cf,"__esModule",{value:!0}),Cf.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Cf.DiscrError=e={})),Cf}var a3;function f0e(){if(a3)return Wg;a3=1,Object.defineProperty(Wg,"__esModule",{value:!0});const e=ct(),t=d0e(),n=Hx(),r=zx(),s=pt(),o={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:i,tagName:c}})=>i===t.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:i,tag:c,tagName:u}})=>(0,e._)`{error: ${i}, tag: ${u}, tagValue: ${c}}`},code(i){const{gen:c,data:u,schema:l,parentSchema:d,it:h}=i,{oneOf:m}=d;if(!h.opts.discriminator)throw new Error("discriminator: requires discriminator option");const p=l.propertyName;if(typeof p!="string")throw new Error("discriminator: requires propertyName");if(l.mapping)throw new Error("discriminator: mapping is not supported");if(!m)throw new Error("discriminator: requires oneOf keyword");const y=c.let("valid",!1),g=c.const("tag",(0,e._)`${u}${(0,e.getProperty)(p)}`);c.if((0,e._)`typeof ${g} == "string"`,()=>b(),()=>i.error(!1,{discrError:t.DiscrError.Tag,tag:g,tagName:p})),i.ok(y);function b(){const _=k();c.if(!1);for(const S in _)c.elseIf((0,e._)`${g} === ${S}`),c.assign(y,x(_[S]));c.else(),i.error(!1,{discrError:t.DiscrError.Mapping,tag:g,tagName:p}),c.endIf()}function x(_){const S=c.name("valid"),w=i.subschema({keyword:"oneOf",schemaProp:_},S);return i.mergeEvaluated(w,e.Name),S}function k(){var _;const S={},w=A(d);let T=!0;for(let j=0;j<m.length;j++){let F=m[j];if(F?.$ref&&!(0,s.schemaHasRulesButRef)(F,h.self.RULES)){const Y=F.$ref;if(F=n.resolveRef.call(h.self,h.schemaEnv.root,h.baseId,Y),F instanceof n.SchemaEnv&&(F=F.schema),F===void 0)throw new r.default(h.opts.uriResolver,h.baseId,Y)}const K=(_=F?.properties)===null||_===void 0?void 0:_[p];if(typeof K!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${p}"`);T=T&&(w||A(F)),L(K,j)}if(!T)throw new Error(`discriminator: "${p}" must be required`);return S;function A({required:j}){return Array.isArray(j)&&j.includes(p)}function L(j,F){if(j.const)R(j.const,F);else if(j.enum)for(const K of j.enum)R(K,F);else throw new Error(`discriminator: "properties/${p}" must have "const" or "enum"`)}function R(j,F){if(typeof j!="string"||j in S)throw new Error(`discriminator: "${p}" values must be unique strings`);S[j]=F}}}};return Wg.default=o,Wg}var Yg={};const h0e="https://json-schema.org/draft/2020-12/schema",m0e="https://json-schema.org/draft/2020-12/schema",p0e={"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},g0e="meta",b0e="Core and Validation specifications meta-schema",y0e=[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],x0e=["object","boolean"],k0e="This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",v0e={definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}},S0e={$schema:h0e,$id:m0e,$vocabulary:p0e,$dynamicAnchor:g0e,title:b0e,allOf:y0e,type:x0e,$comment:k0e,properties:v0e},w0e="https://json-schema.org/draft/2020-12/schema",_0e="https://json-schema.org/draft/2020-12/meta/applicator",E0e={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},T0e="meta",C0e="Applicator vocabulary meta-schema",I0e=["object","boolean"],A0e={prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},N0e={schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}},R0e={$schema:w0e,$id:_0e,$vocabulary:E0e,$dynamicAnchor:T0e,title:C0e,type:I0e,properties:A0e,$defs:N0e},P0e="https://json-schema.org/draft/2020-12/schema",O0e="https://json-schema.org/draft/2020-12/meta/unevaluated",L0e={"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$0e="meta",j0e="Unevaluated applicator vocabulary meta-schema",M0e=["object","boolean"],D0e={unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}},F0e={$schema:P0e,$id:O0e,$vocabulary:L0e,$dynamicAnchor:$0e,title:j0e,type:M0e,properties:D0e},B0e="https://json-schema.org/draft/2020-12/schema",U0e="https://json-schema.org/draft/2020-12/meta/content",z0e={"https://json-schema.org/draft/2020-12/vocab/content":!0},H0e="meta",q0e="Content vocabulary meta-schema",V0e=["object","boolean"],G0e={contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}},K0e={$schema:B0e,$id:U0e,$vocabulary:z0e,$dynamicAnchor:H0e,title:q0e,type:V0e,properties:G0e},W0e="https://json-schema.org/draft/2020-12/schema",Y0e="https://json-schema.org/draft/2020-12/meta/core",J0e={"https://json-schema.org/draft/2020-12/vocab/core":!0},Q0e="meta",X0e="Core vocabulary meta-schema",Z0e=["object","boolean"],e1e={$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},t1e={anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}},n1e={$schema:W0e,$id:Y0e,$vocabulary:J0e,$dynamicAnchor:Q0e,title:X0e,type:Z0e,properties:e1e,$defs:t1e},r1e="https://json-schema.org/draft/2020-12/schema",s1e="https://json-schema.org/draft/2020-12/meta/format-annotation",a1e={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},o1e="meta",i1e="Format vocabulary meta-schema for annotation results",c1e=["object","boolean"],u1e={format:{type:"string"}},l1e={$schema:r1e,$id:s1e,$vocabulary:a1e,$dynamicAnchor:o1e,title:i1e,type:c1e,properties:u1e},d1e="https://json-schema.org/draft/2020-12/schema",f1e="https://json-schema.org/draft/2020-12/meta/meta-data",h1e={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},m1e="meta",p1e="Meta-data vocabulary meta-schema",g1e=["object","boolean"],b1e={title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}},y1e={$schema:d1e,$id:f1e,$vocabulary:h1e,$dynamicAnchor:m1e,title:p1e,type:g1e,properties:b1e},x1e="https://json-schema.org/draft/2020-12/schema",k1e="https://json-schema.org/draft/2020-12/meta/validation",v1e={"https://json-schema.org/draft/2020-12/vocab/validation":!0},S1e="meta",w1e="Validation vocabulary meta-schema",_1e=["object","boolean"],E1e={type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},T1e={nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},C1e={$schema:x1e,$id:k1e,$vocabulary:v1e,$dynamicAnchor:S1e,title:w1e,type:_1e,properties:E1e,$defs:T1e};var o3;function I1e(){if(o3)return Yg;o3=1,Object.defineProperty(Yg,"__esModule",{value:!0});const e=S0e,t=R0e,n=F0e,r=K0e,s=n1e,a=l1e,o=y1e,i=C1e,c=["/properties"];function u(l){return[e,t,n,r,s,d(this,a),o,d(this,i)].forEach(h=>this.addMetaSchema(h,void 0,!1)),this;function d(h,m){return l?h.$dataMetaSchema(m,c):m}}return Yg.default=u,Yg}var i3;function A1e(){return i3||(i3=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;const n=wye(),r=l0e(),s=f0e(),a=I1e(),o="https://json-schema.org/draft/2020-12/schema";class i extends n.default{constructor(m={}){super({...m,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),r.default.forEach(m=>this.addVocabulary(m)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:m,meta:p}=this.opts;p&&(a.default.call(this,m),this.refs["http://json-schema.org/schema"]=o)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}}t.Ajv2020=i,e.exports=t=i,e.exports.Ajv2020=i,Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var c=Ux();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=ct();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var l=qI();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return l.default}});var d=zx();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return d.default}})})(tg,tg.exports)),tg.exports}var N1e=A1e();const R1e=p1(N1e);new R1e({allErrors:!0,strict:!1,validateSchema:!1,allowUnionTypes:!0});class wze extends np("KernelCoreEffectError"){}class _ze extends np("ToolInteractionPendingError"){}class Eze extends np("ToolInteractionDeniedError"){}Yi(q({limit:H(it)}));Yi(q({namespaces:_e(iye)}));Yi(q({namespace:H(C),query:H(C),limit:H(it),includeSchemas:H(Ke)}));Yi(q({results:_e(HI)}));Yi(q({path:C,includeSchemas:H(Ke)}));Yi(ne(HI));Yi(q({query:C,limit:H(it),includeSchemas:H(Ke)}));const P1e=Cr(HI,q({score:it}));Yi(q({bestPath:ne(C),results:_e(P1e),total:it}));const vp=C.pipe(nn("DocumentId")),Sp=C.pipe(nn("ResourceId")),pd=C.pipe(nn("ScopeId")),qx=C.pipe(nn("CapabilityId")),ym=C.pipe(nn("ExecutableId")),Vx=C.pipe(nn("ResponseSetId")),Gx=C.pipe(nn("DiagnosticId")),Tt=C.pipe(nn("ShapeSymbolId")),WI=C.pipe(nn("ParameterSymbolId")),TU=C.pipe(nn("RequestBodySymbolId")),YI=C.pipe(nn("ResponseSymbolId")),wp=C.pipe(nn("HeaderSymbolId")),Pu=C.pipe(nn("ExampleSymbolId")),JI=C.pipe(nn("SecuritySchemeSymbolId")),O1e=tn(Tt,WI,TU,YI,wp,Pu,JI),QI=ie("openapi","graphql-schema","google-discovery","mcp","custom"),L1e=ie("service","document","resource","pathItem","operation","folder"),$1e=ie("read","write","delete","action","subscribe"),j1e=ie("path","query","header","cookie"),M1e=ie("success","redirect","stream","download","upload","longRunning"),D1e=ie("oauth2","http","apiKey","basic","bearer","custom"),F1e=ie("1XX","2XX","3XX","4XX","5XX"),B1e=ie("cursor","offset","token","unknown"),U1e=ie("info","warning","error"),z1e=ie("external_ref_bundled","relative_ref_rebased","schema_hoisted","selection_shape_synthesized","opaque_hook_imported","discriminator_lost","multi_response_union_synthesized","unsupported_link_preserved_native","unsupported_callback_preserved_native","unresolved_ref","merge_conflict_preserved_first","projection_call_shape_synthesized","projection_result_shape_synthesized","projection_collision_grouped_fields","synthetic_resource_context_created","selection_shape_missing"),H1e=ie("json","yaml","graphql","text","unknown"),q1e=ie("declared","hoisted","derived","merged","projected"),so=q({summary:H(C),description:H(C),externalDocsUrl:H(C)}),CU=q({relation:q1e,documentId:vp,resourceId:H(Sp),pointer:H(C),line:H(it),column:H(it)}),IU=q({sourceKind:QI,kind:C,pointer:H(C),encoding:H(H1e),summary:H(C),value:H(Tn)}),Ws=q({synthetic:Ke,provenance:_e(CU),diagnosticIds:H(_e(Gx)),native:H(_e(IU))}),V1e=q({sourceKind:QI,pluginKey:C,importerVersion:C,importedAt:C,sourceConfigHash:C}),AU=q({id:vp,kind:QI,title:H(C),versionHint:H(C),fetchedAt:C,rawRef:C,entryUri:H(C),native:H(_e(IU))}),NU=q({shapeId:Tt,docs:H(so),deprecated:H(Ke),exampleIds:H(_e(Pu))}),G1e=q({propertyName:C,mapping:H(yt({key:C,value:Tt}))}),K1e=q({type:ie("scalar"),scalar:ie("string","number","integer","boolean","null","bytes"),format:H(C),constraints:H(yt({key:C,value:Tn}))}),W1e=q({type:ie("unknown"),reason:H(C)}),Y1e=q({type:ie("const"),value:Tn}),J1e=q({type:ie("enum"),values:_e(Tn)}),Q1e=q({type:ie("object"),fields:yt({key:C,value:NU}),required:H(_e(C)),additionalProperties:H(tn(Ke,Tt)),patternProperties:H(yt({key:C,value:Tt}))}),X1e=q({type:ie("array"),itemShapeId:Tt,minItems:H(it),maxItems:H(it)}),Z1e=q({type:ie("tuple"),itemShapeIds:_e(Tt),additionalItems:H(tn(Ke,Tt))}),exe=q({type:ie("map"),valueShapeId:Tt}),txe=q({type:ie("allOf"),items:_e(Tt)}),nxe=q({type:ie("anyOf"),items:_e(Tt)}),rxe=q({type:ie("oneOf"),items:_e(Tt),discriminator:H(G1e)}),sxe=q({type:ie("nullable"),itemShapeId:Tt}),axe=q({type:ie("ref"),target:Tt}),oxe=q({type:ie("not"),itemShapeId:Tt}),ixe=q({type:ie("conditional"),ifShapeId:Tt,thenShapeId:H(Tt),elseShapeId:H(Tt)}),cxe=q({type:ie("graphqlInterface"),fields:yt({key:C,value:NU}),possibleTypeIds:_e(Tt)}),uxe=q({type:ie("graphqlUnion"),memberTypeIds:_e(Tt)}),lxe=tn(W1e,K1e,Y1e,J1e,Q1e,X1e,Z1e,exe,txe,nxe,rxe,sxe,axe,oxe,ixe,cxe,uxe),c3=q({shapeId:Tt,pointer:H(C)}),RU=Cr(q({id:Sp,documentId:vp,canonicalUri:C,baseUri:C,dialectUri:H(C),rootShapeId:H(Tt),anchors:yt({key:C,value:c3}),dynamicAnchors:yt({key:C,value:c3})}),Ws),dxe=tn(q({location:ie("header","query","cookie"),name:C}),q({location:ie("body"),path:C})),fxe=q({authorizationUrl:H(C),tokenUrl:H(C),refreshUrl:H(C),scopes:H(yt({key:C,value:C}))}),hxe=q({in:H(ie("header","query","cookie")),name:H(C)}),mxe=Cr(q({id:JI,kind:ie("securityScheme"),schemeType:D1e,docs:H(so),placement:H(hxe),http:H(q({scheme:C,bearerFormat:H(C)})),apiKey:H(q({in:ie("header","query","cookie"),name:C})),oauth:H(q({flows:H(yt({key:C,value:fxe})),scopes:H(yt({key:C,value:C}))})),custom:H(q({placementHints:H(_e(dxe))}))}),Ws),pxe=q({contentType:H(C),style:H(C),explode:H(Ke),allowReserved:H(Ke),headers:H(_e(wp))}),Kx=q({mediaType:C,shapeId:H(Tt),exampleIds:H(_e(Pu)),encoding:H(yt({key:C,value:pxe}))}),gxe=Cr(q({id:Tt,kind:ie("shape"),resourceId:H(Sp),title:H(C),docs:H(so),deprecated:H(Ke),node:lxe}),Ws),bxe=Cr(q({id:WI,kind:ie("parameter"),name:C,location:j1e,required:H(Ke),docs:H(so),deprecated:H(Ke),exampleIds:H(_e(Pu)),schemaShapeId:H(Tt),content:H(_e(Kx)),style:H(C),explode:H(Ke),allowReserved:H(Ke)}),Ws),yxe=Cr(q({id:wp,kind:ie("header"),name:C,docs:H(so),deprecated:H(Ke),exampleIds:H(_e(Pu)),schemaShapeId:H(Tt),content:H(_e(Kx)),style:H(C),explode:H(Ke)}),Ws),xxe=Cr(q({id:TU,kind:ie("requestBody"),docs:H(so),required:H(Ke),contents:_e(Kx)}),Ws),kxe=Cr(q({id:YI,kind:ie("response"),docs:H(so),headerIds:H(_e(wp)),contents:H(_e(Kx))}),Ws),vxe=Cr(q({id:Pu,kind:ie("example"),name:H(C),docs:H(so),exampleKind:ie("value","call"),value:H(Tn),externalValue:H(C),call:H(q({args:yt({key:C,value:Tn}),result:H(Tn)}))}),Ws),PU=tn(gxe,bxe,xxe,kxe,yxe,vxe,mxe),A0=pB(()=>tn(q({kind:ie("none")}),q({kind:ie("scheme"),schemeId:JI,scopes:H(_e(C))}),q({kind:ie("allOf"),items:_e(A0)}),q({kind:ie("anyOf"),items:_e(A0)}))),Sxe=q({url:C,description:H(C),variables:H(yt({key:C,value:C}))}),wxe=q({servers:H(_e(Sxe)),auth:H(A0),parameterIds:H(_e(WI)),headerIds:H(_e(wp)),variables:H(yt({key:C,value:C}))}),OU=Cr(q({id:pd,kind:L1e,parentId:H(pd),name:H(C),namespace:H(C),docs:H(so),defaults:H(wxe)}),Ws),_xe=q({approval:q({mayRequire:Ke,reasons:H(_e(ie("write","delete","sensitive","externalSideEffect")))}),elicitation:q({mayRequest:Ke,shapeId:H(Tt)}),resume:q({supported:Ke})}),LU=Cr(q({id:qx,serviceScopeId:pd,surface:q({toolPath:_e(C),title:H(C),summary:H(C),description:H(C),aliases:H(_e(C)),tags:H(_e(C))}),semantics:q({effect:$1e,safe:H(Ke),idempotent:H(Ke),destructive:H(Ke)}),docs:H(so),auth:A0,interaction:_xe,executableIds:_e(ym),preferredExecutableId:H(ym),exampleIds:H(_e(Pu))}),Ws),Exe=q({protocol:H(C),method:H(ne(C)),pathTemplate:H(ne(C)),operationId:H(ne(C)),group:H(ne(C)),leaf:H(ne(C)),rawToolId:H(ne(C)),title:H(ne(C)),summary:H(ne(C))}),Txe=q({responseSetId:Vx,callShapeId:Tt,resultDataShapeId:H(Tt),resultErrorShapeId:H(Tt),resultHeadersShapeId:H(Tt),resultStatusShapeId:H(Tt)}),$U=Cr(q({id:ym,capabilityId:qx,scopeId:pd,pluginKey:C,bindingVersion:it,binding:Tn,projection:Txe,display:H(Exe)}),Ws),Cxe=q({kind:B1e,tokenParamName:H(C),nextFieldPath:H(C)}),Ixe=tn(q({kind:ie("exact"),status:it}),q({kind:ie("range"),value:F1e}),q({kind:ie("default")})),Axe=q({match:Ixe,responseId:YI,traits:H(_e(M1e)),pagination:H(Cxe)}),jU=Cr(q({id:Vx,variants:_e(Axe)}),Ws),MU=q({id:Gx,level:U1e,code:z1e,message:C,relatedSymbolIds:H(_e(O1e)),provenance:_e(CU)}),DU=q({version:ie("ir.v1"),documents:yt({key:vp,value:AU}),resources:yt({key:Sp,value:RU}),scopes:yt({key:pd,value:OU}),symbols:yt({key:C,value:PU}),capabilities:yt({key:qx,value:LU}),executables:yt({key:ym,value:$U}),responseSets:yt({key:Vx,value:jU}),diagnostics:yt({key:Gx,value:MU})}),Nxe=q({version:ie("ir.v1.fragment"),documents:H(yt({key:vp,value:AU})),resources:H(yt({key:Sp,value:RU})),scopes:H(yt({key:pd,value:OU})),symbols:H(yt({key:C,value:PU})),capabilities:H(yt({key:qx,value:LU})),executables:H(yt({key:ym,value:$U})),responseSets:H(yt({key:Vx,value:jU})),diagnostics:H(yt({key:Gx,value:MU}))}),Rxe=q({version:ie("ir.v1.snapshot"),import:V1e,catalog:DU});_I(DU);_I(Rxe);_I(Nxe);q({secretId:C});ie("runtime","import");ie("imported");const Pxe=C,Oxe=ie("draft","probing","auth_required","connected","error"),XI=ie("auto","streamable-http","sse","stdio"),Zn=yt({key:C,value:C}),FU=_e(C),z_=pB(()=>tn(C,it,Ke,Nx,_e(z_),yt({key:C,value:z_}))).annotations({identifier:"JsonValue"}),$o=yt({key:C,value:z_}).annotations({identifier:"JsonObject"});q({id:C,scopeId:C,name:C,kind:Pxe,status:Oxe,enabled:Ke,namespace:ne(C),createdAt:it,updatedAt:it});q({id:C});const Lxe=ie("plugin","unknown"),BU=ie("low","medium","high"),$xe=ie("none","bearer","oauth2","apiKey","basic","unknown"),jxe=ie("header","query","cookie"),Mxe=tn(q({kind:ie("none")}),q({kind:ie("bearer"),headerName:H(ne(C)),prefix:H(ne(C)),token:C}),q({kind:ie("basic"),username:C,password:C}),q({kind:ie("headers"),headers:Zn})),Dxe=q({suggestedKind:$xe,confidence:BU,supported:Ke,reason:C,headerName:ne(C),prefix:ne(C),parameterName:ne(C),parameterLocation:ne(jxe),oauthAuthorizationUrl:ne(C),oauthTokenUrl:ne(C),oauthScopes:_e(C)}),Fxe=q({detectedKind:Lxe,confidence:BU,endpoint:C,specUrl:ne(C),name:ne(C),namespace:ne(C),transport:ne(XI),authInference:Dxe,toolCount:ne(it),warnings:_e(C)});class Tze extends np("SourceCoreEffectError"){}const mr=C.pipe(nn("ScopeId")),Zi=C.pipe(nn("SourceId")),Wx=C.pipe(nn("SourceCatalogId")),Yx=C.pipe(nn("SourceCatalogRevisionId")),UU=C.pipe(nn("SecretMaterialId")),zU=C.pipe(nn("SecretStoreId")),HU=C.pipe(nn("PolicyId")),Jx=C.pipe(nn("ExecutionId")),ZI=C.pipe(nn("ExecutionInteractionId")),Bxe=C.pipe(nn("ExecutionStepId")),e2=C,t2=ie("draft","probing","auth_required","connected","error"),Uxe=q({scopeId:mr,sourceId:Zi,catalogId:Wx,catalogRevisionId:Yx,name:C,kind:e2,status:t2,enabled:Ke,namespace:ne(C),createdAt:At,updatedAt:At});Nu(Uxe,q({id:Zi,scopeId:mr,catalogId:Wx,catalogRevisionId:Yx,name:C,kind:e2,status:t2,enabled:Ke,namespace:ne(C),createdAt:At,updatedAt:At}),{strict:!1,decode:e=>({id:e.sourceId,scopeId:e.scopeId,catalogId:e.catalogId,catalogRevisionId:e.catalogRevisionId,name:e.name,kind:e.kind,status:e.status,enabled:e.enabled,namespace:e.namespace,createdAt:e.createdAt,updatedAt:e.updatedAt}),encode:e=>({scopeId:e.scopeId,sourceId:e.id,catalogId:e.catalogId,catalogRevisionId:e.catalogRevisionId,name:e.name,kind:e.kind,status:e.status,enabled:e.enabled,namespace:e.namespace,createdAt:e.createdAt,updatedAt:e.updatedAt})});const ks=q({id:Zi,scopeId:mr,name:C,kind:e2,status:t2,enabled:Ke,namespace:ne(C),createdAt:At,updatedAt:At}),hr=q({secretId:UU}),zxe=ie("imported"),Hxe=C,qxe=ie("private","scope","organization","public");q({id:Wx,kind:zxe,pluginKey:Hxe,name:C,summary:ne(C),visibility:qxe,latestRevisionId:Yx,createdAt:At,updatedAt:At});q({id:Yx,catalogId:Wx,revisionNumber:it,sourceConfigJson:C,importMetadataJson:ne(C),importMetadataHash:ne(C),snapshotHash:ne(C),createdAt:At,updatedAt:At});const qU=ie("allow","deny"),VU=ie("auto","required"),Xf=q({id:HU,key:C,scopeId:mr,resourcePattern:C,effect:qU,approvalMode:VU,priority:it,enabled:Ke,createdAt:At,updatedAt:At});hp(Xf);const n2=ie("auth_material","oauth_access_token","oauth_refresh_token","oauth_client_info");q({id:UU,name:ne(C),purpose:n2,storeId:zU,createdAt:At,updatedAt:At});const Vxe=C,Gxe=ie("connected","error");q({id:zU,scopeId:mr,name:C,kind:Vxe,status:Gxe,enabled:Ke,createdAt:At,updatedAt:At});const GU=q({scopeId:mr,actorScopeId:mr,resolutionScopeIds:_e(mr)});hp(GU);const Kxe=ie("quickjs","ses","deno"),Wxe=q({name:H(C),namespace:H(C),enabled:H(Ke),config:H(Tn)}),Yxe=Cr(Wxe,q({kind:C})),Jxe=ie("allow","deny"),Qxe=ie("auto","manual"),Xxe=q({match:C,action:Jxe,approval:Qxe,enabled:H(Ke),priority:H(it)}),Zxe=q({name:H(C)});q({runtime:H(Kxe),workspace:H(Zxe),sources:H(yt({key:C,value:Yxe})),policies:H(yt({key:C,value:Xxe}))});const KU=ie("pending","running","waiting_for_interaction","completed","failed","cancelled"),WU=q({id:Jx,scopeId:mr,createdByScopeId:mr,status:KU,code:C,resultJson:ne(C),errorText:ne(C),logsJson:ne(C),startedAt:ne(At),completedAt:ne(At),createdAt:At,updatedAt:At});hp(q({status:KU,code:C,resultJson:ne(C),errorText:ne(C),logsJson:ne(C),startedAt:ne(At),completedAt:ne(At),updatedAt:At}));const YU=ie("pending","resolved","cancelled"),eke=q({id:ZI,executionId:Jx,status:YU,kind:C,purpose:C,payloadJson:C,responseJson:ne(C),responsePrivateJson:ne(C),createdAt:At,updatedAt:At});hp(q({status:YU,kind:C,purpose:C,payloadJson:C,responseJson:ne(C),responsePrivateJson:ne(C),updatedAt:At}));const Kv=q({execution:WU,pendingInteraction:ne(eke)}),tke=ie("tool_call"),JU=ie("pending","waiting","completed","failed");q({id:Bxe,executionId:Jx,sequence:it,kind:tke,status:JU,path:C,argsJson:C,resultJson:ne(C),errorText:ne(C),interactionId:ne(ZI),createdAt:At,updatedAt:At});hp(q({status:JU,resultJson:ne(C),errorText:ne(C),interactionId:ne(ZI),updatedAt:At}));const nke=ie("ir"),rke=q({path:C,sourceKey:C,title:H(C),description:H(C),protocol:C,toolId:C,rawToolId:ne(C),operationId:ne(C),group:ne(C),leaf:ne(C),tags:_e(C),method:ne(C),pathTemplate:ne(C),inputTypePreview:H(C),outputTypePreview:H(C)}),ske=q({label:C,value:C,mono:H(Ke)}),ake=q({kind:ie("facts"),title:C,items:_e(ske)}),oke=q({kind:ie("markdown"),title:C,body:C}),ike=q({kind:ie("code"),title:C,language:C,body:C}),cke=tn(ake,oke,ike),uke=q({path:C,method:ne(C),interaction:H(ie("auto","required")),inputTypePreview:H(C),outputTypePreview:H(C)}),u3=q({shapeId:ne(C),typePreview:ne(C),typeDeclaration:ne(C),schemaJson:ne(C),exampleJson:ne(C)}),lke=q({callSignature:C,callDeclaration:C,callShapeId:C,resultShapeId:ne(C),responseSetId:C,input:u3,output:u3}),dke=q({source:ks,namespace:C,pipelineKind:nke,toolCount:it,tools:_e(uke)}),fke=q({summary:rke,contract:lke,sections:_e(cke)}),hke=q({query:C,limit:H(it)}),mke=q({path:C,score:it,description:H(C),inputTypePreview:H(C),outputTypePreview:H(C),reasons:_e(C)}),pke=q({query:C,queryTokens:_e(C),bestPath:ne(C),total:it,results:_e(mke)});q({id:C,appliedAt:At});const gke=q({kind:C,displayName:C,canCreate:Ke}),bke=q({platform:C,secretStorePlugins:_e(gke),defaultSecretStoreId:ne(C)}),yke=q({sourceId:C,sourceName:C}),xke=q({canCreateSecrets:Ke,canUpdateSecrets:Ke,canDeleteSecrets:Ke,canBrowseSecrets:Ke,canImportSecrets:Ke}),kke=q({id:C,storeId:C,storeName:C,storeKind:C,name:ne(C),purpose:C,createdAt:it,updatedAt:it,linkedSources:_e(yke)}),vke=q({name:C,value:C,purpose:H(n2),storeId:H(C)}),l3=q({id:C,name:ne(C),storeId:C,purpose:C,createdAt:it,updatedAt:it}),Ske=q({name:H(C),value:H(C)}),wke=q({id:C,storeId:C,name:ne(C),purpose:C,createdAt:it,updatedAt:it}),Wv=q({id:C,kind:C,name:C,status:C,enabled:Ke,capabilities:xke,createdAt:it,updatedAt:it}),_ke=q({key:C,label:C,description:ne(C),kind:ie("group","secret")}),Eke=q({parentKey:H(C),query:H(C)}),Tke=q({entries:_e(_ke)}),Cke=q({selectionKey:C,name:H(C),purpose:H(n2)}),Ike=q({kind:C,name:C,config:Tn}),Ake=q({name:H(C),config:H(Tn)}),Nke=q({removed:Ke}),Rke=q({removed:Ke}),QU=q({resourcePattern:rye,effect:H(qU),approvalMode:H(VU),priority:H(it),enabled:H(Ke)}),Pke=QU,Oke=QU;class Je extends Gd()("ControlPlaneBadRequestError",{operation:C,message:C,details:C},wa({status:400})){}class Dr extends Gd()("ControlPlaneUnauthorizedError",{operation:C,message:C,details:C},wa({status:401})){}class ft extends Gd()("ControlPlaneForbiddenError",{operation:C,message:C,details:C},wa({status:403})){}class kt extends Gd()("ControlPlaneNotFoundError",{operation:C,message:C,details:C},wa({status:404})){}class He extends Gd()("ControlPlaneStorageError",{operation:C,message:C,details:C},wa({status:500})){}const Jg=gn("workspaceId",mr),d3=gn("executionId",Jx);class Lke extends Xi("executions").add(Jn("list")`/workspaces/${Jg}/executions`.addSuccess(_e(WU)).addError(Je).addError(Dr).addError(ft).addError(kt).addError(He)).add(Dn("create")`/workspaces/${Jg}/executions`.setPayload(sye).addSuccess(Kv).addError(Je).addError(Dr).addError(ft).addError(kt).addError(He)).add(Jn("get")`/workspaces/${Jg}/executions/${d3}`.addSuccess(Kv).addError(Je).addError(Dr).addError(ft).addError(kt).addError(He)).add(Dn("resume")`/workspaces/${Jg}/executions/${d3}/resume`.setPayload(aye).addSuccess(Kv).addError(Je).addError(Dr).addError(ft).addError(kt).addError(He)).prefix("/v1"){}class $ke extends Xi("local").add(Jn("installation")`/local/installation`.addSuccess(GU).addError(Je).addError(kt).addError(He)).add(Jn("config")`/local/config`.addSuccess(bke).addError(He)).add(Jn("listSecretStores")`/local/secret-stores`.addSuccess(_e(Wv)).addError(He)).add(Dn("createSecretStore")`/local/secret-stores`.setPayload(Ike).addSuccess(Wv).addError(Je).addError(He)).add(U_("updateSecretStore")`/local/secret-stores/${gn("storeId",C)}`.setPayload(Ake).addSuccess(Wv).addError(Je).addError(kt).addError(He)).add(Bi("deleteSecretStore")`/local/secret-stores/${gn("storeId",C)}`.addSuccess(Nke).addError(kt).addError(He)).add(Dn("browseSecretStore")`/local/secret-stores/${gn("storeId",C)}/browse`.setPayload(Eke).addSuccess(Tke).addError(Je).addError(kt).addError(He)).add(Dn("importSecretFromStore")`/local/secret-stores/${gn("storeId",C)}/import`.setPayload(Cke).addSuccess(l3).addError(Je).addError(kt).addError(He)).add(Jn("listSecrets")`/local/secrets`.addSuccess(_e(kke)).addError(He)).add(Dn("createSecret")`/local/secrets`.setPayload(vke).addSuccess(l3).addError(Je).addError(He)).add(U_("updateSecret")`/local/secrets/${gn("secretId",C)}`.setPayload(Ske).addSuccess(wke).addError(Je).addError(kt).addError(He)).add(Bi("deleteSecret")`/local/secrets/${gn("secretId",C)}`.addSuccess(Rke).addError(kt).addError(He)).prefix("/v1"){}const If=gn("workspaceId",mr),Yv=gn("policyId",HU);class jke extends Xi("policies").add(Jn("list")`/workspaces/${If}/policies`.addSuccess(_e(Xf)).addError(Je).addError(Dr).addError(ft).addError(kt).addError(He)).add(Dn("create")`/workspaces/${If}/policies`.setPayload(Pke).addSuccess(Xf).addError(Je).addError(Dr).addError(ft).addError(kt).addError(He)).add(Jn("get")`/workspaces/${If}/policies/${Yv}`.addSuccess(Xf).addError(Je).addError(Dr).addError(ft).addError(kt).addError(He)).add(U_("update")`/workspaces/${If}/policies/${Yv}`.setPayload(Oke).addSuccess(Xf).addError(Je).addError(Dr).addError(ft).addError(kt).addError(He)).add(Bi("remove")`/workspaces/${If}/policies/${Yv}`.addSuccess(q({removed:Ke})).addError(Je).addError(Dr).addError(ft).addError(kt).addError(He)).prefix("/v1"){}const Xu=gn("workspaceId",mr),Af=gn("sourceId",Zi),Mke=gn("toolPath",C);class Dke extends Xi("sources").add(Jn("list")`/workspaces/${Xu}/sources`.addSuccess(_e(ks)).addError(Je).addError(Dr).addError(ft).addError(He)).add(Jn("get")`/workspaces/${Xu}/sources/${Af}`.addSuccess(ks).addError(Je).addError(Dr).addError(ft).addError(kt).addError(He)).add(Bi("remove")`/workspaces/${Xu}/sources/${Af}`.addSuccess(q({removed:Ke})).addError(Je).addError(Dr).addError(ft).addError(He)).add(Jn("inspection")`/workspaces/${Xu}/sources/${Af}/inspection`.addSuccess(dke).addError(Je).addError(Dr).addError(ft).addError(kt).addError(He)).add(Jn("inspectionTool")`/workspaces/${Xu}/sources/${Af}/tools/${Mke}/inspection`.addSuccess(fke).addError(Je).addError(Dr).addError(ft).addError(kt).addError(He)).add(Dn("inspectionDiscover")`/workspaces/${Xu}/sources/${Af}/inspection/discover`.setPayload(hke).addSuccess(pke).addError(Je).addError(Dr).addError(ft).addError(kt).addError(He)).prefix("/v1"){}const Fke=yp().add($ke).add(Dke).add(jke).add(Lke).annotateContext(Xbe({title:"Executor API",description:"Local-first API for workspace sources, policies, auth, and execution"})),r2=(e={})=>(e.plugins??[]).reduce((t,n)=>t.add(n.group),Fke),Bke=r2(),Uke=(e={})=>Zbe(r2(e));Uke();const zke="http://127.0.0.1:8788";let Hke=typeof window<"u"&&typeof window.location?.origin=="string"?window.location.origin:zke;const ws=()=>Hke,XU=()=>(e,t)=>{const n=s=>bbe()(e,{api:t,httpClient:Vbe,baseUrl:s}),r=new Map;return(s=ws())=>{const a=String(s),o=r.get(a);if(o!==void 0)return o;const i=n(s);return r.set(a,i),i}},Qx=()=>(e,t)=>XU()(e,r2({plugins:t})),xn=XU()("ExecutorReactHttpClient",Bke),qke=()=>({localInstallation:[]}),Vke=()=>({instanceConfig:[]}),Ou=()=>({secrets:[]}),Gke=e=>({sources:[e]}),Kke=e=>({executions:[e]}),Wke=(e,t)=>({execution:[e,t]}),Yke=(e,t)=>({source:[e,t]}),Jke=(e,t)=>({sourceInspection:[e,t]}),Qke=(e,t,n)=>({sourceInspectionTool:n==null?[e,t]:[e,t,n]}),Xx=e=>({policies:[e]}),Xke=e=>new Error(BC(e)),Zke=e=>Ss(e)?{status:"ready",data:e.value}:Kd(e)?{status:"error",error:Xke(e.cause)}:{status:"loading"},eve=RB(Ub).pipe(jI),Lu=e=>{if(e.status==="loading")return{status:"loading"};if(e.status==="error")return{status:"error",error:e.error};throw new Error("Expected workspace loadable to be pending or errored")},Ys=e=>{const t=Qi(e);return E.useMemo(()=>Zke(t),[t])},ec=()=>eve,ZU=(e=ws())=>xn(e).query("local","installation",{reactivityKeys:qke(),timeToLive:"5 minutes"}),tve=(e=ws())=>xn(e).query("local","config",{reactivityKeys:Vke(),timeToLive:"5 minutes"}),ez=(e=ws())=>xn(e).query("local","listSecrets",{reactivityKeys:Ou(),timeToLive:"1 minute"}),nve=(e=ws())=>xn(e).query("local","listSecretStores",{reactivityKeys:Ou(),timeToLive:"1 minute"}),rve=e=>xn().query("executions","list",{path:{workspaceId:e},reactivityKeys:Kke(e),timeToLive:"15 seconds"}),sve=(e,t)=>xn().query("executions","get",{path:{workspaceId:e,executionId:t},reactivityKeys:Wke(e,t),timeToLive:"15 seconds"}),ave=e=>xn().query("policies","list",{path:{workspaceId:e},reactivityKeys:Xx(e),timeToLive:"30 seconds"}),ove=e=>xn().query("sources","list",{path:{workspaceId:e},reactivityKeys:Gke(e),timeToLive:"30 seconds"}),ive=(e,t)=>xn().query("sources","get",{path:{workspaceId:e,sourceId:t},reactivityKeys:Yke(e,t),timeToLive:"30 seconds"}),cve=(e,t)=>xn().query("sources","inspection",{path:{workspaceId:e,sourceId:t},reactivityKeys:Jke(e,t),timeToLive:"30 seconds"}),tz=(e,t,n)=>n===null?ec():xn().query("sources","inspectionTool",{path:{workspaceId:e,sourceId:t,toolPath:n},reactivityKeys:Qke(e,t,n),timeToLive:"30 seconds"}),uve="ws_placeholder",lve=()=>{const e=Ys(ZU(ws()));return E.useMemo(()=>e.status!=="ready"?e:{status:"ready",data:{installation:e.data,workspaceId:e.data.scopeId}},[e])},rs=()=>{const e=lve(),t=e.status==="ready";return E.useMemo(()=>({workspace:e,enabled:t,workspaceId:t?e.data.workspaceId:uve}),[t,e])},dve=e=>f.jsx($be,{children:e.children}),er=e=>{const[t,n]=E.useState({status:"idle",data:null,error:null}),r=E.useCallback(async a=>{n(o=>({status:"pending",data:o.data,error:null}));try{const o=await e(a);return n({status:"success",data:o,error:null}),o}catch(o){const i=o instanceof Error?o:new Error(String(o));throw n({status:"error",data:null,error:i}),i}},[e]),s=E.useCallback(()=>{n({status:"idle",data:null,error:null})},[]);return E.useMemo(()=>({...t,mutateAsync:r,reset:s}),[r,s,t])},nz=()=>Ys(ez(ws())),rz=()=>Ys(nve(ws())),sz=()=>Bbe(ez(ws())),fve=()=>{const e=Dt(xn().mutation("local","createSecretStore"),{mode:"promise"});return er(E.useCallback(t=>e({payload:t,reactivityKeys:Ou()}),[e]))},hve=()=>{const e=Dt(xn().mutation("local","deleteSecretStore"),{mode:"promise"});return er(E.useCallback(t=>e({path:{storeId:t},reactivityKeys:Ou()}),[e]))},az=()=>{const e=Dt(xn().mutation("local","createSecret"),{mode:"promise"});return er(E.useCallback(t=>e({payload:t,reactivityKeys:Ou()}),[e]))},mve=()=>{const e=Dt(xn().mutation("local","updateSecret"),{mode:"promise"});return er(E.useCallback(t=>e({path:{secretId:t.secretId},payload:t.payload,reactivityKeys:Ou()}),[e]))},pve=()=>{const e=Dt(xn().mutation("local","deleteSecret"),{mode:"promise"});return er(E.useCallback(t=>e({path:{secretId:t},reactivityKeys:Ou()}),[e]))},f3="inline-flex h-8 items-center justify-center rounded-lg border border-input bg-card px-3 text-xs font-medium text-foreground transition-colors hover:bg-accent/50 disabled:pointer-events-none disabled:opacity-50";function xm(e){const t=nz(),n=rz(),r=sz(),s=az(),a=Dt(xn().mutation("local","browseSecretStore"),{mode:"promise"}),o=Dt(xn().mutation("local","importSecretFromStore"),{mode:"promise"}),[i,c]=E.useState(""),[u,l]=E.useState(""),[d,h]=E.useState(null),[m,p]=E.useState(!1),[y,g]=E.useState(!1),[b,x]=E.useState(""),[k,_]=E.useState([]),[S,w]=E.useState(null),[T,A]=E.useState("idle"),L=E.useCallback(async I=>a({path:{storeId:I.storeId},payload:I.query?.trim()?{query:I.query.trim()}:{}}),[a]),R=E.useCallback(async I=>o({path:{storeId:I.storeId},payload:{selectionKey:I.selectionKey}}),[o]),j=er(R),F=E.useMemo(()=>n.status==="ready"?n.data.filter(I=>I.capabilities.canBrowseSecrets&&I.capabilities.canImportSecrets):[],[n]),K=E.useMemo(()=>{if(!e.value)return null;try{const I=JSON.parse(e.value);return typeof I.secretId=="string"?I.secretId:null}catch{return null}},[e.value]),Y=E.useMemo(()=>t.status==="ready"&&K?t.data.find(I=>I.id===K)??null:null,[t,K]),W=E.useMemo(()=>{if(t.status!=="ready")return[];const I=b.trim().toLowerCase();return t.data.filter(U=>I.length===0||(U.name??"").toLowerCase().includes(I)||U.id.toLowerCase().includes(I)||U.storeName.toLowerCase().includes(I)||U.storeKind.toLowerCase().includes(I))},[b,t]),J=E.useMemo(()=>[...W.map(U=>({kind:"managed",secret:U})),...k],[W,k]);E.useEffect(()=>{if(!y)return;if(F.length===0){_([]),A("idle");return}let I=!0;A("pending");const U=window.setTimeout(()=>{Promise.all(F.map(async V=>(await L({storeId:V.id,query:b})).entries.filter(P=>P.kind==="secret").map(P=>({kind:"remote",storeId:V.id,storeName:V.name,entry:P})))).then(V=>{I&&(_(V.flat().sort((N,P)=>N.entry.label.localeCompare(P.entry.label))),w(null),A("idle"))}).catch(V=>{I&&(_([]),w(V instanceof Error?V.message:"Failed loading connected secrets."),A("idle"))})},250);return()=>{I=!1,window.clearTimeout(U)}},[F,L,b,y]);const ae=async()=>{const I=i.trim();if(!I){h("Secret name is required.");return}if(!u.trim()){h("Secret value is required.");return}try{h(null);const U=await s.mutateAsync({name:I,value:u});e.onChange(JSON.stringify({secretId:U.id})),c(""),l(""),p(!1)}catch(U){h(U instanceof Error?U.message:"Failed creating secret.")}},ge=I=>{e.onChange(JSON.stringify({secretId:I.id})),g(!1),x(""),w(null)},le=async I=>{try{const U=await j.mutateAsync({storeId:I.storeId,selectionKey:I.entry.key});r(),e.onChange(JSON.stringify({secretId:U.id})),g(!1),x(""),w(null)}catch(U){w(U instanceof Error?U.message:"Failed linking secret.")}};return f.jsxs("div",{className:"grid gap-2",children:[f.jsx("span",{className:"text-xs font-medium text-foreground",children:e.label}),f.jsx("input",{value:y?b:Y?Y.name??Y.id:"",onChange:I=>{x(I.target.value),y||(g(!0),p(!1))},onFocus:()=>{y||(g(!0),p(!1))},onBlur:I=>{I.relatedTarget?.closest("[data-secret-results]")||(g(!1),x(""))},placeholder:Y?Y.name??Y.id:e.emptyLabel,className:"h-9 w-full rounded-lg border border-input bg-background px-3 text-sm outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring/25"}),y&&f.jsxs("div",{className:"space-y-3","data-secret-results":!0,children:[S&&f.jsx("div",{className:"rounded-lg border border-destructive/30 bg-destructive/8 px-3 py-2 text-xs text-destructive",children:S}),f.jsxs("div",{className:"max-h-64 space-y-2 overflow-y-auto pr-1",children:[f.jsx("button",{type:"button",onClick:()=>{g(!1),p(!0)},className:"flex w-full items-start justify-between gap-3 rounded-lg border border-input bg-background px-3 py-2 text-left transition-colors hover:bg-accent/40",children:f.jsx("span",{className:"text-sm text-foreground",children:"Create new secret"})}),T==="pending"&&f.jsx("div",{className:"rounded-lg border border-border px-3 py-2 text-xs text-muted-foreground",children:"Loading secrets..."}),T!=="pending"&&J.length===0&&!S&&f.jsx("div",{className:"rounded-lg border border-border px-3 py-2 text-xs text-muted-foreground",children:"No secrets matched."}),T!=="pending"&&J.map(I=>I.kind==="managed"?f.jsxs("button",{type:"button",onClick:()=>ge(I.secret),className:"flex w-full items-start justify-between gap-3 rounded-lg border border-input bg-background px-3 py-2 text-left transition-colors hover:bg-accent/40",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-sm text-foreground",children:I.secret.name??I.secret.id}),f.jsxs("div",{className:"truncate text-xs text-muted-foreground",children:[I.secret.storeName," · managed"]})]}),f.jsx("div",{className:"shrink-0 text-[11px] uppercase tracking-wide text-muted-foreground",children:"Use"})]},`managed:${I.secret.id}`):f.jsxs("button",{type:"button",onClick:()=>{le(I)},className:"flex w-full items-start justify-between gap-3 rounded-lg border border-input bg-background px-3 py-2 text-left transition-colors hover:bg-accent/40",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-sm text-foreground",children:I.entry.label}),f.jsxs("div",{className:"truncate text-xs text-muted-foreground",children:[I.storeName,I.entry.description?` · ${I.entry.description}`:""]})]}),f.jsx("div",{className:"shrink-0 text-[11px] uppercase tracking-wide text-muted-foreground",children:j.status==="pending"?"Linking":"Link"})]},`remote:${I.storeId}:${I.entry.key}`))]})]}),m&&f.jsxs("div",{className:"space-y-3 border-l-2 border-border pl-4",children:[f.jsx("input",{value:i,onChange:I=>c(I.target.value),placeholder:e.draftNamePlaceholder,className:"h-9 w-full rounded-lg border border-input bg-background px-3 text-sm outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring/25"}),f.jsx("textarea",{value:u,onChange:I=>l(I.target.value),rows:3,placeholder:e.draftValuePlaceholder,className:"w-full rounded-lg border border-input bg-background px-3 py-2 font-mono text-xs outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring/25"}),d&&f.jsx("div",{className:"rounded-lg border border-destructive/30 bg-destructive/8 px-3 py-2 text-xs text-destructive",children:d}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{type:"button",onClick:()=>{p(!1),h(null)},className:f3,children:"Cancel"}),f.jsx("button",{type:"button",onClick:()=>{ae()},className:f3,children:s.status==="pending"?"Creating...":"Save secret"})]})]})]})}const Js=()=>Ys(ZU(ws())),gve=()=>Ys(tve(ws())),bve=()=>{const e=rs(),t=e.enabled?rve(e.workspaceId):ec(),n=Ys(t);return e.enabled?n:Lu(e.workspace)},oz=e=>{const t=rs(),n=t.enabled?sve(t.workspaceId,e):ec(),r=Ys(n);return t.enabled?r:Lu(t.workspace)},iz=()=>{const e=rs(),t=e.enabled?ove(e.workspaceId):ec(),n=Ys(t);return e.enabled?n:Lu(e.workspace)},Zx=e=>{const t=rs(),n=t.enabled?ive(t.workspaceId,e):ec(),r=Ys(n);return t.enabled?r:Lu(t.workspace)},yve=e=>{const t=rs(),n=t.enabled?cve(t.workspaceId,e):ec(),r=Ys(n);return t.enabled?r:Lu(t.workspace)},xve=(e,t)=>{const n=rs(),r=n.enabled?tz(n.workspaceId,e,t):ec(),s=Ys(r);return n.enabled?s:Lu(n.workspace)},kve=()=>{const e=E.useContext(xp),t=rs();return E.useCallback((n,r)=>t.enabled?e.mount(tz(t.workspaceId,n,r)):()=>{},[e,t.enabled,t.workspaceId])},cz=()=>{const e=rs(),t=e.enabled?ave(e.workspaceId):ec(),n=Ys(t);return e.enabled?n:Lu(e.workspace)},uz=()=>{const e=rs(),t=Dt(xn().mutation("policies","create"),{mode:"promise"});return er(E.useCallback(n=>e.enabled?t({path:{workspaceId:e.workspaceId},payload:n,reactivityKeys:Xx(e.workspaceId)}):Promise.reject(new Error("Executor workspace context is not ready")),[t,e.enabled,e.workspaceId]))},lz=()=>{const e=rs(),t=Dt(xn().mutation("policies","update"),{mode:"promise"});return er(E.useCallback(n=>e.enabled?t({path:{workspaceId:e.workspaceId,policyId:n.policyId},payload:n.payload,reactivityKeys:Xx(e.workspaceId)}):Promise.reject(new Error("Executor workspace context is not ready")),[t,e.enabled,e.workspaceId]))},vve=()=>{const e=rs(),t=Dt(xn().mutation("policies","remove"),{mode:"promise"});return er(E.useCallback(n=>e.enabled?t({path:{workspaceId:e.workspaceId,policyId:n},reactivityKeys:Xx(e.workspaceId)}):Promise.reject(new Error("Executor workspace context is not ready")),[t,e.enabled,e.workspaceId]))},dz=e=>e.replace(/^\/+/,"").replace(/\/+$/,""),tc=(...e)=>`/${e.map(dz).filter(Boolean).join("/")}`,N0="/sources/add",s2=e=>dz(e),a2=s2,fz=e=>tc("plugins",e),hz=(e,t="")=>{const n=s2(t);return n.length===0?fz(e):tc("plugins",e,n)},mz=(e,t="")=>hz(e,t),Sve=e=>mz(e,"add"),pz=e=>tc("plugins",e,"sources","$sourceId"),wve=e=>tc("plugins",e,"sources","$sourceId","edit"),gz=(e,t)=>tc("plugins",e,"sources",t),_ve=(e,t)=>tc("plugins",e,"sources",t,"edit"),Eve=(e,t)=>{const n=a2(t);return n.length===0?pz(e):tc("plugins",e,"sources","$sourceId",n)},Tve=(e,t,n)=>{const r=a2(n);return r.length===0?gz(e,t):tc("plugins",e,"sources",t,r)},o2=e=>({base:fz(e),routePattern:(t="")=>hz(e,t),route:(t="")=>mz(e,t)}),km=e=>({add:Sve(e),detailPattern:pz(e),editPattern:wve(e),detail:t=>gz(e,t),edit:t=>_ve(e,t),childPattern:t=>Eve(e,t),child:(t,n)=>Tve(e,t,n)}),_p=e=>e,Br=e=>{const t=e(),n=r=>E.createElement(e(),r);return n.displayName=`LiveFrontendPluginComponent(${t.displayName??t.name??"Anonymous"})`,n},Cve=e=>{const t=new Map,n=new Map,r=new Map;for(const a of e){if(t.has(a.key))throw new Error(`Duplicate frontend plugin registration: ${a.key}`);if(t.set(a.key,a),a.secretStore){if(r.has(a.secretStore.kind))throw new Error(`Duplicate frontend secret store registration: ${a.secretStore.kind}`);r.set(a.secretStore.kind,a)}const o=new Set,i=new Set;for(const c of a.routes??[]){if(o.has(c.key))throw new Error(`Duplicate frontend plugin route key for ${a.key}: ${c.key}`);o.add(c.key);const u=s2(c.path??"");if(i.has(u))throw new Error(`Duplicate frontend plugin route path for ${a.key}: ${u||"<root>"}`);i.add(u),n.set(`${a.key}:${c.key}`,{plugin:a,route:c})}}const s=[...n.values()];return{plugins:[...t.values()],routes:s,getPlugin:a=>t.get(a)??null,getRoute:(a,o)=>n.get(`${a}:${o}`)??null}},bz=E.createContext(null);function Ive(e){return f.jsx(bz.Provider,{value:e.value,children:e.children})}const ek=()=>{const e=E.useContext(bz);if(e===null)throw new Error("Executor plugin route context is unavailable.");return e},Ave=()=>ek().plugin,i2=()=>ek().navigation,yz=()=>ek().search,xz=()=>ek().params,Qs=()=>{const e=Ave(),t=i2();return{paths:km(e.key),home:()=>t.home(),add:()=>t.route("add"),detail:(r,s)=>t.route(`sources/${r}`,s),edit:(r,s)=>t.route(`sources/${r}/edit`,s),child:({sourceId:r,path:s,search:a})=>{const o=a2(s);return t.route(o.length===0?`sources/${r}`:`sources/${r}/${o}`,a)},updateSearch:r=>t.updateSearch(r)}},nc=()=>yz(),Ep=()=>xz();function kz(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=kz(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Tp(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=kz(e))&&(r&&(r+=" "),r+=t);return r}const Nve=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Rve=(e,t)=>({classGroupId:e,validator:t}),vz=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),R0="-",h3=[],Pve="arbitrary..",Ove=e=>{const t=$ve(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return Lve(o);const i=o.split(R0),c=i[0]===""&&i.length>1?1:0;return Sz(i,c,t)},getConflictingClassGroupIds:(o,i)=>{if(i){const c=r[o],u=n[o];return c?u?Nve(u,c):c:u||h3}return n[o]||h3}}},Sz=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],a=n.nextPart.get(s);if(a){const u=Sz(e,t+1,a);if(u)return u}const o=n.validators;if(o===null)return;const i=t===0?e.join(R0):e.slice(t).join(R0),c=o.length;for(let u=0;u<c;u++){const l=o[u];if(l.validator(i))return l.classGroupId}},Lve=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Pve+r:void 0})(),$ve=e=>{const{theme:t,classGroups:n}=e;return jve(n,t)},jve=(e,t)=>{const n=vz();for(const r in e){const s=e[r];c2(s,n,r,t)}return n},c2=(e,t,n,r)=>{const s=e.length;for(let a=0;a<s;a++){const o=e[a];Mve(o,t,n,r)}},Mve=(e,t,n,r)=>{if(typeof e=="string"){Dve(e,t,n);return}if(typeof e=="function"){Fve(e,t,n,r);return}Bve(e,t,n,r)},Dve=(e,t,n)=>{const r=e===""?t:wz(t,e);r.classGroupId=n},Fve=(e,t,n,r)=>{if(Uve(e)){c2(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Rve(n,e))},Bve=(e,t,n,r)=>{const s=Object.entries(e),a=s.length;for(let o=0;o<a;o++){const[i,c]=s[o];c2(c,wz(t,i),n,r)}},wz=(e,t)=>{let n=e;const r=t.split(R0),s=r.length;for(let a=0;a<s;a++){const o=r[a];let i=n.nextPart.get(o);i||(i=vz(),n.nextPart.set(o,i)),n=i}return n},Uve=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,zve=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(a,o)=>{n[a]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let o=n[a];if(o!==void 0)return o;if((o=r[a])!==void 0)return s(a,o),o},set(a,o){a in n?n[a]=o:s(a,o)}}},H_="!",m3=":",Hve=[],p3=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),qve=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const a=[];let o=0,i=0,c=0,u;const l=s.length;for(let y=0;y<l;y++){const g=s[y];if(o===0&&i===0){if(g===m3){a.push(s.slice(c,y)),c=y+1;continue}if(g==="/"){u=y;continue}}g==="["?o++:g==="]"?o--:g==="("?i++:g===")"&&i--}const d=a.length===0?s:s.slice(c);let h=d,m=!1;d.endsWith(H_)?(h=d.slice(0,-1),m=!0):d.startsWith(H_)&&(h=d.slice(1),m=!0);const p=u&&u>c?u-c:void 0;return p3(a,m,h,p)};if(t){const s=t+m3,a=r;r=o=>o.startsWith(s)?a(o.slice(s.length)):p3(Hve,!1,o,void 0,!0)}if(n){const s=r;r=a=>n({className:a,parseClassName:s})}return r},Vve=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let a=0;a<n.length;a++){const o=n[a],i=o[0]==="[",c=t.has(o);i||c?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(o)):s.push(o)}return s.length>0&&(s.sort(),r.push(...s)),r}},Gve=e=>({cache:zve(e.cacheSize),parseClassName:qve(e),sortModifiers:Vve(e),...Ove(e)}),Kve=/\s+/,Wve=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:a}=t,o=[],i=e.trim().split(Kve);let c="";for(let u=i.length-1;u>=0;u-=1){const l=i[u],{isExternal:d,modifiers:h,hasImportantModifier:m,baseClassName:p,maybePostfixModifierPosition:y}=n(l);if(d){c=l+(c.length>0?" "+c:c);continue}let g=!!y,b=r(g?p.substring(0,y):p);if(!b){if(!g){c=l+(c.length>0?" "+c:c);continue}if(b=r(p),!b){c=l+(c.length>0?" "+c:c);continue}g=!1}const x=h.length===0?"":h.length===1?h[0]:a(h).join(":"),k=m?x+H_:x,_=k+b;if(o.indexOf(_)>-1)continue;o.push(_);const S=s(b,g);for(let w=0;w<S.length;++w){const T=S[w];o.push(k+T)}c=l+(c.length>0?" "+c:c)}return c},Yve=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=_z(n))&&(s&&(s+=" "),s+=r);return s},_z=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=_z(e[r]))&&(n&&(n+=" "),n+=t);return n},Jve=(e,...t)=>{let n,r,s,a;const o=c=>{const u=t.reduce((l,d)=>d(l),e());return n=Gve(u),r=n.cache.get,s=n.cache.set,a=i,i(c)},i=c=>{const u=r(c);if(u)return u;const l=Wve(c,n);return s(c,l),l};return a=o,(...c)=>a(Yve(...c))},Qve=[],Nn=e=>{const t=n=>n[e]||Qve;return t.isThemeGetter=!0,t},Ez=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Tz=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Xve=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Zve=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,eSe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,tSe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,nSe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,rSe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xo=e=>Xve.test(e),lt=e=>!!e&&!Number.isNaN(Number(e)),Zo=e=>!!e&&Number.isInteger(Number(e)),Jv=e=>e.endsWith("%")&<(e.slice(0,-1)),po=e=>Zve.test(e),Cz=()=>!0,sSe=e=>eSe.test(e)&&!tSe.test(e),u2=()=>!1,aSe=e=>nSe.test(e),oSe=e=>rSe.test(e),iSe=e=>!Me(e)&&!De(e),cSe=e=>rc(e,Nz,u2),Me=e=>Ez.test(e),hc=e=>rc(e,Rz,sSe),g3=e=>rc(e,gSe,lt),uSe=e=>rc(e,Oz,Cz),lSe=e=>rc(e,Pz,u2),b3=e=>rc(e,Iz,u2),dSe=e=>rc(e,Az,oSe),Qg=e=>rc(e,Lz,aSe),De=e=>Tz.test(e),Nf=e=>$u(e,Rz),fSe=e=>$u(e,Pz),y3=e=>$u(e,Iz),hSe=e=>$u(e,Nz),mSe=e=>$u(e,Az),Xg=e=>$u(e,Lz,!0),pSe=e=>$u(e,Oz,!0),rc=(e,t,n)=>{const r=Ez.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},$u=(e,t,n=!1)=>{const r=Tz.exec(e);return r?r[1]?t(r[1]):n:!1},Iz=e=>e==="position"||e==="percentage",Az=e=>e==="image"||e==="url",Nz=e=>e==="length"||e==="size"||e==="bg-size",Rz=e=>e==="length",gSe=e=>e==="number",Pz=e=>e==="family-name",Oz=e=>e==="number"||e==="weight",Lz=e=>e==="shadow",bSe=()=>{const e=Nn("color"),t=Nn("font"),n=Nn("text"),r=Nn("font-weight"),s=Nn("tracking"),a=Nn("leading"),o=Nn("breakpoint"),i=Nn("container"),c=Nn("spacing"),u=Nn("radius"),l=Nn("shadow"),d=Nn("inset-shadow"),h=Nn("text-shadow"),m=Nn("drop-shadow"),p=Nn("blur"),y=Nn("perspective"),g=Nn("aspect"),b=Nn("ease"),x=Nn("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[..._(),De,Me],w=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],A=()=>[De,Me,c],L=()=>[Xo,"full","auto",...A()],R=()=>[Zo,"none","subgrid",De,Me],j=()=>["auto",{span:["full",Zo,De,Me]},Zo,De,Me],F=()=>[Zo,"auto",De,Me],K=()=>["auto","min","max","fr",De,Me],Y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],J=()=>["auto",...A()],ae=()=>[Xo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],ge=()=>[Xo,"screen","full","dvw","lvw","svw","min","max","fit",...A()],le=()=>[Xo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],I=()=>[e,De,Me],U=()=>[..._(),y3,b3,{position:[De,Me]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],N=()=>["auto","cover","contain",hSe,cSe,{size:[De,Me]}],P=()=>[Jv,Nf,hc],D=()=>["","none","full",u,De,Me],Q=()=>["",lt,Nf,hc],pe=()=>["solid","dashed","dotted","double"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ee=()=>[lt,Jv,y3,b3],Ne=()=>["","none",p,De,Me],G=()=>["none",lt,De,Me],X=()=>["none",lt,De,Me],ee=()=>[lt,De,Me],oe=()=>[Xo,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[po],breakpoint:[po],color:[Cz],container:[po],"drop-shadow":[po],ease:["in","out","in-out"],font:[iSe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[po],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[po],shadow:[po],spacing:["px",lt],text:[po],"text-shadow":[po],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Xo,Me,De,g]}],container:["container"],columns:[{columns:[lt,Me,De,i]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:w()}],"overflow-x":[{"overflow-x":w()}],"overflow-y":[{"overflow-y":w()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{"inset-s":L(),start:L()}],end:[{"inset-e":L(),end:L()}],"inset-bs":[{"inset-bs":L()}],"inset-be":[{"inset-be":L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[Zo,"auto",De,Me]}],basis:[{basis:[Xo,"full","auto",i,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[lt,Xo,"auto","initial","none",Me]}],grow:[{grow:["",lt,De,Me]}],shrink:[{shrink:["",lt,De,Me]}],order:[{order:[Zo,"first","last","none",De,Me]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:J()}],mx:[{mx:J()}],my:[{my:J()}],ms:[{ms:J()}],me:[{me:J()}],mbs:[{mbs:J()}],mbe:[{mbe:J()}],mt:[{mt:J()}],mr:[{mr:J()}],mb:[{mb:J()}],ml:[{ml:J()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:ae()}],"inline-size":[{inline:["auto",...ge()]}],"min-inline-size":[{"min-inline":["auto",...ge()]}],"max-inline-size":[{"max-inline":["none",...ge()]}],"block-size":[{block:["auto",...le()]}],"min-block-size":[{"min-block":["auto",...le()]}],"max-block-size":[{"max-block":["none",...le()]}],w:[{w:[i,"screen",...ae()]}],"min-w":[{"min-w":[i,"screen","none",...ae()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[o]},...ae()]}],h:[{h:["screen","lh",...ae()]}],"min-h":[{"min-h":["screen","lh","none",...ae()]}],"max-h":[{"max-h":["screen","lh",...ae()]}],"font-size":[{text:["base",n,Nf,hc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,pSe,uSe]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Jv,Me]}],"font-family":[{font:[fSe,lSe,t]}],"font-features":[{"font-features":[Me]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,De,Me]}],"line-clamp":[{"line-clamp":[lt,"none",De,g3]}],leading:[{leading:[a,...A()]}],"list-image":[{"list-image":["none",De,Me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",De,Me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...pe(),"wavy"]}],"text-decoration-thickness":[{decoration:[lt,"from-font","auto",De,hc]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[lt,"auto",De,Me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",De,Me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",De,Me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:U()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:N()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Zo,De,Me],radial:["",De,Me],conic:[Zo,De,Me]},mSe,dSe]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:D()}],"rounded-s":[{"rounded-s":D()}],"rounded-e":[{"rounded-e":D()}],"rounded-t":[{"rounded-t":D()}],"rounded-r":[{"rounded-r":D()}],"rounded-b":[{"rounded-b":D()}],"rounded-l":[{"rounded-l":D()}],"rounded-ss":[{"rounded-ss":D()}],"rounded-se":[{"rounded-se":D()}],"rounded-ee":[{"rounded-ee":D()}],"rounded-es":[{"rounded-es":D()}],"rounded-tl":[{"rounded-tl":D()}],"rounded-tr":[{"rounded-tr":D()}],"rounded-br":[{"rounded-br":D()}],"rounded-bl":[{"rounded-bl":D()}],"border-w":[{border:Q()}],"border-w-x":[{"border-x":Q()}],"border-w-y":[{"border-y":Q()}],"border-w-s":[{"border-s":Q()}],"border-w-e":[{"border-e":Q()}],"border-w-bs":[{"border-bs":Q()}],"border-w-be":[{"border-be":Q()}],"border-w-t":[{"border-t":Q()}],"border-w-r":[{"border-r":Q()}],"border-w-b":[{"border-b":Q()}],"border-w-l":[{"border-l":Q()}],"divide-x":[{"divide-x":Q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...pe(),"hidden","none"]}],"divide-style":[{divide:[...pe(),"hidden","none"]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...pe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[lt,De,Me]}],"outline-w":[{outline:["",lt,Nf,hc]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",l,Xg,Qg]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",d,Xg,Qg]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[lt,hc]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":Q()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",h,Xg,Qg]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[lt,De,Me]}],"mix-blend":[{"mix-blend":[...ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ce()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[lt]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ee()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":Ee()}],"mask-image-t-to-pos":[{"mask-t-to":Ee()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":Ee()}],"mask-image-r-to-pos":[{"mask-r-to":Ee()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":Ee()}],"mask-image-b-to-pos":[{"mask-b-to":Ee()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":Ee()}],"mask-image-l-to-pos":[{"mask-l-to":Ee()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":Ee()}],"mask-image-x-to-pos":[{"mask-x-to":Ee()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":Ee()}],"mask-image-y-to-pos":[{"mask-y-to":Ee()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[De,Me]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ee()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[lt]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ee()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:N()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",De,Me]}],filter:[{filter:["","none",De,Me]}],blur:[{blur:Ne()}],brightness:[{brightness:[lt,De,Me]}],contrast:[{contrast:[lt,De,Me]}],"drop-shadow":[{"drop-shadow":["","none",m,Xg,Qg]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",lt,De,Me]}],"hue-rotate":[{"hue-rotate":[lt,De,Me]}],invert:[{invert:["",lt,De,Me]}],saturate:[{saturate:[lt,De,Me]}],sepia:[{sepia:["",lt,De,Me]}],"backdrop-filter":[{"backdrop-filter":["","none",De,Me]}],"backdrop-blur":[{"backdrop-blur":Ne()}],"backdrop-brightness":[{"backdrop-brightness":[lt,De,Me]}],"backdrop-contrast":[{"backdrop-contrast":[lt,De,Me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",lt,De,Me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[lt,De,Me]}],"backdrop-invert":[{"backdrop-invert":["",lt,De,Me]}],"backdrop-opacity":[{"backdrop-opacity":[lt,De,Me]}],"backdrop-saturate":[{"backdrop-saturate":[lt,De,Me]}],"backdrop-sepia":[{"backdrop-sepia":["",lt,De,Me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",De,Me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[lt,"initial",De,Me]}],ease:[{ease:["linear","initial",b,De,Me]}],delay:[{delay:[lt,De,Me]}],animate:[{animate:["none",x,De,Me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,De,Me]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:G()}],"rotate-x":[{"rotate-x":G()}],"rotate-y":[{"rotate-y":G()}],"rotate-z":[{"rotate-z":G()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:ee()}],"skew-x":[{"skew-x":ee()}],"skew-y":[{"skew-y":ee()}],transform:[{transform:[De,Me,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",De,Me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",De,Me]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[lt,Nf,hc,g3]}],stroke:[{stroke:["none",...I()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},tk=Jve(bSe);function gt(...e){return tk(Tp(e))}var Zt=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function ySe(e){return l2(e)}function l2(e){return Array.isArray(e)?xSe(e):e instanceof RegExp?e:typeof e=="object"?kSe(e):e}function xSe(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=l2(e[n]);return t}function kSe(e){let t={};for(let n in e)t[n]=l2(e[n]);return t}function $z(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function jz(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?jz(e.substring(0,e.length-1)):e.substr(~t+1)}var Qv=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Zg=class{static hasCaptures(e){return e===null?!1:(Qv.lastIndex=0,Qv.test(e))}static replaceCaptures(e,t,n){return e.replace(Qv,(r,s,a,o)=>{let i=n[parseInt(s||a,10)];if(i){let c=t.substring(i.start,i.end);for(;c[0]===".";)c=c.substring(1);switch(o){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return r})}};function Mz(e,t){return e<t?-1:e>t?1:0}function Dz(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let s=0;s<n;s++){let a=Mz(e[s],t[s]);if(a!==0)return a}return 0}return n-r}function x3(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Fz(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Bz=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},P0=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(wSe(e),t)}static createFromParsedTheme(e,t){return ESe(e,t)}_cachedMatchRoot=new Bz(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(s=>vSe(e.parent,s.parentScopes));return r?new Uz(r.fontStyle,r.foreground,r.background):null}},Xv=class ty{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new ty(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new ty(n,t[r]);return n}push(t){return new ty(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function vSe(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],s=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],s=!0}for(;e&&!SSe(e.scopeName,r);){if(s)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function SSe(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Uz=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function wSe(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let s=0,a=t.length;s<a;s++){let o=t[s];if(!o.settings)continue;let i;if(typeof o.scope=="string"){let d=o.scope;d=d.replace(/^[,]+/,""),d=d.replace(/[,]+$/,""),i=d.split(",")}else Array.isArray(o.scope)?i=o.scope:i=[""];let c=-1;if(typeof o.settings.fontStyle=="string"){c=0;let d=o.settings.fontStyle.split(" ");for(let h=0,m=d.length;h<m;h++)switch(d[h]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let u=null;typeof o.settings.foreground=="string"&&x3(o.settings.foreground)&&(u=o.settings.foreground);let l=null;typeof o.settings.background=="string"&&x3(o.settings.background)&&(l=o.settings.background);for(let d=0,h=i.length;d<h;d++){let p=i[d].trim().split(" "),y=p[p.length-1],g=null;p.length>1&&(g=p.slice(0,p.length-1),g.reverse()),n[r++]=new _Se(y,g,s,c,u,l)}}return n}var _Se=class{constructor(e,t,n,r,s,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=s,this.background=a}},kr=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(kr||{});function ESe(e,t){e.sort((c,u)=>{let l=Mz(c.scope,u.scope);return l!==0||(l=Dz(c.parentScopes,u.parentScopes),l!==0)?l:c.index-u.index});let n=0,r="#000000",s="#ffffff";for(;e.length>=1&&e[0].scope==="";){let c=e.shift();c.fontStyle!==-1&&(n=c.fontStyle),c.foreground!==null&&(r=c.foreground),c.background!==null&&(s=c.background)}let a=new TSe(t),o=new Uz(n,a.getId(r),a.getId(s)),i=new ISe(new q_(0,null,-1,0,0),[]);for(let c=0,u=e.length;c<u;c++){let l=e[c];i.insert(0,l.scope,l.parentScopes,l.fontStyle,a.getId(l.foreground),a.getId(l.background))}return new P0(a,o,i)}var TSe=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},CSe=Object.freeze([]),q_=class zz{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,r,s,a){this.scopeDepth=t,this.parentScopes=n||CSe,this.fontStyle=r,this.foreground=s,this.background=a}clone(){return new zz(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,s=t.length;r<s;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,s){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),s!==0&&(this.background=s)}},ISe=class V_{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,s=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[s]===">"&&s++,!(r>=t.parentScopes.length||s>=n.parentScopes.length);){const a=n.parentScopes[s].length-t.parentScopes[r].length;if(a!==0)return a;r++,s++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),s,a;if(r===-1?(s=t,a=""):(s=t.substring(0,r),a=t.substring(r+1)),this._children.hasOwnProperty(s))return this._children[s].match(a)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(V_._cmpBySpecificity),n}insert(t,n,r,s,a,o){if(n===""){this._doInsertHere(t,r,s,a,o);return}let i=n.indexOf("."),c,u;i===-1?(c=n,u=""):(c=n.substring(0,i),u=n.substring(i+1));let l;this._children.hasOwnProperty(c)?l=this._children[c]:(l=new V_(this._mainRule.clone(),q_.cloneArr(this._rulesWithParentScopes)),this._children[c]=l),l.insert(t+1,u,r,s,a,o)}_doInsertHere(t,n,r,s,a){if(n===null){this._mainRule.acceptOverwrite(t,r,s,a);return}for(let o=0,i=this._rulesWithParentScopes.length;o<i;o++){let c=this._rulesWithParentScopes[o];if(Dz(c.parentScopes,n)===0){c.acceptOverwrite(t,r,s,a);return}}r===-1&&(r=this._mainRule.fontStyle),s===0&&(s=this._mainRule.foreground),a===0&&(a=this._mainRule.background),this._rulesWithParentScopes.push(new q_(t,n,r,s,a))}},gd=class Rs{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=Rs.getLanguageId(t),r=Rs.getTokenType(t),s=Rs.getFontStyle(t),a=Rs.getForeground(t),o=Rs.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:s,foreground:a,background:o})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,s,a,o,i){let c=Rs.getLanguageId(t),u=Rs.getTokenType(t),l=Rs.containsBalancedBrackets(t)?1:0,d=Rs.getFontStyle(t),h=Rs.getForeground(t),m=Rs.getBackground(t);return n!==0&&(c=n),r!==8&&(u=r),s!==null&&(l=s?1:0),a!==-1&&(d=a),o!==0&&(h=o),i!==0&&(m=i),(c<<0|u<<8|l<<10|d<<11|h<<15|m<<24)>>>0}};function O0(e,t){const n=[],r=ASe(e);let s=r.next();for(;s!==null;){let c=0;if(s.length===2&&s.charAt(1)===":"){switch(s.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=r.next()}let u=o();if(n.push({matcher:u,priority:c}),s!==",")break;s=r.next()}return n;function a(){if(s==="-"){s=r.next();const c=a();return u=>!!c&&!c(u)}if(s==="("){s=r.next();const c=i();return s===")"&&(s=r.next()),c}if(k3(s)){const c=[];do c.push(s),s=r.next();while(k3(s));return u=>t(c,u)}return null}function o(){const c=[];let u=a();for(;u;)c.push(u),u=a();return l=>c.every(d=>d(l))}function i(){const c=[];let u=o();for(;u&&(c.push(u),s==="|"||s===",");){do s=r.next();while(s==="|"||s===",");u=o()}return l=>c.some(d=>d(l))}}function k3(e){return!!e&&!!e.match(/[\w\.:]+/)}function ASe(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function Hz(e){typeof e.dispose=="function"&&e.dispose()}var vm=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},NSe=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},RSe=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},PSe=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new vm(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new RSe;for(const n of e)OSe(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof vm){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function OSe(e,t,n,r){const s=n.lookup(e.scopeName);if(!s){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const a=n.lookup(t);e instanceof vm?ny({baseGrammar:a,selfGrammar:s},r):G_(e.ruleName,{baseGrammar:a,selfGrammar:s,repository:s.repository},r);const o=n.injections(e.scopeName);if(o)for(const i of o)r.add(new vm(i))}function G_(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];L0([r],t,n)}}function ny(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&L0(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&L0(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function L0(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const s=r.repository?$z({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&L0(r.patterns,{...t,repository:s},n);const a=r.include;if(!a)continue;const o=qz(a);switch(o.kind){case 0:ny({...t,selfGrammar:t.baseGrammar},n);break;case 1:ny(t,n);break;case 2:G_(o.ruleName,{...t,repository:s},n);break;case 3:case 4:const i=o.scopeName===t.selfGrammar.scopeName?t.selfGrammar:o.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(i){const c={baseGrammar:t.baseGrammar,selfGrammar:i,repository:s};o.kind===4?G_(o.ruleName,c,n):ny(c,n)}else o.kind===4?n.add(new NSe(o.scopeName,o.ruleName)):n.add(new vm(o.scopeName));break}}}var LSe=class{kind=0},$Se=class{kind=1},jSe=class{constructor(e){this.ruleName=e}kind=2},MSe=class{constructor(e){this.scopeName=e}kind=3},DSe=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function qz(e){if(e==="$base")return new LSe;if(e==="$self")return new $Se;const t=e.indexOf("#");if(t===-1)return new MSe(e);if(t===0)return new jSe(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new DSe(n,r)}}var FSe=/\\(\d+)/,v3=/\\(\d+)/g,BSe=-1,Vz=-2;var Cp=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Zg.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Zg.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${jz(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Zg.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Zg.replaceCaptures(this._contentName,e,t)}},USe=class extends Cp{retokenizeCapturedWithRuleId;constructor(e,t,n,r,s){super(e,t,n,r),this.retokenizeCapturedWithRuleId=s}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},zSe=class extends Cp{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,s){super(e,t,n,null),this._match=new Sm(r,this.id),this.captures=s,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new wm,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},S3=class extends Cp{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,s){super(e,t,n,r),this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new wm,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},K_=class extends Cp{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,s,a,o,i,c,u){super(e,t,n,r),this._begin=new Sm(s,this.id),this.beginCaptures=a,this._end=new Sm(o||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=i,this.applyEndPatternLast=c||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new wm;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},$0=class extends Cp{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,s,a,o,i,c){super(e,t,n,r),this._begin=new Sm(s,this.id),this.beginCaptures=a,this.whileCaptures=i,this._while=new Sm(o,Vz),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new wm;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new wm,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},Gz=class xr{static createCaptureRule(t,n,r,s,a){return t.registerRule(o=>new USe(n,o,r,s,a))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(s=>{if(t.id=s,t.match)return new zSe(t.$vscodeTextmateLocation,t.id,t.name,t.match,xr._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=$z({},r,t.repository));let a=t.patterns;return typeof a>"u"&&t.include&&(a=[{include:t.include}]),new S3(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,xr._compilePatterns(a,n,r))}return t.while?new $0(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,xr._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,xr._compileCaptures(t.whileCaptures||t.captures,n,r),xr._compilePatterns(t.patterns,n,r)):new K_(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,xr._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,xr._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,xr._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let s=[];if(t){let a=0;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const i=parseInt(o,10);i>a&&(a=i)}for(let o=0;o<=a;o++)s[o]=null;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const i=parseInt(o,10);let c=0;t[o].patterns&&(c=xr.getCompiledRuleId(t[o],n,r)),s[i]=xr.createCaptureRule(n,t[o].$vscodeTextmateLocation,t[o].name,t[o].contentName,c)}}return s}static _compilePatterns(t,n,r){let s=[];if(t)for(let a=0,o=t.length;a<o;a++){const i=t[a];let c=-1;if(i.include){const u=qz(i.include);switch(u.kind){case 0:case 1:c=xr.getCompiledRuleId(r[i.include],n,r);break;case 2:let l=r[u.ruleName];l&&(c=xr.getCompiledRuleId(l,n,r));break;case 3:case 4:const d=u.scopeName,h=u.kind===4?u.ruleName:null,m=n.getExternalGrammar(d,r);if(m)if(h){let p=m.repository[h];p&&(c=xr.getCompiledRuleId(p,n,m.repository))}else c=xr.getCompiledRuleId(m.repository.$self,n,m.repository);break}}else c=xr.getCompiledRuleId(i,n,r);if(c!==-1){const u=n.getRule(c);let l=!1;if((u instanceof S3||u instanceof K_||u instanceof $0)&&u.hasMissingPatterns&&u.patterns.length===0&&(l=!0),l)continue;s.push(c)}}return{patterns:s,hasMissingPatterns:(t?t.length:0)!==s.length}}},Sm=class Kz{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const r=t.length;let s=0,a=[],o=!1;for(let i=0;i<r;i++)if(t.charAt(i)==="\\"&&i+1<r){const u=t.charAt(i+1);u==="z"?(a.push(t.substring(s,i)),a.push("$(?!\\n)(?<!\\n)"),s=i+2):(u==="A"||u==="G")&&(o=!0),i++}this.hasAnchor=o,s===0?this.source=t:(a.push(t.substring(s,r)),this.source=a.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=FSe.test(this.source):this.hasBackReferences=!1}clone(){return new Kz(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(s=>t.substring(s.start,s.end));return v3.lastIndex=0,this.source.replace(v3,(s,a)=>Fz(r[parseInt(a,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],s=[],a,o,i,c;for(a=0,o=this.source.length;a<o;a++)i=this.source.charAt(a),t[a]=i,n[a]=i,r[a]=i,s[a]=i,i==="\\"&&a+1<o&&(c=this.source.charAt(a+1),c==="A"?(t[a+1]="",n[a+1]="",r[a+1]="A",s[a+1]="A"):c==="G"?(t[a+1]="",n[a+1]="G",r[a+1]="",s[a+1]="G"):(t[a+1]=c,n[a+1]=c,r[a+1]=c,s[a+1]=c),a++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:s.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},wm=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new w3(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(s=>s.resolveAnchors(t,n));return new w3(e,r,this._items.map(s=>s.ruleId))}},w3=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
|
|
36
|
-
`)}findNextMatchSync(e,t,n){const r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Zv=class{constructor(e,t){this.languageId=e,this.tokenType=t}},HSe=class W_{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Zv(t,8),this._embeddedLanguagesMatcher=new qSe(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?W_._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Zv(0,0);_getBasicScopeAttributes=new Bz(t=>{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new Zv(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(W_.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},qSe=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>Fz(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},_3=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Wz(e,t,n,r,s,a,o,i){const c=t.content.length;let u=!1,l=-1;if(o){const m=VSe(e,t,n,r,s,a);s=m.stack,r=m.linePos,n=m.isFirstLine,l=m.anchorPosition}const d=Date.now();for(;!u;){if(i!==0&&Date.now()-d>i)return new _3(s,!0);h()}return new _3(s,!1);function h(){const m=GSe(e,t,n,r,s,l);if(!m){a.produce(s,c),u=!0;return}const p=m.captureIndices,y=m.matchedRuleId,g=p&&p.length>0?p[0].end>r:!1;if(y===BSe){const b=s.getRule(e);a.produce(s,p[0].start),s=s.withContentNameScopesList(s.nameScopesList),Zf(e,t,n,s,a,b.endCaptures,p),a.produce(s,p[0].end);const x=s;if(s=s.parent,l=x.getAnchorPos(),!g&&x.getEnterPos()===r){s=x,a.produce(s,c),u=!0;return}}else{const b=e.getRule(y);a.produce(s,p[0].start);const x=s,k=b.getName(t.content,p),_=s.contentNameScopesList.pushAttributed(k,e);if(s=s.push(y,r,l,p[0].end===c,null,_,_),b instanceof K_){const S=b;Zf(e,t,n,s,a,S.beginCaptures,p),a.produce(s,p[0].end),l=p[0].end;const w=S.getContentName(t.content,p),T=_.pushAttributed(w,e);if(s=s.withContentNameScopesList(T),S.endHasBackReferences&&(s=s.withEndRule(S.getEndWithResolvedBackReferences(t.content,p))),!g&&x.hasSameRuleAs(s)){s=s.pop(),a.produce(s,c),u=!0;return}}else if(b instanceof $0){const S=b;Zf(e,t,n,s,a,S.beginCaptures,p),a.produce(s,p[0].end),l=p[0].end;const w=S.getContentName(t.content,p),T=_.pushAttributed(w,e);if(s=s.withContentNameScopesList(T),S.whileHasBackReferences&&(s=s.withEndRule(S.getWhileWithResolvedBackReferences(t.content,p))),!g&&x.hasSameRuleAs(s)){s=s.pop(),a.produce(s,c),u=!0;return}}else if(Zf(e,t,n,s,a,b.captures,p),a.produce(s,p[0].end),s=s.pop(),!g){s=s.safePop(),a.produce(s,c),u=!0;return}}p[0].end>r&&(r=p[0].end,n=!1)}}function VSe(e,t,n,r,s,a){let o=s.beginRuleCapturedEOL?0:-1;const i=[];for(let c=s;c;c=c.pop()){const u=c.getRule(e);u instanceof $0&&i.push({rule:u,stack:c})}for(let c=i.pop();c;c=i.pop()){const{ruleScanner:u,findOptions:l}=YSe(c.rule,e,c.stack.endRule,n,r===o),d=u.findNextMatchSync(t,r,l);if(d){if(d.ruleId!==Vz){s=c.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(a.produce(c.stack,d.captureIndices[0].start),Zf(e,t,n,c.stack,a,c.rule.whileCaptures,d.captureIndices),a.produce(c.stack,d.captureIndices[0].end),o=d.captureIndices[0].end,d.captureIndices[0].end>r&&(r=d.captureIndices[0].end,n=!1))}else{s=c.stack.pop();break}}return{stack:s,linePos:r,anchorPosition:o,isFirstLine:n}}function GSe(e,t,n,r,s,a){const o=KSe(e,t,n,r,s,a),i=e.getInjections();if(i.length===0)return o;const c=WSe(i,e,t,n,r,s,a);if(!c)return o;if(!o)return c;const u=o.captureIndices[0].start,l=c.captureIndices[0].start;return l<u||c.priorityMatch&&l===u?c:o}function KSe(e,t,n,r,s,a){const o=s.getRule(e),{ruleScanner:i,findOptions:c}=Yz(o,e,s.endRule,n,r===a),u=i.findNextMatchSync(t,r,c);return u?{captureIndices:u.captureIndices,matchedRuleId:u.ruleId}:null}function WSe(e,t,n,r,s,a,o){let i=Number.MAX_VALUE,c=null,u,l=0;const d=a.contentNameScopesList.getScopeNames();for(let h=0,m=e.length;h<m;h++){const p=e[h];if(!p.matcher(d))continue;const y=t.getRule(p.ruleId),{ruleScanner:g,findOptions:b}=Yz(y,t,null,r,s===o),x=g.findNextMatchSync(n,s,b);if(!x)continue;const k=x.captureIndices[0].start;if(!(k>=i)&&(i=k,c=x.captureIndices,u=x.ruleId,l=p.priority,i===s))break}return c?{priorityMatch:l===-1,captureIndices:c,matchedRuleId:u}:null}function Yz(e,t,n,r,s){return{ruleScanner:e.compileAG(t,n,r,s),findOptions:0}}function YSe(e,t,n,r,s){return{ruleScanner:e.compileWhileAG(t,n,r,s),findOptions:0}}function Zf(e,t,n,r,s,a,o){if(a.length===0)return;const i=t.content,c=Math.min(a.length,o.length),u=[],l=o[0].end;for(let d=0;d<c;d++){const h=a[d];if(h===null)continue;const m=o[d];if(m.length===0)continue;if(m.start>l)break;for(;u.length>0&&u[u.length-1].endPos<=m.start;)s.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?s.produceFromScopes(u[u.length-1].scopes,m.start):s.produce(r,m.start),h.retokenizeCapturedWithRuleId){const y=h.getName(i,o),g=r.contentNameScopesList.pushAttributed(y,e),b=h.getContentName(i,o),x=g.pushAttributed(b,e),k=r.push(h.retokenizeCapturedWithRuleId,m.start,-1,!1,null,g,x),_=e.createOnigString(i.substring(0,m.end));Wz(e,_,n&&m.start===0,m.start,k,s,!1,0),Hz(_);continue}const p=h.getName(i,o);if(p!==null){const g=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).pushAttributed(p,e);u.push(new JSe(g,m.end))}}for(;u.length>0;)s.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var JSe=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function QSe(e,t,n,r,s,a,o,i){return new ZSe(e,t,n,r,s,a,o,i)}function E3(e,t,n,r,s){const a=O0(t,j0),o=Gz.getCompiledRuleId(n,r,s.repository);for(const i of a)e.push({debugSelector:t,matcher:i.matcher,ruleId:o,grammar:s,priority:i.priority})}function j0(e,t){if(t.length<e.length)return!1;let n=0;return e.every(r=>{for(let s=n;s<t.length;s++)if(XSe(t[s],r))return n=s+1,!0;return!1})}function XSe(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var ZSe=class{constructor(e,t,n,r,s,a,o,i){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=i,this._basicScopeAttributesProvider=new HSe(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=T3(t,null),this._injections=null,this._tokenTypeMatchers=[],s)for(const c of Object.keys(s)){const u=O0(c,j0);for(const l of u)this._tokenTypeMatchers.push({matcher:l.matcher,type:s[c]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:s=>s===this._rootScopeName?this._grammar:this.getExternalGrammar(s),injections:s=>this._grammarRepository.injections(s)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const s=r.injections;if(s)for(let o in s)E3(t,o,s[o],this,r);const a=this._grammarRepository.injections(n);a&&a.forEach(o=>{const i=this.getExternalGrammar(o);if(i){const c=i.injectionSelector;c&&E3(t,c,i,this,i)}})}return t.sort((s,a)=>s.priority-a.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=T3(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Gz.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let s;if(!t||t===Y_.NULL){s=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),l=this.themeProvider.getDefaults(),d=gd.set(0,u.languageId,u.tokenType,null,l.fontStyle,l.foregroundId,l.backgroundId),h=this.getRule(this._rootId).getName(null,null);let m;h?m=Ih.createRootAndLookUpScopeName(h,d,this):m=Ih.createRoot("unknown",d),t=new Y_(null,this._rootId,-1,-1,!1,null,m,m)}else s=!1,t.reset();e=e+`
|
|
37
|
-
`;const a=this.createOnigString(e),o=a.content.length,i=new twe(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Wz(this,a,s,0,t,i,!0,r);return Hz(a),{lineLength:o,lineTokens:i,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function T3(e,t){return e=ySe(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Ih=class La{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,s=t?.scopePath??null;for(const a of n)s=Xv.push(s,a.scopeNames),r=new La(r,s,a.encodedTokenAttributes);return r}static createRoot(t,n){return new La(null,new Xv(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const s=r.getMetadataForScope(t),a=new Xv(null,t),o=r.themeProvider.themeMatch(a),i=La.mergeAttributes(n,s,o);return new La(null,a,i)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return La.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let s=-1,a=0,o=0;return r!==null&&(s=r.fontStyle,a=r.foregroundId,o=r.backgroundId),gd.set(t,n.languageId,n.tokenType,null,s,a,o)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return La._pushAttributed(this,t,n);const r=t.split(/ /g);let s=this;for(const a of r)s=La._pushAttributed(s,a,n);return s}static _pushAttributed(t,n,r){const s=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),i=La.mergeAttributes(t.tokenAttributes,s,o);return new La(t,a,i)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===t?n.reverse():void 0}},Y_=class Sc{constructor(t,n,r,s,a,o,i,c){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=a,this.endRule=o,this.nameScopesList=i,this.contentNameScopesList=c,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=s}_stackElementBrand=void 0;static NULL=new Sc(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:Sc._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Ih.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){Sc._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,s,a,o,i){return new Sc(this,t,n,r,s,a,o,i)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new Sc(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const r=Ih.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new Sc(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Ih.fromExtension(r,n.contentNameScopesList))}},ewe=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):O0(n,j0).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>O0(n,j0).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},twe=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let r=e?.tokenAttributes??0,s=!1;if(this.balancedBracketSelectors?.matchesAlways&&(s=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const a=e?.getScopeNames()??[];for(const o of this._tokenTypeOverrides)o.matcher(a)&&(r=gd.set(r,0,o.type,null,-1,0,0));this.balancedBracketSelectors&&(s=this.balancedBracketSelectors.match(a))}if(s&&(r=gd.set(r,0,8,s,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=t;return}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,s=this._binaryTokens.length;r<s;r++)n[r]=this._binaryTokens[r];return n}},nwe=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,s){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,QSe(e,a,t,n,r,s,this,this._onigLib))}return this._grammars.get(e)}},rwe=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new nwe(P0.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(P0.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,r){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(t,n,r){return this._loadGrammar(t,n,r.embeddedLanguages,r.tokenTypes,new ewe(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,r,s,a){const o=new PSe(this._syncRegistry,t);for(;o.Q.length>0;)o.Q.map(i=>this._loadSingleGrammar(i.scopeName)),o.processQueue();return this._grammarForScopeName(t,n,r,s,a)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(t,n=[],r=0,s=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,s)}_grammarForScopeName(t,n=0,r=null,s=null,a=null){return this._syncRegistry.grammarForScopeName(t,n,r,s,a)}},J_=Y_.NULL;function M0(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[s,a]of Object.entries(t?.colorReplacements||{}))typeof a=="string"?n[s]=a:s===r&&Object.assign(n,a);return n}function Ri(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function swe(e){return Array.isArray(e)?e:[e]}async function Jz(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function nk(e){return!e||["plaintext","txt","text","plain"].includes(e)}function awe(e){return e==="ansi"||nk(e)}function rk(e){return e==="none"}function owe(e){return rk(e)}function sk(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(/(\r?\n)/g);let r=0;const s=[];for(let a=0;a<n.length;a+=2){const o=t?n[a]+(n[a+1]||""):n[a];s.push([o,r]),r+=n[a].length,r+=n[a+1]?.length||0}return s}const C3={light:"#333333",dark:"#bbbbbb"},I3={light:"#fffffe",dark:"#1e1e1e"},A3="__shiki_resolved";function d2(e){if(e?.[A3])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){const i=t.settings?t.settings.find(c=>!c.name&&!c.scope):void 0;i?.settings?.foreground&&(r=i.settings.foreground),i?.settings?.background&&(n=i.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?C3.light:C3.dark),n||(n=t.type==="light"?I3.light:I3.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let s=0;const a=new Map;function o(i){if(a.has(i))return a.get(i);s+=1;const c=`#${s.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${c}`]?o(i):(a.set(i,c),c)}t.settings=t.settings.map(i=>{const c=i.settings?.foreground&&!i.settings.foreground.startsWith("#"),u=i.settings?.background&&!i.settings.background.startsWith("#");if(!c&&!u)return i;const l={...i,settings:{...i.settings}};if(c){const d=o(i.settings.foreground);t.colorReplacements[d]=i.settings.foreground,l.settings.foreground=d}if(u){const d=o(i.settings.background);t.colorReplacements[d]=i.settings.background,l.settings.background=d}return l});for(const i of Object.keys(t.colors||{}))if((i==="editor.foreground"||i==="editor.background"||i.startsWith("terminal.ansi"))&&!t.colors[i]?.startsWith("#")){const c=o(t.colors[i]);t.colorReplacements[c]=t.colors[i],t.colors[i]=c}return Object.defineProperty(t,A3,{enumerable:!1,writable:!1,value:!0}),t}async function Qz(e){return Array.from(new Set((await Promise.all(e.filter(t=>!awe(t)).map(async t=>await Jz(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function Xz(e){return(await Promise.all(e.map(async t=>owe(t)?null:d2(await Jz(t))))).filter(t=>!!t)}function Zz(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new Zt(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}var iwe=class extends rwe{_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(s=>this.loadTheme(s)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=d2(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=P0.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Zz(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(s=>s.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(s=>{this._alias[s]=e.name}),this._loadedLanguagesCache=null,t.size)for(const s of t)this._resolvedGrammars.delete(s.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(s.scopeName),this._syncRegistry?._grammars?.delete(s.scopeName),this.loadLanguage(this._langMap.get(s.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const r of e)this.resolveEmbeddedLanguages(r);const t=Array.from(this._langGraph.entries()),n=t.filter(([r,s])=>!s);if(n.length){const r=t.filter(([s,a])=>a?(a.embeddedLanguages||a.embeddedLangs)?.some(o=>n.map(([i])=>i).includes(o)):!1).filter(s=>!n.includes(s));throw new Zt(`Missing languages ${n.map(([s])=>`\`${s}\``).join(", ")}, required by ${r.map(([s])=>`\`${s}\``).join(", ")}`)}for(const[r,s]of t)this._resolver.addLanguage(s);for(const[r,s]of t)this.loadLanguage(s)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);const t=e.embeddedLanguages??e.embeddedLangs;if(t)for(const n of t)this._langGraph.set(n,this._langMap.get(n))}},cwe=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},t.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let r=1;r<=t.length;r++){const s=t.slice(0,r).join(".");n=[...n,...this._injections.get(s)||[]]}return n}};let Rf=0;function uwe(e){Rf+=1,e.warnings!==!1&&Rf>=10&&Rf%10===0&&console.warn(`[Shiki] ${Rf} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new Zt("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(d2),s=new iwe(new cwe(e.engine,n),r,n,e.langAlias);let a;function o(x){return Zz(x,e.langAlias)}function i(x){g();const k=s.getGrammar(typeof x=="string"?x:x.name);if(!k)throw new Zt(`Language \`${x}\` not found, you may need to load it first`);return k}function c(x){if(x==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};g();const k=s.getTheme(x);if(!k)throw new Zt(`Theme \`${x}\` not found, you may need to load it first`);return k}function u(x){g();const k=c(x);return a!==x&&(s.setTheme(k),a=x),{theme:k,colorMap:s.getColorMap()}}function l(){return g(),s.getLoadedThemes()}function d(){return g(),s.getLoadedLanguages()}function h(...x){g(),s.loadLanguages(x.flat(1))}async function m(...x){return h(await Qz(x))}function p(...x){g();for(const k of x.flat(1))s.loadTheme(k)}async function y(...x){return g(),p(await Xz(x))}function g(){if(t)throw new Zt("Shiki instance has been disposed")}function b(){t||(t=!0,s.dispose(),Rf-=1)}return{setTheme:u,getTheme:c,getLanguage:i,getLoadedThemes:l,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:m,loadLanguageSync:h,loadTheme:y,loadThemeSync:p,dispose:b,[Symbol.dispose]:b}}async function lwe(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([Xz(e.themes||[]),Qz(e.langs||[]),e.engine]);return uwe({...e,themes:t,langs:n,engine:r})}const e9=new WeakMap;function ak(e,t){e9.set(e,t)}function _m(e){return e9.get(e)}var ok=class t9{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new t9(Object.fromEntries(swe(n).map(r=>[r,J_])),t)}constructor(...t){if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,s]=t;this.lang=r,this._stacks={[s]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return dwe(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function dwe(e){const t=[],n=new Set;function r(s){if(n.has(s))return;n.add(s);const a=s?.nameScopesList?.scopeName;a&&t.push(a),s.parent&&r(s.parent)}return r(e),t}function fwe(e,t){if(!(e instanceof ok))throw new Zt("Invalid grammar state");return e.getInternalStack(t)}function n9(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n;if(nk(e.resolveLangAlias(n.lang||"text"))||rk(r))return sk(t).map(i=>[{content:i[0],offset:i[1]}]);const{theme:s,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==o.name)throw new Zt(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(s.name))throw new Zt(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return mwe(t,o,s,a,n)}function hwe(...e){if(e.length===2)return _m(e[1]);const[t,n,r={}]=e,{lang:s="text",theme:a=t.getLoadedThemes()[0]}=r;if(nk(s)||rk(a))throw new Zt("Plain language does not have grammar state");if(s==="ansi")throw new Zt("ANSI language does not have grammar state");const{theme:o,colorMap:i}=t.setTheme(a),c=t.getLanguage(s);return new ok(f2(n,c,o,i,r).stateStack,c.name,o.name)}function mwe(e,t,n,r,s){const a=f2(e,t,n,r,s),o=new ok(a.stateStack,t.name,n.name);return ak(a.tokens,o),a.tokens}function f2(e,t,n,r,s){const a=M0(n,s),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:i=500}=s,c=sk(e);let u=s.grammarState?fwe(s.grammarState,n.name)??J_:s.grammarContextCode!=null?f2(s.grammarContextCode,t,n,r,{...s,grammarState:void 0,grammarContextCode:void 0}).stateStack:J_,l=[];const d=[];for(let h=0,m=c.length;h<m;h++){const[p,y]=c[h];if(p===""){l=[],d.push([]);continue}if(o>0&&p.length>=o){l=[],d.push([{content:p,offset:y,color:"",fontStyle:0}]);continue}let g,b,x;s.includeExplanation&&(g=t.tokenizeLine(p,u,i),b=g.tokens,x=0);const k=t.tokenizeLine2(p,u,i),_=k.tokens.length/2;for(let S=0;S<_;S++){const w=k.tokens[2*S],T=S+1<_?k.tokens[2*S+2]:p.length;if(w===T)continue;const A=k.tokens[2*S+1],L=Ri(r[gd.getForeground(A)],a),R=gd.getFontStyle(A),j={content:p.substring(w,T),offset:y+w,color:L,fontStyle:R};if(s.includeExplanation){const F=[];if(s.includeExplanation!=="scopeName")for(const Y of n.settings){let W;switch(typeof Y.scope){case"string":W=Y.scope.split(/,/).map(J=>J.trim());break;case"object":W=Y.scope;break;default:continue}F.push({settings:Y,selectors:W.map(J=>J.split(/ /))})}j.explanation=[];let K=0;for(;w+K<T;){const Y=b[x],W=p.substring(Y.startIndex,Y.endIndex);K+=W.length,j.explanation.push({content:W,scopes:s.includeExplanation==="scopeName"?pwe(Y.scopes):gwe(F,Y.scopes)}),x+=1}}l.push(j)}d.push(l),l=[],u=k.ruleStack}return{tokens:d,stateStack:u}}function pwe(e){return e.map(t=>({scopeName:t}))}function gwe(e,t){const n=[];for(let r=0,s=t.length;r<s;r++){const a=t[r];n[r]={scopeName:a,themeMatches:ywe(e,a,t.slice(0,r))}}return n}function N3(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function bwe(e,t,n){if(!N3(e[e.length-1],t))return!1;let r=e.length-2,s=n.length-1;for(;r>=0&&s>=0;)N3(e[r],n[s])&&(r-=1),s-=1;return r===-1}function ywe(e,t,n){const r=[];for(const{selectors:s,settings:a}of e)for(const o of s)if(bwe(o,t,n)){r.push(a);break}return r}function r9(e,t,n){const r=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),s=r.map(c=>{const u=n9(e,t,{...n,theme:c.theme});return{tokens:u,state:_m(u),theme:typeof c.theme=="string"?c.theme:c.theme.name}}),a=xwe(...s.map(c=>c.tokens)),o=a[0].map((c,u)=>c.map((l,d)=>{const h={content:l.content,variants:{},offset:l.offset};return"includeExplanation"in n&&n.includeExplanation&&(h.explanation=l.explanation),a.forEach((m,p)=>{const{content:y,explanation:g,offset:b,...x}=m[u][d];h.variants[r[p].color]=x}),h})),i=s[0].state?new ok(Object.fromEntries(s.map(c=>[c.theme,c.state?.getInternalStack(c.theme)])),s[0].state.lang):void 0;return i&&ak(o,i),o}function xwe(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const s=e.map(c=>c[r]),a=t.map(()=>[]);t.forEach((c,u)=>c.push(a[u]));const o=s.map(()=>0),i=s.map(c=>c[0]);for(;i.every(c=>c);){const c=Math.min(...i.map(u=>u.content.length));for(let u=0;u<n;u++){const l=i[u];l.content.length===c?(a[u].push(l),o[u]+=1,i[u]=s[u][o[u]]):(a[u].push({...l,content:l.content.slice(0,c)}),i[u]={...l,content:l.content.slice(c),offset:l.offset+c})}}}return t}const s9=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Ip{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ip.prototype.normal={};Ip.prototype.property={};Ip.prototype.space=void 0;function a9(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new Ip(n,r,t)}function Em(e){return e.toLowerCase()}class ss{constructor(t,n){this.attribute=n,this.property=t}}ss.prototype.attribute="";ss.prototype.booleanish=!1;ss.prototype.boolean=!1;ss.prototype.commaOrSpaceSeparated=!1;ss.prototype.commaSeparated=!1;ss.prototype.defined=!1;ss.prototype.mustUseProperty=!1;ss.prototype.number=!1;ss.prototype.overloadedBoolean=!1;ss.prototype.property="";ss.prototype.spaceSeparated=!1;ss.prototype.space=void 0;let kwe=0;const at=ju(),vn=ju(),Q_=ju(),xe=ju(),Gt=ju(),Fl=ju(),cs=ju();function ju(){return 2**++kwe}const X_=Object.freeze(Object.defineProperty({__proto__:null,boolean:at,booleanish:vn,commaOrSpaceSeparated:cs,commaSeparated:Fl,number:xe,overloadedBoolean:Q_,spaceSeparated:Gt},Symbol.toStringTag,{value:"Module"})),eS=Object.keys(X_);class h2 extends ss{constructor(t,n,r,s){let a=-1;if(super(t,n),R3(this,"space",s),typeof r=="number")for(;++a<eS.length;){const o=eS[a];R3(this,eS[a],(r&X_[o])===X_[o])}}}h2.prototype.defined=!0;function R3(e,t,n){n&&(e[t]=n)}function Wd(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const a=new h2(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Em(r)]=r,n[Em(a.attribute)]=r}return new Ip(t,n,e.space)}const o9=Wd({properties:{ariaActiveDescendant:null,ariaAtomic:vn,ariaAutoComplete:null,ariaBusy:vn,ariaChecked:vn,ariaColCount:xe,ariaColIndex:xe,ariaColSpan:xe,ariaControls:Gt,ariaCurrent:null,ariaDescribedBy:Gt,ariaDetails:null,ariaDisabled:vn,ariaDropEffect:Gt,ariaErrorMessage:null,ariaExpanded:vn,ariaFlowTo:Gt,ariaGrabbed:vn,ariaHasPopup:null,ariaHidden:vn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Gt,ariaLevel:xe,ariaLive:null,ariaModal:vn,ariaMultiLine:vn,ariaMultiSelectable:vn,ariaOrientation:null,ariaOwns:Gt,ariaPlaceholder:null,ariaPosInSet:xe,ariaPressed:vn,ariaReadOnly:vn,ariaRelevant:null,ariaRequired:vn,ariaRoleDescription:Gt,ariaRowCount:xe,ariaRowIndex:xe,ariaRowSpan:xe,ariaSelected:vn,ariaSetSize:xe,ariaSort:null,ariaValueMax:xe,ariaValueMin:xe,ariaValueNow:xe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function i9(e,t){return t in e?e[t]:t}function c9(e,t){return i9(e,t.toLowerCase())}const vwe=Wd({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Fl,acceptCharset:Gt,accessKey:Gt,action:null,allow:null,allowFullScreen:at,allowPaymentRequest:at,allowUserMedia:at,alt:null,as:null,async:at,autoCapitalize:null,autoComplete:Gt,autoFocus:at,autoPlay:at,blocking:Gt,capture:null,charSet:null,checked:at,cite:null,className:Gt,cols:xe,colSpan:null,content:null,contentEditable:vn,controls:at,controlsList:Gt,coords:xe|Fl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:at,defer:at,dir:null,dirName:null,disabled:at,download:Q_,draggable:vn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:at,formTarget:null,headers:Gt,height:xe,hidden:Q_,high:xe,href:null,hrefLang:null,htmlFor:Gt,httpEquiv:Gt,id:null,imageSizes:null,imageSrcSet:null,inert:at,inputMode:null,integrity:null,is:null,isMap:at,itemId:null,itemProp:Gt,itemRef:Gt,itemScope:at,itemType:Gt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:at,low:xe,manifest:null,max:null,maxLength:xe,media:null,method:null,min:null,minLength:xe,multiple:at,muted:at,name:null,nonce:null,noModule:at,noValidate:at,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:at,optimum:xe,pattern:null,ping:Gt,placeholder:null,playsInline:at,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:at,referrerPolicy:null,rel:Gt,required:at,reversed:at,rows:xe,rowSpan:xe,sandbox:Gt,scope:null,scoped:at,seamless:at,selected:at,shadowRootClonable:at,shadowRootDelegatesFocus:at,shadowRootMode:null,shape:null,size:xe,sizes:null,slot:null,span:xe,spellCheck:vn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:xe,step:null,style:null,tabIndex:xe,target:null,title:null,translate:null,type:null,typeMustMatch:at,useMap:null,value:vn,width:xe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Gt,axis:null,background:null,bgColor:null,border:xe,borderColor:null,bottomMargin:xe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:at,declare:at,event:null,face:null,frame:null,frameBorder:null,hSpace:xe,leftMargin:xe,link:null,longDesc:null,lowSrc:null,marginHeight:xe,marginWidth:xe,noResize:at,noHref:at,noShade:at,noWrap:at,object:null,profile:null,prompt:null,rev:null,rightMargin:xe,rules:null,scheme:null,scrolling:vn,standby:null,summary:null,text:null,topMargin:xe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:xe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:at,disableRemotePlayback:at,prefix:null,property:null,results:xe,security:null,unselectable:null},space:"html",transform:c9}),Swe=Wd({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:cs,accentHeight:xe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:xe,amplitude:xe,arabicForm:null,ascent:xe,attributeName:null,attributeType:null,azimuth:xe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:xe,by:null,calcMode:null,capHeight:xe,className:Gt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:xe,diffuseConstant:xe,direction:null,display:null,dur:null,divisor:xe,dominantBaseline:null,download:at,dx:null,dy:null,edgeMode:null,editable:null,elevation:xe,enableBackground:null,end:null,event:null,exponent:xe,externalResourcesRequired:null,fill:null,fillOpacity:xe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Fl,g2:Fl,glyphName:Fl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:xe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:xe,horizOriginX:xe,horizOriginY:xe,id:null,ideographic:xe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:xe,k:xe,k1:xe,k2:xe,k3:xe,k4:xe,kernelMatrix:cs,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:xe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:xe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:xe,overlineThickness:xe,paintOrder:null,panose1:null,path:null,pathLength:xe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Gt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:xe,pointsAtY:xe,pointsAtZ:xe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:cs,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:cs,rev:cs,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:cs,requiredFeatures:cs,requiredFonts:cs,requiredFormats:cs,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:xe,specularExponent:xe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:xe,strikethroughThickness:xe,string:null,stroke:null,strokeDashArray:cs,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:xe,strokeOpacity:xe,strokeWidth:null,style:null,surfaceScale:xe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:cs,tabIndex:xe,tableValues:null,target:null,targetX:xe,targetY:xe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:cs,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:xe,underlineThickness:xe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:xe,values:null,vAlphabetic:xe,vMathematical:xe,vectorEffect:null,vHanging:xe,vIdeographic:xe,version:null,vertAdvY:xe,vertOriginX:xe,vertOriginY:xe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:xe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:i9}),u9=Wd({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),l9=Wd({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:c9}),d9=Wd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),wwe={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},_we=/[A-Z]/g,P3=/-[a-z]/g,Ewe=/^data[-\w.:]+$/i;function Ap(e,t){const n=Em(t);let r=t,s=ss;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Ewe.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(P3,Cwe);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!P3.test(a)){let o=a.replace(_we,Twe);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=h2}return new s(r,t)}function Twe(e){return"-"+e.toLowerCase()}function Cwe(e){return e.charAt(1).toUpperCase()}const Yd=a9([o9,vwe,u9,l9,d9],"html"),ao=a9([o9,Swe,u9,l9,d9],"svg"),O3={}.hasOwnProperty;function m2(e,t){const n=t||{};function r(s,...a){let o=r.invalid;const i=r.handlers;if(s&&O3.call(s,e)){const c=String(s[e]);o=O3.call(i,c)?i[c]:r.unknown}if(o)return o.call(this,s,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Iwe=/["&'<>`]/g,Awe=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Nwe=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Rwe=/[|\\{}()[\]^$+*?.]/g,L3=new WeakMap;function Pwe(e,t){if(e=e.replace(t.subset?Owe(t.subset):Iwe,r),t.subset||t.escapeOnly)return e;return e.replace(Awe,n).replace(Nwe,r);function n(s,a,o){return t.format((s.charCodeAt(0)-55296)*1024+s.charCodeAt(1)-56320+65536,o.charCodeAt(a+2),t)}function r(s,a,o){return t.format(s.charCodeAt(0),o.charCodeAt(a+1),t)}}function Owe(e){let t=L3.get(e);return t||(t=Lwe(e),L3.set(e,t)),t}function Lwe(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(Rwe,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const $we=/[\dA-Fa-f]/;function jwe(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!$we.test(String.fromCharCode(t))?r:r+";"}const Mwe=/\d/;function Dwe(e,t,n){const r="&#"+String(e);return n&&t&&!Mwe.test(String.fromCharCode(t))?r:r+";"}const Fwe=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],tS={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Bwe=["cent","copy","divide","gt","lt","not","para","times"],f9={}.hasOwnProperty,Z_={};let eb;for(eb in tS)f9.call(tS,eb)&&(Z_[tS[eb]]=eb);const Uwe=/[^\dA-Za-z]/;function zwe(e,t,n,r){const s=String.fromCharCode(e);if(f9.call(Z_,s)){const a=Z_[s],o="&"+a;return n&&Fwe.includes(a)&&!Bwe.includes(a)&&(!r||t&&t!==61&&Uwe.test(String.fromCharCode(t)))?o:o+";"}return""}function Hwe(e,t,n){let r=jwe(e,t,n.omitOptionalSemicolons),s;if((n.useNamedReferences||n.useShortestReferences)&&(s=zwe(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!s)&&n.useShortestReferences){const a=Dwe(e,t,n.omitOptionalSemicolons);a.length<r.length&&(r=a)}return s&&(!n.useShortestReferences||s.length<r.length)?s:r}function Bl(e,t){return Pwe(e,Object.assign({format:Hwe},t))}const qwe=/^>|^->|<!--|-->|--!>|<!-$/g,Vwe=[">"],Gwe=["<",">"];function Kwe(e,t,n,r){return r.settings.bogusComments?"<?"+Bl(e.value,Object.assign({},r.settings.characterReferences,{subset:Vwe}))+">":"<!--"+e.value.replace(qwe,s)+"-->";function s(a){return Bl(a,Object.assign({},r.settings.characterReferences,{subset:Gwe}))}}function Wwe(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function D0(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function $3(e){const t=[],n=String(e||"");let r=n.indexOf(","),s=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const o=n.slice(s,r).trim();(o||!a)&&t.push(o),s=r+1,r=n.indexOf(",",s)}return t}function p2(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function j3(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function g2(e){return e.join(" ").trim()}const Ywe=/[ \t\n\f\r]/g;function ik(e){return typeof e=="object"?e.type==="text"?M3(e.value):!1:M3(e)}function M3(e){return e.replace(Ywe,"")===""}const Hn=m9(1),h9=m9(-1),Jwe=[];function m9(e){return t;function t(n,r,s){const a=n?n.children:Jwe;let o=(r||0)+e,i=a[o];if(!s)for(;i&&ik(i);)o+=e,i=a[o];return i}}const Qwe={}.hasOwnProperty;function p9(e){return t;function t(n,r,s){return Qwe.call(e,n.tagName)&&e[n.tagName](n,r,s)}}const b2=p9({body:Zwe,caption:nS,colgroup:nS,dd:r_e,dt:n_e,head:nS,html:Xwe,li:t_e,optgroup:s_e,option:a_e,p:e_e,rp:D3,rt:D3,tbody:i_e,td:F3,tfoot:c_e,th:F3,thead:o_e,tr:u_e});function nS(e,t,n){const r=Hn(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&ik(r.value.charAt(0)))}function Xwe(e,t,n){const r=Hn(n,t);return!r||r.type!=="comment"}function Zwe(e,t,n){const r=Hn(n,t);return!r||r.type!=="comment"}function e_e(e,t,n){const r=Hn(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function t_e(e,t,n){const r=Hn(n,t);return!r||r.type==="element"&&r.tagName==="li"}function n_e(e,t,n){const r=Hn(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function r_e(e,t,n){const r=Hn(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function D3(e,t,n){const r=Hn(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function s_e(e,t,n){const r=Hn(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function a_e(e,t,n){const r=Hn(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function o_e(e,t,n){const r=Hn(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function i_e(e,t,n){const r=Hn(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function c_e(e,t,n){return!Hn(n,t)}function u_e(e,t,n){const r=Hn(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function F3(e,t,n){const r=Hn(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const l_e=p9({body:h_e,colgroup:m_e,head:f_e,html:d_e,tbody:p_e});function d_e(e){const t=Hn(e,-1);return!t||t.type!=="comment"}function f_e(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function h_e(e){const t=Hn(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&ik(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function m_e(e,t,n){const r=h9(n,t),s=Hn(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&b2(r,n.children.indexOf(r),n)?!1:!!(s&&s.type==="element"&&s.tagName==="col")}function p_e(e,t,n){const r=h9(n,t),s=Hn(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&b2(r,n.children.indexOf(r),n)?!1:!!(s&&s.type==="element"&&s.tagName==="tr")}const tb={name:[[`
|
|
38
|
-
\f\r &/=>`.split(""),`
|
|
39
|
-
\f\r "&'/=>\``.split("")],[`\0
|
|
40
|
-
\f\r "&'/<=>`.split(""),`\0
|
|
41
|
-
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
42
|
-
\f\r &>`.split(""),`\0
|
|
43
|
-
\f\r "&'<=>\``.split("")],[`\0
|
|
44
|
-
\f\r "&'<=>\``.split(""),`\0
|
|
45
|
-
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function g_e(e,t,n,r){const s=r.schema,a=s.space==="svg"?!1:r.settings.omitOptionalTags;let o=s.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const i=[];let c;s.space==="html"&&e.tagName==="svg"&&(r.schema=ao);const u=b_e(r,e.properties),l=r.all(s.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=s,l&&(o=!1),(u||!a||!l_e(e,t,n))&&(i.push("<",e.tagName,u?" "+u:""),o&&(s.space==="svg"||r.settings.closeSelfClosing)&&(c=u.charAt(u.length-1),(!r.settings.tightSelfClosing||c==="/"||c&&c!=='"'&&c!=="'")&&i.push(" "),i.push("/")),i.push(">")),i.push(l),!o&&(!a||!b2(e,t,n))&&i.push("</"+e.tagName+">"),i.join("")}function b_e(e,t){const n=[];let r=-1,s;if(t){for(s in t)if(t[s]!==null&&t[s]!==void 0){const a=y_e(e,s,t[s]);a&&n.push(a)}}for(;++r<n.length;){const a=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&a!=='"'&&a!=="'"&&(n[r]+=" ")}return n.join("")}function y_e(e,t,n){const r=Ap(e.schema,t),s=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,a=e.settings.allowDangerousCharacters?0:1;let o=e.quote,i;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const c=Bl(r.attribute,Object.assign({},e.settings.characterReferences,{subset:tb.name[s][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?p2:g2)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(i=Bl(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:tb.unquoted[s][a]}))),i!==n&&(e.settings.quoteSmart&&D0(n,o)>D0(n,e.alternative)&&(o=e.alternative),i=o+Bl(n,Object.assign({},e.settings.characterReferences,{subset:(o==="'"?tb.single:tb.double)[s][a],attribute:!0}))+o),c+(i&&"="+i))}const x_e=["<","&"];function g9(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Bl(e.value,Object.assign({},r.settings.characterReferences,{subset:x_e}))}function k_e(e,t,n,r){return r.settings.allowDangerousHtml?e.value:g9(e,t,n,r)}function v_e(e,t,n,r){return r.all(e)}const S_e=m2("type",{invalid:w_e,unknown:__e,handlers:{comment:Kwe,doctype:Wwe,element:g_e,raw:k_e,root:v_e,text:g9}});function w_e(e){throw new Error("Expected node, not `"+e+"`")}function __e(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const E_e={},T_e={},C_e=[];function I_e(e,t){const n=t||E_e,r=n.quote||'"',s=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:A_e,all:N_e,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||s9,characterReferences:n.characterReferences||T_e,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?ao:Yd,quote:r,alternative:s}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function A_e(e,t,n){return S_e(e,t,n,this)}function N_e(e){const t=[],n=e&&e.children||C_e;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}function b9(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const r of n)r&&!e.properties.class.includes(r)&&e.properties.class.push(r);return e}function R_e(e){const t=sk(e,!0).map(([s])=>s);function n(s){if(s===e.length)return{line:t.length-1,character:t[t.length-1].length};let a=s,o=0;for(const i of t){if(a<i.length)break;a-=i.length,o++}return{line:o,character:a}}function r(s,a){let o=0;for(let i=0;i<s;i++)o+=t[i].length;return o+=a,o}return{lines:t,indexToPos:n,posToIndex:r}}const y2="light-dark()",P_e=["color","background-color"];function O_e(e,t){let n=0;const r=[];for(const s of t)s>n&&r.push({...e,content:e.content.slice(n,s),offset:e.offset+n}),n=s;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function L_e(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((r,s)=>r-s);return n.length?e.map(r=>r.flatMap(s=>{const a=n.filter(o=>s.offset<o&&o<s.offset+s.content.length).map(o=>o-s.offset).sort((o,i)=>o-i);return a.length?O_e(s,a):s})):e}function $_e(e,t,n,r,s="css-vars"){const a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(l=>F0(e.variants[l])),i=new Set(o.flatMap(l=>Object.keys(l))),c={},u=(l,d)=>{const h=d==="color"?"":d==="background-color"?"-bg":`-${d}`;return n+t[l]+(d==="color"?"":h)};return o.forEach((l,d)=>{for(const h of i){const m=l[h]||"inherit";if(d===0&&r&&P_e.includes(h))if(r===y2&&o.length>1){const p=t.findIndex(g=>g==="light"),y=t.findIndex(g=>g==="dark");if(p===-1||y===-1)throw new Zt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');c[h]=`light-dark(${o[p][h]||"inherit"}, ${o[y][h]||"inherit"})`,s==="css-vars"&&(c[u(d,h)]=m)}else c[h]=m;else s==="css-vars"&&(c[u(d,h)]=m)}}),a.htmlStyle=c,a}function F0(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&kr.Italic&&(t["font-style"]="italic"),e.fontStyle&kr.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&kr.Underline&&n.push("underline"),e.fontStyle&kr.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function eE(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function j_e(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let s=function(o){if(typeof o=="number"){if(o<0||o>n.source.length)throw new Zt(`Invalid decoration offset: ${o}. Code length: ${n.source.length}`);return{...r.indexToPos(o),offset:o}}else{const i=r.lines[o.line];if(i===void 0)throw new Zt(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${r.lines.length}`);let c=o.character;if(c<0&&(c=i.length+c),c<0||c>i.length)throw new Zt(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${i.length}`);return{...o,character:c,offset:r.posToIndex(o.line,c)}}};const r=R_e(n.source),a=(n.options.decorations||[]).map(o=>({...o,start:s(o.start),end:s(o.end)}));M_e(a),e.set(n.meta,{decorations:a,converter:r,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(this.options.decorations?.length)return L_e(n,t(this).decorations.flatMap(r=>[r.start.offset,r.end.offset]))},code(n){if(!this.options.decorations?.length)return;const r=t(this),s=Array.from(n.children).filter(l=>l.type==="element"&&l.tagName==="span");if(s.length!==r.converter.lines.length)throw new Zt(`Number of lines in code element (${s.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function a(l,d,h,m){const p=s[l];let y="",g=-1,b=-1;if(d===0&&(g=0),h===0&&(b=0),h===Number.POSITIVE_INFINITY&&(b=p.children.length),g===-1||b===-1)for(let k=0;k<p.children.length;k++)y+=y9(p.children[k]),g===-1&&y.length===d&&(g=k+1),b===-1&&y.length===h&&(b=k+1);if(g===-1)throw new Zt(`Failed to find start index for decoration ${JSON.stringify(m.start)}`);if(b===-1)throw new Zt(`Failed to find end index for decoration ${JSON.stringify(m.end)}`);const x=p.children.slice(g,b);if(!m.alwaysWrap&&x.length===p.children.length)i(p,m,"line");else if(!m.alwaysWrap&&x.length===1&&x[0].type==="element")i(x[0],m,"token");else{const k={type:"element",tagName:"span",properties:{},children:x};i(k,m,"wrapper"),p.children.splice(g,x.length,k)}}function o(l,d){s[l]=i(s[l],d,"line")}function i(l,d,h){const m=d.properties||{},p=d.transform||(y=>y);return l.tagName=d.tagName||"span",l.properties={...l.properties,...m,class:l.properties.class},d.properties?.class&&b9(l,d.properties.class),l=p(l,h)||l,l}const c=[],u=r.decorations.sort((l,d)=>d.start.offset-l.start.offset||l.end.offset-d.end.offset);for(const l of u){const{start:d,end:h}=l;if(d.line===h.line)a(d.line,d.character,h.character,l);else if(d.line<h.line){a(d.line,d.character,Number.POSITIVE_INFINITY,l);for(let m=d.line+1;m<h.line;m++)c.unshift(()=>o(m,l));a(h.line,0,h.character,l)}}c.forEach(l=>l())}}}function M_e(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new Zt(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const s=e[r],a=n.start.offset<=s.start.offset&&s.start.offset<n.end.offset,o=n.start.offset<s.end.offset&&s.end.offset<=n.end.offset,i=s.start.offset<=n.start.offset&&n.start.offset<s.end.offset,c=s.start.offset<n.end.offset&&n.end.offset<=s.end.offset;if(a||o||i||c){if(a&&o||i&&c||i&&n.start.offset===n.end.offset||o&&s.start.offset===s.end.offset)continue;throw new Zt(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(s.start)} intersect.`)}}}}function y9(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(y9).join(""):""}const D_e=[j_e()];function B0(e){const t=F_e(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...D_e]}function F_e(e){const t=[],n=[],r=[];for(const s of e)switch(s.enforce){case"pre":t.push(s);break;case"post":n.push(s);break;default:r.push(s)}return{pre:t,post:n,normal:r}}var Mc=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],rS={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function B_e(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const r=e.indexOf("m",n);if(r!==-1)return{sequence:e.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:e.length}}function B3(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(r=>Number.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function U_e(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)rS[r]&&t.push({type:"setDecoration",value:rS[r]});else if(r<=29){const s=rS[r-20];s&&(t.push({type:"resetDecoration",value:s}),s==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Mc[r-30]}});else if(r===38){const s=B3(e);s&&t.push({type:"setForegroundColor",value:s})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Mc[r-40]}});else if(r===48){const s=B3(e);s&&t.push({type:"setBackgroundColor",value:s})}else r===49?t.push({type:"resetBackgroundColor"}):r===53?t.push({type:"setDecoration",value:"overline"}):r===55?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Mc[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Mc[r-100+8]}})}return t}function z_e(){let e=null,t=null,n=new Set;return{parse(r){const s=[];let a=0;do{const o=B_e(r,a),i=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(i.length>0&&s.push({value:i,foreground:e,background:t,decorations:new Set(n)}),o.sequence){const c=U_e(o.sequence);for(const u of c)u.type==="resetAll"?(e=null,t=null,n.clear()):u.type==="resetForegroundColor"?e=null:u.type==="resetBackgroundColor"?t=null:u.type==="resetDecoration"&&n.delete(u.value);for(const u of c)u.type==="setForegroundColor"?e=u.value:u.type==="setBackgroundColor"?t=u.value:u.type==="setDecoration"&&n.add(u.value)}a=o.position}while(a<r.length);return s}}}var H_e={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function q_e(e=H_e){function t(i){return e[i]}function n(i){return`#${i.map(c=>Math.max(0,Math.min(c,255)).toString(16).padStart(2,"0")).join("")}`}let r;function s(){if(r)return r;r=[];for(let u=0;u<Mc.length;u++)r.push(t(Mc[u]));let i=[0,95,135,175,215,255];for(let u=0;u<6;u++)for(let l=0;l<6;l++)for(let d=0;d<6;d++)r.push(n([i[u],i[l],i[d]]));let c=8;for(let u=0;u<24;u++,c+=10)r.push(n([c,c,c]));return r}function a(i){return s()[i]}function o(i){switch(i.type){case"named":return t(i.name);case"rgb":return n(i.rgb);case"table":return a(i.index)}}return{value:o}}const V_e={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function G_e(e,t,n){const r=M0(e,n),s=sk(t),a=q_e(Object.fromEntries(Mc.map(i=>{const c=`terminal.ansi${i[0].toUpperCase()}${i.substring(1)}`;return[i,e.colors?.[c]||V_e[i]]}))),o=z_e();return s.map(i=>o.parse(i[0]).map(c=>{let u,l;c.decorations.has("reverse")?(u=c.background?a.value(c.background):e.bg,l=c.foreground?a.value(c.foreground):e.fg):(u=c.foreground?a.value(c.foreground):e.fg,l=c.background?a.value(c.background):void 0),u=Ri(u,r),l=Ri(l,r),c.decorations.has("dim")&&(u=K_e(u));let d=kr.None;return c.decorations.has("bold")&&(d|=kr.Bold),c.decorations.has("italic")&&(d|=kr.Italic),c.decorations.has("underline")&&(d|=kr.Underline),c.decorations.has("strikethrough")&&(d|=kr.Strikethrough),{content:c.value,offset:i[1],color:u,bgColor:l,fontStyle:d}}))}function K_e(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const r=t[1];if(r.length===8){const s=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${s}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const s=r[0],a=r[1],o=r[2],i=r[3];return`#${s}${s}${a}${a}${o}${o}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){const s=r[0],a=r[1],o=r[2];return`#${s}${s}${a}${a}${o}${o}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function x9(e,t,n={}){const r=e.resolveLangAlias(n.lang||"text"),{theme:s=e.getLoadedThemes()[0]}=n;if(!nk(r)&&!rk(s)&&r==="ansi"){const{theme:a}=e.setTheme(s);return G_e(a,t,n)}return n9(e,t,n)}function U0(e,t,n){let r,s,a,o,i,c;if("themes"in n){const{defaultColor:u="light",cssVariablePrefix:l="--shiki-",colorsRendering:d="css-vars"}=n,h=Object.entries(n.themes).filter(b=>b[1]).map(b=>({color:b[0],theme:b[1]})).sort((b,x)=>b.color===u?-1:x.color===u?1:0);if(h.length===0)throw new Zt("`themes` option must not be empty");const m=r9(e,t,n);if(c=_m(m),u&&y2!==u&&!h.find(b=>b.color===u))throw new Zt(`\`themes\` option must contain the defaultColor key \`${u}\``);const p=h.map(b=>e.getTheme(b.theme)),y=h.map(b=>b.color);a=m.map(b=>b.map(x=>$_e(x,y,l,u,d))),c&&ak(a,c);const g=h.map(b=>M0(b.theme,n));s=U3(h,p,g,l,u,"fg",d),r=U3(h,p,g,l,u,"bg",d),o=`shiki-themes ${p.map(b=>b.name).join(" ")}`,i=u?void 0:[s,r].join(";")}else if("theme"in n){const u=M0(n.theme,n);a=x9(e,t,n);const l=e.getTheme(n.theme);r=Ri(l.bg,u),s=Ri(l.fg,u),o=l.name,c=_m(a)}else throw new Zt("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:s,bg:r,themeName:o,rootStyle:i,grammarState:c}}function U3(e,t,n,r,s,a,o){return e.map((i,c)=>{const u=Ri(t[c][a],n[c])||"inherit",l=`${r+i.color}${a==="bg"?"-bg":""}:${u}`;if(c===0&&s){if(s===y2&&e.length>1){const d=e.findIndex(m=>m.color==="light"),h=e.findIndex(m=>m.color==="dark");if(d===-1||h===-1)throw new Zt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${Ri(t[d][a],n[d])||"inherit"}, ${Ri(t[h][a],n[h])||"inherit"});${l}`}return u}return o==="css-vars"?l:null}).filter(i=>!!i).join(";")}function z0(e,t,n,r={meta:{},options:n,codeToHast:(s,a)=>z0(e,s,a),codeToTokens:(s,a)=>U0(e,s,a)}){let s=t;for(const p of B0(n))s=p.preprocess?.call(r,s,n)||s;let{tokens:a,fg:o,bg:i,themeName:c,rootStyle:u,grammarState:l}=U0(e,s,n);const{mergeWhitespaces:d=!0,mergeSameStyleTokens:h=!1}=n;d===!0?a=Y_e(a):d==="never"&&(a=J_e(a)),h&&(a=Q_e(a));const m={...r,get source(){return s}};for(const p of B0(n))a=p.tokens?.call(m,a)||a;return W_e(a,{...n,fg:o,bg:i,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??u},m,l)}function W_e(e,t,n,r=_m(e)){const s=B0(t),a=[],o={type:"root",children:[]},{structure:i="classic",tabindex:c="0"}=t,u={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?u.style=t.rootStyle:u.style=`background-color:${t.bg};color:${t.fg}`),c!==!1&&c!=null&&(u.tabindex=c.toString());for(const[y,g]of Object.entries(t.meta||{}))y.startsWith("_")||(u[y]=g);let l={type:"element",tagName:"pre",properties:u,children:[],data:t.data},d={type:"element",tagName:"code",properties:{},children:a};const h=[],m={...n,structure:i,addClassToHast:b9,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return l},get code(){return d},get lines(){return h}};if(e.forEach((y,g)=>{g&&(i==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):i==="classic"&&a.push({type:"text",value:`
|
|
46
|
-
`}));let b={type:"element",tagName:"span",properties:{class:"line"},children:[]},x=0;for(const k of y){let _={type:"element",tagName:"span",properties:{...k.htmlAttrs},children:[{type:"text",value:k.content}]};const S=eE(k.htmlStyle||F0(k));S&&(_.properties.style=S);for(const w of s)_=w?.span?.call(m,_,g+1,x,b,k)||_;i==="inline"?o.children.push(_):i==="classic"&&b.children.push(_),x+=k.content.length}if(i==="classic"){for(const k of s)b=k?.line?.call(m,b,g+1)||b;h.push(b),a.push(b)}else i==="inline"&&h.push(b)}),i==="classic"){for(const y of s)d=y?.code?.call(m,d)||d;l.children.push(d);for(const y of s)l=y?.pre?.call(m,l)||l;o.children.push(l)}else if(i==="inline"){const y=[];let g={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const x of o.children)x.type==="element"&&x.tagName==="br"?(y.push(g),g={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(x.type==="element"||x.type==="text")&&g.children.push(x);y.push(g);let b={type:"element",tagName:"code",properties:{},children:y};for(const x of s)b=x?.code?.call(m,b)||b;o.children=[];for(let x=0;x<b.children.length;x++){x>0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const k=b.children[x];k.type==="element"&&o.children.push(...k.children)}}let p=o;for(const y of s)p=y?.root?.call(m,p)||p;return r&&ak(p,r),p}function Y_e(e){return e.map(t=>{const n=[];let r="",s;return t.forEach((a,o)=>{const i=!(a.fontStyle&&(a.fontStyle&kr.Underline||a.fontStyle&kr.Strikethrough));i&&a.content.match(/^\s+$/)&&t[o+1]?(s===void 0&&(s=a.offset),r+=a.content):r?(i?n.push({...a,offset:s,content:r+a.content}):n.push({content:r,offset:s},a),s=void 0,r=""):n.push(a)}),n})}function J_e(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const r=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!r)return n;const[,s,a,o]=r;if(!s&&!o)return n;const i=[{...n,offset:n.offset+s.length,content:a}];return s&&i.unshift({content:s,offset:n.offset}),o&&i.push({content:o,offset:n.offset+s.length+a.length}),i}))}function Q_e(e){return e.map(t=>{const n=[];for(const r of t){if(n.length===0){n.push({...r});continue}const s=n[n.length-1],a=eE(s.htmlStyle||F0(s)),o=eE(r.htmlStyle||F0(r)),i=s.fontStyle&&(s.fontStyle&kr.Underline||s.fontStyle&kr.Strikethrough),c=r.fontStyle&&(r.fontStyle&kr.Underline||r.fontStyle&kr.Strikethrough);!i&&!c&&a===o?s.content+=r.content:n.push({...r})}return n})}const X_e=I_e;function Z_e(e,t,n){const r={meta:{},options:n,codeToHast:(a,o)=>z0(e,a,o),codeToTokens:(a,o)=>U0(e,a,o)};let s=X_e(z0(e,t,n,r));for(const a of B0(n))s=a.postprocess?.call(r,s,n)||s;return s}async function k9(e){const t=await lwe(e);return{getLastGrammarState:(...n)=>hwe(t,...n),codeToTokensBase:(n,r)=>x9(t,n,r),codeToTokensWithThemes:(n,r)=>r9(t,n,r),codeToTokens:(n,r)=>U0(t,n,r),codeToHast:(n,r)=>z0(t,n,r),codeToHtml:(n,r)=>Z_e(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}const z3=4294967295;var eEe=class{regexps;constructor(e,t={}){this.patterns=e,this.options=t;const{forgiving:n=!1,cache:r,regexConstructor:s}=t;if(!s)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(a=>{if(typeof a!="string")return a;const o=r?.get(a);if(o){if(o instanceof RegExp)return o;if(n)return null;throw o}try{const i=s(a);return r?.set(a,i),i}catch(i){if(r?.set(a,i),n)return null;throw i}})}findNextMatchSync(e,t,n){const r=typeof e=="string"?e:e.content,s=[];function a(o,i,c=0){return{index:o,captureIndices:i.indices.map(u=>u==null?{start:z3,end:z3,length:0}:{start:u[0]+c,end:u[1]+c,length:u[1]-u[0]})}}for(let o=0;o<this.regexps.length;o++){const i=this.regexps[o];if(i)try{i.lastIndex=t;const c=i.exec(r);if(!c)continue;if(c.index===t)return a(o,c,0);s.push([o,c,0])}catch(c){if(this.options.forgiving)continue;throw c}}if(s.length){const o=Math.min(...s.map(i=>i[1].index));for(const[i,c,u]of s)if(c.index===o)return a(i,c,u)}return null}};function Jd(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function tEe(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const x2=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),Wn=String.raw;function Qd(e,t){if(e==null)throw new Error(t??"Value expected");return e}const v9=Wn`\[\^?`,S9=`c.? | C(?:-.?)?|${Wn`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${Wn`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${Wn`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${Wn`o\{[^\}]*\}?`}|${Wn`\d{1,3}`}`,k2=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,nb=new RegExp(Wn`
|
|
47
|
-
\\ (?:
|
|
48
|
-
${S9}
|
|
49
|
-
| [gk]<[^>]*>?
|
|
50
|
-
| [gk]'[^']*'?
|
|
51
|
-
| .
|
|
52
|
-
)
|
|
53
|
-
| \( (?:
|
|
54
|
-
\? (?:
|
|
55
|
-
[:=!>({]
|
|
56
|
-
| <[=!]
|
|
57
|
-
| <[^>]*>
|
|
58
|
-
| '[^']*'
|
|
59
|
-
| ~\|?
|
|
60
|
-
| #(?:[^)\\]|\\.?)*
|
|
61
|
-
| [^:)]*[:)]
|
|
62
|
-
)?
|
|
63
|
-
| \*[^\)]*\)?
|
|
64
|
-
)?
|
|
65
|
-
| (?:${k2.source})+
|
|
66
|
-
| ${v9}
|
|
67
|
-
| .
|
|
68
|
-
`.replace(/\s+/g,""),"gsu"),sS=new RegExp(Wn`
|
|
69
|
-
\\ (?:
|
|
70
|
-
${S9}
|
|
71
|
-
| .
|
|
72
|
-
)
|
|
73
|
-
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
74
|
-
| ${v9}
|
|
75
|
-
| &&
|
|
76
|
-
| .
|
|
77
|
-
`.replace(/\s+/g,""),"gsu");function nEe(e,t={}){const n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const r=vEe(n.flags),s=[r.extended],a={captureGroup:n.rules.captureGroup,getCurrentModX(){return s.at(-1)},numOpenGroups:0,popModX(){s.pop()},pushModX(d){s.push(d)},replaceCurrentModX(d){s[s.length-1]=d},singleline:n.rules.singleline};let o=[],i;for(nb.lastIndex=0;i=nb.exec(e);){const d=rEe(a,e,i[0],nb.lastIndex);d.tokens?o.push(...d.tokens):d.token&&o.push(d.token),d.lastIndex!==void 0&&(nb.lastIndex=d.lastIndex)}const c=[];let u=0;o.filter(d=>d.type==="GroupOpen").forEach(d=>{d.kind==="capturing"?d.number=++u:d.raw==="("&&c.push(d)}),u||c.forEach((d,h)=>{d.kind="capturing",d.number=h+1});const l=u||c.length;return{tokens:o.map(d=>d.type==="EscapedNumber"?wEe(d,l):d).flat(),flags:r}}function rEe(e,t,n,r){const[s,a]=n;if(n==="["||n==="[^"){const o=sEe(t,n,r);return{tokens:o.tokens,lastIndex:o.lastIndex}}if(s==="\\"){if("AbBGyYzZ".includes(a))return{token:H3(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:mEe(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:_9(n)}}if(a==="K")return{token:E9("keep",n)};if(a==="N"||a==="R")return{token:Dc("newline",n,{negate:a==="N"})};if(a==="O")return{token:Dc("any",n)};if(a==="X")return{token:Dc("text_segment",n)};const o=w9(n,{inCharClass:!1});return Array.isArray(o)?{tokens:o}:{token:o}}if(s==="("){if(a==="*")return{token:yEe(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:bEe(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:dl("group",n)};if(n==="(?>")return{token:dl("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:dl(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:dl("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:dl("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:dEe(n)}}if(e.getCurrentModX()){if(n==="#"){const o=t.indexOf(`
|
|
78
|
-
`,r);return{lastIndex:o===-1?t.length:o}}if(/^\s$/.test(n)){const o=/\s+/y;return o.lastIndex=r,{lastIndex:o.exec(t)?o.lastIndex:r}}}if(n===".")return{token:Dc("dot",n)};if(n==="^"||n==="$"){const o=e.singleline?{"^":Wn`\A`,$:Wn`\Z`}[n]:n;return{token:H3(o,n)}}return n==="|"?{token:oEe(n)}:k2.test(n)?{tokens:_Ee(n)}:{token:Ro(Jd(n),n)}}function sEe(e,t,n){const r=[q3(t[1]==="^",t)];let s=1,a;for(sS.lastIndex=n;a=sS.exec(e);){const o=a[0];if(o[0]==="["&&o[1]!==":")s++,r.push(q3(o[1]==="^",o));else if(o==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(Ro(93,o));else if(s--,r.push(iEe(o)),!s)break}else{const i=aEe(o);Array.isArray(i)?r.push(...i):r.push(i)}}return{tokens:r,lastIndex:sS.lastIndex||e.length}}function aEe(e){if(e[0]==="\\")return w9(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!x2.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return Dc("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?cEe(e):e==="&&"?uEe(e):Ro(Jd(e),e)}function w9(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return gEe(e);if("dDhHsSwW".includes(n))return xEe(e);if(e.startsWith(Wn`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return kEe(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const r=e.split(/\\x/).slice(1).map(o=>parseInt(o,16)),s=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),a=new TextEncoder;return[...s].map(o=>{const i=[...a.encode(o)].map(c=>`\\x${c.toString(16)}`).join("");return Ro(Jd(o),i)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Ro(SEe(e),e);if(V3.has(n))return Ro(V3.get(n),e);if(/\d/.test(n))return lEe(t,e);if(e==="\\")throw new Error(Wn`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Ro(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function oEe(e){return{type:"Alternator",raw:e}}function H3(e,t){return{type:"Assertion",kind:e,raw:t}}function _9(e){return{type:"Backreference",raw:e}}function Ro(e,t){return{type:"Character",value:e,raw:t}}function iEe(e){return{type:"CharacterClassClose",raw:e}}function cEe(e){return{type:"CharacterClassHyphen",raw:e}}function uEe(e){return{type:"CharacterClassIntersector",raw:e}}function q3(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function Dc(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function E9(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Qd(n.flags),raw:t}}function lEe(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function dEe(e){return{type:"GroupClose",raw:e}}function dl(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function fEe(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function hEe(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function mEe(e){return{type:"Subroutine",raw:e}}const pEe=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),V3=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function gEe(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return Ro(Jd(t.toUpperCase())-64,e)}function bEe(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??="";const s=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),a=K3(n),o=K3(r),i={};if(a&&(i.enable=a),o&&(i.disable=o),e.endsWith(")"))return t.replaceCurrentModX(s),E9("flags",e,{flags:i});if(e.endsWith(":"))return t.pushModX(s),t.numOpenGroups++,dl("group",e,{...(a||o)&&{flags:i}});throw new Error(`Unexpected flag modifier "${e}"`)}function yEe(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:r,args:s}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const a=s?s.split(",").filter(l=>l!=="").map(l=>/^[+-]?\d+$/.test(l)?+l:l):[],[o,i,c]=a,u=pEe.has(n)?n.toLowerCase():"custom";switch(u){case"fail":case"mismatch":case"skip":if(a.length>0)throw new Error(`Named callout arguments not allowed "${a}"`);break;case"error":if(a.length>1)throw new Error(`Named callout allows only one argument "${a}"`);if(typeof o=="string")throw new Error(`Named callout argument must be a number "${o}"`);break;case"max":if(!a.length||a.length>2)throw new Error(`Named callout must have one or two arguments "${a}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(a.length===2&&(typeof i=="number"||!/^[<>X]$/.test(i)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${i}"`);break;case"count":case"total_count":if(a.length>1)throw new Error(`Named callout allows only one argument "${a}"`);if(a.length===1&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case"cmp":if(a.length!==3)throw new Error(`Named callout must have three arguments "${a}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof i=="number"||!/^(?:[<>!=]=|[<>])$/.test(i))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${i}"`);if(typeof c=="string"&&!/^[A-Za-z_]\w*$/.test(c))throw new Error(`Named callout argument three must be a tag or number "${c}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${u}"`)}return fEe(u,r??null,s?.split(",")??null,e)}function G3(e){let t=null,n,r;if(e[0]==="{"){const{minStr:s,maxStr:a}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+s>o||a&&+a>o)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+s,r=a===void 0?+s:a===""?1/0:+a,n>r&&(t="possessive",[n,r]=[r,n]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=e[0]==="+"?1:0,r=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return hEe(t,n,r,e)}function xEe(e){const t=e[1].toLowerCase();return Dc({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function kEe(e){const{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return Dc("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function K3(e){const t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function vEe(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){const r=e[n];if(!"imxDPSWy".includes(r))throw new Error(`Invalid flag "${r}"`);if(r==="y"){if(!/^y{[gw]}/.test(e.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[n+2]==="g"?"grapheme":"word",n+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[r]]=!0}return t}function SEe(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function wEe(e,t){const{raw:n,inCharClass:r}=e,s=n.slice(1);if(!r&&(s!=="0"&&s.length===1||s[0]!=="0"&&+s<=t))return[_9(n)];const a=[],o=s.match(/^[0-7]+|\d/g);for(let i=0;i<o.length;i++){const c=o[i];let u;if(i===0&&c!=="8"&&c!=="9"){if(u=parseInt(c,8),u>127)throw new Error(Wn`Octal encoded byte above 177 unsupported "${n}"`)}else u=Jd(c);a.push(Ro(u,(i===0?"\\":"")+c))}return a}function _Ee(e){const t=[],n=new RegExp(k2,"gy");let r;for(;r=n.exec(e);){const s=r[0];if(s[0]==="{"){const a=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(s);if(a){const{min:o,max:i}=a.groups;if(+o>+i&&s.endsWith("?")){n.lastIndex--,t.push(G3(s.slice(0,-1)));continue}}}t.push(G3(s))}return t}function T9(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const n=e.body[0];return!t||Object.keys(t).every(r=>t[r]===n[r])}function EEe(e){return TEe.has(e.type)}const TEe=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function C9(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=nEe(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),s=(h,m)=>{const p=r.tokens[a.nextIndex];switch(a.parent=h,a.nextIndex++,p.type){case"Alternator":return yu();case"Assertion":return CEe(p);case"Backreference":return IEe(p,a);case"Character":return ck(p.value,{useLastValid:!!m.isCheckingRangeEnd});case"CharacterClassHyphen":return AEe(p,a,m);case"CharacterClassOpen":return NEe(p,a,m);case"CharacterSet":return REe(p,a);case"Directive":return MEe(p.kind,{flags:p.flags});case"GroupOpen":return PEe(p,a,m);case"NamedCallout":return FEe(p.kind,p.tag,p.arguments);case"Quantifier":return OEe(p,a);case"Subroutine":return LEe(p,a);default:throw new Error(`Unexpected token type "${p.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:s},o=UEe(DEe(r.flags));let i=o.body[0];for(;a.nextIndex<r.tokens.length;){const h=s(i,{});h.type==="Alternative"?(o.body.push(h),i=h):i.body.push(h)}const{capturingGroups:c,hasNumberedRef:u,namedGroupsByName:l,subroutines:d}=a;if(u&&l.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:h}of d)if(typeof h=="number"){if(h>c.length)throw new Error("Subroutine uses a group number that's not defined");h&&(c[h-1].isSubroutined=!0)}else if(l.has(h)){if(l.get(h).length>1)throw new Error(Wn`Subroutine uses a duplicate group name "\g<${h}>"`);l.get(h)[0].isSubroutined=!0}else throw new Error(Wn`Subroutine uses a group name that's not defined "\g<${h}>"`);return o}function CEe({kind:e}){return tE(Qd({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===Wn`\B`||e===Wn`\Y`})}function IEe({raw:e},t){const n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),s=(a,o=!1)=>{const i=t.capturingGroups.length;let c=!1;if(a>i)if(t.skipBackrefValidation)c=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,nE(o?i+1-a:a,{orphan:c})};if(n){const a=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(a)return s(+a.groups.num,!!a.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${e}"`);return nE(r)}return s(+r)}function AEe(e,t,n){const{tokens:r,walk:s}=t,a=t.parent,o=a.body.at(-1),i=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!=="CharacterClass"&&o.type!=="CharacterClassRange"&&i&&i.type!=="CharacterClassOpen"&&i.type!=="CharacterClassClose"&&i.type!=="CharacterClassIntersector"){const c=s(a,{...n,isCheckingRangeEnd:!0});if(o.type==="Character"&&c.type==="Character")return a.body.pop(),jEe(o,c);throw new Error("Invalid character class range")}return ck(Jd("-"))}function NEe({negate:e},t,n){const{tokens:r,walk:s}=t,a=r[t.nextIndex],o=[ry()];let i=J3(a);for(;i.type!=="CharacterClassClose";){if(i.type==="CharacterClassIntersector")o.push(ry()),t.nextIndex++;else{const u=o.at(-1);u.body.push(s(u,n))}i=J3(r[t.nextIndex],a)}const c=ry({negate:e});return o.length===1?c.body=o[0].body:(c.kind="intersection",c.body=o.map(u=>u.body.length===1?u.body[0]:u)),t.nextIndex++,c}function REe({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:s,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e==="property"){const i=uk(n);if(x2.has(i)&&!o?.has(i))e="posix",n=i;else return fl(n,{negate:t,normalizeUnknownPropertyNames:s,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e==="posix"?BEe(n,{negate:t}):rE(e,{negate:t})}function PEe(e,t,n){const{tokens:r,capturingGroups:s,namedGroupsByName:a,skipLookbehindValidation:o,walk:i}=t,c=zEe(e),u=c.type==="AbsenceFunction",l=Y3(c),d=l&&c.negate;if(c.type==="CapturingGroup"&&(s.push(c),c.name&&tEe(a,c.name,[]).push(c)),u&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let h=Q3(r[t.nextIndex]);for(;h.type!=="GroupClose";){if(h.type==="Alternator")c.body.push(yu()),t.nextIndex++;else{const m=c.body.at(-1),p=i(m,{...n,isInAbsenceFunction:n.isInAbsenceFunction||u,isInLookbehind:n.isInLookbehind||l,isInNegLookbehind:n.isInNegLookbehind||d});if(m.body.push(p),(l||n.isInLookbehind)&&!o){const y="Lookbehind includes a pattern not allowed by Oniguruma";if(d||n.isInNegLookbehind){if(W3(p)||p.type==="CapturingGroup")throw new Error(y)}else if(W3(p)||Y3(p)&&p.negate)throw new Error(y)}}h=Q3(r[t.nextIndex])}return t.nextIndex++,c}function OEe({kind:e,min:t,max:n},r){const s=r.parent,a=s.body.at(-1);if(!a||!EEe(a))throw new Error("Quantifier requires a repeatable token");const o=A9(e,t,n,a);return s.body.pop(),o}function LEe({raw:e},t){const{capturingGroups:n,subroutines:r}=t;let s=e.slice(3,-1);const a=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(s);if(a){const i=+a.groups.num,c=n.length;if(t.hasNumberedRef=!0,s={"":i,"+":c+i,"-":c+1-i}[a.groups.sign],s<1)throw new Error("Invalid subroutine number")}else s==="0"&&(s=0);const o=N9(s);return r.push(o),o}function $Ee(e,t){return{type:"AbsenceFunction",kind:e,body:Np(t?.body)}}function yu(e){return{type:"Alternative",body:R9(e?.body)}}function tE(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function nE(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function I9(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!HEe(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:Np(t?.body)}}function ck(e,t){const n={useLastValid:!1,...t};if(e>1114111){const r=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:e}}function ry(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:R9(e?.body)}}function jEe(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function rE(e,t){const n=!!t?.negate,r={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(r.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(r.variableLength=!0),r}function MEe(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:Qd(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function DEe(e){return{type:"Flags",...e}}function ua(e){const t=e?.atomic,n=e?.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:Np(e?.body)}}function Ic(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:Np(e?.body)}}function FEe(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function BEe(e,t){const n=!!t?.negate;if(!x2.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function A9(e,t,n,r){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:r}}function UEe(e,t){return{type:"Regex",body:Np(t?.body),flags:e}}function N9(e){return{type:"Subroutine",ref:e}}function fl(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let r=n.unicodePropertyMap?.get(uk(e));if(!r){if(n.normalizeUnknownPropertyNames)r=qEe(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(Wn`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function zEe({flags:e,kind:t,name:n,negate:r,number:s}){switch(t){case"absence_repeater":return $Ee("repeater");case"atomic":return ua({atomic:!0});case"capturing":return I9(s,{name:n});case"group":return ua({flags:e});case"lookahead":case"lookbehind":return Ic({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function Np(e){if(e===void 0)e=[yu()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function R9(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function W3(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function Y3(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function HEe(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function qEe(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function uk(e){return e.replace(/[- _]+/g,"").toLowerCase()}function J3(e,t){return Qd(e,`${t?.type==="Character"&&t.value===93?"Empty":"Unclosed"} character class`)}function Q3(e){return Qd(e,"Unclosed group")}function Ah(e,t,n=null){function r(a,o){for(let i=0;i<a.length;i++){const c=s(a[i],o,i,a);i=Math.max(-1,i+c)}}function s(a,o=null,i=null,c=null){let u=0,l=!1;const d={node:a,parent:o,key:i,container:c,root:e,remove(){rb(c).splice(Math.max(0,Zu(i)+u),1),u--,l=!0},removeAllNextSiblings(){return rb(c).splice(Zu(i)+1)},removeAllPrevSiblings(){const b=Zu(i)+u;return u-=b,rb(c).splice(0,Math.max(0,b))},replaceWith(b,x={}){const k=!!x.traverse;c?c[Math.max(0,Zu(i)+u)]=b:Qd(o,"Can't replace root node")[i]=b,k&&s(b,o,i,c),l=!0},replaceWithMultiple(b,x={}){const k=!!x.traverse;if(rb(c).splice(Math.max(0,Zu(i)+u),1,...b),u+=b.length-1,k){let _=0;for(let S=0;S<b.length;S++)_+=s(b[S],o,Zu(i)+S+_,c)}l=!0},skip(){l=!0}},{type:h}=a,m=t["*"],p=t[h],y=typeof m=="function"?m:m?.enter,g=typeof p=="function"?p:p?.enter;if(y?.(d,n),g?.(d,n),!l)switch(h){case"AbsenceFunction":case"CapturingGroup":case"Group":r(a.body,a);break;case"Alternative":case"CharacterClass":r(a.body,a);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":s(a.min,a,"min"),s(a.max,a,"max");break;case"LookaroundAssertion":r(a.body,a);break;case"Quantifier":s(a.body,a,"body");break;case"Regex":r(a.body,a),s(a.flags,a,"flags");break;default:throw new Error(`Unexpected node type "${h}"`)}return p?.exit?.(d,n),m?.exit?.(d,n),u}return s(e),e}function rb(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function Zu(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const VEe=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function GEe(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function KEe(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}const Bs=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function v2(e,t,n,r){const s=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),a=[!1];let o=0,i="";for(const c of e.matchAll(s)){const{0:u,groups:{$skip:l}}=c;if(!l&&(!r||r===Bs.DEFAULT==!o)){n instanceof Function?i+=n(c,{context:o?Bs.CHAR_CLASS:Bs.DEFAULT,negated:a[a.length-1]}):i+=n;continue}u[0]==="["?(o++,a.push(u[1]==="^")):u==="]"&&o&&(o--,a.pop()),i+=u}return i}function P9(e,t,n,r){v2(e,t,n,r)}function WEe(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;const s=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");s.lastIndex=n;let a=0,o;for(;o=s.exec(e);){const{0:i,groups:{$skip:c}}=o;if(!c&&(!r||r===Bs.DEFAULT==!a))return o;i==="["?a++:i==="]"&&a&&a--,s.lastIndex==o.index&&s.lastIndex++}return null}function sb(e,t,n){return!!WEe(e,t,0,n)}function YEe(e,t){const n=/\\?./gsu;n.lastIndex=t;let r=e.length,s=0,a=1,o;for(;o=n.exec(e);){const[i]=o;if(i==="[")s++;else if(s)i==="]"&&s--;else if(i==="(")a++;else if(i===")"&&(a--,!a)){r=o.index;break}}return e.slice(t,r)}const X3=new RegExp(String.raw`(?<noncapturingStart>${VEe})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function JEe(e,t){const n=t?.hiddenCaptures??[];let r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};const s="(?>",a="(?:(?=(",o=[0],i=[];let c=0,u=0,l=NaN,d;do{d=!1;let h=0,m=0,p=!1,y;for(X3.lastIndex=Number.isNaN(l)?0:l+a.length;y=X3.exec(e);){const{0:g,index:b,groups:{capturingStart:x,noncapturingStart:k}}=y;if(g==="[")h++;else if(h)g==="]"&&h--;else if(g===s&&!p)l=b,p=!0;else if(p&&k)m++;else if(x)p?m++:(c++,o.push(c+u));else if(g===")"&&p){if(!m){u++;const _=c+u;if(e=`${e.slice(0,l)}${a}${e.slice(l+s.length,b)}))<$$${_}>)${e.slice(b+1)}`,d=!0,i.push(_),GEe(n,_),r.size){const S=new Map;r.forEach((w,T)=>{S.set(T>=_?T+1:T,w.map(A=>A>=_?A+1:A))}),r=S}break}m--}}}while(d);return n.push(...i),e=v2(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:h,groups:{backrefNum:m,wrappedBackrefNum:p}})=>{if(m){const y=+m;if(y>o.length-1)throw new Error(`Backref "${h}" greater than number of captures`);return`\\${o[y]}`}return`\\${p}`},Bs.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}const O9=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,aS=new RegExp(String.raw`
|
|
79
|
-
\\(?: \d+
|
|
80
|
-
| c[A-Za-z]
|
|
81
|
-
| [gk]<[^>]+>
|
|
82
|
-
| [pPu]\{[^\}]+\}
|
|
83
|
-
| u[A-Fa-f\d]{4}
|
|
84
|
-
| x[A-Fa-f\d]{2}
|
|
85
|
-
)
|
|
86
|
-
| \((?: \? (?: [:=!>]
|
|
87
|
-
| <(?:[=!]|[^>]+>)
|
|
88
|
-
| [A-Za-z\-]+:
|
|
89
|
-
| \(DEFINE\)
|
|
90
|
-
))?
|
|
91
|
-
| (?<qBase>${O9})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
92
|
-
| \\?.
|
|
93
|
-
`.replace(/\s+/g,""),"gsu");function QEe(e){if(!new RegExp(`${O9}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,s="",a=0,o;for(aS.lastIndex=0;o=aS.exec(e);){const{0:i,index:c,groups:{qBase:u,qMod:l,invalidQ:d}}=o;if(i==="[")a||(r=c),a++;else if(i==="]")a?a--:r=null;else if(!a)if(l==="+"&&s&&!s.startsWith("(")){if(d)throw new Error(`Invalid quantifier "${i}"`);let h=-1;if(/^\{\d+\}$/.test(u))e=KEe(e,c+u.length,l,"");else{if(s===")"||s==="]"){const m=s===")"?n:r;if(m===null)throw new Error(`Invalid unmatched "${s}"`);e=`${e.slice(0,m)}(?>${e.slice(m,c)}${u})${e.slice(c+i.length)}`}else e=`${e.slice(0,c-s.length)}(?>${s}${u})${e.slice(c+i.length)}`;h+=4}aS.lastIndex+=h}else i[0]==="("?t.push(c):i===")"&&(n=t.length?t.pop():null);s=i}return{pattern:e}}const Ds=String.raw,XEe=Ds`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,sE=Ds`\(\?R=(?<rDepth>[^\)]+)\)|${XEe}`,lk=Ds`\(\?<(?![=!])(?<captureName>[^>]+)>`,L9=Ds`${lk}|(?<unnamed>\()(?!\?)`,mc=new RegExp(Ds`${lk}|${sE}|\(\?|\\?.`,"gsu"),oS="Cannot use multiple overlapping recursions";function ZEe(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let s=t?.captureTransfers??new Map;if(!new RegExp(sE,"su").test(e))return{pattern:e,captureTransfers:s,hiddenCaptures:n};if(r==="plugin"&&sb(e,Ds`\(\?\(DEFINE\)`,Bs.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const a=[],o=sb(e,Ds`\\[1-9]`,Bs.DEFAULT),i=new Map,c=[];let u=!1,l=0,d=0,h;for(mc.lastIndex=0;h=mc.exec(e);){const{0:m,groups:{captureName:p,rDepth:y,gRNameOrNum:g,gRDepth:b}}=h;if(m==="[")l++;else if(l)m==="]"&&l--;else if(y){if(Z3(y),u)throw new Error(oS);if(o)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const x=e.slice(0,h.index),k=e.slice(mc.lastIndex);if(sb(k,sE,Bs.DEFAULT))throw new Error(oS);const _=+y-1;e=eL(x,k,_,!1,n,a,d),s=nL(s,x,_,a.length,0,d);break}else if(g){Z3(b);let x=!1;for(const F of c)if(F.name===g||F.num===+g){if(x=!0,F.hasRecursedWithin)throw new Error(oS);break}if(!x)throw new Error(Ds`Recursive \g cannot be used outside the referenced group "${r==="external"?g:Ds`\g<${g}&R=${b}>`}"`);const k=i.get(g),_=YEe(e,k);if(o&&sb(_,Ds`${lk}|\((?!\?)`,Bs.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const S=e.slice(k,h.index),w=_.slice(S.length+m.length),T=a.length,A=+b-1,L=eL(S,w,A,!0,n,a,d);s=nL(s,S,A,a.length-T,T,d);const R=e.slice(0,k),j=e.slice(k+_.length);e=`${R}${L}${j}`,mc.lastIndex+=L.length-m.length-S.length-w.length,c.forEach(F=>F.hasRecursedWithin=!0),u=!0}else if(p)d++,i.set(String(d),mc.lastIndex),i.set(p,mc.lastIndex),c.push({num:d,name:p});else if(m[0]==="("){const x=m==="(";x&&(d++,i.set(String(d),mc.lastIndex)),c.push(x?{num:d}:{})}else m===")"&&c.pop()}return n.push(...a),{pattern:e,captureTransfers:s,hiddenCaptures:n}}function Z3(e){const t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if(e=+e,e<2||e>100)throw new Error(t)}function eL(e,t,n,r,s,a,o){const i=new Set;r&&P9(e+t,lk,({groups:{captureName:u}})=>{i.add(u)},Bs.DEFAULT);const c=[n,r?i:null,s,a,o];return`${e}${tL(`(?:${e}`,"forward",...c)}(?:)${tL(`${t})`,"backward",...c)}${t}`}function tL(e,t,n,r,s,a,o){const c=l=>t==="forward"?l+2:n-l+2-1;let u="";for(let l=0;l<n;l++){const d=c(l);u+=v2(e,Ds`${L9}|\\k<(?<backref>[^>]+)>`,({0:h,groups:{captureName:m,unnamed:p,backref:y}})=>{if(y&&r&&!r.has(y))return h;const g=`_$${d}`;if(p||m){const b=o+a.length+1;return a.push(b),eTe(s,b),p?h:`(?<${m}${g}>`}return Ds`\k<${y}${g}>`},Bs.DEFAULT)}return u}function eTe(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function nL(e,t,n,r,s,a){if(e.size&&r){let o=0;P9(t,L9,()=>o++,Bs.DEFAULT);const i=a-o+s,c=new Map;return e.forEach((u,l)=>{const d=(r-o*n)/n,h=o*n,m=l>i+o?l+r:l,p=[];for(const y of u)if(y<=i)p.push(y);else if(y>i+o+d)p.push(y+r);else if(y<=i+o)for(let g=0;g<=n;g++)p.push(y+o*g);else for(let g=0;g<=n;g++)p.push(y+h+d*g);c.set(m,p)}),c}return e}var Ln=String.fromCodePoint,rt=String.raw,jo={flagGroups:(()=>{try{new RegExp("(?i:)")}catch{return!1}return!0})(),unicodeSets:(()=>{try{new RegExp("[[]]","v")}catch{return!1}return!0})()};jo.bugFlagVLiteralHyphenIsRange=jo.unicodeSets?(()=>{try{new RegExp(rt`[\d\-a]`,"v")}catch{return!0}return!1})():!1;jo.bugNestedClassIgnoresNegation=jo.unicodeSets&&new RegExp("[[^a]]","v").test("a");function H0(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function Tm(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function aE(e,t){return rL[e]>=rL[t]}function tTe(e,t){if(e==null)throw new Error(t??"Value expected");return e}var rL={ES2025:2025,ES2024:2024,ES2018:2018},nTe={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function $9(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!nTe[e.target])throw new Error(`Unexpected target "${e.target}"`);const t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target==="auto"&&(t.target=jo.flagGroups?"ES2025":jo.unicodeSets?"ES2024":"ES2018"),t}var rTe="[ -\r ]",sTe=new Set([Ln(304),Ln(305)]),go=rt`[\p{L}\p{M}\p{N}\p{Pc}]`;function j9(e){if(sTe.has(e))return[e];const t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),s=iTe.get(n),a=aTe.get(n),o=oTe.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),s&&t.add(s),t.add(n),a&&t.add(a),[...t]}var S2=new Map(`C Other
|
|
94
|
-
Cc Control cntrl
|
|
95
|
-
Cf Format
|
|
96
|
-
Cn Unassigned
|
|
97
|
-
Co Private_Use
|
|
98
|
-
Cs Surrogate
|
|
99
|
-
L Letter
|
|
100
|
-
LC Cased_Letter
|
|
101
|
-
Ll Lowercase_Letter
|
|
102
|
-
Lm Modifier_Letter
|
|
103
|
-
Lo Other_Letter
|
|
104
|
-
Lt Titlecase_Letter
|
|
105
|
-
Lu Uppercase_Letter
|
|
106
|
-
M Mark Combining_Mark
|
|
107
|
-
Mc Spacing_Mark
|
|
108
|
-
Me Enclosing_Mark
|
|
109
|
-
Mn Nonspacing_Mark
|
|
110
|
-
N Number
|
|
111
|
-
Nd Decimal_Number digit
|
|
112
|
-
Nl Letter_Number
|
|
113
|
-
No Other_Number
|
|
114
|
-
P Punctuation punct
|
|
115
|
-
Pc Connector_Punctuation
|
|
116
|
-
Pd Dash_Punctuation
|
|
117
|
-
Pe Close_Punctuation
|
|
118
|
-
Pf Final_Punctuation
|
|
119
|
-
Pi Initial_Punctuation
|
|
120
|
-
Po Other_Punctuation
|
|
121
|
-
Ps Open_Punctuation
|
|
122
|
-
S Symbol
|
|
123
|
-
Sc Currency_Symbol
|
|
124
|
-
Sk Modifier_Symbol
|
|
125
|
-
Sm Math_Symbol
|
|
126
|
-
So Other_Symbol
|
|
127
|
-
Z Separator
|
|
128
|
-
Zl Line_Separator
|
|
129
|
-
Zp Paragraph_Separator
|
|
130
|
-
Zs Space_Separator
|
|
131
|
-
ASCII
|
|
132
|
-
ASCII_Hex_Digit AHex
|
|
133
|
-
Alphabetic Alpha
|
|
134
|
-
Any
|
|
135
|
-
Assigned
|
|
136
|
-
Bidi_Control Bidi_C
|
|
137
|
-
Bidi_Mirrored Bidi_M
|
|
138
|
-
Case_Ignorable CI
|
|
139
|
-
Cased
|
|
140
|
-
Changes_When_Casefolded CWCF
|
|
141
|
-
Changes_When_Casemapped CWCM
|
|
142
|
-
Changes_When_Lowercased CWL
|
|
143
|
-
Changes_When_NFKC_Casefolded CWKCF
|
|
144
|
-
Changes_When_Titlecased CWT
|
|
145
|
-
Changes_When_Uppercased CWU
|
|
146
|
-
Dash
|
|
147
|
-
Default_Ignorable_Code_Point DI
|
|
148
|
-
Deprecated Dep
|
|
149
|
-
Diacritic Dia
|
|
150
|
-
Emoji
|
|
151
|
-
Emoji_Component EComp
|
|
152
|
-
Emoji_Modifier EMod
|
|
153
|
-
Emoji_Modifier_Base EBase
|
|
154
|
-
Emoji_Presentation EPres
|
|
155
|
-
Extended_Pictographic ExtPict
|
|
156
|
-
Extender Ext
|
|
157
|
-
Grapheme_Base Gr_Base
|
|
158
|
-
Grapheme_Extend Gr_Ext
|
|
159
|
-
Hex_Digit Hex
|
|
160
|
-
IDS_Binary_Operator IDSB
|
|
161
|
-
IDS_Trinary_Operator IDST
|
|
162
|
-
ID_Continue IDC
|
|
163
|
-
ID_Start IDS
|
|
164
|
-
Ideographic Ideo
|
|
165
|
-
Join_Control Join_C
|
|
166
|
-
Logical_Order_Exception LOE
|
|
167
|
-
Lowercase Lower
|
|
168
|
-
Math
|
|
169
|
-
Noncharacter_Code_Point NChar
|
|
170
|
-
Pattern_Syntax Pat_Syn
|
|
171
|
-
Pattern_White_Space Pat_WS
|
|
172
|
-
Quotation_Mark QMark
|
|
173
|
-
Radical
|
|
174
|
-
Regional_Indicator RI
|
|
175
|
-
Sentence_Terminal STerm
|
|
176
|
-
Soft_Dotted SD
|
|
177
|
-
Terminal_Punctuation Term
|
|
178
|
-
Unified_Ideograph UIdeo
|
|
179
|
-
Uppercase Upper
|
|
180
|
-
Variation_Selector VS
|
|
181
|
-
White_Space space
|
|
182
|
-
XID_Continue XIDC
|
|
183
|
-
XID_Start XIDS`.split(/\s/).map(e=>[uk(e),e])),aTe=new Map([["s",Ln(383)],[Ln(383),"s"]]),oTe=new Map([[Ln(223),Ln(7838)],[Ln(107),Ln(8490)],[Ln(229),Ln(8491)],[Ln(969),Ln(8486)]]),iTe=new Map([ri(453),ri(456),ri(459),ri(498),...iS(8072,8079),...iS(8088,8095),...iS(8104,8111),ri(8124),ri(8140),ri(8188)]),cTe=new Map([["alnum",rt`[\p{Alpha}\p{Nd}]`],["alpha",rt`\p{Alpha}`],["ascii",rt`\p{ASCII}`],["blank",rt`[\p{Zs}\t]`],["cntrl",rt`\p{Cc}`],["digit",rt`\p{Nd}`],["graph",rt`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",rt`\p{Lower}`],["print",rt`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",rt`[\p{P}\p{S}]`],["space",rt`\p{space}`],["upper",rt`\p{Upper}`],["word",rt`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",rt`\p{AHex}`]]);function uTe(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function ri(e){const t=Ln(e);return[t.toLowerCase(),t]}function iS(e,t){return uTe(e,t).map(n=>ri(n))}var M9=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function lTe(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};D9(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:aE(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};Ah(e,dTe,r);const s={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:s,prevFlags:null,globalFlags:s,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};Ah(e,fTe,a);const o={groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer};return Ah(e,hTe,o),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var dTe={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:s}=e;if(s==="repeater"){const a=ua();a.body[0].body.push(Ic({negate:!0,body:r}),fl("Any"));const o=ua();o.body[0].body.push(A9("greedy",0,1/0,a)),n(hn(o,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){const s=e.body.filter(a=>a.kind==="flags");for(let a=n+1;a<t.body.length;a++){const o=t.body[a];Tm(r,o,[]).push(...s)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const n=B9(t.get(e));if(n){const r=ua({flags:n});r.body[0].body=e.body,e.body=[hn(r,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:s,remove:a,replaceWith:o},i){const{kind:c,negate:u}=e,{asciiWordBoundaries:l,avoidSubclass:d,supportedGNodes:h,wordIsAscii:m}=i;if(c==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${u?"Y":"y"}"`);if(c==="line_end")o(hn(Ic({body:[yu({body:[tE("string_end")]}),yu({body:[ck(10)]})]}),t));else if(c==="line_start")o(hn(bo(rt`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c==="search_start")if(h.has(e))s.flags.sticky=!0,a();else{const p=r[n-1];if(p&&xTe(p))o(hn(Ic({negate:!0}),t));else{if(d)throw new Error(rt`Uses "\G" in a way that requires a subclass`);o(si(tE("string_start"),t)),i.strategy="clip_search"}}else if(!(c==="string_end"||c==="string_start"))if(c==="string_end_newline")o(hn(bo(rt`(?=\n?\z)`),t));else if(c==="word_boundary"){if(!m&&!l){const p=`(?:(?<=${go})(?!${go})|(?<!${go})(?=${go}))`,y=`(?:(?<=${go})(?=${go})|(?<!${go})(?!${go}))`;o(hn(bo(u?y:p),t))}}else throw new Error(`Unexpected assertion kind "${c}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!uS(n)&&(n=cS(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!uS(r)&&(r=cS(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){const r=ry({body:[e]});n(hn(r,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:s,digitIsAscii:a,spaceIsAscii:o,wordIsAscii:i}){const{kind:c,negate:u,value:l}=e;if(a&&(c==="digit"||l==="digit")){n(si(rE("digit",{negate:u}),t));return}if(o&&(c==="space"||l==="space")){n(hn(lS(bo(rTe),u),t));return}if(i&&(c==="word"||l==="word")){n(si(rE("word",{negate:u}),t));return}if(c==="any")n(si(fl("Any"),t));else if(c==="digit")n(si(fl("Nd",{negate:u}),t));else if(c!=="dot")if(c==="text_segment"){if(r==="strict")throw new Error(rt`Use of "\X" requires non-strict accuracy`);const d="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",h=rt`\p{RI}{2}|${d}(?:\u200D${d})*`;n(hn(bo(rt`(?>\r\n|${s?rt`\p{RGI_Emoji}`:h}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c==="hex")n(si(fl("AHex",{negate:u}),t));else if(c==="newline")n(hn(bo(u?`[^
|
|
184
|
-
]`:`(?>\r
|
|
185
|
-
?|[
|
|
186
|
-
\v\f
\u2028\u2029])`),t));else if(c==="posix")if(!s&&(l==="graph"||l==="print")){if(r==="strict")throw new Error(`POSIX class "${l}" requires min target ES2024 or non-strict accuracy`);let d={graph:"!-~",print:" -~"}[l];u&&(d=`\0-${Ln(d.codePointAt(0)-1)}${Ln(d.codePointAt(2)+1)}-`),n(hn(bo(`[${d}]`),t))}else n(hn(lS(bo(cTe.get(l)),u),t));else if(c==="property")S2.has(uk(l))||(e.key="sc");else if(c==="space")n(si(fl("space",{negate:u}),t));else if(c==="word")n(hn(lS(bo(go),u),t));else throw new Error(`Unexpected character set kind "${c}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:s,removeAllPrevSiblings:a,removeAllNextSiblings:o}){const{kind:i,flags:c}=e;if(i==="flags")if(!c.enable&&!c.disable)r();else{const u=ua({flags:c});u.body[0].body=o(),s(hn(u,t),{traverse:!0})}else if(i==="keep"){const u=n.body[0],d=n.body.length===1&&T9(u,{type:"Group"})&&u.body[0].body.length===1?u.body[0]:n;if(t.parent!==d||d.body.length>1)throw new Error(rt`Uses "\K" in a way that's unsupported`);const h=Ic({behind:!0});h.body[0].body=a(),s(hn(h,t))}else throw new Error(`Unexpected directive kind "${i}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:r}=e;if(r==="fail")n(hn(Ic({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=ua();t.body[0].body.push(e.body),e.body=hn(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,s=!1;for(const a of e.body)if(a.body.length===1&&a.body[0].kind==="search_start")a.body.pop();else{const o=z9(a.body);o?(r=!0,Array.isArray(o)?n.push(...o):n.push(o)):s=!0}r&&!s&&n.forEach(a=>t.add(a))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(rt`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!uS(n)&&(n=cS(n,t),e.ref=n)}},fTe={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:s}=e;r||n.set(e,[...t.get(s).map(({node:a})=>a)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:s,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:i,reffedNodesByReferencer:c}){const u=s.get(e);if(u&&i.has(e.number)){const d=si(sL(e.number),t);c.set(d,i.get(e.number)),n(d);return}i.set(e.number,e),o.set(e.number,[]),e.name&&Tm(o,e.name,[]);const l=o.get(e.name??e.number);for(let d=0;d<l.length;d++){const h=l[d];if(u===h.node||u&&u===h.origin||e===h.origin){l.splice(d,1);break}}if(o.get(e.number).push({node:e,origin:u}),e.name&&o.get(e.name).push({node:e,origin:u}),e.name){const d=Tm(a,e.name,new Map);let h=!1;if(u)h=!0;else for(const m of d.values())if(!m.hasDuplicateNameToRemove){h=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:h})}},exit({node:e},{openRefs:t}){t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=H0(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){const{isRecursive:s,ref:a}=e;if(s){let l=t;for(;(l=l.parent)&&!(l.type==="CapturingGroup"&&(l.name===a||l.number===a)););r.reffedNodesByReferencer.set(e,l);return}const o=r.subroutineRefMap.get(a),i=a===0,c=i?sL(0):F9(o,r.groupOriginByCopy,null);let u=c;if(!i){const l=B9(gTe(o,h=>h.type==="Group"&&!!h.flags)),d=l?H0(r.globalFlags,l):r.globalFlags;mTe(d,r.currentFlags)||(u=ua({flags:bTe(d)}),u.body[0].body.push(c))}n(hn(u,t),{traverse:!i})}},hTe={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const a=r.reffedNodesByReferencer.get(e).filter(o=>pTe(o,e));if(!a.length)n(hn(Ic({negate:!0}),t));else if(a.length>1){const o=ua({atomic:!0,body:a.reverse().map(i=>yu({body:[nE(i.number)]}))});n(hn(o,t))}else e.ref=a[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let r=0;r<n;r++){const s=I9();e.body.at(-1).body.push(s)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function D9(e){Ah(e,{"*"({node:t,parent:n}){t.parent=n}})}function mTe(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function pTe(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const r=U9(n.parent);for(const s of r){if(s===n)break;if(s===e||H9(s,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function F9(e,t,n,r){const s=Array.isArray(e)?[]:{};for(const[a,o]of Object.entries(e))a==="parent"?s.parent=Array.isArray(n)?r:n:o&&typeof o=="object"?s[a]=F9(o,t,s,n):(a==="type"&&o==="CapturingGroup"&&t.set(s,t.get(e)??e),s[a]=o);return s}function sL(e){const t=N9(e);return t.isRecursive=!0,t}function gTe(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function cS(e,t){if(t.has(e))return t.get(e);const n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function B9(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:r})=>{t.forEach(s=>{r.enable?.[s]&&(delete n.disable[s],n.enable[s]=!0),r.disable?.[s]&&(n.disable[s]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function bTe({dotAll:e,ignoreCase:t}){const n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function U9(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function z9(e){const t=e.find(n=>n.kind==="search_start"||kTe(n,{negate:!1})||!yTe(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const n=[];for(const r of t.body){const s=z9(r.body);if(!s)return null;Array.isArray(s)?n.push(...s):n.push(s)}return n}return null}function H9(e,t){const n=U9(e)??[];for(const r of n)if(r===t||H9(r,t))return!0;return!1}function yTe({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function xTe(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function kTe(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&T9(e.body[0],{type:"Assertion",kind:"search_start"})}function uS(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function bo(e,t){const r=C9(e,{...t,unicodePropertyMap:S2}).body;return r.length>1||r[0].body.length>1?ua({body:r}):r[0].body[0]}function lS(e,t){return e.negate=t,e}function si(e,t){return e.parent=t,e}function hn(e,t){return D9(e),e.parent=t,e}function vTe(e,t){const n=$9(t),r=aE(n.target,"ES2024"),s=aE(n.target,"ES2025"),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw new Error("Invalid recursionLimit; use 2-20");let o=null,i=null;if(!s){const m=[e.flags.ignoreCase];Ah(e,STe,{getCurrentModI:()=>m.at(-1),popModI(){m.pop()},pushModI(p){m.push(p)},setHasCasedChar(){m.at(-1)?o=!0:i=!0}})}const c={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!i)};let u=e;const l={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:u,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!s&&o&&i),useFlagMods:s,useFlagV:r,verbose:n.verbose};function d(m){return l.lastNode=u,u=m,tTe(wTe[m.type],`Unexpected node type "${m.type}"`)(m,l,d)}const h={pattern:e.body.map(d).join("|"),flags:d(e.flags),options:{...e.options}};return r||(delete h.options.force.v,h.options.disable.v=!0,h.options.unicodeSetsPlugin=null),h._captureTransfers=new Map,h._hiddenCaptures=[],l.captureMap.forEach((m,p)=>{m.hidden&&h._hiddenCaptures.push(p),m.transferTo&&Tm(h._captureTransfers,m.transferTo,[]).push(p)}),h}var STe={"*":{enter({node:e},t){if(oL(e)){const n=t.getCurrentModI();t.pushModI(e.flags?H0({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){oL(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){w2(Ln(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),q9(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&M9.has(e.value)&&t.setHasCasedChar()}},wTe={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?rt`\B`:rt`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){const{body:r,name:s,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},i=t.originMap.get(e);return i&&(o.hidden=!0,a>i.number&&(o.transferTo=i.number)),t.captureMap.set(a,o),`(${s?`?<${s}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=Ln(e),r=el(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&w2(n)){const s=j9(n);return t.inCharClass?s.join(""):s.length>1?`[${s.join("")}]`:s[0]}return n},CharacterClass(e,t,n){const{kind:r,negate:s,parent:a}=e;let{body:o}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");jo.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(iL)&&(o=[ck(45),...o.filter(u=>!iL(u))]);const i=()=>`[${s?"^":""}${o.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||jo.bugNestedClassIgnoresNegation)&&!s){const l=o.filter(d=>d.type==="CharacterClass"&&d.kind==="union"&&d.negate);if(l.length){const d=ua(),h=d.body[0];return d.parent=a,h.parent=d,o=o.filter(m=>!l.includes(m)),e.body=o,o.length?(e.parent=h,h.body.push(e)):d.body.pop(),l.forEach(m=>{const p=yu({body:[m]});m.parent=p,p.parent=d,d.body.push(p)}),n(d)}}t.inCharClass=!0;const u=i();return t.inCharClass=!1,u}const c=o[0];if(r==="union"&&!s&&c&&((!t.useFlagV||!t.verbose)&&a.kind==="union"&&!(jo.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind==="intersection"&&o.length===1&&c.type!=="CharacterClassRange"))return o.map(n).join("");if(!t.useFlagV&&a.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return i()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,s={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=el(n,s),o=el(r,s),i=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const c=q9(e);ITe(c).forEach(l=>{i.add(Array.isArray(l)?`${el(l[0],s)}-${el(l[1],s)}`:el(l,s))})}return`${a}-${o}${[...i].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},s){if(e==="dot")return s.currentFlags.dotAll?s.appliedGlobalFlags.dotAll||s.useFlagMods?".":"[^]":rt`[^\n]`;if(e==="digit")return t?rt`\D`:rt`\d`;if(e==="property"){if(s.useAppliedIgnoreCase&&s.currentFlags.ignoreCase&&M9.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?rt`\P`:rt`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?rt`\W`:rt`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:r},s,a){const o=s.currentFlags;n&&(s.currentFlags=H0(o,n));const i=t.map(a).join("|"),c=!s.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!s.useFlagMods||!n)?i:`(?${ATe(e,n,s.useFlagMods)}${i})`;return s.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,s){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(s).join("|")})`},Quantifier(e,t,n){return n(e.body)+NTe(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return t===0?`(?R=${r})`:rt`\g<${t}&R=${r}>`}},_Te=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),ETe=new Set(["-","\\","]","^","["]),TTe=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),aL=new Map([[9,rt`\t`],[10,rt`\n`],[11,rt`\v`],[12,rt`\f`],[13,rt`\r`],[8232,rt`\u2028`],[8233,rt`\u2029`],[65279,rt`\uFEFF`]]),CTe=new RegExp("^\\p{Cased}$","u");function w2(e){return CTe.test(e)}function q9(e,t){const n=!!t?.firstOnly,r=e.min.value,s=e.max.value,a=[];if(r<65&&(s===65535||s>=131071)||r===65536&&s>=131071)return a;for(let o=r;o<=s;o++){const i=Ln(o);if(!w2(i))continue;const c=j9(i).filter(u=>{const l=u.codePointAt(0);return l<r||l>s});if(c.length&&(a.push(...c),n))break}return a}function el(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(aL.has(e))return aL.get(e);if(e<32||e>126&&e<160||e>262143||t&&RTe(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const s=n?r?TTe:ETe:_Te,a=Ln(e);return(s.has(a)?"\\":"")+a}function ITe(e){const t=e.map(s=>s.codePointAt(0)).sort((s,a)=>s-a),n=[];let r=null;for(let s=0;s<t.length;s++)t[s+1]===t[s]+1?r??=t[s]:r===null?n.push(t[s]):(n.push([r,t[s]]),r=null);return n}function ATe(e,t,n){if(e)return">";let r="";if(t&&n){const{enable:s,disable:a}=t;r=(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")+(a?"-":"")+(a?.ignoreCase?"i":"")+(a?.dotAll?"s":"")}return`${r}:`}function NTe({kind:e,max:t,min:n}){let r;return!n&&t===1?r="?":!n&&t===1/0?r="*":n===1&&t===1/0?r="+":n===t?r=`{${n}}`:r=`{${n},${t===1/0?"":t}}`,r+{greedy:"",lazy:"?",possessive:"+"}[e]}function oL({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function RTe(e){return e>47&&e<58}function iL({type:e,value:t}){return e==="Character"&&t===45}var PTe=class oE extends RegExp{#e=new Map;#t=null;#r;#n=null;#s=null;rawOptions={};get source(){return this.#r||"(?:)"}constructor(t,n,r){const s=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw new Error("Cannot provide options when copying a regexp");const a=t;super(a,n),this.#r=a.source,a instanceof oE&&(this.#e=a.#e,this.#n=a.#n,this.#s=a.#s,this.rawOptions=a.rawOptions)}else{const a={hiddenCaptures:[],strategy:null,transfers:[],...r};super(s?"":t,n),this.#r=t,this.#e=LTe(a.hiddenCaptures,a.transfers),this.#s=a.strategy,this.rawOptions=r??{}}s||(this.#t=this)}exec(t){if(!this.#t){const{lazyCompile:s,...a}=this.rawOptions;this.#t=new oE(this.#r,this.flags,a)}const n=this.global||this.sticky,r=this.lastIndex;if(this.#s==="clip_search"&&n&&r){this.lastIndex=0;const s=this.#a(t.slice(r));return s&&(OTe(s,r,t,this.hasIndices),this.lastIndex+=r),s}return this.#a(t)}#a(t){this.#t.lastIndex=this.lastIndex;const n=super.exec.call(this.#t,t);if(this.lastIndex=this.#t.lastIndex,!n||!this.#e.size)return n;const r=[...n];n.length=1;let s;this.hasIndices&&(s=[...n.indices],n.indices.length=1);const a=[0];for(let o=1;o<r.length;o++){const{hidden:i,transferTo:c}=this.#e.get(o)??{};if(i?a.push(null):(a.push(n.length),n.push(r[o]),this.hasIndices&&n.indices.push(s[o])),c&&r[o]!==void 0){const u=a[c];if(!u)throw new Error(`Invalid capture transfer to "${u}"`);if(n[u]=r[o],this.hasIndices&&(n.indices[u]=s[o]),n.groups){this.#n||(this.#n=$Te(this.source));const l=this.#n.get(c);l&&(n.groups[l]=r[o],this.hasIndices&&(n.indices.groups[l]=s[o]))}}}return n}};function OTe(e,t,n,r){if(e.index+=t,e.input=n,r){const s=e.indices;for(let o=0;o<s.length;o++){const i=s[o];i&&(s[o]=[i[0]+t,i[1]+t])}const a=s.groups;a&&Object.keys(a).forEach(o=>{const i=a[o];i&&(a[o]=[i[0]+t,i[1]+t])})}}function LTe(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,s]of t)for(const a of s)Tm(n,a,{}).transferTo=r;return n}function $Te(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,s=0,a;for(;a=t.exec(e);){const{0:o,groups:{capture:i,name:c}}=a;o==="["?r++:r?o==="]"&&r--:i&&(s++,c&&n.set(s,c))}return n}function jTe(e,t){const n=MTe(e,t);return n.options?new PTe(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function MTe(e,t){const n=$9(t),r=C9(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:S2}),s=lTe(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),a=vTe(s,n),o=ZEe(a.pattern,{captureTransfers:a._captureTransfers,hiddenCaptures:a._hiddenCaptures,mode:"external"}),i=QEe(o.pattern),c=JEe(i.pattern,{captureTransfers:o.captureTransfers,hiddenCaptures:o.hiddenCaptures}),u={pattern:c.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${a.flags}${a.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const l=c.hiddenCaptures.sort((p,y)=>p-y),d=Array.from(c.captureTransfers),h=s._strategy,m=u.pattern.length>=n.lazyCompileLength;(l.length||d.length||h||m)&&(u.options={...l.length&&{hiddenCaptures:l},...d.length&&{transfers:d},...h&&{strategy:h},...m&&{lazyCompile:m}})}return u}function DTe(e,t){return jTe(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function V9(e={}){const t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||=n=>DTe(n,{target:t.target}),{createScanner(n){return new eEe(n,t)},createString(n){return{content:n}}}}const G9=["json","xml","yaml","shellscript","typescript","javascript","python","html","css","markdown","sql","graphql","go","rust","java","ruby","php","swift","kotlin","c","cpp","csharp","tsx","jsx","toml","dockerfile","diff","http","jsonc","log","proto"],iE={sh:"shellscript",shell:"shellscript",bash:"shellscript",zsh:"shellscript",ts:"typescript",js:"javascript",py:"python",rb:"ruby",rs:"rust","c++":"cpp","c#":"csharp",cs:"csharp",kt:"kotlin",md:"markdown",gql:"graphql",yml:"yaml"},K9={json:()=>Le(()=>import("./json-Cp-IABpG.js"),[]),xml:()=>Le(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([0,1])),yaml:()=>Le(()=>import("./yaml-Buea-lGh.js"),[]),shellscript:()=>Le(()=>import("./shellscript-Yzrsuije.js"),[]),typescript:()=>Le(()=>import("./typescript-BPQ3VLAy.js"),[]),javascript:()=>Le(()=>import("./javascript-wDzz0qaB.js"),[]),python:()=>Le(()=>import("./python-B6aJPvgy.js"),[]),html:()=>Le(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([2,3,4])),css:()=>Le(()=>import("./css-DPfMkruS.js"),[]),markdown:()=>Le(()=>import("./markdown-Cvjx9yec.js"),[]),sql:()=>Le(()=>import("./sql-BLtJtn59.js"),[]),graphql:()=>Le(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([5,3,6,7,8])),go:()=>Le(()=>import("./go-CxLEBnE3.js"),[]),rust:()=>Le(()=>import("./rust-B1yitclQ.js"),[]),java:()=>Le(()=>import("./java-CylS5w8V.js"),[]),ruby:()=>Le(()=>import("./ruby-xesJ3fNi.js"),__vite__mapDeps([9,2,3,4,0,1,10,5,6,7,8,11,12,13,14])),php:()=>Le(()=>import("./php-Dhbhpdrm.js"),__vite__mapDeps([15,2,3,4,0,1,10,16])),swift:()=>Le(()=>import("./swift-D82vCrfD.js"),[]),kotlin:()=>Le(()=>import("./kotlin-BdnUsdx6.js"),[]),c:()=>Le(()=>import("./c-BIGW1oBm.js"),[]),cpp:()=>Le(()=>import("./cpp-BRuaLJcg.js"),__vite__mapDeps([11,12,10])),csharp:()=>Le(()=>import("./csharp-COcwbKMJ.js"),[]),tsx:()=>Le(()=>import("./tsx-COt5Ahok.js"),[]),jsx:()=>Le(()=>import("./jsx-g9-lgVsj.js"),[]),toml:()=>Le(()=>import("./toml-vGWfd6FD.js"),[]),dockerfile:()=>Le(()=>import("./dockerfile-BcOcwvcX.js"),[]),diff:()=>Le(()=>import("./diff-D97Zzqfu.js"),[]),http:()=>Le(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([17,13,16,0,1,5,3,6,7,8])),jsonc:()=>Le(()=>import("./jsonc-Des-eS-w.js"),[]),log:()=>Le(()=>import("./log-2UxHyX5q.js"),[]),proto:()=>Le(()=>import("./proto-C7zT0LnQ.js"),[])},FTe=new Set([...G9,...Object.keys(iE)]);function _2(e){const t=e.trim().toLowerCase();return t in K9?t:t in iE?iE[t]:null}function BTe(e){return FTe.has(e.trim().toLowerCase())}const UTe=V9({forgiving:!0});let dS=null,ab=null;async function E2(){return dS||ab||(ab=k9({themes:[Le(()=>import("./vitesse-dark-D0r3Knsf.js"),[])],langs:Object.values(K9).map(e=>e()),engine:UTe}).then(e=>(dS=e,e)),ab)}E2();async function zTe(e,t){const n=await E2(),r=_2(t.lang)??"json";return n.codeToHtml(e,{lang:r,theme:"vitesse-dark"})}const cL="vitesse-dark",ob=new Map,pc=new Map;function HTe(){return{name:"shiki",type:"code-highlighter",getSupportedLanguages:()=>[...G9],getThemes:()=>[cL,cL],supportsLanguage:e=>BTe(e),highlight(e,t){const r=_2(e.language)??"json",s=`${r}:${e.code.length}:${e.code.slice(0,128)}`,a=ob.get(s);return a||(t&&(pc.has(s)||pc.set(s,new Set),pc.get(s).add(t)),E2().then(o=>{if(ob.has(s)){const c=ob.get(s);pc.get(s)?.forEach(u=>u(c)),pc.delete(s);return}const i=o.codeToTokens(e.code,{lang:r,themes:{light:"vitesse-dark",dark:"vitesse-dark"}});ob.set(s,i),pc.get(s)?.forEach(c=>c(i)),pc.delete(s)}),null)}}}function dk(){return typeof window<"u"}function fk(e){return T2(e)?(e.nodeName||"").toLowerCase():"#document"}function Vo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qTe(e){var t;return(t=(T2(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function T2(e){return dk()?e instanceof Node||e instanceof Vo(e).Node:!1}function Sl(e){return dk()?e instanceof Element||e instanceof Vo(e).Element:!1}function wo(e){return dk()?e instanceof HTMLElement||e instanceof Vo(e).HTMLElement:!1}function Cm(e){return!dk()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Vo(e).ShadowRoot}function C2(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=I2(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}let fS;function VTe(){return fS==null&&(fS=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),fS}function hS(e){return/^(html|body|#document)$/.test(fk(e))}function I2(e){return Vo(e).getComputedStyle(e)}function GTe(e){if(fk(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Cm(e)&&e.host||qTe(e);return Cm(t)?t.host:t}const uL={};function Go(e,t){const n=E.useRef(uL);return n.current===uL&&(n.current=e(t)),n}const mS=rM[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],KTe=mS&&mS!==E.useLayoutEffect?mS:e=>e();function rn(e){const t=Go(WTe).current;return t.next=e,KTe(t.effect),t.trampoline}function WTe(){const e={next:void 0,callback:YTe,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function YTe(){}const JTe={...rM},QTe=()=>{},qt=typeof document<"u"?E.useLayoutEffect:QTe;function cE(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const Nh={};function W9(e,t,n,r,s){let a={...uE(e,Nh)};return t&&(a=sy(a,t)),n&&(a=sy(a,n)),r&&(a=sy(a,r)),a}function XTe(e){if(e.length===0)return Nh;if(e.length===1)return uE(e[0],Nh);let t={...uE(e[0],Nh)};for(let n=1;n<e.length;n+=1)t=sy(t,e[n]);return t}function sy(e,t){return Y9(t)?t(e):ZTe(e,t)}function ZTe(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=cE(e.style,r);break}case"className":{e[n]=J9(e.className,r);break}default:eCe(n,r)?e[n]=tCe(e[n],r):e[n]=r}}return e}function eCe(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),s=e.charCodeAt(2);return n===111&&r===110&&s>=65&&s<=90&&(typeof t=="function"||typeof t>"u")}function Y9(e){return typeof e=="function"}function uE(e,t){return Y9(e)?e(t):e??Nh}function tCe(e,t){return t?e?n=>{if(nCe(n)){const s=n;lE(s);const a=t(s);return s.baseUIHandlerPrevented||e?.(s),a}const r=t(n);return e?.(n),r}:t:e}function lE(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function J9(e,t){return t?e?t+" "+e:t:e}function nCe(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function rCe(e,t){return function(r,...s){const a=new URL(e);return a.searchParams.set("code",r.toString()),s.forEach(o=>a.searchParams.append("args[]",o)),`${t} error #${r}; visit ${a} for the full message.`}}const Xd=rCe("https://base-ui.com/production-error","Base UI"),sCe=E.createContext(void 0);function aCe(e=!1){const t=E.useContext(sCe);if(t===void 0&&!e)throw new Error(Xd(16));return t}function oCe(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:a}=e,o=r&&t!==!1,i=r&&t===!1;return{props:E.useMemo(()=>{const u={onKeyDown(l){n&&t&&l.key!=="Tab"&&l.preventDefault()}};return r||(u.tabIndex=s,!a&&n&&(u.tabIndex=t?s:-1)),(a&&(t||o)||!a&&n)&&(u["aria-disabled"]=n),a&&(!t||i)&&(u.disabled=n),u},[r,n,t,o,i,a,s])}}function iCe(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0,composite:a}=e,o=E.useRef(null),i=aCe(!0),c=a??i!==void 0,{props:u}=oCe({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:s}),l=E.useCallback(()=>{const m=o.current;pS(m)&&c&&t&&u.disabled===void 0&&m.disabled&&(m.disabled=!1)},[t,u.disabled,c]);qt(l,[l]);const d=E.useCallback((m={})=>{const{onClick:p,onMouseDown:y,onKeyUp:g,onKeyDown:b,onPointerDown:x,...k}=m;return W9({type:s?"button":void 0,onClick(S){if(t){S.preventDefault();return}p?.(S)},onMouseDown(S){t||y?.(S)},onKeyDown(S){if(t||(lE(S),b?.(S),S.baseUIHandlerPrevented))return;const w=S.target===S.currentTarget,T=S.currentTarget,A=pS(T),L=!s&&cCe(T),R=w&&(s?A:!L),j=S.key==="Enter",F=S.key===" ",K=T.getAttribute("role"),Y=K?.startsWith("menuitem")||K==="option"||K==="gridcell";if(w&&c&&F){if(S.defaultPrevented&&Y)return;S.preventDefault(),L||s&&A?(T.click(),S.preventBaseUIHandler()):R&&(p?.(S),S.preventBaseUIHandler());return}R&&(!s&&(F||j)&&S.preventDefault(),!s&&j&&p?.(S))},onKeyUp(S){if(!t){if(lE(S),g?.(S),S.target===S.currentTarget&&s&&c&&pS(S.currentTarget)&&S.key===" "){S.preventDefault();return}S.baseUIHandlerPrevented||S.target===S.currentTarget&&!s&&!c&&S.key===" "&&p?.(S)}},onPointerDown(S){if(t){S.preventDefault();return}x?.(S)}},s?void 0:{role:"button"},u,k)},[t,u,c,s]),h=rn(m=>{o.current=m,l()});return{getButtonProps:d,buttonRef:h}}function pS(e){return wo(e)&&e.tagName==="BUTTON"}function cCe(e){return!!(e?.tagName==="A"&&e?.href)}function q0(e,t,n,r){const s=Go(Q9).current;return lCe(s,e,t,n,r)&&X9(s,[e,t,n,r]),s.callback}function uCe(e){const t=Go(Q9).current;return dCe(t,e)&&X9(t,e),t.callback}function Q9(){return{callback:null,cleanup:null,refs:[]}}function lCe(e,t,n,r,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==s}function dCe(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function X9(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let s=0;s<t.length;s+=1){const a=t[s];if(a!=null)switch(typeof a){case"function":{const o=a(n);typeof o=="function"&&(r[s]=o);break}case"object":{a.current=n;break}}}e.cleanup=()=>{for(let s=0;s<t.length;s+=1){const a=t[s];if(a!=null)switch(typeof a){case"function":{const o=r[s];typeof o=="function"?o():a(null);break}case"object":{a.current=null;break}}}}}}}const fCe=parseInt(E.version,10);function A2(e){return fCe>=e}function lL(e){if(!E.isValidElement(e))return null;const t=e,n=t.props;return(A2(19)?n?.ref:t.ref)??null}function hCe(e,t){const n={};for(const r in e){const s=e[r];if(t?.hasOwnProperty(r)){const a=t[r](s);a!=null&&Object.assign(n,a);continue}s===!0?n[`data-${r.toLowerCase()}`]="":s&&(n[`data-${r.toLowerCase()}`]=s.toString())}return n}function mCe(e,t){return typeof e=="function"?e(t):e}function pCe(e,t){return typeof e=="function"?e(t):e}function Kr(){}const Wr=Object.freeze({}),gCe="data-base-ui-click-trigger",bCe={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Zd(e,t,n={}){const r=t.render,s=yCe(t,n);if(n.enabled===!1)return null;const a=n.state??Wr;return kCe(e,r,s,a)}function yCe(e,t={}){const{className:n,style:r,render:s}=e,{state:a=Wr,ref:o,props:i,stateAttributesMapping:c,enabled:u=!0}=t,l=u?mCe(n,a):void 0,d=u?pCe(r,a):void 0,h=u?hCe(a,c):Wr,m=u?cE(h,Array.isArray(i)?XTe(i):i)??Wr:Wr;return typeof document<"u"&&(u?Array.isArray(o)?m.ref=uCe([m.ref,lL(s),...o]):m.ref=q0(m.ref,lL(s),o):q0(null,null)),u?(l!==void 0&&(m.className=J9(m.className,l)),d!==void 0&&(m.style=cE(m.style,d)),m):Wr}const xCe=Symbol.for("react.lazy");function kCe(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const s=W9(n,t.props);s.ref=n.ref;let a=t;return a?.$$typeof===xCe&&(a=E.Children.toArray(t)[0]),E.cloneElement(a,s)}if(e&&typeof e=="string")return vCe(e,n);throw new Error(Xd(8))}function vCe(e,t){return e==="button"?E.createElement("button",{type:"button",...t,key:t.key}):e==="img"?E.createElement("img",{alt:"",...t,key:t.key}):E.createElement(e,t)}const SCe=E.forwardRef(function(t,n){const{render:r,className:s,disabled:a=!1,focusableWhenDisabled:o=!1,nativeButton:i=!0,...c}=t,{getButtonProps:u,buttonRef:l}=iCe({disabled:a,focusableWhenDisabled:o,native:i});return Zd("button",t,{state:{disabled:a},ref:[n,l],props:[c,u]})}),dL=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,fL=Tp,N2=(e,t)=>n=>{var r;if(t?.variants==null)return fL(e,n?.class,n?.className);const{variants:s,defaultVariants:a}=t,o=Object.keys(s).map(u=>{const l=n?.[u],d=a?.[u];if(l===null)return null;const h=dL(l)||dL(d);return s[u][h]}),i=n&&Object.entries(n).reduce((u,l)=>{let[d,h]=l;return h===void 0||(u[d]=h),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,l)=>{let{class:d,className:h,...m}=l;return Object.entries(m).every(p=>{let[y,g]=p;return Array.isArray(g)?g.includes({...a,...i}[y]):{...a,...i}[y]===g})?[...u,d,h]:u},[]);return fL(e,o,c,n?.class,n?.className)},wCe=N2("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40","destructive-outline":"border-destructive/25 bg-destructive/5 text-destructive hover:bg-destructive/10",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Te({className:e,variant:t="default",size:n="default",...r}){return f.jsx(SCe,{"data-slot":"button",className:gt(wCe({variant:t,size:n,className:e})),...r})}function Z9({className:e,...t}){return f.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:gt("size-4",e),...t,children:f.jsx("path",{d:"M4 8h8M8 4v8",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})})}function _Ce({className:e,...t}){return f.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:gt("size-4",e),...t,children:[f.jsx("circle",{cx:"7",cy:"7",r:"4.5",stroke:"currentColor",strokeWidth:"1.3"}),f.jsx("path",{d:"M10.5 10.5L14 14",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}function hL({className:e,...t}){return f.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:gt("size-3",e),...t,children:f.jsx("path",{d:"M6 4l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ECe({className:e,...t}){return f.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:gt("size-3",e),...t,children:f.jsx("path",{d:"M2 4h5l2 2h5v7H2V4z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function e7({className:e,...t}){return f.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:gt("size-3.5",e),...t,children:[f.jsx("rect",{x:"5",y:"5",width:"8",height:"8",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),f.jsx("path",{d:"M11 3H4a1 1 0 00-1 1v7",stroke:"currentColor",strokeWidth:"1.2"})]})}function t7({className:e,...t}){return f.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:gt("size-3.5",e),...t,children:f.jsx("path",{d:"M4 8.5l3 3 5-6",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function n7({className:e,...t}){return f.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:gt("size-3",e),...t,children:f.jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function TCe({className:e,...t}){return f.jsxs("svg",{viewBox:"0 0 48 48",fill:"none",className:gt("size-12",e),...t,children:[f.jsx("rect",{x:"6",y:"6",width:"36",height:"36",rx:"4",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M16 18h16M16 24h12M16 30h8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function r7({className:e,...t}){return f.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:gt("size-4 animate-spin",e),...t,children:[f.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.5",opacity:"0.2"}),f.jsx("path",{d:"M14 8a6 6 0 00-6-6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function Im({className:e,...t}){return f.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:gt("size-4",e),...t,children:[f.jsx("path",{d:"M3 11.75L11.6 3.15a1.2 1.2 0 011.7 0l.55.55a1.2 1.2 0 010 1.7L5.25 14H3v-2.25z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),f.jsx("path",{d:"M9.75 5l1.25 1.25",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}const mL=new Map;function CCe(e,t){return`${t}::${e.length}::${e.slice(0,64)}`}function ICe(e,t){if(t)return _2(t)??"json";const n=e.trimStart();return n.startsWith("{")||n.startsWith("[")?"json":n.startsWith("<")?"xml":n.startsWith("---")?"yaml":"json"}function s7(e){const{code:t,lang:n,className:r}=e,[s,a]=E.useState(null),[o,i]=E.useState(!1),c=E.useRef(!0),u=ICe(t,n),l=CCe(t,u);E.useEffect(()=>(c.current=!0,()=>{c.current=!1}),[]),E.useEffect(()=>{const h=mL.get(l);if(h){a(h);return}let m=!1;return zTe(t,{lang:u}).then(p=>{m||(mL.set(l,p),c.current&&a(p))}),()=>{m=!0}},[t,l,u]);const d=E.useCallback(()=>{navigator.clipboard.writeText(t).then(()=>{i(!0),setTimeout(()=>i(!1),1500)})},[t]);return f.jsxs("div",{className:gt("group relative overflow-auto",r),children:[f.jsx(Te,{type:"button",variant:"outline",size:"icon",onClick:d,className:"absolute right-2 top-2 z-10 bg-card/90 p-1.5 text-muted-foreground/40 opacity-0 backdrop-blur-sm hover:text-foreground group-hover:opacity-100",title:"Copy to clipboard",children:o?f.jsx(t7,{className:"size-3"}):f.jsx(e7,{className:"size-3"})}),s?f.jsx("div",{className:"shiki-container text-[12px] leading-relaxed [&_pre]:!bg-transparent [&_pre]:p-3 [&_code]:font-mono",dangerouslySetInnerHTML:{__html:s}}):f.jsx("pre",{className:"p-3 font-mono text-[12px] leading-relaxed text-foreground/60",children:t})]})}function hs(e){return f.jsxs("section",{className:gt("overflow-hidden rounded-lg border border-border bg-card/60",e.compact&&"min-h-48"),children:[f.jsx("div",{className:"border-b border-border px-3 py-2 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/70",children:e.title}),e.body?f.jsx(s7,{code:e.body,lang:e.lang,className:"max-h-[32rem]"}):f.jsx("div",{className:"flex items-center justify-center p-6 text-[13px] text-muted-foreground/40",children:e.empty})]})}function bd(e){return e.loadable.status==="loading"?f.jsx("div",{className:"flex h-full min-h-48 items-center justify-center",children:f.jsxs("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[f.jsx(r7,{}),f.jsx("span",{children:e.loading??"Loading..."})]})}):e.loadable.status==="error"?f.jsx("div",{className:"flex h-full min-h-48 items-center justify-center",children:f.jsx("div",{className:"rounded-lg border border-destructive/25 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:e.loadable.error.message})}):f.jsx(f.Fragment,{children:e.children(e.loadable.data)})}function a7(e){return f.jsx("div",{className:`flex h-full items-center justify-center ${e.className??""}`,children:f.jsxs("div",{className:"text-center",children:[f.jsx(TCe,{className:"mx-auto mb-3 text-muted-foreground/20"}),f.jsx("p",{className:"text-[13px] text-muted-foreground/60",children:e.title}),e.description&&f.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground/40",children:e.description})]})})}const hk=(function(e){if(e==null)return PCe;if(typeof e=="function")return mk(e);if(typeof e=="object")return Array.isArray(e)?ACe(e):NCe(e);if(typeof e=="string")return RCe(e);throw new Error("Expected function, string, or object as test")});function ACe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=hk(e[n]);return mk(r);function r(...s){let a=-1;for(;++a<t.length;)if(t[a].apply(this,s))return!0;return!1}}function NCe(e){const t=e;return mk(n);function n(r){const s=r;let a;for(a in e)if(s[a]!==t[a])return!1;return!0}}function RCe(e){return mk(t);function t(n){return n&&n.type===e}}function mk(e){return t;function t(n,r,s){return!!(OCe(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function PCe(){return!0}function OCe(e){return e!==null&&typeof e=="object"&&"type"in e}const o7=[],eh=!0,dE=!1,wl="skip";function R2(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const a=hk(s),o=r?-1:1;i(e,void 0,[])();function i(c,u,l){const d=c&&typeof c=="object"?c:{};if(typeof d.type=="string"){const m=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(c.type+(m?"<"+m+">":""))+")"})}return h;function h(){let m=o7,p,y,g;if((!t||a(c,u,l[l.length-1]||void 0))&&(m=LCe(n(c,l)),m[0]===dE))return m;if("children"in c&&c.children){const b=c;if(b.children&&m[0]!==wl)for(y=(r?b.children.length:-1)+o,g=l.concat(b);y>-1&&y<b.children.length;){const x=b.children[y];if(p=i(x,y,g)(),p[0]===dE)return p;y=typeof p[1]=="number"?p[1]:y+o}}return m}}}function LCe(e){return Array.isArray(e)?e:typeof e=="number"?[eh,e]:e==null?o7:[e]}function Za(e,t,n,r){let s,a,o;typeof t=="function"&&typeof n!="function"?(a=void 0,o=t,s=n):(a=t,o=n,s=r),R2(e,a,i,s);function i(c,u){const l=u[u.length-1],d=l?l.children.indexOf(c):void 0;return o(c,d,l)}}const yd={indicator:"indicator",textOnly:"text-only",remove:"remove"};function $Ce({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:s=[],blockedImageClass:a="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:o="text-gray-500",linkBlockPolicy:i=yd.indicator,imageBlockPolicy:c=yd.indicator}){const u=t.length&&!t.every(d=>d==="*"),l=n.length&&!n.every(d=>d==="*");if(!e&&(u||l))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return d=>{const h=UCe(e,t,n,r,s,a,o,i,c);i7(d),Za(d,h)}}function pL(e,t){if(typeof e!="string")return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))try{return new URL(e,"http://example.com")}catch{return null}return null}}function jCe(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}const MCe=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),DCe=new Set(["javascript:","data:","file:","vbscript:"]);function gL(e,t,n,r=!1,s=!1,a=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!s)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return s&&r&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){const l=e.substring(5);if(l&&l.length>0&&l!=="invalid")return e}}catch{return null}return null}const o=pL(e,n);if(!o||DCe.has(o.protocol)||!(MCe.has(o.protocol)||a.includes(o.protocol)||a.includes("*")))return null;if(o.protocol==="mailto:"||!o.protocol.match(/^https?:$/))return o.href;const c=jCe(e);return o&&t.some(u=>{const l=pL(u,n);return!l||l.origin!==o.origin?!1:o.href.startsWith(l.href)})?c?o.pathname+o.search+o.hash:o.href:t.includes("*")?o.protocol!=="https:"&&o.protocol!=="http:"?null:c?o.pathname+o.search+o.hash:o.href:null}function i7(e){if("children"in e&&Array.isArray(e.children)){e.children=e.children.filter(t=>t!=null);for(const t of e.children)i7(t)}}const gS=Symbol("node-seen");function FCe(e,t,n){return t===yd.remove?{type:"remove"}:t===yd.textOnly?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[...e.children]}}:{type:"replace",element:{type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(e.properties.href),class:n},children:[...e.children,{type:"text",value:" [blocked]"}]}}}function BCe(e,t,n){if(t===yd.remove)return{type:"remove"};if(t===yd.textOnly){const r=String(e.properties.alt||"");return r?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[{type:"text",value:r}]}}:{type:"remove"}}return{type:"replace",element:{type:"element",tagName:"span",properties:{class:n},children:[{type:"text",value:"[Image blocked: "+String(e.properties.alt||"No description")+"]"}]}}}const UCe=(e,t,n,r,s,a,o,i,c)=>{const u=(l,d,h)=>{if(l.type!=="element"||l[gS])return eh;if(l.tagName==="a"){const m=gL(l.properties.href,t,e,!1,!1,s);if(m===null){if(l[gS]=!0,Za(l,u),h&&typeof d=="number"){const p=FCe(l,i,o);if(p.type==="remove")return h.children.splice(d,1),[wl,d];h.children[d]=p.element}return wl}else return l.properties.href=m,l.properties.target="_blank",l.properties.rel="noopener noreferrer",eh}if(l.tagName==="img"){const m=gL(l.properties.src,n,e,r,!0,s);if(m===null){if(l[gS]=!0,Za(l,u),h&&typeof d=="number"){const p=BCe(l,c,a);if(p.type==="remove")return h.children.splice(d,1),[wl,d];h.children[d]=p.element}return wl}else return l.properties.src=m,eh}return eh};return u},c7=-1,pk=0,Rh=1,V0=2,P2=3,O2=4,L2=5,$2=6,u7=7,l7=8,bL=typeof self=="object"?self:globalThis,zCe=(e,t)=>{const n=(s,a)=>(e.set(a,s),s),r=s=>{if(e.has(s))return e.get(s);const[a,o]=t[s];switch(a){case pk:case c7:return n(o,s);case Rh:{const i=n([],s);for(const c of o)i.push(r(c));return i}case V0:{const i=n({},s);for(const[c,u]of o)i[r(c)]=r(u);return i}case P2:return n(new Date(o),s);case O2:{const{source:i,flags:c}=o;return n(new RegExp(i,c),s)}case L2:{const i=n(new Map,s);for(const[c,u]of o)i.set(r(c),r(u));return i}case $2:{const i=n(new Set,s);for(const c of o)i.add(r(c));return i}case u7:{const{name:i,message:c}=o;return n(new bL[i](c),s)}case l7:return n(BigInt(o),s);case"BigInt":return n(Object(BigInt(o)),s);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:i}=new Uint8Array(o);return n(new DataView(i),o)}}return n(new bL[a](o),s)};return r},yL=e=>zCe(new Map,e)(0),tl="",{toString:HCe}={},{keys:qCe}=Object,Pf=e=>{const t=typeof e;if(t!=="object"||!e)return[pk,t];const n=HCe.call(e).slice(8,-1);switch(n){case"Array":return[Rh,tl];case"Object":return[V0,tl];case"Date":return[P2,tl];case"RegExp":return[O2,tl];case"Map":return[L2,tl];case"Set":return[$2,tl];case"DataView":return[Rh,n]}return n.includes("Array")?[Rh,n]:n.includes("Error")?[u7,n]:[V0,n]},ib=([e,t])=>e===pk&&(t==="function"||t==="symbol"),VCe=(e,t,n,r)=>{const s=(o,i)=>{const c=r.push(o)-1;return n.set(i,c),c},a=o=>{if(n.has(o))return n.get(o);let[i,c]=Pf(o);switch(i){case pk:{let l=o;switch(c){case"bigint":i=l7,l=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);l=null;break;case"undefined":return s([c7],o)}return s([i,l],o)}case Rh:{if(c){let h=o;return c==="DataView"?h=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(o)),s([c,[...h]],o)}const l=[],d=s([i,l],o);for(const h of o)l.push(a(h));return d}case V0:{if(c)switch(c){case"BigInt":return s([c,o.toString()],o);case"Boolean":case"Number":case"String":return s([c,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const l=[],d=s([i,l],o);for(const h of qCe(o))(e||!ib(Pf(o[h])))&&l.push([a(h),a(o[h])]);return d}case P2:return s([i,o.toISOString()],o);case O2:{const{source:l,flags:d}=o;return s([i,{source:l,flags:d}],o)}case L2:{const l=[],d=s([i,l],o);for(const[h,m]of o)(e||!(ib(Pf(h))||ib(Pf(m))))&&l.push([a(h),a(m)]);return d}case $2:{const l=[],d=s([i,l],o);for(const h of o)(e||!ib(Pf(h)))&&l.push(a(h));return d}}const{message:u}=o;return s([i,{name:c,message:u}],o)};return a},xL=(e,{json:t,lossy:n}={})=>{const r=[];return VCe(!(t||n),!!t,new Map,r)(e),r},xu=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?yL(xL(e,t)):structuredClone(e):(e,t)=>yL(xL(e,t));const kL=/[#.]/g;function GCe(e,t){const n=e||"",r={};let s=0,a,o;for(;s<n.length;){kL.lastIndex=s;const i=kL.exec(n),c=n.slice(s,i?i.index:n.length);c&&(a?a==="#"?r.id=c:Array.isArray(r.className)?r.className.push(c):r.className=[c]:o=c,s+=c.length),i&&(a=i[0],s++)}return{type:"element",tagName:o||t||"div",properties:r,children:[]}}function d7(e,t,n){const r=n?JCe(n):void 0;function s(a,o,...i){let c;if(a==null){c={type:"root",children:[]};const u=o;i.unshift(u)}else{c=GCe(a,t);const u=c.tagName.toLowerCase(),l=r?r.get(u):void 0;if(c.tagName=l||u,KCe(o))i.unshift(o);else for(const[d,h]of Object.entries(o))WCe(e,c.properties,d,h)}for(const u of i)fE(c.children,u);return c.type==="element"&&c.tagName==="template"&&(c.content={type:"root",children:c.children},c.children=[]),c}return s}function KCe(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const s=t[r];if(s&&typeof s=="object"){if(!Array.isArray(s))return!0;const a=s;for(const o of a)if(typeof o!="number"&&typeof o!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function WCe(e,t,n,r){const s=Ap(e,n);let a;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;a=r}else typeof r=="boolean"?a=r:typeof r=="string"?s.spaceSeparated?a=j3(r):s.commaSeparated?a=$3(r):s.commaOrSpaceSeparated?a=j3($3(r).join(" ")):a=vL(s,s.property,r):Array.isArray(r)?a=[...r]:a=s.property==="style"?YCe(r):String(r);if(Array.isArray(a)){const o=[];for(const i of a)o.push(vL(s,s.property,i));a=o}s.property==="className"&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[s.property]=a}}function fE(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)fE(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?fE(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function vL(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Em(n)===Em(t)))return!0}return n}function YCe(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function JCe(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const QCe=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],XCe=d7(Yd,"div"),ZCe=d7(ao,"g",QCe);function eIe(e){const t=String(e),n=[];return{toOffset:s,toPoint:r};function r(a){if(typeof a=="number"&&a>-1&&a<=t.length){let o=0;for(;;){let i=n[o];if(i===void 0){const c=SL(t,n[o-1]);i=c===-1?t.length+1:c+1,n[o]=i}if(i>a)return{line:o+1,column:a-(o>0?n[o-1]:0)+1,offset:a};o++}}}function s(a){if(a&&typeof a.line=="number"&&typeof a.column=="number"&&!Number.isNaN(a.line)&&!Number.isNaN(a.column)){for(;n.length<a.line;){const i=n[n.length-1],c=SL(t,i),u=c===-1?t.length+1:c+1;if(i===u)break;n.push(u)}const o=(a.line>1?n[a.line-2]:0)+a.column-1;if(o<n[a.line-1])return o}}}function SL(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
187
|
-
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const Fc={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},f7={}.hasOwnProperty,tIe=Object.prototype;function nIe(e,t){const n=t||{};return j2({file:n.file||void 0,location:!1,schema:n.space==="svg"?ao:Yd,verbose:n.verbose||!1},e)}function j2(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},ay(e,r,n),n}case"#document":case"#document-fragment":{const r=t,s="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:h7(e,t.childNodes),data:{quirksMode:s}},e.file&&e.location){const a=String(e.file),o=eIe(a),i=o.toPoint(0),c=o.toPoint(a.length);n.position={start:i,end:c}}return n}case"#documentType":{const r=t;return n={type:"doctype"},ay(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},ay(e,r,n),n}default:return n=rIe(e,t),n}}function h7(e,t){let n=-1;const r=[];for(;++n<t.length;){const s=j2(e,t[n]);r.push(s)}return r}function rIe(e,t){const n=e.schema;e.schema=t.namespaceURI===Fc.svg?ao:Yd;let r=-1;const s={};for(;++r<t.attrs.length;){const i=t.attrs[r],c=(i.prefix?i.prefix+":":"")+i.name;f7.call(tIe,c)||(s[c]=i.value)}const o=(e.schema.space==="svg"?ZCe:XCe)(t.tagName,s,h7(e,t.childNodes));if(ay(e,t,o),o.tagName==="template"){const i=t,c=i.sourceCodeLocation,u=c&&c.startTag&&_l(c.startTag),l=c&&c.endTag&&_l(c.endTag),d=j2(e,i.content);u&&l&&e.file&&(d.position={start:u.end,end:l.start}),o.content=d}return e.schema=n,o}function ay(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=sIe(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function sIe(e,t,n){const r=_l(n);if(t.type==="element"){const s=t.children[t.children.length-1];if(r&&!n.endTag&&s&&s.position&&s.position.end&&(r.end=Object.assign({},s.position.end)),e.verbose){const a={};let o;if(n.attrs)for(o in n.attrs)f7.call(n.attrs,o)&&(a[Ap(e.schema,o).property]=_l(n.attrs[o]));n.startTag;const i=_l(n.startTag),c=n.endTag?_l(n.endTag):void 0,u={opening:i};c&&(u.closing=c),u.properties=a,t.data={position:u}}}return r}function _l(e){const t=wL({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=wL({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function wL(e){return e.line&&e.column?e:void 0}const aIe={},oIe={}.hasOwnProperty,m7=m2("type",{handlers:{root:cIe,element:hIe,text:dIe,comment:fIe,doctype:lIe}});function iIe(e,t){const r=(t||aIe).space;return m7(e,r==="svg"?ao:Yd)}function cIe(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=M2(e.children,n,t),ef(e,n),n}function uIe(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=M2(e.children,n,t),ef(e,n),n}function lIe(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return ef(e,t),t}function dIe(e){const t={nodeName:"#text",value:e.value,parentNode:null};return ef(e,t),t}function fIe(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return ef(e,t),t}function hIe(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=ao);const s=[];let a;if(e.properties){for(a in e.properties)if(a!=="children"&&oIe.call(e.properties,a)){const c=mIe(r,a,e.properties[a]);c&&s.push(c)}}const o=r.space,i={nodeName:e.tagName,tagName:e.tagName,attrs:s,namespaceURI:Fc[o],childNodes:[],parentNode:null};return i.childNodes=M2(e.children,i,r),ef(e,i),e.tagName==="template"&&e.content&&(i.content=uIe(e.content,r)),i}function mIe(e,t,n){const r=Ap(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?p2(n):g2(n));const s={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const a=s.name.indexOf(":");a<0?s.prefix="":(s.name=s.name.slice(a+1),s.prefix=r.attribute.slice(0,a)),s.namespace=Fc[r.space]}return s}function M2(e,t,n){let r=-1;const s=[];if(e)for(;++r<e.length;){const a=m7(e[r],n);a.parentNode=t,s.push(a)}return s}function ef(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const pIe=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Jt="�";var $;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})($||($={}));const qr={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function p7(e){return e>=55296&&e<=57343}function gIe(e){return e>=56320&&e<=57343}function bIe(e,t){return(e-55296)*1024+9216+t}function g7(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function b7(e){return e>=64976&&e<=65007||pIe.has(e)}var se;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(se||(se={}));const yIe=65536;class xIe{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=yIe,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:s,offset:a}=this,o=s+n,i=a+n;return{code:t,startLine:r,endLine:r,startCol:o,endCol:o,startOffset:i,endOffset:i}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(gIe(n))return this.pos++,this._addGap(),bIe(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,$.EOF;return this._err(se.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,$.EOF;const r=this.html.charCodeAt(n);return r===$.CARRIAGE_RETURN?$.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,$.EOF;let t=this.html.charCodeAt(this.pos);return t===$.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,$.LINE_FEED):t===$.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,p7(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===$.LINE_FEED||t===$.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){g7(t)?this._err(se.controlCharacterInInputStream):b7(t)&&this._err(se.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var dt;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(dt||(dt={}));function y7(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const kIe=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),vIe=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function SIe(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=vIe.get(e))!==null&&t!==void 0?t:e}var Yn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Yn||(Yn={}));const wIe=32;var bi;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(bi||(bi={}));function hE(e){return e>=Yn.ZERO&&e<=Yn.NINE}function _Ie(e){return e>=Yn.UPPER_A&&e<=Yn.UPPER_F||e>=Yn.LOWER_A&&e<=Yn.LOWER_F}function EIe(e){return e>=Yn.UPPER_A&&e<=Yn.UPPER_Z||e>=Yn.LOWER_A&&e<=Yn.LOWER_Z||hE(e)}function TIe(e){return e===Yn.EQUALS||EIe(e)}var Vn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Vn||(Vn={}));var To;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(To||(To={}));class CIe{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Vn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=To.Strict}startEntity(t){this.decodeMode=t,this.state=Vn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Vn.EntityStart:return t.charCodeAt(n)===Yn.NUM?(this.state=Vn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Vn.NamedEntity,this.stateNamedEntity(t,n));case Vn.NumericStart:return this.stateNumericStart(t,n);case Vn.NumericDecimal:return this.stateNumericDecimal(t,n);case Vn.NumericHex:return this.stateNumericHex(t,n);case Vn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|wIe)===Yn.LOWER_X?(this.state=Vn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Vn.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,s){if(n!==r){const a=r-n;this.result=this.result*Math.pow(s,a)+Number.parseInt(t.substr(n,a),s),this.consumed+=a}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const s=t.charCodeAt(n);if(hE(s)||_Ie(s))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const s=t.charCodeAt(n);if(hE(s))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Yn.SEMI)this.consumed+=1;else if(this.decodeMode===To.Strict)return 0;return this.emitCodePoint(SIe(this.result),this.consumed),this.errors&&(t!==Yn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let s=r[this.treeIndex],a=(s&bi.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const o=t.charCodeAt(n);if(this.treeIndex=IIe(r,s,this.treeIndex+Math.max(1,a),o),this.treeIndex<0)return this.result===0||this.decodeMode===To.Attribute&&(a===0||TIe(o))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],a=(s&bi.VALUE_LENGTH)>>14,a!==0){if(o===Yn.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==To.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,s=(r[n]&bi.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[t]&~bi.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case Vn.NamedEntity:return this.result!==0&&(this.decodeMode!==To.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Vn.NumericDecimal:return this.emitNumericEntity(0,2);case Vn.NumericHex:return this.emitNumericEntity(0,3);case Vn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Vn.EntityStart:return 0}}}function IIe(e,t,n,r){const s=(t&bi.BRANCH_LENGTH)>>7,a=t&bi.JUMP_TABLE;if(s===0)return a!==0&&r===a?n:-1;if(a){const c=r-a;return c<0||c>=s?-1:e[n+c]-1}let o=n,i=o+s-1;for(;o<=i;){const c=o+i>>>1,u=e[c];if(u<r)o=c+1;else if(u>r)i=c-1;else return e[c+s]}return-1}var de;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(de||(de={}));var Zc;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Zc||(Zc={}));var $s;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})($s||($s={}));var Z;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(Z||(Z={}));var v;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(v||(v={}));const AIe=new Map([[Z.A,v.A],[Z.ADDRESS,v.ADDRESS],[Z.ANNOTATION_XML,v.ANNOTATION_XML],[Z.APPLET,v.APPLET],[Z.AREA,v.AREA],[Z.ARTICLE,v.ARTICLE],[Z.ASIDE,v.ASIDE],[Z.B,v.B],[Z.BASE,v.BASE],[Z.BASEFONT,v.BASEFONT],[Z.BGSOUND,v.BGSOUND],[Z.BIG,v.BIG],[Z.BLOCKQUOTE,v.BLOCKQUOTE],[Z.BODY,v.BODY],[Z.BR,v.BR],[Z.BUTTON,v.BUTTON],[Z.CAPTION,v.CAPTION],[Z.CENTER,v.CENTER],[Z.CODE,v.CODE],[Z.COL,v.COL],[Z.COLGROUP,v.COLGROUP],[Z.DD,v.DD],[Z.DESC,v.DESC],[Z.DETAILS,v.DETAILS],[Z.DIALOG,v.DIALOG],[Z.DIR,v.DIR],[Z.DIV,v.DIV],[Z.DL,v.DL],[Z.DT,v.DT],[Z.EM,v.EM],[Z.EMBED,v.EMBED],[Z.FIELDSET,v.FIELDSET],[Z.FIGCAPTION,v.FIGCAPTION],[Z.FIGURE,v.FIGURE],[Z.FONT,v.FONT],[Z.FOOTER,v.FOOTER],[Z.FOREIGN_OBJECT,v.FOREIGN_OBJECT],[Z.FORM,v.FORM],[Z.FRAME,v.FRAME],[Z.FRAMESET,v.FRAMESET],[Z.H1,v.H1],[Z.H2,v.H2],[Z.H3,v.H3],[Z.H4,v.H4],[Z.H5,v.H5],[Z.H6,v.H6],[Z.HEAD,v.HEAD],[Z.HEADER,v.HEADER],[Z.HGROUP,v.HGROUP],[Z.HR,v.HR],[Z.HTML,v.HTML],[Z.I,v.I],[Z.IMG,v.IMG],[Z.IMAGE,v.IMAGE],[Z.INPUT,v.INPUT],[Z.IFRAME,v.IFRAME],[Z.KEYGEN,v.KEYGEN],[Z.LABEL,v.LABEL],[Z.LI,v.LI],[Z.LINK,v.LINK],[Z.LISTING,v.LISTING],[Z.MAIN,v.MAIN],[Z.MALIGNMARK,v.MALIGNMARK],[Z.MARQUEE,v.MARQUEE],[Z.MATH,v.MATH],[Z.MENU,v.MENU],[Z.META,v.META],[Z.MGLYPH,v.MGLYPH],[Z.MI,v.MI],[Z.MO,v.MO],[Z.MN,v.MN],[Z.MS,v.MS],[Z.MTEXT,v.MTEXT],[Z.NAV,v.NAV],[Z.NOBR,v.NOBR],[Z.NOFRAMES,v.NOFRAMES],[Z.NOEMBED,v.NOEMBED],[Z.NOSCRIPT,v.NOSCRIPT],[Z.OBJECT,v.OBJECT],[Z.OL,v.OL],[Z.OPTGROUP,v.OPTGROUP],[Z.OPTION,v.OPTION],[Z.P,v.P],[Z.PARAM,v.PARAM],[Z.PLAINTEXT,v.PLAINTEXT],[Z.PRE,v.PRE],[Z.RB,v.RB],[Z.RP,v.RP],[Z.RT,v.RT],[Z.RTC,v.RTC],[Z.RUBY,v.RUBY],[Z.S,v.S],[Z.SCRIPT,v.SCRIPT],[Z.SEARCH,v.SEARCH],[Z.SECTION,v.SECTION],[Z.SELECT,v.SELECT],[Z.SOURCE,v.SOURCE],[Z.SMALL,v.SMALL],[Z.SPAN,v.SPAN],[Z.STRIKE,v.STRIKE],[Z.STRONG,v.STRONG],[Z.STYLE,v.STYLE],[Z.SUB,v.SUB],[Z.SUMMARY,v.SUMMARY],[Z.SUP,v.SUP],[Z.TABLE,v.TABLE],[Z.TBODY,v.TBODY],[Z.TEMPLATE,v.TEMPLATE],[Z.TEXTAREA,v.TEXTAREA],[Z.TFOOT,v.TFOOT],[Z.TD,v.TD],[Z.TH,v.TH],[Z.THEAD,v.THEAD],[Z.TITLE,v.TITLE],[Z.TR,v.TR],[Z.TRACK,v.TRACK],[Z.TT,v.TT],[Z.U,v.U],[Z.UL,v.UL],[Z.SVG,v.SVG],[Z.VAR,v.VAR],[Z.WBR,v.WBR],[Z.XMP,v.XMP]]);function tf(e){var t;return(t=AIe.get(e))!==null&&t!==void 0?t:v.UNKNOWN}const me=v,NIe={[de.HTML]:new Set([me.ADDRESS,me.APPLET,me.AREA,me.ARTICLE,me.ASIDE,me.BASE,me.BASEFONT,me.BGSOUND,me.BLOCKQUOTE,me.BODY,me.BR,me.BUTTON,me.CAPTION,me.CENTER,me.COL,me.COLGROUP,me.DD,me.DETAILS,me.DIR,me.DIV,me.DL,me.DT,me.EMBED,me.FIELDSET,me.FIGCAPTION,me.FIGURE,me.FOOTER,me.FORM,me.FRAME,me.FRAMESET,me.H1,me.H2,me.H3,me.H4,me.H5,me.H6,me.HEAD,me.HEADER,me.HGROUP,me.HR,me.HTML,me.IFRAME,me.IMG,me.INPUT,me.LI,me.LINK,me.LISTING,me.MAIN,me.MARQUEE,me.MENU,me.META,me.NAV,me.NOEMBED,me.NOFRAMES,me.NOSCRIPT,me.OBJECT,me.OL,me.P,me.PARAM,me.PLAINTEXT,me.PRE,me.SCRIPT,me.SECTION,me.SELECT,me.SOURCE,me.STYLE,me.SUMMARY,me.TABLE,me.TBODY,me.TD,me.TEMPLATE,me.TEXTAREA,me.TFOOT,me.TH,me.THEAD,me.TITLE,me.TR,me.TRACK,me.UL,me.WBR,me.XMP]),[de.MATHML]:new Set([me.MI,me.MO,me.MN,me.MS,me.MTEXT,me.ANNOTATION_XML]),[de.SVG]:new Set([me.TITLE,me.FOREIGN_OBJECT,me.DESC]),[de.XLINK]:new Set,[de.XML]:new Set,[de.XMLNS]:new Set},mE=new Set([me.H1,me.H2,me.H3,me.H4,me.H5,me.H6]);Z.STYLE,Z.SCRIPT,Z.XMP,Z.IFRAME,Z.NOEMBED,Z.NOFRAMES,Z.PLAINTEXT;var M;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(M||(M={}));const bn={DATA:M.DATA,RCDATA:M.RCDATA,RAWTEXT:M.RAWTEXT,SCRIPT_DATA:M.SCRIPT_DATA,PLAINTEXT:M.PLAINTEXT,CDATA_SECTION:M.CDATA_SECTION};function RIe(e){return e>=$.DIGIT_0&&e<=$.DIGIT_9}function th(e){return e>=$.LATIN_CAPITAL_A&&e<=$.LATIN_CAPITAL_Z}function PIe(e){return e>=$.LATIN_SMALL_A&&e<=$.LATIN_SMALL_Z}function ai(e){return PIe(e)||th(e)}function _L(e){return ai(e)||RIe(e)}function cb(e){return e+32}function x7(e){return e===$.SPACE||e===$.LINE_FEED||e===$.TABULATION||e===$.FORM_FEED}function EL(e){return x7(e)||e===$.SOLIDUS||e===$.GREATER_THAN_SIGN}function OIe(e){return e===$.NULL?se.nullCharacterReference:e>1114111?se.characterReferenceOutsideUnicodeRange:p7(e)?se.surrogateCharacterReference:b7(e)?se.noncharacterCharacterReference:g7(e)||e===$.CARRIAGE_RETURN?se.controlCharacterReference:null}class LIe{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=M.DATA,this.returnState=M.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new xIe(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new CIe(kIe,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(se.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(se.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=OIe(r);s&&this._err(s,1)}}:void 0)}_err(t,n=0){var r,s;(s=(r=this.handler).onParseError)===null||s===void 0||s.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t?.())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r?.()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:dt.START_TAG,tagName:"",tagID:v.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:dt.END_TAG,tagName:"",tagID:v.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:dt.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:dt.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(y7(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const s=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(se.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=tf(t.tagName),t.type===dt.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(se.endTagWithAttributes),t.selfClosing&&this._err(se.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case dt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case dt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case dt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:dt.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=x7(t)?dt.WHITESPACE_CHARACTER:t===$.NULL?dt.NULL_CHARACTER:dt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(dt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=M.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?To.Attribute:To.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===M.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===M.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===M.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case M.DATA:{this._stateData(t);break}case M.RCDATA:{this._stateRcdata(t);break}case M.RAWTEXT:{this._stateRawtext(t);break}case M.SCRIPT_DATA:{this._stateScriptData(t);break}case M.PLAINTEXT:{this._statePlaintext(t);break}case M.TAG_OPEN:{this._stateTagOpen(t);break}case M.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case M.TAG_NAME:{this._stateTagName(t);break}case M.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case M.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case M.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case M.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case M.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case M.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case M.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case M.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case M.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case M.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case M.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case M.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case M.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case M.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case M.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case M.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case M.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case M.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case M.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case M.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case M.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case M.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case M.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case M.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case M.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case M.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case M.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case M.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case M.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case M.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case M.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case M.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case M.BOGUS_COMMENT:{this._stateBogusComment(t);break}case M.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case M.COMMENT_START:{this._stateCommentStart(t);break}case M.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case M.COMMENT:{this._stateComment(t);break}case M.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case M.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case M.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case M.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case M.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case M.COMMENT_END:{this._stateCommentEnd(t);break}case M.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case M.DOCTYPE:{this._stateDoctype(t);break}case M.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case M.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case M.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case M.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case M.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case M.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case M.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case M.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case M.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case M.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case M.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case M.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case M.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case M.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case M.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case M.CDATA_SECTION:{this._stateCdataSection(t);break}case M.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case M.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case M.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case M.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case $.LESS_THAN_SIGN:{this.state=M.TAG_OPEN;break}case $.AMPERSAND:{this._startCharacterReference();break}case $.NULL:{this._err(se.unexpectedNullCharacter),this._emitCodePoint(t);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case $.AMPERSAND:{this._startCharacterReference();break}case $.LESS_THAN_SIGN:{this.state=M.RCDATA_LESS_THAN_SIGN;break}case $.NULL:{this._err(se.unexpectedNullCharacter),this._emitChars(Jt);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case $.LESS_THAN_SIGN:{this.state=M.RAWTEXT_LESS_THAN_SIGN;break}case $.NULL:{this._err(se.unexpectedNullCharacter),this._emitChars(Jt);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case $.LESS_THAN_SIGN:{this.state=M.SCRIPT_DATA_LESS_THAN_SIGN;break}case $.NULL:{this._err(se.unexpectedNullCharacter),this._emitChars(Jt);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case $.NULL:{this._err(se.unexpectedNullCharacter),this._emitChars(Jt);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(ai(t))this._createStartTagToken(),this.state=M.TAG_NAME,this._stateTagName(t);else switch(t){case $.EXCLAMATION_MARK:{this.state=M.MARKUP_DECLARATION_OPEN;break}case $.SOLIDUS:{this.state=M.END_TAG_OPEN;break}case $.QUESTION_MARK:{this._err(se.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=M.BOGUS_COMMENT,this._stateBogusComment(t);break}case $.EOF:{this._err(se.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(se.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=M.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(ai(t))this._createEndTagToken(),this.state=M.TAG_NAME,this._stateTagName(t);else switch(t){case $.GREATER_THAN_SIGN:{this._err(se.missingEndTagName),this.state=M.DATA;break}case $.EOF:{this._err(se.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(se.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=M.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this.state=M.BEFORE_ATTRIBUTE_NAME;break}case $.SOLIDUS:{this.state=M.SELF_CLOSING_START_TAG;break}case $.GREATER_THAN_SIGN:{this.state=M.DATA,this.emitCurrentTagToken();break}case $.NULL:{this._err(se.unexpectedNullCharacter),n.tagName+=Jt;break}case $.EOF:{this._err(se.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(th(t)?cb(t):t)}}_stateRcdataLessThanSign(t){t===$.SOLIDUS?this.state=M.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=M.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){ai(t)?(this.state=M.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=M.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=M.BEFORE_ATTRIBUTE_NAME,!1;case $.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=M.SELF_CLOSING_START_TAG,!1;case $.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=M.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=M.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===$.SOLIDUS?this.state=M.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=M.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){ai(t)?(this.state=M.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=M.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=M.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case $.SOLIDUS:{this.state=M.SCRIPT_DATA_END_TAG_OPEN;break}case $.EXCLAMATION_MARK:{this.state=M.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=M.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){ai(t)?(this.state=M.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=M.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=M.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===$.HYPHEN_MINUS?(this.state=M.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=M.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===$.HYPHEN_MINUS?(this.state=M.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=M.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case $.HYPHEN_MINUS:{this.state=M.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case $.LESS_THAN_SIGN:{this.state=M.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case $.NULL:{this._err(se.unexpectedNullCharacter),this._emitChars(Jt);break}case $.EOF:{this._err(se.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case $.HYPHEN_MINUS:{this.state=M.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case $.LESS_THAN_SIGN:{this.state=M.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case $.NULL:{this._err(se.unexpectedNullCharacter),this.state=M.SCRIPT_DATA_ESCAPED,this._emitChars(Jt);break}case $.EOF:{this._err(se.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=M.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case $.HYPHEN_MINUS:{this._emitChars("-");break}case $.LESS_THAN_SIGN:{this.state=M.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case $.GREATER_THAN_SIGN:{this.state=M.SCRIPT_DATA,this._emitChars(">");break}case $.NULL:{this._err(se.unexpectedNullCharacter),this.state=M.SCRIPT_DATA_ESCAPED,this._emitChars(Jt);break}case $.EOF:{this._err(se.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=M.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===$.SOLIDUS?this.state=M.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:ai(t)?(this._emitChars("<"),this.state=M.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=M.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){ai(t)?(this.state=M.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=M.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=M.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(qr.SCRIPT,!1)&&EL(this.preprocessor.peek(qr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<qr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=M.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=M.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case $.HYPHEN_MINUS:{this.state=M.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case $.LESS_THAN_SIGN:{this.state=M.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case $.NULL:{this._err(se.unexpectedNullCharacter),this._emitChars(Jt);break}case $.EOF:{this._err(se.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case $.HYPHEN_MINUS:{this.state=M.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case $.LESS_THAN_SIGN:{this.state=M.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case $.NULL:{this._err(se.unexpectedNullCharacter),this.state=M.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Jt);break}case $.EOF:{this._err(se.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=M.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case $.HYPHEN_MINUS:{this._emitChars("-");break}case $.LESS_THAN_SIGN:{this.state=M.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case $.GREATER_THAN_SIGN:{this.state=M.SCRIPT_DATA,this._emitChars(">");break}case $.NULL:{this._err(se.unexpectedNullCharacter),this.state=M.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Jt);break}case $.EOF:{this._err(se.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=M.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===$.SOLIDUS?(this.state=M.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=M.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(qr.SCRIPT,!1)&&EL(this.preprocessor.peek(qr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<qr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=M.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=M.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.SOLIDUS:case $.GREATER_THAN_SIGN:case $.EOF:{this.state=M.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case $.EQUALS_SIGN:{this._err(se.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=M.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=M.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:case $.SOLIDUS:case $.GREATER_THAN_SIGN:case $.EOF:{this._leaveAttrName(),this.state=M.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case $.EQUALS_SIGN:{this._leaveAttrName(),this.state=M.BEFORE_ATTRIBUTE_VALUE;break}case $.QUOTATION_MARK:case $.APOSTROPHE:case $.LESS_THAN_SIGN:{this._err(se.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case $.NULL:{this._err(se.unexpectedNullCharacter),this.currentAttr.name+=Jt;break}default:this.currentAttr.name+=String.fromCodePoint(th(t)?cb(t):t)}}_stateAfterAttributeName(t){switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.SOLIDUS:{this.state=M.SELF_CLOSING_START_TAG;break}case $.EQUALS_SIGN:{this.state=M.BEFORE_ATTRIBUTE_VALUE;break}case $.GREATER_THAN_SIGN:{this.state=M.DATA,this.emitCurrentTagToken();break}case $.EOF:{this._err(se.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=M.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.QUOTATION_MARK:{this.state=M.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case $.APOSTROPHE:{this.state=M.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case $.GREATER_THAN_SIGN:{this._err(se.missingAttributeValue),this.state=M.DATA,this.emitCurrentTagToken();break}default:this.state=M.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case $.QUOTATION_MARK:{this.state=M.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case $.AMPERSAND:{this._startCharacterReference();break}case $.NULL:{this._err(se.unexpectedNullCharacter),this.currentAttr.value+=Jt;break}case $.EOF:{this._err(se.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case $.APOSTROPHE:{this.state=M.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case $.AMPERSAND:{this._startCharacterReference();break}case $.NULL:{this._err(se.unexpectedNullCharacter),this.currentAttr.value+=Jt;break}case $.EOF:{this._err(se.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this._leaveAttrValue(),this.state=M.BEFORE_ATTRIBUTE_NAME;break}case $.AMPERSAND:{this._startCharacterReference();break}case $.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=M.DATA,this.emitCurrentTagToken();break}case $.NULL:{this._err(se.unexpectedNullCharacter),this.currentAttr.value+=Jt;break}case $.QUOTATION_MARK:case $.APOSTROPHE:case $.LESS_THAN_SIGN:case $.EQUALS_SIGN:case $.GRAVE_ACCENT:{this._err(se.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case $.EOF:{this._err(se.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this._leaveAttrValue(),this.state=M.BEFORE_ATTRIBUTE_NAME;break}case $.SOLIDUS:{this._leaveAttrValue(),this.state=M.SELF_CLOSING_START_TAG;break}case $.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=M.DATA,this.emitCurrentTagToken();break}case $.EOF:{this._err(se.eofInTag),this._emitEOFToken();break}default:this._err(se.missingWhitespaceBetweenAttributes),this.state=M.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case $.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=M.DATA,this.emitCurrentTagToken();break}case $.EOF:{this._err(se.eofInTag),this._emitEOFToken();break}default:this._err(se.unexpectedSolidusInTag),this.state=M.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case $.GREATER_THAN_SIGN:{this.state=M.DATA,this.emitCurrentComment(n);break}case $.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case $.NULL:{this._err(se.unexpectedNullCharacter),n.data+=Jt;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(qr.DASH_DASH,!0)?(this._createCommentToken(qr.DASH_DASH.length+1),this.state=M.COMMENT_START):this._consumeSequenceIfMatch(qr.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(qr.DOCTYPE.length+1),this.state=M.DOCTYPE):this._consumeSequenceIfMatch(qr.CDATA_START,!0)?this.inForeignNode?this.state=M.CDATA_SECTION:(this._err(se.cdataInHtmlContent),this._createCommentToken(qr.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=M.BOGUS_COMMENT):this._ensureHibernation()||(this._err(se.incorrectlyOpenedComment),this._createCommentToken(2),this.state=M.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case $.HYPHEN_MINUS:{this.state=M.COMMENT_START_DASH;break}case $.GREATER_THAN_SIGN:{this._err(se.abruptClosingOfEmptyComment),this.state=M.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=M.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case $.HYPHEN_MINUS:{this.state=M.COMMENT_END;break}case $.GREATER_THAN_SIGN:{this._err(se.abruptClosingOfEmptyComment),this.state=M.DATA,this.emitCurrentComment(n);break}case $.EOF:{this._err(se.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=M.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case $.HYPHEN_MINUS:{this.state=M.COMMENT_END_DASH;break}case $.LESS_THAN_SIGN:{n.data+="<",this.state=M.COMMENT_LESS_THAN_SIGN;break}case $.NULL:{this._err(se.unexpectedNullCharacter),n.data+=Jt;break}case $.EOF:{this._err(se.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case $.EXCLAMATION_MARK:{n.data+="!",this.state=M.COMMENT_LESS_THAN_SIGN_BANG;break}case $.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=M.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===$.HYPHEN_MINUS?this.state=M.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=M.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===$.HYPHEN_MINUS?this.state=M.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=M.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==$.GREATER_THAN_SIGN&&t!==$.EOF&&this._err(se.nestedComment),this.state=M.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case $.HYPHEN_MINUS:{this.state=M.COMMENT_END;break}case $.EOF:{this._err(se.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=M.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case $.GREATER_THAN_SIGN:{this.state=M.DATA,this.emitCurrentComment(n);break}case $.EXCLAMATION_MARK:{this.state=M.COMMENT_END_BANG;break}case $.HYPHEN_MINUS:{n.data+="-";break}case $.EOF:{this._err(se.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=M.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case $.HYPHEN_MINUS:{n.data+="--!",this.state=M.COMMENT_END_DASH;break}case $.GREATER_THAN_SIGN:{this._err(se.incorrectlyClosedComment),this.state=M.DATA,this.emitCurrentComment(n);break}case $.EOF:{this._err(se.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=M.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this.state=M.BEFORE_DOCTYPE_NAME;break}case $.GREATER_THAN_SIGN:{this.state=M.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case $.EOF:{this._err(se.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(se.missingWhitespaceBeforeDoctypeName),this.state=M.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(th(t))this._createDoctypeToken(String.fromCharCode(cb(t))),this.state=M.DOCTYPE_NAME;else switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.NULL:{this._err(se.unexpectedNullCharacter),this._createDoctypeToken(Jt),this.state=M.DOCTYPE_NAME;break}case $.GREATER_THAN_SIGN:{this._err(se.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=M.DATA;break}case $.EOF:{this._err(se.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=M.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this.state=M.AFTER_DOCTYPE_NAME;break}case $.GREATER_THAN_SIGN:{this.state=M.DATA,this.emitCurrentDoctype(n);break}case $.NULL:{this._err(se.unexpectedNullCharacter),n.name+=Jt;break}case $.EOF:{this._err(se.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(th(t)?cb(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.GREATER_THAN_SIGN:{this.state=M.DATA,this.emitCurrentDoctype(n);break}case $.EOF:{this._err(se.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(qr.PUBLIC,!1)?this.state=M.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(qr.SYSTEM,!1)?this.state=M.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(se.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=M.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this.state=M.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case $.QUOTATION_MARK:{this._err(se.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=M.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case $.APOSTROPHE:{this._err(se.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=M.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case $.GREATER_THAN_SIGN:{this._err(se.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=M.DATA,this.emitCurrentDoctype(n);break}case $.EOF:{this._err(se.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(se.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=M.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.QUOTATION_MARK:{n.publicId="",this.state=M.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case $.APOSTROPHE:{n.publicId="",this.state=M.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case $.GREATER_THAN_SIGN:{this._err(se.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=M.DATA,this.emitCurrentDoctype(n);break}case $.EOF:{this._err(se.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(se.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=M.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case $.QUOTATION_MARK:{this.state=M.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case $.NULL:{this._err(se.unexpectedNullCharacter),n.publicId+=Jt;break}case $.GREATER_THAN_SIGN:{this._err(se.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=M.DATA;break}case $.EOF:{this._err(se.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case $.APOSTROPHE:{this.state=M.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case $.NULL:{this._err(se.unexpectedNullCharacter),n.publicId+=Jt;break}case $.GREATER_THAN_SIGN:{this._err(se.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=M.DATA;break}case $.EOF:{this._err(se.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this.state=M.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case $.GREATER_THAN_SIGN:{this.state=M.DATA,this.emitCurrentDoctype(n);break}case $.QUOTATION_MARK:{this._err(se.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=M.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case $.APOSTROPHE:{this._err(se.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=M.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case $.EOF:{this._err(se.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(se.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=M.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=M.DATA;break}case $.QUOTATION_MARK:{n.systemId="",this.state=M.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case $.APOSTROPHE:{n.systemId="",this.state=M.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case $.EOF:{this._err(se.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(se.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=M.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this.state=M.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case $.QUOTATION_MARK:{this._err(se.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=M.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case $.APOSTROPHE:{this._err(se.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=M.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case $.GREATER_THAN_SIGN:{this._err(se.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=M.DATA,this.emitCurrentDoctype(n);break}case $.EOF:{this._err(se.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(se.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=M.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.QUOTATION_MARK:{n.systemId="",this.state=M.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case $.APOSTROPHE:{n.systemId="",this.state=M.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case $.GREATER_THAN_SIGN:{this._err(se.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=M.DATA,this.emitCurrentDoctype(n);break}case $.EOF:{this._err(se.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(se.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=M.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case $.QUOTATION_MARK:{this.state=M.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case $.NULL:{this._err(se.unexpectedNullCharacter),n.systemId+=Jt;break}case $.GREATER_THAN_SIGN:{this._err(se.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=M.DATA;break}case $.EOF:{this._err(se.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case $.APOSTROPHE:{this.state=M.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case $.NULL:{this._err(se.unexpectedNullCharacter),n.systemId+=Jt;break}case $.GREATER_THAN_SIGN:{this._err(se.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=M.DATA;break}case $.EOF:{this._err(se.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=M.DATA;break}case $.EOF:{this._err(se.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(se.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=M.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case $.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=M.DATA;break}case $.NULL:{this._err(se.unexpectedNullCharacter);break}case $.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case $.RIGHT_SQUARE_BRACKET:{this.state=M.CDATA_SECTION_BRACKET;break}case $.EOF:{this._err(se.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===$.RIGHT_SQUARE_BRACKET?this.state=M.CDATA_SECTION_END:(this._emitChars("]"),this.state=M.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case $.GREATER_THAN_SIGN:{this.state=M.DATA;break}case $.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=M.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference($.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&_L(this.preprocessor.peek(1))?M.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){_L(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===$.SEMICOLON&&this._err(se.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const k7=new Set([v.DD,v.DT,v.LI,v.OPTGROUP,v.OPTION,v.P,v.RB,v.RP,v.RT,v.RTC]),TL=new Set([...k7,v.CAPTION,v.COLGROUP,v.TBODY,v.TD,v.TFOOT,v.TH,v.THEAD,v.TR]),G0=new Set([v.APPLET,v.CAPTION,v.HTML,v.MARQUEE,v.OBJECT,v.TABLE,v.TD,v.TEMPLATE,v.TH]),$Ie=new Set([...G0,v.OL,v.UL]),jIe=new Set([...G0,v.BUTTON]),CL=new Set([v.ANNOTATION_XML,v.MI,v.MN,v.MO,v.MS,v.MTEXT]),IL=new Set([v.DESC,v.FOREIGN_OBJECT,v.TITLE]),MIe=new Set([v.TR,v.TEMPLATE,v.HTML]),DIe=new Set([v.TBODY,v.TFOOT,v.THEAD,v.TEMPLATE,v.HTML]),FIe=new Set([v.TABLE,v.TEMPLATE,v.HTML]),BIe=new Set([v.TD,v.TH]);class UIe{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=v.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===v.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===de.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const s=this._indexOf(t)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,r),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==de.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(mE,de.HTML)}popUntilTableCellPopped(){this.popUntilPopped(BIe,de.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(FIe,de.HTML)}clearBackToTableBodyContext(){this.clearBackTo(DIe,de.HTML)}clearBackToTableRowContext(){this.clearBackTo(MIe,de.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===v.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===v.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case de.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case de.SVG:{if(IL.has(s))return!1;break}case de.MATHML:{if(CL.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,G0)}hasInListItemScope(t){return this.hasInDynamicScope(t,$Ie)}hasInButtonScope(t){return this.hasInDynamicScope(t,jIe)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case de.HTML:{if(mE.has(n))return!0;if(G0.has(n))return!1;break}case de.SVG:{if(IL.has(n))return!1;break}case de.MATHML:{if(CL.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===de.HTML)switch(this.tagIDs[n]){case t:return!0;case v.TABLE:case v.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===de.HTML)switch(this.tagIDs[t]){case v.TBODY:case v.THEAD:case v.TFOOT:return!0;case v.TABLE:case v.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===de.HTML)switch(this.tagIDs[n]){case t:return!0;case v.OPTION:case v.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&k7.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&TL.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&TL.has(this.currentTagId);)this.pop()}}const bS=3;var Da;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Da||(Da={}));const AL={type:Da.Marker};class zIe{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],s=n.length,a=this.treeAdapter.getTagName(t),o=this.treeAdapter.getNamespaceURI(t);for(let i=0;i<this.entries.length;i++){const c=this.entries[i];if(c.type===Da.Marker)break;const{element:u}=c;if(this.treeAdapter.getTagName(u)===a&&this.treeAdapter.getNamespaceURI(u)===o){const l=this.treeAdapter.getAttrList(u);l.length===s&&r.push({idx:i,attrs:l})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<bS)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<bS)return;const s=new Map(n.map(o=>[o.name,o.value]));let a=0;for(let o=0;o<r.length;o++){const i=r[o];i.attrs.every(c=>s.get(c.name)===c.value)&&(a+=1,a>=bS&&this.entries.splice(i.idx,1))}}insertMarker(){this.entries.unshift(AL)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Da.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Da.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(AL);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Da.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Da.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Da.Element&&n.element===t)}}const oi={createDocument(){return{nodeName:"#document",mode:$s.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const s=e.childNodes.find(a=>a.nodeName==="#documentType");if(s)s.name=t,s.publicId=n,s.systemId=r;else{const a={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};oi.appendChild(e,a)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(oi.isTextNode(n)){n.value+=t;return}}oi.appendChild(e,oi.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&oi.isTextNode(r)?r.value+=t:oi.insertBefore(e,oi.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},v7="html",HIe="about:legacy-compat",qIe="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",S7=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],VIe=[...S7,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],GIe=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),w7=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],KIe=[...w7,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function NL(e,t){return t.some(n=>e.startsWith(n))}function WIe(e){return e.name===v7&&e.publicId===null&&(e.systemId===null||e.systemId===HIe)}function YIe(e){if(e.name!==v7)return $s.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===qIe)return $s.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),GIe.has(n))return $s.QUIRKS;let r=t===null?VIe:S7;if(NL(n,r))return $s.QUIRKS;if(r=t===null?w7:KIe,NL(n,r))return $s.LIMITED_QUIRKS}return $s.NO_QUIRKS}const RL={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},JIe="definitionurl",QIe="definitionURL",XIe=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),ZIe=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:de.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:de.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:de.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:de.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:de.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:de.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:de.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:de.XML}],["xml:space",{prefix:"xml",name:"space",namespace:de.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:de.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:de.XMLNS}]]),e2e=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),t2e=new Set([v.B,v.BIG,v.BLOCKQUOTE,v.BODY,v.BR,v.CENTER,v.CODE,v.DD,v.DIV,v.DL,v.DT,v.EM,v.EMBED,v.H1,v.H2,v.H3,v.H4,v.H5,v.H6,v.HEAD,v.HR,v.I,v.IMG,v.LI,v.LISTING,v.MENU,v.META,v.NOBR,v.OL,v.P,v.PRE,v.RUBY,v.S,v.SMALL,v.SPAN,v.STRONG,v.STRIKE,v.SUB,v.SUP,v.TABLE,v.TT,v.U,v.UL,v.VAR]);function n2e(e){const t=e.tagID;return t===v.FONT&&e.attrs.some(({name:r})=>r===Zc.COLOR||r===Zc.SIZE||r===Zc.FACE)||t2e.has(t)}function _7(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===JIe){e.attrs[t].name=QIe;break}}function E7(e){for(let t=0;t<e.attrs.length;t++){const n=XIe.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function D2(e){for(let t=0;t<e.attrs.length;t++){const n=ZIe.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function r2e(e){const t=e2e.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=tf(e.tagName))}function s2e(e,t){return t===de.MATHML&&(e===v.MI||e===v.MO||e===v.MN||e===v.MS||e===v.MTEXT)}function a2e(e,t,n){if(t===de.MATHML&&e===v.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Zc.ENCODING){const s=n[r].value.toLowerCase();return s===RL.TEXT_HTML||s===RL.APPLICATION_XML}}return t===de.SVG&&(e===v.FOREIGN_OBJECT||e===v.DESC||e===v.TITLE)}function o2e(e,t,n,r){return(!r||r===de.HTML)&&a2e(e,t,n)||(!r||r===de.MATHML)&&s2e(e,t)}const i2e="hidden",c2e=8,u2e=3;var z;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(z||(z={}));const l2e={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},T7=new Set([v.TABLE,v.TBODY,v.TFOOT,v.THEAD,v.TR]),PL={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:oi,onParseError:null};class OL{constructor(t,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=z.INITIAL,this.originalInsertionMode=z.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...PL,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new LIe(this.options,this),this.activeFormattingElements=new zIe(this.treeAdapter),this.fragmentContextID=r?tf(this.treeAdapter.getTagName(r)):v.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new UIe(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...PL,...n};t??(t=r.treeAdapter.createElement(Z.TEMPLATE,de.HTML,[]));const s=r.treeAdapter.createElement("documentmock",de.HTML,[]),a=new this(r,s,t);return a.fragmentContextID===v.TEMPLATE&&a.tmplInsertionModeStack.unshift(z.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var s;if(!this.onParseError)return;const a=(s=t.location)!==null&&s!==void 0?s:l2e,o={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(o)}onItemPush(t,n,r){var s,a;(a=(s=this.treeAdapter).onItemPush)===null||a===void 0||a.call(s,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(s=(r=this.treeAdapter).onItemPop)===null||s===void 0||s.call(r,t,this.openElements.current),n){let a,o;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,o=this.fragmentContextID):{current:a,currentTagId:o}=this.openElements,this._setContextModes(a,o)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===de.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,de.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=z.TEXT}switchToPlaintextParsing(){this.insertionMode=z.TEXT,this.originalInsertionMode=z.IN_BODY,this.tokenizer.state=bn.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===Z.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==de.HTML))switch(this.fragmentContextID){case v.TITLE:case v.TEXTAREA:{this.tokenizer.state=bn.RCDATA;break}case v.STYLE:case v.XMP:case v.IFRAME:case v.NOEMBED:case v.NOFRAMES:case v.NOSCRIPT:{this.tokenizer.state=bn.RAWTEXT;break}case v.SCRIPT:{this.tokenizer.state=bn.SCRIPT_DATA;break}case v.PLAINTEXT:{this.tokenizer.state=bn.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",s=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,s),t.location){const o=this.treeAdapter.getChildNodes(this.document).find(i=>this.treeAdapter.isDocumentTypeNode(i));o&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,de.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,de.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(Z.HTML,de.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,v.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const s=this.treeAdapter.getChildNodes(n),a=r?s.lastIndexOf(r):s.length,o=s[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:c,endCol:u,endOffset:l}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:c,endCol:u,endOffset:l})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,s=this.treeAdapter.getTagName(t),a=n.type===dt.END_TAG&&s===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,a)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===v.SVG&&this.treeAdapter.getTagName(n)===Z.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===de.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===v.MGLYPH||t.tagID===v.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,de.HTML)}_processToken(t){switch(t.type){case dt.CHARACTER:{this.onCharacter(t);break}case dt.NULL_CHARACTER:{this.onNullCharacter(t);break}case dt.COMMENT:{this.onComment(t);break}case dt.DOCTYPE:{this.onDoctype(t);break}case dt.START_TAG:{this._processStartTag(t);break}case dt.END_TAG:{this.onEndTag(t);break}case dt.EOF:{this.onEof(t);break}case dt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return o2e(t,s,a,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===Da.Marker||this.openElements.contains(s.element)),r=n===-1?t-1:n-1;for(let s=r;s>=0;s--){const a=this.activeFormattingElements.entries[s];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=z.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(v.P),this.openElements.popUntilTagNamePopped(v.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case v.TR:{this.insertionMode=z.IN_ROW;return}case v.TBODY:case v.THEAD:case v.TFOOT:{this.insertionMode=z.IN_TABLE_BODY;return}case v.CAPTION:{this.insertionMode=z.IN_CAPTION;return}case v.COLGROUP:{this.insertionMode=z.IN_COLUMN_GROUP;return}case v.TABLE:{this.insertionMode=z.IN_TABLE;return}case v.BODY:{this.insertionMode=z.IN_BODY;return}case v.FRAMESET:{this.insertionMode=z.IN_FRAMESET;return}case v.SELECT:{this._resetInsertionModeForSelect(t);return}case v.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case v.HTML:{this.insertionMode=this.headElement?z.AFTER_HEAD:z.BEFORE_HEAD;return}case v.TD:case v.TH:{if(t>0){this.insertionMode=z.IN_CELL;return}break}case v.HEAD:{if(t>0){this.insertionMode=z.IN_HEAD;return}break}}this.insertionMode=z.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===v.TEMPLATE)break;if(r===v.TABLE){this.insertionMode=z.IN_SELECT_IN_TABLE;return}}this.insertionMode=z.IN_SELECT}_isElementCausesFosterParenting(t){return T7.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case v.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===de.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case v.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return NIe[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){BAe(this,t);return}switch(this.insertionMode){case z.INITIAL:{Of(this,t);break}case z.BEFORE_HTML:{Ph(this,t);break}case z.BEFORE_HEAD:{Oh(this,t);break}case z.IN_HEAD:{Lh(this,t);break}case z.IN_HEAD_NO_SCRIPT:{$h(this,t);break}case z.AFTER_HEAD:{jh(this,t);break}case z.IN_BODY:case z.IN_CAPTION:case z.IN_CELL:case z.IN_TEMPLATE:{I7(this,t);break}case z.TEXT:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case z.IN_TABLE:case z.IN_TABLE_BODY:case z.IN_ROW:{yS(this,t);break}case z.IN_TABLE_TEXT:{L7(this,t);break}case z.IN_COLUMN_GROUP:{K0(this,t);break}case z.AFTER_BODY:{W0(this,t);break}case z.AFTER_AFTER_BODY:{oy(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){FAe(this,t);return}switch(this.insertionMode){case z.INITIAL:{Of(this,t);break}case z.BEFORE_HTML:{Ph(this,t);break}case z.BEFORE_HEAD:{Oh(this,t);break}case z.IN_HEAD:{Lh(this,t);break}case z.IN_HEAD_NO_SCRIPT:{$h(this,t);break}case z.AFTER_HEAD:{jh(this,t);break}case z.TEXT:{this._insertCharacters(t);break}case z.IN_TABLE:case z.IN_TABLE_BODY:case z.IN_ROW:{yS(this,t);break}case z.IN_COLUMN_GROUP:{K0(this,t);break}case z.AFTER_BODY:{W0(this,t);break}case z.AFTER_AFTER_BODY:{oy(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){pE(this,t);return}switch(this.insertionMode){case z.INITIAL:case z.BEFORE_HTML:case z.BEFORE_HEAD:case z.IN_HEAD:case z.IN_HEAD_NO_SCRIPT:case z.AFTER_HEAD:case z.IN_BODY:case z.IN_TABLE:case z.IN_CAPTION:case z.IN_COLUMN_GROUP:case z.IN_TABLE_BODY:case z.IN_ROW:case z.IN_CELL:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:case z.IN_TEMPLATE:case z.IN_FRAMESET:case z.AFTER_FRAMESET:{pE(this,t);break}case z.IN_TABLE_TEXT:{Lf(this,t);break}case z.AFTER_BODY:{b2e(this,t);break}case z.AFTER_AFTER_BODY:case z.AFTER_AFTER_FRAMESET:{y2e(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case z.INITIAL:{x2e(this,t);break}case z.BEFORE_HEAD:case z.IN_HEAD:case z.IN_HEAD_NO_SCRIPT:case z.AFTER_HEAD:{this._err(t,se.misplacedDoctype);break}case z.IN_TABLE_TEXT:{Lf(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,se.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?UAe(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case z.INITIAL:{Of(this,t);break}case z.BEFORE_HTML:{k2e(this,t);break}case z.BEFORE_HEAD:{S2e(this,t);break}case z.IN_HEAD:{Na(this,t);break}case z.IN_HEAD_NO_SCRIPT:{E2e(this,t);break}case z.AFTER_HEAD:{C2e(this,t);break}case z.IN_BODY:{Ir(this,t);break}case z.IN_TABLE:{xd(this,t);break}case z.IN_TABLE_TEXT:{Lf(this,t);break}case z.IN_CAPTION:{wAe(this,t);break}case z.IN_COLUMN_GROUP:{U2(this,t);break}case z.IN_TABLE_BODY:{yk(this,t);break}case z.IN_ROW:{xk(this,t);break}case z.IN_CELL:{TAe(this,t);break}case z.IN_SELECT:{M7(this,t);break}case z.IN_SELECT_IN_TABLE:{IAe(this,t);break}case z.IN_TEMPLATE:{NAe(this,t);break}case z.AFTER_BODY:{PAe(this,t);break}case z.IN_FRAMESET:{OAe(this,t);break}case z.AFTER_FRAMESET:{$Ae(this,t);break}case z.AFTER_AFTER_BODY:{MAe(this,t);break}case z.AFTER_AFTER_FRAMESET:{DAe(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?zAe(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case z.INITIAL:{Of(this,t);break}case z.BEFORE_HTML:{v2e(this,t);break}case z.BEFORE_HEAD:{w2e(this,t);break}case z.IN_HEAD:{_2e(this,t);break}case z.IN_HEAD_NO_SCRIPT:{T2e(this,t);break}case z.AFTER_HEAD:{I2e(this,t);break}case z.IN_BODY:{bk(this,t);break}case z.TEXT:{hAe(this,t);break}case z.IN_TABLE:{Am(this,t);break}case z.IN_TABLE_TEXT:{Lf(this,t);break}case z.IN_CAPTION:{_Ae(this,t);break}case z.IN_COLUMN_GROUP:{EAe(this,t);break}case z.IN_TABLE_BODY:{gE(this,t);break}case z.IN_ROW:{j7(this,t);break}case z.IN_CELL:{CAe(this,t);break}case z.IN_SELECT:{D7(this,t);break}case z.IN_SELECT_IN_TABLE:{AAe(this,t);break}case z.IN_TEMPLATE:{RAe(this,t);break}case z.AFTER_BODY:{B7(this,t);break}case z.IN_FRAMESET:{LAe(this,t);break}case z.AFTER_FRAMESET:{jAe(this,t);break}case z.AFTER_AFTER_BODY:{oy(this,t);break}}}onEof(t){switch(this.insertionMode){case z.INITIAL:{Of(this,t);break}case z.BEFORE_HTML:{Ph(this,t);break}case z.BEFORE_HEAD:{Oh(this,t);break}case z.IN_HEAD:{Lh(this,t);break}case z.IN_HEAD_NO_SCRIPT:{$h(this,t);break}case z.AFTER_HEAD:{jh(this,t);break}case z.IN_BODY:case z.IN_TABLE:case z.IN_CAPTION:case z.IN_COLUMN_GROUP:case z.IN_TABLE_BODY:case z.IN_ROW:case z.IN_CELL:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:{P7(this,t);break}case z.TEXT:{mAe(this,t);break}case z.IN_TABLE_TEXT:{Lf(this,t);break}case z.IN_TEMPLATE:{F7(this,t);break}case z.AFTER_BODY:case z.IN_FRAMESET:case z.AFTER_FRAMESET:case z.AFTER_AFTER_BODY:case z.AFTER_AFTER_FRAMESET:{B2(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===$.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case z.IN_HEAD:case z.IN_HEAD_NO_SCRIPT:case z.AFTER_HEAD:case z.TEXT:case z.IN_COLUMN_GROUP:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:case z.IN_FRAMESET:case z.AFTER_FRAMESET:{this._insertCharacters(t);break}case z.IN_BODY:case z.IN_CAPTION:case z.IN_CELL:case z.IN_TEMPLATE:case z.AFTER_BODY:case z.AFTER_AFTER_BODY:case z.AFTER_AFTER_FRAMESET:{C7(this,t);break}case z.IN_TABLE:case z.IN_TABLE_BODY:case z.IN_ROW:{yS(this,t);break}case z.IN_TABLE_TEXT:{O7(this,t);break}}}}function d2e(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):R7(e,t),n}function f2e(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const s=e.openElements.items[r];if(s===t.element)break;e._isSpecialElement(s,e.openElements.tagIDs[r])&&(n=s)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function h2e(e,t,n){let r=t,s=e.openElements.getCommonAncestor(t);for(let a=0,o=s;o!==n;a++,o=s){s=e.openElements.getCommonAncestor(o);const i=e.activeFormattingElements.getElementEntry(o),c=i&&a>=u2e;!i||c?(c&&e.activeFormattingElements.removeEntry(i),e.openElements.remove(o)):(o=m2e(e,i),r===t&&(e.activeFormattingElements.bookmark=i),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function m2e(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function p2e(e,t,n){const r=e.treeAdapter.getTagName(t),s=tf(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const a=e.treeAdapter.getNamespaceURI(t);s===v.TEMPLATE&&a===de.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function g2e(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:s}=n,a=e.treeAdapter.createElement(s.tagName,r,s.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,s),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,s.tagID)}function F2(e,t){for(let n=0;n<c2e;n++){const r=d2e(e,t);if(!r)break;const s=f2e(e,r);if(!s)break;e.activeFormattingElements.bookmark=r;const a=h2e(e,s,r.element),o=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(a),o&&p2e(e,o,a),g2e(e,s,r)}}function pE(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function b2e(e,t){e._appendCommentNode(t,e.openElements.items[0])}function y2e(e,t){e._appendCommentNode(t,e.document)}function B2(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],s=e.treeAdapter.getNodeSourceCodeLocation(r);if(s&&!s.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const a=e.openElements.items[1],o=e.treeAdapter.getNodeSourceCodeLocation(a);o&&!o.endTag&&e._setEndLocation(a,t)}}}}function x2e(e,t){e._setDocumentType(t);const n=t.forceQuirks?$s.QUIRKS:YIe(t);WIe(t)||e._err(t,se.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=z.BEFORE_HTML}function Of(e,t){e._err(t,se.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,$s.QUIRKS),e.insertionMode=z.BEFORE_HTML,e._processToken(t)}function k2e(e,t){t.tagID===v.HTML?(e._insertElement(t,de.HTML),e.insertionMode=z.BEFORE_HEAD):Ph(e,t)}function v2e(e,t){const n=t.tagID;(n===v.HTML||n===v.HEAD||n===v.BODY||n===v.BR)&&Ph(e,t)}function Ph(e,t){e._insertFakeRootElement(),e.insertionMode=z.BEFORE_HEAD,e._processToken(t)}function S2e(e,t){switch(t.tagID){case v.HTML:{Ir(e,t);break}case v.HEAD:{e._insertElement(t,de.HTML),e.headElement=e.openElements.current,e.insertionMode=z.IN_HEAD;break}default:Oh(e,t)}}function w2e(e,t){const n=t.tagID;n===v.HEAD||n===v.BODY||n===v.HTML||n===v.BR?Oh(e,t):e._err(t,se.endTagWithoutMatchingOpenElement)}function Oh(e,t){e._insertFakeElement(Z.HEAD,v.HEAD),e.headElement=e.openElements.current,e.insertionMode=z.IN_HEAD,e._processToken(t)}function Na(e,t){switch(t.tagID){case v.HTML:{Ir(e,t);break}case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:{e._appendElement(t,de.HTML),t.ackSelfClosing=!0;break}case v.TITLE:{e._switchToTextParsing(t,bn.RCDATA);break}case v.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,bn.RAWTEXT):(e._insertElement(t,de.HTML),e.insertionMode=z.IN_HEAD_NO_SCRIPT);break}case v.NOFRAMES:case v.STYLE:{e._switchToTextParsing(t,bn.RAWTEXT);break}case v.SCRIPT:{e._switchToTextParsing(t,bn.SCRIPT_DATA);break}case v.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=z.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(z.IN_TEMPLATE);break}case v.HEAD:{e._err(t,se.misplacedStartTagForHeadElement);break}default:Lh(e,t)}}function _2e(e,t){switch(t.tagID){case v.HEAD:{e.openElements.pop(),e.insertionMode=z.AFTER_HEAD;break}case v.BODY:case v.BR:case v.HTML:{Lh(e,t);break}case v.TEMPLATE:{Mu(e,t);break}default:e._err(t,se.endTagWithoutMatchingOpenElement)}}function Mu(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==v.TEMPLATE&&e._err(t,se.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,se.endTagWithoutMatchingOpenElement)}function Lh(e,t){e.openElements.pop(),e.insertionMode=z.AFTER_HEAD,e._processToken(t)}function E2e(e,t){switch(t.tagID){case v.HTML:{Ir(e,t);break}case v.BASEFONT:case v.BGSOUND:case v.HEAD:case v.LINK:case v.META:case v.NOFRAMES:case v.STYLE:{Na(e,t);break}case v.NOSCRIPT:{e._err(t,se.nestedNoscriptInHead);break}default:$h(e,t)}}function T2e(e,t){switch(t.tagID){case v.NOSCRIPT:{e.openElements.pop(),e.insertionMode=z.IN_HEAD;break}case v.BR:{$h(e,t);break}default:e._err(t,se.endTagWithoutMatchingOpenElement)}}function $h(e,t){const n=t.type===dt.EOF?se.openElementsLeftAfterEof:se.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=z.IN_HEAD,e._processToken(t)}function C2e(e,t){switch(t.tagID){case v.HTML:{Ir(e,t);break}case v.BODY:{e._insertElement(t,de.HTML),e.framesetOk=!1,e.insertionMode=z.IN_BODY;break}case v.FRAMESET:{e._insertElement(t,de.HTML),e.insertionMode=z.IN_FRAMESET;break}case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:case v.NOFRAMES:case v.SCRIPT:case v.STYLE:case v.TEMPLATE:case v.TITLE:{e._err(t,se.abandonedHeadElementChild),e.openElements.push(e.headElement,v.HEAD),Na(e,t),e.openElements.remove(e.headElement);break}case v.HEAD:{e._err(t,se.misplacedStartTagForHeadElement);break}default:jh(e,t)}}function I2e(e,t){switch(t.tagID){case v.BODY:case v.HTML:case v.BR:{jh(e,t);break}case v.TEMPLATE:{Mu(e,t);break}default:e._err(t,se.endTagWithoutMatchingOpenElement)}}function jh(e,t){e._insertFakeElement(Z.BODY,v.BODY),e.insertionMode=z.IN_BODY,gk(e,t)}function gk(e,t){switch(t.type){case dt.CHARACTER:{I7(e,t);break}case dt.WHITESPACE_CHARACTER:{C7(e,t);break}case dt.COMMENT:{pE(e,t);break}case dt.START_TAG:{Ir(e,t);break}case dt.END_TAG:{bk(e,t);break}case dt.EOF:{P7(e,t);break}}}function C7(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function I7(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function A2e(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function N2e(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function R2e(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,de.HTML),e.insertionMode=z.IN_FRAMESET)}function P2e(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,de.HTML)}function O2e(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&mE.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,de.HTML)}function L2e(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,de.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function $2e(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,de.HTML),n||(e.formElement=e.openElements.current))}function j2e(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const s=e.openElements.tagIDs[r];if(n===v.LI&&s===v.LI||(n===v.DD||n===v.DT)&&(s===v.DD||s===v.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==v.ADDRESS&&s!==v.DIV&&s!==v.P&&e._isSpecialElement(e.openElements.items[r],s))break}e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,de.HTML)}function M2e(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,de.HTML),e.tokenizer.state=bn.PLAINTEXT}function D2e(e,t){e.openElements.hasInScope(v.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(v.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,de.HTML),e.framesetOk=!1}function F2e(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Z.A);n&&(F2(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,de.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function B2e(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,de.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function U2e(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(v.NOBR)&&(F2(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,de.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function z2e(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,de.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function H2e(e,t){e.treeAdapter.getDocumentMode(e.document)!==$s.QUIRKS&&e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,de.HTML),e.framesetOk=!1,e.insertionMode=z.IN_TABLE}function A7(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,de.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function N7(e){const t=y7(e,Zc.TYPE);return t!=null&&t.toLowerCase()===i2e}function q2e(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,de.HTML),N7(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function V2e(e,t){e._appendElement(t,de.HTML),t.ackSelfClosing=!0}function G2e(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._appendElement(t,de.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function K2e(e,t){t.tagName=Z.IMG,t.tagID=v.IMG,A7(e,t)}function W2e(e,t){e._insertElement(t,de.HTML),e.skipNextNewLine=!0,e.tokenizer.state=bn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=z.TEXT}function Y2e(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,bn.RAWTEXT)}function J2e(e,t){e.framesetOk=!1,e._switchToTextParsing(t,bn.RAWTEXT)}function LL(e,t){e._switchToTextParsing(t,bn.RAWTEXT)}function Q2e(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,de.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===z.IN_TABLE||e.insertionMode===z.IN_CAPTION||e.insertionMode===z.IN_TABLE_BODY||e.insertionMode===z.IN_ROW||e.insertionMode===z.IN_CELL?z.IN_SELECT_IN_TABLE:z.IN_SELECT}function X2e(e,t){e.openElements.currentTagId===v.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,de.HTML)}function Z2e(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,de.HTML)}function eAe(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(v.RTC),e._insertElement(t,de.HTML)}function tAe(e,t){e._reconstructActiveFormattingElements(),_7(t),D2(t),t.selfClosing?e._appendElement(t,de.MATHML):e._insertElement(t,de.MATHML),t.ackSelfClosing=!0}function nAe(e,t){e._reconstructActiveFormattingElements(),E7(t),D2(t),t.selfClosing?e._appendElement(t,de.SVG):e._insertElement(t,de.SVG),t.ackSelfClosing=!0}function $L(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,de.HTML)}function Ir(e,t){switch(t.tagID){case v.I:case v.S:case v.B:case v.U:case v.EM:case v.TT:case v.BIG:case v.CODE:case v.FONT:case v.SMALL:case v.STRIKE:case v.STRONG:{B2e(e,t);break}case v.A:{F2e(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{O2e(e,t);break}case v.P:case v.DL:case v.OL:case v.UL:case v.DIV:case v.DIR:case v.NAV:case v.MAIN:case v.MENU:case v.ASIDE:case v.CENTER:case v.FIGURE:case v.FOOTER:case v.HEADER:case v.HGROUP:case v.DIALOG:case v.DETAILS:case v.ADDRESS:case v.ARTICLE:case v.SEARCH:case v.SECTION:case v.SUMMARY:case v.FIELDSET:case v.BLOCKQUOTE:case v.FIGCAPTION:{P2e(e,t);break}case v.LI:case v.DD:case v.DT:{j2e(e,t);break}case v.BR:case v.IMG:case v.WBR:case v.AREA:case v.EMBED:case v.KEYGEN:{A7(e,t);break}case v.HR:{G2e(e,t);break}case v.RB:case v.RTC:{Z2e(e,t);break}case v.RT:case v.RP:{eAe(e,t);break}case v.PRE:case v.LISTING:{L2e(e,t);break}case v.XMP:{Y2e(e,t);break}case v.SVG:{nAe(e,t);break}case v.HTML:{A2e(e,t);break}case v.BASE:case v.LINK:case v.META:case v.STYLE:case v.TITLE:case v.SCRIPT:case v.BGSOUND:case v.BASEFONT:case v.TEMPLATE:{Na(e,t);break}case v.BODY:{N2e(e,t);break}case v.FORM:{$2e(e,t);break}case v.NOBR:{U2e(e,t);break}case v.MATH:{tAe(e,t);break}case v.TABLE:{H2e(e,t);break}case v.INPUT:{q2e(e,t);break}case v.PARAM:case v.TRACK:case v.SOURCE:{V2e(e,t);break}case v.IMAGE:{K2e(e,t);break}case v.BUTTON:{D2e(e,t);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{z2e(e,t);break}case v.IFRAME:{J2e(e,t);break}case v.SELECT:{Q2e(e,t);break}case v.OPTION:case v.OPTGROUP:{X2e(e,t);break}case v.NOEMBED:case v.NOFRAMES:{LL(e,t);break}case v.FRAMESET:{R2e(e,t);break}case v.TEXTAREA:{W2e(e,t);break}case v.NOSCRIPT:{e.options.scriptingEnabled?LL(e,t):$L(e,t);break}case v.PLAINTEXT:{M2e(e,t);break}case v.COL:case v.TH:case v.TD:case v.TR:case v.HEAD:case v.FRAME:case v.TBODY:case v.TFOOT:case v.THEAD:case v.CAPTION:case v.COLGROUP:break;default:$L(e,t)}}function rAe(e,t){if(e.openElements.hasInScope(v.BODY)&&(e.insertionMode=z.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function sAe(e,t){e.openElements.hasInScope(v.BODY)&&(e.insertionMode=z.AFTER_BODY,B7(e,t))}function aAe(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function oAe(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(v.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(v.FORM):n&&e.openElements.remove(n))}function iAe(e){e.openElements.hasInButtonScope(v.P)||e._insertFakeElement(Z.P,v.P),e._closePElement()}function cAe(e){e.openElements.hasInListItemScope(v.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(v.LI),e.openElements.popUntilTagNamePopped(v.LI))}function uAe(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function lAe(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function dAe(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function fAe(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Z.BR,v.BR),e.openElements.pop(),e.framesetOk=!1}function R7(e,t){const n=t.tagName,r=t.tagID;for(let s=e.openElements.stackTop;s>0;s--){const a=e.openElements.items[s],o=e.openElements.tagIDs[s];if(r===o&&(r!==v.UNKNOWN||e.treeAdapter.getTagName(a)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=s&&e.openElements.shortenToLength(s);break}if(e._isSpecialElement(a,o))break}}function bk(e,t){switch(t.tagID){case v.A:case v.B:case v.I:case v.S:case v.U:case v.EM:case v.TT:case v.BIG:case v.CODE:case v.FONT:case v.NOBR:case v.SMALL:case v.STRIKE:case v.STRONG:{F2(e,t);break}case v.P:{iAe(e);break}case v.DL:case v.UL:case v.OL:case v.DIR:case v.DIV:case v.NAV:case v.PRE:case v.MAIN:case v.MENU:case v.ASIDE:case v.BUTTON:case v.CENTER:case v.FIGURE:case v.FOOTER:case v.HEADER:case v.HGROUP:case v.DIALOG:case v.ADDRESS:case v.ARTICLE:case v.DETAILS:case v.SEARCH:case v.SECTION:case v.SUMMARY:case v.LISTING:case v.FIELDSET:case v.BLOCKQUOTE:case v.FIGCAPTION:{aAe(e,t);break}case v.LI:{cAe(e);break}case v.DD:case v.DT:{uAe(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{lAe(e);break}case v.BR:{fAe(e);break}case v.BODY:{rAe(e,t);break}case v.HTML:{sAe(e,t);break}case v.FORM:{oAe(e);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{dAe(e,t);break}case v.TEMPLATE:{Mu(e,t);break}default:R7(e,t)}}function P7(e,t){e.tmplInsertionModeStack.length>0?F7(e,t):B2(e,t)}function hAe(e,t){var n;t.tagID===v.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function mAe(e,t){e._err(t,se.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function yS(e,t){if(e.openElements.currentTagId!==void 0&&T7.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=z.IN_TABLE_TEXT,t.type){case dt.CHARACTER:{L7(e,t);break}case dt.WHITESPACE_CHARACTER:{O7(e,t);break}}else Rp(e,t)}function pAe(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,de.HTML),e.insertionMode=z.IN_CAPTION}function gAe(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,de.HTML),e.insertionMode=z.IN_COLUMN_GROUP}function bAe(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Z.COLGROUP,v.COLGROUP),e.insertionMode=z.IN_COLUMN_GROUP,U2(e,t)}function yAe(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,de.HTML),e.insertionMode=z.IN_TABLE_BODY}function xAe(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Z.TBODY,v.TBODY),e.insertionMode=z.IN_TABLE_BODY,yk(e,t)}function kAe(e,t){e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function vAe(e,t){N7(t)?e._appendElement(t,de.HTML):Rp(e,t),t.ackSelfClosing=!0}function SAe(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,de.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function xd(e,t){switch(t.tagID){case v.TD:case v.TH:case v.TR:{xAe(e,t);break}case v.STYLE:case v.SCRIPT:case v.TEMPLATE:{Na(e,t);break}case v.COL:{bAe(e,t);break}case v.FORM:{SAe(e,t);break}case v.TABLE:{kAe(e,t);break}case v.TBODY:case v.TFOOT:case v.THEAD:{yAe(e,t);break}case v.INPUT:{vAe(e,t);break}case v.CAPTION:{pAe(e,t);break}case v.COLGROUP:{gAe(e,t);break}default:Rp(e,t)}}function Am(e,t){switch(t.tagID){case v.TABLE:{e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode());break}case v.TEMPLATE:{Mu(e,t);break}case v.BODY:case v.CAPTION:case v.COL:case v.COLGROUP:case v.HTML:case v.TBODY:case v.TD:case v.TFOOT:case v.TH:case v.THEAD:case v.TR:break;default:Rp(e,t)}}function Rp(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,gk(e,t),e.fosterParentingEnabled=n}function O7(e,t){e.pendingCharacterTokens.push(t)}function L7(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Lf(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)Rp(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const $7=new Set([v.CAPTION,v.COL,v.COLGROUP,v.TBODY,v.TD,v.TFOOT,v.TH,v.THEAD,v.TR]);function wAe(e,t){const n=t.tagID;$7.has(n)?e.openElements.hasInTableScope(v.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(v.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=z.IN_TABLE,xd(e,t)):Ir(e,t)}function _Ae(e,t){const n=t.tagID;switch(n){case v.CAPTION:case v.TABLE:{e.openElements.hasInTableScope(v.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(v.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=z.IN_TABLE,n===v.TABLE&&Am(e,t));break}case v.BODY:case v.COL:case v.COLGROUP:case v.HTML:case v.TBODY:case v.TD:case v.TFOOT:case v.TH:case v.THEAD:case v.TR:break;default:bk(e,t)}}function U2(e,t){switch(t.tagID){case v.HTML:{Ir(e,t);break}case v.COL:{e._appendElement(t,de.HTML),t.ackSelfClosing=!0;break}case v.TEMPLATE:{Na(e,t);break}default:K0(e,t)}}function EAe(e,t){switch(t.tagID){case v.COLGROUP:{e.openElements.currentTagId===v.COLGROUP&&(e.openElements.pop(),e.insertionMode=z.IN_TABLE);break}case v.TEMPLATE:{Mu(e,t);break}case v.COL:break;default:K0(e,t)}}function K0(e,t){e.openElements.currentTagId===v.COLGROUP&&(e.openElements.pop(),e.insertionMode=z.IN_TABLE,e._processToken(t))}function yk(e,t){switch(t.tagID){case v.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,de.HTML),e.insertionMode=z.IN_ROW;break}case v.TH:case v.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(Z.TR,v.TR),e.insertionMode=z.IN_ROW,xk(e,t);break}case v.CAPTION:case v.COL:case v.COLGROUP:case v.TBODY:case v.TFOOT:case v.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=z.IN_TABLE,xd(e,t));break}default:xd(e,t)}}function gE(e,t){const n=t.tagID;switch(t.tagID){case v.TBODY:case v.TFOOT:case v.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=z.IN_TABLE);break}case v.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=z.IN_TABLE,Am(e,t));break}case v.BODY:case v.CAPTION:case v.COL:case v.COLGROUP:case v.HTML:case v.TD:case v.TH:case v.TR:break;default:Am(e,t)}}function xk(e,t){switch(t.tagID){case v.TH:case v.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,de.HTML),e.insertionMode=z.IN_CELL,e.activeFormattingElements.insertMarker();break}case v.CAPTION:case v.COL:case v.COLGROUP:case v.TBODY:case v.TFOOT:case v.THEAD:case v.TR:{e.openElements.hasInTableScope(v.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=z.IN_TABLE_BODY,yk(e,t));break}default:xd(e,t)}}function j7(e,t){switch(t.tagID){case v.TR:{e.openElements.hasInTableScope(v.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=z.IN_TABLE_BODY);break}case v.TABLE:{e.openElements.hasInTableScope(v.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=z.IN_TABLE_BODY,gE(e,t));break}case v.TBODY:case v.TFOOT:case v.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(v.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=z.IN_TABLE_BODY,gE(e,t));break}case v.BODY:case v.CAPTION:case v.COL:case v.COLGROUP:case v.HTML:case v.TD:case v.TH:break;default:Am(e,t)}}function TAe(e,t){const n=t.tagID;$7.has(n)?(e.openElements.hasInTableScope(v.TD)||e.openElements.hasInTableScope(v.TH))&&(e._closeTableCell(),xk(e,t)):Ir(e,t)}function CAe(e,t){const n=t.tagID;switch(n){case v.TD:case v.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=z.IN_ROW);break}case v.TABLE:case v.TBODY:case v.TFOOT:case v.THEAD:case v.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),j7(e,t));break}case v.BODY:case v.CAPTION:case v.COL:case v.COLGROUP:case v.HTML:break;default:bk(e,t)}}function M7(e,t){switch(t.tagID){case v.HTML:{Ir(e,t);break}case v.OPTION:{e.openElements.currentTagId===v.OPTION&&e.openElements.pop(),e._insertElement(t,de.HTML);break}case v.OPTGROUP:{e.openElements.currentTagId===v.OPTION&&e.openElements.pop(),e.openElements.currentTagId===v.OPTGROUP&&e.openElements.pop(),e._insertElement(t,de.HTML);break}case v.HR:{e.openElements.currentTagId===v.OPTION&&e.openElements.pop(),e.openElements.currentTagId===v.OPTGROUP&&e.openElements.pop(),e._appendElement(t,de.HTML),t.ackSelfClosing=!0;break}case v.INPUT:case v.KEYGEN:case v.TEXTAREA:case v.SELECT:{e.openElements.hasInSelectScope(v.SELECT)&&(e.openElements.popUntilTagNamePopped(v.SELECT),e._resetInsertionMode(),t.tagID!==v.SELECT&&e._processStartTag(t));break}case v.SCRIPT:case v.TEMPLATE:{Na(e,t);break}}}function D7(e,t){switch(t.tagID){case v.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===v.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===v.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===v.OPTGROUP&&e.openElements.pop();break}case v.OPTION:{e.openElements.currentTagId===v.OPTION&&e.openElements.pop();break}case v.SELECT:{e.openElements.hasInSelectScope(v.SELECT)&&(e.openElements.popUntilTagNamePopped(v.SELECT),e._resetInsertionMode());break}case v.TEMPLATE:{Mu(e,t);break}}}function IAe(e,t){const n=t.tagID;n===v.CAPTION||n===v.TABLE||n===v.TBODY||n===v.TFOOT||n===v.THEAD||n===v.TR||n===v.TD||n===v.TH?(e.openElements.popUntilTagNamePopped(v.SELECT),e._resetInsertionMode(),e._processStartTag(t)):M7(e,t)}function AAe(e,t){const n=t.tagID;n===v.CAPTION||n===v.TABLE||n===v.TBODY||n===v.TFOOT||n===v.THEAD||n===v.TR||n===v.TD||n===v.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(v.SELECT),e._resetInsertionMode(),e.onEndTag(t)):D7(e,t)}function NAe(e,t){switch(t.tagID){case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:case v.NOFRAMES:case v.SCRIPT:case v.STYLE:case v.TEMPLATE:case v.TITLE:{Na(e,t);break}case v.CAPTION:case v.COLGROUP:case v.TBODY:case v.TFOOT:case v.THEAD:{e.tmplInsertionModeStack[0]=z.IN_TABLE,e.insertionMode=z.IN_TABLE,xd(e,t);break}case v.COL:{e.tmplInsertionModeStack[0]=z.IN_COLUMN_GROUP,e.insertionMode=z.IN_COLUMN_GROUP,U2(e,t);break}case v.TR:{e.tmplInsertionModeStack[0]=z.IN_TABLE_BODY,e.insertionMode=z.IN_TABLE_BODY,yk(e,t);break}case v.TD:case v.TH:{e.tmplInsertionModeStack[0]=z.IN_ROW,e.insertionMode=z.IN_ROW,xk(e,t);break}default:e.tmplInsertionModeStack[0]=z.IN_BODY,e.insertionMode=z.IN_BODY,Ir(e,t)}}function RAe(e,t){t.tagID===v.TEMPLATE&&Mu(e,t)}function F7(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):B2(e,t)}function PAe(e,t){t.tagID===v.HTML?Ir(e,t):W0(e,t)}function B7(e,t){var n;if(t.tagID===v.HTML){if(e.fragmentContext||(e.insertionMode=z.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===v.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else W0(e,t)}function W0(e,t){e.insertionMode=z.IN_BODY,gk(e,t)}function OAe(e,t){switch(t.tagID){case v.HTML:{Ir(e,t);break}case v.FRAMESET:{e._insertElement(t,de.HTML);break}case v.FRAME:{e._appendElement(t,de.HTML),t.ackSelfClosing=!0;break}case v.NOFRAMES:{Na(e,t);break}}}function LAe(e,t){t.tagID===v.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==v.FRAMESET&&(e.insertionMode=z.AFTER_FRAMESET))}function $Ae(e,t){switch(t.tagID){case v.HTML:{Ir(e,t);break}case v.NOFRAMES:{Na(e,t);break}}}function jAe(e,t){t.tagID===v.HTML&&(e.insertionMode=z.AFTER_AFTER_FRAMESET)}function MAe(e,t){t.tagID===v.HTML?Ir(e,t):oy(e,t)}function oy(e,t){e.insertionMode=z.IN_BODY,gk(e,t)}function DAe(e,t){switch(t.tagID){case v.HTML:{Ir(e,t);break}case v.NOFRAMES:{Na(e,t);break}}}function FAe(e,t){t.chars=Jt,e._insertCharacters(t)}function BAe(e,t){e._insertCharacters(t),e.framesetOk=!1}function U7(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==de.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function UAe(e,t){if(n2e(t))U7(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===de.MATHML?_7(t):r===de.SVG&&(r2e(t),E7(t)),D2(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function zAe(e,t){if(t.tagID===v.P||t.tagID===v.BR){U7(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===de.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}Z.AREA,Z.BASE,Z.BASEFONT,Z.BGSOUND,Z.BR,Z.COL,Z.EMBED,Z.FRAME,Z.HR,Z.IMG,Z.INPUT,Z.KEYGEN,Z.LINK,Z.META,Z.PARAM,Z.SOURCE,Z.TRACK,Z.WBR;const kk=z7("end"),oo=z7("start");function z7(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function H7(e){const t=oo(e),n=kk(e);if(t&&n)return{start:t,end:n}}const HAe=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,qAe=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),jL={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function q7(e,t){const n=eNe(e),r=m2("type",{handlers:{root:VAe,element:GAe,text:KAe,comment:G7,doctype:WAe,raw:JAe},unknown:QAe}),s={parser:n?new OL(jL):OL.getFragmentParser(void 0,jL),handle(i){r(i,s)},stitches:!1,options:t||{}};r(e,s),nf(s,oo());const a=n?s.parser.document:s.parser.getFragment(),o=nIe(a,{file:s.options.file});return s.stitches&&Za(o,"comment",function(i,c,u){const l=i;if(l.value.stitch&&u&&c!==void 0){const d=u.children;return d[c]=l.value.stitch,c}}),o.type==="root"&&o.children.length===1&&o.children[0].type===e.type?o.children[0]:o}function V7(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function VAe(e,t){V7(e.children,t)}function GAe(e,t){XAe(e,t),V7(e.children,t),ZAe(e,t)}function KAe(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:dt.CHARACTER,chars:e.value,location:Pp(e)};nf(t,oo(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function WAe(e,t){const n={type:dt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Pp(e)};nf(t,oo(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function YAe(e,t){t.stitches=!0;const n=tNe(e);if("children"in e&&"children"in n){const r=q7({type:"root",children:e.children},t.options);n.children=r.children}G7({type:"comment",value:{stitch:n}},t)}function G7(e,t){const n=e.value,r={type:dt.COMMENT,data:n,location:Pp(e)};nf(t,oo(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function JAe(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,K7(t,oo(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(HAe,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function QAe(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))YAe(n,t);else{let r="";throw qAe.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function nf(e,t){K7(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=bn.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function K7(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function XAe(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===bn.PLAINTEXT)return;nf(t,oo(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:Fc.html;s===Fc.html&&n==="svg"&&(s=Fc.svg);const a=iIe({...e,children:[]},{space:s===Fc.svg?"svg":"html"}),o={type:dt.START_TAG,tagName:n,tagID:tf(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:Pp(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function ZAe(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&s9.includes(n)||t.parser.tokenizer.state===bn.PLAINTEXT)return;nf(t,kk(e));const r={type:dt.END_TAG,tagName:n,tagID:tf(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Pp(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===bn.RCDATA||t.parser.tokenizer.state===bn.RAWTEXT||t.parser.tokenizer.state===bn.SCRIPT_DATA)&&(t.parser.tokenizer.state=bn.DATA)}function eNe(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Pp(e){const t=oo(e)||{line:void 0,column:void 0,offset:void 0},n=kk(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function tNe(e){return"children"in e?xu({...e,children:[]}):xu(e)}function bE(e){return function(t,n){return q7(t,{...e,file:n})}}const gc=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Ac={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...gc,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...gc],h2:[["className","sr-only"]],img:[...gc,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...gc,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...gc],table:[...gc],ul:[...gc,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},ui={}.hasOwnProperty;function nNe(e,t){let n={type:"root",children:[]};const r={schema:t?{...Ac,...t}:Ac,stack:[]},s=W7(r,e);return s&&(Array.isArray(s)?s.length===1?n=s[0]:n.children=s:n=s),n}function W7(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return rNe(e,n);case"doctype":return sNe(e,n);case"element":return aNe(e,n);case"root":return oNe(e,n);case"text":return iNe(e,n)}}}function rNe(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),a={type:"comment",value:r<0?n:n.slice(0,r)};return Op(a,t),a}}function sNe(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return Op(n,t),n}}function aNe(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=Y7(e,t.children),s=cNe(e,t.properties);e.stack.pop();let a=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&ui.call(e.schema.ancestors,n))){const i=e.schema.ancestors[n];let c=-1;for(a=!1;++c<i.length;)e.stack.includes(i[c])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const o={type:"element",tagName:n,properties:s,children:r};return Op(o,t),o}function oNe(e,t){const r={type:"root",children:Y7(e,t.children)};return Op(r,t),r}function iNe(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return Op(r,t),r}function Y7(e,t){const n=[];if(Array.isArray(t)){const r=t;let s=-1;for(;++s<r.length;){const a=W7(e,r[s]);a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}function cNe(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,s=e.schema.required,a=r&&ui.call(r,n)?r[n]:void 0,o=r&&ui.call(r,"*")?r["*"]:void 0,i=t&&typeof t=="object"?t:{},c={};let u;for(u in i)if(ui.call(i,u)){const l=i[u];let d=ML(e,DL(a,u),u,l);d==null&&(d=ML(e,DL(o,u),u,l)),d!=null&&(c[u]=d)}if(s&&ui.call(s,n)){const l=s[n];for(u in l)ui.call(l,u)&&!ui.call(c,u)&&(c[u]=l[u])}return c}function ML(e,t,n,r){return t?Array.isArray(r)?uNe(e,t,n,r):J7(e,t,n,r):void 0}function uNe(e,t,n,r){let s=-1;const a=[];for(;++s<r.length;){const o=J7(e,t,n,r[s]);(typeof o=="number"||typeof o=="string")&&a.push(o)}return a}function J7(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&lNe(e,n,r)){if(typeof t=="object"&&t.length>1){let s=!1,a=0;for(;++a<t.length;){const o=t[a];if(o&&typeof o=="object"&&"flags"in o){if(o.test(String(r))){s=!0;break}}else if(o===r){s=!0;break}}if(!s)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function lNe(e,t,n){const r=e.schema.protocols&&ui.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const s=String(n),a=s.indexOf(":"),o=s.indexOf("?"),i=s.indexOf("#"),c=s.indexOf("/");if(a<0||c>-1&&a>c||o>-1&&a>o||i>-1&&a>i)return!0;let u=-1;for(;++u<r.length;){const l=r[u];if(a===l.length&&s.slice(0,l.length)===l)return!0}return!1}function Op(e,t){const n=H7(t);t.data&&(e.data=xu(t.data)),n&&(e.position=n)}function DL(e,t){let n,r=-1;if(e)for(;++r<e.length;){const s=e[r],a=typeof s=="string"?s:s[0];if(a===t)return s;a==="data*"&&(n=s)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function Q7(e){return function(t){return nNe(t,e)}}const Fr=sc(/[A-Za-z]/),_r=sc(/[\dA-Za-z]/),dNe=sc(/[#-'*+\--9=?A-Z^-~]/);function Y0(e){return e!==null&&(e<32||e===127)}const yE=sc(/\d/),fNe=sc(/[\dA-Fa-f]/),hNe=sc(/[!-/:-@[-`{-~]/);function qe(e){return e!==null&&e<-2}function Vt(e){return e!==null&&(e<0||e===32)}function mt(e){return e===-2||e===-1||e===32}const vk=sc(new RegExp("\\p{P}|\\p{S}","u")),ku=sc(/\s/);function sc(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function mNe(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function pNe(e,t,n){const s=hk((n||{}).ignore||[]),a=gNe(t);let o=-1;for(;++o<a.length;)R2(e,"text",i);function i(u,l){let d=-1,h;for(;++d<l.length;){const m=l[d],p=h?h.children:void 0;if(s(m,p?p.indexOf(m):void 0,h))return;h=m}if(h)return c(u,l)}function c(u,l){const d=l[l.length-1],h=a[o][0],m=a[o][1];let p=0;const g=d.children.indexOf(u);let b=!1,x=[];h.lastIndex=0;let k=h.exec(u.value);for(;k;){const _=k.index,S={index:k.index,input:k.input,stack:[...l,u]};let w=m(...k,S);if(typeof w=="string"&&(w=w.length>0?{type:"text",value:w}:void 0),w===!1?h.lastIndex=_+1:(p!==_&&x.push({type:"text",value:u.value.slice(p,_)}),Array.isArray(w)?x.push(...w):w&&x.push(w),p=_+k[0].length,b=!0),!h.global)break;k=h.exec(u.value)}return b?(p<u.value.length&&x.push({type:"text",value:u.value.slice(p)}),d.children.splice(g,1,...x)):x=[u],g+x.length}}function gNe(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const s=n[r];t.push([bNe(s[0]),yNe(s[1])])}return t}function bNe(e){return typeof e=="string"?new RegExp(mNe(e),"g"):e}function yNe(e){return typeof e=="function"?e:function(){return e}}const xS="phrasing",kS=["autolink","link","image","label"];function xNe(){return{transforms:[TNe],enter:{literalAutolink:vNe,literalAutolinkEmail:vS,literalAutolinkHttp:vS,literalAutolinkWww:vS},exit:{literalAutolink:ENe,literalAutolinkEmail:_Ne,literalAutolinkHttp:SNe,literalAutolinkWww:wNe}}}function kNe(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:xS,notInConstruct:kS},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:xS,notInConstruct:kS},{character:":",before:"[ps]",after:"\\/",inConstruct:xS,notInConstruct:kS}]}}function vNe(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function vS(e){this.config.enter.autolinkProtocol.call(this,e)}function SNe(e){this.config.exit.autolinkProtocol.call(this,e)}function wNe(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function _Ne(e){this.config.exit.autolinkEmail.call(this,e)}function ENe(e){this.exit(e)}function TNe(e){pNe(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,CNe],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),INe]],{ignore:["link","linkReference"]})}function CNe(e,t,n,r,s){let a="";if(!X7(s)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!ANe(n)))return!1;const o=NNe(n+r);if(!o[0])return!1;const i={type:"link",title:null,url:a+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[i,{type:"text",value:o[1]}]:i}function INe(e,t,n,r){return!X7(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function ANe(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function NNe(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=D0(e,"(");let a=D0(e,")");for(;r!==-1&&s>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function X7(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||ku(n)||vk(n))&&(!t||n!==47)}function pa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}Z7.peek=FNe;function RNe(){this.buffer()}function PNe(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function ONe(){this.buffer()}function LNe(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function $Ne(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=pa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function jNe(e){this.exit(e)}function MNe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=pa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function DNe(e){this.exit(e)}function FNe(){return"["}function Z7(e,t,n,r){const s=n.createTracker(r);let a=s.move("[^");const o=n.enter("footnoteReference"),i=n.enter("reference");return a+=s.move(n.safe(n.associationId(e),{after:"]",before:a})),i(),o(),a+=s.move("]"),a}function BNe(){return{enter:{gfmFootnoteCallString:RNe,gfmFootnoteCall:PNe,gfmFootnoteDefinitionLabelString:ONe,gfmFootnoteDefinition:LNe},exit:{gfmFootnoteCallString:$Ne,gfmFootnoteCall:jNe,gfmFootnoteDefinitionLabelString:MNe,gfmFootnoteDefinition:DNe}}}function UNe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Z7},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,a,o){const i=a.createTracker(o);let c=i.move("[^");const u=a.enter("footnoteDefinition"),l=a.enter("label");return c+=i.move(a.safe(a.associationId(r),{before:c,after:"]"})),l(),c+=i.move("]:"),r.children&&r.children.length>0&&(i.shift(4),c+=i.move((t?`
|
|
188
|
-
`:" ")+a.indentLines(a.containerFlow(r,i.current()),t?eH:zNe))),u(),c}}function zNe(e,t,n){return t===0?e:eH(e,t,n)}function eH(e,t,n){return(n?"":" ")+e}const HNe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];tH.peek=WNe;function qNe(){return{canContainEols:["delete"],enter:{strikethrough:GNe},exit:{strikethrough:KNe}}}function VNe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:HNe}],handlers:{delete:tH}}}function GNe(e){this.enter({type:"delete",children:[]},e)}function KNe(e){this.exit(e)}function tH(e,t,n,r){const s=n.createTracker(r),a=n.enter("strikethrough");let o=s.move("~~");return o+=n.containerPhrasing(e,{...s.current(),before:o,after:"~"}),o+=s.move("~~"),a(),o}function WNe(){return"~"}function YNe(e){return e.length}function JNe(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||YNe,a=[],o=[],i=[],c=[];let u=0,l=-1;for(;++l<e.length;){const y=[],g=[];let b=-1;for(e[l].length>u&&(u=e[l].length);++b<e[l].length;){const x=QNe(e[l][b]);if(n.alignDelimiters!==!1){const k=s(x);g[b]=k,(c[b]===void 0||k>c[b])&&(c[b]=k)}y.push(x)}o[l]=y,i[l]=g}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<u;)a[d]=FL(r[d]);else{const y=FL(r);for(;++d<u;)a[d]=y}d=-1;const h=[],m=[];for(;++d<u;){const y=a[d];let g="",b="";y===99?(g=":",b=":"):y===108?g=":":y===114&&(b=":");let x=n.alignDelimiters===!1?1:Math.max(1,c[d]-g.length-b.length);const k=g+"-".repeat(x)+b;n.alignDelimiters!==!1&&(x=g.length+x+b.length,x>c[d]&&(c[d]=x),m[d]=x),h[d]=k}o.splice(1,0,h),i.splice(1,0,m),l=-1;const p=[];for(;++l<o.length;){const y=o[l],g=i[l];d=-1;const b=[];for(;++d<u;){const x=y[d]||"";let k="",_="";if(n.alignDelimiters!==!1){const S=c[d]-(g[d]||0),w=a[d];w===114?k=" ".repeat(S):w===99?S%2?(k=" ".repeat(S/2+.5),_=" ".repeat(S/2-.5)):(k=" ".repeat(S/2),_=k):_=" ".repeat(S)}n.delimiterStart!==!1&&!d&&b.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&x==="")&&(n.delimiterStart!==!1||d)&&b.push(" "),n.alignDelimiters!==!1&&b.push(k),b.push(x),n.alignDelimiters!==!1&&b.push(_),n.padding!==!1&&b.push(" "),(n.delimiterEnd!==!1||d!==u-1)&&b.push("|")}p.push(n.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return p.join(`
|
|
189
|
-
`)}function QNe(e){return e==null?"":String(e)}function FL(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function XNe(e,t,n,r){const s=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const o=n.indentLines(n.containerFlow(e,a.current()),ZNe);return s(),o}function ZNe(e,t,n){return">"+(n?"":" ")+e}function eRe(e,t){return BL(e,t.inConstruct,!0)&&!BL(e,t.notInConstruct,!1)}function BL(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function UL(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
190
|
-
`&&eRe(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
191
|
-
`}function tRe(e,t){const n=String(e);let r=n.indexOf(t),s=r,a=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++a>o&&(o=a):a=1,s=r+t.length,r=n.indexOf(t,s);return o}function nRe(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function rRe(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function sRe(e,t,n,r){const s=rRe(n),a=e.value||"",o=s==="`"?"GraveAccent":"Tilde";if(nRe(e,n)){const d=n.enter("codeIndented"),h=n.indentLines(a,aRe);return d(),h}const i=n.createTracker(r),c=s.repeat(Math.max(tRe(a,s)+1,3)),u=n.enter("codeFenced");let l=i.move(c);if(e.lang){const d=n.enter(`codeFencedLang${o}`);l+=i.move(n.safe(e.lang,{before:l,after:" ",encode:["`"],...i.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${o}`);l+=i.move(" "),l+=i.move(n.safe(e.meta,{before:l,after:`
|
|
192
|
-
`,encode:["`"],...i.current()})),d()}return l+=i.move(`
|
|
193
|
-
`),a&&(l+=i.move(a+`
|
|
194
|
-
`)),l+=i.move(c),u(),l}function aRe(e,t,n){return(n?"":" ")+e}function z2(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function oRe(e,t,n,r){const s=z2(n),a=s==='"'?"Quote":"Apostrophe",o=n.enter("definition");let i=n.enter("label");const c=n.createTracker(r);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),i(),!e.url||/[\0- \u007F]/.test(e.url)?(i=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(i=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":`
|
|
195
|
-
`,...c.current()}))),i(),e.title&&(i=n.enter(`title${a}`),u+=c.move(" "+s),u+=c.move(n.safe(e.title,{before:u,after:s,...c.current()})),u+=c.move(s),i()),o(),u}function iRe(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Nm(e){return"&#x"+e.toString(16).toUpperCase()+";"}function kd(e){if(e===null||Vt(e)||ku(e))return 1;if(vk(e))return 2}function J0(e,t,n){const r=kd(e),s=kd(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}nH.peek=cRe;function nH(e,t,n,r){const s=iRe(n),a=n.enter("emphasis"),o=n.createTracker(r),i=o.move(s);let c=o.move(n.containerPhrasing(e,{after:s,before:i,...o.current()}));const u=c.charCodeAt(0),l=J0(r.before.charCodeAt(r.before.length-1),u,s);l.inside&&(c=Nm(u)+c.slice(1));const d=c.charCodeAt(c.length-1),h=J0(r.after.charCodeAt(0),d,s);h.inside&&(c=c.slice(0,-1)+Nm(d));const m=o.move(s);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:l.outside},i+c+m}function cRe(e,t,n){return n.options.emphasis||"*"}const uRe={};function H2(e,t){const n=uRe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return rH(e,r,s)}function rH(e,t,n){if(lRe(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return zL(e.children,t,n)}return Array.isArray(e)?zL(e,t,n):""}function zL(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=rH(e[s],t,n);return r.join("")}function lRe(e){return!!(e&&typeof e=="object")}function dRe(e,t){let n=!1;return Za(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,dE}),!!((!e.depth||e.depth<3)&&H2(e)&&(t.options.setext||n))}function fRe(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(dRe(e,n)){const l=n.enter("headingSetext"),d=n.enter("phrasing"),h=n.containerPhrasing(e,{...a.current(),before:`
|
|
196
|
-
`,after:`
|
|
197
|
-
`});return d(),l(),h+`
|
|
198
|
-
`+(s===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
199
|
-
`))+1))}const o="#".repeat(s),i=n.enter("headingAtx"),c=n.enter("phrasing");a.move(o+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
|
|
200
|
-
`,...a.current()});return/^[\t ]/.test(u)&&(u=Nm(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),c(),i(),u}sH.peek=hRe;function sH(e){return e.value||""}function hRe(){return"<"}aH.peek=mRe;function aH(e,t,n,r){const s=z2(n),a=s==='"'?"Quote":"Apostrophe",o=n.enter("image");let i=n.enter("label");const c=n.createTracker(r);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),i(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(i=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(i=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),i(),e.title&&(i=n.enter(`title${a}`),u+=c.move(" "+s),u+=c.move(n.safe(e.title,{before:u,after:s,...c.current()})),u+=c.move(s),i()),u+=c.move(")"),o(),u}function mRe(){return"!"}oH.peek=pRe;function oH(e,t,n,r){const s=e.referenceType,a=n.enter("imageReference");let o=n.enter("label");const i=n.createTracker(r);let c=i.move("![");const u=n.safe(e.alt,{before:c,after:"]",...i.current()});c+=i.move(u+"]["),o();const l=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...i.current()});return o(),n.stack=l,a(),s==="full"||!u||u!==d?c+=i.move(d+"]"):s==="shortcut"?c=c.slice(0,-1):c+=i.move("]"),c}function pRe(){return"!"}iH.peek=gRe;function iH(e,t,n){let r=e.value||"",s="`",a=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const o=n.unsafe[a],i=n.compilePattern(o);let c;if(o.atBreak)for(;c=i.exec(r);){let u=c.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(c.index+1)}}return s+r+s}function gRe(){return"`"}function cH(e,t){const n=H2(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}uH.peek=bRe;function uH(e,t,n,r){const s=z2(n),a=s==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let i,c;if(cH(e,n)){const l=n.stack;n.stack=[],i=n.enter("autolink");let d=o.move("<");return d+=o.move(n.containerPhrasing(e,{before:d,after:">",...o.current()})),d+=o.move(">"),i(),n.stack=l,d}i=n.enter("link"),c=n.enter("label");let u=o.move("[");return u+=o.move(n.containerPhrasing(e,{before:u,after:"](",...o.current()})),u+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(n.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(c=n.enter("destinationRaw"),u+=o.move(n.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),u+=o.move(" "+s),u+=o.move(n.safe(e.title,{before:u,after:s,...o.current()})),u+=o.move(s),c()),u+=o.move(")"),i(),u}function bRe(e,t,n){return cH(e,n)?"<":"["}lH.peek=yRe;function lH(e,t,n,r){const s=e.referenceType,a=n.enter("linkReference");let o=n.enter("label");const i=n.createTracker(r);let c=i.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...i.current()});c+=i.move(u+"]["),o();const l=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...i.current()});return o(),n.stack=l,a(),s==="full"||!u||u!==d?c+=i.move(d+"]"):s==="shortcut"?c=c.slice(0,-1):c+=i.move("]"),c}function yRe(){return"["}function q2(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function xRe(e){const t=q2(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function kRe(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function dH(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function vRe(e,t,n,r){const s=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?kRe(n):q2(n);const i=e.ordered?o==="."?")":".":xRe(n);let c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const l=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&l&&(!l.children||!l.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),dH(n)===o&&l){let d=-1;for(;++d<e.children.length;){const h=e.children[d];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(o=i),n.bulletCurrent=o;const u=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,s(),u}function SRe(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function wRe(e,t,n,r){const s=SRe(n);let a=n.bulletCurrent||q2(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const i=n.createTracker(r);i.move(a+" ".repeat(o-a.length)),i.shift(o);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,i.current()),l);return c(),u;function l(d,h,m){return h?(m?"":" ".repeat(o))+d:(m?a:a+" ".repeat(o-a.length))+d}}function _Re(e,t,n,r){const s=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),s(),o}const ERe=hk(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function TRe(e,t,n,r){return(e.children.some(function(o){return ERe(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function CRe(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}fH.peek=IRe;function fH(e,t,n,r){const s=CRe(n),a=n.enter("strong"),o=n.createTracker(r),i=o.move(s+s);let c=o.move(n.containerPhrasing(e,{after:s,before:i,...o.current()}));const u=c.charCodeAt(0),l=J0(r.before.charCodeAt(r.before.length-1),u,s);l.inside&&(c=Nm(u)+c.slice(1));const d=c.charCodeAt(c.length-1),h=J0(r.after.charCodeAt(0),d,s);h.inside&&(c=c.slice(0,-1)+Nm(d));const m=o.move(s+s);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:l.outside},i+c+m}function IRe(e,t,n){return n.options.strong||"*"}function ARe(e,t,n,r){return n.safe(e.value,r)}function NRe(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function RRe(e,t,n){const r=(dH(n)+(n.options.ruleSpaces?" ":"")).repeat(NRe(n));return n.options.ruleSpaces?r.slice(0,-1):r}const hH={blockquote:XNe,break:UL,code:sRe,definition:oRe,emphasis:nH,hardBreak:UL,heading:fRe,html:sH,image:aH,imageReference:oH,inlineCode:iH,link:uH,linkReference:lH,list:vRe,listItem:wRe,paragraph:_Re,root:TRe,strong:fH,text:ARe,thematicBreak:RRe},HL=document.createElement("i");function V2(e){const t="&"+e+";";HL.innerHTML=t;const n=HL.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function mH(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}const PRe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ORe(e){return e.replace(PRe,LRe)}function LRe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),a=s===120||s===88;return mH(n.slice(a?2:1),a?16:10)}return V2(n)||e}function $Re(){return{enter:{table:jRe,tableData:qL,tableHeader:qL,tableRow:DRe},exit:{codeText:FRe,table:MRe,tableData:SS,tableHeader:SS,tableRow:SS}}}function jRe(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function MRe(e){this.exit(e),this.data.inTable=void 0}function DRe(e){this.enter({type:"tableRow",children:[]},e)}function SS(e){this.exit(e)}function qL(e){this.enter({type:"tableCell",children:[]},e)}function FRe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,BRe));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function BRe(e,t){return t==="|"?t:e}function URe(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
201
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:o,tableCell:c,tableRow:i}};function o(m,p,y,g){return u(l(m,y,g),m.align)}function i(m,p,y,g){const b=d(m,y,g),x=u([b]);return x.slice(0,x.indexOf(`
|
|
202
|
-
`))}function c(m,p,y,g){const b=y.enter("tableCell"),x=y.enter("phrasing"),k=y.containerPhrasing(m,{...g,before:a,after:a});return x(),b(),k}function u(m,p){return JNe(m,{align:p,alignDelimiters:r,padding:n,stringLength:s})}function l(m,p,y){const g=m.children;let b=-1;const x=[],k=p.enter("table");for(;++b<g.length;)x[b]=d(g[b],p,y);return k(),x}function d(m,p,y){const g=m.children;let b=-1;const x=[],k=p.enter("tableRow");for(;++b<g.length;)x[b]=c(g[b],m,p,y);return k(),x}function h(m,p,y){let g=hH.inlineCode(m,p,y);return y.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function zRe(){return{exit:{taskListCheckValueChecked:VL,taskListCheckValueUnchecked:VL,paragraph:qRe}}}function HRe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:VRe}}}function VL(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function qRe(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=t.children;let a=-1,o;for(;++a<s.length;){const i=s[a];if(i.type==="paragraph"){o=i;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function VRe(e,t,n,r){const s=e.children[0],a=typeof e.checked=="boolean"&&s&&s.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",i=n.createTracker(r);a&&i.move(o);let c=hH.listItem(e,t,n,{...r,...i.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(l){return l+o}}function GRe(){return[xNe(),BNe(),qNe(),$Re(),zRe()]}function KRe(e){return{extensions:[kNe(),UNe(e),VNe(),URe(e),HRe()]}}function vs(e,t,n,r){const s=e.length;let a=0,o;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function js(e,t){return e.length>0?(vs(e,e.length,0,t),e):t}const GL={}.hasOwnProperty;function pH(e){const t={};let n=-1;for(;++n<e.length;)WRe(t,e[n]);return t}function WRe(e,t){let n;for(n in t){const s=(GL.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){GL.call(s,o)||(s[o]=[]);const i=a[o];YRe(s[o],Array.isArray(i)?i:i?[i]:[])}}}function YRe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);vs(e,0,0,r)}const JRe={tokenize:nPe,partial:!0},gH={tokenize:rPe,partial:!0},bH={tokenize:sPe,partial:!0},yH={tokenize:aPe,partial:!0},QRe={tokenize:oPe,partial:!0},xH={name:"wwwAutolink",tokenize:ePe,previous:vH},kH={name:"protocolAutolink",tokenize:tPe,previous:SH},Ko={name:"emailAutolink",tokenize:ZRe,previous:wH},io={};function XRe(){return{text:io}}let bc=48;for(;bc<123;)io[bc]=Ko,bc++,bc===58?bc=65:bc===91&&(bc=97);io[43]=Ko;io[45]=Ko;io[46]=Ko;io[95]=Ko;io[72]=[Ko,kH];io[104]=[Ko,kH];io[87]=[Ko,xH];io[119]=[Ko,xH];function ZRe(e,t,n){const r=this;let s,a;return o;function o(d){return!xE(d)||!wH.call(r,r.previous)||G2(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),i(d))}function i(d){return xE(d)?(e.consume(d),i):d===64?(e.consume(d),c):n(d)}function c(d){return d===46?e.check(QRe,l,u)(d):d===45||d===95||_r(d)?(a=!0,e.consume(d),c):l(d)}function u(d){return e.consume(d),s=!0,c}function l(d){return a&&s&&Fr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function ePe(e,t,n){const r=this;return s;function s(o){return o!==87&&o!==119||!vH.call(r,r.previous)||G2(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(JRe,e.attempt(gH,e.attempt(bH,a),n),n)(o))}function a(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function tPe(e,t,n){const r=this;let s="",a=!1;return o;function o(d){return(d===72||d===104)&&SH.call(r,r.previous)&&!G2(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(d),e.consume(d),i):n(d)}function i(d){if(Fr(d)&&s.length<5)return s+=String.fromCodePoint(d),e.consume(d),i;if(d===58){const h=s.toLowerCase();if(h==="http"||h==="https")return e.consume(d),c}return n(d)}function c(d){return d===47?(e.consume(d),a?u:(a=!0,c)):n(d)}function u(d){return d===null||Y0(d)||Vt(d)||ku(d)||vk(d)?n(d):e.attempt(gH,e.attempt(bH,l),n)(d)}function l(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function nPe(e,t,n){let r=0;return s;function s(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),s):o===46&&r===3?(e.consume(o),a):n(o)}function a(o){return o===null?n(o):t(o)}}function rPe(e,t,n){let r,s,a;return o;function o(u){return u===46||u===95?e.check(yH,c,i)(u):u===null||Vt(u)||ku(u)||u!==45&&vk(u)?c(u):(a=!0,e.consume(u),o)}function i(u){return u===95?r=!0:(s=r,r=void 0),e.consume(u),o}function c(u){return s||r||!a?n(u):t(u)}}function sPe(e,t){let n=0,r=0;return s;function s(o){return o===40?(n++,e.consume(o),s):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(yH,t,a)(o):o===null||Vt(o)||ku(o)?t(o):(e.consume(o),s)}function a(o){return o===41&&r++,e.consume(o),s}}function aPe(e,t,n){return r;function r(i){return i===33||i===34||i===39||i===41||i===42||i===44||i===46||i===58||i===59||i===63||i===95||i===126?(e.consume(i),r):i===38?(e.consume(i),a):i===93?(e.consume(i),s):i===60||i===null||Vt(i)||ku(i)?t(i):n(i)}function s(i){return i===null||i===40||i===91||Vt(i)||ku(i)?t(i):r(i)}function a(i){return Fr(i)?o(i):n(i)}function o(i){return i===59?(e.consume(i),r):Fr(i)?(e.consume(i),o):n(i)}}function oPe(e,t,n){return r;function r(a){return e.consume(a),s}function s(a){return _r(a)?n(a):t(a)}}function vH(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Vt(e)}function SH(e){return!Fr(e)}function wH(e){return!(e===47||xE(e))}function xE(e){return e===43||e===45||e===46||e===95||_r(e)}function G2(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function rf(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&_r(e.charCodeAt(n+1))&&_r(e.charCodeAt(n+2)))s=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){const i=e.charCodeAt(n+1);a<56320&&i>56319&&i<57344?(o=String.fromCharCode(a,i),s=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+s+1,o=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function Sk(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const a=e[s].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const kE={name:"attention",resolveAll:iPe,tokenize:cPe};function iPe(e,t){let n=-1,r,s,a,o,i,c,u,l;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},h={...e[n][1].start};KL(d,-c),KL(h,c),o={type:c>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},i={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:c>1?"strong":"emphasis",start:{...o.start},end:{...i.end}},e[r][1].end={...o.start},e[n][1].start={...i.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=js(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=js(u,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",a,t]]),u=js(u,Sk(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=js(u,[["exit",a,t],["enter",i,t],["exit",i,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(l=2,u=js(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):l=0,vs(e,r-1,n-r+3,u),n=r+u.length-l-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function cPe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=kd(r);let a;return o;function o(c){return a=c,e.enter("attentionSequence"),i(c)}function i(c){if(c===a)return e.consume(c),i;const u=e.exit("attentionSequence"),l=kd(c),d=!l||l===2&&s||n.includes(c),h=!s||s===2&&l||n.includes(r);return u._open=!!(a===42?d:d&&(s||!h)),u._close=!!(a===42?h:h&&(l||!d)),t(c)}}function KL(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const uPe={name:"autolink",tokenize:lPe};function lPe(e,t,n){let r=0;return s;function s(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(m){return Fr(m)?(e.consume(m),o):m===64?n(m):u(m)}function o(m){return m===43||m===45||m===46||_r(m)?(r=1,i(m)):u(m)}function i(m){return m===58?(e.consume(m),r=0,c):(m===43||m===45||m===46||_r(m))&&r++<32?(e.consume(m),i):(r=0,u(m))}function c(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||Y0(m)?n(m):(e.consume(m),c)}function u(m){return m===64?(e.consume(m),l):dNe(m)?(e.consume(m),u):n(m)}function l(m){return _r(m)?d(m):n(m)}function d(m){return m===46?(e.consume(m),r=0,l):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):h(m)}function h(m){if((m===45||_r(m))&&r++<63){const p=m===45?h:d;return e.consume(m),p}return n(m)}}function vt(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(c){return mt(c)?(e.enter(n),i(c)):t(c)}function i(c){return mt(c)&&a++<s?(e.consume(c),i):(e.exit(n),t(c))}}const Lp={partial:!0,tokenize:dPe};function dPe(e,t,n){return r;function r(a){return mt(a)?vt(e,s,"linePrefix")(a):s(a)}function s(a){return a===null||qe(a)?t(a):n(a)}}const _H={continuation:{tokenize:hPe},exit:mPe,name:"blockQuote",tokenize:fPe};function fPe(e,t,n){const r=this;return s;function s(o){if(o===62){const i=r.containerState;return i.open||(e.enter("blockQuote",{_container:!0}),i.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),a}return n(o)}function a(o){return mt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function hPe(e,t,n){const r=this;return s;function s(o){return mt(o)?vt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(_H,t,n)(o)}}function mPe(e){e.exit("blockQuote")}const EH={name:"characterEscape",tokenize:pPe};function pPe(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),s}function s(a){return hNe(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const TH={name:"characterReference",tokenize:gPe};function gPe(e,t,n){const r=this;let s=0,a,o;return i;function i(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),c}function c(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),a=31,o=_r,l(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=fNe,l):(e.enter("characterReferenceValue"),a=7,o=yE,l(d))}function l(d){if(d===59&&s){const h=e.exit("characterReferenceValue");return o===_r&&!V2(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&s++<a?(e.consume(d),l):n(d)}}const WL={partial:!0,tokenize:yPe},YL={concrete:!0,name:"codeFenced",tokenize:bPe};function bPe(e,t,n){const r=this,s={partial:!0,tokenize:S};let a=0,o=0,i;return c;function c(w){return u(w)}function u(w){const T=r.events[r.events.length-1];return a=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,i=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(w)}function l(w){return w===i?(o++,e.consume(w),l):o<3?n(w):(e.exit("codeFencedFenceSequence"),mt(w)?vt(e,d,"whitespace")(w):d(w))}function d(w){return w===null||qe(w)?(e.exit("codeFencedFence"),r.interrupt?t(w):e.check(WL,y,_)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(w))}function h(w){return w===null||qe(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(w)):mt(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),vt(e,m,"whitespace")(w)):w===96&&w===i?n(w):(e.consume(w),h)}function m(w){return w===null||qe(w)?d(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===null||qe(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(w)):w===96&&w===i?n(w):(e.consume(w),p)}function y(w){return e.attempt(s,_,g)(w)}function g(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),b}function b(w){return a>0&&mt(w)?vt(e,x,"linePrefix",a+1)(w):x(w)}function x(w){return w===null||qe(w)?e.check(WL,y,_)(w):(e.enter("codeFlowValue"),k(w))}function k(w){return w===null||qe(w)?(e.exit("codeFlowValue"),x(w)):(e.consume(w),k)}function _(w){return e.exit("codeFenced"),t(w)}function S(w,T,A){let L=0;return R;function R(W){return w.enter("lineEnding"),w.consume(W),w.exit("lineEnding"),j}function j(W){return w.enter("codeFencedFence"),mt(W)?vt(w,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):F(W)}function F(W){return W===i?(w.enter("codeFencedFenceSequence"),K(W)):A(W)}function K(W){return W===i?(L++,w.consume(W),K):L>=o?(w.exit("codeFencedFenceSequence"),mt(W)?vt(w,Y,"whitespace")(W):Y(W)):A(W)}function Y(W){return W===null||qe(W)?(w.exit("codeFencedFence"),T(W)):A(W)}}}function yPe(e,t,n){const r=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const wS={name:"codeIndented",tokenize:kPe},xPe={partial:!0,tokenize:vPe};function kPe(e,t,n){const r=this;return s;function s(u){return e.enter("codeIndented"),vt(e,a,"linePrefix",5)(u)}function a(u){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?c(u):qe(u)?e.attempt(xPe,o,c)(u):(e.enter("codeFlowValue"),i(u))}function i(u){return u===null||qe(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),i)}function c(u){return e.exit("codeIndented"),t(u)}}function vPe(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):qe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):vt(e,a,"linePrefix",5)(o)}function a(o){const i=r.events[r.events.length-1];return i&&i[1].type==="linePrefix"&&i[2].sliceSerialize(i[1],!0).length>=4?t(o):qe(o)?s(o):n(o)}}const SPe={name:"codeText",previous:_Pe,resolve:wPe,tokenize:EPe};function wPe(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function _Pe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function EPe(e,t,n){let r=0,s,a;return o;function o(d){return e.enter("codeText"),e.enter("codeTextSequence"),i(d)}function i(d){return d===96?(e.consume(d),r++,i):(e.exit("codeTextSequence"),c(d))}function c(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),c):d===96?(a=e.enter("codeTextSequence"),s=0,l(d)):qe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(d))}function u(d){return d===null||d===32||d===96||qe(d)?(e.exit("codeTextData"),c(d)):(e.consume(d),u)}function l(d){return d===96?(e.consume(d),s++,l):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(a.type="codeTextData",u(d))}}class TPe{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&$f(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),$f(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),$f(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);$f(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);$f(this.left,n.reverse())}}}function $f(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function CH(e){const t={};let n=-1,r,s,a,o,i,c,u;const l=new TPe(e);for(;++n<l.length;){for(;n in t;)n=t[n];if(r=l.get(n),n&&r[1].type==="chunkFlow"&&l.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type==="lineEndingBlank"&&(a+=2),a<c.length&&c[a][1].type==="content"))for(;++a<c.length&&c[a][1].type!=="content";)c[a][1].type==="chunkText"&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,CPe(l,n)),n=t[n],u=!0);else if(r[1]._container){for(a=n,s=void 0;a--;)if(o=l.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(l.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=a);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(r[1].end={...l.get(s)[1].start},i=l.slice(s,n),i.unshift(r),l.splice(s,n-s+1,i))}}return vs(e,0,Number.POSITIVE_INFINITY,l.slice(0)),!u}function CPe(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const a=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const i=o.events,c=[],u={};let l,d,h=-1,m=n,p=0,y=0;const g=[y];for(;m;){for(;e.get(++s)[1]!==m;);a.push(s),m._tokenizer||(l=r.sliceStream(m),m.next||l.push(null),d&&o.defineSkip(m.start),m._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(l),m._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=n;++h<i.length;)i[h][0]==="exit"&&i[h-1][0]==="enter"&&i[h][1].type===i[h-1][1].type&&i[h][1].start.line!==i[h][1].end.line&&(y=h+1,g.push(y),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(o.events=[],m?(m._tokenizer=void 0,m.previous=void 0):g.pop(),h=g.length;h--;){const b=i.slice(g[h],g[h+1]),x=a.pop();c.push([x,x+b.length-1]),e.splice(x,2,b)}for(c.reverse(),h=-1;++h<c.length;)u[p+c[h][0]]=p+c[h][1],p+=c[h][1]-c[h][0]-1;return u}const IPe={resolve:NPe,tokenize:RPe},APe={partial:!0,tokenize:PPe};function NPe(e){return CH(e),e}function RPe(e,t){let n;return r;function r(i){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(i)}function s(i){return i===null?a(i):qe(i)?e.check(APe,o,a)(i):(e.consume(i),s)}function a(i){return e.exit("chunkContent"),e.exit("content"),t(i)}function o(i){return e.consume(i),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function PPe(e,t,n){const r=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),vt(e,a,"linePrefix")}function a(o){if(o===null||qe(o))return n(o);const i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&i[1].type==="linePrefix"&&i[2].sliceSerialize(i[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function IH(e,t,n,r,s,a,o,i,c){const u=c||Number.POSITIVE_INFINITY;let l=0;return d;function d(b){return b===60?(e.enter(r),e.enter(s),e.enter(a),e.consume(b),e.exit(a),h):b===null||b===32||b===41||Y0(b)?n(b):(e.enter(r),e.enter(o),e.enter(i),e.enter("chunkString",{contentType:"string"}),y(b))}function h(b){return b===62?(e.enter(a),e.consume(b),e.exit(a),e.exit(s),e.exit(r),t):(e.enter(i),e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===62?(e.exit("chunkString"),e.exit(i),h(b)):b===null||b===60||qe(b)?n(b):(e.consume(b),b===92?p:m)}function p(b){return b===60||b===62||b===92?(e.consume(b),m):m(b)}function y(b){return!l&&(b===null||b===41||Vt(b))?(e.exit("chunkString"),e.exit(i),e.exit(o),e.exit(r),t(b)):l<u&&b===40?(e.consume(b),l++,y):b===41?(e.consume(b),l--,y):b===null||b===32||b===40||Y0(b)?n(b):(e.consume(b),b===92?g:y)}function g(b){return b===40||b===41||b===92?(e.consume(b),y):y(b)}}function AH(e,t,n,r,s,a){const o=this;let i=0,c;return u;function u(m){return e.enter(r),e.enter(s),e.consume(m),e.exit(s),e.enter(a),l}function l(m){return i>999||m===null||m===91||m===93&&!c||m===94&&!i&&"_hiddenFootnoteSupport"in o.parser.constructs?n(m):m===93?(e.exit(a),e.enter(s),e.consume(m),e.exit(s),e.exit(r),t):qe(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),l):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||qe(m)||i++>999?(e.exit("chunkString"),l(m)):(e.consume(m),c||(c=!mt(m)),m===92?h:d)}function h(m){return m===91||m===92||m===93?(e.consume(m),i++,d):d(m)}}function NH(e,t,n,r,s,a){let o;return i;function i(h){return h===34||h===39||h===40?(e.enter(r),e.enter(s),e.consume(h),e.exit(s),o=h===40?41:h,c):n(h)}function c(h){return h===o?(e.enter(s),e.consume(h),e.exit(s),e.exit(r),t):(e.enter(a),u(h))}function u(h){return h===o?(e.exit(a),c(o)):h===null?n(h):qe(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),vt(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),l(h))}function l(h){return h===o||h===null||qe(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?d:l)}function d(h){return h===o||h===92?(e.consume(h),l):l(h)}}function Mh(e,t){let n;return r;function r(s){return qe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):mt(s)?vt(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const OPe={name:"definition",tokenize:$Pe},LPe={partial:!0,tokenize:jPe};function $Pe(e,t,n){const r=this;let s;return a;function a(m){return e.enter("definition"),o(m)}function o(m){return AH.call(r,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function i(m){return s=pa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),c):n(m)}function c(m){return Vt(m)?Mh(e,u)(m):u(m)}function u(m){return IH(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function l(m){return e.attempt(LPe,d,d)(m)}function d(m){return mt(m)?vt(e,h,"whitespace")(m):h(m)}function h(m){return m===null||qe(m)?(e.exit("definition"),r.parser.defined.push(s),t(m)):n(m)}}function jPe(e,t,n){return r;function r(i){return Vt(i)?Mh(e,s)(i):n(i)}function s(i){return NH(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(i)}function a(i){return mt(i)?vt(e,o,"whitespace")(i):o(i)}function o(i){return i===null||qe(i)?t(i):n(i)}}const MPe={name:"hardBreakEscape",tokenize:DPe};function DPe(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return qe(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const FPe={name:"headingAtx",resolve:BPe,tokenize:UPe};function BPe(e,t){let n=e.length-2,r=3,s,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},vs(e,r,n-r+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function UPe(e,t,n){let r=0;return s;function s(l){return e.enter("atxHeading"),a(l)}function a(l){return e.enter("atxHeadingSequence"),o(l)}function o(l){return l===35&&r++<6?(e.consume(l),o):l===null||Vt(l)?(e.exit("atxHeadingSequence"),i(l)):n(l)}function i(l){return l===35?(e.enter("atxHeadingSequence"),c(l)):l===null||qe(l)?(e.exit("atxHeading"),t(l)):mt(l)?vt(e,i,"whitespace")(l):(e.enter("atxHeadingText"),u(l))}function c(l){return l===35?(e.consume(l),c):(e.exit("atxHeadingSequence"),i(l))}function u(l){return l===null||l===35||Vt(l)?(e.exit("atxHeadingText"),i(l)):(e.consume(l),u)}}const zPe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],JL=["pre","script","style","textarea"],HPe={concrete:!0,name:"htmlFlow",resolveTo:GPe,tokenize:KPe},qPe={partial:!0,tokenize:YPe},VPe={partial:!0,tokenize:WPe};function GPe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function KPe(e,t,n){const r=this;let s,a,o,i,c;return u;function u(N){return l(N)}function l(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),d}function d(N){return N===33?(e.consume(N),h):N===47?(e.consume(N),a=!0,y):N===63?(e.consume(N),s=3,r.interrupt?t:I):Fr(N)?(e.consume(N),o=String.fromCharCode(N),g):n(N)}function h(N){return N===45?(e.consume(N),s=2,m):N===91?(e.consume(N),s=5,i=0,p):Fr(N)?(e.consume(N),s=4,r.interrupt?t:I):n(N)}function m(N){return N===45?(e.consume(N),r.interrupt?t:I):n(N)}function p(N){const P="CDATA[";return N===P.charCodeAt(i++)?(e.consume(N),i===P.length?r.interrupt?t:F:p):n(N)}function y(N){return Fr(N)?(e.consume(N),o=String.fromCharCode(N),g):n(N)}function g(N){if(N===null||N===47||N===62||Vt(N)){const P=N===47,D=o.toLowerCase();return!P&&!a&&JL.includes(D)?(s=1,r.interrupt?t(N):F(N)):zPe.includes(o.toLowerCase())?(s=6,P?(e.consume(N),b):r.interrupt?t(N):F(N)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):a?x(N):k(N))}return N===45||_r(N)?(e.consume(N),o+=String.fromCharCode(N),g):n(N)}function b(N){return N===62?(e.consume(N),r.interrupt?t:F):n(N)}function x(N){return mt(N)?(e.consume(N),x):R(N)}function k(N){return N===47?(e.consume(N),R):N===58||N===95||Fr(N)?(e.consume(N),_):mt(N)?(e.consume(N),k):R(N)}function _(N){return N===45||N===46||N===58||N===95||_r(N)?(e.consume(N),_):S(N)}function S(N){return N===61?(e.consume(N),w):mt(N)?(e.consume(N),S):k(N)}function w(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),c=N,T):mt(N)?(e.consume(N),w):A(N)}function T(N){return N===c?(e.consume(N),c=null,L):N===null||qe(N)?n(N):(e.consume(N),T)}function A(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||Vt(N)?S(N):(e.consume(N),A)}function L(N){return N===47||N===62||mt(N)?k(N):n(N)}function R(N){return N===62?(e.consume(N),j):n(N)}function j(N){return N===null||qe(N)?F(N):mt(N)?(e.consume(N),j):n(N)}function F(N){return N===45&&s===2?(e.consume(N),J):N===60&&s===1?(e.consume(N),ae):N===62&&s===4?(e.consume(N),U):N===63&&s===3?(e.consume(N),I):N===93&&s===5?(e.consume(N),le):qe(N)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(qPe,V,K)(N)):N===null||qe(N)?(e.exit("htmlFlowData"),K(N)):(e.consume(N),F)}function K(N){return e.check(VPe,Y,V)(N)}function Y(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),W}function W(N){return N===null||qe(N)?K(N):(e.enter("htmlFlowData"),F(N))}function J(N){return N===45?(e.consume(N),I):F(N)}function ae(N){return N===47?(e.consume(N),o="",ge):F(N)}function ge(N){if(N===62){const P=o.toLowerCase();return JL.includes(P)?(e.consume(N),U):F(N)}return Fr(N)&&o.length<8?(e.consume(N),o+=String.fromCharCode(N),ge):F(N)}function le(N){return N===93?(e.consume(N),I):F(N)}function I(N){return N===62?(e.consume(N),U):N===45&&s===2?(e.consume(N),I):F(N)}function U(N){return N===null||qe(N)?(e.exit("htmlFlowData"),V(N)):(e.consume(N),U)}function V(N){return e.exit("htmlFlow"),t(N)}}function WPe(e,t,n){const r=this;return s;function s(o){return qe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function YPe(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Lp,t,n)}}const JPe={name:"htmlText",tokenize:QPe};function QPe(e,t,n){const r=this;let s,a,o;return i;function i(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),c}function c(I){return I===33?(e.consume(I),u):I===47?(e.consume(I),S):I===63?(e.consume(I),k):Fr(I)?(e.consume(I),A):n(I)}function u(I){return I===45?(e.consume(I),l):I===91?(e.consume(I),a=0,p):Fr(I)?(e.consume(I),x):n(I)}function l(I){return I===45?(e.consume(I),m):n(I)}function d(I){return I===null?n(I):I===45?(e.consume(I),h):qe(I)?(o=d,ae(I)):(e.consume(I),d)}function h(I){return I===45?(e.consume(I),m):d(I)}function m(I){return I===62?J(I):I===45?h(I):d(I)}function p(I){const U="CDATA[";return I===U.charCodeAt(a++)?(e.consume(I),a===U.length?y:p):n(I)}function y(I){return I===null?n(I):I===93?(e.consume(I),g):qe(I)?(o=y,ae(I)):(e.consume(I),y)}function g(I){return I===93?(e.consume(I),b):y(I)}function b(I){return I===62?J(I):I===93?(e.consume(I),b):y(I)}function x(I){return I===null||I===62?J(I):qe(I)?(o=x,ae(I)):(e.consume(I),x)}function k(I){return I===null?n(I):I===63?(e.consume(I),_):qe(I)?(o=k,ae(I)):(e.consume(I),k)}function _(I){return I===62?J(I):k(I)}function S(I){return Fr(I)?(e.consume(I),w):n(I)}function w(I){return I===45||_r(I)?(e.consume(I),w):T(I)}function T(I){return qe(I)?(o=T,ae(I)):mt(I)?(e.consume(I),T):J(I)}function A(I){return I===45||_r(I)?(e.consume(I),A):I===47||I===62||Vt(I)?L(I):n(I)}function L(I){return I===47?(e.consume(I),J):I===58||I===95||Fr(I)?(e.consume(I),R):qe(I)?(o=L,ae(I)):mt(I)?(e.consume(I),L):J(I)}function R(I){return I===45||I===46||I===58||I===95||_r(I)?(e.consume(I),R):j(I)}function j(I){return I===61?(e.consume(I),F):qe(I)?(o=j,ae(I)):mt(I)?(e.consume(I),j):L(I)}function F(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),s=I,K):qe(I)?(o=F,ae(I)):mt(I)?(e.consume(I),F):(e.consume(I),Y)}function K(I){return I===s?(e.consume(I),s=void 0,W):I===null?n(I):qe(I)?(o=K,ae(I)):(e.consume(I),K)}function Y(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||Vt(I)?L(I):(e.consume(I),Y)}function W(I){return I===47||I===62||Vt(I)?L(I):n(I)}function J(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function ae(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),ge}function ge(I){return mt(I)?vt(e,le,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):le(I)}function le(I){return e.enter("htmlTextData"),o(I)}}const K2={name:"labelEnd",resolveAll:tOe,resolveTo:nOe,tokenize:rOe},XPe={tokenize:sOe},ZPe={tokenize:aOe},eOe={tokenize:oOe};function tOe(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&vs(e,0,e.length,n),e}function nOe(e,t){let n=e.length,r=0,s,a,o,i;for(;n--;)if(s=e[n][1],a){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(a=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(o=n);const c={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[a][1].start},end:{...e[o][1].end}},l={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return i=[["enter",c,t],["enter",u,t]],i=js(i,e.slice(a+1,a+r+3)),i=js(i,[["enter",l,t]]),i=js(i,Sk(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),i=js(i,[["exit",l,t],e[o-2],e[o-1],["exit",u,t]]),i=js(i,e.slice(o+1)),i=js(i,[["exit",c,t]]),vs(e,a,e.length,i),e}function rOe(e,t,n){const r=this;let s=r.events.length,a,o;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){a=r.events[s][1];break}return i;function i(h){return a?a._inactive?d(h):(o=r.parser.defined.includes(pa(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),c):n(h)}function c(h){return h===40?e.attempt(XPe,l,o?l:d)(h):h===91?e.attempt(ZPe,l,o?u:d)(h):o?l(h):d(h)}function u(h){return e.attempt(eOe,l,d)(h)}function l(h){return t(h)}function d(h){return a._balanced=!0,n(h)}}function sOe(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),s}function s(d){return Vt(d)?Mh(e,a)(d):a(d)}function a(d){return d===41?l(d):IH(e,o,i,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return Vt(d)?Mh(e,c)(d):l(d)}function i(d){return n(d)}function c(d){return d===34||d===39||d===40?NH(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):l(d)}function u(d){return Vt(d)?Mh(e,l)(d):l(d)}function l(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function aOe(e,t,n){const r=this;return s;function s(i){return AH.call(r,e,a,o,"reference","referenceMarker","referenceString")(i)}function a(i){return r.parser.defined.includes(pa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(i):n(i)}function o(i){return n(i)}}function oOe(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),s}function s(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const iOe={name:"labelStartImage",resolveAll:K2.resolveAll,tokenize:cOe};function cOe(e,t,n){const r=this;return s;function s(i){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(i),e.exit("labelImageMarker"),a}function a(i){return i===91?(e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelImage"),o):n(i)}function o(i){return i===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(i):t(i)}}const uOe={name:"labelStartLink",resolveAll:K2.resolveAll,tokenize:lOe};function lOe(e,t,n){const r=this;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const _S={name:"lineEnding",tokenize:dOe};function dOe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),vt(e,t,"linePrefix")}}const iy={name:"thematicBreak",tokenize:fOe};function fOe(e,t,n){let r=0,s;return a;function a(u){return e.enter("thematicBreak"),o(u)}function o(u){return s=u,i(u)}function i(u){return u===s?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||qe(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===s?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),mt(u)?vt(e,i,"whitespace")(u):i(u))}}const Vr={continuation:{tokenize:gOe},exit:yOe,name:"list",tokenize:pOe},hOe={partial:!0,tokenize:xOe},mOe={partial:!0,tokenize:bOe};function pOe(e,t,n){const r=this,s=r.events[r.events.length-1];let a=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return i;function i(m){const p=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:yE(m)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(iy,n,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(m)}return n(m)}function c(m){return yE(m)&&++o<10?(e.consume(m),c):(!r.interrupt||o<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(Lp,r.interrupt?n:l,e.attempt(hOe,h,d))}function l(m){return r.containerState.initialBlankLine=!0,a++,h(m)}function d(m){return mt(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),h):n(m)}function h(m){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function gOe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Lp,s,a);function s(i){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,vt(e,t,"listItemIndent",r.containerState.size+1)(i)}function a(i){return r.containerState.furtherBlankLines||!mt(i)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(i)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(mOe,t,o)(i))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,vt(e,e.attempt(Vr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}function bOe(e,t,n){const r=this;return vt(e,s,"listItemIndent",r.containerState.size+1);function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function yOe(e){e.exit(this.containerState.type)}function xOe(e,t,n){const r=this;return vt(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const o=r.events[r.events.length-1];return!mt(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const QL={name:"setextUnderline",resolveTo:kOe,tokenize:vOe};function kOe(e,t){let n=e.length,r,s,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",a?(e.splice(s,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function vOe(e,t,n){const r=this;let s;return a;function a(u){let l=r.events.length,d;for(;l--;)if(r.events[l][1].type!=="lineEnding"&&r.events[l][1].type!=="linePrefix"&&r.events[l][1].type!=="content"){d=r.events[l][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),s=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),i(u)}function i(u){return u===s?(e.consume(u),i):(e.exit("setextHeadingLineSequence"),mt(u)?vt(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||qe(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const SOe={tokenize:NOe,partial:!0};function wOe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:COe,continuation:{tokenize:IOe},exit:AOe}},text:{91:{name:"gfmFootnoteCall",tokenize:TOe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:_Oe,resolveTo:EOe}}}}function _Oe(e,t,n){const r=this;let s=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;s--;){const c=r.events[s][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return i;function i(c){if(!o||!o._balanced)return n(c);const u=pa(r.sliceSerialize({start:o.end,end:r.now()}));return u.codePointAt(0)!==94||!a.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function EOe(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},i=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...i),e}function TOe(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,o;return i;function i(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),c}function c(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(a>999||d===93&&!o||d===null||d===91||Vt(d))return n(d);if(d===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return s.includes(pa(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return Vt(d)||(o=!0),a++,e.consume(d),d===92?l:u}function l(d){return d===91||d===92||d===93?(e.consume(d),a++,u):u(d)}}function COe(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o=0,i;return c;function c(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",l):n(p)}function l(p){if(o>999||p===93&&!i||p===null||p===91||Vt(p))return n(p);if(p===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return a=pa(r.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Vt(p)||(i=!0),o++,e.consume(p),p===92?d:l}function d(p){return p===91||p===92||p===93?(e.consume(p),o++,l):l(p)}function h(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),s.includes(a)||s.push(a),vt(e,m,"gfmFootnoteDefinitionWhitespace")):n(p)}function m(p){return t(p)}}function IOe(e,t,n){return e.check(Lp,t,e.attempt(SOe,t,n))}function AOe(e){e.exit("gfmFootnoteDefinition")}function NOe(e,t,n){const r=this;return vt(e,s,"gfmFootnoteDefinitionIndent",5);function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(a):n(a)}}function ROe(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(o,i){let c=-1;for(;++c<o.length;)if(o[c][0]==="enter"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._close){let u=c;for(;u--;)if(o[u][0]==="exit"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._open&&o[c][1].end.offset-o[c][1].start.offset===o[u][1].end.offset-o[u][1].start.offset){o[c][1].type="strikethroughSequence",o[u][1].type="strikethroughSequence";const l={type:"strikethrough",start:Object.assign({},o[u][1].start),end:Object.assign({},o[c][1].end)},d={type:"strikethroughText",start:Object.assign({},o[u][1].end),end:Object.assign({},o[c][1].start)},h=[["enter",l,i],["enter",o[u][1],i],["exit",o[u][1],i],["enter",d,i]],m=i.parser.constructs.insideSpan.null;m&&vs(h,h.length,0,Sk(m,o.slice(u+1,c),i)),vs(h,h.length,0,[["exit",d,i],["enter",o[c][1],i],["exit",o[c][1],i],["exit",l,i]]),vs(o,u-1,c-u+3,h),c=u+h.length-2;break}}for(c=-1;++c<o.length;)o[c][1].type==="strikethroughSequenceTemporary"&&(o[c][1].type="data");return o}function a(o,i,c){const u=this.previous,l=this.events;let d=0;return h;function h(p){return u===126&&l[l.length-1][1].type!=="characterEscape"?c(p):(o.enter("strikethroughSequenceTemporary"),m(p))}function m(p){const y=kd(u);if(p===126)return d>1?c(p):(o.consume(p),d++,m);if(d<2&&!n)return c(p);const g=o.exit("strikethroughSequenceTemporary"),b=kd(p);return g._open=!b||b===2&&!!y,g._close=!y||y===2&&!!b,i(p)}}}class POe{constructor(){this.map=[]}add(t,n,r){OOe(this,t,n,r)}consume(t){if(this.map.sort(function(a,o){return a[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const a of s)t.push(a);s=r.pop()}this.map.length=0}}function OOe(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function LOe(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function $Oe(){return{flow:{null:{name:"table",tokenize:jOe,resolveAll:MOe}}}}function jOe(e,t,n){const r=this;let s=0,a=0,o;return i;function i(R){let j=r.events.length-1;for(;j>-1;){const Y=r.events[j][1].type;if(Y==="lineEnding"||Y==="linePrefix")j--;else break}const F=j>-1?r.events[j][1].type:null,K=F==="tableHead"||F==="tableRow"?w:c;return K===w&&r.parser.lazy[r.now().line]?n(R):K(R)}function c(R){return e.enter("tableHead"),e.enter("tableRow"),u(R)}function u(R){return R===124||(o=!0,a+=1),l(R)}function l(R){return R===null?n(R):qe(R)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),m):n(R):mt(R)?vt(e,l,"whitespace")(R):(a+=1,o&&(o=!1,s+=1),R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),o=!0,l):(e.enter("data"),d(R)))}function d(R){return R===null||R===124||Vt(R)?(e.exit("data"),l(R)):(e.consume(R),R===92?h:d)}function h(R){return R===92||R===124?(e.consume(R),d):d(R)}function m(R){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(R):(e.enter("tableDelimiterRow"),o=!1,mt(R)?vt(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):p(R))}function p(R){return R===45||R===58?g(R):R===124?(o=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),y):S(R)}function y(R){return mt(R)?vt(e,g,"whitespace")(R):g(R)}function g(R){return R===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),b):R===45?(a+=1,b(R)):R===null||qe(R)?_(R):S(R)}function b(R){return R===45?(e.enter("tableDelimiterFiller"),x(R)):S(R)}function x(R){return R===45?(e.consume(R),x):R===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(R))}function k(R){return mt(R)?vt(e,_,"whitespace")(R):_(R)}function _(R){return R===124?p(R):R===null||qe(R)?!o||s!==a?S(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(R)):S(R)}function S(R){return n(R)}function w(R){return e.enter("tableRow"),T(R)}function T(R){return R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),T):R===null||qe(R)?(e.exit("tableRow"),t(R)):mt(R)?vt(e,T,"whitespace")(R):(e.enter("data"),A(R))}function A(R){return R===null||R===124||Vt(R)?(e.exit("data"),T(R)):(e.consume(R),R===92?L:A)}function L(R){return R===92||R===124?(e.consume(R),A):A(R)}}function MOe(e,t){let n=-1,r=!0,s=0,a=[0,0,0,0],o=[0,0,0,0],i=!1,c=0,u,l,d;const h=new POe;for(;++n<e.length;){const m=e[n],p=m[1];m[0]==="enter"?p.type==="tableHead"?(i=!1,c!==0&&(XL(h,t,c,u,l),l=void 0,c=0),u={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},h.add(n,0,[["enter",u,t]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],i&&(i=!1,l={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},h.add(n,0,[["enter",l,t]])),s=p.type==="tableDelimiterRow"?2:l?3:1):s&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=ub(h,t,a,s,void 0,d),a=[0,0,0,0]),o[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=ub(h,t,a,s,void 0,d)),a=o,o=[a[1],n,0,0])):p.type==="tableHead"?(i=!0,c=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(c=n,a[1]!==0?(o[0]=o[1],d=ub(h,t,a,s,n,d)):o[1]!==0&&(d=ub(h,t,o,s,n,d)),s=0):s&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&XL(h,t,c,u,l),h.consume(t.events),n=-1;++n<t.events.length;){const m=t.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=LOe(t.events,n))}return e}function ub(e,t,n,r,s,a){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",i="tableContent";n[0]!==0&&(a.end=Object.assign({},hl(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const c=hl(t.events,n[1]);if(a={type:o,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const u=hl(t.events,n[2]),l=hl(t.events,n[3]),d={type:i,start:Object.assign({},u),end:Object.assign({},l)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const h=t.events[n[2]],m=t.events[n[3]];if(h[1].end=Object.assign({},m[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,y=n[3]-n[2]-1;e.add(p,y,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return s!==void 0&&(a.end=Object.assign({},hl(t.events,s)),e.add(s,0,[["exit",a,t]]),a=void 0),a}function XL(e,t,n,r,s){const a=[],o=hl(t.events,n);s&&(s.end=Object.assign({},o),a.push(["exit",s,t])),r.end=Object.assign({},o),a.push(["exit",r,t]),e.add(n+1,0,a)}function hl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const DOe={name:"tasklistCheck",tokenize:BOe};function FOe(){return{text:{91:DOe}}}function BOe(e,t,n){const r=this;return s;function s(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),a)}function a(c){return Vt(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),i):n(c)}function i(c){return qe(c)?t(c):mt(c)?e.check({tokenize:UOe},t,n)(c):n(c)}}function UOe(e,t,n){return vt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function zOe(e){return pH([XRe(),wOe(),ROe(e),$Oe(),FOe()])}const HOe={};function qOe(e){const t=this,n=e||HOe,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(zOe(n)),a.push(GRe()),o.push(KRe(n))}var VOe=Object.defineProperty,GOe=Object.defineProperties,KOe=Object.getOwnPropertyDescriptors,ZL=Object.getOwnPropertySymbols,WOe=Object.prototype.hasOwnProperty,YOe=Object.prototype.propertyIsEnumerable,e$=(e,t,n)=>t in e?VOe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,RH=(e,t)=>{for(var n in t||(t={}))WOe.call(t,n)&&e$(e,n,t[n]);if(ZL)for(var n of ZL(t))YOe.call(t,n)&&e$(e,n,t[n]);return e},PH=(e,t)=>GOe(e,KOe(t)),es=(e,t)=>{let n=!1,r=!1;for(let s=0;s<t;s+=1){if(e[s]==="\\"&&s+1<e.length&&e[s+1]==="`"){s+=1;continue}if(e.substring(s,s+3)==="```"){r=!r,s+=2;continue}!r&&e[s]==="`"&&(n=!n)}return n||r},JOe=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",s=t>1&&e.substring(t-2,t+1)==="```";return n||r||s},QOe=e=>{let t=0;for(let n=0;n<e.length;n+=1){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="`"){n+=1;continue}e[n]==="`"&&!JOe(e,n)&&(t+=1)}return t},Ui=(e,t)=>{let n=!1,r=!1,s=-1;for(let a=0;a<e.length;a+=1){if(e[a]==="\\"&&a+1<e.length&&e[a+1]==="`"){a+=1;continue}if(e.substring(a,a+3)==="```"){r=!r,a+=2;continue}if(!r&&e[a]==="`")if(n){if(s<t&&t<a)return!0;n=!1,s=-1}else n=!0,s=a}return!1},XOe=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,ZOe=e=>!e||typeof e!="string"||!e.includes(">")?e:e.replace(XOe,(t,n,r,s)=>es(e,s)?t:`${n}\\>${r}`),e3e=/(\*\*)([^*]*\*?)$/,t3e=/(__)([^_]*?)$/,n3e=/(\*\*\*)([^*]*?)$/,r3e=/(\*)([^*]*?)$/,s3e=/(_)([^_]*?)$/,a3e=/(`)([^`]*?)$/,o3e=/(~~)([^~]*?)$/,Du=/^[\s_~*`]*$/,OH=/^[\s]*[-*+][\s]+$/,i3e=/[\p{L}\p{N}_]/u,c3e=/^```[^`\n]*```?$/,u3e=/^\*{4,}$/,l3e=/(__)([^_]+)_$/,d3e=/(~~)([^~]+)~$/,t$=/~~/g,zi=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95?!0:i3e.test(e)},f3e=(e,t)=>{let n=1;for(let r=t-1;r>=0;r-=1)if(e[r]==="]")n+=1;else if(e[r]==="["&&(n-=1,n===0))return r;return-1},LH=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if(e[r]==="[")n+=1;else if(e[r]==="]"&&(n-=1,n===0))return r;return-1},wk=(e,t)=>{let n=!1,r=!1;for(let s=0;s<e.length&&s<t;s+=1){if(e[s]==="\\"&&e[s+1]==="$"){s+=1;continue}e[s]==="$"&&(e[s+1]==="$"?(r=!r,s+=1,n=!1):r||(n=!n))}return n||r},h3e=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===")")return!0;if(e[n]===`
|
|
203
|
-
`)return!1}return!1},$H=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===")")return!1;if(e[n]==="(")return n>0&&e[n-1]==="]"?h3e(e,t):!1;if(e[n]===`
|
|
204
|
-
`)return!1}return!1},m3e=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===">")return!1;if(e[n]==="<"){let r=n+1<e.length?e[n+1]:"";return r>="a"&&r<="z"||r>="A"&&r<="Z"||r==="/"}if(e[n]===`
|
|
205
|
-
`)return!1}return!1},W2=(e,t,n)=>{let r=0;for(let c=t-1;c>=0;c-=1)if(e[c]===`
|
|
206
|
-
`){r=c+1;break}let s=e.length;for(let c=t;c<e.length;c+=1)if(e[c]===`
|
|
207
|
-
`){s=c;break}let a=e.substring(r,s),o=0,i=!1;for(let c of a)if(c===n)o+=1;else if(c!==" "&&c!==" "){i=!0;break}return o>=3&&!i},p3e=(e,t,n,r)=>n==="\\"||e.includes("$")&&wk(e,t)?!0:n!=="*"&&r==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(n==="*"||n&&r&&zi(n)&&zi(r)||(!n||n===" "||n===" "||n===`
|
|
208
|
-
`)&&(!r||r===" "||r===" "||r===`
|
|
209
|
-
`)),jH=e=>{let t=0,n=!1,r=e.length;for(let s=0;s<r;s+=1){if(e[s]==="`"&&s+2<r&&e[s+1]==="`"&&e[s+2]==="`"){n=!n,s+=2;continue}if(n||e[s]!=="*")continue;let a=s>0?e[s-1]:"",o=s<r-1?e[s+1]:"";p3e(e,s,a,o)||(t+=1)}return t},g3e=(e,t,n,r)=>!!(n==="\\"||e.includes("$")&&wk(e,t)||$H(e,t)||m3e(e,t)||n==="_"||r==="_"||n&&r&&zi(n)&&zi(r)),b3e=e=>{let t=0,n=!1,r=e.length;for(let s=0;s<r;s+=1){if(e[s]==="`"&&s+2<r&&e[s+1]==="`"&&e[s+2]==="`"){n=!n,s+=2;continue}if(n||e[s]!=="_")continue;let a=s>0?e[s-1]:"",o=s<r-1?e[s+1]:"";g3e(e,s,a,o)||(t+=1)}return t},y3e=e=>{let t=0,n=0,r=!1;for(let s=0;s<e.length;s+=1){if(e[s]==="`"&&s+2<e.length&&e[s+1]==="`"&&e[s+2]==="`"){n>=3&&(t+=Math.floor(n/3)),n=0,r=!r,s+=2;continue}r||(e[s]==="*"?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0))}return n>=3&&(t+=Math.floor(n/3)),t},Y2=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="*"&&r+1<e.length&&e[r+1]==="*"&&(t+=1,r+=1)}return t},n$=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="_"&&r+1<e.length&&e[r+1]==="_"&&(t+=1,r+=1)}return t},x3e=(e,t,n)=>{if(!t||Du.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
210
|
-
`),s=r===-1?0:r+1,a=e.substring(s,n);return OH.test(a)&&t.includes(`
|
|
211
|
-
`)?!0:W2(e,n,"*")},k3e=e=>{let t=e.match(e3e);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return es(e,r)||Ui(e,r)||x3e(e,n,r)?e:Y2(e)%2===1?n.endsWith("*")?`${e}*`:`${e}**`:e},v3e=(e,t,n)=>{if(!t||Du.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
212
|
-
`),s=r===-1?0:r+1,a=e.substring(s,n);return OH.test(a)&&t.includes(`
|
|
213
|
-
`)?!0:W2(e,n,"_")},S3e=e=>{let t=e.match(t3e);if(!t){let s=e.match(l3e);if(s){let a=e.lastIndexOf(s[1]);if(!(es(e,a)||Ui(e,a))&&n$(e)%2===1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return es(e,r)||Ui(e,r)||v3e(e,n,r)?e:n$(e)%2===1?`${e}__`:e},w3e=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="*"&&e[n-1]!=="*"&&e[n+1]!=="*"&&e[n-1]!=="\\"&&!wk(e,n)){let r=n>0?e[n-1]:"",s=n<e.length-1?e[n+1]:"";if((!r||r===" "||r===" "||r===`
|
|
214
|
-
`)&&(!s||s===" "||s===" "||s===`
|
|
215
|
-
`)||r&&s&&zi(r)&&zi(s))continue;return n}}return-1},_3e=e=>{if(!e.match(r3e))return e;let t=w3e(e);if(t===-1||es(e,t)||Ui(e,t))return e;let n=e.substring(t+1);return!n||Du.test(n)?e:jH(e)%2===1?`${e}*`:e},MH=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="_"&&e[n-1]!=="_"&&e[n+1]!=="_"&&e[n-1]!=="\\"&&!wk(e,n)&&!$H(e,n)){let r=n>0?e[n-1]:"",s=n<e.length-1?e[n+1]:"";if(r&&s&&zi(r)&&zi(s))continue;return n}}return-1},E3e=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
216
|
-
`;)t-=1;if(t<e.length){let n=e.slice(0,t),r=e.slice(t);return`${n}_${r}`}return`${e}_`},T3e=e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if(Y2(t)%2!==1)return null;let n=t.indexOf("**"),r=MH(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},C3e=e=>{if(!e.match(s3e))return e;let t=MH(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||Du.test(n)||es(e,t)||Ui(e,t))return e;if(b3e(e)%2===1){let r=T3e(e);return r!==null?r:E3e(e)}return e},I3e=e=>{let t=Y2(e),n=jH(e);return t%2===0&&n%2===0},A3e=(e,t,n)=>!t||Du.test(t)||es(e,n)||Ui(e,n)?!0:W2(e,n,"*"),N3e=e=>{if(u3e.test(e))return e;let t=e.match(n3e);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return A3e(e,n,r)?e:y3e(e)%2===1?I3e(e)?e:`${e}***`:e},R3e=/<[a-zA-Z/][^>]*$/,P3e=e=>{let t=e.match(R3e);return!t||t.index===void 0||es(e,t.index)?e:e.substring(0,t.index).trimEnd()},O3e=e=>!e.match(c3e)||e.includes(`
|
|
217
|
-
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,L3e=e=>(e.match(/```/g)||[]).length%2===1,$3e=e=>{let t=O3e(e);if(t!==null)return t;let n=e.match(a3e);if(n&&!L3e(e)){let r=n[2];if(!r||Du.test(r))return e;if(QOe(e)%2===1)return`${e}\``}return e},j3e=(e,t)=>t>=2&&e.substring(t-2,t+1)==="```"||t>=1&&e.substring(t-1,t+2)==="```"||t<=e.length-3&&e.substring(t,t+3)==="```",M3e=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!j3e(e,r)&&(n=!n),!n&&e[r]==="$"&&e[r+1]==="$"&&(t+=1,r+=1);return t},D3e=e=>{let t=e.indexOf("$$");return t!==-1&&e.indexOf(`
|
|
218
|
-
`,t)!==-1&&!e.endsWith(`
|
|
219
|
-
`)?`${e}
|
|
220
|
-
$$`:`${e}$$`},F3e=e=>M3e(e)%2===0?e:D3e(e),B3e=(e,t,n)=>{if(e.substring(t+2).includes(")"))return null;let r=f3e(e,t);if(r===-1||es(e,r))return null;let s=r>0&&e[r-1]==="!",a=s?r-1:r,o=e.substring(0,a);if(s)return o;let i=e.substring(r+1,t);return n==="text-only"?`${o}${i}`:`${o}[${i}](streamdown:incomplete-link)`},r$=(e,t)=>{for(let n=0;n<t;n++)if(e[n]==="["&&!es(e,n)){if(n>0&&e[n-1]==="!")continue;let r=LH(e,n);if(r===-1)return n;if(r+1<e.length&&e[r+1]==="("){let s=e.indexOf(")",r+2);s!==-1&&(n=s)}}return t},U3e=(e,t,n)=>{let r=t>0&&e[t-1]==="!",s=r?t-1:t;if(!e.substring(t+1).includes("]")){let a=e.substring(0,s);if(r)return a;if(n==="text-only"){let o=r$(e,t);return e.substring(0,o)+e.substring(o+1)}return`${e}](streamdown:incomplete-link)`}if(LH(e,t)===-1){let a=e.substring(0,s);if(r)return a;if(n==="text-only"){let o=r$(e,t);return e.substring(0,o)+e.substring(o+1)}return`${e}](streamdown:incomplete-link)`}return null},DH=(e,t="protocol")=>{let n=e.lastIndexOf("](");if(n!==-1&&!es(e,n)){let r=B3e(e,n,t);if(r!==null)return r}for(let r=e.length-1;r>=0;r-=1)if(e[r]==="["&&!es(e,r)){let s=U3e(e,r,t);if(s!==null)return s}return e},z3e=/^-{1,2}$/,H3e=/^[\s]*-{1,2}[\s]+$/,q3e=/^={1,2}$/,V3e=/^[\s]*={1,2}[\s]+$/,G3e=e=>{if(!e||typeof e!="string")return e;let t=e.lastIndexOf(`
|
|
221
|
-
`);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),s=n.trim();if(z3e.test(s)&&!n.match(H3e)){let a=r.split(`
|
|
222
|
-
`).at(-1);if(a&&a.trim().length>0)return`${e}`}if(q3e.test(s)&&!n.match(V3e)){let a=r.split(`
|
|
223
|
-
`).at(-1);if(a&&a.trim().length>0)return`${e}`}return e},K3e=e=>{var t,n;let r=e.match(o3e);if(r){let s=r[2];if(!s||Du.test(s))return e;let a=e.lastIndexOf(r[1]);if(es(e,a)||Ui(e,a))return e;if(((t=e.match(t$))==null?void 0:t.length)%2===1)return`${e}~~`}else{let s=e.match(d3e);if(s){let a=e.lastIndexOf(s[0].slice(0,2));if(es(e,a)||Ui(e,a))return e;if(((n=e.match(t$))==null?void 0:n.length)%2===1)return`${e}~`}}return e},ES=e=>e!==!1,us={COMPARISON_OPERATORS:-10,HTML_TAGS:-5,SETEXT_HEADINGS:0,LINKS:10,BOLD_ITALIC:20,BOLD:30,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,DEFAULT:100},W3e=[{handler:{name:"comparisonOperators",handle:ZOe,priority:us.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:P3e,priority:us.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:G3e,priority:us.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:DH,priority:us.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:N3e,priority:us.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:k3e,priority:us.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:S3e,priority:us.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:_3e,priority:us.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:C3e,priority:us.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:$3e,priority:us.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:K3e,priority:us.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:F3e,priority:us.KATEX},optionKey:"katex"}],Y3e=e=>{var t;let n=(t=e?.linkMode)!=null?t:"protocol";return W3e.filter(({handler:r,optionKey:s})=>r.name==="links"?ES(e?.links)||ES(e?.images):ES(e?.[s])).map(({handler:r,earlyReturn:s})=>r.name==="links"?{handler:PH(RH({},r),{handle:a=>DH(a,n)}),earlyReturn:n==="protocol"?s:void 0}:{handler:r,earlyReturn:s})},J3e=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,s=Y3e(t),a=((n=t?.handlers)!=null?n:[]).map(i=>{var c;return{handler:PH(RH({},i),{priority:(c=i.priority)!=null?c:us.DEFAULT}),earlyReturn:void 0}}),o=[...s,...a].sort((i,c)=>{var u,l;return((u=i.handler.priority)!=null?u:0)-((l=c.handler.priority)!=null?l:0)});for(let{handler:i,earlyReturn:c}of o)if(r=i.handle(r),c!=null&&c(r))return r;return r},Q3e=J3e;const X3e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Z3e=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,eLe={};function s$(e,t){return(eLe.jsx?Z3e:X3e).test(e)}var nl={},TS,a$;function tLe(){if(a$)return TS;a$=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,i=/^\s+|\s+$/g,c=`
|
|
224
|
-
`,u="/",l="*",d="",h="comment",m="declaration";function p(g,b){if(typeof g!="string")throw new TypeError("First argument must be a string");if(!g)return[];b=b||{};var x=1,k=1;function _(Y){var W=Y.match(t);W&&(x+=W.length);var J=Y.lastIndexOf(c);k=~J?Y.length-J:k+Y.length}function S(){var Y={line:x,column:k};return function(W){return W.position=new w(Y),L(),W}}function w(Y){this.start=Y,this.end={line:x,column:k},this.source=b.source}w.prototype.content=g;function T(Y){var W=new Error(b.source+":"+x+":"+k+": "+Y);if(W.reason=Y,W.filename=b.source,W.line=x,W.column=k,W.source=g,!b.silent)throw W}function A(Y){var W=Y.exec(g);if(W){var J=W[0];return _(J),g=g.slice(J.length),W}}function L(){A(n)}function R(Y){var W;for(Y=Y||[];W=j();)W!==!1&&Y.push(W);return Y}function j(){var Y=S();if(!(u!=g.charAt(0)||l!=g.charAt(1))){for(var W=2;d!=g.charAt(W)&&(l!=g.charAt(W)||u!=g.charAt(W+1));)++W;if(W+=2,d===g.charAt(W-1))return T("End of comment missing");var J=g.slice(2,W-2);return k+=2,_(J),g=g.slice(W),k+=2,Y({type:h,comment:J})}}function F(){var Y=S(),W=A(r);if(W){if(j(),!A(s))return T("property missing ':'");var J=A(a),ae=Y({type:m,property:y(W[0].replace(e,d)),value:J?y(J[0].replace(e,d)):d});return A(o),ae}}function K(){var Y=[];R(Y);for(var W;W=F();)W!==!1&&(Y.push(W),R(Y));return Y}return L(),K()}function y(g){return g?g.replace(i,d):d}return TS=p,TS}var o$;function nLe(){if(o$)return nl;o$=1;var e=nl&&nl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(nl,"__esModule",{value:!0}),nl.default=n;const t=e(tLe());function n(r,s){let a=null;if(!r||typeof r!="string")return a;const o=(0,t.default)(r),i=typeof s=="function";return o.forEach(c=>{if(c.type!=="declaration")return;const{property:u,value:l}=c;i?s(u,l,c):l&&(a=a||{},a[u]=l)}),a}return nl}var jf={},i$;function rLe(){if(i$)return jf;i$=1,Object.defineProperty(jf,"__esModule",{value:!0}),jf.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(u){return!u||n.test(u)||e.test(u)},o=function(u,l){return l.toUpperCase()},i=function(u,l){return"".concat(l,"-")},c=function(u,l){return l===void 0&&(l={}),a(u)?u:(u=u.toLowerCase(),l.reactCompat?u=u.replace(s,i):u=u.replace(r,i),u.replace(t,o))};return jf.camelCase=c,jf}var Mf,c$;function sLe(){if(c$)return Mf;c$=1;var e=Mf&&Mf.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(nLe()),n=rLe();function r(s,a){var o={};return!s||typeof s!="string"||(0,t.default)(s,function(i,c){i&&c&&(o[(0,n.camelCase)(i,a)]=c)}),o}return r.default=r,Mf=r,Mf}var aLe=sLe();const oLe=p1(aLe);function Dh(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?u$(e.position):"start"in e||"end"in e?u$(e):"line"in e||"column"in e?vE(e):""}function vE(e){return l$(e&&e.line)+":"+l$(e&&e.column)}function u$(e){return vE(e&&e.start)+"-"+vE(e&&e.end)}function l$(e){return e&&typeof e=="number"?e:1}class Ar extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?s=t:!a.cause&&t&&(o=!0,s=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?a.ruleId=r:(a.source=r.slice(0,c),a.ruleId=r.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){const c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.position)}const i=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=i?i.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=i?i.line:void 0,this.name=Dh(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ar.prototype.file="";Ar.prototype.name="";Ar.prototype.reason="";Ar.prototype.message="";Ar.prototype.stack="";Ar.prototype.column=void 0;Ar.prototype.line=void 0;Ar.prototype.ancestors=void 0;Ar.prototype.cause=void 0;Ar.prototype.fatal=void 0;Ar.prototype.place=void 0;Ar.prototype.ruleId=void 0;Ar.prototype.source=void 0;const J2={}.hasOwnProperty,iLe=new Map,cLe=/[A-Z]/g,uLe=new Set(["table","tbody","thead","tfoot","tr"]),lLe=new Set(["td","th"]),FH="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function dLe(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=xLe(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=yLe(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ao:Yd,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=BH(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function BH(e,t,n){if(t.type==="element")return fLe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return hLe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return pLe(e,t,n);if(t.type==="mdxjsEsm")return mLe(e,t);if(t.type==="root")return gLe(e,t,n);if(t.type==="text")return bLe(e,t)}function fLe(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=ao,e.schema=s),e.ancestors.push(t);const a=zH(e,t.tagName,!1),o=kLe(e,t);let i=X2(e,t);return uLe.has(t.tagName)&&(i=i.filter(function(c){return typeof c=="string"?!ik(c):!0})),UH(e,o,a,t),Q2(o,i),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function hLe(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Rm(e,t.position)}function mLe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Rm(e,t.position)}function pLe(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=ao,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:zH(e,t.name,!0),o=vLe(e,t),i=X2(e,t);return UH(e,o,a,t),Q2(o,i),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function gLe(e,t,n){const r={};return Q2(r,X2(e,t)),e.create(t,e.Fragment,r,n)}function bLe(e,t){return t.value}function UH(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Q2(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function yLe(e,t,n){return r;function r(s,a,o,i){const u=Array.isArray(o.children)?n:t;return i?u(a,o,i):u(a,o)}}function xLe(e,t){return n;function n(r,s,a,o){const i=Array.isArray(a.children),c=oo(r);return t(s,a,o,i,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function kLe(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&J2.call(t.properties,s)){const a=SLe(e,s,t.properties[s]);if(a){const[o,i]=a;e.tableCellAlignToStyle&&o==="align"&&typeof i=="string"&&lLe.has(t.tagName)?r=i:n[o]=i}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function vLe(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const i=o.properties[0];i.type,Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else Rm(e,t.position);else{const s=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const i=r.value.data.estree.body[0];i.type,a=e.evaluater.evaluateExpression(i.expression)}else Rm(e,t.position);else a=r.value===null?!0:r.value;n[s]=a}return n}function X2(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:iLe;for(;++r<t.children.length;){const a=t.children[r];let o;if(e.passKeys){const c=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(c){const u=s.get(c)||0;o=c+"-"+u,s.set(c,u+1)}}const i=BH(e,a,o);i!==void 0&&n.push(i)}return n}function SLe(e,t,n){const r=Ap(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?p2(n):g2(n)),r.property==="style"){let s=typeof n=="object"?n:wLe(e,String(n));return e.stylePropertyNameCase==="css"&&(s=_Le(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?wwe[r.property]||r.property:r.attribute,n]}}function wLe(e,t){try{return oLe(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new Ar("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=FH+"#cannot-parse-style-attribute",s}}function zH(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let a=-1,o;for(;++a<s.length;){const i=s$(s[a])?{type:"Identifier",name:s[a]}:{type:"Literal",value:s[a]};o=o?{type:"MemberExpression",object:o,property:i,computed:!!(a&&i.type==="Literal"),optional:!1}:i}r=o}else r=s$(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return J2.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);Rm(e)}function Rm(e,t){const n=new Ar("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=FH+"#cannot-handle-mdx-estrees-without-createevaluater",n}function _Le(e){const t={};let n;for(n in e)J2.call(e,n)&&(t[ELe(n)]=e[n]);return t}function ELe(e){let t=e.replace(cLe,TLe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function TLe(e){return"-"+e.toLowerCase()}const CS={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},CLe={tokenize:ILe};function ILe(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),vt(e,t,"linePrefix")}function s(i){return e.enter("paragraph"),a(i)}function a(i){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,o(i)}function o(i){if(i===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(i);return}return qe(i)?(e.consume(i),e.exit("chunkText"),a):(e.consume(i),o)}}const ALe={tokenize:NLe},d$={tokenize:RLe};function NLe(e){const t=this,n=[];let r=0,s,a,o;return i;function i(k){if(r<n.length){const _=n[r];return t.containerState=_[1],e.attempt(_[0].continuation,c,u)(k)}return u(k)}function c(k){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&x();const _=t.events.length;let S=_,w;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){w=t.events[S][1].end;break}b(r);let T=_;for(;T<t.events.length;)t.events[T][1].end={...w},T++;return vs(t.events,S+1,0,t.events.slice(_)),t.events.length=T,u(k)}return i(k)}function u(k){if(r===n.length){if(!s)return h(k);if(s.currentConstruct&&s.currentConstruct.concrete)return p(k);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(d$,l,d)(k)}function l(k){return s&&x(),b(r),h(k)}function d(k){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,p(k)}function h(k){return t.containerState={},e.attempt(d$,m,p)(k)}function m(k){return r++,n.push([t.currentConstruct,t.containerState]),h(k)}function p(k){if(k===null){s&&x(),b(0),e.consume(k);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:a}),y(k)}function y(k){if(k===null){g(e.exit("chunkFlow"),!0),b(0),e.consume(k);return}return qe(k)?(e.consume(k),g(e.exit("chunkFlow")),r=0,t.interrupt=void 0,i):(e.consume(k),y)}function g(k,_){const S=t.sliceStream(k);if(_&&S.push(null),k.previous=a,a&&(a.next=k),a=k,s.defineSkip(k.start),s.write(S),t.parser.lazy[k.start.line]){let w=s.events.length;for(;w--;)if(s.events[w][1].start.offset<o&&(!s.events[w][1].end||s.events[w][1].end.offset>o))return;const T=t.events.length;let A=T,L,R;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){if(L){R=t.events[A][1].end;break}L=!0}for(b(r),w=T;w<t.events.length;)t.events[w][1].end={...R},w++;vs(t.events,A+1,0,t.events.slice(T)),t.events.length=w}}function b(k){let _=n.length;for(;_-- >k;){const S=n[_];t.containerState=S[1],S[0].exit.call(t,e)}n.length=k}function x(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function RLe(e,t,n){return vt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const PLe={tokenize:OLe};function OLe(e){const t=this,n=e.attempt(Lp,r,e.attempt(this.parser.constructs.flowInitial,s,vt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(IPe,s)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const LLe={resolveAll:qH()},$Le=HH("string"),jLe=HH("text");function HH(e){return{resolveAll:qH(e==="text"?MLe:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],a=n.attempt(s,o,i);return o;function o(l){return u(l)?a(l):i(l)}function i(l){if(l===null){n.consume(l);return}return n.enter("data"),n.consume(l),c}function c(l){return u(l)?(n.exit("data"),a(l)):(n.consume(l),c)}function u(l){if(l===null)return!0;const d=s[l];let h=-1;if(d)for(;++h<d.length;){const m=d[h];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function qH(e){return t;function t(n,r){let s=-1,a;for(;++s<=n.length;)a===void 0?n[s]&&n[s][1].type==="data"&&(a=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==a+2&&(n[a][1].end=n[s-1][1].end,n.splice(a+2,s-a-2),s=a+2),a=void 0);return e?e(n,r):n}}function MLe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let a=s.length,o=-1,i=0,c;for(;a--;){const u=s[a];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)i++,o--;if(o)break;o=-1}else if(u===-2)c=!0,i++;else if(u!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(i=0),i){const u={type:n===e.length||c||i<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-i,offset:r.end.offset-i},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const DLe={42:Vr,43:Vr,45:Vr,48:Vr,49:Vr,50:Vr,51:Vr,52:Vr,53:Vr,54:Vr,55:Vr,56:Vr,57:Vr,62:_H},FLe={91:OPe},BLe={[-2]:wS,[-1]:wS,32:wS},ULe={35:FPe,42:iy,45:[QL,iy],60:HPe,61:QL,95:iy,96:YL,126:YL},zLe={38:TH,92:EH},HLe={[-5]:_S,[-4]:_S,[-3]:_S,33:iOe,38:TH,42:kE,60:[uPe,JPe],91:uOe,92:[MPe,EH],93:K2,95:kE,96:SPe},qLe={null:[kE,LLe]},VLe={null:[42,95]},GLe={null:[]},KLe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:VLe,contentInitial:FLe,disable:GLe,document:DLe,flow:ULe,flowInitial:BLe,insideSpan:qLe,string:zLe,text:HLe},Symbol.toStringTag,{value:"Module"}));function WLe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},a=[];let o=[],i=[];const c={attempt:T(S),check:T(w),consume:x,enter:k,exit:_,interrupt:T(w,{interrupt:!0})},u={code:null,containerState:{},defineSkip:y,events:[],now:p,parser:e,previous:null,sliceSerialize:h,sliceStream:m,write:d};let l=t.tokenize.call(u,c);return t.resolveAll&&a.push(t),u;function d(j){return o=js(o,j),g(),o[o.length-1]!==null?[]:(A(t,0),u.events=Sk(a,u.events,u),u.events)}function h(j,F){return JLe(m(j),F)}function m(j){return YLe(o,j)}function p(){const{_bufferIndex:j,_index:F,line:K,column:Y,offset:W}=r;return{_bufferIndex:j,_index:F,line:K,column:Y,offset:W}}function y(j){s[j.line]=j.column,R()}function g(){let j;for(;r._index<o.length;){const F=o[r._index];if(typeof F=="string")for(j=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===j&&r._bufferIndex<F.length;)b(F.charCodeAt(r._bufferIndex));else b(F)}}function b(j){l=l(j)}function x(j){qe(j)?(r.line++,r.column=1,r.offset+=j===-3?2:1,R()):j!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=j}function k(j,F){const K=F||{};return K.type=j,K.start=p(),u.events.push(["enter",K,u]),i.push(K),K}function _(j){const F=i.pop();return F.end=p(),u.events.push(["exit",F,u]),F}function S(j,F){A(j,F.from)}function w(j,F){F.restore()}function T(j,F){return K;function K(Y,W,J){let ae,ge,le,I;return Array.isArray(Y)?V(Y):"tokenize"in Y?V([Y]):U(Y);function U(Q){return pe;function pe(ce){const Ee=ce!==null&&Q[ce],Ne=ce!==null&&Q.null,G=[...Array.isArray(Ee)?Ee:Ee?[Ee]:[],...Array.isArray(Ne)?Ne:Ne?[Ne]:[]];return V(G)(ce)}}function V(Q){return ae=Q,ge=0,Q.length===0?J:N(Q[ge])}function N(Q){return pe;function pe(ce){return I=L(),le=Q,Q.partial||(u.currentConstruct=Q),Q.name&&u.parser.constructs.disable.null.includes(Q.name)?D():Q.tokenize.call(F?Object.assign(Object.create(u),F):u,c,P,D)(ce)}}function P(Q){return j(le,I),W}function D(Q){return I.restore(),++ge<ae.length?N(ae[ge]):J}}}function A(j,F){j.resolveAll&&!a.includes(j)&&a.push(j),j.resolve&&vs(u.events,F,u.events.length-F,j.resolve(u.events.slice(F),u)),j.resolveTo&&(u.events=j.resolveTo(u.events,u))}function L(){const j=p(),F=u.previous,K=u.currentConstruct,Y=u.events.length,W=Array.from(i);return{from:Y,restore:J};function J(){r=j,u.previous=F,u.currentConstruct=K,u.events.length=Y,i=W,R()}}function R(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function YLe(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,a=t.end._bufferIndex;let o;if(n===s)o=[e[n].slice(r,a)];else{if(o=e.slice(n,s),r>-1){const i=o[0];typeof i=="string"?o[0]=i.slice(r):o.shift()}a>0&&o.push(e[s].slice(0,a))}return o}function JLe(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const a=e[n];let o;if(typeof a=="string")o=a;else switch(a){case-5:{o="\r";break}case-4:{o=`
|
|
225
|
-
`;break}case-3:{o=`\r
|
|
226
|
-
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&s)continue;o=" ";break}default:o=String.fromCharCode(a)}s=a===-2,r.push(o)}return r.join("")}function QLe(e){const r={constructs:pH([KLe,...(e||{}).extensions||[]]),content:s(CLe),defined:[],document:s(ALe),flow:s(PLe),lazy:{},string:s($Le),text:s(jLe)};return r;function s(a){return o;function o(i){return WLe(r,a,i)}}}function XLe(e){for(;!CH(e););return e}const f$=/[\0\t\n\r]/g;function ZLe(){let e=1,t="",n=!0,r;return s;function s(a,o,i){const c=[];let u,l,d,h,m;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),d=0,t="",n&&(a.charCodeAt(0)===65279&&d++,n=void 0);d<a.length;){if(f$.lastIndex=d,u=f$.exec(a),h=u&&u.index!==void 0?u.index:a.length,m=a.charCodeAt(h),!u){t=a.slice(d);break}if(m===10&&d===h&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),d<h&&(c.push(a.slice(d,h)),e+=h-d),m){case 0:{c.push(65533),e++;break}case 9:{for(l=Math.ceil(e/4)*4,c.push(-2);e++<l;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return i&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const VH={}.hasOwnProperty;function e$e(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),t$e(n)(XLe(QLe(n).document().write(ZLe()(e,t,!0))))}function t$e(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(ze),autolinkProtocol:L,autolinkEmail:L,atxHeading:a(be),blockQuote:a(Ne),characterEscape:L,characterReference:L,codeFenced:a(G),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(G,o),codeText:a(X,o),codeTextData:L,data:L,codeFlowValue:L,definition:a(ee),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(oe),hardBreakEscape:a(Oe),hardBreakTrailing:a(Oe),htmlFlow:a(fe,o),htmlFlowData:L,htmlText:a(fe,o),htmlTextData:L,image:a(ve),label:o,link:a(ze),listItem:a(re),listItemValue:h,listOrdered:a(Se,d),listUnordered:a(Se),paragraph:a(Ie),reference:N,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(be),strong:a(We),thematicBreak:a(an)},exit:{atxHeading:c(),atxHeadingSequence:S,autolink:c(),autolinkEmail:Ee,autolinkProtocol:ce,blockQuote:c(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:D,characterReferenceMarkerNumeric:D,characterReferenceValue:Q,characterReference:pe,codeFenced:c(g),codeFencedFence:y,codeFencedFenceInfo:m,codeFencedFenceMeta:p,codeFlowValue:R,codeIndented:c(b),codeText:c(W),codeTextData:R,data:R,definition:c(),definitionDestinationString:_,definitionLabelString:x,definitionTitleString:k,emphasis:c(),hardBreakEscape:c(F),hardBreakTrailing:c(F),htmlFlow:c(K),htmlFlowData:R,htmlText:c(Y),htmlTextData:R,image:c(ae),label:le,labelText:ge,lineEnding:j,link:c(J),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:P,resourceDestinationString:I,resourceTitleString:U,resource:V,setextHeading:c(A),setextHeadingLineSequence:T,setextHeadingText:w,strong:c(),thematicBreak:c()}};GH(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(te){let ue={type:"root",children:[]};const $e={stack:[ue],tokenStack:[],config:t,enter:i,exit:u,buffer:o,resume:l,data:n},we=[];let Ge=-1;for(;++Ge<te.length;)if(te[Ge][1].type==="listOrdered"||te[Ge][1].type==="listUnordered")if(te[Ge][0]==="enter")we.push(Ge);else{const Re=we.pop();Ge=s(te,Re,Ge)}for(Ge=-1;++Ge<te.length;){const Re=t[te[Ge][0]];VH.call(Re,te[Ge][1].type)&&Re[te[Ge][1].type].call(Object.assign({sliceSerialize:te[Ge][2].sliceSerialize},$e),te[Ge][1])}if($e.tokenStack.length>0){const Re=$e.tokenStack[$e.tokenStack.length-1];(Re[1]||h$).call($e,void 0,Re[0])}for(ue.position={start:ei(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:ei(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},Ge=-1;++Ge<t.transforms.length;)ue=t.transforms[Ge](ue)||ue;return ue}function s(te,ue,$e){let we=ue-1,Ge=-1,Re=!1,as,yr,Yo,oc;for(;++we<=$e;){const Nr=te[we];switch(Nr[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Nr[0]==="enter"?Ge++:Ge--,oc=void 0;break}case"lineEndingBlank":{Nr[0]==="enter"&&(as&&!oc&&!Ge&&!Yo&&(Yo=we),oc=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:oc=void 0}if(!Ge&&Nr[0]==="enter"&&Nr[1].type==="listItemPrefix"||Ge===-1&&Nr[0]==="exit"&&(Nr[1].type==="listUnordered"||Nr[1].type==="listOrdered")){if(as){let Jo=we;for(yr=void 0;Jo--;){const Xs=te[Jo];if(Xs[1].type==="lineEnding"||Xs[1].type==="lineEndingBlank"){if(Xs[0]==="exit")continue;yr&&(te[yr][1].type="lineEndingBlank",Re=!0),Xs[1].type="lineEnding",yr=Jo}else if(!(Xs[1].type==="linePrefix"||Xs[1].type==="blockQuotePrefix"||Xs[1].type==="blockQuotePrefixWhitespace"||Xs[1].type==="blockQuoteMarker"||Xs[1].type==="listItemIndent"))break}Yo&&(!yr||Yo<yr)&&(as._spread=!0),as.end=Object.assign({},yr?te[yr][1].start:Nr[1].end),te.splice(yr||we,0,["exit",as,Nr[2]]),we++,$e++}if(Nr[1].type==="listItemPrefix"){const Jo={type:"listItem",_spread:!1,start:Object.assign({},Nr[1].start),end:void 0};as=Jo,te.splice(we,0,["enter",Jo,Nr[2]]),we++,$e++,Yo=void 0,oc=!0}}}return te[ue][1]._spread=Re,$e}function a(te,ue){return $e;function $e(we){i.call(this,te(we),we),ue&&ue.call(this,we)}}function o(){this.stack.push({type:"fragment",children:[]})}function i(te,ue,$e){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([ue,$e||void 0]),te.position={start:ei(ue.start),end:void 0}}function c(te){return ue;function ue($e){te&&te.call(this,$e),u.call(this,$e)}}function u(te,ue){const $e=this.stack.pop(),we=this.tokenStack.pop();if(we)we[0].type!==te.type&&(ue?ue.call(this,te,we[0]):(we[1]||h$).call(this,te,we[0]));else throw new Error("Cannot close `"+te.type+"` ("+Dh({start:te.start,end:te.end})+"): it’s not open");$e.position.end=ei(te.end)}function l(){return H2(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(te){if(this.data.expectingFirstListItemValue){const ue=this.stack[this.stack.length-2];ue.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function m(){const te=this.resume(),ue=this.stack[this.stack.length-1];ue.lang=te}function p(){const te=this.resume(),ue=this.stack[this.stack.length-1];ue.meta=te}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const te=this.resume(),ue=this.stack[this.stack.length-1];ue.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const te=this.resume(),ue=this.stack[this.stack.length-1];ue.value=te.replace(/(\r?\n|\r)$/g,"")}function x(te){const ue=this.resume(),$e=this.stack[this.stack.length-1];$e.label=ue,$e.identifier=pa(this.sliceSerialize(te)).toLowerCase()}function k(){const te=this.resume(),ue=this.stack[this.stack.length-1];ue.title=te}function _(){const te=this.resume(),ue=this.stack[this.stack.length-1];ue.url=te}function S(te){const ue=this.stack[this.stack.length-1];if(!ue.depth){const $e=this.sliceSerialize(te).length;ue.depth=$e}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function T(te){const ue=this.stack[this.stack.length-1];ue.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function A(){this.data.setextHeadingSlurpLineEnding=void 0}function L(te){const $e=this.stack[this.stack.length-1].children;let we=$e[$e.length-1];(!we||we.type!=="text")&&(we=Ft(),we.position={start:ei(te.start),end:void 0},$e.push(we)),this.stack.push(we)}function R(te){const ue=this.stack.pop();ue.value+=this.sliceSerialize(te),ue.position.end=ei(te.end)}function j(te){const ue=this.stack[this.stack.length-1];if(this.data.atHardBreak){const $e=ue.children[ue.children.length-1];$e.position.end=ei(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ue.type)&&(L.call(this,te),R.call(this,te))}function F(){this.data.atHardBreak=!0}function K(){const te=this.resume(),ue=this.stack[this.stack.length-1];ue.value=te}function Y(){const te=this.resume(),ue=this.stack[this.stack.length-1];ue.value=te}function W(){const te=this.resume(),ue=this.stack[this.stack.length-1];ue.value=te}function J(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const ue=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=ue,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function ae(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const ue=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=ue,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function ge(te){const ue=this.sliceSerialize(te),$e=this.stack[this.stack.length-2];$e.label=ORe(ue),$e.identifier=pa(ue).toLowerCase()}function le(){const te=this.stack[this.stack.length-1],ue=this.resume(),$e=this.stack[this.stack.length-1];if(this.data.inReference=!0,$e.type==="link"){const we=te.children;$e.children=we}else $e.alt=ue}function I(){const te=this.resume(),ue=this.stack[this.stack.length-1];ue.url=te}function U(){const te=this.resume(),ue=this.stack[this.stack.length-1];ue.title=te}function V(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function P(te){const ue=this.resume(),$e=this.stack[this.stack.length-1];$e.label=ue,$e.identifier=pa(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function D(te){this.data.characterReferenceType=te.type}function Q(te){const ue=this.sliceSerialize(te),$e=this.data.characterReferenceType;let we;$e?(we=mH(ue,$e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):we=V2(ue);const Ge=this.stack[this.stack.length-1];Ge.value+=we}function pe(te){const ue=this.stack.pop();ue.position.end=ei(te.end)}function ce(te){R.call(this,te);const ue=this.stack[this.stack.length-1];ue.url=this.sliceSerialize(te)}function Ee(te){R.call(this,te);const ue=this.stack[this.stack.length-1];ue.url="mailto:"+this.sliceSerialize(te)}function Ne(){return{type:"blockquote",children:[]}}function G(){return{type:"code",lang:null,meta:null,value:""}}function X(){return{type:"inlineCode",value:""}}function ee(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function oe(){return{type:"emphasis",children:[]}}function be(){return{type:"heading",depth:0,children:[]}}function Oe(){return{type:"break"}}function fe(){return{type:"html",value:""}}function ve(){return{type:"image",title:null,url:"",alt:null}}function ze(){return{type:"link",title:null,url:"",children:[]}}function Se(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function re(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function Ie(){return{type:"paragraph",children:[]}}function We(){return{type:"strong",children:[]}}function Ft(){return{type:"text",value:""}}function an(){return{type:"thematicBreak"}}}function ei(e){return{line:e.line,column:e.column,offset:e.offset}}function GH(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?GH(e,r):n$e(e,r)}}function n$e(e,t){let n;for(n in t)if(VH.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function h$(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Dh({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Dh({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Dh({start:t.start,end:t.end})+") is still open")}function r$e(e){const t=this;t.parser=n;function n(r){return e$e(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function s$e(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function a$e(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
227
|
-
`}]}function o$e(e,t){const n=t.value?t.value+`
|
|
228
|
-
`:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function i$e(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function c$e(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function u$e(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=rf(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,i=e.footnoteCounts.get(r);i===void 0?(i=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,i+=1,e.footnoteCounts.set(r,i);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(i>1?"-"+i:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function l$e(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function d$e(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function KH(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),a=s[0];a&&a.type==="text"?a.value="["+a.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=r:s.push({type:"text",value:r}),s}function f$e(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return KH(e,t);const s={src:rf(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,a),e.applyData(t,a)}function h$e(e,t){const n={src:rf(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function m$e(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function p$e(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return KH(e,t);const s={href:rf(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function g$e(e,t){const n={href:rf(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function b$e(e,t,n){const r=e.all(t),s=n?y$e(n):WH(t),a={},o=[];if(typeof t.checked=="boolean"){const l=r[0];let d;l&&l.type==="element"&&l.tagName==="p"?d=l:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let i=-1;for(;++i<r.length;){const l=r[i];(s||i!==0||l.type!=="element"||l.tagName!=="p")&&o.push({type:"text",value:`
|
|
229
|
-
`}),l.type==="element"&&l.tagName==="p"&&!s?o.push(...l.children):o.push(l)}const c=r[r.length-1];c&&(s||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
|
|
230
|
-
`});const u={type:"element",tagName:"li",properties:a,children:o};return e.patch(t,u),e.applyData(t,u)}function y$e(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=WH(n[r])}return t}function WH(e){const t=e.spread;return t??e.children.length>1}function x$e(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const o=r[s];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function k$e(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function v$e(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function S$e(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function w$e(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),s.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=oo(t.children[1]),c=kk(t.children[t.children.length-1]);i&&c&&(o.position={start:i,end:c}),s.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,a),e.applyData(t,a)}function _$e(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,i=o?o.length:t.children.length;let c=-1;const u=[];for(;++c<i;){const d=t.children[c],h={},m=o?o[c]:void 0;m&&(h.align=m);let p={type:"element",tagName:a,properties:h,children:[]};d&&(p.children=e.all(d),e.patch(d,p),p=e.applyData(d,p)),u.push(p)}const l={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,l),e.applyData(t,l)}function E$e(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const m$=9,p$=32;function T$e(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const a=[];for(;r;)a.push(g$(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return a.push(g$(t.slice(s),s>0,!1)),a.join("")}function g$(e,t,n){let r=0,s=e.length;if(t){let a=e.codePointAt(r);for(;a===m$||a===p$;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(s-1);for(;a===m$||a===p$;)s--,a=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function C$e(e,t){const n={type:"text",value:T$e(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function I$e(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const A$e={blockquote:s$e,break:a$e,code:o$e,delete:i$e,emphasis:c$e,footnoteReference:u$e,heading:l$e,html:d$e,imageReference:f$e,image:h$e,inlineCode:m$e,linkReference:p$e,link:g$e,listItem:b$e,list:x$e,paragraph:k$e,root:v$e,strong:S$e,table:w$e,tableCell:E$e,tableRow:_$e,text:C$e,thematicBreak:I$e,toml:lb,yaml:lb,definition:lb,footnoteDefinition:lb};function lb(){}function N$e(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function R$e(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function P$e(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||N$e,r=e.options.footnoteBackLabel||R$e,s=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},i=[];let c=-1;for(;++c<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[c]);if(!u)continue;const l=e.all(u),d=String(u.identifier).toUpperCase(),h=rf(d.toLowerCase());let m=0;const p=[],y=e.footnoteCounts.get(d);for(;y!==void 0&&++m<=y;){p.length>0&&p.push({type:"text",value:" "});let x=typeof n=="string"?n:n(c,m);typeof x=="string"&&(x={type:"text",value:x}),p.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,m),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const g=l[l.length-1];if(g&&g.type==="element"&&g.tagName==="p"){const x=g.children[g.children.length-1];x&&x.type==="text"?x.value+=" ":g.children.push({type:"text",value:" "}),g.children.push(...p)}else l.push(...p);const b={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(l,!0)};e.patch(u,b),i.push(b)}if(i.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...xu(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
231
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(i,!0)},{type:"text",value:`
|
|
232
|
-
`}]}}const SE={}.hasOwnProperty,O$e={};function L$e(e,t){const n=t||O$e,r=new Map,s=new Map,a=new Map,o={...A$e,...n.handlers},i={all:u,applyData:j$e,definitionById:r,footnoteById:s,footnoteCounts:a,footnoteOrder:[],handlers:o,one:c,options:n,patch:$$e,wrap:D$e};return Za(e,function(l){if(l.type==="definition"||l.type==="footnoteDefinition"){const d=l.type==="definition"?r:s,h=String(l.identifier).toUpperCase();d.has(h)||d.set(h,l)}}),i;function c(l,d){const h=l.type,m=i.handlers[h];if(SE.call(i.handlers,h)&&m)return m(i,l,d);if(i.options.passThrough&&i.options.passThrough.includes(h)){if("children"in l){const{children:y,...g}=l,b=xu(g);return b.children=i.all(l),b}return xu(l)}return(i.options.unknownHandler||M$e)(i,l,d)}function u(l){const d=[];if("children"in l){const h=l.children;let m=-1;for(;++m<h.length;){const p=i.one(h[m],l);if(p){if(m&&h[m-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=b$(p.value)),!Array.isArray(p)&&p.type==="element")){const y=p.children[0];y&&y.type==="text"&&(y.value=b$(y.value))}Array.isArray(p)?d.push(...p):d.push(p)}}}return d}}function $$e(e,t){e.position&&(t.position=H7(e))}function j$e(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&a&&Object.assign(n.properties,xu(a)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function M$e(e,t){const n=t.data||{},r="value"in t&&!(SE.call(n,"hProperties")||SE.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function D$e(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
233
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
234
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
235
|
-
`}),n}function b$(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function y$(e,t){const n=L$e(e,t),r=n.one(e,void 0),s=P$e(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:`
|
|
236
|
-
`},s),a}function F$e(e,t){return e&&"run"in e?async function(n,r){const s=y$(n,{file:r,...t});await e.run(s,r)}:function(n,r){return y$(n,{file:r,...e||t})}}function x$(e){if(e)throw e}var IS,k$;function B$e(){if(k$)return IS;k$=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(u){return typeof Array.isArray=="function"?Array.isArray(u):t.call(u)==="[object Array]"},a=function(u){if(!u||t.call(u)!=="[object Object]")return!1;var l=e.call(u,"constructor"),d=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!l&&!d)return!1;var h;for(h in u);return typeof h>"u"||e.call(u,h)},o=function(u,l){n&&l.name==="__proto__"?n(u,l.name,{enumerable:!0,configurable:!0,value:l.newValue,writable:!0}):u[l.name]=l.newValue},i=function(u,l){if(l==="__proto__")if(e.call(u,l)){if(r)return r(u,l).value}else return;return u[l]};return IS=function c(){var u,l,d,h,m,p,y=arguments[0],g=1,b=arguments.length,x=!1;for(typeof y=="boolean"&&(x=y,y=arguments[1]||{},g=2),(y==null||typeof y!="object"&&typeof y!="function")&&(y={});g<b;++g)if(u=arguments[g],u!=null)for(l in u)d=i(y,l),h=i(u,l),y!==h&&(x&&h&&(a(h)||(m=s(h)))?(m?(m=!1,p=d&&s(d)?d:[]):p=d&&a(d)?d:{},o(y,{name:l,newValue:c(x,p,h)})):typeof h<"u"&&o(y,{name:l,newValue:h}));return y},IS}var U$e=B$e();const AS=p1(U$e);function wE(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function z$e(){const e=[],t={run:n,use:r};return t;function n(...s){let a=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);i(null,...s);function i(c,...u){const l=e[++a];let d=-1;if(c){o(c);return}for(;++d<s.length;)(u[d]===null||u[d]===void 0)&&(u[d]=s[d]);s=u,l?H$e(l,i)(...u):o(null,...u)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function H$e(e,t){let n;return r;function r(...o){const i=e.length>o.length;let c;i&&o.push(s);try{c=e.apply(this,o)}catch(u){const l=u;if(i&&n)throw l;return s(l)}i||(c&&c.then&&typeof c.then=="function"?c.then(a,s):c instanceof Error?s(c):a(c))}function s(o,...i){n||(n=!0,t(o,...i))}function a(o){s(null,o)}}const ja={basename:q$e,dirname:V$e,extname:G$e,join:K$e,sep:"/"};function q$e(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');$p(e);let n=0,r=-1,s=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else r<0&&(a=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,i=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else o<0&&(a=!0,o=s+1),i>-1&&(e.codePointAt(s)===t.codePointAt(i--)?i<0&&(r=s):(i=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function V$e(e){if($p(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function G$e(e){$p(e);let t=e.length,n=-1,r=0,s=-1,a=0,o;for(;t--;){const i=e.codePointAt(t);if(i===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),i===46?s<0?s=t:a!==1&&(a=1):s>-1&&(a=-1)}return s<0||n<0||a===0||a===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function K$e(...e){let t=-1,n;for(;++t<e.length;)$p(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":W$e(n)}function W$e(e){$p(e);const t=e.codePointAt(0)===47;let n=Y$e(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Y$e(e,t){let n="",r=0,s=-1,a=0,o=-1,i,c;for(;++o<=e.length;){if(o<e.length)i=e.codePointAt(o);else{if(i===47)break;i=47}if(i===47){if(!(s===o-1||a===1))if(s!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),s=o,a=0;continue}}else if(n.length>0){n="",r=0,s=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),r=o-s-1;s=o,a=0}else i===46&&a>-1?a++:a=-1}return n}function $p(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const J$e={cwd:Q$e};function Q$e(){return"/"}function _E(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function X$e(e){if(typeof e=="string")e=new URL(e);else if(!_E(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Z$e(e)}function Z$e(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const NS=["history","path","basename","stem","extname","dirname"];class eje{constructor(t){let n;t?_E(t)?n={path:t}:typeof t=="string"||tje(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":J$e.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<NS.length;){const a=NS[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let s;for(s in n)NS.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?ja.basename(this.path):void 0}set basename(t){PS(t,"basename"),RS(t,"basename"),this.path=ja.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ja.dirname(this.path):void 0}set dirname(t){v$(this.basename,"dirname"),this.path=ja.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ja.extname(this.path):void 0}set extname(t){if(RS(t,"extname"),v$(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ja.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){_E(t)&&(t=X$e(t)),PS(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ja.basename(this.path,this.extname):void 0}set stem(t){PS(t,"stem"),RS(t,"stem"),this.path=ja.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new Ar(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function RS(e,t){if(e&&e.includes(ja.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ja.sep+"`")}function PS(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function v$(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function tje(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const nje=(function(e){const r=this.constructor.prototype,s=r[e],a=function(){return s.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),rje={}.hasOwnProperty;class Z2 extends nje{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=z$e()}copy(){const t=new Z2;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(AS(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?($S("data",this.frozen),this.namespace[t]=n,this):rje.call(this.namespace,t)&&this.namespace[t]||void 0:t?($S("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=db(t),r=this.parser||this.Parser;return OS("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),OS("process",this.parser||this.Parser),LS("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(a,o){const i=db(t),c=r.parse(i);r.run(c,i,function(l,d,h){if(l||!d||!h)return u(l);const m=d,p=r.stringify(m,h);oje(p)?h.value=p:h.result=p,u(l,h)});function u(l,d){l||!d?o(l):a?a(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),OS("processSync",this.parser||this.Parser),LS("processSync",this.compiler||this.Compiler),this.process(t,s),w$("processSync","process",n),r;function s(a,o){n=!0,x$(a),r=o}}run(t,n,r){S$(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(o,i){const c=db(n);s.run(t,c,u);function u(l,d,h){const m=d||t;l?i(l):o?o(m):r(void 0,m,h)}}}runSync(t,n){let r=!1,s;return this.run(t,n,a),w$("runSync","run",r),s;function a(o,i){x$(o),s=i,r=!0}}stringify(t,n){this.freeze();const r=db(n),s=this.compiler||this.Compiler;return LS("stringify",s),S$(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if($S("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?i(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[l,...d]=u;c(l,d)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");i(u.plugins),u.settings&&(s.settings=AS(!0,s.settings,u.settings))}function i(u){let l=-1;if(u!=null)if(Array.isArray(u))for(;++l<u.length;){const d=u[l];a(d)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,l){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===u){h=d;break}if(h===-1)r.push([u,...l]);else if(l.length>0){let[m,...p]=l;const y=r[h][1];wE(y)&&wE(m)&&(m=AS(!0,y,m)),r[h]=[u,m,...p]}}}}const sje=new Z2().freeze();function OS(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function LS(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function $S(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function S$(e){if(!wE(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function w$(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function db(e){return aje(e)?e:new eje(e)}function aje(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function oje(e){return typeof e=="string"||ije(e)}function ije(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function eA(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Fu=eA();function YH(e){Fu=e}var Nc={exec:()=>null};function wt(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(s,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(Ur.caret,"$1"),n=n.replace(s,o),r},getRegex:()=>new RegExp(n,t)};return r}var cje=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Ur={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},uje=/^(?:[ \t]*(?:\n|$))+/,lje=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,dje=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,jp=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,fje=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,tA=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,JH=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,QH=wt(JH).replace(/bull/g,tA).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),hje=wt(JH).replace(/bull/g,tA).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),nA=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,mje=/^[^\n]+/,rA=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,pje=wt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",rA).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),gje=wt(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,tA).getRegex(),_k="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",sA=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,bje=wt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",sA).replace("tag",_k).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),XH=wt(nA).replace("hr",jp).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_k).getRegex(),yje=wt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",XH).getRegex(),aA={blockquote:yje,code:lje,def:pje,fences:dje,heading:fje,hr:jp,html:bje,lheading:QH,list:gje,newline:uje,paragraph:XH,table:Nc,text:mje},_$=wt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",jp).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_k).getRegex(),xje={...aA,lheading:hje,table:_$,paragraph:wt(nA).replace("hr",jp).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",_$).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_k).getRegex()},kje={...aA,html:wt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",sA).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Nc,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:wt(nA).replace("hr",jp).replace("heading",` *#{1,6} *[^
|
|
237
|
-
]`).replace("lheading",QH).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},vje=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Sje=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ZH=/^( {2,}|\\)\n(?!\s*$)/,wje=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ek=/[\p{P}\p{S}]/u,oA=/[\s\p{P}\p{S}]/u,eq=/[^\s\p{P}\p{S}]/u,_je=wt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,oA).getRegex(),tq=/(?!~)[\p{P}\p{S}]/u,Eje=/(?!~)[\s\p{P}\p{S}]/u,Tje=/(?:[^\s\p{P}\p{S}]|~)/u,nq=/(?![*_])[\p{P}\p{S}]/u,Cje=/(?![*_])[\s\p{P}\p{S}]/u,Ije=/(?:[^\s\p{P}\p{S}]|[*_])/u,Aje=wt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",cje?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),rq=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Nje=wt(rq,"u").replace(/punct/g,Ek).getRegex(),Rje=wt(rq,"u").replace(/punct/g,tq).getRegex(),sq="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Pje=wt(sq,"gu").replace(/notPunctSpace/g,eq).replace(/punctSpace/g,oA).replace(/punct/g,Ek).getRegex(),Oje=wt(sq,"gu").replace(/notPunctSpace/g,Tje).replace(/punctSpace/g,Eje).replace(/punct/g,tq).getRegex(),Lje=wt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,eq).replace(/punctSpace/g,oA).replace(/punct/g,Ek).getRegex(),$je=wt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,nq).getRegex(),jje="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Mje=wt(jje,"gu").replace(/notPunctSpace/g,Ije).replace(/punctSpace/g,Cje).replace(/punct/g,nq).getRegex(),Dje=wt(/\\(punct)/,"gu").replace(/punct/g,Ek).getRegex(),Fje=wt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Bje=wt(sA).replace("(?:-->|$)","-->").getRegex(),Uje=wt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Bje).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Q0=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,zje=wt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Q0).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),aq=wt(/^!?\[(label)\]\[(ref)\]/).replace("label",Q0).replace("ref",rA).getRegex(),oq=wt(/^!?\[(ref)\](?:\[\])?/).replace("ref",rA).getRegex(),Hje=wt("reflink|nolink(?!\\()","g").replace("reflink",aq).replace("nolink",oq).getRegex(),E$=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,iA={_backpedal:Nc,anyPunctuation:Dje,autolink:Fje,blockSkip:Aje,br:ZH,code:Sje,del:Nc,delLDelim:Nc,delRDelim:Nc,emStrongLDelim:Nje,emStrongRDelimAst:Pje,emStrongRDelimUnd:Lje,escape:vje,link:zje,nolink:oq,punctuation:_je,reflink:aq,reflinkSearch:Hje,tag:Uje,text:wje,url:Nc},qje={...iA,link:wt(/^!?\[(label)\]\((.*?)\)/).replace("label",Q0).getRegex(),reflink:wt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Q0).getRegex()},EE={...iA,emStrongRDelimAst:Oje,emStrongLDelim:Rje,delLDelim:$je,delRDelim:Mje,url:wt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",E$).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:wt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",E$).getRegex()},Vje={...EE,br:wt(ZH).replace("{2,}","*").getRegex(),text:wt(EE.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},fb={normal:aA,gfm:xje,pedantic:kje},Df={normal:iA,gfm:EE,breaks:Vje,pedantic:qje},Gje={"&":"&","<":"<",">":">",'"':""","'":"'"},T$=e=>Gje[e];function $a(e,t){if(t){if(Ur.escapeTest.test(e))return e.replace(Ur.escapeReplace,T$)}else if(Ur.escapeTestNoEncode.test(e))return e.replace(Ur.escapeReplaceNoEncode,T$);return e}function C$(e){try{e=encodeURI(e).replace(Ur.percentDecode,"%")}catch{return null}return e}function I$(e,t){let n=e.replace(Ur.findPipe,(a,o,i)=>{let c=!1,u=o;for(;--u>=0&&i[u]==="\\";)c=!c;return c?"|":" |"}),r=n.split(Ur.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(Ur.slashPipe,"|");return r}function Ff(e,t,n){let r=e.length;if(r===0)return"";let s=0;for(;s<r&&e.charAt(r-s-1)===t;)s++;return e.slice(0,r-s)}function Kje(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Wje(e,t=0){let n=t,r="";for(let s of e)if(s===" "){let a=4-n%4;r+=" ".repeat(a),n+=a}else r+=s,n++;return r}function A$(e,t,n,r,s){let a=t.href,o=t.title||null,i=e[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let c={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:o,text:i,tokens:r.inlineTokens(i)};return r.state.inLink=!1,c}function Yje(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let s=r[1];return t.split(`
|
|
238
|
-
`).map(a=>{let o=a.match(n.other.beginningSpace);if(o===null)return a;let[i]=o;return i.length>=s.length?a.slice(s.length):a}).join(`
|
|
239
|
-
`)}var X0=class{options;rules;lexer;constructor(e){this.options=e||Fu}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Ff(n,`
|
|
240
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=Yje(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=Ff(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Ff(t[0],`
|
|
241
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=Ff(t[0],`
|
|
242
|
-
`).split(`
|
|
243
|
-
`),r="",s="",a=[];for(;n.length>0;){let o=!1,i=[],c;for(c=0;c<n.length;c++)if(this.rules.other.blockquoteStart.test(n[c]))i.push(n[c]),o=!0;else if(!o)i.push(n[c]);else break;n=n.slice(c);let u=i.join(`
|
|
244
|
-
`),l=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
245
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
246
|
-
${u}`:u,s=s?`${s}
|
|
247
|
-
${l}`:l;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,a,!0),this.lexer.state.top=d,n.length===0)break;let h=a.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){let m=h,p=m.raw+`
|
|
248
|
-
`+n.join(`
|
|
249
|
-
`),y=this.blockquote(p);a[a.length-1]=y,r=r.substring(0,r.length-m.raw.length)+y.raw,s=s.substring(0,s.length-m.text.length)+y.text;break}else if(h?.type==="list"){let m=h,p=m.raw+`
|
|
250
|
-
`+n.join(`
|
|
251
|
-
`),y=this.list(p);a[a.length-1]=y,r=r.substring(0,r.length-h.raw.length)+y.raw,s=s.substring(0,s.length-m.raw.length)+y.raw,n=p.substring(a.at(-1).raw.length).split(`
|
|
252
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:a,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let c=!1,u="",l="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;u=t[0],e=e.substring(u.length);let d=Wje(t[2].split(`
|
|
253
|
-
`,1)[0],t[1].length),h=e.split(`
|
|
254
|
-
`,1)[0],m=!d.trim(),p=0;if(this.options.pedantic?(p=2,l=d.trimStart()):m?p=t[1].length+1:(p=d.search(this.rules.other.nonSpaceChar),p=p>4?1:p,l=d.slice(p),p+=t[1].length),m&&this.rules.other.blankLine.test(h)&&(u+=h+`
|
|
255
|
-
`,e=e.substring(h.length+1),c=!0),!c){let y=this.rules.other.nextBulletRegex(p),g=this.rules.other.hrRegex(p),b=this.rules.other.fencesBeginRegex(p),x=this.rules.other.headingBeginRegex(p),k=this.rules.other.htmlBeginRegex(p),_=this.rules.other.blockquoteBeginRegex(p);for(;e;){let S=e.split(`
|
|
256
|
-
`,1)[0],w;if(h=S,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),w=h):w=h.replace(this.rules.other.tabCharGlobal," "),b.test(h)||x.test(h)||k.test(h)||_.test(h)||y.test(h)||g.test(h))break;if(w.search(this.rules.other.nonSpaceChar)>=p||!h.trim())l+=`
|
|
257
|
-
`+w.slice(p);else{if(m||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||b.test(d)||x.test(d)||g.test(d))break;l+=`
|
|
258
|
-
`+h}m=!h.trim(),u+=S+`
|
|
259
|
-
`,e=e.substring(S.length+1),d=w.slice(p)}}s.loose||(o?s.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(o=!0)),s.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(l),loose:!1,text:l,tokens:[]}),s.raw+=u}let i=s.items.at(-1);if(i)i.raw=i.raw.trimEnd(),i.text=i.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c of s.items){if(this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]),c.task){if(c.text=c.text.replace(this.rules.other.listReplaceTask,""),c.tokens[0]?.type==="text"||c.tokens[0]?.type==="paragraph"){c.tokens[0].raw=c.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),c.tokens[0].text=c.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let l=this.lexer.inlineQueue.length-1;l>=0;l--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[l].src)){this.lexer.inlineQueue[l].src=this.lexer.inlineQueue[l].src.replace(this.rules.other.listReplaceTask,"");break}}let u=this.rules.other.listTaskCheckbox.exec(c.raw);if(u){let l={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};c.checked=l.checked,s.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=l.raw+c.tokens[0].raw,c.tokens[0].text=l.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(l)):c.tokens.unshift({type:"paragraph",raw:l.raw,text:l.raw,tokens:[l]}):c.tokens.unshift(l)}}if(!s.loose){let u=c.tokens.filter(d=>d.type==="space"),l=u.length>0&&u.some(d=>this.rules.other.anyLine.test(d.raw));s.loose=l}}if(s.loose)for(let c of s.items){c.loose=!0;for(let u of c.tokens)u.type==="text"&&(u.type="paragraph")}return s}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:s}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=I$(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
260
|
-
`):[],a={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let o of r)this.rules.other.tableAlignRight.test(o)?a.align.push("right"):this.rules.other.tableAlignCenter.test(o)?a.align.push("center"):this.rules.other.tableAlignLeft.test(o)?a.align.push("left"):a.align.push(null);for(let o=0;o<n.length;o++)a.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:a.align[o]});for(let o of s)a.rows.push(I$(o,a.header.length).map((i,c)=>({text:i,tokens:this.lexer.inline(i),header:!1,align:a.align[c]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
|
|
261
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=Ff(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=Kje(t[2],"()");if(a===-2)return;if(a>-1){let o=(t[0].indexOf("!")===0?5:4)+t[1].length+a;t[2]=t[2].substring(0,a),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let r=t[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(r);a&&(r=a[1],s=a[3])}else s=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),A$(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[r.toLowerCase()];if(!s){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return A$(n,s,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,a,o,i=s,c=0,u=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+s);(r=u.exec(t))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){i+=o;continue}else if((r[5]||r[6])&&s%3&&!((s+o)%3)){c+=o;continue}if(i-=o,i>0)continue;o=Math.min(o,o+i+c);let l=[...r[0]][0].length,d=e.slice(0,s+r.index+l+o);if(Math.min(s,o)%2){let m=d.slice(1,-1);return{type:"em",raw:d,text:m,tokens:this.lexer.inlineTokens(m)}}let h=d.slice(2,-2);return{type:"strong",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,a,o,i=s,c=this.rules.inline.delRDelim;for(c.lastIndex=0,t=t.slice(-1*e.length+s);(r=c.exec(t))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a||(o=[...a].length,o!==s))continue;if(r[3]||r[4]){i+=o;continue}if(i-=o,i>0)continue;o=Math.min(o,o+i);let u=[...r[0]][0].length,l=e.slice(0,s+r.index+u+o),d=l.slice(s,-s);return{type:"del",raw:l,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if(t[2]==="@")n=t[0],r="mailto:"+n;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);n=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},Ms=class TE{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Fu,this.options.tokenizer=this.options.tokenizer||new X0,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:Ur,block:fb.normal,inline:Df.normal};this.options.pedantic?(n.block=fb.pedantic,n.inline=Df.pedantic):this.options.gfm&&(n.block=fb.gfm,this.options.breaks?n.inline=Df.breaks:n.inline=Df.gfm),this.tokenizer.rules=n}static get rules(){return{block:fb,inline:Df}}static lex(t,n){return new TE(n).lex(t)}static lexInline(t,n){return new TE(n).inlineTokens(t)}lex(t){t=t.replace(Ur.carriageReturn,`
|
|
262
|
-
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){for(this.options.pedantic&&(t=t.replace(Ur.tabCharGlobal," ").replace(Ur.spaceLine,""));t;){let s;if(this.options.extensions?.block?.some(o=>(s=o.call({lexer:this},t,n))?(t=t.substring(s.raw.length),n.push(s),!0):!1))continue;if(s=this.tokenizer.space(t)){t=t.substring(s.raw.length);let o=n.at(-1);s.raw.length===1&&o!==void 0?o.raw+=`
|
|
263
|
-
`:n.push(s);continue}if(s=this.tokenizer.code(t)){t=t.substring(s.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
264
|
-
`)?"":`
|
|
265
|
-
`)+s.raw,o.text+=`
|
|
266
|
-
`+s.text,this.inlineQueue.at(-1).src=o.text):n.push(s);continue}if(s=this.tokenizer.fences(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.heading(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.hr(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.blockquote(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.list(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.html(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.def(t)){t=t.substring(s.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
267
|
-
`)?"":`
|
|
268
|
-
`)+s.raw,o.text+=`
|
|
269
|
-
`+s.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},n.push(s));continue}if(s=this.tokenizer.table(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.lheading(t)){t=t.substring(s.raw.length),n.push(s);continue}let a=t;if(this.options.extensions?.startBlock){let o=1/0,i=t.slice(1),c;this.options.extensions.startBlock.forEach(u=>{c=u.call({lexer:this},i),typeof c=="number"&&c>=0&&(o=Math.min(o,c))}),o<1/0&&o>=0&&(a=t.substring(0,o+1))}if(this.state.top&&(s=this.tokenizer.paragraph(a))){let o=n.at(-1);r&&o?.type==="paragraph"?(o.raw+=(o.raw.endsWith(`
|
|
270
|
-
`)?"":`
|
|
271
|
-
`)+s.raw,o.text+=`
|
|
272
|
-
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(s),r=a.length!==t.length,t=t.substring(s.raw.length);continue}if(s=this.tokenizer.text(t)){t=t.substring(s.raw.length);let o=n.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
273
|
-
`)?"":`
|
|
274
|
-
`)+s.raw,o.text+=`
|
|
275
|
-
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(s);continue}if(t){let o="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let r=t,s=null;if(this.tokens.links){let c=Object.keys(this.tokens.links);if(c.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)c.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)a=s[2]?s[2].length:0,r=r.slice(0,s.index+a)+"["+"a".repeat(s[0].length-a-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let o=!1,i="";for(;t;){o||(i=""),o=!1;let c;if(this.options.extensions?.inline?.some(l=>(c=l.call({lexer:this},t,n))?(t=t.substring(c.raw.length),n.push(c),!0):!1))continue;if(c=this.tokenizer.escape(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.tag(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.link(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(c.raw.length);let l=n.at(-1);c.type==="text"&&l?.type==="text"?(l.raw+=c.raw,l.text+=c.text):n.push(c);continue}if(c=this.tokenizer.emStrong(t,r,i)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.codespan(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.br(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.del(t,r,i)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.autolink(t)){t=t.substring(c.raw.length),n.push(c);continue}if(!this.state.inLink&&(c=this.tokenizer.url(t))){t=t.substring(c.raw.length),n.push(c);continue}let u=t;if(this.options.extensions?.startInline){let l=1/0,d=t.slice(1),h;this.options.extensions.startInline.forEach(m=>{h=m.call({lexer:this},d),typeof h=="number"&&h>=0&&(l=Math.min(l,h))}),l<1/0&&l>=0&&(u=t.substring(0,l+1))}if(c=this.tokenizer.inlineText(u)){t=t.substring(c.raw.length),c.raw.slice(-1)!=="_"&&(i=c.raw.slice(-1)),o=!0;let l=n.at(-1);l?.type==="text"?(l.raw+=c.raw,l.text+=c.text):n.push(c);continue}if(t){let l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return n}},Z0=class{options;parser;constructor(t){this.options=t||Fu}space(t){return""}code({text:t,lang:n,escaped:r}){let s=(n||"").match(Ur.notSpaceStart)?.[0],a=t.replace(Ur.endingNewline,"")+`
|
|
276
|
-
`;return s?'<pre><code class="language-'+$a(s)+'">'+(r?a:$a(a,!0))+`</code></pre>
|
|
277
|
-
`:"<pre><code>"+(r?a:$a(a,!0))+`</code></pre>
|
|
278
|
-
`}blockquote({tokens:t}){return`<blockquote>
|
|
279
|
-
${this.parser.parse(t)}</blockquote>
|
|
280
|
-
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:n}){return`<h${n}>${this.parser.parseInline(t)}</h${n}>
|
|
281
|
-
`}hr(t){return`<hr>
|
|
282
|
-
`}list(t){let n=t.ordered,r=t.start,s="";for(let i=0;i<t.items.length;i++){let c=t.items[i];s+=this.listitem(c)}let a=n?"ol":"ul",o=n&&r!==1?' start="'+r+'"':"";return"<"+a+o+`>
|
|
283
|
-
`+s+"</"+a+`>
|
|
284
|
-
`}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
|
|
285
|
-
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
286
|
-
`}table(t){let n="",r="";for(let a=0;a<t.header.length;a++)r+=this.tablecell(t.header[a]);n+=this.tablerow({text:r});let s="";for(let a=0;a<t.rows.length;a++){let o=t.rows[a];r="";for(let i=0;i<o.length;i++)r+=this.tablecell(o[i]);s+=this.tablerow({text:r})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
287
|
-
<thead>
|
|
288
|
-
`+n+`</thead>
|
|
289
|
-
`+s+`</table>
|
|
290
|
-
`}tablerow({text:t}){return`<tr>
|
|
291
|
-
${t}</tr>
|
|
292
|
-
`}tablecell(t){let n=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+n+`</${r}>
|
|
293
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${$a(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:n,tokens:r}){let s=this.parser.parseInline(r),a=C$(t);if(a===null)return s;t=a;let o='<a href="'+t+'"';return n&&(o+=' title="'+$a(n)+'"'),o+=">"+s+"</a>",o}image({href:t,title:n,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let a=C$(t);if(a===null)return $a(r);t=a;let o=`<img src="${t}" alt="${$a(r)}"`;return n&&(o+=` title="${$a(n)}"`),o+=">",o}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:$a(t.text)}},cA=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},aa=class CE{options;renderer;textRenderer;constructor(t){this.options=t||Fu,this.options.renderer=this.options.renderer||new Z0,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new cA}static parse(t,n){return new CE(n).parse(t)}static parseInline(t,n){return new CE(n).parseInline(t)}parse(t){let n="";for(let r=0;r<t.length;r++){let s=t[r];if(this.options.extensions?.renderers?.[s.type]){let o=s,i=this.options.extensions.renderers[o.type].call({parser:this},o);if(i!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){n+=i||"";continue}}let a=s;switch(a.type){case"space":{n+=this.renderer.space(a);break}case"hr":{n+=this.renderer.hr(a);break}case"heading":{n+=this.renderer.heading(a);break}case"code":{n+=this.renderer.code(a);break}case"table":{n+=this.renderer.table(a);break}case"blockquote":{n+=this.renderer.blockquote(a);break}case"list":{n+=this.renderer.list(a);break}case"checkbox":{n+=this.renderer.checkbox(a);break}case"html":{n+=this.renderer.html(a);break}case"def":{n+=this.renderer.def(a);break}case"paragraph":{n+=this.renderer.paragraph(a);break}case"text":{n+=this.renderer.text(a);break}default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(t,n=this.renderer){let r="";for(let s=0;s<t.length;s++){let a=t[s];if(this.options.extensions?.renderers?.[a.type]){let i=this.options.extensions.renderers[a.type].call({parser:this},a);if(i!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=i||"";continue}}let o=a;switch(o.type){case"escape":{r+=n.text(o);break}case"html":{r+=n.html(o);break}case"link":{r+=n.link(o);break}case"image":{r+=n.image(o);break}case"checkbox":{r+=n.checkbox(o);break}case"strong":{r+=n.strong(o);break}case"em":{r+=n.em(o);break}case"codespan":{r+=n.codespan(o);break}case"br":{r+=n.br(o);break}case"del":{r+=n.del(o);break}case"text":{r+=n.text(o);break}default:{let i='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return r}},nh=class{options;block;constructor(e){this.options=e||Fu}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Ms.lex:Ms.lexInline}provideParser(){return this.block?aa.parse:aa.parseInline}},Jje=class{defaults=eA();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=aa;Renderer=Z0;TextRenderer=cA;Lexer=Ms;Tokenizer=X0;Hooks=nh;constructor(...t){this.use(...t)}walkTokens(t,n){let r=[];for(let s of t)switch(r=r.concat(n.call(this,s)),s.type){case"table":{let a=s;for(let o of a.header)r=r.concat(this.walkTokens(o.tokens,n));for(let o of a.rows)for(let i of o)r=r.concat(this.walkTokens(i.tokens,n));break}case"list":{let a=s;r=r.concat(this.walkTokens(a.items,n));break}default:{let a=s;this.defaults.extensions?.childTokens?.[a.type]?this.defaults.extensions.childTokens[a.type].forEach(o=>{let i=a[o].flat(1/0);r=r.concat(this.walkTokens(i,n))}):a.tokens&&(r=r.concat(this.walkTokens(a.tokens,n)))}}return r}use(...t){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let o=n.renderers[a.name];o?n.renderers[a.name]=function(...i){let c=a.renderer.apply(this,i);return c===!1&&(c=o.apply(this,i)),c}:n.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=n[a.level];o?o.unshift(a.tokenizer):n[a.level]=[a.tokenizer],a.start&&(a.level==="block"?n.startBlock?n.startBlock.push(a.start):n.startBlock=[a.start]:a.level==="inline"&&(n.startInline?n.startInline.push(a.start):n.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(n.childTokens[a.name]=a.childTokens)}),s.extensions=n),r.renderer){let a=this.defaults.renderer||new Z0(this.defaults);for(let o in r.renderer){if(!(o in a))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let i=o,c=r.renderer[i],u=a[i];a[i]=(...l)=>{let d=c.apply(a,l);return d===!1&&(d=u.apply(a,l)),d||""}}s.renderer=a}if(r.tokenizer){let a=this.defaults.tokenizer||new X0(this.defaults);for(let o in r.tokenizer){if(!(o in a))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let i=o,c=r.tokenizer[i],u=a[i];a[i]=(...l)=>{let d=c.apply(a,l);return d===!1&&(d=u.apply(a,l)),d}}s.tokenizer=a}if(r.hooks){let a=this.defaults.hooks||new nh;for(let o in r.hooks){if(!(o in a))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let i=o,c=r.hooks[i],u=a[i];nh.passThroughHooks.has(o)?a[i]=l=>{if(this.defaults.async&&nh.passThroughHooksRespectAsync.has(o))return(async()=>{let h=await c.call(a,l);return u.call(a,h)})();let d=c.call(a,l);return u.call(a,d)}:a[i]=(...l)=>{if(this.defaults.async)return(async()=>{let h=await c.apply(a,l);return h===!1&&(h=await u.apply(a,l)),h})();let d=c.apply(a,l);return d===!1&&(d=u.apply(a,l)),d}}s.hooks=a}if(r.walkTokens){let a=this.defaults.walkTokens,o=r.walkTokens;s.walkTokens=function(i){let c=[];return c.push(o.call(this,i)),a&&(c=c.concat(a.call(this,i))),c}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return Ms.lex(t,n??this.defaults)}parser(t,n){return aa.parse(t,n??this.defaults)}parseMarkdown(t){return(n,r)=>{let s={...r},a={...this.defaults,...s},o=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&s.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=t),a.async)return(async()=>{let i=a.hooks?await a.hooks.preprocess(n):n,c=await(a.hooks?await a.hooks.provideLexer():t?Ms.lex:Ms.lexInline)(i,a),u=a.hooks?await a.hooks.processAllTokens(c):c;a.walkTokens&&await Promise.all(this.walkTokens(u,a.walkTokens));let l=await(a.hooks?await a.hooks.provideParser():t?aa.parse:aa.parseInline)(u,a);return a.hooks?await a.hooks.postprocess(l):l})().catch(o);try{a.hooks&&(n=a.hooks.preprocess(n));let i=(a.hooks?a.hooks.provideLexer():t?Ms.lex:Ms.lexInline)(n,a);a.hooks&&(i=a.hooks.processAllTokens(i)),a.walkTokens&&this.walkTokens(i,a.walkTokens);let c=(a.hooks?a.hooks.provideParser():t?aa.parse:aa.parseInline)(i,a);return a.hooks&&(c=a.hooks.postprocess(c)),c}catch(i){return o(i)}}}onError(t,n){return r=>{if(r.message+=`
|
|
294
|
-
Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+$a(r.message+"",!0)+"</pre>";return n?Promise.resolve(s):s}if(n)return Promise.reject(r);throw r}}},vu=new Jje;function Ut(e,t){return vu.parse(e,t)}Ut.options=Ut.setOptions=function(e){return vu.setOptions(e),Ut.defaults=vu.defaults,YH(Ut.defaults),Ut};Ut.getDefaults=eA;Ut.defaults=Fu;Ut.use=function(...e){return vu.use(...e),Ut.defaults=vu.defaults,YH(Ut.defaults),Ut};Ut.walkTokens=function(e,t){return vu.walkTokens(e,t)};Ut.parseInline=vu.parseInline;Ut.Parser=aa;Ut.parser=aa.parse;Ut.Renderer=Z0;Ut.TextRenderer=cA;Ut.Lexer=Ms;Ut.lexer=Ms.lex;Ut.Tokenizer=X0;Ut.Hooks=nh;Ut.parse=Ut;Ut.options;Ut.setOptions;Ut.use;Ut.walkTokens;Ut.parseInline;aa.parse;Ms.lex;var Qje=300,Xje="300px",Zje=500;function eMe(e={}){let{immediate:t=!1,debounceDelay:n=Qje,rootMargin:r=Xje,idleTimeout:s=Zje}=e,[a,o]=E.useState(!1),i=E.useRef(null),c=E.useRef(null),u=E.useRef(null),l=E.useMemo(()=>m=>{let p=Date.now();return window.setTimeout(()=>{m({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-p))})},1)},[]),d=E.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(m,p)=>window.requestIdleCallback(m,p):l,[l]),h=E.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?m=>window.cancelIdleCallback(m):m=>{clearTimeout(m)},[]);return E.useEffect(()=>{if(t){o(!0);return}let m=i.current;if(!m)return;c.current&&(clearTimeout(c.current),c.current=null),u.current&&(h(u.current),u.current=null);let p=()=>{c.current&&(clearTimeout(c.current),c.current=null),u.current&&(h(u.current),u.current=null)},y=k=>{u.current=d(_=>{_.timeRemaining()>0||_.didTimeout?(o(!0),k.disconnect()):u.current=d(()=>{o(!0),k.disconnect()},{timeout:s/2})},{timeout:s})},g=k=>{p(),c.current=window.setTimeout(()=>{var _,S;let w=k.takeRecords();(w.length===0||(S=(_=w.at(-1))==null?void 0:_.isIntersecting)!=null&&S)&&y(k)},n)},b=(k,_)=>{k.isIntersecting?g(_):p()},x=new IntersectionObserver(k=>{for(let _ of k)b(_,x)},{rootMargin:r,threshold:0});return x.observe(m),()=>{c.current&&clearTimeout(c.current),u.current&&h(u.current),x.disconnect()}},[t,n,r,s,h,d]),{shouldRender:a,containerRef:i}}var iq=/\s/,tMe=/^\s+$/,nMe=new Set(["code","pre","svg","math","annotation"]),rMe=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",sMe=e=>e.some(t=>rMe(t)&&nMe.has(t.tagName)),aMe=e=>{let t=[],n="",r=!1;for(let s of e){let a=iq.test(s);a!==r&&n&&(t.push(n),n=""),n+=s,r=a}return n&&t.push(n),t},oMe=e=>{let t=[],n="";for(let r of e)iq.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},iMe=(e,t,n,r,s)=>({type:"element",tagName:"span",properties:{"data-sd-animate":!0,style:s?`--sd-animation:sd-${t};--sd-duration:0ms;--sd-easing:${r}`:`--sd-animation:sd-${t};--sd-duration:${n}ms;--sd-easing:${r}`},children:[{type:"text",value:e}]}),cMe=(e,t,n,r,s)=>{let a=t.at(-1);if(!(a&&"children"in a))return;if(sMe(t))return wl;let o=a,i=o.children.indexOf(e);if(i===-1)return;let c=e.value;if(!c.trim()){s.count+=c.length;return}let u=n.sep==="char"?oMe(c):aMe(c),l=r.prevContentLength,d=u.map(h=>{let m=s.count;if(s.count+=h.length,tMe.test(h))return{type:"text",value:h};let p=l>0&&m<l;return iMe(h,n.animation,n.duration,n.easing,p)});return o.children.splice(i,1,...d),i+d.length},uMe=0;function IE(e){var t,n,r,s;let a={animation:(t=e?.animation)!=null?t:"fadeIn",duration:(n=e?.duration)!=null?n:150,easing:(r=e?.easing)!=null?r:"ease",sep:(s=e?.sep)!=null?s:"word"},o={prevContentLength:0,lastRenderCharCount:0},i=uMe++,c=()=>u=>{let l={count:0};R2(u,"text",(d,h)=>cMe(d,h,a,o,l)),o.lastRenderCharCount=l.count,o.prevContentLength=0};return Object.defineProperty(c,"name",{value:`rehypeAnimate$${i}`}),{name:"animate",type:"animate",rehypePlugin:c,setPrevContentLength(u){o.prevContentLength=u},getLastRenderCharCount(){let u=o.lastRenderCharCount;return o.lastRenderCharCount=0,u}}}IE();var cq=E.createContext(!1),lMe=()=>E.useContext(cq),uA=(...e)=>tk(Tp(e)),dMe=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(r=>r.startsWith(n)?r:`${e}:${r}`).join(" ")},fMe=e=>e?(...t)=>dMe(e,tk(Tp(t))):uA,Ul=(e,t,n)=>{let r=typeof t=="string"?new Blob([t],{type:n}):t,s=URL.createObjectURL(r),a=document.createElement("a");a.href=s,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(s)},AE=E.createContext(uA),ht=()=>E.useContext(AE),hMe=uA("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-6","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),mMe=e=>{let t={};for(let n of e.split(";")){let r=n.indexOf(":");if(r>0){let s=n.slice(0,r).trim(),a=n.slice(r+1).trim();s&&a&&(t[s]=a)}}return t},pMe=E.memo(({children:e,result:t,language:n,className:r,startLine:s,...a})=>{let o=ht(),i=E.useMemo(()=>o(hMe),[o]),c=E.useMemo(()=>{let u={};return t.bg&&(u["--sdm-bg"]=t.bg),t.fg&&(u["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(u,mMe(t.rootStyle)),u},[t.bg,t.fg,t.rootStyle]);return f.jsx("div",{className:o(r,"overflow-hidden rounded-md border border-border bg-background p-4 text-sm"),"data-language":n,"data-streamdown":"code-block-body",...a,children:f.jsx("pre",{className:o(r,"bg-[var(--sdm-bg,inherit]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]"),style:c,children:f.jsx("code",{className:o("[counter-increment:line_0] [counter-reset:line]"),style:s&&s>1?{counterReset:`line ${s-1}`}:void 0,children:t.tokens.map((u,l)=>f.jsx("span",{className:i,children:u.length===0||u.length===1&&u[0].content===""?`
|
|
295
|
-
`:u.map((d,h)=>{let m={},p=!!d.bgColor;if(d.color&&(m["--sdm-c"]=d.color),d.bgColor&&(m["--sdm-tbg"]=d.bgColor),d.htmlStyle)for(let[y,g]of Object.entries(d.htmlStyle))y==="color"?m["--sdm-c"]=g:y==="background-color"?(m["--sdm-tbg"]=g,p=!0):m[y]=g;return f.jsx("span",{className:o("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",p&&"bg-[var(--sdm-tbg)]",p&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:m,...d.htmlAttrs,children:d.content},h)})},l))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className&&e.startLine===t.startLine),gMe=({className:e,language:t,style:n,isIncomplete:r,...s})=>{let a=ht();return f.jsx("div",{className:a("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...n},...s})},uq=E.createContext({code:""}),lq=()=>E.useContext(uq),bMe=({language:e})=>{let t=ht();return f.jsx("div",{className:t("flex h-8 items-center text-muted-foreground text-xs"),"data-language":e,"data-streamdown":"code-block-header",children:f.jsx("span",{className:t("ml-1 font-mono lowercase"),children:e})})},yMe=/\n+$/,xMe=E.lazy(()=>Le(()=>import("./highlighted-body-TPN3WLV5-46YyTVIj.js"),__vite__mapDeps([18,19])).then(e=>({default:e.HighlightedCodeBlockBody}))),kMe=({code:e,language:t,className:n,children:r,isIncomplete:s=!1,startLine:a,...o})=>{let i=ht(),c=E.useMemo(()=>e.replace(yMe,""),[e]),u=E.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:c.split(`
|
|
296
|
-
`).map(l=>[{content:l,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[c]);return f.jsx(uq.Provider,{value:{code:e},children:f.jsxs(gMe,{isIncomplete:s,language:t,children:[f.jsx(bMe,{language:t}),r?f.jsx("div",{className:i("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:f.jsx("div",{className:i("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"code-block-actions",children:r})}):null,f.jsx(E.Suspense,{fallback:f.jsx(pMe,{className:n,language:t,result:u,startLine:a,...o}),children:f.jsx(xMe,{className:n,code:c,language:t,raw:u,startLine:a,...o})})]})})},vMe=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),SMe=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),wMe=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),_Me=e=>f.jsxs("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[f.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),EMe=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),TMe=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),CMe=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),IMe=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),AMe=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),NMe=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),rh={CheckIcon:vMe,CopyIcon:SMe,DownloadIcon:wMe,ExternalLinkIcon:IMe,Loader2Icon:_Me,Maximize2Icon:EMe,RotateCcwIcon:TMe,XIcon:CMe,ZoomInIcon:AMe,ZoomOutIcon:NMe},dq=E.createContext(rh),RMe=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(s=>e[s]===t[s])},N$=({icons:e,children:t})=>{let n=E.useRef(e),r=E.useRef(e?{...rh,...e}:rh);RMe(n.current,e)||(n.current=e,r.current=e?{...rh,...e}:rh);let s=r.current;return f.jsx(dq.Provider,{value:s,children:t})},Ra=()=>E.useContext(dq),fq={copyCode:"Copy Code",downloadFile:"Download file",downloadDiagram:"Download diagram",downloadDiagramAsSvg:"Download diagram as SVG",downloadDiagramAsPng:"Download diagram as PNG",downloadDiagramAsMmd:"Download diagram as MMD",viewFullscreen:"View fullscreen",exitFullscreen:"Exit fullscreen",mermaidFormatSvg:"SVG",mermaidFormatPng:"PNG",mermaidFormatMmd:"MMD",copyTable:"Copy table",copyTableAsMarkdown:"Copy table as Markdown",copyTableAsCsv:"Copy table as CSV",copyTableAsTsv:"Copy table as TSV",downloadTable:"Download table",downloadTableAsCsv:"Download table as CSV",downloadTableAsMarkdown:"Download table as Markdown",tableFormatMarkdown:"Markdown",tableFormatCsv:"CSV",tableFormatTsv:"TSV",imageNotAvailable:"Image not available",downloadImage:"Download image",openExternalLink:"Open external link?",externalLinkWarning:"You're about to visit an external website.",close:"Close",copyLink:"Copy link",copied:"Copied",openLink:"Open link"},NE=E.createContext(fq),Wo=()=>E.useContext(NE),R$=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:s,code:a,...o})=>{let i=ht(),[c,u]=E.useState(!1),l=E.useRef(0),{code:d}=lq(),{isAnimating:h}=E.useContext(_s),m=Wo(),p=a??d,y=async()=>{var x;if(typeof window>"u"||!((x=navigator?.clipboard)!=null&&x.writeText)){t?.(new Error("Clipboard API not available"));return}try{c||(await navigator.clipboard.writeText(p),u(!0),e?.(),l.current=window.setTimeout(()=>u(!1),n))}catch(k){t?.(k)}};E.useEffect(()=>()=>{window.clearTimeout(l.current)},[]);let g=Ra(),b=c?g.CheckIcon:g.CopyIcon;return f.jsx("button",{className:i("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",s),"data-streamdown":"code-block-copy-button",disabled:h,onClick:y,title:m.copyCode,type:"button",...o,children:r??f.jsx(b,{size:14})})},P$={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},PMe=({onDownload:e,onError:t,language:n,children:r,className:s,code:a,...o})=>{let i=ht(),{code:c}=lq(),{isAnimating:u}=E.useContext(_s),l=Wo(),d=Ra(),h=a??c,m=`file.${n&&n in P$?P$[n]:"txt"}`,p="text/plain",y=()=>{try{Ul(m,h,p),e?.()}catch(g){t?.(g)}};return f.jsx("button",{className:i("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",s),"data-streamdown":"code-block-download-button",disabled:u,onClick:y,title:l.downloadFile,type:"button",...o,children:r??f.jsx(d.DownloadIcon,{size:14})})},O$=()=>{let{Loader2Icon:e}=Ra(),t=ht();return f.jsxs("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[f.jsx("div",{className:t("h-[46px] w-full bg-muted/80")}),f.jsx("div",{className:t("flex w-full items-center justify-center p-4"),children:f.jsx(e,{className:t("size-4 animate-spin")})})]})},OMe=/\.[^/.]+$/,LMe=({node:e,className:t,src:n,alt:r,onLoad:s,onError:a,...o})=>{let{DownloadIcon:i}=Ra(),c=ht(),u=E.useRef(null),[l,d]=E.useState(!1),[h,m]=E.useState(!1),p=Wo(),y=o.width!=null||o.height!=null,g=(l||y)&&!h,b=h&&!y;E.useEffect(()=>{let S=u.current;if(S!=null&&S.complete){let w=S.naturalWidth>0;d(w),m(!w)}},[]);let x=E.useCallback(S=>{d(!0),m(!1),s?.(S)},[s]),k=E.useCallback(S=>{d(!1),m(!0),a?.(S)},[a]),_=async()=>{if(n)try{let S=await(await fetch(n)).blob(),w=new URL(n,window.location.origin).pathname.split("/").pop()||"",T=w.split(".").pop(),A=w.includes(".")&&T!==void 0&&T.length<=4,L="";if(A)L=w;else{let R=S.type,j="png";R.includes("jpeg")||R.includes("jpg")?j="jpg":R.includes("png")?j="png":R.includes("svg")?j="svg":R.includes("gif")?j="gif":R.includes("webp")&&(j="webp"),L=`${(r||w||"image").replace(OMe,"")}.${j}`}Ul(L,S,S.type)}catch{window.open(n,"_blank")}};return n?f.jsxs("div",{className:c("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[f.jsx("img",{alt:r,className:c("max-w-full rounded-lg",b&&"hidden",t),"data-streamdown":"image",onError:k,onLoad:x,ref:u,src:n,...o}),b&&f.jsx("span",{className:c("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:p.imageNotAvailable}),f.jsx("div",{className:c("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block")}),g&&f.jsx("button",{className:c("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:_,title:p.downloadImage,type:"button",children:f.jsx(i,{size:14})})]}):null},Fh=0,lA=()=>{Fh+=1,Fh===1&&(document.body.style.overflow="hidden")},dA=()=>{Fh=Math.max(0,Fh-1),Fh===0&&(document.body.style.overflow="")},$Me=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:s,CopyIcon:a,ExternalLinkIcon:o,XIcon:i}=Ra(),c=ht(),[u,l]=E.useState(!1),d=Wo(),h=E.useCallback(async()=>{try{await navigator.clipboard.writeText(e),l(!0),setTimeout(()=>l(!1),2e3)}catch{}},[e]),m=E.useCallback(()=>{r(),n()},[r,n]);return E.useEffect(()=>{if(t){lA();let p=y=>{y.key==="Escape"&&n()};return document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p),dA()}}},[t,n]),t?f.jsx("div",{className:c("fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm"),"data-streamdown":"link-safety-modal",onClick:n,onKeyDown:p=>{p.key==="Escape"&&n()},role:"button",tabIndex:0,children:f.jsxs("div",{className:c("relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg"),onClick:p=>p.stopPropagation(),onKeyDown:p=>p.stopPropagation(),role:"presentation",children:[f.jsx("button",{className:c("absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:n,title:d.close,type:"button",children:f.jsx(i,{size:16})}),f.jsxs("div",{className:c("flex flex-col gap-2"),children:[f.jsxs("div",{className:c("flex items-center gap-2 font-semibold text-lg"),children:[f.jsx(o,{size:20}),f.jsx("span",{children:d.openExternalLink})]}),f.jsx("p",{className:c("text-muted-foreground text-sm"),children:d.externalLinkWarning})]}),f.jsx("div",{className:c("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),f.jsxs("div",{className:c("flex gap-2"),children:[f.jsx("button",{className:c("flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted"),onClick:h,type:"button",children:u?f.jsxs(f.Fragment,{children:[f.jsx(s,{size:14}),f.jsx("span",{children:d.copied})]}):f.jsxs(f.Fragment,{children:[f.jsx(a,{size:14}),f.jsx("span",{children:d.copyLink})]})}),f.jsxs("button",{className:c("flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90"),onClick:m,type:"button",children:[f.jsx(o,{size:14}),f.jsx("span",{children:d.openLink})]})]})]})}):null},RE=E.createContext(null),fA=()=>E.useContext(RE),Nze=()=>{var e;let t=fA();return(e=t?.code)!=null?e:null},hA=()=>{var e;let t=fA();return(e=t?.mermaid)!=null?e:null},jMe=e=>{var t;let n=fA();return n!=null&&n.renderers&&e&&(t=n.renderers.find(r=>Array.isArray(r.language)?r.language.includes(e):r.language===e))!=null?t:null},MMe=(e,t)=>{var n;let r=(n=void 0)!=null?n:5;return new Promise((s,a)=>{let o="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),i=new Image;i.crossOrigin="anonymous",i.onload=()=>{let c=document.createElement("canvas"),u=i.width*r,l=i.height*r;c.width=u,c.height=l;let d=c.getContext("2d");if(!d){a(new Error("Failed to create 2D canvas context for PNG export"));return}d.drawImage(i,0,0,u,l),c.toBlob(h=>{if(!h){a(new Error("Failed to create PNG blob"));return}s(h)},"image/png")},i.onerror=()=>a(new Error("Failed to load SVG image")),i.src=o})},DMe=({chart:e,children:t,className:n,onDownload:r,config:s,onError:a})=>{let o=ht(),[i,c]=E.useState(!1),u=E.useRef(null),{isAnimating:l}=E.useContext(_s),d=Ra(),h=hA(),m=Wo(),p=async y=>{try{if(y==="mmd"){Ul("diagram.mmd",e,"text/plain"),c(!1),r?.(y);return}if(!h){a?.(new Error("Mermaid plugin not available"));return}let g=h.getMermaid(s),b=e.split("").reduce((_,S)=>(_<<5)-_+S.charCodeAt(0)|0,0),x=`mermaid-${Math.abs(b)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:k}=await g.render(x,e);if(!k){a?.(new Error("SVG not found. Please wait for the diagram to render."));return}if(y==="svg"){Ul("diagram.svg",k,"image/svg+xml"),c(!1),r?.(y);return}if(y==="png"){let _=await MMe(k);Ul("diagram.png",_,"image/png"),r?.(y),c(!1);return}}catch(g){a?.(g)}};return E.useEffect(()=>{let y=g=>{let b=g.composedPath();u.current&&!b.includes(u.current)&&c(!1)};return document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y)}},[]),f.jsxs("div",{className:o("relative"),ref:u,children:[f.jsx("button",{className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",n),disabled:l,onClick:()=>c(!i),title:m.downloadDiagram,type:"button",children:t??f.jsx(d.DownloadIcon,{size:14})}),i?f.jsxs("div",{className:o("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[f.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("svg"),title:m.downloadDiagramAsSvg,type:"button",children:m.mermaidFormatSvg}),f.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("png"),title:m.downloadDiagramAsPng,type:"button",children:m.mermaidFormatPng}),f.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("mmd"),title:m.downloadDiagramAsMmd,type:"button",children:m.mermaidFormatMmd})]}):null]})},FMe=({chart:e,config:t,onFullscreen:n,onExit:r,className:s,...a})=>{let{Maximize2Icon:o,XIcon:i}=Ra(),c=ht(),[u,l]=E.useState(!1),{isAnimating:d,controls:h}=E.useContext(_s),m=Wo(),p=(()=>{if(typeof h=="boolean")return h;let g=h.mermaid;return g===!1?!1:g===!0||g===void 0?!0:g.panZoom!==!1})(),y=()=>{l(!u)};return E.useEffect(()=>{if(u){lA();let g=b=>{b.key==="Escape"&&l(!1)};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g),dA()}}},[u]),E.useEffect(()=>{u?n?.():r&&r()},[u,n,r]),f.jsxs(f.Fragment,{children:[f.jsx("button",{className:c("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",s),disabled:d,onClick:y,title:m.viewFullscreen,type:"button",...a,children:f.jsx(o,{size:14})}),u?wu.createPortal(f.jsxs("div",{className:c("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),onClick:y,onKeyDown:g=>{g.key==="Escape"&&y()},role:"button",tabIndex:0,children:[f.jsx("button",{className:c("absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:y,title:m.exitFullscreen,type:"button",children:f.jsx(i,{size:20})}),f.jsx("div",{className:c("flex size-full items-center justify-center p-4"),onClick:g=>g.stopPropagation(),onKeyDown:g=>g.stopPropagation(),role:"presentation",children:f.jsx(Vq,{chart:e,className:c("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:p})})]}),document.body):null]})},hq=e=>{var t,n;let r=[],s=[],a=e.querySelectorAll("thead th");for(let i of a)r.push(((t=i.textContent)==null?void 0:t.trim())||"");let o=e.querySelectorAll("tbody tr");for(let i of o){let c=[],u=i.querySelectorAll("td");for(let l of u)c.push(((n=l.textContent)==null?void 0:n.trim())||"");s.push(c)}return{headers:r,rows:s}},mq=e=>{let{headers:t,rows:n}=e,r=i=>{let c=!1,u=!1;for(let l of i){if(l==='"'){c=!0,u=!0;break}(l===","||l===`
|
|
297
|
-
`)&&(c=!0)}return c?u?`"${i.replace(/"/g,'""')}"`:`"${i}"`:i},s=t.length>0?n.length+1:n.length,a=new Array(s),o=0;t.length>0&&(a[o]=t.map(r).join(","),o+=1);for(let i of n)a[o]=i.map(r).join(","),o+=1;return a.join(`
|
|
298
|
-
`)},BMe=e=>{let{headers:t,rows:n}=e,r=i=>{let c=!1;for(let l of i)if(l===" "||l===`
|
|
299
|
-
`||l==="\r"){c=!0;break}if(!c)return i;let u=[];for(let l of i)l===" "?u.push("\\t"):l===`
|
|
300
|
-
`?u.push("\\n"):l==="\r"?u.push("\\r"):u.push(l);return u.join("")},s=t.length>0?n.length+1:n.length,a=new Array(s),o=0;t.length>0&&(a[o]=t.map(r).join(" "),o+=1);for(let i of n)a[o]=i.map(r).join(" "),o+=1;return a.join(`
|
|
301
|
-
`)},jS=e=>{let t=!1;for(let r of e)if(r==="\\"||r==="|"){t=!0;break}if(!t)return e;let n=[];for(let r of e)r==="\\"?n.push("\\\\"):r==="|"?n.push("\\|"):n.push(r);return n.join("")},PE=e=>{let{headers:t,rows:n}=e;if(t.length===0)return"";let r=new Array(n.length+2),s=0,a=t.map(i=>jS(i));r[s]=`| ${a.join(" | ")} |`,s+=1;let o=new Array(t.length);for(let i=0;i<t.length;i+=1)o[i]="---";r[s]=`| ${o.join(" | ")} |`,s+=1;for(let i of n)if(i.length<t.length){let c=new Array(t.length);for(let u=0;u<t.length;u+=1)c[u]=u<i.length?jS(i[u]):"";r[s]=`| ${c.join(" | ")} |`,s+=1}else{let c=i.map(u=>jS(u));r[s]=`| ${c.join(" | ")} |`,s+=1}return r.join(`
|
|
302
|
-
`)},pq=({children:e,className:t,onCopy:n,onError:r,timeout:s=2e3})=>{let a=ht(),[o,i]=E.useState(!1),[c,u]=E.useState(!1),l=E.useRef(null),d=E.useRef(0),{isAnimating:h}=E.useContext(_s),m=Wo(),p=async b=>{var x,k;if(typeof window>"u"||!((x=navigator?.clipboard)!=null&&x.write)){r?.(new Error("Clipboard API not available"));return}try{let _=(k=l.current)==null?void 0:k.closest('[data-streamdown="table-wrapper"]'),S=_?.querySelector("table");if(!S){r?.(new Error("Table not found"));return}let w=hq(S),T=({csv:mq,tsv:BMe,md:PE}[b]||PE)(w),A=new ClipboardItem({"text/plain":new Blob([T],{type:"text/plain"}),"text/html":new Blob([S.outerHTML],{type:"text/html"})});await navigator.clipboard.write([A]),u(!0),i(!1),n?.(b),d.current=window.setTimeout(()=>u(!1),s)}catch(_){r?.(_)}};E.useEffect(()=>{let b=x=>{let k=x.composedPath();l.current&&!k.includes(l.current)&&i(!1)};return document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b),window.clearTimeout(d.current)}},[]);let y=Ra(),g=c?y.CheckIcon:y.CopyIcon;return f.jsxs("div",{className:a("relative"),ref:l,children:[f.jsx("button",{className:a("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:h,onClick:()=>i(!o),title:m.copyTable,type:"button",children:e??f.jsx(g,{height:14,width:14})}),o?f.jsxs("div",{className:a("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[f.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("md"),title:m.copyTableAsMarkdown,type:"button",children:m.tableFormatMarkdown}),f.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("csv"),title:m.copyTableAsCsv,type:"button",children:m.tableFormatCsv}),f.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("tsv"),title:m.copyTableAsTsv,type:"button",children:m.tableFormatTsv})]}):null]})},gq=({children:e,className:t,onDownload:n,onError:r})=>{let s=ht(),[a,o]=E.useState(!1),i=E.useRef(null),{isAnimating:c}=E.useContext(_s),u=Wo(),l=Ra(),d=h=>{var m;try{let p=(m=i.current)==null?void 0:m.closest('[data-streamdown="table-wrapper"]'),y=p?.querySelector("table");if(!y){r?.(new Error("Table not found"));return}let g=hq(y),b=h==="csv"?mq(g):PE(g);Ul(`table.${h==="csv"?"csv":"md"}`,b,h==="csv"?"text/csv":"text/markdown"),o(!1),n?.(h)}catch(p){r?.(p)}};return E.useEffect(()=>{let h=m=>{let p=m.composedPath();i.current&&!p.includes(i.current)&&o(!1)};return document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}},[]),f.jsxs("div",{className:s("relative"),ref:i,children:[f.jsx("button",{className:s("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:c,onClick:()=>o(!a),title:u.downloadTable,type:"button",children:e??f.jsx(l.DownloadIcon,{size:14})}),a?f.jsxs("div",{className:s("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[f.jsx("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>d("csv"),title:u.downloadTableAsCsv,type:"button",children:u.tableFormatCsv}),f.jsx("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>d("markdown"),title:u.downloadTableAsMarkdown,type:"button",children:u.tableFormatMarkdown})]}):null]})},UMe=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:s,XIcon:a}=Ra(),o=ht(),[i,c]=E.useState(!1),{isAnimating:u}=E.useContext(_s),l=Wo(),d=()=>{c(!0)},h=()=>{c(!1)};return E.useEffect(()=>{if(i){lA();let m=p=>{p.key==="Escape"&&c(!1)};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m),dA()}}},[i]),f.jsxs(f.Fragment,{children:[f.jsx("button",{className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:u,onClick:d,title:l.viewFullscreen,type:"button",children:f.jsx(s,{size:14})}),i?wu.createPortal(f.jsx("div",{"aria-label":l.viewFullscreen,"aria-modal":"true",className:o("fixed inset-0 z-50 flex flex-col bg-background"),"data-streamdown":"table-fullscreen",onClick:h,onKeyDown:m=>{m.key==="Escape"&&h()},role:"dialog",children:f.jsxs("div",{className:o("flex h-full flex-col"),onClick:m=>m.stopPropagation(),onKeyDown:m=>m.stopPropagation(),role:"presentation",children:[f.jsxs("div",{className:o("flex items-center justify-end gap-1 p-4"),children:[n?f.jsx(pq,{}):null,r?f.jsx(gq,{}):null,f.jsx("button",{className:o("rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:h,title:l.exitFullscreen,type:"button",children:f.jsx(a,{size:20})})]}),f.jsx("div",{className:o("flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10"),children:f.jsx("table",{className:o("w-full border-collapse border border-border"),"data-streamdown":"table",children:e})})]})}),document.body):null]})},zMe=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:s=!0,showFullscreen:a=!0,...o})=>{let i=ht(),c=n&&r,u=n&&s,l=n&&a,d=c||u||l;return f.jsxs("div",{className:i("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"),"data-streamdown":"table-wrapper",children:[d?f.jsxs("div",{className:i("flex items-center justify-end gap-1"),children:[c?f.jsx(pq,{}):null,u?f.jsx(gq,{}):null,l?f.jsx(UMe,{showCopy:c,showDownload:u,children:e}):null]}):null,f.jsx("div",{className:i("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"),children:f.jsx("table",{className:i("w-full divide-y divide-border",t),"data-streamdown":"table",...o,children:e})})]})},HMe=/startLine=(\d+)/,qMe=E.lazy(()=>Le(()=>Promise.resolve().then(()=>FUe),void 0).then(e=>({default:e.Mermaid}))),VMe=/language-([^\s]+)/;function Tk(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,s=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&s?.line===a?.line&&s?.column===a?.column}function ln(e,t){return e.className===t.className&&Tk(e.node,t.node)}var OE=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,MS=(e,t)=>{if(typeof e=="boolean")return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},L$=(e,t)=>{if(typeof e=="boolean")return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},hb=(e,t)=>{if(typeof e=="boolean")return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},mA=E.memo(({children:e,className:t,node:n,...r})=>{let s=ht();return f.jsx("ol",{className:s("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e})},(e,t)=>ln(e,t));mA.displayName="MarkdownOl";var bq=E.memo(({children:e,className:t,node:n,...r})=>{let s=ht();return f.jsx("li",{className:s("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e})},(e,t)=>e.className===t.className&&Tk(e.node,t.node));bq.displayName="MarkdownLi";var yq=E.memo(({children:e,className:t,node:n,...r})=>{let s=ht();return f.jsx("ul",{className:s("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e})},(e,t)=>ln(e,t));yq.displayName="MarkdownUl";var xq=E.memo(({className:e,node:t,...n})=>{let r=ht();return f.jsx("hr",{className:r("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n})},(e,t)=>ln(e,t));xq.displayName="MarkdownHr";var kq=E.memo(({children:e,className:t,node:n,...r})=>{let s=ht();return f.jsx("span",{className:s("font-semibold",t),"data-streamdown":"strong",...r,children:e})},(e,t)=>ln(e,t));kq.displayName="MarkdownStrong";var GMe=({children:e,className:t,href:n,node:r,...s})=>{let a=ht(),{linkSafety:o}=E.useContext(_s),[i,c]=E.useState(!1),u=n==="streamdown:incomplete-link",l=E.useCallback(async p=>{if(!(!(o!=null&&o.enabled&&n)||u)){if(p.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}c(!0)}},[o,n,u]),d=E.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),h=E.useCallback(()=>{c(!1)},[]),m={url:n??"",isOpen:i,onClose:h,onConfirm:d};return o!=null&&o.enabled&&n?f.jsxs(f.Fragment,{children:[f.jsx("button",{className:a("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":u,"data-streamdown":"link",onClick:l,type:"button",children:e}),o.renderModal?o.renderModal(m):f.jsx($Me,{...m})]}):f.jsx("a",{className:a("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":u,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...s,children:e})},vq=E.memo(GMe,(e,t)=>ln(e,t)&&e.href===t.href);vq.displayName="MarkdownA";var Sq=E.memo(({children:e,className:t,node:n,...r})=>{let s=ht();return f.jsx("h1",{className:s("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e})},(e,t)=>ln(e,t));Sq.displayName="MarkdownH1";var wq=E.memo(({children:e,className:t,node:n,...r})=>{let s=ht();return f.jsx("h2",{className:s("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e})},(e,t)=>ln(e,t));wq.displayName="MarkdownH2";var _q=E.memo(({children:e,className:t,node:n,...r})=>{let s=ht();return f.jsx("h3",{className:s("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e})},(e,t)=>ln(e,t));_q.displayName="MarkdownH3";var Eq=E.memo(({children:e,className:t,node:n,...r})=>{let s=ht();return f.jsx("h4",{className:s("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e})},(e,t)=>ln(e,t));Eq.displayName="MarkdownH4";var Tq=E.memo(({children:e,className:t,node:n,...r})=>{let s=ht();return f.jsx("h5",{className:s("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e})},(e,t)=>ln(e,t));Tq.displayName="MarkdownH5";var Cq=E.memo(({children:e,className:t,node:n,...r})=>{let s=ht();return f.jsx("h6",{className:s("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e})},(e,t)=>ln(e,t));Cq.displayName="MarkdownH6";var Iq=E.memo(({children:e,className:t,node:n,...r})=>{let{controls:s}=E.useContext(_s),a=OE(s,"table"),o=MS(s,"copy"),i=MS(s,"download"),c=MS(s,"fullscreen");return f.jsx(zMe,{className:t,showControls:a,showCopy:o,showDownload:i,showFullscreen:c,...r,children:e})},(e,t)=>ln(e,t));Iq.displayName="MarkdownTable";var Aq=E.memo(({children:e,className:t,node:n,...r})=>{let s=ht();return f.jsx("thead",{className:s("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e})},(e,t)=>ln(e,t));Aq.displayName="MarkdownThead";var Nq=E.memo(({children:e,className:t,node:n,...r})=>{let s=ht();return f.jsx("tbody",{className:s("divide-y divide-border",t),"data-streamdown":"table-body",...r,children:e})},(e,t)=>ln(e,t));Nq.displayName="MarkdownTbody";var Rq=E.memo(({children:e,className:t,node:n,...r})=>{let s=ht();return f.jsx("tr",{className:s("border-border",t),"data-streamdown":"table-row",...r,children:e})},(e,t)=>ln(e,t));Rq.displayName="MarkdownTr";var Pq=E.memo(({children:e,className:t,node:n,...r})=>{let s=ht();return f.jsx("th",{className:s("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e})},(e,t)=>ln(e,t));Pq.displayName="MarkdownTh";var Oq=E.memo(({children:e,className:t,node:n,...r})=>{let s=ht();return f.jsx("td",{className:s("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e})},(e,t)=>ln(e,t));Oq.displayName="MarkdownTd";var Lq=E.memo(({children:e,className:t,node:n,...r})=>{let s=ht();return f.jsx("blockquote",{className:s("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e})},(e,t)=>ln(e,t));Lq.displayName="MarkdownBlockquote";var $q=E.memo(({children:e,className:t,node:n,...r})=>{let s=ht();return f.jsx("sup",{className:s("text-sm",t),"data-streamdown":"superscript",...r,children:e})},(e,t)=>ln(e,t));$q.displayName="MarkdownSup";var jq=E.memo(({children:e,className:t,node:n,...r})=>{let s=ht();return f.jsx("sub",{className:s("text-sm",t),"data-streamdown":"subscript",...r,children:e})},(e,t)=>ln(e,t));jq.displayName="MarkdownSub";var Mq=E.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let s=o=>{var i,c;if(!E.isValidElement(o))return!1;let u=Array.isArray(o.props.children)?o.props.children:[o.props.children],l=!1,d=!1;for(let h of u)if(h){if(typeof h=="string")h.trim()!==""&&(l=!0);else if(E.isValidElement(h))if(((i=h.props)==null?void 0:i["data-footnote-backref"])!==void 0)d=!0;else{let m=Array.isArray(h.props.children)?h.props.children:[h.props.children];for(let p of m){if(typeof p=="string"&&p.trim()!==""){l=!0;break}if(E.isValidElement(p)&&((c=p.props)==null?void 0:c["data-footnote-backref"])===void 0){l=!0;break}}}}return d&&!l},a=Array.isArray(e)?e.map(o=>{if(!E.isValidElement(o))return o;if(o.type===mA){let i=(Array.isArray(o.props.children)?o.props.children:[o.props.children]).filter(c=>!s(c));return i.length===0?null:{...o,props:{...o.props,children:i}}}return o}):e;return(Array.isArray(a)?a.some(o=>o!==null):a!==null)?f.jsx("section",{className:t,...r,children:a}):null}return f.jsx("section",{className:t,...r,children:e})},(e,t)=>ln(e,t));Mq.displayName="MarkdownSection";var KMe=({node:e,className:t,children:n,...r})=>{var s,a;let o=ht(),i=!("data-block"in r),{mermaid:c,controls:u}=E.useContext(_s),l=hA(),d=lMe(),h=t?.match(VMe),m=(s=h?.at(1))!=null?s:"",p=jMe(m);if(i)return f.jsx("code",{className:o("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let y=(a=e?.properties)==null?void 0:a.metastring,g=y?.match(HMe),b=g?Number.parseInt(g[1],10):void 0,x=b!==void 0&&b>=1?b:void 0,k="";if(E.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?k=n.props.children:typeof n=="string"&&(k=n),p){let T=p.component;return f.jsx(E.Suspense,{fallback:f.jsx(O$,{}),children:f.jsx(T,{code:k,isIncomplete:d,language:m})})}if(m==="mermaid"&&l){let T=OE(u,"mermaid"),A=hb(u,"download"),L=hb(u,"copy"),R=hb(u,"fullscreen"),j=hb(u,"panZoom"),F=T&&(A||L||R);return f.jsx(E.Suspense,{fallback:f.jsx(O$,{}),children:f.jsxs("div",{className:o("group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",t),"data-streamdown":"mermaid-block",children:[f.jsx("div",{className:o("flex h-8 items-center text-muted-foreground text-xs"),children:f.jsx("span",{className:o("ml-1 font-mono lowercase"),children:"mermaid"})}),F?f.jsx("div",{className:o("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:f.jsxs("div",{className:o("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"mermaid-block-actions",children:[A?f.jsx(DMe,{chart:k,config:c?.config}):null,L?f.jsx(R$,{code:k}):null,R?f.jsx(FMe,{chart:k,config:c?.config}):null]})}):null,f.jsx("div",{className:o("rounded-md border border-border bg-background"),children:f.jsx(qMe,{chart:k,config:c?.config,showControls:j})})]})})}let _=OE(u,"code"),S=L$(u,"download"),w=L$(u,"copy");return f.jsx(kMe,{className:t,code:k,isIncomplete:d,language:m,startLine:x,children:_?f.jsxs(f.Fragment,{children:[S?f.jsx(PMe,{code:k,language:m}):null,w?f.jsx(R$,{}):null]}):null})},Dq=E.memo(KMe,(e,t)=>e.className===t.className&&Tk(e.node,t.node));Dq.displayName="MarkdownCode";var Fq=E.memo(LMe,(e,t)=>e.className===t.className&&Tk(e.node,t.node));Fq.displayName="MarkdownImg";var Bq=E.memo(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(s=>s!=null&&s!=="");if(r.length===1&&E.isValidElement(r[0])){let s=r[0].props.node,a=s?.tagName;if(a==="img")return f.jsx(f.Fragment,{children:e});if(a==="code"&&"data-block"in r[0].props)return f.jsx(f.Fragment,{children:e})}return f.jsx("p",{...n,children:e})},(e,t)=>ln(e,t));Bq.displayName="MarkdownParagraph";var WMe={ol:mA,li:bq,ul:yq,hr:xq,strong:kq,a:vq,h1:Sq,h2:wq,h3:_q,h4:Eq,h5:Tq,h6:Cq,table:Iq,thead:Aq,tbody:Nq,tr:Rq,th:Pq,td:Oq,blockquote:Lq,code:Dq,img:Fq,pre:({children:e})=>E.isValidElement(e)?E.cloneElement(e,{"data-block":"true"}):e,sup:$q,sub:jq,p:Bq,section:Mq},YMe=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,JMe=new RegExp("\\p{L}","u");function $$(e){let t=e.replace(/^#{1,6}\s+/gm,"").replace(/(\*{1,3}|_{1,3})/g,"").replace(/`[^`]*`/g,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^[\s>*\-+\d.]+/gm,"");for(let n of t){if(YMe.test(n))return"rtl";if(JMe.test(n))return"ltr"}return"ltr"}var QMe=/^[ \t]{0,3}(`{3,}|~{3,})/,XMe=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,j$=e=>{let t=e.split(`
|
|
303
|
-
`),n=null,r=0;for(let s of t){let a=QMe.exec(s);if(n===null){if(a){let o=a[1];n=o[0],r=o.length}}else if(a){let o=a[1],i=o[0],c=o.length;i===n&&c>=r&&(n=null,r=0)}}return n!==null},ZMe=e=>{let t=e.split(`
|
|
304
|
-
`);for(let n of t){let r=n.trim();if(r.length>0&&r.includes("|")&&XMe.test(r))return!0}return!1},eDe=()=>e=>{Za(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},M$=[],D$={allowDangerousHtml:!0},mb=new WeakMap,tDe=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,s=e.remarkRehypeOptions;if(!(n||r||s)){let l="default";return this.keyCache.set(e,l),l}let a=l=>{if(!l||l.length===0)return"";let d="";for(let h=0;h<l.length;h+=1){let m=l[h];if(h>0&&(d+=","),Array.isArray(m)){let[p,y]=m;if(typeof p=="function"){let g=mb.get(p);g||(g=p.name,mb.set(p,g)),d+=g}else d+=String(p);d+=":",d+=JSON.stringify(y)}else if(typeof m=="function"){let p=mb.get(m);p||(p=m.name,mb.set(m,p)),d+=p}else d+=String(m)}return d},o=a(n),i=a(r),c=s?JSON.stringify(s):"",u=`${i}::${o}::${c}`;return this.keyCache.set(e,u),u}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r&&this.cache.delete(r)}this.cache.set(n,t)}clear(){this.cache.clear()}},F$=new tDe,Uq=e=>{let t=nDe(e),n=e.children||"",r=t.runSync(t.parse(n),n);return uDe(r,e)},nDe=e=>{let t=F$.get(e);if(t)return t;let n=sDe(e);return F$.set(e,n),n},rDe=e=>e.some(t=>Array.isArray(t)?t[0]===bE:t===bE),sDe=e=>{let t=e.rehypePlugins||M$,n=e.remarkPlugins||M$,r=rDe(t)?n:[...n,eDe],s=e.remarkRehypeOptions?{...D$,...e.remarkRehypeOptions}:D$;return sje().use(r$e).use(r).use(F$e,s).use(t)},aDe=e=>e,oDe=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},iDe=(e,t)=>{var n;for(let r in CS)if(Object.hasOwn(CS,r)&&Object.hasOwn(e.properties,r)){let s=e.properties[r],a=CS[r];(a===null||a.includes(e.tagName))&&(e.properties[r]=(n=t(String(s||""),r,e))!=null?n:void 0)}},cDe=(e,t,n,r,s,a)=>{let o=!1;return r?o=!r.includes(e.tagName):s&&(o=s.includes(e.tagName)),!o&&a&&typeof t=="number"&&(o=!a(e,t,n)),o},uDe=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:s,skipHtml:a,unwrapDisallowed:o,urlTransform:i}=t;if(n||r||s||a||i){let c=i||aDe;Za(e,(u,l,d)=>{if(u.type==="raw"&&d&&typeof l=="number")return oDe(d,l,a,u.value),l;if(u.type==="element"&&(iDe(u,c),cDe(u,l,d,r,s,n)&&d&&typeof l=="number"))return o&&u.children?d.children.splice(l,1,...u.children):d.children.splice(l,1),l})}return dLe(e,{Fragment:f.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0})},lDe=/\[\^[\w-]{1,200}\](?!:)/,dDe=/\[\^[\w-]{1,200}\]:/,fDe=/<(\w+)[\s>]/,hDe=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),B$=new Map,U$=new Map,mDe=e=>{let t=e.toLowerCase(),n=B$.get(t);if(n)return n;let r=new RegExp(`<${t}(?=[\\s>/])[^>]*>`,"gi");return B$.set(t,r),r},pDe=e=>{let t=e.toLowerCase(),n=U$.get(t);if(n)return n;let r=new RegExp(`</${t}(?=[\\s>])[^>]*>`,"gi");return U$.set(t,r),r},z$=(e,t)=>{if(hDe.has(t.toLowerCase()))return 0;let n=e.match(mDe(t));if(!n)return 0;let r=0;for(let s of n)s.trimEnd().endsWith("/>")||(r+=1);return r},H$=(e,t)=>{let n=e.match(pDe(t));return n?n.length:0},gDe=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},bDe=e=>{let t=lDe.test(e),n=dDe.test(e);if(t||n)return[e];let r=Ms.lex(e,{gfm:!0}),s=[],a=[],o=!1;for(let i of r){let c=i.raw,u=s.length;if(a.length>0){s[u-1]+=c;let l=a.at(-1),d=z$(c,l),h=H$(c,l);for(let m=0;m<d;m+=1)a.push(l);for(let m=0;m<h;m+=1)a.length>0&&a.at(-1)===l&&a.pop();continue}if(i.type==="html"&&i.block){let l=c.match(fDe);if(l){let d=l[1],h=z$(c,d),m=H$(c,d);h>m&&a.push(d)}}if(u>0&&!o){let l=s[u-1];if(gDe(l)%2===1){s[u-1]=l+c;continue}}s.push(c),i.type!=="space"&&(o=i.type==="code")}return s},yDe=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let s=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(s,(a,o,i,c)=>{let u=i.replace(/\n\n/g,`
|
|
305
|
-
<!---->
|
|
306
|
-
`);return o+u+c})}return n},xDe=/([\\`*_~[\]|])/g,kDe=e=>e.replace(xDe,"\\$1"),vDe=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let s=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(s,(a,o,i,c)=>o+kDe(i)+c)}return n},zq=e=>e.type==="text"?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(zq).join(""):"",SDe=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(r=>r.toLowerCase()));Za(t,"element",r=>{if(n.has(r.tagName.toLowerCase())){let s=zq(r);r.children=s?[{type:"text",value:s}]:[]}})},wDe=()=>e=>{Za(e,"code",t=>{var n,r;t.meta&&(t.data=(n=t.data)!=null?n:{},t.data.hProperties={...(r=t.data.hProperties)!=null?r:{},metastring:t.meta})})},_De=/^[ \t]*<[\w!/?-]/,EDe=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,TDe=e=>typeof e!="string"||e.length===0||!_De.test(e)?e:e.replace(EDe,"$1"),q$,V$,G$,K$,cy={...Ac,protocols:{...Ac.protocols,href:[...(V$=(q$=Ac.protocols)==null?void 0:q$.href)!=null?V$:[],"tel"]},attributes:{...Ac.attributes,code:[...(K$=(G$=Ac.attributes)==null?void 0:G$.code)!=null?K$:[],"metastring"]}},LE={raw:bE,sanitize:[Q7,cy],harden:[$Ce,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},CDe={gfm:[qOe,{}],codeMeta:wDe},W$=Object.values(LE),IDe=Object.values(CDe),ADe={block:" ▋",circle:" ●"},NDe={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},_s=E.createContext(NDe),Hq=E.memo(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:s,dir:a,animatePlugin:o,...i})=>{if(o){let l=o.getLastRenderCharCount();o.setPrevContentLength(l)}let c=typeof e=="string"&&n?TDe(e):e,u=f.jsx(Uq,{...i,children:c});return f.jsx(cq.Provider,{value:s,children:a?f.jsx("div",{dir:a,style:{display:"contents"},children:u}):u})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(s=>{var a,o;return((a=e.components)==null?void 0:a[s])!==((o=t.components)==null?void 0:o[s])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});Hq.displayName="Block";var RDe=["github-light","github-dark"],qq=E.memo(({children:e,mode:t="streaming",dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:s=!1,components:a,rehypePlugins:o=W$,remarkPlugins:i=IDe,className:c,shikiTheme:u=RDe,mermaid:l,controls:d=!0,isAnimating:h=!1,animated:m,BlockComponent:p=Hq,parseMarkdownIntoBlocksFn:y=bDe,caret:g,plugins:b,remend:x,linkSafety:k={enabled:!0},allowedTags:_,literalTagContent:S,translations:w,icons:T,prefix:A,onAnimationStart:L,onAnimationEnd:R,...j})=>{let F=E.useId(),[K,Y]=E.useTransition(),W=E.useMemo(()=>fMe(A),[A]),J=E.useRef(null),ae=E.useRef(L),ge=E.useRef(R);ae.current=L,ge.current=R,E.useEffect(()=>{var fe,ve,ze;if(t==="static")return;let Se=J.current;if(J.current=h,Se===null){h&&((fe=ae.current)==null||fe.call(ae));return}h&&!Se?(ve=ae.current)==null||ve.call(ae):!h&&Se&&((ze=ge.current)==null||ze.call(ge))},[h,t]);let le=E.useMemo(()=>_?Object.keys(_):[],[_]),I=E.useMemo(()=>{if(typeof e!="string")return"";let fe=t==="streaming"&&r?Q3e(e,x):e;return S&&S.length>0&&(fe=vDe(fe,S)),le.length>0&&(fe=yDe(fe,le)),fe},[e,t,r,x,le,S]),U=E.useMemo(()=>y(I),[I,y]),[V,N]=E.useState(U);E.useEffect(()=>{t==="streaming"&&!ce?Y(()=>{N(U)}):N(U)},[U,t]);let P=t==="streaming"?V:U,D=E.useMemo(()=>n==="auto"?P.map($$):void 0,[P,n]),Q=E.useMemo(()=>P.map((fe,ve)=>`${F}-${ve}`),[P.length,F]),pe=E.useMemo(()=>m===!0?"true":m?JSON.stringify(m):"",[m]),ce=E.useMemo(()=>pe?pe==="true"?IE():IE(m):null,[pe]),Ee=E.useMemo(()=>{var fe,ve;return{shikiTheme:(ve=(fe=b?.code)==null?void 0:fe.getThemes())!=null?ve:u,controls:d,isAnimating:h,mode:t,mermaid:l,linkSafety:k}},[u,d,h,t,l,k,b?.code]),Ne=E.useMemo(()=>w?JSON.stringify(w):"",[w]),G=E.useMemo(()=>({...fq,...w}),[Ne]),X=E.useMemo(()=>{let{inlineCode:fe,...ve}=a??{},ze={...WMe,...ve};if(fe){let Se=ze.code;ze.code=re=>"data-block"in re?Se?E.createElement(Se,re):null:E.createElement(fe,re)}return ze},[a]),ee=E.useMemo(()=>{let fe=[];return b!=null&&b.cjk&&(fe=[...fe,...b.cjk.remarkPluginsBefore]),fe=[...fe,...i],b!=null&&b.cjk&&(fe=[...fe,...b.cjk.remarkPluginsAfter]),b!=null&&b.math&&(fe=[...fe,b.math.remarkPlugin]),fe},[i,b?.math,b?.cjk]),oe=E.useMemo(()=>{var fe;let ve=o;if(_&&Object.keys(_).length>0&&o===W$){let ze={...cy,tagNames:[...(fe=cy.tagNames)!=null?fe:[],...Object.keys(_)],attributes:{...cy.attributes,..._}};ve=[LE.raw,[Q7,ze],LE.harden]}return S&&S.length>0&&(ve=[...ve,[SDe,S]]),b!=null&&b.math&&(ve=[...ve,b.math.rehypePlugin]),ce&&h&&(ve=[...ve,ce.rehypePlugin]),ve},[o,b?.math,ce,h,_,S]),be=E.useMemo(()=>{if(!h||P.length===0)return!1;let fe=P.at(-1);return j$(fe)||ZMe(fe)},[h,P]),Oe=E.useMemo(()=>g&&h&&!be?{"--streamdown-caret":`"${ADe[g]}"`}:void 0,[g,h,be]);return t==="static"?f.jsx(NE.Provider,{value:G,children:f.jsx(RE.Provider,{value:b??null,children:f.jsx(_s.Provider,{value:Ee,children:f.jsx(N$,{icons:T,children:f.jsx(AE.Provider,{value:W,children:f.jsx("div",{className:W("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",c),dir:n==="auto"?$$(I):n,children:f.jsx(Uq,{components:X,rehypePlugins:oe,remarkPlugins:ee,...j,children:I})})})})})})}):f.jsx(NE.Provider,{value:G,children:f.jsx(RE.Provider,{value:b??null,children:f.jsx(_s.Provider,{value:Ee,children:f.jsx(N$,{icons:T,children:f.jsx(AE.Provider,{value:W,children:f.jsxs("div",{className:W("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",g&&!be?"*:last:after:inline *:last:after:align-baseline *:last:after:content-[var(--streamdown-caret)]":null,c),style:Oe,children:[P.length===0&&g&&h&&f.jsx("span",{}),P.map((fe,ve)=>{var ze;let Se=ve===P.length-1,re=h&&Se&&j$(fe);return f.jsx(p,{animatePlugin:ce,components:X,content:fe,dir:(ze=D?.[ve])!=null?ze:n!=="auto"?n:void 0,index:ve,isIncomplete:re,rehypePlugins:oe,remarkPlugins:ee,shouldNormalizeHtmlIndentation:s,shouldParseIncompleteMarkdown:r,...j},Q[ve])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir);qq.displayName="Streamdown";var PDe=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:s=.1,showControls:a=!0,initialZoom:o=1,fullscreen:i=!1})=>{let{RotateCcwIcon:c,ZoomInIcon:u,ZoomOutIcon:l}=Ra(),d=ht(),h=E.useRef(null),m=E.useRef(null),[p,y]=E.useState(o),[g,b]=E.useState({x:0,y:0}),[x,k]=E.useState(!1),[_,S]=E.useState({x:0,y:0}),[w,T]=E.useState({x:0,y:0}),A=E.useCallback(J=>{y(ae=>Math.max(n,Math.min(r,ae+J)))},[n,r]),L=E.useCallback(()=>{A(s)},[A,s]),R=E.useCallback(()=>{A(-s)},[A,s]),j=E.useCallback(()=>{y(o),b({x:0,y:0})},[o]),F=E.useCallback(J=>{J.preventDefault();let ae=J.deltaY>0?-s:s;A(ae)},[A,s]),K=E.useCallback(J=>{if(J.button!==0||J.isPrimary===!1)return;k(!0),S({x:J.clientX,y:J.clientY}),T(g);let ae=J.currentTarget;ae instanceof HTMLElement&&ae.setPointerCapture(J.pointerId)},[g]),Y=E.useCallback(J=>{if(!x)return;J.preventDefault();let ae=J.clientX-_.x,ge=J.clientY-_.y;b({x:w.x+ae,y:w.y+ge})},[x,_,w]),W=E.useCallback(J=>{k(!1);let ae=J.currentTarget;ae instanceof HTMLElement&&ae.releasePointerCapture(J.pointerId)},[]);return E.useEffect(()=>{let J=h.current;if(J)return J.addEventListener("wheel",F,{passive:!1}),()=>{J.removeEventListener("wheel",F)}},[F]),E.useEffect(()=>{let J=m.current;if(J&&x)return document.body.style.userSelect="none",J.addEventListener("pointermove",Y,{passive:!1}),J.addEventListener("pointerup",W),J.addEventListener("pointercancel",W),()=>{document.body.style.userSelect="",J.removeEventListener("pointermove",Y),J.removeEventListener("pointerup",W),J.removeEventListener("pointercancel",W)}},[x,Y,W]),f.jsxs("div",{className:d("relative flex flex-col",i?"h-full w-full":"min-h-28 w-full",t),ref:h,style:{cursor:x?"grabbing":"grab"},children:[a?f.jsxs("div",{className:d("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm",i?"bottom-4 left-4":"bottom-2 left-2"),children:[f.jsx("button",{className:d("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:p>=r,onClick:L,title:"Zoom in",type:"button",children:f.jsx(u,{size:16})}),f.jsx("button",{className:d("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:p<=n,onClick:R,title:"Zoom out",type:"button",children:f.jsx(l,{size:16})}),f.jsx("button",{className:d("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"),onClick:j,title:"Reset zoom and pan",type:"button",children:f.jsx(c,{size:16})})]}):null,f.jsx("div",{className:d("flex-1 origin-center transition-transform duration-150 ease-out",i?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:K,ref:m,role:"application",style:{transform:`translate(${g.x}px, ${g.y}px) scale(${p})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},Vq=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:s=!0})=>{let a=ht(),[o,i]=E.useState(null),[c,u]=E.useState(!1),[l,d]=E.useState(""),[h,m]=E.useState(""),[p,y]=E.useState(0),{mermaid:g}=E.useContext(_s),b=hA(),x=g?.errorComponent,{shouldRender:k,containerRef:_}=eMe({immediate:r});if(E.useEffect(()=>{if(k){if(!b){i("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{i(null),u(!0);let w=b.getMermaid(n),T=e.split("").reduce((R,j)=>(R<<5)-R+j.charCodeAt(0)|0,0),A=`mermaid-${Math.abs(T)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:L}=await w.render(A,e);d(L),m(L)}catch(w){if(!(h||l)){let T=w instanceof Error?w.message:"Failed to render Mermaid chart";i(T)}}finally{u(!1)}})()}},[e,n,p,k,b]),!(k||l||h))return f.jsx("div",{className:a("my-4 min-h-[200px]",t),ref:_});if(c&&!l&&!h)return f.jsx("div",{className:a("my-4 flex justify-center p-4",t),ref:_,children:f.jsxs("div",{className:a("flex items-center space-x-2 text-muted-foreground"),children:[f.jsx("div",{className:a("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),f.jsx("span",{className:a("text-sm"),children:"Loading diagram..."})]})});if(o&&!l&&!h){let w=()=>y(T=>T+1);return x?f.jsx("div",{ref:_,children:f.jsx(x,{chart:e,error:o,retry:w})}):f.jsxs("div",{className:a("rounded-md bg-red-50 p-4",t),ref:_,children:[f.jsxs("p",{className:a("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",o]}),f.jsxs("details",{className:a("mt-2"),children:[f.jsx("summary",{className:a("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),f.jsx("pre",{className:a("mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs"),children:e})]})]})}let S=l||h;return f.jsx("div",{className:a("size-full",t),"data-streamdown":"mermaid",ref:_,children:f.jsx(PDe,{className:a(r?"size-full overflow-hidden":"overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:s,zoomStep:.1,children:f.jsx("div",{"aria-label":"Mermaid chart",className:a("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:S},role:"img"})})})};const ODe=HTe(),Y$=["text-[13px] leading-relaxed text-muted-foreground","[&_p]:mb-[0.4em] [&_p:last-child]:mb-0","[&_strong]:text-foreground [&_strong]:font-semibold","[&_b]:text-foreground [&_b]:font-semibold","[&_code]:font-mono [&_code]:text-xs [&_code]:bg-muted [&_code]:border [&_code]:border-border","[&_code]:rounded-sm [&_code]:px-1.5 [&_code]:py-px [&_code]:text-primary","[&_pre]:bg-muted [&_pre]:border [&_pre]:border-border [&_pre]:rounded-md","[&_pre]:px-3 [&_pre]:py-2 [&_pre]:overflow-x-auto [&_pre]:my-2 [&_pre]:text-xs [&_pre]:leading-relaxed","[&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:p-0 [&_pre_code]:text-inherit","[&_a]:text-primary [&_a]:underline [&_a]:underline-offset-2","[&_a]:decoration-primary/30 hover:[&_a]:decoration-primary/80","[&_ul]:pl-5 [&_ul]:my-1.5 [&_ol]:pl-5 [&_ol]:my-1.5","[&_li]:mb-0.5 [&_li_::marker]:text-muted-foreground","[&_table]:w-full [&_table]:border-collapse [&_table]:text-xs [&_table]:my-2","[&_th]:border [&_th]:border-border [&_th]:px-2 [&_th]:py-1 [&_th]:text-left [&_th]:bg-muted [&_th]:font-semibold [&_th]:text-foreground","[&_td]:border [&_td]:border-border [&_td]:px-2 [&_td]:py-1 [&_td]:text-left [&_td]:bg-background","[&_h1]:font-semibold [&_h1]:text-foreground [&_h1]:mt-2 [&_h1]:mb-1 [&_h1]:text-[15px]","[&_h2]:font-semibold [&_h2]:text-foreground [&_h2]:mt-2 [&_h2]:mb-1 [&_h2]:text-sm","[&_h3]:font-semibold [&_h3]:text-foreground [&_h3]:mt-2 [&_h3]:mb-1 [&_h3]:text-[13px]","[&_h4]:font-semibold [&_h4]:text-foreground [&_h4]:mt-2 [&_h4]:mb-1 [&_h4]:text-[13px]","[&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:my-1.5 [&_blockquote]:text-muted-foreground","[&_hr]:border-0 [&_hr]:border-t [&_hr]:border-border [&_hr]:my-2","[&_img]:max-w-full [&_img]:rounded"].join(" ");function J$(e){return f.jsx("div",{className:e.className?`${Y$} ${e.className}`:Y$,children:f.jsx(qq,{plugins:{code:ODe},controls:{code:!0},linkSafety:{enabled:!1},children:e.children})})}const LDe=(e,t)=>{const n=e.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${n}$`).test(t)},Q$=e=>e.priority+Math.max(1,e.resourcePattern.replace(/\*/g,"").length),Ck=(e,t,n)=>{const s=t.filter(a=>a.enabled&&LDe(a.resourcePattern,e)).sort((a,o)=>Q$(o)-Q$(a)||a.updatedAt-o.updatedAt)[0];return s?s.effect==="deny"?{level:"denied",matchedPolicy:s}:s.approvalMode==="required"?{level:"requires-approval",matchedPolicy:s}:{level:"auto-run",matchedPolicy:s}:{level:n==="auto"?"auto-run":"requires-approval",matchedPolicy:null}},Gq={"auto-run":{label:"Auto",dotClass:"bg-emerald-500",textClass:"text-emerald-600 dark:text-emerald-400"},"requires-approval":{label:"Approval",dotClass:"bg-amber-500",textClass:"text-amber-600 dark:text-amber-400"},denied:{label:"Denied",dotClass:"bg-red-500",textClass:"text-red-600 dark:text-red-400"}},$De=e=>{const{level:t}=Ck(e.toolPath,e.policies,e.interaction),n=Gq[t];return f.jsxs("span",{className:gt("inline-flex shrink-0 items-center gap-1 rounded-full px-1.5 py-px text-[9px] font-medium leading-none",n.textClass,e.className),title:n.label,children:[f.jsx("span",{className:gt("size-1.5 rounded-full",n.dotClass)}),n.label]})},jDe=e=>{const{level:t,matchedPolicy:n}=Ck(e.toolPath,e.policies,e.interaction),r=Gq[t];return f.jsxs("span",{className:gt("inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide",t==="auto-run"&&"border-emerald-500/20 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",t==="requires-approval"&&"border-amber-500/20 bg-amber-500/10 text-amber-600 dark:text-amber-400",t==="denied"&&"border-red-500/20 bg-red-500/10 text-red-600 dark:text-red-400",e.className),title:n?`Matched policy: ${n.resourcePattern}`:void 0,children:[f.jsx("span",{className:gt("size-1 rounded-full",r.dotClass)}),r.label]})},MDe=N2("inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground",secondary:"bg-secondary text-secondary-foreground",destructive:"bg-destructive/10 text-destructive dark:bg-destructive/20",outline:"border-border text-foreground",muted:"bg-muted text-muted-foreground",get:"border-[var(--method-get)]/20 bg-[var(--method-get)]/10 text-[var(--method-get)]",post:"border-[var(--method-post)]/20 bg-[var(--method-post)]/10 text-[var(--method-post)]",put:"border-[var(--method-put)]/20 bg-[var(--method-put)]/10 text-[var(--method-put)]",delete:"border-[var(--method-delete)]/20 bg-[var(--method-delete)]/10 text-[var(--method-delete)]"}},defaultVariants:{variant:"default"}});function Fn({className:e,variant:t,...n}){return f.jsx("span",{"data-slot":"badge",className:gt(MDe({variant:t}),e),...n})}function Kq({method:e}){const t={GET:"get",POST:"post",PUT:"put",PATCH:"put",DELETE:"delete"}[e.toUpperCase()]??"outline";return f.jsx(Fn,{variant:t,children:e})}let X$=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const DDe={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},sh={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},FDe={disabled:!1,...sh},BDe={valid(e){return e===null?null:e?{[X$.valid]:""}:{[X$.invalid]:""}}},UDe=E.createContext({invalid:void 0,name:void 0,validityData:{state:DDe,errors:[],error:"",value:"",initialValue:null},setValidityData:Kr,disabled:void 0,touched:sh.touched,setTouched:Kr,dirty:sh.dirty,setDirty:Kr,filled:sh.filled,setFilled:Kr,focused:sh.focused,setFocused:Kr,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:FDe,markedDirtyRef:{current:!1},validation:{getValidationProps:(e=Wr)=>e,getInputValidationProps:(e=Wr)=>e,inputRef:{current:null},commit:async()=>{}}});function Wq(e=!0){const t=E.useContext(UDe);if(t.setValidityData===Kr&&!e)throw new Error(Xd(28));return t}const zDe=E.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Kr,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function HDe(){return E.useContext(zDe)}let Z$=0;function qDe(e,t="mui"){const[n,r]=E.useState(e),s=e||n;return E.useEffect(()=>{n==null&&(Z$+=1,r(`${t}-${Z$}`))},[n,t]),s}const ej=JTe.useId;function Ik(e,t){if(ej!==void 0){const n=ej();return e??(t?`${t}-${n}`:n)}return qDe(e,t)}function VDe(e){return Ik(e,"base-ui")}const GDe=E.createContext({controlId:void 0,registerControlId:Kr,labelId:void 0,setLabelId:Kr,messageIds:[],setMessageIds:Kr,getDescriptionProps:e=>e});function Yq(){return E.useContext(GDe)}const KDe=[];function Jq(e){E.useEffect(e,KDe)}const Bf=0;class Su{static create(){return new Su}currentId=Bf;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Bf,n()},t)}isStarted(){return this.currentId!==Bf}clear=()=>{this.currentId!==Bf&&(clearTimeout(this.currentId),this.currentId=Bf)};disposeEffect=()=>this.clear}function e1(){const e=Go(Su.create).current;return Jq(e.disposeEffect),e}function WDe(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function $n(e){return e?.ownerDocument||document}const sf=typeof navigator<"u",DS=QDe(),Qq=ZDe(),Xq=XDe(),Zq=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),eV=DS.platform==="MacIntel"&&DS.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(DS.platform),YDe=sf&&/apple/i.test(navigator.vendor),$E=sf&&/android/i.test(Qq)||/android/i.test(Xq);sf&&Qq.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const JDe=Xq.includes("jsdom/");function QDe(){if(!sf)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function XDe(){if(!sf)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function ZDe(){if(!sf)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const jE="data-base-ui-focusable",tV="active",nV="selected",e6e="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function li(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Qt(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Cm(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Fa(e){return"composedPath"in e?e.composedPath()[0]:e.target}function ta(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function t6e(e){return e.matches("html,body")}function rV(e){return wo(e)&&e.matches(e6e)}function tj(e){return e?e.getAttribute("role")==="combobox"&&rV(e):!1}function ME(e){return e?e.hasAttribute(jE)?e:e.querySelector(`[${jE}]`)||e:null}function zl(e,t,n=!0){return e.filter(s=>s.parentId===t&&(!n||s.context?.open)).flatMap(s=>[s,...zl(e,s.id,n)])}function nj(e,t){let n=[],r=e.find(s=>s.id===t)?.parentId;for(;r;){const s=e.find(a=>a.id===r);r=s?.parentId,s&&(n=n.concat(s))}return n}function n6e(e){e.preventDefault(),e.stopPropagation()}function r6e(e){return"nativeEvent"in e}function s6e(e){return e.pointerType===""&&e.isTrusted?!0:$E&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function a6e(e){return JDe?!1:!$E&&e.width===0&&e.height===0||$E&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function o6e(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function i6e(e){return I2(e).display!=="none"}var c6e=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],t1=c6e.join(","),sV=typeof Element>"u",vd=sV?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,n1=!sV&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},r1=function(t,n){var r;n===void 0&&(n=!0);var s=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),a=s===""||s==="true",o=a||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):r1(t.parentNode));return o},u6e=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},aV=function(t,n,r){if(r1(t))return[];var s=Array.prototype.slice.apply(t.querySelectorAll(t1));return n&&vd.call(t,t1)&&s.unshift(t),s=s.filter(r),s},s1=function(t,n,r){for(var s=[],a=Array.from(t);a.length;){var o=a.shift();if(!r1(o,!1))if(o.tagName==="SLOT"){var i=o.assignedElements(),c=i.length?i:o.children,u=s1(c,!0,r);r.flatten?s.push.apply(s,u):s.push({scopeParent:o,candidates:u})}else{var l=vd.call(o,t1);l&&r.filter(o)&&(n||!t.includes(o))&&s.push(o);var d=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),h=!r1(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(d&&h){var m=s1(d===!0?o.children:d.children,!0,r);r.flatten?s.push.apply(s,m):s.push({scopeParent:o,candidates:m})}else a.unshift.apply(a,o.children)}}return s},oV=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},iV=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||u6e(t))&&!oV(t)?0:t.tabIndex},l6e=function(t,n){var r=iV(t);return r<0&&n&&!oV(t)?0:r},d6e=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},cV=function(t){return t.tagName==="INPUT"},f6e=function(t){return cV(t)&&t.type==="hidden"},h6e=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},m6e=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},p6e=function(t){if(!t.name)return!0;var n=t.form||n1(t),r=function(i){return n.querySelectorAll('input[type="radio"][name="'+i+'"]')},s;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")s=r(window.CSS.escape(t.name));else try{s=r(t.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var a=m6e(s,t.form);return!a||a===t},g6e=function(t){return cV(t)&&t.type==="radio"},b6e=function(t){return g6e(t)&&!p6e(t)},y6e=function(t){var n,r=t&&n1(t),s=(n=r)===null||n===void 0?void 0:n.host,a=!1;if(r&&r!==t){var o,i,c;for(a=!!((o=s)!==null&&o!==void 0&&(i=o.ownerDocument)!==null&&i!==void 0&&i.contains(s)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!a&&s;){var u,l,d;r=n1(s),s=(u=r)===null||u===void 0?void 0:u.host,a=!!((l=s)!==null&&l!==void 0&&(d=l.ownerDocument)!==null&&d!==void 0&&d.contains(s))}}return a},rj=function(t){var n=t.getBoundingClientRect(),r=n.width,s=n.height;return r===0&&s===0},x6e=function(t,n){var r=n.displayCheck,s=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var a=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!a}if(getComputedStyle(t).visibility==="hidden")return!0;var o=vd.call(t,"details>summary:first-of-type"),i=o?t.parentElement:t;if(vd.call(i,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof s=="function"){for(var c=t;t;){var u=t.parentElement,l=n1(t);if(u&&!u.shadowRoot&&s(u)===!0)return rj(t);t.assignedSlot?t=t.assignedSlot:!u&&l!==t.ownerDocument?t=l.host:t=u}t=c}if(y6e(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return rj(t);return!1},k6e=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var s=n.children.item(r);if(s.tagName==="LEGEND")return vd.call(n,"fieldset[disabled] *")?!0:!s.contains(t)}return!0}n=n.parentElement}return!1},DE=function(t,n){return!(n.disabled||f6e(n)||x6e(n,t)||h6e(n)||k6e(n))},FE=function(t,n){return!(b6e(n)||iV(n)<0||!DE(t,n))},v6e=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},uV=function(t){var n=[],r=[];return t.forEach(function(s,a){var o=!!s.scopeParent,i=o?s.scopeParent:s,c=l6e(i,o),u=o?uV(s.candidates):i;c===0?o?n.push.apply(n,u):n.push(i):r.push({documentOrder:a,tabIndex:c,item:s,isScope:o,content:u})}),r.sort(d6e).reduce(function(s,a){return a.isScope?s.push.apply(s,a.content):s.push(a.content),s},[]).concat(n)},Ak=function(t,n){n=n||{};var r;return n.getShadowRoot?r=s1([t],n.includeContainer,{filter:FE.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:v6e}):r=aV(t,n.includeContainer,FE.bind(null,n)),uV(r)},S6e=function(t,n){n=n||{};var r;return n.getShadowRoot?r=s1([t],n.includeContainer,{filter:DE.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=aV(t,n.includeContainer,DE.bind(null,n)),r},lV=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return vd.call(t,t1)===!1?!1:FE(n,t)};const Mp=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function dV(e,t){const n=Ak(e,Mp()),r=n.length;if(r===0)return;const s=li($n(e)),a=n.indexOf(s),o=a===-1?t===1?0:r-1:a+t;return n[o]}function fV(e){return dV($n(e).body,1)||e}function hV(e){return dV($n(e).body,-1)||e}function Bh(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Qt(n,r)}function w6e(e){Ak(e,Mp()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function sj(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const pb=null;class _6e{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let s=0;s<n.length;s+=1)n[s]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const gb=new _6e;class Ba{static create(){return new Ba}static request(t){return gb.request(t)}static cancel(t){return gb.cancel(t)}currentId=pb;request(t){this.cancel(),this.currentId=gb.request(()=>{this.currentId=pb,t()})}cancel=()=>{this.currentId!==pb&&(gb.cancel(this.currentId),this.currentId=pb)};disposeEffect=()=>this.cancel}function mV(){const e=Go(Ba.create).current;return Jq(e.disposeEffect),e}function xo(e){return e==null?e:"current"in e?e.current:e}let Pm=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const E6e={[Pm.startingStyle]:""},T6e={[Pm.endingStyle]:""},pV={transitionStatus(e){return e==="starting"?E6e:e==="ending"?T6e:null}};function C6e(e,t=!1,n=!0){const r=mV();return rn((s,a=null)=>{r.cancel();function o(){wu.flushSync(s)}const i=xo(e);if(i==null)return;const c=i;if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)s();else{let u=function(){const d=Pm.startingStyle;if(!c.hasAttribute(d)){r.request(l);return}const h=new MutationObserver(()=>{c.hasAttribute(d)||(h.disconnect(),l())});h.observe(c,{attributes:!0,attributeFilter:[d]}),a?.addEventListener("abort",()=>h.disconnect(),{once:!0})},l=function(){Promise.all(c.getAnimations().map(d=>d.finished)).then(()=>{a?.aborted||o()}).catch(()=>{const d=c.getAnimations();if(n){if(a?.aborted)return;o()}else d.length>0&&d.some(h=>h.pending||h.playState!=="finished")&&l()})};if(t){u();return}r.request(l)}})}function gV(e){const{enabled:t=!0,open:n,ref:r,onComplete:s}=e,a=rn(s),o=C6e(r,n,!1);E.useEffect(()=>{if(!t)return;const i=new AbortController;return o(a,i.signal),()=>{i.abort()}},[t,n,a,o])}function I6e(e,t=!1,n=!1){const[r,s]=E.useState(e&&t?"idle":void 0),[a,o]=E.useState(e);return e&&!a&&(o(!0),s("starting")),!e&&a&&r!=="ending"&&!n&&s("ending"),!e&&!a&&r==="ending"&&s(void 0),qt(()=>{if(!e&&a&&r!=="ending"&&n){const i=Ba.request(()=>{s("ending")});return()=>{Ba.cancel(i)}}},[e,a,r,n]),qt(()=>{if(!e||t)return;const i=Ba.request(()=>{s(void 0)});return()=>{Ba.cancel(i)}},[t,e]),qt(()=>{if(!e||!t)return;e&&a&&r!=="idle"&&s("starting");const i=Ba.request(()=>{s("idle")});return()=>{Ba.cancel(i)}},[t,e,a,s,r]),E.useMemo(()=>({mounted:a,setMounted:o,transitionStatus:r}),[a,r])}function A6e({controlled:e,default:t,name:n,state:r="value"}){const{current:s}=E.useRef(e!==void 0),[a,o]=E.useState(t),i=s?e:a,c=E.useCallback(u=>{s||o(u)},[]);return[i,c]}function N6e(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:s,registerControlId:a}=Yq(),o=VDe(t),i=n?s:void 0,c=Go(()=>Symbol("labelable-control")),u=E.useRef(!1),l=E.useRef(t!=null),d=rn(()=>{!u.current||a===Kr||(u.current=!1,a(c.current,void 0))});return qt(()=>{if(a===Kr)return;let h;if(n){const m=r?.current;Sl(m)&&m.closest("label")!=null?h=t??null:h=i??o}else if(t!=null)l.current=!0,h=t;else if(l.current)h=o;else{d();return}if(h===void 0){d();return}u.current=!0,a(c.current,h)},[t,r,i,a,n,o,c,d]),E.useEffect(()=>d,[d]),s??o}function R6e(e){const{enabled:t=!0,value:n,id:r,name:s,controlRef:a,commit:o}=e,{formRef:i}=HDe(),{invalid:c,markedDirtyRef:u,validityData:l,setValidityData:d}=Wq(),h=rn(e.getValue);qt(()=>{if(!t)return;let m=n;m===void 0&&(m=h()),l.initialValue===null&&m!==null&&d(p=>({...p,initialValue:m}))},[t,d,n,l.initialValue,h]),qt(()=>{!t||!r||i.current.fields.set(r,{getValue:h,name:s,controlRef:a,validityData:WDe(l,c),validate(m=!0){let p=n;p===void 0&&(p=h()),u.current=!0,m?wu.flushSync(()=>o(p)):o(p)}})},[o,a,t,i,h,r,c,u,s,l,n]),qt(()=>{const m=i.current.fields;return()=>{r&&m.delete(r)}},[i,r])}const P6e="none",aj="trigger-press",O6e="trigger-hover",bV="outside-press",yV="focus-out",L6e="escape-key",$6e="imperative-action";function yi(e,t,n,r){let s=!1,a=!1;const o=Wr;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){a=!0},get isCanceled(){return s},get isPropagationAllowed(){return a},trigger:n,...o}}const j6e=E.forwardRef(function(t,n){const{render:r,className:s,id:a,name:o,value:i,disabled:c=!1,onValueChange:u,defaultValue:l,autoFocus:d=!1,...h}=t,{state:m,name:p,disabled:y,setTouched:g,setDirty:b,validityData:x,setFocused:k,setFilled:_,validationMode:S,validation:w}=Wq(),T=y||c,A=p??o,L={...m,disabled:T},{labelId:R}=Yq(),j=N6e({id:a});qt(()=>{const ae=i!=null;w.inputRef.current?.value||ae&&i!==""?_(!0):ae&&i===""&&_(!1)},[w.inputRef,_,i]);const F=E.useRef(null);qt(()=>{d&&F.current===li($n(F.current))&&k(!0)},[d,k]);const[K]=A6e({controlled:i,default:l,name:"FieldControl",state:"value"}),Y=i!==void 0,W=Y?K:void 0;return R6e({id:j,name:A,commit:w.commit,value:W,getValue:()=>w.inputRef.current?.value,controlRef:w.inputRef}),Zd("input",t,{ref:[n,F],state:L,props:[{id:j,disabled:T,name:A,ref:w.inputRef,"aria-labelledby":R,autoFocus:d,...Y?{value:W}:{defaultValue:l},onChange(ae){const ge=ae.currentTarget.value;u?.(ge,yi(P6e,ae.nativeEvent)),b(ge!==x.initialValue),_(ge!=="")},onFocus(){k(!0)},onBlur(ae){g(!0),k(!1),S==="onBlur"&&w.commit(ae.currentTarget.value)},onKeyDown(ae){ae.currentTarget.tagName==="INPUT"&&ae.key==="Enter"&&(g(!0),w.commit(ae.currentTarget.value))}},w.getInputValidationProps(),h],stateAttributesMapping:BDe})}),M6e=E.forwardRef(function(t,n){return f.jsx(j6e,{ref:n,...t})}),_t=E.forwardRef(({className:e,type:t,...n},r)=>f.jsx(M6e,{ref:r,type:t,"data-slot":"input",className:gt("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...n}));_t.displayName="Input";const D6e=e=>{const t={segment:"",children:new Map};for(const n of e){const r=n.path.split(".");let s=t;for(const a of r){const o=s.children.get(a);if(o){s=o;continue}const i={segment:a,children:new Map};s.children.set(a,i),s=i}s.tool=n}return t},xV=e=>{let t=e.tool?1:0;for(const n of e.children.values())t+=xV(n);return t},kV=(e,t)=>{if(!t.trim())return e;const n=t.trim().toLowerCase().split(/\s+/),r=e.toLowerCase(),s=[];for(const c of n){let u=0;for(;u<r.length;){const l=r.indexOf(c,u);if(l===-1)break;s.push([l,l+c.length]),u=l+1}}if(s.length===0)return e;s.sort((c,u)=>c[0]-u[0]);const a=[s[0]];for(let c=1;c<s.length;c++){const u=a[a.length-1],l=s[c];l[0]<=u[1]?u[1]=Math.max(u[1],l[1]):a.push(l)}const o=[];let i=0;for(const[c,u]of a)i<c&&o.push({text:e.slice(i,c),highlighted:!1}),o.push({text:e.slice(c,u),highlighted:!0}),i=u;return i<e.length&&o.push({text:e.slice(i),highlighted:!1}),f.jsx(f.Fragment,{children:o.map((c,u)=>c.highlighted?f.jsx("mark",{className:"rounded-sm bg-primary/20 px-px text-foreground",children:c.text},u):f.jsx("span",{children:c.text},u))})},F6e=e=>f.jsx(Te,{type:"button",variant:"ghost",size:"icon",onClick:()=>{e.onCopy(e.text,e.field)},className:"size-6 shrink-0 text-muted-foreground/30 hover:text-muted-foreground",title:`Copy ${e.field}`,children:e.copiedField===e.field?f.jsx(t7,{}):f.jsx(e7,{})}),B6e=e=>{const t=E.useMemo(()=>D6e(e.tools),[e.tools]),n=kve(),r=[...t.children.values()].sort((s,a)=>s.segment.localeCompare(a.segment));return f.jsx("div",{className:"flex flex-col gap-px",children:r.map(s=>f.jsx(vV,{node:s,depth:0,selectedToolPath:e.selectedToolPath,onSelectTool:e.onSelectTool,search:e.search,defaultOpen:e.isFiltered,sourceId:e.sourceId,prefetch:n,policies:e.policies},s.segment))})},vV=e=>{const{node:t,depth:n,selectedToolPath:r,onSelectTool:s,search:a,defaultOpen:o,sourceId:i,prefetch:c}=e,u=t.children.size>0,l=!!t.tool&&!u,d=E.useMemo(()=>{if(!r)return!1;const b=x=>{if(x.tool?.path===r)return!0;for(const k of x.children.values())if(b(k))return!0;return!1};return b(t)},[t,r]),[h,m]=E.useState(o||d);if(E.useEffect(()=>{(o||d)&&m(!0)},[o,d]),l)return f.jsx(oj,{tool:t.tool,active:t.tool?.path===r,onSelect:()=>s(t.tool.path),search:a,depth:n,sourceId:i,prefetch:c,policies:e.policies});const p=8+n*16,y=[...t.children.values()].sort((b,x)=>b.segment.localeCompare(x.segment)),g=xV(t);return f.jsxs("div",{children:[t.tool?f.jsxs("div",{className:"flex items-center",children:[f.jsx(Te,{type:"button",variant:"ghost",size:"icon",onClick:()=>m(b=>!b),"aria-expanded":h,className:"shrink-0 size-auto rounded p-0.5 text-muted-foreground/30 hover:text-muted-foreground",style:{marginLeft:p},children:f.jsx(hL,{className:"shrink-0 transition-transform duration-150",style:{width:8,height:8,transform:h?"rotate(90deg)":"rotate(0deg)",transformOrigin:"50% 50%"}})}),f.jsx(oj,{tool:t.tool,active:t.tool?.path===r,onSelect:()=>s(t.tool.path),search:a,depth:-1,className:"flex-1 pl-1",sourceId:i,prefetch:c,policies:e.policies})]}):f.jsxs(Te,{type:"button",variant:"ghost",onClick:()=>m(b=>!b),"aria-expanded":h,className:gt("group flex h-auto w-full items-center gap-1.5 rounded-md py-1 pr-2.5 text-[12px] hover:bg-accent/40",h?"text-foreground/80":"text-muted-foreground/60"),style:{paddingLeft:p},children:[f.jsx(hL,{className:"shrink-0 text-muted-foreground/30 transition-transform duration-150",style:{width:8,height:8,transform:h?"rotate(90deg)":"rotate(0deg)",transformOrigin:"50% 50%"}}),f.jsx(ECe,{className:gt("shrink-0",h?"text-primary/60":"text-muted-foreground/30"),style:{width:12,height:12}}),f.jsx("span",{className:"flex-1 truncate text-left font-mono",children:kV(t.segment,a)}),f.jsx("span",{className:"shrink-0 tabular-nums text-[10px] text-muted-foreground/25",children:g})]}),h&&u&&f.jsxs("div",{className:"relative flex flex-col gap-px",children:[f.jsx("span",{className:"absolute bottom-1 top-0 w-px bg-border/40",style:{left:p+5},"aria-hidden":!0}),y.map(b=>f.jsx(vV,{node:b,depth:n+1,selectedToolPath:r,onSelectTool:s,search:a,defaultOpen:o,sourceId:i,prefetch:c,policies:e.policies},b.segment))]})]})},oj=e=>{const t=E.useRef(null),n=e.depth>=0?8+e.depth*16+8:void 0;E.useEffect(()=>{e.active&&t.current&&t.current.scrollIntoView({block:"nearest"})},[e.active]);const r=e.depth>=0?e.tool.path.split(".").pop()??e.tool.path:e.tool.path;return f.jsxs(Te,{ref:t,type:"button",variant:"ghost",onMouseEnter:()=>{e.prefetch(e.sourceId,e.tool.path)},onClick:e.onSelect,className:gt("group flex h-auto w-full items-center gap-2 rounded-md py-1.5 pr-2.5 text-left",e.active?"border-l-2 border-l-primary bg-primary/10 text-foreground":"text-foreground/70 hover:bg-accent/50 hover:text-foreground",e.className),style:n!=null?{paddingLeft:n}:void 0,children:[f.jsx(Z9,{className:"size-3 shrink-0 text-muted-foreground/40"}),f.jsx("span",{className:"flex-1 truncate font-mono text-[12px]",children:kV(r,e.search)}),e.tool.method&&f.jsx(Kq,{method:e.tool.method}),e.policies&&f.jsx($De,{toolPath:e.tool.path,policies:e.policies,interaction:e.tool.interaction})]})},U6e=[{level:"auto-run",label:"Auto-run",description:"Execute without asking",dotClass:"bg-emerald-500",activeClass:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300"},{level:"requires-approval",label:"Approval",description:"Ask before running",dotClass:"bg-amber-500",activeClass:"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300"},{level:"denied",label:"Denied",description:"Block completely",dotClass:"bg-red-500",activeClass:"border-red-500/30 bg-red-500/10 text-red-700 dark:text-red-300"}],z6e=e=>{const{level:t,matchedPolicy:n}=Ck(e.toolPath,e.policies);return f.jsxs("div",{className:"rounded-lg border border-border bg-card/60 p-3",children:[f.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[f.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground/70",children:"Permission"}),n&&f.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/40",children:n.resourcePattern})]}),f.jsx("div",{className:"flex gap-1.5",children:U6e.map(r=>{const s=t===r.level;return f.jsxs(Te,{type:"button",variant:"outline",disabled:e.pending,onClick:()=>{s||e.onSetPermission({toolPath:e.toolPath,level:r.level})},className:gt("flex h-auto flex-1 flex-col items-center gap-1 rounded-lg px-2 py-2 text-center transition-all",s?r.activeClass:"border-border/60 bg-background/50 text-muted-foreground hover:bg-accent/40"),children:[f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx("span",{className:gt("size-1.5 rounded-full",s?r.dotClass:"bg-muted-foreground/30")}),f.jsx("span",{className:"text-[11px] font-semibold",children:r.label})]}),f.jsx("span",{className:"text-[9px] opacity-60",children:r.description})]},r.level)})})]})},SV=e=>{const[t,n]=E.useState(null),r=e.detail.contract.input.typeDeclaration??e.detail.contract.input.typePreview??null,s=e.detail.contract.output.typeDeclaration??e.detail.contract.output.typePreview??null;return f.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[f.jsx("div",{className:"shrink-0 border-b border-border bg-background/95 backdrop-blur-sm",children:f.jsxs("div",{className:"flex items-start gap-3 px-5 py-3.5",children:[f.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:f.jsx(Z9,{className:"size-4"})}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("h3",{className:"truncate text-sm font-semibold text-foreground",children:e.detail.summary.path}),f.jsx(F6e,{text:e.detail.summary.path,field:"path",copiedField:t,onCopy:async(a,o)=>{await navigator.clipboard.writeText(a),n(o),window.setTimeout(()=>n(null),1500)}})]}),f.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[e.detail.summary.method&&f.jsx(Kq,{method:e.detail.summary.method}),e.policies&&f.jsx(jDe,{toolPath:e.detail.summary.path,policies:e.policies}),e.renderHeaderMeta?.(e.detail)]})]})]})}),f.jsx("div",{className:"flex-1 overflow-y-auto",children:f.jsxs("div",{className:"space-y-4 px-5 py-4",children:[e.onSetPermission&&e.policies&&f.jsx(z6e,{toolPath:e.detail.summary.path,policies:e.policies,onSetPermission:e.onSetPermission,pending:e.permissionPending}),e.detail.summary.description&&f.jsx(J$,{children:e.detail.summary.description}),f.jsxs("div",{className:"grid grid-cols-1 gap-3 xl:grid-cols-2",children:[f.jsx(hs,{title:"Input",body:r,lang:"typescript",empty:"No input."}),f.jsx(hs,{title:"Output",body:s,lang:"typescript",empty:"No output."})]}),f.jsx(hs,{title:"Call Signature",body:e.detail.contract.callSignature,lang:"typescript",empty:"No call signature."}),f.jsxs("div",{className:"grid grid-cols-1 gap-2 xl:grid-cols-2",children:[f.jsx(hs,{title:"Input schema",body:e.detail.contract.input.schemaJson,empty:"No input schema.",compact:!0}),f.jsx(hs,{title:"Output schema",body:e.detail.contract.output.schemaJson,empty:"No output schema.",compact:!0}),e.renderSchemaExtras?.(e.detail)]}),e.detail.sections.map((a,o)=>f.jsxs("section",{className:"overflow-hidden rounded-lg border border-border bg-card/60",children:[f.jsx("div",{className:"border-b border-border px-3 py-2 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/70",children:a.title}),a.kind==="facts"?f.jsx("div",{className:"grid gap-2 p-4",children:a.items.map(i=>f.jsxs("div",{className:"text-sm",children:[f.jsxs("span",{className:"text-muted-foreground",children:[i.label,":"]})," ",f.jsx("span",{className:i.mono?"font-mono text-xs text-foreground":"text-foreground",children:i.value})]},`${a.title}-${i.label}`))}):a.kind==="markdown"?f.jsx("div",{className:"p-4",children:f.jsx(J$,{children:a.body})}):a.body?f.jsx(s7,{code:a.body,lang:a.language,className:"max-h-[32rem]"}):f.jsx("div",{className:"flex items-center justify-center p-6 text-[13px] text-muted-foreground/40",children:"No content."})]},`${a.title}-${String(o)}`))]})})]})},H6e=e=>{const[t,n]=E.useState(""),r=E.useRef(null),s=t.trim().toLowerCase().split(/\s+/).filter(Boolean),a=E.useMemo(()=>e.bundle.tools.filter(l=>{if(s.length===0)return!0;const d=[l.path,l.method??"",l.inputTypePreview??"",l.outputTypePreview??""].join(" ").toLowerCase();return s.every(h=>d.includes(h))}),[e.bundle.tools,s]);E.useEffect(()=>{const l=d=>{d.key==="/"&&document.activeElement?.tagName!=="INPUT"&&(d.preventDefault(),r.current?.focus()),d.key==="Escape"&&(r.current?.blur(),t.length>0&&n(""))};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[t]);const o=e.policies,i=e.onSetPermission,c=e.permissionPending,u=e.renderDetail??(l=>f.jsx(SV,{detail:l,policies:o,onSetPermission:i,permissionPending:c}));return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex w-72 shrink-0 flex-col border-r border-border bg-card/30 lg:w-80 xl:w-[22rem]",children:[f.jsx("div",{className:"shrink-0 border-b border-border px-3 py-2",children:f.jsxs("div",{className:"flex h-8 items-center gap-2 rounded-md border border-input bg-background px-2.5",children:[f.jsx(_Ce,{className:"size-3.5 shrink-0 text-muted-foreground/40"}),f.jsx(_t,{ref:r,value:t,onChange:l=>n(l.target.value),placeholder:`Filter ${e.bundle.toolCount} tools...`,className:"min-w-0 flex-1 border-0 bg-transparent p-0 text-[13px] shadow-none ring-0 focus:border-0 focus:ring-0"}),t.length>0?f.jsx(Te,{type:"button",variant:"ghost",size:"icon",onClick:()=>n(""),className:"size-5 shrink-0 text-muted-foreground/40 hover:text-foreground",children:f.jsx(n7,{})}):f.jsx("kbd",{className:"shrink-0 rounded border border-border bg-muted px-1 py-px text-[10px] leading-none text-muted-foreground/50",children:"/"})]})}),f.jsx("div",{className:"flex-1 overflow-y-auto",children:a.length===0?f.jsx("div",{className:"p-4 text-center text-[13px] text-muted-foreground/50",children:s.length>0?"No tools match your filter":"No tools available"}):f.jsx("div",{className:"p-1.5",children:f.jsx(B6e,{tools:a,selectedToolPath:e.selectedToolPath,onSelectTool:e.onSelectTool,search:t,isFiltered:s.length>0,sourceId:e.sourceId,policies:e.policies})})})]}),f.jsx("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:f.jsx(bd,{loadable:e.detail,loading:"Loading tool...",children:l=>l?u(l):f.jsx(a7,{title:e.bundle.toolCount>0?"Select a tool":"No tools available",description:e.bundle.toolCount>0?"Choose from the list or press / to search.":void 0})})})]})},Nk=e=>{const t=yve(e.sourceId),n=cz(),r=e.policies??(n.status==="ready"?n.data:[]),s=e.selectedToolPath??e.search.tool??null,a=xve(e.sourceId,s),o=e.navigate,i=uz(),c=lz(),[u,l]=E.useState(!1),d=m=>{switch(m){case"auto-run":return{effect:"allow",approvalMode:"auto"};case"requires-approval":return{effect:"allow",approvalMode:"required"};case"denied":return{effect:"deny",approvalMode:"auto"};default:return{effect:"allow",approvalMode:"auto"}}},h=E.useCallback(async m=>{l(!0);try{const{matchedPolicy:p}=Ck(m.toolPath,r),y=d(m.level);p&&p.resourcePattern===m.toolPath?await c.mutateAsync({policyId:p.id,payload:y}):await i.mutateAsync({resourcePattern:m.toolPath,...y,priority:10,enabled:!0})}catch{}finally{l(!1)}},[i,c,r]);return E.useEffect(()=>{if(t.status!=="ready"||!o)return;const m=t.data.tools[0]?.path,p=s??m;p&&(e.search.tab!=="discover"&&s||E.startTransition(()=>{o({tab:"model",tool:p,query:""})}))},[t,o,e.search.tab,s]),f.jsx(bd,{loadable:t,loading:"Loading source...",children:m=>{const p=m.tools.find(y=>y.path===s)??m.tools[0]??null;return f.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[f.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b border-border bg-background/95 px-4 backdrop-blur-sm",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx("h2",{className:"truncate text-sm font-semibold text-foreground",children:e.title}),f.jsx(Fn,{variant:"outline",children:e.kind}),f.jsxs("span",{className:"hidden text-[11px] tabular-nums text-muted-foreground/50 sm:block",children:[m.toolCount," ",m.toolCount===1?"tool":"tools"]})]}),f.jsx("div",{className:"flex shrink-0 items-center gap-2",children:e.actions})]}),e.summary&&f.jsx("div",{className:"shrink-0 border-b border-border bg-card/30 px-4 py-2",children:e.summary}),f.jsx("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:f.jsx(H6e,{bundle:m,detail:a,selectedToolPath:p?.path??null,policies:r,onSetPermission:h,permissionPending:u,onSelectTool:y=>{o&&E.startTransition(()=>{o({tab:"model",tool:y,query:""})})},sourceId:e.sourceId,renderDetail:e.renderDetail??(e.renderHeaderMeta||e.renderSchemaExtras?y=>f.jsx(SV,{detail:y,policies:r,onSetPermission:h,permissionPending:u,renderHeaderMeta:e.renderHeaderMeta,renderSchemaExtras:e.renderSchemaExtras}):void 0)})})]})}})},q6e=["model","discover"],Rk=e=>({tab:typeof e.tab=="string"&&q6e.includes(e.tab)?e.tab:"model",tool:typeof e.tool=="string"&&e.tool.length>0?e.tool:void 0,query:typeof e.query=="string"?e.query:void 0}),V6e=N2("group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current",warning:"border-amber-500/25 bg-amber-500/8 text-amber-700 dark:text-amber-400",success:"border-primary/25 bg-primary/8 text-primary"}},defaultVariants:{variant:"default"}});function ts({className:e,variant:t,...n}){return f.jsx("div",{"data-slot":"alert",role:"alert",className:gt(V6e({variant:t}),e),...n})}function ac({className:e,size:t="default",...n}){return f.jsx("div",{"data-slot":"card","data-size":t,className:gt("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...n})}function et({className:e,...t}){return f.jsx("label",{"data-slot":"label",className:gt("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function Ea({className:e,children:t,...n}){return f.jsx("select",{"data-slot":"select",className:gt("h-8 w-full rounded-lg border border-input bg-transparent px-2.5 text-base outline-none transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30",e),...n,children:t})}const G6e=E.forwardRef(function(t,n){const{className:r,render:s,orientation:a="horizontal",...o}=t;return Zd("div",t,{state:{orientation:a},ref:n,props:[{role:"separator","aria-orientation":a},o]})});function ij({className:e,orientation:t="horizontal",...n}){return f.jsx(G6e,{"data-slot":"separator",orientation:t,className:gt("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...n})}function Bc({className:e,...t}){return f.jsx("textarea",{"data-slot":"textarea",className:gt("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...t})}let cj={},uj={},lj="";function K6e(e){if(typeof document>"u")return!1;const t=$n(e);return Vo(t).innerWidth-t.documentElement.clientWidth>0}function W6e(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=$n(e),r=n.documentElement,s=n.body,a=C2(r)?r:s,o=a.style.overflowY,i=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",a.style.overflowY="scroll";const c=a.offsetWidth;a.style.overflowY="hidden";const u=a.offsetWidth;return a.style.overflowY=o,r.style.scrollbarGutter=i,c===u}function Y6e(e){const t=$n(e),n=t.documentElement,r=t.body,s=C2(n)?n:r,a={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,a)}}function J6e(e){const t=$n(e),n=t.documentElement,r=t.body,s=Vo(n);let a=0,o=0,i=!1;const c=Ba.create();if(Zq&&(s.visualViewport?.scale??1)!==1)return()=>{};function u(){const h=s.getComputedStyle(n),m=s.getComputedStyle(r),g=(h.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=n.scrollTop,o=n.scrollLeft,cj={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},lj=n.style.scrollBehavior,uj={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const b=n.scrollHeight>n.clientHeight,x=n.scrollWidth>n.clientWidth,k=h.overflowY==="scroll"||m.overflowY==="scroll",_=h.overflowX==="scroll"||m.overflowX==="scroll",S=Math.max(0,s.innerWidth-r.clientWidth),w=Math.max(0,s.innerHeight-r.clientHeight),T=parseFloat(m.marginTop)+parseFloat(m.marginBottom),A=parseFloat(m.marginLeft)+parseFloat(m.marginRight),L=C2(n)?n:r;if(i=W6e(e),i){n.style.scrollbarGutter=g,L.style.overflowY="hidden",L.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:g,overflowY:"hidden",overflowX:"hidden"}),(b||k)&&(n.style.overflowY="scroll"),(x||_)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:T||w?`calc(100dvh - ${T+w}px)`:"100dvh",width:A||S?`calc(100vw - ${A+S}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function l(){Object.assign(n.style,cj),Object.assign(r.style,uj),i||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=lj)}function d(){l(),c.request(u)}return u(),s.addEventListener("resize",d),()=>{c.cancel(),l(),typeof s.removeEventListener=="function"&&s.removeEventListener("resize",d)}}class Q6e{lockCount=0;restore=null;timeoutLock=Su.create();timeoutUnlock=Su.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=$n(t).documentElement,s=Vo(r).getComputedStyle(r).overflowY;if(s==="hidden"||s==="clip"){this.restore=Kr;return}const a=eV||!K6e(t);this.restore=a?Y6e(t):J6e(t)}}const X6e=new Q6e;function Z6e(e=!0,t=null){qt(()=>{if(e)return X6e.acquire(t)},[e,t])}function e5e(e){const t=E.useRef(!0);t.current&&(t.current=!1,e())}function FS(e){const t=Go(t5e,e).current;return t.next=e,qt(t.effect),t}function t5e(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const n5e={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},r5e={...n5e,position:"fixed",top:0,left:0},a1=E.forwardRef(function(t,n){const[r,s]=E.useState();qt(()=>{YDe&&s("button")},[]);const a={tabIndex:0,role:r};return f.jsx("span",{...t,ref:n,style:r5e,"aria-hidden":r?void 0:!0,...a,"data-base-ui-focus-guard":""})});function o1(e){return`data-base-ui-${e}`}let dj=0;function BS(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:s=!1}=t;r&&cancelAnimationFrame(dj);const a=()=>e?.focus({preventScroll:n});s?a():dj=requestAnimationFrame(a)}const US={inert:new WeakMap,"aria-hidden":new WeakMap},fj="data-base-ui-inert",BE={inert:new WeakSet,"aria-hidden":new WeakSet};let Uf=new WeakMap,zS=0;function s5e(e){return BE[e]}function wV(e){return e?Cm(e)?e.host:wV(e.parentNode):null}const HS=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=wV(n);return e.contains(r)?r:null}).filter(n=>n!=null),hj=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},mj=(e,t,n)=>{const r=[],s=a=>{!a||n.has(a)||Array.from(a.children).forEach(o=>{fk(o)!=="script"&&(t.has(o)?s(o):r.push(o))})};return s(e),r};function a5e(e,t,n,r,{mark:s=!0,markerIgnoreElements:a=[]}){const o=r?"inert":n?"aria-hidden":null;let i=null,c=null;const u=HS(t,e),l=s?HS(t,a):[],d=new Set(l),h=s?mj(t,hj(u),new Set(u)).filter(y=>!d.has(y)):[],m=[],p=[];if(o){const y=US[o],g=s5e(o);c=g,i=y;const b=HS(t,Array.from(t.querySelectorAll("[aria-live]"))),x=u.concat(b);mj(t,hj(x),new Set(x)).forEach(_=>{const S=_.getAttribute(o),w=S!==null&&S!=="false",T=(y.get(_)||0)+1;y.set(_,T),m.push(_),T===1&&w&&g.add(_),w||_.setAttribute(o,o==="inert"?"":"true")})}return s&&h.forEach(y=>{const g=(Uf.get(y)||0)+1;Uf.set(y,g),p.push(y),g===1&&y.setAttribute(fj,"")}),zS+=1,()=>{i&&m.forEach(y=>{const b=(i.get(y)||0)-1;i.set(y,b),b||(!c?.has(y)&&o&&y.removeAttribute(o),c?.delete(y))}),s&&p.forEach(y=>{const g=(Uf.get(y)||0)-1;Uf.set(y,g),g||y.removeAttribute(fj)}),zS-=1,zS||(US.inert=new WeakMap,US["aria-hidden"]=new WeakMap,BE.inert=new WeakSet,BE["aria-hidden"]=new WeakSet,Uf=new WeakMap)}}function pj(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0,markerIgnoreElements:a=[]}=t,o=$n(e[0]).body;return a5e(e,o,n,r,{mark:s,markerIgnoreElements:a})}const _V=E.createContext(null),EV=()=>E.useContext(_V),o5e=o1("portal");function i5e(e={}){const{ref:t,container:n,componentProps:r=Wr,elementProps:s}=e,a=Ik(),i=EV()?.portalNode,[c,u]=E.useState(null),[l,d]=E.useState(null),h=rn(g=>{g!==null&&d(g)}),m=E.useRef(null);qt(()=>{if(n===null){m.current&&(m.current=null,d(null),u(null));return}if(a==null)return;const g=(n&&(T2(n)?n:n.current))??i??document.body;if(g==null){m.current&&(m.current=null,d(null),u(null));return}m.current!==g&&(m.current=g,d(null),u(g))},[n,i,a]);const p=Zd("div",r,{ref:[t,h],props:[{id:a,[o5e]:""},s]});return{portalNode:l,portalSubtree:c&&p?wu.createPortal(p,c):null}}const c5e=E.forwardRef(function(t,n){const{children:r,container:s,className:a,render:o,renderGuards:i,...c}=t,{portalNode:u,portalSubtree:l}=i5e({container:s,ref:n,componentProps:t,elementProps:c}),d=E.useRef(null),h=E.useRef(null),m=E.useRef(null),p=E.useRef(null),[y,g]=E.useState(null),b=y?.modal,x=y?.open,k=typeof i=="boolean"?i:!!y&&!y.modal&&y.open&&!!u;E.useEffect(()=>{if(!u||b)return;function S(w){u&&w.relatedTarget&&Bh(w)&&(w.type==="focusin"?sj:w6e)(u)}return u.addEventListener("focusin",S,!0),u.addEventListener("focusout",S,!0),()=>{u.removeEventListener("focusin",S,!0),u.removeEventListener("focusout",S,!0)}},[u,b]),E.useEffect(()=>{!u||x||sj(u)},[x,u]);const _=E.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:h,beforeInsideRef:m,afterInsideRef:p,portalNode:u,setFocusManagerState:g}),[u]);return f.jsxs(E.Fragment,{children:[l,f.jsxs(_V.Provider,{value:_,children:[k&&u&&f.jsx(a1,{"data-type":"outside",ref:d,onFocus:S=>{if(Bh(S,u))m.current?.focus();else{const w=y?y.domReference:null;hV(w)?.focus()}}}),k&&u&&f.jsx("span",{"aria-owns":u.id,style:bCe}),u&&wu.createPortal(r,u),k&&u&&f.jsx(a1,{"data-type":"outside",ref:h,onFocus:S=>{if(Bh(S,u))p.current?.focus();else{const w=y?y.domReference:null;fV(w)?.focus(),y?.closeOnFocusOut&&y?.onOpenChange(!1,yi(yV,S.nativeEvent))}}})]})]})});function u5e(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}const l5e=E.createContext(null),d5e=E.createContext(null),TV=()=>E.useContext(l5e)?.id||null,CV=e=>{const t=E.useContext(d5e);return e??t};function f5e(e,t){const n=Vo(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const gj=20;let xi=[];function pA(){xi=xi.filter(e=>e.deref()?.isConnected)}function h5e(e){pA(),e&&fk(e)!=="body"&&(xi.push(new WeakRef(e)),xi.length>gj&&(xi=xi.slice(-gj)))}function qS(){return pA(),xi[xi.length-1]?.deref()}function m5e(e){if(!e)return null;const t=Mp();return lV(e,t)?e:Ak(e,t)[0]||e}function p5e(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():i6e(e)}function bj(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Mp(),s=S6e(e,n).filter(o=>{const i=o.getAttribute("data-tabindex")||"";return lV(o,n)||o.hasAttribute("data-tabindex")&&!i.startsWith("-")}),a=e.getAttribute("tabindex");t.current.includes("floating")||s.length===0?a!=="0"&&e.setAttribute("tabindex","0"):(a!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function g5e(e){const{context:t,children:n,disabled:r=!1,initialFocus:s=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:i=!0,closeOnFocusOut:c=!0,openInteractionType:u="",nextFocusableElement:l,previousFocusableElement:d,beforeContentFocusGuardRef:h,externalTree:m,getInsideElements:p}=e,y="rootStore"in t?t.rootStore:t,g=y.useState("open"),b=y.useState("domReferenceElement"),x=y.useState("floatingElement"),{events:k,dataRef:_}=y.context,S=rn(()=>_.current.floatingContext?.nodeId),w=s===!1,T=tj(b)&&w,A=E.useRef(["content"]),L=FS(s),R=FS(a),j=FS(u),F=CV(m),K=EV(),Y=E.useRef(!1),W=E.useRef(!1),J=E.useRef(!1),ae=E.useRef(-1),ge=E.useRef(""),le=E.useRef(""),I=E.useRef(null),U=E.useRef(null),V=q0(I,h,K?.beforeInsideRef),N=q0(U,K?.afterInsideRef),P=e1(),D=e1(),Q=mV(),pe=K!=null,ce=ME(x),Ee=rn((ee=ce)=>ee?Ak(ee,Mp()):[]),Ne=rn(()=>p?.().filter(ee=>ee!=null)??[]),G=rn(ee=>{const oe=Ee(ee);return A.current.map(()=>oe).filter(Boolean).flat()});E.useEffect(()=>{if(r||!i)return;function ee(be){be.key==="Tab"&&Qt(ce,li($n(ce)))&&Ee().length===0&&!T&&n6e(be)}const oe=$n(ce);return oe.addEventListener("keydown",ee),()=>{oe.removeEventListener("keydown",ee)}},[r,b,ce,i,A,T,Ee,G]),E.useEffect(()=>{if(r||!g)return;const ee=$n(ce);function oe(){J.current=!1}function be(fe){const ve=Fa(fe),ze=Ne(),Se=Qt(x,ve)||Qt(b,ve)||Qt(K?.portalNode,ve)||ze.some(re=>re===ve||Qt(re,ve));J.current=!Se,le.current=fe.pointerType||"keyboard",ve?.closest(`[${gCe}]`)&&(W.current=!0)}function Oe(){le.current="keyboard"}return ee.addEventListener("pointerdown",be,!0),ee.addEventListener("pointerup",oe,!0),ee.addEventListener("pointercancel",oe,!0),ee.addEventListener("keydown",Oe,!0),()=>{ee.removeEventListener("pointerdown",be,!0),ee.removeEventListener("pointerup",oe,!0),ee.removeEventListener("pointercancel",oe,!0),ee.removeEventListener("keydown",Oe,!0)}},[r,x,b,ce,g,K,Ne]),E.useEffect(()=>{if(r||!c)return;const ee=$n(ce);function oe(){W.current=!0,D.start(0,()=>{W.current=!1})}function be(Se){const re=Fa(Se),We=Ee().indexOf(re);We!==-1&&(ae.current=We)}function Oe(Se){const re=Se.relatedTarget,Ie=Se.currentTarget,We=Fa(Se);queueMicrotask(()=>{const Ft=S(),an=y.context.triggerElements,te=Ne(),ue=re?.hasAttribute(o1("focus-guard"))&&[I.current,U.current,K?.beforeInsideRef.current,K?.afterInsideRef.current,K?.beforeOutsideRef.current,K?.afterOutsideRef.current,xo(d),xo(l)].includes(re),$e=!(Qt(b,re)||Qt(x,re)||Qt(re,x)||Qt(K?.portalNode,re)||te.some(we=>we===re||Qt(we,re))||re!=null&&an.hasElement(re)||an.hasMatchingElement(we=>Qt(we,re))||ue||F&&(zl(F.nodesRef.current,Ft).find(we=>Qt(we.context?.elements.floating,re)||Qt(we.context?.elements.domReference,re))||nj(F.nodesRef.current,Ft).find(we=>[we.context?.elements.floating,ME(we.context?.elements.floating)].includes(re)||we.context?.elements.domReference===re)));if(Ie===b&&ce&&bj(ce,A),o&&Ie!==b&&!p5e(We)&&li(ee)===ee.body){if(wo(ce)&&(ce.focus(),o==="popup")){Q.request(()=>{ce.focus()});return}const we=ae.current,Ge=Ee(),Re=Ge[we]||Ge[Ge.length-1]||ce;wo(Re)&&Re.focus()}if(_.current.insideReactTree){_.current.insideReactTree=!1;return}(T||!i)&&re&&$e&&!W.current&&(T||re!==qS())&&(Y.current=!0,y.setOpen(!1,yi(yV,Se)))})}function fe(){J.current||(_.current.insideReactTree=!0,P.start(0,()=>{_.current.insideReactTree=!1}))}const ve=wo(b)?b:null,ze=[];if(!(!x&&!ve))return ve&&(ve.addEventListener("focusout",Oe),ve.addEventListener("pointerdown",oe),ze.push(()=>{ve.removeEventListener("focusout",Oe),ve.removeEventListener("pointerdown",oe)})),x&&(x.addEventListener("focusin",be),x.addEventListener("focusout",Oe),K&&(x.addEventListener("focusout",fe,!0),ze.push(()=>{x.removeEventListener("focusout",fe,!0)})),ze.push(()=>{x.removeEventListener("focusin",be),x.removeEventListener("focusout",Oe)})),()=>{ze.forEach(Se=>{Se()})}},[r,b,x,ce,i,F,K,y,c,o,Ee,T,S,A,_,P,D,Q,l,d,Ne]),E.useEffect(()=>{if(r||!x||!g)return;const ee=Array.from(K?.portalNode?.querySelectorAll(`[${o1("portal")}]`)||[]),be=(F?nj(F.nodesRef.current,S()):[]).find(re=>tj(re.context?.elements.domReference||null))?.context?.elements.domReference,fe=[...[x,...ee,I.current,U.current,K?.beforeOutsideRef.current,K?.afterOutsideRef.current,...Ne()],be,xo(d),xo(l),T?b:null].filter(re=>re!=null),ve=pj(fe,{ariaHidden:i||T,mark:!1}),ze=[x,...ee].filter(re=>re!=null),Se=pj(ze);return()=>{Se(),ve()}},[g,r,b,x,i,A,K,T,F,S,l,d,Ne]),qt(()=>{if(!g||r||!wo(ce))return;const ee=$n(ce),oe=li(ee);queueMicrotask(()=>{const be=G(ce),Oe=L.current,fe=typeof Oe=="function"?Oe(j.current||""):Oe;if(fe===void 0||fe===!1)return;let ve;fe===!0||fe===null?ve=be[0]||ce:ve=xo(fe),ve=ve||be[0]||ce,!Qt(ce,oe)&&BS(ve,{preventScroll:ve===ce})})},[r,g,ce,w,G,L,j]),qt(()=>{if(r||!ce)return;const ee=$n(ce),oe=li(ee);h5e(oe);function be(fe){if(fe.open||(ge.current=f5e(fe.nativeEvent,le.current)),fe.reason===O6e&&fe.nativeEvent.type==="mouseleave"&&(Y.current=!0),fe.reason===bV)if(fe.nested)Y.current=!1;else if(s6e(fe.nativeEvent)||a6e(fe.nativeEvent))Y.current=!1;else{let ve=!1;document.createElement("div").focus({get preventScroll(){return ve=!0,!1}}),ve?Y.current=!1:Y.current=!0}}k.on("openchange",be);function Oe(){const fe=R.current;let ve=typeof fe=="function"?fe(ge.current):fe;if(ve===void 0||ve===!1)return null;if(ve===null&&(ve=!0),typeof ve=="boolean"){const Se=b||qS();return Se&&Se.isConnected?Se:null}const ze=b||qS();return xo(ve)||ze||null}return()=>{k.off("openchange",be);const fe=li(ee),ve=Ne(),ze=Qt(x,fe)||ve.some(re=>re===fe||Qt(re,fe))||F&&zl(F.nodesRef.current,S(),!1).some(re=>Qt(re.context?.elements.floating,fe)),Se=Oe();queueMicrotask(()=>{const re=m5e(Se),Ie=typeof R.current!="boolean";R.current&&!Y.current&&wo(re)&&(!(!Ie&&re!==fe&&fe!==ee.body)||ze)&&re.focus({preventScroll:!0}),Y.current=!1})}},[r,x,ce,R,_,k,F,b,S,Ne]),qt(()=>{if(!Zq||g||!x)return;const ee=li($n(x));!wo(ee)||!rV(ee)||Qt(x,ee)&&ee.blur()},[g,x]),qt(()=>{if(!(r||!K))return K.setFocusManagerState({modal:i,closeOnFocusOut:c,open:g,onOpenChange:y.setOpen,domReference:b}),()=>{K.setFocusManagerState(null)}},[r,K,i,g,y,c,b]),qt(()=>{if(!(r||!ce))return bj(ce,A),()=>{queueMicrotask(pA)}},[r,ce,A]);const X=!r&&(i?!T:!0)&&(pe||i);return f.jsxs(E.Fragment,{children:[X&&f.jsx(a1,{"data-type":"inside",ref:V,onFocus:ee=>{if(i){const oe=G();BS(oe[oe.length-1])}else K?.portalNode&&(Y.current=!1,Bh(ee,K.portalNode)?fV(b)?.focus():xo(d??K.beforeOutsideRef)?.focus())}}),n,X&&f.jsx(a1,{"data-type":"inside",ref:N,onFocus:ee=>{i?BS(G()[0]):K?.portalNode&&(c&&(Y.current=!0),Bh(ee,K.portalNode)?hV(b)?.focus():xo(l??K.afterOutsideRef)?.focus())}})]})}const b5e={intentional:"onClick",sloppy:"onPointerDown"};function y5e(){return!1}function x5e(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function k5e(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),s=n.useState("floatingElement"),{dataRef:a}=n.context,{enabled:o=!0,escapeKey:i=!0,outsidePress:c=!0,outsidePressEvent:u="sloppy",referencePress:l=y5e,referencePressEvent:d="sloppy",bubbles:h,externalTree:m}=t,p=CV(m),y=rn(typeof c=="function"?c:()=>!1),g=typeof c=="function"?y:c,b=g!==!1,x=rn(()=>u),k=E.useRef(!1),_=E.useRef(!1),S=E.useRef(!1),{escapeKey:w,outsidePress:T}=x5e(h),A=E.useRef(null),L=e1(),R=e1(),j=rn(()=>{R.clear(),a.current.insideReactTree=!1}),F=E.useRef(!1),K=E.useRef(""),Y=rn(l),W=rn(U=>{if(!r||!o||!i||U.key!=="Escape"||F.current)return;const V=a.current.floatingContext?.nodeId,N=p?zl(p.nodesRef.current,V):[];if(!w&&N.length>0){let Q=!0;if(N.forEach(pe=>{pe.context?.open&&!pe.context.dataRef.current.__escapeKeyBubbles&&(Q=!1)}),!Q)return}const P=r6e(U)?U.nativeEvent:U,D=yi(L6e,P);n.setOpen(!1,D),!w&&!D.isPropagationAllowed&&U.stopPropagation()}),J=rn(()=>{a.current.insideReactTree=!0,R.start(0,j)});E.useEffect(()=>{if(!r||!o)return;a.current.__escapeKeyBubbles=w,a.current.__outsidePressBubbles=T;const U=new Su,V=new Su;function N(){U.clear(),F.current=!0}function P(){U.start(VTe()?5:0,()=>{F.current=!1})}function D(){S.current=!0,V.start(0,()=>{S.current=!1})}function Q(){k.current=!1,_.current=!1}function pe(){const re=K.current,Ie=re==="pen"||!re?"mouse":re,We=x(),Ft=typeof We=="function"?We():We;return typeof Ft=="string"?Ft:Ft[Ie]}function ce(re){const Ie=pe();return Ie==="intentional"&&re.type!=="click"||Ie==="sloppy"&&re.type==="click"}function Ee(re){const Ie=a.current.floatingContext?.nodeId,We=p&&zl(p.nodesRef.current,Ie).some(Ft=>ta(re,Ft.context?.elements.floating));return ta(re,n.select("floatingElement"))||ta(re,n.select("domReferenceElement"))||We}function Ne(re){if(ce(re)){j();return}if(a.current.insideReactTree){j();return}const Ie=Fa(re),We=`[${o1("inert")}]`;let Ft=Array.from($n(n.select("floatingElement")).querySelectorAll(We));const an=Sl(Ie)?Ie.getRootNode():null;Cm(an)&&(Ft=Ft.concat(Array.from(an.querySelectorAll(We))));const te=n.context.triggerElements;if(Ie&&(te.hasElement(Ie)||te.hasMatchingElement(Ge=>Qt(Ge,Ie))))return;let ue=Sl(Ie)?Ie:null;for(;ue&&!hS(ue);){const Ge=GTe(ue);if(hS(Ge)||!Sl(Ge))break;ue=Ge}if(Ft.length&&Sl(Ie)&&!t6e(Ie)&&!Qt(Ie,n.select("floatingElement"))&&Ft.every(Ge=>!Qt(ue,Ge)))return;if(wo(Ie)&&!("touches"in re)){const Ge=hS(Ie),Re=I2(Ie),as=/auto|scroll/,yr=Ge||as.test(Re.overflowX),Yo=Ge||as.test(Re.overflowY),oc=yr&&Ie.clientWidth>0&&Ie.scrollWidth>Ie.clientWidth,Nr=Yo&&Ie.clientHeight>0&&Ie.scrollHeight>Ie.clientHeight,Jo=Re.direction==="rtl",Xs=Nr&&(Jo?re.offsetX<=Ie.offsetWidth-Ie.clientWidth:re.offsetX>Ie.clientWidth),rK=oc&&re.offsetY>Ie.clientHeight;if(Xs||rK)return}if(Ee(re))return;if(pe()==="intentional"&&S.current){V.clear(),S.current=!1;return}if(typeof g=="function"&&!g(re))return;const $e=a.current.floatingContext?.nodeId,we=p?zl(p.nodesRef.current,$e):[];if(we.length>0){let Ge=!0;if(we.forEach(Re=>{Re.context?.open&&!Re.context.dataRef.current.__outsidePressBubbles&&(Ge=!1)}),!Ge)return}n.setOpen(!1,yi(bV,re)),j()}function G(re){pe()!=="sloppy"||re.pointerType==="touch"||!n.select("open")||!o||ta(re,n.select("floatingElement"))||ta(re,n.select("domReferenceElement"))||Ne(re)}function X(re){if(pe()!=="sloppy"||!n.select("open")||!o||ta(re,n.select("floatingElement"))||ta(re,n.select("domReferenceElement")))return;const Ie=re.touches[0];Ie&&(A.current={startTime:Date.now(),startX:Ie.clientX,startY:Ie.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},L.start(1e3,()=>{A.current&&(A.current.dismissOnTouchEnd=!1,A.current.dismissOnMouseDown=!1)}))}function ee(re){K.current="touch";const Ie=Fa(re);function We(){X(re),Ie?.removeEventListener(re.type,We)}Ie?.addEventListener(re.type,We)}function oe(re){if(L.clear(),re.type==="pointerdown"&&(K.current=re.pointerType),re.type==="mousedown"&&A.current&&!A.current.dismissOnMouseDown)return;const Ie=Fa(re);function We(){re.type==="pointerdown"?G(re):Ne(re),Ie?.removeEventListener(re.type,We)}Ie?.addEventListener(re.type,We)}function be(re){if(!k.current)return;const Ie=_.current;if(Q(),pe()==="intentional"){if(re.type==="pointercancel"){Ie&&D();return}if(!Ee(re)){if(Ie){D();return}typeof g=="function"&&!g(re)||(V.clear(),S.current=!0,j())}}}function Oe(re){if(pe()!=="sloppy"||!A.current||ta(re,n.select("floatingElement"))||ta(re,n.select("domReferenceElement")))return;const Ie=re.touches[0];if(!Ie)return;const We=Math.abs(Ie.clientX-A.current.startX),Ft=Math.abs(Ie.clientY-A.current.startY),an=Math.sqrt(We*We+Ft*Ft);an>5&&(A.current.dismissOnTouchEnd=!0),an>10&&(Ne(re),L.clear(),A.current=null)}function fe(re){const Ie=Fa(re);function We(){Oe(re),Ie?.removeEventListener(re.type,We)}Ie?.addEventListener(re.type,We)}function ve(re){pe()!=="sloppy"||!A.current||ta(re,n.select("floatingElement"))||ta(re,n.select("domReferenceElement"))||(A.current.dismissOnTouchEnd&&Ne(re),L.clear(),A.current=null)}function ze(re){const Ie=Fa(re);function We(){ve(re),Ie?.removeEventListener(re.type,We)}Ie?.addEventListener(re.type,We)}const Se=$n(s);return i&&(Se.addEventListener("keydown",W),Se.addEventListener("compositionstart",N),Se.addEventListener("compositionend",P)),b&&(Se.addEventListener("click",oe,!0),Se.addEventListener("pointerdown",oe,!0),Se.addEventListener("pointerup",be,!0),Se.addEventListener("pointercancel",be,!0),Se.addEventListener("mousedown",oe,!0),Se.addEventListener("mouseup",be,!0),Se.addEventListener("touchstart",ee,!0),Se.addEventListener("touchmove",fe,!0),Se.addEventListener("touchend",ze,!0)),()=>{i&&(Se.removeEventListener("keydown",W),Se.removeEventListener("compositionstart",N),Se.removeEventListener("compositionend",P)),b&&(Se.removeEventListener("click",oe,!0),Se.removeEventListener("pointerdown",oe,!0),Se.removeEventListener("pointerup",be,!0),Se.removeEventListener("pointercancel",be,!0),Se.removeEventListener("mousedown",oe,!0),Se.removeEventListener("mouseup",be,!0),Se.removeEventListener("touchstart",ee,!0),Se.removeEventListener("touchmove",fe,!0),Se.removeEventListener("touchend",ze,!0)),U.clear(),V.clear(),Q(),S.current=!1}},[a,s,i,b,g,r,o,w,T,W,j,x,p,n,L]),E.useEffect(j,[g,j]);const ae=E.useMemo(()=>({onKeyDown:W,[b5e[d]]:U=>{Y()&&n.setOpen(!1,yi(aj,U.nativeEvent))},...d!=="intentional"&&{onClick(U){Y()&&n.setOpen(!1,yi(aj,U.nativeEvent))}}}),[W,n,d,Y]),ge=rn(U=>{if(!r||!o||U.button!==0)return;const V=Fa(U.nativeEvent);Qt(n.select("floatingElement"),V)&&(k.current||(k.current=!0,_.current=!1))}),le=rn(U=>{!r||!o||(U.defaultPrevented||U.nativeEvent.defaultPrevented)&&k.current&&(_.current=!0)}),I=E.useMemo(()=>({onKeyDown:W,onPointerDown:le,onMouseDown:le,onClickCapture:J,onMouseDownCapture(U){J(),ge(U)},onPointerDownCapture(U){J(),ge(U)},onMouseUpCapture:J,onTouchEndCapture:J,onTouchMoveCapture:J}),[W,J,ge,le]);return E.useMemo(()=>o?{reference:ae,floating:I,trigger:ae}:{},[o,ae,I])}var i1=Symbol("NOT_FOUND");function v5e(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function S5e(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function w5e(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var yj=e=>Array.isArray(e)?e:[e];function _5e(e){const t=Array.isArray(e[0])?e[0]:e;return w5e(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function E5e(e,t){const n=[],{length:r}=e;for(let s=0;s<r;s++)n.push(e[s].apply(null,t));return n}function T5e(e){let t;return{get(n){return t&&e(t.key,n)?t.value:i1},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function C5e(e,t){let n=[];function r(i){const c=n.findIndex(u=>t(i,u.key));if(c>-1){const u=n[c];return c>0&&(n.splice(c,1),n.unshift(u)),u.value}return i1}function s(i,c){r(i)===i1&&(n.unshift({key:i,value:c}),n.length>e&&n.pop())}function a(){return n}function o(){n=[]}return{get:r,put:s,getEntries:a,clear:o}}var I5e=(e,t)=>e===t;function A5e(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:s}=n;for(let a=0;a<s;a++)if(!e(n[a],r[a]))return!1;return!0}}function N5e(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=I5e,maxSize:s=1,resultEqualityCheck:a}=n,o=A5e(r);let i=0;const c=s<=1?T5e(o):C5e(s,o);function u(){let l=c.get(arguments);if(l===i1){if(l=e.apply(null,arguments),i++,a){const h=c.getEntries().find(m=>a(m.value,l));h&&(l=h.value,i!==0&&i--)}c.put(arguments,l)}return l}return u.clearCache=()=>{c.clear(),u.resetResultsCount()},u.resultsCount=()=>i,u.resetResultsCount=()=>{i=0},u}var R5e=class{constructor(e){this.value=e}deref(){return this.value}},P5e=typeof WeakRef<"u"?WeakRef:R5e,O5e=0,xj=1;function bb(){return{s:O5e,v:void 0,o:null,p:null}}function IV(e,t={}){let n=bb();const{resultEqualityCheck:r}=t;let s,a=0;function o(){let i=n;const{length:c}=arguments;for(let d=0,h=c;d<h;d++){const m=arguments[d];if(typeof m=="function"||typeof m=="object"&&m!==null){let p=i.o;p===null&&(i.o=p=new WeakMap);const y=p.get(m);y===void 0?(i=bb(),p.set(m,i)):i=y}else{let p=i.p;p===null&&(i.p=p=new Map);const y=p.get(m);y===void 0?(i=bb(),p.set(m,i)):i=y}}const u=i;let l;if(i.s===xj)l=i.v;else if(l=e.apply(null,arguments),a++,r){const d=s?.deref?.()??s;d!=null&&r(d,l)&&(l=d,a!==0&&a--),s=typeof l=="object"&&l!==null||typeof l=="function"?new P5e(l):l}return u.s=xj,u.v=l,l}return o.clearCache=()=>{n=bb(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function AV(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...s)=>{let a=0,o=0,i,c={},u=s.pop();typeof u=="object"&&(c=u,u=s.pop()),v5e(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const l={...n,...c},{memoize:d,memoizeOptions:h=[],argsMemoize:m=IV,argsMemoizeOptions:p=[]}=l,y=yj(h),g=yj(p),b=_5e(s),x=d(function(){return a++,u.apply(null,arguments)},...y),k=m(function(){o++;const S=E5e(b,arguments);return i=x.apply(null,S),i},...g);return Object.assign(k,{resultFunc:u,memoizedResultFunc:x,dependencies:b,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>i,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:d,argsMemoize:m})};return Object.assign(r,{withTypes:()=>r}),r}var L5e=AV(IV),$5e=Object.assign((e,t=L5e)=>{S5e(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(a=>e[a]);return t(r,(...a)=>a.reduce((o,i,c)=>(o[n[c]]=i,o),{}))},{withTypes:()=>$5e});AV({memoize:N5e,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Pt=(e,t,n,r,s,a,...o)=>{if(o.length>0)throw new Error(Xd(1));let i;if(e)i=e;else throw new Error("Missing arguments");return i};var j5e=aM();const M5e=A2(19),D5e=M5e?B5e:U5e;function NV(e,t,n,r,s){return D5e(e,t,n,r,s)}function F5e(e,t,n,r,s){const a=E.useCallback(()=>t(e.getSnapshot(),n,r,s),[e,t,n,r,s]);return j5e.useSyncExternalStore(e.subscribe,a,a)}function B5e(e,t,n,r,s){return F5e(e,t,n,r,s)}function U5e(e,t,n,r,s){return oM.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,n,r,s))}class z5e{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,s){return NV(this,t,n,r,s)}}class RV extends z5e{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){E.useDebugValue(t),qt(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const r=this;qt(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);qt(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){E.useDebugValue(t);const r=n!==void 0;qt(()=>{r&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,r])}select(t,n,r,s){const a=this.selectors[t];return a(this.state,n,r,s)}useState(t,n,r,s){return E.useDebugValue(t),NV(this,this.selectors[t],n,r,s)}useContextCallback(t,n){E.useDebugValue(t);const r=rn(n??Kr);this.context[t]=r}useStateSetter(t){const n=E.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let s=r(this.state);return n(s,s,this),this.subscribe(a=>{const o=r(a);if(!Object.is(s,o)){const i=s;s=o,n(o,i,this)}})}}const H5e={open:Pt(e=>e.open),domReferenceElement:Pt(e=>e.domReferenceElement),referenceElement:Pt(e=>e.positionReference??e.referenceElement),floatingElement:Pt(e=>e.floatingElement),floatingId:Pt(e=>e.floatingId)};class PV extends RV{constructor(t){const{nested:n,noEmit:r,onOpenChange:s,triggerElements:a,...o}=t;super({...o,positionReference:o.referenceElement,domReferenceElement:o.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:u5e(),nested:n,noEmit:r,triggerElements:a},H5e)}setOpen=(t,n)=>{if((!t||!this.state.open||o6e(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)}this.context.onOpenChange?.(t,n)}}function q5e(e){const t=e.useState("open");qt(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[r,s]=n.value;e.update({activeTriggerId:r,activeTriggerElement:s})}}},[t,e])}function V5e(e,t,n){const{mounted:r,setMounted:s,transitionStatus:a}=I6e(e);t.useSyncedValues({mounted:r,transitionStatus:a});const o=rn(()=>{s(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),t.context.onOpenChangeComplete?.(!1)}),i=t.useState("preventUnmountingOnClose");return gV({enabled:!i,open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}class OV{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function G5e(){return new PV({open:!1,floatingElement:null,referenceElement:null,triggerElements:new OV,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function K5e(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:G5e(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Wr,inactiveTriggerProps:Wr,popupProps:Wr}}const yb=Pt(e=>e.triggerIdProp??e.activeTriggerId),W5e={open:Pt(e=>e.openProp??e.open),mounted:Pt(e=>e.mounted),transitionStatus:Pt(e=>e.transitionStatus),floatingRootContext:Pt(e=>e.floatingRootContext),preventUnmountingOnClose:Pt(e=>e.preventUnmountingOnClose),payload:Pt(e=>e.payload),activeTriggerId:yb,activeTriggerElement:Pt(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:Pt((e,t)=>t!==void 0&&yb(e)===t),isOpenedByTrigger:Pt((e,t)=>t!==void 0&&yb(e)===t&&e.open),isMountedByTrigger:Pt((e,t)=>t!==void 0&&yb(e)===t&&e.mounted),triggerProps:Pt((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:Pt(e=>e.popupProps),popupElement:Pt(e=>e.popupElement),positionerElement:Pt(e=>e.positionerElement)};function Y5e(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:s}=e,a=Ik(),o=TV()!=null,i=t.useState("open"),c=t.useState("activeTriggerElement"),u=t.useState(r?"popupElement":"positionerElement"),l=t.context.triggerElements,d=Go(()=>new PV({open:i,referenceElement:c,floatingElement:u,triggerElements:l,onOpenChange:s,floatingId:a,nested:o,noEmit:n})).current;return qt(()=>{const h={open:i,floatingId:a,referenceElement:c,floatingElement:u};Sl(c)&&(h.domReferenceElement=c),d.state.positionReference===d.state.referenceElement&&(h.positionReference=c),d.update(h)},[i,a,c,u,d]),d.context.onOpenChange=s,d.context.nested=o,d.context.noEmit=n,d}function J5e(e=[]){const t=e.map(u=>u?.reference),n=e.map(u=>u?.floating),r=e.map(u=>u?.item),s=e.map(u=>u?.trigger),a=E.useCallback(u=>xb(u,e,"reference"),t),o=E.useCallback(u=>xb(u,e,"floating"),n),i=E.useCallback(u=>xb(u,e,"item"),r),c=E.useCallback(u=>xb(u,e,"trigger"),s);return E.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:i,getTriggerProps:c}),[a,o,i,c])}function xb(e,t,n){const r=new Map,s=n==="item",a={};n==="floating"&&(a.tabIndex=-1,a[jE]="");for(const o in e)s&&e&&(o===tV||o===nV)||(a[o]=e[o]);for(let o=0;o<t.length;o+=1){let i;const c=t[o]?.[n];typeof c=="function"?i=e?c(e):null:i=c,i&&kj(a,i,s,r)}return kj(a,e,s,r),a}function kj(e,t,n,r){for(const s in t){const a=t[s];n&&(s===tV||s===nV)||(s.startsWith("on")?(r.has(s)||r.set(s,[]),typeof a=="function"&&(r.get(s)?.push(a),e[s]=(...o)=>r.get(s)?.map(i=>i(...o)).find(i=>i!==void 0))):e[s]=a)}}const Q5e=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function X5e(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),s=n.useState("floatingId"),a=n.useState("domReferenceElement"),o=n.useState("floatingElement"),{role:i="dialog"}=t,c=Ik(),u=a?.id||c,l=E.useMemo(()=>ME(o)?.id||s,[o,s]),d=Q5e.get(i)??i,m=TV()!=null,p=E.useMemo(()=>d==="tooltip"||i==="label"?Wr:{"aria-haspopup":d==="alertdialog"?"dialog":d,"aria-expanded":"false",...d==="listbox"&&{role:"combobox"},...d==="menu"&&m&&{role:"menuitem"},...i==="select"&&{"aria-autocomplete":"none"},...i==="combobox"&&{"aria-autocomplete":"list"}},[d,m,i]),y=E.useMemo(()=>d==="tooltip"||i==="label"?{[`aria-${i==="label"?"labelledby":"describedby"}`]:r?l:void 0}:{...p,"aria-expanded":r?"true":"false","aria-controls":r?l:void 0,...d==="menu"&&{id:u}},[d,l,r,u,i,p]),g=E.useMemo(()=>{const x={id:l,...d&&{role:d}};return d==="tooltip"||i==="label"?x:{...x,...d==="menu"&&{"aria-labelledby":u}}},[d,l,u,i]),b=E.useCallback(({active:x,selected:k})=>{const _={role:"option",...x&&{id:`${l}-fui-option`}};switch(i){case"select":case"combobox":return{..._,"aria-selected":k}}return{}},[l,i]);return E.useMemo(()=>({reference:y,floating:g,item:b,trigger:p}),[y,g,p,b])}function Z5e(e){const t=E.useRef(""),n=E.useCallback(s=>{s.defaultPrevented||(t.current=s.pointerType,e(s,s.pointerType))},[e]);return{onClick:E.useCallback(s=>{if(s.detail===0){e(s,"keyboard");return}"pointerType"in s?e(s,s.pointerType):e(s,t.current),t.current=""},[e]),onPointerDown:n}}function e4e(e,t){const n=E.useRef(e),r=rn(t);qt(()=>{n.current!==e&&r(n.current)},[e,r]),qt(()=>{n.current=e},[e])}function t4e(e){const[t,n]=E.useState(null),r=rn((o,i)=>{e||n(i||(eV?"touch":""))});e4e(e,o=>{o&&!e&&n(null)});const{onClick:s,onPointerDown:a}=Z5e(r);return E.useMemo(()=>({openMethod:t,triggerProps:{onClick:s,onPointerDown:a}}),[t,s,a])}let Uc=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Pm.startingStyle]="startingStyle",e[e.endingStyle=Pm.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const n4e={[Uc.open]:""},r4e={[Uc.closed]:""},s4e={[Uc.anchorHidden]:""},LV={open(e){return e?n4e:r4e},anchorHidden(e){return e?s4e:null}};function a4e(e){return A2(19)?e:e?"true":void 0}const o4e=E.forwardRef(function(t,n){const{cutout:r,...s}=t;let a;if(r){const o=r?.getBoundingClientRect();a=`polygon(
|
|
307
|
-
0% 0%,
|
|
308
|
-
100% 0%,
|
|
309
|
-
100% 100%,
|
|
310
|
-
0% 100%,
|
|
311
|
-
0% 0%,
|
|
312
|
-
${o.left}px ${o.top}px,
|
|
313
|
-
${o.left}px ${o.bottom}px,
|
|
314
|
-
${o.right}px ${o.bottom}px,
|
|
315
|
-
${o.right}px ${o.top}px,
|
|
316
|
-
${o.left}px ${o.top}px
|
|
317
|
-
)`}return f.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:a}})}),$V="ArrowUp",jV="ArrowDown",MV="ArrowLeft",DV="ArrowRight",FV="Home",BV="End",i4e=new Set([MV,DV]),c4e=new Set([$V,jV]),u4e=new Set([...i4e,...c4e]);[...u4e];const l4e=new Set([$V,jV,MV,DV,FV,BV]),UV=E.createContext(void 0);function Pk(e){const t=E.useContext(UV);if(e===!1&&t===void 0)throw new Error(Xd(27));return t}const d4e={...LV,...pV},f4e=E.forwardRef(function(t,n){const{render:r,className:s,forceRender:a=!1,...o}=t,{store:i}=Pk(),c=i.useState("open"),u=i.useState("nested"),l=i.useState("mounted"),d=i.useState("transitionStatus");return Zd("div",t,{state:{open:c,transitionStatus:d},ref:[i.context.backdropRef,n],stateAttributesMapping:d4e,props:[{role:"presentation",hidden:!l,style:{userSelect:"none",WebkitUserSelect:"none"}},o],enabled:a||!u})});let h4e=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),m4e=(function(e){return e[e.open=Uc.open]="open",e[e.closed=Uc.closed]="closed",e[e.startingStyle=Uc.startingStyle]="startingStyle",e[e.endingStyle=Uc.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const zV=E.createContext(void 0);function p4e(){const e=E.useContext(zV);if(e===void 0)throw new Error(Xd(26));return e}const g4e={...LV,...pV,nestedDialogOpen(e){return e?{[m4e.nestedDialogOpen]:""}:null}},b4e=E.forwardRef(function(t,n){const{className:r,finalFocus:s,initialFocus:a,render:o,...i}=t,{store:c}=Pk(),u=c.useState("descriptionElementId"),l=c.useState("disablePointerDismissal"),d=c.useState("floatingRootContext"),h=c.useState("popupProps"),m=c.useState("modal"),p=c.useState("mounted"),y=c.useState("nested"),g=c.useState("nestedOpenDialogCount"),b=c.useState("open"),x=c.useState("openMethod"),k=c.useState("titleElementId"),_=c.useState("transitionStatus"),S=c.useState("role");p4e(),gV({open:b,ref:c.context.popupRef,onComplete(){b&&c.context.onOpenChangeComplete?.(!0)}});function w(j){return j==="touch"?c.context.popupRef.current:!0}const T=a===void 0?w:a,A=g>0,R=Zd("div",t,{state:{open:b,nested:y,transitionStatus:_,nestedDialogOpen:A},props:[h,{"aria-labelledby":k??void 0,"aria-describedby":u??void 0,role:S,tabIndex:-1,hidden:!p,onKeyDown(j){l4e.has(j.key)&&j.stopPropagation()},style:{[h4e.nestedDialogs]:g}},i],ref:[n,c.context.popupRef,c.useStateSetter("popupElement")],stateAttributesMapping:g4e});return f.jsx(g5e,{context:d,openInteractionType:x,disabled:!p,closeOnFocusOut:!l,initialFocus:T,returnFocus:s,modal:m!==!1,restoreFocus:"popup",children:R})}),y4e=E.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,{store:a}=Pk(),o=a.useState("mounted"),i=a.useState("modal"),c=a.useState("open");return o||r?f.jsx(zV.Provider,{value:r,children:f.jsxs(c5e,{ref:n,...s,children:[o&&i===!0&&f.jsx(o4e,{ref:a.context.internalBackdropRef,inert:a4e(!c)}),t.children]})}):null});function x4e(e){const{store:t,parentContext:n,actionsRef:r}=e,s=t.useState("open"),a=t.useState("disablePointerDismissal"),o=t.useState("modal"),i=t.useState("popupElement"),{openMethod:c,triggerProps:u}=t4e(s);q5e(t);const{forceUnmount:l}=V5e(s,t),d=rn(L=>{const R=yi(L);return R.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},R}),h=E.useCallback(()=>{t.setOpen(!1,d($6e))},[t,d]);E.useImperativeHandle(r,()=>({unmount:l,close:h}),[l,h]);const m=Y5e({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[p,y]=E.useState(0),g=p===0,b=X5e(m),x=k5e(m,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:o==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(L){if(!t.context.outsidePressEnabledRef.current||"button"in L&&L.button!==0||"touches"in L&&L.touches.length!==1)return!1;const R=Fa(L);if(g&&!a){const j=R;return o&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===j||t.context.backdropRef.current===j||Qt(j,i)&&!j?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:g});Z6e(s&&o===!0,i);const{getReferenceProps:k,getFloatingProps:_,getTriggerProps:S}=J5e([b,x]);t.useContextCallback("onNestedDialogOpen",L=>{y(L+1)}),t.useContextCallback("onNestedDialogClose",()=>{y(0)}),E.useEffect(()=>(n?.onNestedDialogOpen&&s&&n.onNestedDialogOpen(p),n?.onNestedDialogClose&&!s&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&s&&n.onNestedDialogClose()}),[s,n,p]);const w=E.useMemo(()=>k(u),[k,u]),T=E.useMemo(()=>S(u),[S,u]),A=E.useMemo(()=>_(),[_]);t.useSyncedValues({openMethod:c,activeTriggerProps:w,inactiveTriggerProps:T,popupProps:A,floatingRootContext:m,nestedOpenDialogCount:p})}const k4e={...W5e,modal:Pt(e=>e.modal),nested:Pt(e=>e.nested),nestedOpenDialogCount:Pt(e=>e.nestedOpenDialogCount),disablePointerDismissal:Pt(e=>e.disablePointerDismissal),openMethod:Pt(e=>e.openMethod),descriptionElementId:Pt(e=>e.descriptionElementId),titleElementId:Pt(e=>e.titleElementId),viewportElement:Pt(e=>e.viewportElement),role:Pt(e=>e.role)};class v4e extends RV{constructor(t){super(S4e(t),{popupRef:E.createRef(),backdropRef:E.createRef(),internalBackdropRef:E.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new OV,onOpenChange:void 0,onOpenChangeComplete:void 0},k4e)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const r={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",r);const s={open:t},a=n.trigger?.id??null;(a||t)&&(s.activeTriggerId=a,s.activeTriggerElement=n.trigger??null),this.update(s)}}function S4e(e={}){return{...K5e(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function w4e(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:s,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:i=!0,actionsRef:c,handle:u,triggerId:l,defaultTriggerId:d=null}=e,h=Pk(!0),m=!!h,p=Go(()=>u?.store??new v4e({open:r,openProp:n,activeTriggerId:d,triggerIdProp:l,modal:i,disablePointerDismissal:o,nested:m})).current;e5e(()=>{n===void 0&&p.state.open===!1&&r===!0&&p.update({open:!0,activeTriggerId:d})}),p.useControlledProp("openProp",n),p.useControlledProp("triggerIdProp",l),p.useSyncedValues({disablePointerDismissal:o,nested:m,modal:i}),p.useContextCallback("onOpenChange",s),p.useContextCallback("onOpenChangeComplete",a);const y=p.useState("payload");x4e({store:p,actionsRef:c,parentContext:h?.store.context});const g=E.useMemo(()=>({store:p}),[p]);return f.jsx(UV.Provider,{value:g,children:typeof t=="function"?t({payload:y}):t})}function _4e({...e}){return f.jsx(w4e,{"data-slot":"dialog",...e})}function E4e({...e}){return f.jsx(y4e,{"data-slot":"dialog-portal",...e})}function T4e({className:e,...t}){return f.jsx(f4e,{"data-slot":"dialog-overlay",className:gt("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function C4e({...e}){return f.jsx(b4e,{"data-slot":"dialog-popup",...e})}function jt(...e){return tk(Tp(e))}function I4e({className:e,...t}){return f.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:jt("size-4",e),...t,children:[f.jsx("rect",{x:"2",y:"2",width:"5",height:"5",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),f.jsx("rect",{x:"9",y:"2",width:"5",height:"5",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),f.jsx("rect",{x:"2",y:"9",width:"5",height:"5",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),f.jsx("rect",{x:"9",y:"9",width:"5",height:"5",rx:"1",stroke:"currentColor",strokeWidth:"1.3"})]})}function HV({className:e,...t}){return f.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:jt("size-3.5",e),...t,children:[f.jsx("rect",{x:"5",y:"5",width:"8",height:"8",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),f.jsx("path",{d:"M11 3H4a1 1 0 00-1 1v7",stroke:"currentColor",strokeWidth:"1.2"})]})}function qV({className:e,...t}){return f.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:jt("size-3.5",e),...t,children:f.jsx("path",{d:"M4 8.5l3 3 5-6",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function A4e({className:e,...t}){return f.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:jt("size-3",e),...t,children:f.jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function Es({className:e,...t}){return f.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:jt("size-4 animate-spin",e),...t,children:[f.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.5",opacity:"0.2"}),f.jsx("path",{d:"M14 8a6 6 0 00-6-6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function eo({className:e,...t}){return f.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:jt("size-4",e),...t,children:f.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function VV({className:e,...t}){return f.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:jt("size-4",e),...t,children:[f.jsx("path",{d:"M3 11.75L11.6 3.15a1.2 1.2 0 011.7 0l.55.55a1.2 1.2 0 010 1.7L5.25 14H3v-2.25z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),f.jsx("path",{d:"M9.75 5l1.25 1.25",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function Sd({className:e,...t}){return f.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:jt("size-4",e),...t,children:f.jsx("path",{d:"M3.5 4.5h9M6 2.75h4M5 4.5v7.25m3-7.25v7.25m3-7.25v7.25M4.5 4.5l.4 8.1c.03.52.46.9.98.9h4.24c.52 0 .95-.38.98-.9l.4-8.1",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function N4e({className:e,...t}){return f.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:jt("size-4",e),...t,children:f.jsx("path",{d:"M3 4.5h10M3 8h10M3 11.5h10",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function Om(e){return e.loadable.status==="loading"?f.jsx("div",{className:"flex h-full min-h-48 items-center justify-center",children:f.jsxs("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[f.jsx(Es,{}),f.jsx("span",{children:e.loading??"Loading..."})]})}):e.loadable.status==="error"?f.jsx("div",{className:"flex h-full min-h-48 items-center justify-center",children:f.jsx("div",{className:"rounded-lg border border-destructive/25 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:e.loadable.error.message})}):f.jsx(f.Fragment,{children:e.children(e.loadable.data)})}const vj="google_discovery",Ta="google-discovery",R4e="executor:google-discovery-oauth:",GV=`/v1/plugins/${Ta}/oauth/callback`,af=ie("none","client_secret_post"),KV=tn(q({kind:ie("none")}),q({kind:ie("bearer"),tokenSecretRef:hr}),q({kind:ie("oauth2"),clientId:C,clientSecretRef:ne(hr),clientAuthentication:af,authorizationEndpoint:C,tokenEndpoint:C,scopes:_e(C),accessTokenRef:hr,refreshTokenRef:ne(hr),expiresAt:ne(it)})),WV=q({name:C,service:C,version:C,discoveryUrl:ne(C),defaultHeaders:ne(Zn),scopes:_e(C),auth:KV}),UE=WV;q({sourceId:C,config:UE});q({service:C,version:C,discoveryUrl:C,defaultHeaders:ne(Zn),scopes:_e(C),auth:KV});const P4e=q({service:C,version:C,discoveryUrl:ne(C),defaultHeaders:ne(Zn),scopes:_e(C),clientId:C,clientSecretRef:ne(hr),clientAuthentication:af,redirectUrl:C}),O4e=q({name:C,service:C,version:C,discoveryUrl:ne(C),defaultHeaders:ne(Zn),scopes:_e(C)}),L4e=q({sources:_e(O4e),clientId:C,clientSecretRef:ne(hr),clientAuthentication:af,redirectUrl:C}),Sj=q({sessionId:C,authorizationUrl:C,scopes:_e(C)}),$4e=q({kind:ie("single"),service:C,version:C,discoveryUrl:C,defaultHeaders:ne(Zn),scopes:_e(C),clientId:C,clientSecretRef:ne(hr),clientAuthentication:af,redirectUrl:C,codeVerifier:C}),j4e=q({name:C,service:C,version:C,discoveryUrl:C,defaultHeaders:ne(Zn),scopes:_e(C)}),M4e=q({kind:ie("batch"),sources:_e(j4e),scopes:_e(C),clientId:C,clientSecretRef:ne(hr),clientAuthentication:af,redirectUrl:C,codeVerifier:C});tn($4e,M4e);const D4e=q({kind:ie("oauth2"),clientId:C,clientSecretRef:ne(hr),clientAuthentication:af,authorizationEndpoint:C,tokenEndpoint:C,scopes:_e(C),accessTokenRef:hr,refreshTokenRef:ne(hr),expiresAt:ne(it)}),F4e=q({id:C,name:C});tn(q({type:ie("executor:oauth-result"),ok:ie(!0),sessionId:C,mode:ie("single"),auth:D4e}),q({type:ie("executor:oauth-result"),ok:ie(!0),sessionId:C,mode:ie("batch"),sources:_e(F4e)}),q({type:ie("executor:oauth-result"),ok:ie(!1),sessionId:Nx,error:C}));const of=(e,t)=>`https://www.googleapis.com/discovery/v1/apis/${encodeURIComponent(e)}/${encodeURIComponent(t)}/rest`;class Rze extends br("@executor/platform-api/ControlPlaneExecutor")(){}const rl=gn("workspaceId",mr),VS=gn("sourceId",Zi),B4e=DB({contentType:"text/html"}),U4e=q({state:C,code:H(C),error:H(C),error_description:H(C)}),YV=Xi(Ta).add(Dn("createSource")`/workspaces/${rl}/plugins/google-discovery/sources`.setPayload(WV).addSuccess(ks).addError(Je).addError(ft).addError(He)).add(Jn("getSourceConfig")`/workspaces/${rl}/plugins/google-discovery/sources/${VS}`.addSuccess(UE).addError(Je).addError(ft).addError(kt).addError(He)).add(Dx("updateSource")`/workspaces/${rl}/plugins/google-discovery/sources/${VS}`.setPayload(UE).addSuccess(ks).addError(Je).addError(ft).addError(kt).addError(He)).add(Bi("removeSource")`/workspaces/${rl}/plugins/google-discovery/sources/${VS}`.addSuccess(q({removed:Ke})).addError(Je).addError(ft).addError(kt).addError(He)).add(Dn("startOAuth")`/workspaces/${rl}/plugins/google-discovery/oauth/start`.setPayload(P4e).addSuccess(Sj).addError(Je).addError(ft).addError(He)).add(Dn("startBatchOAuth")`/workspaces/${rl}/plugins/google-discovery/oauth/start-batch`.setPayload(L4e).addSuccess(Sj).addError(Je).addError(ft).addError(He)).add(Jn("oauthCallback")`/plugins/google-discovery/oauth/callback`.setUrlParams(U4e).addSuccess(B4e).addError(Je).addError(He)).prefix("/v1"),z4e={key:Ta,group:YV};yp().add(YV);const JV={admin:"https://ssl.gstatic.com/images/branding/product/2x/admin_2020q4_48dp.png",bigquery:"https://ssl.gstatic.com/bqui1/favicon.ico",calendar:"https://ssl.gstatic.com/calendar/images/dynamiclogo_2020q4/calendar_31_2x.png",chat:"https://ssl.gstatic.com/chat/favicon/favicon_v2.ico",classroom:"https://ssl.gstatic.com/classroom/favicon.png",cloudresourcemanager:"https://www.gstatic.com/devrel-devsite/prod/v0e0f589edd85502a40d78d7d0825db8ea5ef3b99b1571571945f0f3f764ff61b/cloud/images/favicons/onecloud/favicon.ico",docs:"https://ssl.gstatic.com/docs/documents/images/kix-favicon7.ico",drive:"https://ssl.gstatic.com/images/branding/product/2x/drive_2020q4_48dp.png",forms:"https://ssl.gstatic.com/docs/forms/device_home/android_192.png",gmail:"https://ssl.gstatic.com/ui/v1/icons/mail/rfr/gmail.ico",keep:"https://ssl.gstatic.com/keep/icon_2020q4v2_128.png",people:"https://ssl.gstatic.com/images/branding/product/2x/contacts_2022_48dp.png",script:"https://ssl.gstatic.com/script/images/favicon.ico",searchconsole:"https://ssl.gstatic.com/search-console/scfe/search_console-64.png",sheets:"https://ssl.gstatic.com/docs/spreadsheets/favicon3.ico",slides:"https://ssl.gstatic.com/docs/presentations/images/favicon5.ico",tasks:"https://ssl.gstatic.com/tasks/images/favicon.ico",youtube:"https://www.youtube.com/s/desktop/a94e1818/img/favicon_32x32.png"},H4e=e=>{const t=e.namespace?.trim();return!t||!t.startsWith("google.")?null:t.slice(7).replaceAll(".","")},q4e=e=>{const t=H4e(e);return t?JV[t]??null:null},QV=e=>JV[e.replaceAll(".","")]??null,V4e=2*6e4,Dp=Qx()("GoogleDiscoveryReactHttpClient",[z4e]),G4e=()=>({name:"Google Sheets",service:"sheets",version:"v4",discoveryUrl:of("sheets","v4"),defaultHeaders:null,scopes:[],auth:{kind:"none"}}),Rn=e=>({...e,discoveryUrl:e.discoveryUrl||of(e.service,e.version)}),Rc=[Rn({id:"google-calendar",name:"Google Calendar",summary:"Calendars, events, ACLs, and scheduling workflows.",service:"calendar",version:"v3",discoveryUrl:"https://calendar-json.googleapis.com/$discovery/rest?version=v3"}),Rn({id:"google-drive",name:"Google Drive",summary:"Files, folders, permissions, comments, and shared drives.",service:"drive",version:"v3",discoveryUrl:of("drive","v3")}),Rn({id:"google-gmail",name:"Gmail",summary:"Messages, threads, labels, drafts, and mailbox automation.",service:"gmail",version:"v1",discoveryUrl:"https://gmail.googleapis.com/$discovery/rest?version=v1"}),Rn({id:"google-docs",name:"Google Docs",summary:"Documents, structural edits, text ranges, and formatting.",service:"docs",version:"v1",discoveryUrl:"https://docs.googleapis.com/$discovery/rest?version=v1"}),Rn({id:"google-sheets",name:"Google Sheets",summary:"Spreadsheets, values, ranges, formatting, and batch updates.",service:"sheets",version:"v4",discoveryUrl:"https://sheets.googleapis.com/$discovery/rest?version=v4"}),Rn({id:"google-slides",name:"Google Slides",summary:"Presentations, slides, page elements, and deck updates.",service:"slides",version:"v1",discoveryUrl:"https://slides.googleapis.com/$discovery/rest?version=v1"}),Rn({id:"google-forms",name:"Google Forms",summary:"Forms, questions, responses, quizzes, and form metadata.",service:"forms",version:"v1",discoveryUrl:"https://forms.googleapis.com/$discovery/rest?version=v1"}),Rn({id:"google-search-console",name:"Google Search Console",summary:"Sites, sitemaps, URL inspection, and search performance.",service:"searchconsole",version:"v1",discoveryUrl:"https://searchconsole.googleapis.com/$discovery/rest?version=v1"}),Rn({id:"google-people",name:"Google People",summary:"Contacts, profiles, directory people, and contact groups.",service:"people",version:"v1",discoveryUrl:"https://people.googleapis.com/$discovery/rest?version=v1"}),Rn({id:"google-tasks",name:"Google Tasks",summary:"Task lists, task items, notes, and due dates.",service:"tasks",version:"v1",discoveryUrl:"https://tasks.googleapis.com/$discovery/rest?version=v1"}),Rn({id:"google-chat",name:"Google Chat",summary:"Spaces, messages, members, reactions, and chat workflows.",service:"chat",version:"v1",discoveryUrl:"https://chat.googleapis.com/$discovery/rest?version=v1"}),Rn({id:"google-keep",name:"Google Keep",summary:"Notes, lists, attachments, and collaborative annotations.",service:"keep",version:"v1",discoveryUrl:"https://keep.googleapis.com/$discovery/rest?version=v1"}),Rn({id:"google-classroom",name:"Google Classroom",summary:"Courses, rosters, coursework, submissions, and grading data.",service:"classroom",version:"v1",discoveryUrl:"https://classroom.googleapis.com/$discovery/rest?version=v1"}),Rn({id:"google-admin-directory",name:"Google Admin Directory",summary:"Users, groups, org units, roles, and directory resources.",service:"admin",version:"directory_v1",discoveryUrl:"https://admin.googleapis.com/$discovery/rest?version=directory_v1"}),Rn({id:"google-admin-reports",name:"Google Admin Reports",summary:"Audit events, usage reports, and admin activity logs.",service:"admin",version:"reports_v1",discoveryUrl:"https://admin.googleapis.com/$discovery/rest?version=reports_v1"}),Rn({id:"google-apps-script",name:"Google Apps Script",summary:"Projects, deployments, execution, and script metadata.",service:"script",version:"v1",discoveryUrl:"https://script.googleapis.com/$discovery/rest?version=v1"}),Rn({id:"google-bigquery",name:"Google BigQuery",summary:"Datasets, tables, jobs, routines, and analytics workflows.",service:"bigquery",version:"v2",discoveryUrl:"https://bigquery.googleapis.com/$discovery/rest?version=v2"}),Rn({id:"google-cloud-resource-manager",name:"Google Cloud Resource Manager",summary:"Projects, folders, organizations, and IAM hierarchy.",service:"cloudresourcemanager",version:"v3",discoveryUrl:"https://cloudresourcemanager.googleapis.com/$discovery/rest?version=v3"}),Rn({id:"google-youtube-data",name:"YouTube Data",summary:"Channels, playlists, videos, comments, captions, and uploads.",service:"youtube",version:"v3",discoveryUrl:"https://youtube.googleapis.com/$discovery/rest?version=v3"})],yc=(e,t)=>{const n=e[t];return typeof n=="string"&&n.trim().length>0?n.trim():null},K4e=e=>{if(!e)return null;try{const t=new URL(e),n=t.pathname.match(/^\/discovery\/v1\/apis\/([^/]+)\/([^/]+)\/rest$/);if(n){const a=decodeURIComponent(n[1]??""),o=decodeURIComponent(n[2]??"");return{name:Rc.find(c=>c.service===a&&c.version===o)?.name??`Google ${a}`,service:a,version:o,discoveryUrl:t.toString()}}const r=t.searchParams.get("version")?.trim()??"",s=t.pathname==="/$discovery/rest"&&t.hostname.endsWith(".googleapis.com")&&t.hostname!=="www.googleapis.com";if(r&&s){const a=t.hostname.split(".")[0]??"";return{name:Rc.find(i=>i.service===a&&i.version===r)?.name??`Google ${a}`,service:a,version:r,discoveryUrl:t.toString()}}}catch{}return null},W4e=e=>{const t=G4e(),n=K4e(yc(e,"inputUrl")??yc(e,"input")??yc(e,"url")),r=yc(e,"presetService")??n?.service??t.service,s=yc(e,"presetVersion")??n?.version??t.version;return{...t,name:yc(e,"presetName")??n?.name??t.name,service:r,version:s,discoveryUrl:yc(e,"presetDiscoveryUrl")??n?.discoveryUrl??of(r,s)}},Y4e=e=>!e||Object.keys(e).length===0?"":JSON.stringify(e,null,2),wj=e=>{const t=e.trim();if(!t)return null;const n=JSON.parse(t);if(n===null||typeof n!="object"||Array.isArray(n))throw new Error("Headers must be a JSON object.");const r=Object.entries(n);if(!r.every(([,s])=>typeof s=="string"))throw new Error("All header values must be strings.");return Object.fromEntries(r)},_j=e=>e.join(`
|
|
318
|
-
`),Ej=e=>e.split(/[\n,]/).map(t=>t.trim()).filter(Boolean),J4e=e=>e.kind==="bearer"?JSON.stringify(e.tokenSecretRef):"",Q4e=e=>e.kind==="oauth2"&&e.clientSecretRef?JSON.stringify(e.clientSecretRef):"",XV=async e=>new Promise((t,n)=>{const r=`${R4e}${e}`,s=Date.now(),a=()=>{window.removeEventListener("message",i),window.clearInterval(c)},o=u=>{a();try{window.localStorage.removeItem(r)}catch{}t(u)},i=u=>{if(u.origin!==window.location.origin)return;const l=u.data;!l||l.type!=="executor:oauth-result"||l.ok&&l.sessionId!==e||o(l)};window.addEventListener("message",i);const c=window.setInterval(()=>{if(Date.now()-s>V4e){a(),n(new Error("Timed out waiting for Google OAuth to finish."));return}try{const u=window.localStorage.getItem(r);if(!u)return;o(JSON.parse(u))}catch{}},400)}),ZV=e=>{const t=window.open("",e,"width=560,height=760");if(!t)return null;try{t.document.title="Sign in with Google",t.document.body.innerHTML=`
|
|
319
|
-
<main style="font-family: system-ui, -apple-system, sans-serif; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; margin: 0; color: #333;">
|
|
320
|
-
<div style="width: 20px; height: 20px; border: 2px solid #e5e7eb; border-top-color: #6366f1; border-radius: 50%; animation: spin 0.7s linear infinite; margin-bottom: 16px;"></div>
|
|
321
|
-
<p style="margin: 0; font-size: 14px; color: #888;">Redirecting to Google…</p>
|
|
322
|
-
<style>
|
|
323
|
-
@keyframes spin { to { transform: rotate(360deg); } }
|
|
324
|
-
@media (prefers-color-scheme: dark) {
|
|
325
|
-
main { background: #09090b; color: #fafafa !important; }
|
|
326
|
-
p { color: #a1a1aa !important; }
|
|
327
|
-
div { border-color: #3f3f46 !important; }
|
|
328
|
-
}
|
|
329
|
-
</style>
|
|
330
|
-
</main>
|
|
331
|
-
`}catch{}return t},X4e=e=>({name:e.name,service:e.service,version:e.version,discoveryUrl:e.discoveryUrl,defaultHeaders:null,scopes:[]});function eG(e){const t=Js(),n=Dp(),r=Dt(n.mutation(Ta,"startOAuth"),{mode:"promise"}),s=er(e.onSubmit),[a,o]=E.useState(e.initialValue.name),[i,c]=E.useState(e.initialValue.service),[u,l]=E.useState(e.initialValue.version),[d,h]=E.useState(e.initialValue.discoveryUrl??""),[m,p]=E.useState(Y4e(e.initialValue.defaultHeaders)),[y,g]=E.useState(_j(e.initialValue.scopes)),[b,x]=E.useState(e.initialValue.auth.kind),[k,_]=E.useState(J4e(e.initialValue.auth)),[S,w]=E.useState(e.initialValue.auth.kind==="oauth2"?e.initialValue.auth.clientId:""),[T,A]=E.useState(Q4e(e.initialValue.auth)),[L,R]=E.useState(e.initialValue.auth.kind==="oauth2"?e.initialValue.auth:null),[j,F]=E.useState(null),[K,Y]=E.useState(e.initialValue.auth.kind==="oauth2"?"connected":"idle"),W=async()=>{if(t.status!=="ready")throw new Error("Workspace is still loading.");const J=ZV("executor-google-discovery-oauth");if(!J)throw new Error("Failed opening Google OAuth popup. Allow popups for this site and try again.");const ae={service:i.trim(),version:u.trim(),discoveryUrl:d.trim()||null,defaultHeaders:wj(m),scopes:Ej(y),clientId:S.trim(),clientSecretRef:T?JSON.parse(T):null,clientAuthentication:T?"client_secret_post":"none",redirectUrl:new URL(GV,window.location.origin).toString()};let ge;try{ge=await r({path:{workspaceId:t.data.scopeId},payload:ae})}catch(I){throw J.close(),I}J.location.replace(ge.authorizationUrl),J.focus();const le=await XV(ge.sessionId);if(!le.ok)throw new Error(le.error);if(le.mode!=="single")throw new Error("Unexpected batch OAuth result for single-source Google setup.");g(_j(le.auth.scopes)),R(le.auth),Y("connected")};return f.jsxs("div",{className:"space-y-6 rounded-lg border border-border bg-card p-6 text-sm ring-1 ring-foreground/[0.04]",children:[f.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[f.jsxs("div",{className:"grid gap-2 sm:col-span-2",children:[f.jsx(et,{children:"Name"}),f.jsx(_t,{value:a,onChange:J=>o(J.target.value)})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Service"}),f.jsx(_t,{value:i,onChange:J=>c(J.target.value)})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Version"}),f.jsx(_t,{value:u,onChange:J=>l(J.target.value)})]}),f.jsxs("div",{className:"grid gap-2 sm:col-span-2",children:[f.jsx(et,{children:"Discovery URL"}),f.jsx(_t,{value:d,onChange:J=>h(J.target.value),placeholder:of(i||"sheets",u||"v4"),className:"font-mono text-xs"})]})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Default Headers"}),f.jsx(Bc,{value:m,onChange:J=>p(J.target.value),rows:3})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Scopes"}),f.jsx(Bc,{value:y,onChange:J=>g(J.target.value),rows:3,placeholder:"Leave blank to infer from the discovery document."})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Auth"}),f.jsxs(Ea,{value:b,onChange:J=>x(J.target.value),children:[f.jsx("option",{value:"none",children:"None"}),f.jsx("option",{value:"bearer",children:"Bearer Secret"}),f.jsx("option",{value:"oauth2",children:"Google OAuth"})]})]}),b==="bearer"&&f.jsx("div",{className:"rounded-lg border border-border bg-muted/20 p-4",children:f.jsx(xm,{label:"Secret",value:k,emptyLabel:"Select a secret",draftNamePlaceholder:"Google bearer token",draftValuePlaceholder:"Paste the token value",onChange:_})}),b==="oauth2"&&f.jsxs("div",{className:"space-y-4 rounded-lg border border-border bg-muted/20 p-4",children:[f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Client ID"}),f.jsx(_t,{value:S,onChange:J=>w(J.target.value)})]}),f.jsx(xm,{label:"Client Secret",value:T,emptyLabel:"Public client / no secret",draftNamePlaceholder:"Google client secret",draftValuePlaceholder:"Paste the secret value",onChange:A}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(Te,{variant:"outline",type:"button",onClick:()=>{(async()=>{F(null),Y("pending");try{await W()}catch(J){F(J instanceof Error?J.message:"Google OAuth failed."),Y("idle");return}})()},disabled:K==="pending",children:K==="pending"?"Connecting...":K==="connected"?"Reconnect":"Connect with Google"}),K==="connected"&&f.jsx("span",{className:"text-xs text-primary",children:"Connected"})]})]}),j&&f.jsx(ts,{variant:"destructive",children:j}),f.jsx("div",{className:"flex items-center justify-end",children:f.jsx(Te,{type:"button",onClick:()=>{(async()=>{F(null);try{const J=b==="none"?{kind:"none"}:b==="bearer"?{kind:"bearer",tokenSecretRef:JSON.parse(k)}:L||(()=>{throw new Error("Complete Google sign-in before saving.")})();await s.mutateAsync({name:a.trim(),service:i.trim(),version:u.trim(),discoveryUrl:d.trim()||null,defaultHeaders:wj(m),scopes:Ej(y),auth:J})}catch(J){F(J instanceof Error?J.message:"Failed saving source.")}})()},disabled:s.status==="pending",children:s.status==="pending"?e.mode==="create"?"Creating...":"Saving...":e.mode==="create"?"Create Source":"Save Changes"})})]})}function Z4e(e){const t=Js(),n=Dp(),r=Dt(n.mutation(Ta,"startBatchOAuth"),{mode:"promise"}),[s,a]=E.useState([]),[o,i]=E.useState(""),[c,u]=E.useState(""),[l,d]=E.useState(null),[h,m]=E.useState("idle"),p=E.useMemo(()=>Rc.filter(b=>s.includes(b.id)),[s]),y=b=>{a(x=>x.includes(b)?x.filter(k=>k!==b):[...x,b])},g=async()=>{if(t.status!=="ready"){d("Workspace is still loading.");return}if(p.length===0){d("Select at least one Google API.");return}if(!o.trim()){d("Client ID is required for batch Google OAuth.");return}try{d(null),m("connecting");const b=ZV("executor-google-discovery-batch-oauth");if(!b)throw new Error("Failed opening Google OAuth popup. Allow popups for this site and try again.");let x;try{x=await r({path:{workspaceId:t.data.scopeId},payload:{sources:p.map(X4e),clientId:o.trim(),clientSecretRef:c?JSON.parse(c):null,clientAuthentication:c?"client_secret_post":"none",redirectUrl:new URL(GV,window.location.origin).toString()}})}catch(_){throw b.close(),_}b.location.replace(x.authorizationUrl),b.focus();const k=await XV(x.sessionId);if(!k.ok)throw new Error(k.error);if(k.mode!=="batch")throw new Error("Unexpected single-source OAuth result for Google batch setup.");a([]),e.onConnected(k.sources)}catch(b){d(b instanceof Error?b.message:"Failed connecting Google APIs.")}finally{m("idle")}};return f.jsxs("div",{className:"space-y-6 rounded-lg border border-border bg-card p-6 text-sm ring-1 ring-foreground/[0.04]",children:[f.jsxs("div",{children:[f.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Connect multiple Google APIs"}),f.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Select APIs below and connect them all with a single sign-in."})]}),f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("div",{className:"text-xs text-muted-foreground",children:p.length===0?"No Google APIs selected.":`${p.length} Google API${p.length===1?"":"s"} selected.`}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Te,{variant:"outline",size:"sm",type:"button",onClick:()=>a([]),children:"Clear"}),f.jsx(Te,{variant:"outline",size:"sm",type:"button",onClick:()=>a(s.length===Rc.length?[]:Rc.map(b=>b.id)),children:s.length===Rc.length?"Deselect all":"Select all"})]})]}),f.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:Rc.map(b=>{const x=s.includes(b.id),k=QV(b.service);return f.jsx(Te,{variant:"ghost",type:"button",onClick:()=>y(b.id),className:x?"h-auto whitespace-normal rounded-lg border border-primary/30 bg-primary/5 px-4 py-3 text-left":"h-auto whitespace-normal rounded-lg border border-border px-4 py-3 text-left hover:bg-accent/40",children:f.jsxs("div",{className:"flex items-start gap-3",children:[f.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:k?f.jsx("img",{src:k,alt:"",className:"size-5 object-contain"}):f.jsx("span",{className:"text-sm font-semibold text-muted-foreground",children:b.name.slice(0,1)})}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-sm font-semibold text-foreground",children:b.name}),f.jsxs("div",{className:"mt-0.5 text-[11px] text-muted-foreground",children:[b.service," ",b.version]})]}),f.jsx("div",{className:x?"mt-0.5 size-3 rounded-full bg-primary":"mt-0.5 size-3 rounded-full border border-border bg-background"})]}),f.jsx("div",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:b.summary})]})]})},b.id)})}),f.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[f.jsxs("div",{className:"grid gap-2 md:col-span-2",children:[f.jsx(et,{children:"Client ID"}),f.jsx(_t,{value:o,onChange:b=>i(b.target.value),placeholder:"1234567890-abcdef.apps.googleusercontent.com"})]}),f.jsx("div",{className:"md:col-span-2",children:f.jsx(xm,{label:"Client Secret",value:c,emptyLabel:"Public client / no secret",draftNamePlaceholder:"Google client secret",draftValuePlaceholder:"Paste the secret value",onChange:u})})]}),l&&f.jsx(ts,{variant:"destructive",children:l}),f.jsx("div",{className:"flex items-center justify-end gap-3",children:f.jsx(Te,{type:"button",onClick:()=>{g()},disabled:h==="connecting"||p.length===0||o.trim().length===0,children:h==="connecting"?"Connecting...":p.length>0?`Connect ${p.length} Google API${p.length===1?"":"s"}`:"Connect Google APIs"})})]})}function eFe(){const e=Qs(),t=W4e(nc()),n=Js(),r=Dp(),s=Dt(r.mutation(Ta,"createSource"),{mode:"promise"});return n.status!=="ready"?f.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading workspace..."}):f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:f.jsxs("div",{className:"mx-auto w-full max-w-3xl px-6 py-10",children:[f.jsxs("div",{className:"mb-8",children:[f.jsx("h1",{className:"font-display text-2xl tracking-tight text-foreground",children:"Add Google API Source"}),f.jsx("p",{className:"mt-1.5 text-sm leading-6 text-muted-foreground",children:"Connect Google Workspace and Cloud APIs via discovery documents."})]}),f.jsxs("div",{className:"space-y-6",children:[f.jsx(Z4e,{onConnected:a=>{E.startTransition(()=>{if(a.length===1){e.detail(a[0].id,{tab:"model"});return}e.home()})}}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(ij,{className:"flex-1"}),f.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"or add a single API"}),f.jsx(ij,{className:"flex-1"})]}),f.jsx(eG,{initialValue:t,mode:"create",onSubmit:async a=>{const o=await s({path:{workspaceId:n.data.scopeId},payload:a,reactivityKeys:{sources:[n.data.scopeId]}});E.startTransition(()=>{e.detail(o.id,{tab:"model"})})}})]})]})})}function tFe(e){const t=Qs(),n=Js(),r=Dp(),s=Qi(n.status==="ready"?r.query(Ta,"getSourceConfig",{path:{workspaceId:n.data.scopeId,sourceId:e.source.id},reactivityKeys:{source:[n.data.scopeId,e.source.id]},timeToLive:"30 seconds"}):r.query("local","installation",{timeToLive:"1 second"})),a=Dt(r.mutation(Ta,"updateSource"),{mode:"promise"});return n.status!=="ready"?f.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading workspace..."}):Kd(s)?f.jsx(ts,{variant:"destructive",children:"Failed loading source configuration."}):Ss(s)?f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:f.jsxs("div",{className:"mx-auto w-full max-w-3xl px-6 py-10",children:[f.jsxs("div",{className:"mb-8",children:[f.jsx("h1",{className:"font-display text-2xl tracking-tight text-foreground",children:"Edit Google API Source"}),f.jsxs("p",{className:"mt-1.5 text-sm leading-6 text-muted-foreground",children:["Update the connection settings for ",e.source.name,"."]})]}),f.jsx(eG,{initialValue:s.value,mode:"edit",onSubmit:async o=>{const i=await a({path:{workspaceId:n.data.scopeId,sourceId:e.source.id},payload:o,reactivityKeys:{sources:[n.data.scopeId],source:[n.data.scopeId,e.source.id],sourceInspection:[n.data.scopeId,e.source.id],sourceInspectionTool:[n.data.scopeId,e.source.id],sourceDiscovery:[n.data.scopeId,e.source.id]}});E.startTransition(()=>{t.detail(i.id,{tab:"model"})})}})]})}):f.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading configuration..."})}function nFe(e){const t=Qs(),n=Rk(nc()),r=Js(),s=Dp(),a=Dt(s.mutation(Ta,"removeSource"),{mode:"promise"}),[o,i]=E.useState(!1),[c,u]=E.useState(!1),l=Qi(r.status==="ready"?s.query(Ta,"getSourceConfig",{path:{workspaceId:r.data.scopeId,sourceId:e.source.id},reactivityKeys:{source:[r.data.scopeId,e.source.id]},timeToLive:"30 seconds"}):s.query("local","installation",{timeToLive:"1 second"})),d=E.useMemo(()=>{if(!Ss(l))return null;const m=l.value;return f.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[f.jsxs(Fn,{variant:"muted",children:[m.service," ",m.version]}),f.jsx("div",{className:"font-mono text-foreground",children:m.discoveryUrl??of(m.service,m.version)})]})},[l]);if(r.status!=="ready")return f.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading workspace..."});const h=async()=>{if(!c){u(!0);try{await a({path:{workspaceId:r.data.scopeId,sourceId:e.source.id},reactivityKeys:{sources:[r.data.scopeId],source:[r.data.scopeId,e.source.id],sourceInspection:[r.data.scopeId,e.source.id],sourceInspectionTool:[r.data.scopeId,e.source.id],sourceDiscovery:[r.data.scopeId,e.source.id]}}),E.startTransition(()=>{t.home()})}finally{u(!1),i(!1)}}};return f.jsx(Nk,{sourceId:e.source.id,title:e.source.name,kind:e.source.kind,search:n,navigate:m=>t.updateSearch(m),summary:d,actions:f.jsxs(f.Fragment,{children:[f.jsxs(Te,{variant:"outline",type:"button",onClick:()=>{t.edit(e.source.id)},children:[f.jsx(Im,{className:"size-3.5"}),"Edit"]}),o?f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-xs font-medium text-destructive",children:"Confirm delete?"}),f.jsx(Te,{variant:"outline",type:"button",onClick:()=>i(!1),disabled:c,children:"Cancel"}),f.jsx(Te,{variant:"destructive-outline",type:"button",onClick:()=>{h().catch(()=>{})},disabled:c,children:c?"Deleting...":"Delete"})]}):f.jsx(Te,{variant:"destructive-outline",type:"button",onClick:()=>i(!0),disabled:c,children:"Delete"})]})})}function tG(e){const t=Ep(),n=typeof t.sourceId=="string"?t.sourceId:null,r=Zx(n??"");return n===null||r.status==="error"?f.jsx("div",{className:"px-6 py-8 text-sm text-destructive",children:"This Google Discovery source is unavailable."}):r.status==="loading"?f.jsx("div",{className:"px-6 py-8 text-sm text-muted-foreground",children:"Loading source..."}):r.data.kind!==vj?f.jsxs("div",{className:"px-6 py-8 text-sm text-destructive",children:["Expected a `",vj,"` source, but received `",r.data.kind,"`."]}):e.children(r.data)}function rFe(){return f.jsx(tG,{children:e=>f.jsx(tFe,{source:e})})}function sFe(){return f.jsx(tG,{children:e=>f.jsx(nFe,{source:e})})}const aFe=_p({key:Ta,displayName:"Google Discovery",description:"Connect Google Workspace and Cloud APIs via discovery documents.",routes:[{key:"add",path:"add",component:Br(()=>eFe)},{key:"detail",path:"sources/$sourceId",component:Br(()=>sFe)},{key:"edit",path:"sources/$sourceId/edit",component:Br(()=>rFe)}]}),zE=e=>{if(e===null)return"—";const t=new Date(e),n=t.toLocaleString(void 0,{month:"short"}),r=t.getDate(),s=t.getHours().toString().padStart(2,"0"),a=t.getMinutes().toString().padStart(2,"0"),o=t.getSeconds().toString().padStart(2,"0");return`${n} ${r}, ${s}:${a}:${o}`},oFe=e=>{if(e.startedAt===null||e.completedAt===null)return null;const t=Math.max(0,e.completedAt-e.startedAt);return t<1e3?`${t}ms`:t<6e4?`${(t/1e3).toFixed(1)}s`:`${(t/6e4).toFixed(1)}m`},iFe=(e,t=80)=>e.trim().replace(/\s+/g," ").slice(0,t),uy=e=>{if(e===null)return null;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}},nG={completed:{dot:"bg-primary",text:"text-primary"},failed:{dot:"bg-destructive",text:"text-destructive"},running:{dot:"bg-blue-400 animate-pulse",text:"text-blue-400"},waiting_for_interaction:{dot:"bg-amber-400 animate-pulse",text:"text-amber-400"},pending:{dot:"bg-muted",text:"text-muted-foreground"},cancelled:{dot:"bg-muted",text:"text-muted-foreground"}},rG=e=>nG[e].dot,cFe=e=>nG[e].text,uFe=[{value:"all",label:"All"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"},{value:"running",label:"Running"},{value:"waiting_for_interaction",label:"Waiting"},{value:"pending",label:"Pending"},{value:"cancelled",label:"Cancelled"}],lFe=e=>e.startedAt===null||e.completedAt===null?null:Math.max(0,e.completedAt-e.startedAt).toLocaleString(),dFe=e=>{const{execution:t,isSelected:n}=e,r=lFe(t);return f.jsxs("button",{type:"button",onClick:e.onSelect,className:gt("group flex w-full items-start gap-3 border-b border-border/50 px-4 py-2 text-left font-mono text-xs transition-colors hover:bg-white/[0.04]",n&&"bg-white/[0.06]"),children:[f.jsx("span",{className:gt("mt-1.5 size-2 shrink-0 rounded-full",rG(t.status))}),f.jsx("span",{className:"w-[120px] shrink-0 tabular-nums text-muted-foreground",children:zE(t.createdAt)}),f.jsxs("span",{className:"inline-flex w-[130px] shrink-0",children:[f.jsx("span",{className:"text-muted-foreground/60",children:"status:"}),f.jsx("span",{className:cFe(t.status),children:t.status.replaceAll("_"," ")})]}),f.jsxs("span",{className:"inline-flex w-[150px] shrink-0",children:[f.jsx("span",{className:"text-muted-foreground/60",children:"duration_ms:"})," ",f.jsx("span",{className:r&&Number(r.replace(/,/g,""))>5e3?"text-destructive":"text-primary",children:r??"—"})]}),f.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[f.jsx("span",{className:"text-muted-foreground/60",children:"code:"})," ",f.jsxs("span",{className:"text-muted-foreground",children:['"',iFe(t.code,120),'…"']})]})]})},c1=e=>f.jsx("button",{type:"button",onClick:e.onClick,className:gt("px-3 py-1.5 text-sm font-medium transition-colors",e.active?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"),children:e.label}),sG=e=>{const{execution:t,pendingInteraction:n}=e.envelope;return f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[f.jsxs("div",{className:"rounded-lg border border-border/50 px-3 py-2",children:[f.jsx("div",{className:"text-[10px] font-medium uppercase tracking-wider text-muted-foreground/70",children:"Status"}),f.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[f.jsx("span",{className:gt("size-2 rounded-full",rG(t.status))}),f.jsx("span",{className:"text-sm",children:t.status.replaceAll("_"," ")})]})]}),f.jsxs("div",{className:"rounded-lg border border-border/50 px-3 py-2",children:[f.jsx("div",{className:"text-[10px] font-medium uppercase tracking-wider text-muted-foreground/70",children:"Duration"}),f.jsx("div",{className:"mt-1 text-sm",children:oFe(t)??"—"})]})]}),f.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs text-muted-foreground",children:[f.jsxs("div",{children:[f.jsx("span",{className:"text-muted-foreground/60",children:"Created "}),zE(t.createdAt)]}),f.jsxs("div",{children:[f.jsx("span",{className:"text-muted-foreground/60",children:"Started "}),zE(t.startedAt)]})]}),f.jsx(hs,{title:"Code",body:t.code,lang:"ts",empty:"No code captured."}),f.jsx(hs,{title:"Result",body:uy(t.resultJson),lang:"json",empty:"No result recorded."}),t.errorText&&f.jsx(hs,{title:"Error",body:t.errorText,lang:"text",empty:"No error recorded."}),n&&f.jsxs("div",{className:"space-y-3",children:[f.jsxs("div",{className:"text-sm font-medium text-foreground",children:["Pending interaction",f.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:[n.kind," — ",n.purpose]})]}),f.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[f.jsx(hs,{title:"Request",body:uy(n.payloadJson),lang:"json",empty:"No interaction request recorded."}),f.jsx(hs,{title:"Response",body:uy(n.responseJson),lang:"json",empty:"No interaction response recorded."})]})]})]})},aG=e=>{const t=E.useMemo(()=>{if(!e.logsJson)return null;try{const n=JSON.parse(e.logsJson);return Array.isArray(n)?n:null}catch{return null}},[e.logsJson]);return t?f.jsxs("div",{className:"rounded-lg border border-border/50 bg-card/40 p-3",children:[f.jsx("div",{className:"mb-2 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/70",children:"Logs"}),f.jsx("div",{className:"space-y-0.5 font-mono text-xs",children:t.map((n,r)=>{const s=typeof n=="string"&&/\[error]/i.test(n),a=typeof n=="string"&&/\[warn]/i.test(n),o=typeof n=="string"?`line-${r}-${n.slice(0,50).replace(/\s+/g,"-")}`:`line-${r}-${JSON.stringify(n).slice(0,50)}`;return f.jsx("div",{className:gt("whitespace-pre-wrap break-all",s&&"text-red-400",a&&"text-amber-400",!s&&!a&&"text-foreground/80"),children:typeof n=="string"?n:JSON.stringify(n)},o)})})]}):f.jsx(hs,{title:"Logs",body:uy(e.logsJson),lang:"json",empty:"No logs recorded."})},fFe=e=>{const[t,n]=E.useState("properties"),r=oz(e.executionId),[s,a]=E.useState(!1),o=E.useCallback(i=>{const c=l=>{if(l===null)return null;try{return JSON.parse(l)}catch{return l}},u={...i,execution:{...i.execution,resultJson:c(i.execution.resultJson),logsJson:c(i.execution.logsJson),errorText:i.execution.errorText}};navigator.clipboard.writeText(JSON.stringify(u,null,2)).then(()=>{a(!0),setTimeout(()=>a(!1),1500)})},[]);return f.jsx(_4e,{open:!0,onOpenChange:i=>!i&&e.onClose(),children:f.jsxs(E4e,{children:[f.jsx(T4e,{}),f.jsxs(C4e,{className:"fixed inset-y-0 right-0 z-50 flex w-full max-w-3xl flex-col bg-popover text-popover-foreground ring-1 ring-foreground/10 outline-none duration-150 data-open:animate-in data-open:slide-in-from-right data-closed:animate-out data-closed:slide-out-to-right",children:[f.jsxs("div",{className:"flex items-center justify-between border-b border-border/50 px-5 py-3",children:[f.jsx("div",{className:"min-w-0",children:f.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:e.executionId})}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(bd,{loadable:r,loading:"",children:i=>f.jsx(Te,{variant:"ghost",size:"sm",onClick:()=>o(i),className:"text-xs text-muted-foreground",children:s?"Copied":"Copy JSON"})}),f.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:e.onClose,children:f.jsx(n7,{className:"size-3.5"})})]})]}),f.jsxs("div",{className:"flex gap-1 border-b border-border/50 px-5",children:[f.jsx(c1,{label:"Properties",active:t==="properties",onClick:()=>n("properties")}),f.jsx(c1,{label:"Logs",active:t==="logs",onClick:()=>n("logs")})]}),f.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:f.jsx(bd,{loadable:r,loading:"Loading execution...",children:i=>t==="properties"?f.jsx(sG,{envelope:i}):f.jsx(aG,{logsJson:i.execution.logsJson})})})]})]})})};function hFe(){const e=bve(),t=i2(),n=yz(),[r,s]=E.useState("all"),[a,o]=E.useState(""),i=typeof n.executionId=="string"?n.executionId:null,c=E.useCallback(l=>{if(l===null){const{executionId:d,...h}=n;t.updateSearch(h);return}t.updateSearch({...n,executionId:l})},[t,n]),u=E.useMemo(()=>{if(e.status!=="ready")return[];let l=[...e.data];if(r!=="all"&&(l=l.filter(d=>d.status===r)),a.trim()){const d=a.toLowerCase();l=l.filter(h=>h.code.toLowerCase().includes(d)||h.errorText&&h.errorText.toLowerCase().includes(d))}return l},[e,r,a]);return f.jsxs("div",{className:"flex h-full flex-col",children:[f.jsxs("div",{className:"shrink-0 border-b border-border/50 px-6 py-5",children:[f.jsx("h1",{className:"font-display text-2xl tracking-tight text-foreground",children:"Execution history"}),f.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Every execution recorded for this workspace, newest first."}),f.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[f.jsx(Ea,{value:r,onChange:l=>s(l.target.value),className:"w-[140px]",children:uFe.map(l=>f.jsx("option",{value:l.value,children:l.label},l.value))}),f.jsx(_t,{type:"text",placeholder:"Search code or errors...",value:a,onChange:l=>o(l.target.value),className:"flex-1"})]})]}),f.jsxs("div",{className:"flex items-center gap-3 border-b border-border/50 px-4 py-1.5 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/60",children:[f.jsx("span",{className:"size-2 shrink-0"}),f.jsx("span",{className:"w-[120px] shrink-0",children:"_time"}),f.jsx("span",{children:"Raw Data"})]}),f.jsx("div",{className:"flex-1 overflow-y-auto",children:f.jsx(bd,{loadable:e,loading:"Loading executions...",children:()=>u.length===0?f.jsx("div",{className:"py-20",children:f.jsx(a7,{title:r!=="all"||a.trim()?"No matching executions":"No executions yet",description:r!=="all"||a.trim()?"Try adjusting your filters.":"Run something and it will show up here."})}):f.jsx("div",{children:u.map(l=>f.jsx(dFe,{execution:l,isSelected:i===l.id,onSelect:()=>c(i===l.id?null:l.id)},l.id))})})}),i&&f.jsx(fFe,{executionId:i,onClose:()=>c(null)})]})}const mFe=e=>{const[t,n]=E.useState("properties");return f.jsxs("div",{children:[f.jsxs("div",{className:"mb-4 flex gap-1 border-b border-border/50",children:[f.jsx(c1,{label:"Properties",active:t==="properties",onClick:()=>n("properties")}),f.jsx(c1,{label:"Logs",active:t==="logs",onClick:()=>n("logs")})]}),t==="properties"?f.jsx(sG,{envelope:e.envelope}):f.jsx(aG,{logsJson:e.envelope.execution.logsJson})]})};function pFe(){const{executionId:e}=xz(),t=i2(),n=oz(e);return f.jsx("div",{className:"h-full overflow-y-auto",children:f.jsxs("div",{className:"mx-auto max-w-5xl px-6 py-10 lg:px-10 lg:py-14",children:[f.jsxs("div",{className:"mb-8",children:[f.jsx(Te,{variant:"ghost",type:"button",onClick:()=>{t.route()},className:"mb-3 h-auto p-0 text-xs font-medium uppercase tracking-wider text-muted-foreground transition-colors hover:text-foreground",children:"Back to history"}),f.jsx("div",{className:"flex items-center gap-3",children:f.jsx("h1",{className:"font-display text-2xl tracking-tight text-foreground lg:text-3xl",children:e})})]}),f.jsx(bd,{loadable:n,loading:"Loading execution...",children:r=>f.jsx(mFe,{envelope:r})})]})})}const gFe=_p({key:"execution-history",displayName:"Execution History",description:"Browse previous executions for this workspace.",routes:[{key:"history",component:Br(()=>hFe),nav:{label:"Runs",section:"main"}},{key:"detail",path:"$executionId",component:Br(()=>pFe)}]}),oG=tn(q({kind:ie("none")}),q({kind:ie("bearer"),tokenSecretRef:hr,headerName:ne(C),prefix:ne(C)})),iG=q({name:C,endpoint:C,defaultHeaders:ne(Zn),auth:oG}),HE=iG;q({sourceId:C,config:HE});q({endpoint:C,defaultHeaders:ne(Zn),auth:oG});const kb=gn("workspaceId",mr),GS=gn("sourceId",Zi),cG=Xi("graphql").add(Dn("createSource")`/workspaces/${kb}/plugins/graphql/sources`.setPayload(iG).addSuccess(ks).addError(Je).addError(ft).addError(He)).add(Jn("getSourceConfig")`/workspaces/${kb}/plugins/graphql/sources/${GS}`.addSuccess(HE).addError(Je).addError(ft).addError(kt).addError(He)).add(Dx("updateSource")`/workspaces/${kb}/plugins/graphql/sources/${GS}`.setPayload(HE).addSuccess(ks).addError(Je).addError(ft).addError(kt).addError(He)).add(Bi("removeSource")`/workspaces/${kb}/plugins/graphql/sources/${GS}`.addSuccess(q({removed:Ke})).addError(Je).addError(ft).addError(kt).addError(He)).prefix("/v1"),bFe={key:"graphql",group:cG};yp().add(cG);const gA=Qx()("GraphqlReactHttpClient",[bFe]),yFe=()=>({name:"My GraphQL Source",endpoint:"https://example.com/graphql",defaultHeaders:null,auth:{kind:"none"}}),qE="Authorization",u1="Bearer ",uG=(e,t)=>{const n=e[t];return typeof n=="string"&&n.trim().length>0?n.trim():null},xFe=(e,t)=>{for(const n of t){const r=uG(e,n);if(r)return r}return null},kFe=e=>{const t=yFe();return{...t,name:uG(e,"presetName")??t.name,endpoint:xFe(e,["presetEndpoint","endpoint","inputUrl","pastedUrl","url"])??t.endpoint}},vFe=e=>{const t=e.trim();if(!t)return null;const n=JSON.parse(t);if(n===null||typeof n!="object"||Array.isArray(n))throw new Error("Headers must be a JSON object.");const r=Object.entries(n);if(!r.every(([,s])=>typeof s=="string"))throw new Error("All header values must be strings.");return Object.fromEntries(r)},SFe=e=>!e||Object.keys(e).length===0?"":JSON.stringify(e,null,2),wFe=e=>e.kind==="bearer"?JSON.stringify(e.tokenSecretRef):"",_Fe=e=>e.kind==="bearer"&&e.headerName?.trim()||qE,EFe=e=>e.kind==="bearer"?e.prefix??u1:u1,TFe=e=>{const t=e.trim();return t.length>0?t:null},CFe=(e,t,n,r)=>{if(e==="none")return{kind:"none"};if(!t)throw new Error("Select a secret for bearer auth.");return{kind:"bearer",tokenSecretRef:JSON.parse(t),headerName:TFe(n),prefix:r===u1?null:r}},IFe=e=>`tool/${encodeURIComponent(e)}`,AFe=e=>{if(!e.toolPath||e.toolPath.length===0)return null;try{return decodeURIComponent(e.toolPath)}catch{return e.toolPath}};function lG(e){const t=er(e.onSubmit),[n,r]=E.useState(e.initialValue.name),[s,a]=E.useState(e.initialValue.endpoint),[o,i]=E.useState(SFe(e.initialValue.defaultHeaders)),[c,u]=E.useState(e.initialValue.auth.kind),[l,d]=E.useState(wFe(e.initialValue.auth)),[h,m]=E.useState(_Fe(e.initialValue.auth)),[p,y]=E.useState(EFe(e.initialValue.auth)),[g,b]=E.useState(null);return f.jsxs("div",{className:"space-y-6 rounded-lg border border-border bg-card p-6 text-sm ring-1 ring-foreground/[0.04]",children:[f.jsxs("div",{className:"grid gap-4",children:[f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Name"}),f.jsx(_t,{value:n,onChange:x=>r(x.target.value)})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Endpoint"}),f.jsx(_t,{value:s,onChange:x=>a(x.target.value),className:"font-mono text-xs"})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Default Headers"}),f.jsx(Bc,{value:o,onChange:x=>i(x.target.value),rows:3,placeholder:'{"x-api-version":"2026-03-23"}'})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Auth"}),f.jsxs(Ea,{value:c,onChange:x=>u(x.target.value),children:[f.jsx("option",{value:"none",children:"None"}),f.jsx("option",{value:"bearer",children:"Bearer Secret"})]})]}),c==="bearer"&&f.jsxs("div",{className:"space-y-4 rounded-lg border border-border bg-muted/20 p-4",children:[f.jsx(xm,{label:"Secret",value:l,emptyLabel:"Select a secret",draftNamePlaceholder:"GraphQL bearer token",draftValuePlaceholder:"Paste the token value",onChange:d}),f.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Header Name"}),f.jsx(_t,{value:h,onChange:x=>m(x.target.value),placeholder:qE,className:"font-mono text-xs"})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Prefix"}),f.jsx(_t,{value:p,onChange:x=>y(x.target.value),placeholder:u1,className:"font-mono text-xs"})]})]})]})]}),g&&f.jsx(ts,{variant:"destructive",children:g}),f.jsx("div",{className:"flex items-center justify-end",children:f.jsx(Te,{type:"button",onClick:()=>{(async()=>{b(null);try{await t.mutateAsync({name:n.trim(),endpoint:s.trim(),defaultHeaders:vFe(o),auth:CFe(c,l,h,p)})}catch(x){b(x instanceof Error?x.message:"Failed saving GraphQL source.")}})()},disabled:t.status==="pending",children:t.status==="pending"?e.mode==="create"?"Creating...":"Saving...":e.mode==="create"?"Create Source":"Save Changes"})})]})}function NFe(){const e=Qs(),t=kFe(nc()),n=Js(),r=gA(),s=Dt(r.mutation("graphql","createSource"),{mode:"promise"});return n.status!=="ready"?f.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading workspace..."}):f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:f.jsxs("div",{className:"mx-auto w-full max-w-3xl px-6 py-10",children:[f.jsxs("div",{className:"mb-8",children:[f.jsx("h1",{className:"font-display text-2xl tracking-tight text-foreground",children:"Add GraphQL Source"}),f.jsx("p",{className:"mt-1.5 text-sm leading-6 text-muted-foreground",children:"Connect a GraphQL endpoint and expose its operations as tools."})]}),f.jsx(lG,{initialValue:t,mode:"create",onSubmit:async a=>{const o=await s({path:{workspaceId:n.data.scopeId},payload:a,reactivityKeys:{sources:[n.data.scopeId]}});E.startTransition(()=>{e.detail(o.id,{tab:"model"})})}})]})})}function RFe(e){const t=Qs(),n=Js(),r=gA(),s=Qi(n.status==="ready"?r.query("graphql","getSourceConfig",{path:{workspaceId:n.data.scopeId,sourceId:e.source.id},reactivityKeys:{source:[n.data.scopeId,e.source.id]},timeToLive:"30 seconds"}):r.query("local","installation",{timeToLive:"1 second"})),a=Dt(r.mutation("graphql","updateSource"),{mode:"promise"});return n.status!=="ready"?f.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading workspace..."}):Kd(s)?f.jsx(ts,{variant:"destructive",children:"Failed loading source configuration."}):Ss(s)?f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:f.jsxs("div",{className:"mx-auto w-full max-w-3xl px-6 py-10",children:[f.jsxs("div",{className:"mb-8",children:[f.jsx("h1",{className:"font-display text-2xl tracking-tight text-foreground",children:"Edit GraphQL Source"}),f.jsxs("p",{className:"mt-1.5 text-sm leading-6 text-muted-foreground",children:["Update the connection settings for ",e.source.name,"."]})]}),f.jsx(lG,{initialValue:s.value,mode:"edit",onSubmit:async o=>{const i=await a({path:{workspaceId:n.data.scopeId,sourceId:e.source.id},payload:o,reactivityKeys:{sources:[n.data.scopeId],source:[n.data.scopeId,e.source.id],sourceInspection:[n.data.scopeId,e.source.id],sourceInspectionTool:[n.data.scopeId,e.source.id],sourceDiscovery:[n.data.scopeId,e.source.id]}});E.startTransition(()=>{t.detail(i.id,{tab:"model"})})}})]})}):f.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading configuration..."})}function dG(e){const t=Qs(),n=Rk(nc()),r=Js(),s=gA(),a=Dt(s.mutation("graphql","removeSource"),{mode:"promise"}),o=Qi(r.status==="ready"?s.query("graphql","getSourceConfig",{path:{workspaceId:r.data.scopeId,sourceId:e.source.id},reactivityKeys:{source:[r.data.scopeId,e.source.id]},timeToLive:"30 seconds"}):s.query("local","installation",{timeToLive:"1 second"})),i=n.tab==="discover"?"discover":"model",c=n.query??"",u=e.selectedToolPath??n.tool??null,[l,d]=E.useState(!1),[h,m]=E.useState(!1);if(r.status!=="ready")return f.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading workspace..."});const p=x=>{const k=x.tab??i,_=x.query??c,S=x.tool??u,w={tab:k,..._?{query:_}:{},...k==="discover"&&S?{tool:S}:{}};return k==="discover"?t.detail(e.source.id,w):S?t.child({sourceId:e.source.id,path:IFe(S),search:w}):t.detail(e.source.id,w)},y=async()=>{if(!h){m(!0);try{await a({path:{workspaceId:r.data.scopeId,sourceId:e.source.id},reactivityKeys:{sources:[r.data.scopeId],source:[r.data.scopeId,e.source.id],sourceInspection:[r.data.scopeId,e.source.id],sourceInspectionTool:[r.data.scopeId,e.source.id],sourceDiscovery:[r.data.scopeId,e.source.id]}}),E.startTransition(()=>{t.home()})}finally{m(!1),d(!1)}}},g=Ss(o)?o.value:null;if(e.source.status==="auth_required"||e.source.status==="error"){const x=e.source.status==="auth_required"?"Credentials required":"Source needs attention",k=e.source.status==="auth_required"?"This endpoint requires credentials before its schema can be introspected. Edit the source, configure bearer auth, and save again.":"This source could not be indexed successfully. Edit the configuration and save again to rebuild its catalog.";return f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:f.jsx("div",{className:"mx-auto w-full max-w-3xl px-6 py-10",children:f.jsxs(ac,{className:"space-y-6 p-6",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("h1",{className:"font-display text-2xl tracking-tight text-foreground",children:x}),f.jsx(Fn,{variant:"outline",children:e.source.status})]}),f.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:k})]}),g?f.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[f.jsx("span",{className:"font-mono text-foreground",children:g.endpoint}),f.jsxs(Fn,{variant:"muted",children:["Auth: ",g.auth.kind]})]}):null,f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsxs(Te,{variant:"outline",size:"sm",onClick:()=>{t.edit(e.source.id)},children:[f.jsx(Im,{className:"size-3"}),"Edit"]}),l?f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-[11px] font-medium text-destructive",children:"Confirm delete?"}),f.jsx(Te,{variant:"outline",size:"sm",onClick:()=>d(!1),disabled:h,children:"Cancel"}),f.jsx(Te,{variant:"destructive-outline",size:"sm",onClick:()=>{y().catch(()=>{})},disabled:h,children:h?"Deleting...":"Delete"})]}):f.jsx(Te,{variant:"destructive-outline",size:"sm",onClick:()=>d(!0),disabled:h,children:"Delete"})]})]})})})}return f.jsx(Nk,{sourceId:e.source.id,title:e.source.name,kind:e.source.kind,search:n,selectedToolPath:u,navigate:x=>p(x),summary:g?f.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[f.jsx("span",{className:"font-mono text-foreground",children:g.endpoint}),f.jsxs(Fn,{variant:"muted",children:["Auth: ",g.auth.kind]})]}):void 0,actions:f.jsxs(f.Fragment,{children:[f.jsxs(Te,{variant:"outline",size:"sm",onClick:()=>{t.edit(e.source.id)},children:[f.jsx(Im,{className:"size-3"}),"Edit"]}),l?f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-[11px] font-medium text-destructive",children:"Confirm delete?"}),f.jsx(Te,{variant:"outline",size:"sm",onClick:()=>d(!1),disabled:h,children:"Cancel"}),f.jsx(Te,{variant:"destructive-outline",size:"sm",onClick:()=>{y().catch(()=>{})},disabled:h,children:h?"Deleting...":"Delete"})]}):f.jsx(Te,{variant:"destructive-outline",size:"sm",onClick:()=>d(!0),disabled:h,children:"Delete"})]}),renderHeaderMeta:PFe})}const PFe=e=>{const t=e.summary.group&&e.summary.group.toLowerCase()!==e.summary.method?.toLowerCase()?e.summary.group:null;return f.jsxs(f.Fragment,{children:[t&&f.jsx(Fn,{variant:"outline",children:t}),e.summary.protocol&&f.jsx(Fn,{variant:"muted",children:e.summary.protocol})]})};function OFe(e){return f.jsx(dG,{source:e.source,selectedToolPath:null})}function LFe(e){const t=Ep();return f.jsx(dG,{source:e.source,selectedToolPath:AFe(t)})}function bA(e){const t=Ep(),n=typeof t.sourceId=="string"?t.sourceId:null,r=Zx(n??"");return n===null?f.jsx("div",{className:"px-6 py-8 text-sm text-destructive",children:"This GraphQL source is unavailable."}):r.status==="loading"?f.jsx("div",{className:"px-6 py-8 text-sm text-muted-foreground",children:"Loading source..."}):r.status==="error"?f.jsx("div",{className:"px-6 py-8 text-sm text-destructive",children:"Failed loading this GraphQL source."}):r.data.kind!=="graphql"?f.jsxs("div",{className:"px-6 py-8 text-sm text-destructive",children:["Expected a `graphql` source, but received `",r.data.kind,"`."]}):e.children(r.data)}function $Fe(){return f.jsx(bA,{children:e=>f.jsx(OFe,{source:e})})}function jFe(){return f.jsx(bA,{children:e=>f.jsx(RFe,{source:e})})}function MFe(){return f.jsx(bA,{children:e=>f.jsx(LFe,{source:e})})}const DFe=_p({key:"graphql",displayName:"GraphQL",description:"Introspect a GraphQL endpoint into typed query and mutation tools.",routes:[{key:"add",path:"add",component:Br(()=>NFe)},{key:"detail",path:"sources/$sourceId",component:Br(()=>$Fe)},{key:"edit",path:"sources/$sourceId/edit",component:Br(()=>jFe)},{key:"tool-detail",path:"sources/$sourceId/tool/$toolPath",component:Br(()=>MFe)}]}),fG=tn(q({kind:ie("none")}),q({kind:ie("oauth2"),redirectUri:C,accessTokenRef:hr,refreshTokenRef:ne(hr),tokenType:C,expiresAt:ne(it),scope:ne(C),resourceMetadataUrl:ne(C),authorizationServerUrl:ne(C),resourceMetadata:ne($o),authorizationServerMetadata:ne($o),clientInformation:ne($o)})),hG=q({name:C,endpoint:ne(C),transport:ne(XI),queryParams:ne(Zn),headers:ne(Zn),command:ne(C),args:ne(FU),env:ne(Zn),cwd:ne(C),auth:fG}),VE=hG;q({sourceId:C,config:VE});q({endpoint:ne(C),transport:ne(XI),queryParams:ne(Zn),headers:ne(Zn),command:ne(C),args:ne(FU),env:ne(Zn),cwd:ne(C),auth:fG});const FFe=q({endpoint:C,queryParams:ne(Zn),redirectUrl:C}),BFe=q({endpoint:C,queryParams:H(ne(Zn)),probeAuth:H(ne(Mxe))}),UFe=ne(Fxe),zFe=q({sessionId:C,authorizationUrl:C});q({endpoint:C,redirectUrl:C,codeVerifier:C,resourceMetadataUrl:ne(C),authorizationServerUrl:ne(C),resourceMetadata:ne($o),authorizationServerMetadata:ne($o),clientInformation:ne($o)});const HFe=q({kind:ie("oauth2"),redirectUri:C,accessTokenRef:hr,refreshTokenRef:ne(hr),tokenType:C,expiresAt:ne(it),scope:ne(C),resourceMetadataUrl:ne(C),authorizationServerUrl:ne(C),resourceMetadata:ne($o),authorizationServerMetadata:ne($o),clientInformation:ne($o)});tn(q({type:ie("executor:oauth-result"),ok:ie(!0),sessionId:C,auth:HFe}),q({type:ie("executor:oauth-result"),ok:ie(!1),sessionId:Nx,error:C}));const xc=gn("workspaceId",mr),vb=gn("sourceId",Zi),qFe=DB({contentType:"text/html"}),VFe=q({state:C,code:H(C),error:H(C),error_description:H(C)}),mG=Xi("mcp").add(Dn("createSource")`/workspaces/${xc}/plugins/mcp/sources`.setPayload(hG).addSuccess(ks).addError(Je).addError(ft).addError(He)).add(Dn("discoverSource")`/workspaces/${xc}/plugins/mcp/discover`.setPayload(BFe).addSuccess(UFe).addError(Je).addError(ft).addError(He)).add(Jn("getSourceConfig")`/workspaces/${xc}/plugins/mcp/sources/${vb}`.addSuccess(VE).addError(Je).addError(ft).addError(kt).addError(He)).add(Dx("updateSource")`/workspaces/${xc}/plugins/mcp/sources/${vb}`.setPayload(VE).addSuccess(ks).addError(Je).addError(ft).addError(kt).addError(He)).add(Dn("refreshSource")`/workspaces/${xc}/plugins/mcp/sources/${vb}/refresh`.addSuccess(ks).addError(Je).addError(ft).addError(kt).addError(He)).add(Bi("removeSource")`/workspaces/${xc}/plugins/mcp/sources/${vb}`.addSuccess(q({removed:Ke})).addError(Je).addError(ft).addError(kt).addError(He)).add(Dn("startOAuth")`/workspaces/${xc}/plugins/mcp/oauth/start`.setPayload(FFe).addSuccess(zFe).addError(Je).addError(ft).addError(He)).add(Jn("oauthCallback")`/plugins/mcp/oauth/callback`.setUrlParams(VFe).addSuccess(qFe).addError(Je).addError(He)).prefix("/v1"),GFe={key:"mcp",group:mG};yp().add(mG);const pG=(e="")=>({transport:e,queryParamsText:"",headersText:""}),gG=e=>({transport:"stdio",command:e?.command??"",argsText:e?.argsText??"",envText:e?.envText??"",cwd:e?.cwd??""}),KFe=e=>e==="stdio"?"auto":e??"",WFe=(e,t)=>t==="stdio"?e.transport==="stdio"?e:gG():e.transport==="stdio"?pG(t):{...e,transport:t},bG=(e,t)=>{const n=t.trim();if(n.length===0)return null;try{return JSON.parse(n)}catch(r){const s=r instanceof Error?r.message:"Invalid JSON.";throw new Error(`${e} is invalid: ${s}`)}},wc=(e,t)=>{const n=bG(e,t);if(n===null)return null;if(typeof n!="object"||Array.isArray(n))throw new Error(`${e} must be a JSON object.`);const r=Object.entries(n);if(!r.every(([,s])=>typeof s=="string"))throw new Error(`${e} must only contain string values.`);return r.length>0?Object.fromEntries(r):null},yG=(e,t)=>{const n=bG(e,t);if(n===null)return null;if(!Array.isArray(n)||!n.every(s=>typeof s=="string"))throw new Error(`${e} must be a JSON array of strings.`);const r=n.map(s=>s.trim()).filter(s=>s.length>0);return r.length>0?r:null},KS=e=>{if(e.transport==="stdio")return null;const t=e.endpoint.trim();if(t.length===0)return null;const n=new URL(t);for(const[r,s]of Object.entries(e.queryParams??{}))n.searchParams.set(r,s);return n.toString()},YFe=e=>e?.authInference.supported===!0&&e.authInference.suggestedKind==="oauth2",JFe="executor:mcp-oauth:",QFe=2*6e4,Ok=Qx()("McpReactHttpClient",[GFe]),XFe=()=>({name:"My MCP Source",endpoint:"https://example.com/mcp",transport:"auto",queryParams:null,headers:null,command:null,args:null,env:null,cwd:null,auth:{kind:"none"}}),zc=(e,t)=>{const n=e[t];return typeof n=="string"&&n.trim().length>0?n.trim():null},ZFe=e=>{const t=zc(e,"presetTransport");return t==="auto"||t==="streamable-http"||t==="sse"||t==="stdio"?t:null},WS=(e,t)=>{const n=zc(e,t);return n?wc(t,n):null},e8e=(e,t)=>{const n=zc(e,t);return n?yG(t,n):null},t8e=e=>{const t=XFe(),n=zc(e,"presetCommand"),r=e8e(e,"presetArgs"),s=WS(e,"presetEnv"),a=zc(e,"presetCwd"),o=WS(e,"presetQueryParams"),i=WS(e,"presetHeaders"),c=ZFe(e)??(n?"stdio":t.transport);return{...t,name:zc(e,"presetName")??t.name,endpoint:n?null:zc(e,"presetEndpoint")??t.endpoint,transport:c,queryParams:o,headers:i,command:n,args:r,env:s,cwd:a}},YS=e=>!e||Object.keys(e).length===0?"":JSON.stringify(e,null,2),n8e=e=>!e||e.length===0?"":JSON.stringify(e,null,2),r8e=e=>e.transport==="stdio"||e.command?gG({command:e.command??"",argsText:n8e(e.args),envText:YS(e.env),cwd:e.cwd??""}):{...pG(KFe(e.transport)),queryParamsText:YS(e.queryParams),headersText:YS(e.headers)},s8e=async e=>new Promise((t,n)=>{const r=`${JFe}${e}`,s=Date.now(),a=()=>{window.removeEventListener("message",i),window.clearInterval(c)},o=u=>{a();try{window.localStorage.removeItem(r)}catch{}t(u)},i=u=>{if(u.origin!==window.location.origin)return;const l=u.data;!l||l.type!=="executor:oauth-result"||l.ok&&l.sessionId!==e||o(l)};window.addEventListener("message",i);const c=window.setInterval(()=>{if(Date.now()-s>QFe){a(),n(new Error("Timed out waiting for MCP OAuth to finish."));return}try{const u=window.localStorage.getItem(r);if(!u)return;o(JSON.parse(u))}catch{}},400)}),a8e=()=>{const e=window.open("","executor-mcp-oauth","width=560,height=760");if(!e)return null;try{e.document.title="Connecting",e.document.body.innerHTML=`
|
|
332
|
-
<main style="font-family: system-ui, -apple-system, sans-serif; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; margin: 0; color: #333;">
|
|
333
|
-
<div style="width: 20px; height: 20px; border: 2px solid #e5e7eb; border-top-color: #6366f1; border-radius: 50%; animation: spin 0.7s linear infinite; margin-bottom: 16px;"></div>
|
|
334
|
-
<p style="margin: 0; font-size: 14px; color: #888;">Redirecting to sign in…</p>
|
|
335
|
-
<style>
|
|
336
|
-
@keyframes spin { to { transform: rotate(360deg); } }
|
|
337
|
-
@media (prefers-color-scheme: dark) {
|
|
338
|
-
main { background: #09090b; color: #fafafa !important; }
|
|
339
|
-
p { color: #a1a1aa !important; }
|
|
340
|
-
div { border-color: #3f3f46 !important; }
|
|
341
|
-
}
|
|
342
|
-
</style>
|
|
343
|
-
</main>
|
|
344
|
-
`}catch{}return e};function xG(e){const t=Js(),n=Ok(),r=Dt(n.mutation("mcp","discoverSource"),{mode:"promise"}),s=Dt(n.mutation("mcp","startOAuth"),{mode:"promise"}),a=er(e.onSubmit),[o,i]=E.useState(e.initialValue.name),[c,u]=E.useState(e.initialValue.endpoint??""),[l,d]=E.useState(r8e(e.initialValue)),[h,m]=E.useState(e.initialValue.auth.kind),[p,y]=E.useState(e.initialValue.auth.kind==="oauth2"?e.initialValue.auth:null),[g,b]=E.useState(e.initialValue.auth.kind==="oauth2"?"connected":"idle"),[x,k]=E.useState(e.initialValue.auth.kind==="oauth2"),[_,S]=E.useState(e.initialValue.auth.kind==="oauth2"?KS({transport:l.transport,endpoint:e.initialValue.endpoint??"",queryParams:e.initialValue.queryParams}):null),[w,T]=E.useState(e.initialValue.auth.kind==="oauth2"?KS({transport:l.transport,endpoint:e.initialValue.endpoint??"",queryParams:e.initialValue.queryParams}):null),[A,L]=E.useState(null),R=l.transport==="stdio",j=l.transport==="stdio"?"":l.queryParamsText,F=(()=>{if(R)return null;try{return wc("Query params",j)}catch{return null}})(),K=(()=>{try{return KS({transport:l.transport,endpoint:c,queryParams:F})}catch{return null}})(),Y=async()=>{if(t.status!=="ready")throw new Error("Workspace is still loading.");if(R)throw new Error("MCP OAuth is only available for remote MCP transports.");const V=a8e();if(!V)throw new Error("Failed opening MCP OAuth popup. Allow popups for this site and try again.");const N={endpoint:c.trim(),queryParams:wc("Query params",l.queryParamsText),redirectUrl:new URL("/v1/plugins/mcp/oauth/callback",window.location.origin).toString()};let P;try{P=await s({path:{workspaceId:t.data.scopeId},payload:N})}catch(Q){throw V.close(),Q}V.location.replace(P.authorizationUrl),V.focus();const D=await s8e(P.sessionId);if(!D.ok)throw new Error(D.error);return y(D.auth),b("connected"),T(K),D.auth},W=async V=>{if(t.status!=="ready")throw new Error("Workspace is still loading.");if(R||K===null)return k(!1),S(null),null;const N={endpoint:c.trim(),queryParams:wc("Query params",j)};try{const P=await r({path:{workspaceId:t.data.scopeId},payload:N}),D=YFe(P);return k(D),S(K),D&&m(Q=>Q==="oauth2"?Q:"oauth2"),P}catch{return k(!1),S(K),null}};E.useEffect(()=>{if(R||K===null){k(!1),S(null);return}if(K===_)return;const V=window.setTimeout(()=>{W()},450);return()=>{window.clearTimeout(V)}},[c,t.status,R,_,K,j]),E.useEffect(()=>{w===null||K===w||(y(null),b("idle"),T(null))},[w,K]);const J=(V=p,N)=>({name:o.trim(),endpoint:R?null:c.trim()||null,transport:l.transport===""?null:l.transport,queryParams:R?null:wc("Query params",l.queryParamsText),headers:R?null:wc("Headers",l.headersText),command:R&&l.command.trim()||null,args:R?yG("Args",l.argsText):null,env:R?wc("Environment",l.envText):null,cwd:R&&l.cwd.trim()||null,auth:N??(h==="oauth2"?V??(()=>{throw new Error("Complete MCP OAuth before saving.")})():{kind:"none"})}),ae=w!==null&&w===K&&p!==null,ge=!R&&K!==null&&K!==_,le=x&&!ae,I=ge?"Checking source...":e.mode==="create"&&le?"Create source without signing in":a.status==="pending"?e.mode==="create"?"Creating...":"Saving...":e.mode==="create"?"Create Source":"Save Changes",U=e.mode==="create"&&le?"border-amber-500/30 bg-amber-500/12 text-amber-700 hover:bg-amber-500/20 dark:text-amber-300":void 0;return f.jsx("div",{className:"space-y-8",children:f.jsxs("div",{className:"space-y-6 rounded-lg border border-border bg-card p-6 text-sm ring-1 ring-foreground/[0.04]",children:[f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Name"}),f.jsx(_t,{value:o,onChange:V=>i(V.target.value)})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Transport"}),f.jsxs(Ea,{value:l.transport,onChange:V=>{const N=V.target.value;d(P=>WFe(P,N)),N==="stdio"&&(m("none"),y(null),b("idle"),T(null))},children:[f.jsx("option",{value:"",children:"Auto (remote)"}),f.jsx("option",{value:"auto",children:"Auto"}),f.jsx("option",{value:"streamable-http",children:"Streamable HTTP"}),f.jsx("option",{value:"sse",children:"SSE"}),f.jsx("option",{value:"stdio",children:"stdio"})]})]}),R?f.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[f.jsxs("div",{className:"grid gap-2 md:col-span-2",children:[f.jsx(et,{children:"Command"}),f.jsx(_t,{value:l.command,onChange:V=>d({...l,command:V.target.value}),className:"font-mono text-xs"})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Args"}),f.jsx(Bc,{value:l.argsText,onChange:V=>d({...l,argsText:V.target.value}),rows:3,placeholder:'["server.js","--port","8787"]'})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Environment"}),f.jsx(Bc,{value:l.envText,onChange:V=>d({...l,envText:V.target.value}),rows:3,placeholder:'{"NODE_ENV":"production"}'})]}),f.jsxs("div",{className:"grid gap-2 md:col-span-2",children:[f.jsx(et,{children:"Working Directory"}),f.jsx(_t,{value:l.cwd,onChange:V=>d({...l,cwd:V.target.value}),className:"font-mono text-xs"})]})]}):f.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[f.jsxs("div",{className:"grid gap-2 md:col-span-2",children:[f.jsx(et,{children:"Endpoint"}),f.jsx(_t,{value:c,onChange:V=>u(V.target.value),className:"font-mono text-xs"})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Query Params"}),f.jsx(Bc,{value:l.queryParamsText,onChange:V=>d({...l,queryParamsText:V.target.value}),rows:3,placeholder:'{"transport":"streamable-http"}'})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Headers"}),f.jsx(Bc,{value:l.headersText,onChange:V=>d({...l,headersText:V.target.value}),rows:3,placeholder:'{"x-api-key":"..."}'})]})]}),!R&&f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Auth"}),f.jsxs(Ea,{value:h,onChange:V=>{const N=V.target.value;m(N),N!=="oauth2"&&(y(null),b("idle"),T(null))},children:[f.jsx("option",{value:"none",children:"None"}),f.jsx("option",{value:"oauth2",children:"OAuth 2.0"})]})]}),!R&&h==="oauth2"&&f.jsxs("div",{className:"rounded-lg border border-border bg-muted/20 p-4",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-medium text-foreground",children:"OAuth"}),f.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:x?"This MCP server requires OAuth before it can be connected.":"Authenticate with the MCP server's built-in OAuth flow."})]}),f.jsx(Te,{variant:"outline",onClick:()=>{L(null),b("pending"),Y().catch(V=>{b("idle"),L(V instanceof Error?V.message:String(V))})},children:g==="connected"?"Reconnect OAuth":"Connect OAuth"})]}),g==="connected"&&f.jsx("div",{className:"mt-3 text-xs text-primary",children:"Connected"})]}),A&&f.jsx(ts,{variant:"destructive",children:A}),f.jsx("div",{className:"flex items-center justify-end gap-3",children:f.jsxs(Te,{onClick:()=>{L(null),(async()=>{try{if(ge)return;await a.mutateAsync(J(ae?p:null,le?{kind:"none"}:void 0))}catch(V){L(V instanceof Error?V.message:String(V))}})()},disabled:a.status==="pending"||ge,className:U,children:[ge&&f.jsx(r7,{className:"size-3.5"}),I]})})]})})}function o8e(){const e=Qs(),t=t8e(nc()),n=Js(),r=Ok(),s=Dt(r.mutation("mcp","createSource"),{mode:"promise"});return n.status!=="ready"?f.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading workspace..."}):f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:f.jsxs("div",{className:"mx-auto w-full max-w-3xl px-6 py-10",children:[f.jsxs("div",{className:"mb-8",children:[f.jsx("h1",{className:"font-display text-2xl tracking-tight text-foreground",children:"Add MCP Source"}),f.jsx("p",{className:"mt-1.5 text-sm leading-6 text-muted-foreground",children:"Connect a Model Context Protocol server and import its tools."})]}),f.jsx(xG,{initialValue:t,mode:"create",onSubmit:async a=>{const o=await s({path:{workspaceId:n.data.scopeId},payload:a,reactivityKeys:{sources:[n.data.scopeId]}});E.startTransition(()=>{e.detail(o.id,{tab:"model"})})}})]})})}function i8e(e){const t=Qs(),n=Js(),r=Ok(),s=Qi(n.status==="ready"?r.query("mcp","getSourceConfig",{path:{workspaceId:n.data.scopeId,sourceId:e.source.id},reactivityKeys:{source:[n.data.scopeId,e.source.id]},timeToLive:"30 seconds"}):r.query("local","installation",{timeToLive:"1 second"})),a=Dt(r.mutation("mcp","updateSource"),{mode:"promise"});return n.status!=="ready"?f.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading workspace..."}):Kd(s)?f.jsx(ts,{variant:"destructive",children:"Failed loading source configuration."}):Ss(s)?f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:f.jsxs("div",{className:"mx-auto w-full max-w-3xl px-6 py-10",children:[f.jsxs("div",{className:"mb-8",children:[f.jsx("h1",{className:"font-display text-2xl tracking-tight text-foreground",children:"Edit MCP Source"}),f.jsxs("p",{className:"mt-1.5 text-sm leading-6 text-muted-foreground",children:["Update the connection settings for ",e.source.name,"."]})]}),f.jsx(xG,{initialValue:s.value,mode:"edit",onSubmit:async o=>{const i=await a({path:{workspaceId:n.data.scopeId,sourceId:e.source.id},payload:o,reactivityKeys:{sources:[n.data.scopeId],source:[n.data.scopeId,e.source.id],sourceInspection:[n.data.scopeId,e.source.id],sourceInspectionTool:[n.data.scopeId,e.source.id],sourceDiscovery:[n.data.scopeId,e.source.id]}});E.startTransition(()=>{t.detail(i.id,{tab:"model"})})}})]})}):f.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading configuration..."})}function c8e(e){const t=Qs(),n=Rk(nc()),r=Js(),s=Ok(),a=Dt(s.mutation("mcp","removeSource"),{mode:"promise"}),o=Dt(s.mutation("mcp","refreshSource"),{mode:"promise"}),i=er(async y=>o({path:{workspaceId:e.source.scopeId,sourceId:y},reactivityKeys:{sources:[e.source.scopeId],source:[e.source.scopeId,y],sourceInspection:[e.source.scopeId,y],sourceInspectionTool:[e.source.scopeId,y],sourceDiscovery:[e.source.scopeId,y]}})),[c,u]=E.useState(!1),[l,d]=E.useState(!1),h=Qi(r.status==="ready"?s.query("mcp","getSourceConfig",{path:{workspaceId:r.data.scopeId,sourceId:e.source.id},reactivityKeys:{source:[r.data.scopeId,e.source.id]},timeToLive:"30 seconds"}):s.query("local","installation",{timeToLive:"1 second"})),m=E.useMemo(()=>{if(!Ss(h))return null;const y=h.value,g=y.transport==="stdio"?y.command??"stdio":y.endpoint??"remote";return f.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[f.jsx("span",{className:"font-mono text-foreground",children:g}),f.jsxs(Fn,{variant:"muted",children:["Transport: ",y.transport??"auto"]}),f.jsxs(Fn,{variant:"muted",children:["Auth: ",y.auth.kind]})]})},[h]);if(r.status!=="ready")return f.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading workspace..."});const p=async()=>{if(!l){d(!0);try{await a({path:{workspaceId:r.data.scopeId,sourceId:e.source.id},reactivityKeys:{sources:[r.data.scopeId],source:[r.data.scopeId,e.source.id],sourceInspection:[r.data.scopeId,e.source.id],sourceInspectionTool:[r.data.scopeId,e.source.id],sourceDiscovery:[r.data.scopeId,e.source.id]}}),E.startTransition(()=>{t.home()})}finally{d(!1),u(!1)}}};return f.jsx(Nk,{sourceId:e.source.id,title:e.source.name,kind:e.source.kind,search:n,navigate:y=>t.updateSearch(y),summary:m,actions:f.jsxs(f.Fragment,{children:[f.jsx(Te,{variant:"outline",size:"sm",type:"button",onClick:()=>{i.mutateAsync(e.source.id)},disabled:i.status==="pending",children:i.status==="pending"?"Refreshing...":"Refresh"}),f.jsxs(Te,{variant:"outline",size:"sm",type:"button",onClick:()=>{t.edit(e.source.id)},children:[f.jsx(Im,{className:"size-3.5"}),"Edit"]}),c?f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-xs font-medium text-destructive",children:"Confirm delete?"}),f.jsx(Te,{variant:"outline",onClick:()=>u(!1),disabled:l,children:"Cancel"}),f.jsx(Te,{variant:"destructive-outline",onClick:()=>{p().catch(()=>{})},disabled:l,children:l?"Deleting...":"Delete"})]}):f.jsx(Te,{variant:"destructive-outline",onClick:()=>u(!0),disabled:l,children:"Delete"})]})})}function kG(e){const t=Ep(),n=typeof t.sourceId=="string"?t.sourceId:null,r=Zx(n??"");return n===null||r.status==="error"?f.jsx("div",{className:"px-6 py-8 text-sm text-destructive",children:"This MCP source is unavailable."}):r.status==="loading"?f.jsx("div",{className:"px-6 py-8 text-sm text-muted-foreground",children:"Loading source..."}):r.data.kind!=="mcp"?f.jsxs("div",{className:"px-6 py-8 text-sm text-destructive",children:["Expected an `mcp` source, but received `",r.data.kind,"`."]}):e.children(r.data)}function u8e(){return f.jsx(kG,{children:e=>f.jsx(i8e,{source:e})})}function l8e(){return f.jsx(kG,{children:e=>f.jsx(c8e,{source:e})})}const d8e=_p({key:"mcp",displayName:"MCP",description:"Connect remote or local MCP servers.",routes:[{key:"add",path:"add",component:Br(()=>o8e)},{key:"detail",path:"sources/$sourceId",component:Br(()=>l8e)},{key:"edit",path:"sources/$sourceId/edit",component:Br(()=>u8e)}]}),yA=Symbol.for("yaml.alias"),f8e=Symbol.for("yaml.document"),eu=Symbol.for("yaml.map"),vG=Symbol.for("yaml.pair"),xA=Symbol.for("yaml.scalar"),Fp=Symbol.for("yaml.seq"),co=Symbol.for("yaml.node.type"),Bu=e=>!!e&&typeof e=="object"&&e[co]===yA,Lk=e=>!!e&&typeof e=="object"&&e[co]===f8e,SG=e=>!!e&&typeof e=="object"&&e[co]===eu,gr=e=>!!e&&typeof e=="object"&&e[co]===vG,Un=e=>!!e&&typeof e=="object"&&e[co]===xA,kA=e=>!!e&&typeof e=="object"&&e[co]===Fp;function ms(e){if(e&&typeof e=="object")switch(e[co]){case eu:case Fp:return!0}return!1}function Er(e){if(e&&typeof e=="object")switch(e[co]){case yA:case eu:case xA:case Fp:return!0}return!1}const wG=e=>(Un(e)||ms(e))&&!!e.anchor,_c=Symbol("break visit"),h8e=Symbol("skip children"),Uh=Symbol("remove node");function $k(e,t){const n=m8e(t);Lk(e)?El(null,e.contents,n,Object.freeze([e]))===Uh&&(e.contents=null):El(null,e,n,Object.freeze([]))}$k.BREAK=_c;$k.SKIP=h8e;$k.REMOVE=Uh;function El(e,t,n,r){const s=p8e(e,t,n,r);if(Er(s)||gr(s))return g8e(e,r,s),El(e,s,n,r);if(typeof s!="symbol"){if(ms(t)){r=Object.freeze(r.concat(t));for(let a=0;a<t.items.length;++a){const o=El(a,t.items[a],n,r);if(typeof o=="number")a=o-1;else{if(o===_c)return _c;o===Uh&&(t.items.splice(a,1),a-=1)}}}else if(gr(t)){r=Object.freeze(r.concat(t));const a=El("key",t.key,n,r);if(a===_c)return _c;a===Uh&&(t.key=null);const o=El("value",t.value,n,r);if(o===_c)return _c;o===Uh&&(t.value=null)}}return s}function m8e(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function p8e(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(SG(t))return n.Map?.(e,t,r);if(kA(t))return n.Seq?.(e,t,r);if(gr(t))return n.Pair?.(e,t,r);if(Un(t))return n.Scalar?.(e,t,r);if(Bu(t))return n.Alias?.(e,t,r)}function g8e(e,t,n){const r=t[t.length-1];if(ms(r))r.items[e]=n;else if(gr(r))e==="key"?r.key=n:r.value=n;else if(Lk(r))r.contents=n;else{const s=Bu(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}function _G(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function ah(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,a=r.length;s<a;++s){const o=r[s],i=ah(e,r,String(s),o);i===void 0?delete r[s]:i!==o&&(r[s]=i)}else if(r instanceof Map)for(const s of Array.from(r.keys())){const a=r.get(s),o=ah(e,r,s,a);o===void 0?r.delete(s):o!==a&&r.set(s,o)}else if(r instanceof Set)for(const s of Array.from(r)){const a=ah(e,r,s,s);a===void 0?r.delete(s):a!==s&&(r.delete(s),r.add(a))}else for(const[s,a]of Object.entries(r)){const o=ah(e,r,s,a);o===void 0?delete r[s]:o!==a&&(r[s]=o)}return e.call(t,n,r)}function ga(e,t,n){if(Array.isArray(e))return e.map((r,s)=>ga(r,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!wG(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=a=>{r.res=a,delete n.onCreate};const s=e.toJSON(t,n);return n.onCreate&&n.onCreate(s),s}return typeof e=="bigint"&&!n?.keep?Number(e):e}class vA{constructor(t){Object.defineProperty(this,co,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:s,reviver:a}={}){if(!Lk(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},i=ga(this,"",o);if(typeof s=="function")for(const{count:c,res:u}of o.anchors.values())s(u,c);return typeof a=="function"?ah(a,{"":i},"",i):i}}class b8e extends vA{constructor(t){super(yA),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],$k(t,{Node:(a,o)=>{(Bu(o)||wG(o))&&r.push(o)}}),n&&(n.aliasResolveCache=r));let s;for(const a of r){if(a===this)break;a.anchor===this.source&&(s=a)}return s}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:s,maxAliasCount:a}=n,o=this.resolve(s,n);if(!o){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let i=r.get(o);if(i||(ga(o,null,n),i=r.get(o)),i?.res===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(a>=0&&(i.count+=1,i.aliasCount===0&&(i.aliasCount=ly(s,o,r)),i.count*i.aliasCount>a)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return i.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(_G(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(t.implicitKey)return`${s} `}return s}}function ly(e,t,n){if(Bu(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(ms(t)){let r=0;for(const s of t.items){const a=ly(e,s,n);a>r&&(r=a)}return r}else if(gr(t)){const r=ly(e,t.key,n),s=ly(e,t.value,n);return Math.max(r,s)}return 1}const EG=e=>!e||typeof e!="function"&&typeof e!="object";class cn extends vA{constructor(t){super(xA),this.value=t}toJSON(t,n){return n?.keep?this.value:ga(this.value,t,n)}toString(){return String(this.value)}}cn.BLOCK_FOLDED="BLOCK_FOLDED";cn.BLOCK_LITERAL="BLOCK_LITERAL";cn.PLAIN="PLAIN";cn.QUOTE_DOUBLE="QUOTE_DOUBLE";cn.QUOTE_SINGLE="QUOTE_SINGLE";function y8e(e,t,n){return n.find(r=>r.identify?.(e)&&!r.format)}function l1(e,t,n){if(Lk(e)&&(e=e.contents),Er(e))return e;if(gr(e)){const d=n.schema[eu].createNode?.(n.schema,null,n);return d.items.push(e),d}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:s,onTagObj:a,schema:o,sourceObjects:i}=n;let c;if(r&&e&&typeof e=="object"){if(c=i.get(e),c)return c.anchor??(c.anchor=s(e)),new b8e(c.anchor);c={anchor:null,node:null},i.set(e,c)}let u=y8e(e,t,o.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const d=new cn(e);return c&&(c.node=d),d}u=e instanceof Map?o[eu]:Symbol.iterator in Object(e)?o[Fp]:o[eu]}a&&(a(u),delete n.onTagObj);const l=u?.createNode?u.createNode(n.schema,e,n):typeof u?.nodeClass?.from=="function"?u.nodeClass.from(n.schema,e,n):new cn(e);return u.default||(l.tag=u.tag),c&&(c.node=l),l}function Tj(e,t,n){let r=n;for(let s=t.length-1;s>=0;--s){const a=t[s];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){const o=[];o[a]=r,r=o}else r=new Map([[a,r]])}return l1(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const x8e=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class TG extends vA{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>Er(r)||gr(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(x8e(t))this.add(n);else{const[r,...s]=t,a=this.get(r,!0);if(ms(a))a.addIn(s,n);else if(a===void 0&&this.schema)this.set(r,Tj(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const s=this.get(n,!0);if(ms(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...s]=t,a=this.get(r,!0);return s.length===0?!n&&Un(a)?a.value:a:ms(a)?a.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!gr(n))return!1;const r=n.value;return r==null||t&&Un(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const s=this.get(n,!0);return ms(s)?s.hasIn(r):!1}setIn(t,n){const[r,...s]=t;if(s.length===0)this.set(r,n);else{const a=this.get(r,!0);if(ms(a))a.setIn(s,n);else if(a===void 0&&this.schema)this.set(r,Tj(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}}const k8e=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Lm(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Tl=(e,t,n)=>e.endsWith(`
|
|
345
|
-
`)?Lm(n,t):n.includes(`
|
|
346
|
-
`)?`
|
|
347
|
-
`+Lm(n,t):(e.endsWith(" ")?"":" ")+n,CG="flow",GE="block",dy="quoted";function jk(e,t,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:a=20,onFold:o,onOverflow:i}={}){if(!s||s<0)return e;s<a&&(a=0);const c=Math.max(1+a,1+s-t.length);if(e.length<=c)return e;const u=[],l={};let d=s-t.length;typeof r=="number"&&(r>s-Math.max(2,a)?u.push(0):d=s-r);let h,m,p=!1,y=-1,g=-1,b=-1;n===GE&&(y=Cj(e,y,t.length),y!==-1&&(d=y+c));for(let k;k=e[y+=1];){if(n===dy&&k==="\\"){switch(g=y,e[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}b=y}if(k===`
|
|
348
|
-
`)n===GE&&(y=Cj(e,y,t.length)),d=y+t.length+c,h=void 0;else{if(k===" "&&m&&m!==" "&&m!==`
|
|
349
|
-
`&&m!==" "){const _=e[y+1];_&&_!==" "&&_!==`
|
|
350
|
-
`&&_!==" "&&(h=y)}if(y>=d)if(h)u.push(h),d=h+c,h=void 0;else if(n===dy){for(;m===" "||m===" ";)m=k,k=e[y+=1],p=!0;const _=y>b+1?y-2:g-1;if(l[_])return e;u.push(_),l[_]=!0,d=_+c,h=void 0}else p=!0}m=k}if(p&&i&&i(),u.length===0)return e;o&&o();let x=e.slice(0,u[0]);for(let k=0;k<u.length;++k){const _=u[k],S=u[k+1]||e.length;_===0?x=`
|
|
351
|
-
${t}${e.slice(0,S)}`:(n===dy&&l[_]&&(x+=`${e[_]}\\`),x+=`
|
|
352
|
-
${t}${e.slice(_+1,S)}`)}return x}function Cj(e,t,n){let r=t,s=t+1,a=e[s];for(;a===" "||a===" ";)if(t<s+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
|
|
353
|
-
`);r=t,s=t+1,a=e[s]}return r}const Mk=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Dk=e=>/^(%|---|\.\.\.)/m.test(e);function v8e(e,t,n){if(!t||t<0)return!1;const r=t-n,s=e.length;if(s<=r)return!1;for(let a=0,o=0;a<s;++a)if(e[a]===`
|
|
354
|
-
`){if(a-o>r)return!0;if(o=a+1,s-o<=r)return!1}return!0}function zh(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(Dk(e)?" ":"");let o="",i=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(i,c)+"\\ ",c+=1,i=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{o+=n.slice(i,c);const l=n.substr(c+2,4);switch(l){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:l.substr(0,2)==="00"?o+="\\x"+l.substr(2):o+=n.substr(c,6)}c+=5,i=c+1}break;case"n":if(r||n[c+2]==='"'||n.length<s)c+=1;else{for(o+=n.slice(i,c)+`
|
|
355
|
-
|
|
356
|
-
`;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)o+=`
|
|
357
|
-
`,c+=2;o+=a,n[c+2]===" "&&(o+="\\"),c+=1,i=c+1}break;default:c+=1}return o=i?o+n.slice(i):n,r?o:jk(o,a,dy,Mk(t,!1))}function KE(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
358
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return zh(e,t);const n=t.indent||(Dk(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
359
|
-
${n}`)+"'";return t.implicitKey?r:jk(r,n,CG,Mk(t,!1))}function Cl(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=zh;else{const s=e.includes('"'),a=e.includes("'");s&&!a?r=KE:a&&!s?r=zh:r=n?KE:zh}return r(e,t)}let WE;try{WE=new RegExp(`(^|(?<!
|
|
360
|
-
))
|
|
361
|
-
+(?!
|
|
362
|
-
|$)`,"g")}catch{WE=/\n+(?!\n|$)/g}function fy({comment:e,type:t,value:n},r,s,a){const{blockQuote:o,commentString:i,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return Cl(n,r);const u=r.indent||(r.forceBlockIndent||Dk(n)?" ":""),l=o==="literal"?!0:o==="folded"||t===cn.BLOCK_FOLDED?!1:t===cn.BLOCK_LITERAL?!0:!v8e(n,c,u.length);if(!n)return l?`|
|
|
363
|
-
`:`>
|
|
364
|
-
`;let d,h;for(h=n.length;h>0;--h){const S=n[h-1];if(S!==`
|
|
365
|
-
`&&S!==" "&&S!==" ")break}let m=n.substring(h);const p=m.indexOf(`
|
|
366
|
-
`);p===-1?d="-":n===m||p!==m.length-1?(d="+",a&&a()):d="",m&&(n=n.slice(0,-m.length),m[m.length-1]===`
|
|
367
|
-
`&&(m=m.slice(0,-1)),m=m.replace(WE,`$&${u}`));let y=!1,g,b=-1;for(g=0;g<n.length;++g){const S=n[g];if(S===" ")y=!0;else if(S===`
|
|
368
|
-
`)b=g;else break}let x=n.substring(0,b<g?b+1:g);x&&(n=n.substring(x.length),x=x.replace(/\n+/g,`$&${u}`));let _=(y?u?"2":"1":"")+d;if(e&&(_+=" "+i(e.replace(/ ?[\r\n]+/g," ")),s&&s()),!l){const S=n.replace(/\n+/g,`
|
|
369
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`);let w=!1;const T=Mk(r,!0);o!=="folded"&&t!==cn.BLOCK_FOLDED&&(T.onOverflow=()=>{w=!0});const A=jk(`${x}${S}${m}`,u,GE,T);if(!w)return`>${_}
|
|
370
|
-
${u}${A}`}return n=n.replace(/\n+/g,`$&${u}`),`|${_}
|
|
371
|
-
${u}${x}${n}${m}`}function S8e(e,t,n,r){const{type:s,value:a}=e,{actualString:o,implicitKey:i,indent:c,indentStep:u,inFlow:l}=t;if(i&&a.includes(`
|
|
372
|
-
`)||l&&/[[\]{},]/.test(a))return Cl(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return i||l||!a.includes(`
|
|
373
|
-
`)?Cl(a,t):fy(e,t,n,r);if(!i&&!l&&s!==cn.PLAIN&&a.includes(`
|
|
374
|
-
`))return fy(e,t,n,r);if(Dk(a)){if(c==="")return t.forceBlockIndent=!0,fy(e,t,n,r);if(i&&c===u)return Cl(a,t)}const d=a.replace(/\n+/g,`$&
|
|
375
|
-
${c}`);if(o){const h=y=>y.default&&y.tag!=="tag:yaml.org,2002:str"&&y.test?.test(d),{compat:m,tags:p}=t.doc.schema;if(p.some(h)||m?.some(h))return Cl(a,t)}return i?d:jk(d,c,CG,Mk(t,!1))}function w8e(e,t,n,r){const{implicitKey:s,inFlow:a}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:i}=e;i!==cn.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(i=cn.QUOTE_DOUBLE);const c=l=>{switch(l){case cn.BLOCK_FOLDED:case cn.BLOCK_LITERAL:return s||a?Cl(o.value,t):fy(o,t,n,r);case cn.QUOTE_DOUBLE:return zh(o.value,t);case cn.QUOTE_SINGLE:return KE(o.value,t);case cn.PLAIN:return S8e(o,t,n,r);default:return null}};let u=c(i);if(u===null){const{defaultKeyType:l,defaultStringType:d}=t.options,h=s&&l||d;if(u=c(h),u===null)throw new Error(`Unsupported default string type ${h}`)}return u}function _8e(e,t){const n=Object.assign({blockQuote:!0,commentString:k8e,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function E8e(e,t){if(t.tag){const s=e.filter(a=>a.tag===t.tag);if(s.length>0)return s.find(a=>a.format===t.format)??s[0]}let n,r;if(Un(t)){r=t.value;let s=e.filter(a=>a.identify?.(r));if(s.length>1){const a=s.filter(o=>o.test);a.length>0&&(s=a)}n=s.find(a=>a.format===t.format)??s.find(a=>!a.format)}else r=t,n=e.find(s=>s.nodeClass&&r instanceof s.nodeClass);if(!n){const s=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${s} value`)}return n}function T8e(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],a=(Un(e)||ms(e))&&e.anchor;a&&_G(a)&&(n.add(a),s.push(`&${a}`));const o=e.tag??(t.default?null:t.tag);return o&&s.push(r.directives.tagString(o)),s.join(" ")}function d1(e,t,n,r){if(gr(e))return e.toString(t,n,r);if(Bu(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let s;const a=Er(e)?e:t.doc.createNode(e,{onTagObj:c=>s=c});s??(s=E8e(t.doc.schema.tags,a));const o=T8e(a,s,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const i=typeof s.stringify=="function"?s.stringify(a,t,n,r):Un(a)?w8e(a,t,n,r):a.toString(t,n,r);return o?Un(a)||i[0]==="{"||i[0]==="["?`${o} ${i}`:`${o}
|
|
376
|
-
${t.indent}${i}`:i}function C8e({key:e,value:t},n,r,s){const{allNullValues:a,doc:o,indent:i,indentStep:c,options:{commentString:u,indentSeq:l,simpleKeys:d}}=n;let h=Er(e)&&e.comment||null;if(d){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(ms(e)||!Er(e)&&typeof e=="object"){const T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let m=!d&&(!e||h&&t==null&&!n.inFlow||ms(e)||(Un(e)?e.type===cn.BLOCK_FOLDED||e.type===cn.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(d||!a),indent:i+c});let p=!1,y=!1,g=d1(e,n,()=>p=!0,()=>y=!0);if(!m&&!n.inFlow&&g.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(n.inFlow){if(a||t==null)return p&&r&&r(),g===""?"?":m?`? ${g}`:g}else if(a&&!d||t==null&&m)return g=`? ${g}`,h&&!p?g+=Tl(g,n.indent,u(h)):y&&s&&s(),g;p&&(h=null),m?(h&&(g+=Tl(g,n.indent,u(h))),g=`? ${g}
|
|
377
|
-
${i}:`):(g=`${g}:`,h&&(g+=Tl(g,n.indent,u(h))));let b,x,k;Er(t)?(b=!!t.spaceBefore,x=t.commentBefore,k=t.comment):(b=!1,x=null,k=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!m&&!h&&Un(t)&&(n.indentAtStart=g.length+1),y=!1,!l&&c.length>=2&&!n.inFlow&&!m&&kA(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let _=!1;const S=d1(t,n,()=>_=!0,()=>y=!0);let w=" ";if(h||b||x){if(w=b?`
|
|
378
|
-
`:"",x){const T=u(x);w+=`
|
|
379
|
-
${Lm(T,n.indent)}`}S===""&&!n.inFlow?w===`
|
|
380
|
-
`&&k&&(w=`
|
|
381
|
-
|
|
382
|
-
`):w+=`
|
|
383
|
-
${n.indent}`}else if(!m&&ms(t)){const T=S[0],A=S.indexOf(`
|
|
384
|
-
`),L=A!==-1,R=n.inFlow??t.flow??t.items.length===0;if(L||!R){let j=!1;if(L&&(T==="&"||T==="!")){let F=S.indexOf(" ");T==="&"&&F!==-1&&F<A&&S[F+1]==="!"&&(F=S.indexOf(" ",F+1)),(F===-1||A<F)&&(j=!0)}j||(w=`
|
|
385
|
-
${n.indent}`)}}else(S===""||S[0]===`
|
|
386
|
-
`)&&(w="");return g+=w+S,n.inFlow?_&&r&&r():k&&!_?g+=Tl(g,n.indent,u(k)):y&&s&&s(),g}function I8e(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Sb="<<",JS={identify:e=>e===Sb||typeof e=="symbol"&&e.description===Sb,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new cn(Symbol(Sb)),{addToJSMap:IG}),stringify:()=>Sb},A8e=(e,t)=>(JS.identify(t)||Un(t)&&(!t.type||t.type===cn.PLAIN)&&JS.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===JS.tag&&n.default);function IG(e,t,n){if(n=e&&Bu(n)?n.resolve(e.doc):n,kA(n))for(const r of n.items)QS(e,t,r);else if(Array.isArray(n))for(const r of n)QS(e,t,r);else QS(e,t,n)}function QS(e,t,n){const r=e&&Bu(n)?n.resolve(e.doc):n;if(!SG(r))throw new Error("Merge sources must be maps or map aliases");const s=r.toJSON(null,e,Map);for(const[a,o]of s)t instanceof Map?t.has(a)||t.set(a,o):t instanceof Set?t.add(a):Object.prototype.hasOwnProperty.call(t,a)||Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function AG(e,t,{key:n,value:r}){if(Er(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(A8e(e,n))IG(e,t,r);else{const s=ga(n,"",e);if(t instanceof Map)t.set(s,ga(r,s,e));else if(t instanceof Set)t.add(s);else{const a=N8e(n,s,e),o=ga(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function N8e(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Er(e)&&n?.doc){const r=_8e(n.doc,{});r.anchors=new Set;for(const a of n.anchors.keys())r.anchors.add(a.anchor);r.inFlow=!0,r.inStringifyKey=!0;const s=e.toString(r);if(!n.mapKeyWarned){let a=JSON.stringify(s);a.length>40&&(a=a.substring(0,36)+'..."'),I8e(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(t)}function SA(e,t,n){const r=l1(e,void 0,n),s=l1(t,void 0,n);return new Mo(r,s)}class Mo{constructor(t,n=null){Object.defineProperty(this,co,{value:vG}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return Er(n)&&(n=n.clone(t)),Er(r)&&(r=r.clone(t)),new Mo(n,r)}toJSON(t,n){const r=n?.mapAsMap?new Map:{};return AG(n,r,this)}toString(t,n,r){return t?.doc?C8e(this,t,n,r):JSON.stringify(this)}}function NG(e,t,n){return(t.inFlow??e.flow?P8e:R8e)(e,t,n)}function R8e({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:a,onChompKeep:o,onComment:i}){const{indent:c,options:{commentString:u}}=n,l=Object.assign({},n,{indent:a,type:null});let d=!1;const h=[];for(let p=0;p<t.length;++p){const y=t[p];let g=null;if(Er(y))!d&&y.spaceBefore&&h.push(""),f1(n,h,y.commentBefore,d),y.comment&&(g=y.comment);else if(gr(y)){const x=Er(y.key)?y.key:null;x&&(!d&&x.spaceBefore&&h.push(""),f1(n,h,x.commentBefore,d))}d=!1;let b=d1(y,l,()=>g=null,()=>d=!0);g&&(b+=Tl(b,a,u(g))),d&&g&&(d=!1),h.push(r+b)}let m;if(h.length===0)m=s.start+s.end;else{m=h[0];for(let p=1;p<h.length;++p){const y=h[p];m+=y?`
|
|
387
|
-
${c}${y}`:`
|
|
388
|
-
`}}return e?(m+=`
|
|
389
|
-
`+Lm(u(e),c),i&&i()):d&&o&&o(),m}function P8e({items:e},t,{flowChars:n,itemIndent:r}){const{indent:s,indentStep:a,flowCollectionPadding:o,options:{commentString:i}}=t;r+=a;const c=Object.assign({},t,{indent:r,inFlow:!0,type:null});let u=!1,l=0;const d=[];for(let p=0;p<e.length;++p){const y=e[p];let g=null;if(Er(y))y.spaceBefore&&d.push(""),f1(t,d,y.commentBefore,!1),y.comment&&(g=y.comment);else if(gr(y)){const x=Er(y.key)?y.key:null;x&&(x.spaceBefore&&d.push(""),f1(t,d,x.commentBefore,!1),x.comment&&(u=!0));const k=Er(y.value)?y.value:null;k?(k.comment&&(g=k.comment),k.commentBefore&&(u=!0)):y.value==null&&x?.comment&&(g=x.comment)}g&&(u=!0);let b=d1(y,c,()=>g=null);p<e.length-1&&(b+=","),g&&(b+=Tl(b,r,i(g))),!u&&(d.length>l||b.includes(`
|
|
390
|
-
`))&&(u=!0),d.push(b),l=d.length}const{start:h,end:m}=n;if(d.length===0)return h+m;if(!u){const p=d.reduce((y,g)=>y+g.length+2,2);u=t.options.lineWidth>0&&p>t.options.lineWidth}if(u){let p=h;for(const y of d)p+=y?`
|
|
391
|
-
${a}${s}${y}`:`
|
|
392
|
-
`;return`${p}
|
|
393
|
-
${s}${m}`}else return`${h}${o}${d.join(" ")}${o}${m}`}function f1({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const a=Lm(t(r),e);n.push(a.trimStart())}}function Hc(e,t){const n=Un(t)?t.value:t;for(const r of e)if(gr(r)&&(r.key===t||r.key===n||Un(r.key)&&r.key.value===n))return r}class ml extends TG{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(eu,t),this.items=[]}static from(t,n,r){const{keepUndefined:s,replacer:a}=r,o=new this(t),i=(c,u)=>{if(typeof a=="function")u=a.call(n,c,u);else if(Array.isArray(a)&&!a.includes(c))return;(u!==void 0||s)&&o.items.push(SA(c,u,r))};if(n instanceof Map)for(const[c,u]of n)i(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))i(c,n[c]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){let r;gr(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Mo(t,t?.value):r=new Mo(t.key,t.value);const s=Hc(this.items,r.key),a=this.schema?.sortMapEntries;if(s){if(!n)throw new Error(`Key ${r.key} already set`);Un(s.value)&&EG(r.value)?s.value.value=r.value:s.value=r.value}else if(a){const o=this.items.findIndex(i=>a(r,i)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(t){const n=Hc(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const s=Hc(this.items,t)?.value;return(!n&&Un(s)?s.value:s)??void 0}has(t){return!!Hc(this.items,t)}set(t,n){this.add(new Mo(t,n),!0)}toJSON(t,n,r){const s=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(s);for(const a of this.items)AG(n,s,a);return s}toString(t,n,r){if(!t)return JSON.stringify(this);for(const s of this.items)if(!gr(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),NG(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}class RG extends TG{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Fp,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=wb(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=wb(t);if(typeof r!="number")return;const s=this.items[r];return!n&&Un(s)?s.value:s}has(t){const n=wb(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=wb(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const s=this.items[r];Un(s)&&EG(n)?s.value=n:this.items[r]=n}toJSON(t,n){const r=[];n?.onCreate&&n.onCreate(r);let s=0;for(const a of this.items)r.push(ga(a,String(s++),n));return r}toString(t,n,r){return t?NG(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:s}=r,a=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let i of n){if(typeof s=="function"){const c=n instanceof Set?i:String(o++);i=s.call(n,c,i)}a.items.push(l1(i,void 0,r))}}return a}}function wb(e){let t=Un(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}function O8e(e,t,n){const{replacer:r}=n,s=new RG(e);s.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof r=="function"&&(o=r.call(t,String(a++),o));let i,c;if(Array.isArray(o))if(o.length===2)i=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const u=Object.keys(o);if(u.length===1)i=u[0],c=o[i];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else i=o;s.items.push(SA(i,c,n))}return s}class wA extends RG{constructor(){super(),this.add=ml.prototype.add.bind(this),this.delete=ml.prototype.delete.bind(this),this.get=ml.prototype.get.bind(this),this.has=ml.prototype.has.bind(this),this.set=ml.prototype.set.bind(this),this.tag=wA.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n?.onCreate&&n.onCreate(r);for(const s of this.items){let a,o;if(gr(s)?(a=ga(s.key,"",n),o=ga(s.value,a,n)):a=ga(s,"",n),r.has(a))throw new Error("Ordered maps must not include duplicate keys");r.set(a,o)}return r}static from(t,n,r){const s=O8e(t,n,r),a=new this;return a.items=s.items,a}}wA.tag="tag:yaml.org,2002:omap";class _A extends ml{constructor(t){super(t),this.tag=_A.tag}add(t){let n;gr(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Mo(t.key,null):n=new Mo(t,null),Hc(this.items,n.key)||this.items.push(n)}get(t,n){const r=Hc(this.items,t);return!n&&gr(r)?Un(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=Hc(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Mo(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:s}=r,a=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof s=="function"&&(o=s.call(n,o,o)),a.items.push(SA(o,null,r));return a}}_A.tag="tag:yaml.org,2002:set";new Set("0123456789ABCDEFabcdef");new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");new Set(",[]{}");new Set(` ,[]{}
|
|
394
|
-
\r `);const PG=tn(q({kind:ie("none")}),q({kind:ie("bearer"),tokenSecretRef:hr,headerName:ne(C),prefix:ne(C)})),OG=q({name:C,specUrl:C,baseUrl:ne(C),auth:PG}),YE=OG;q({sourceId:C,config:YE});q({specUrl:C,baseUrl:ne(C),authStrategy:ie("none","bearer"),documentHash:C});q({specUrl:C,baseUrl:ne(C),auth:PG,defaultHeaders:ne(Zn),etag:ne(C),lastSyncAt:ne(it)});const L8e=q({specUrl:C}),$8e=q({name:C,kind:ie("apiKey","http","oauth2","openIdConnect","unknown"),placement:ne(C),scheme:ne(C)}),j8e=q({title:ne(C),version:ne(C),baseUrl:ne(C),namespace:ne(C),operationCount:it,securitySchemes:_e($8e),warnings:_e(C)}),sl=gn("workspaceId",mr),_b=gn("sourceId",Zi),LG=Xi("openapi").add(Dn("previewDocument")`/workspaces/${sl}/plugins/openapi/preview`.setPayload(L8e).addSuccess(j8e).addError(Je).addError(ft).addError(He)).add(Dn("createSource")`/workspaces/${sl}/plugins/openapi/sources`.setPayload(OG).addSuccess(ks).addError(Je).addError(ft).addError(He)).add(Jn("getSourceConfig")`/workspaces/${sl}/plugins/openapi/sources/${_b}`.addSuccess(YE).addError(Je).addError(ft).addError(kt).addError(He)).add(Dx("updateSource")`/workspaces/${sl}/plugins/openapi/sources/${_b}`.setPayload(YE).addSuccess(ks).addError(Je).addError(ft).addError(kt).addError(He)).add(Dn("refreshSource")`/workspaces/${sl}/plugins/openapi/sources/${_b}/refresh`.addSuccess(ks).addError(Je).addError(ft).addError(kt).addError(He)).add(Bi("removeSource")`/workspaces/${sl}/plugins/openapi/sources/${_b}`.addSuccess(q({removed:Ke})).addError(Je).addError(ft).addError(kt).addError(He)).prefix("/v1");yp().add(LG);const M8e={key:"openapi",group:LG},JE=()=>({name:"My OpenAPI Source",specUrl:"https://example.com/openapi.json",baseUrl:null,auth:{kind:"none"}}),QE="Authorization",h1="Bearer ",hy=(e,t)=>{const n=e[t];return typeof n=="string"&&n.trim().length>0?n.trim():null},D8e=(e,t)=>{for(const n of t){const r=hy(e,n);if(r)return r}return null},F8e=e=>{const t=e.trim().toLowerCase();return/^https?:\/\//.test(t)?t.endsWith(".json")||t.endsWith(".yaml")||t.endsWith(".yml")||t.includes("/openapi")||t.includes("openapi.")||t.includes("/swagger")||t.includes("swagger.")||t.includes("/api-docs"):!1},B8e=e=>{const t=e.trim();if(!t)return{specUrl:JE().specUrl,baseUrl:JE().baseUrl};if(F8e(t))return{specUrl:t,baseUrl:null};const n=t.replace(/\/+$/,"");return{specUrl:`${n}/openapi.json`,baseUrl:n}},U8e=e=>{const t=JE(),n=D8e(e,["inputUrl","pastedUrl","url"]),r=n?B8e(n):t;return{...t,name:hy(e,"presetName")??t.name,specUrl:hy(e,"presetSpecUrl")??r.specUrl,baseUrl:hy(e,"presetBaseUrl")??r.baseUrl}},Fk=Qx()("OpenApiReactHttpClient",[M8e]),XE=e=>f.jsxs("section",{children:[f.jsx("h2",{className:"mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:e.title}),e.children]}),Ij=e=>{const t=e.trim();if(!/^https?:\/\//i.test(t))return!1;try{return new URL(t).hostname!=="example.com"}catch{return!1}},z8e=e=>e.kind==="apiKey"?e.placement?`API key in ${e.placement}`:"API key":e.kind==="http"?e.scheme?`HTTP ${e.scheme}`:"HTTP auth":e.kind==="oauth2"?"OAuth 2.0":e.kind==="openIdConnect"?"OpenID Connect":"Custom auth",H8e=e=>({name:e.name,specUrl:e.specUrl,baseUrl:e.baseUrl,auth:e.auth}),q8e=e=>e.kind==="bearer"?JSON.stringify(e.tokenSecretRef):"",V8e=e=>e.kind==="bearer"&&e.headerName?.trim()||QE,G8e=e=>e.kind==="bearer"?e.prefix??h1:h1,K8e=e=>{const t=e.trim();return t.length>0?t:null},W8e=(e,t,n,r)=>{if(e==="none")return{kind:"none"};if(!t)throw new Error("Select a secret for bearer auth.");return{kind:"bearer",tokenSecretRef:JSON.parse(t),headerName:K8e(n),prefix:r===h1?null:r}};function $G(e){const t=Fk(),n=Dt(t.mutation("openapi","previewDocument"),{mode:"promise"}),[r,s]=E.useState(e.initialValue.name),[a,o]=E.useState(e.initialValue.specUrl),[i,c]=E.useState(e.initialValue.baseUrl??""),[u,l]=E.useState(e.initialValue.auth.kind),[d,h]=E.useState(q8e(e.initialValue.auth)),[m,p]=E.useState(V8e(e.initialValue.auth)),[y,g]=E.useState(G8e(e.initialValue.auth)),[b,x]=E.useState(null),[k,_]=E.useState(null),[S,w]=E.useState(!1),[T,A]=E.useState(!1),[L,R]=E.useState(null),j=er(async W=>n({path:{workspaceId:e.workspaceId},payload:W})),F=er(e.onSubmit),K=async W=>{const J=a.trim();if(!J){W.mode==="manual"&&x("Spec URL is required."),_(null),R(null);return}if(Ij(J))try{const ae=await j.mutateAsync({specUrl:J});_({...ae,warnings:[...ae.warnings],securitySchemes:[...ae.securitySchemes]}),R(J),b&&x(null),!S&&ae.title&&s(ae.title),!T&&ae.baseUrl&&c(ae.baseUrl)}catch(ae){W.mode==="manual"&&x(ae instanceof Error?ae.message:"Failed previewing document."),_(null)}};E.useEffect(()=>{const W=a.trim();if(!Ij(W)||W===L)return;const J=window.setTimeout(()=>{K({mode:"auto"})},450);return()=>{window.clearTimeout(J)}},[a,L]);const Y=async()=>{x(null);const W=r.trim(),J=a.trim(),ae=i.trim();if(!W){x("Name is required.");return}if(!J){x("Spec URL is required.");return}if(u==="bearer"&&d.trim().length===0){x("Select a secret for bearer auth.");return}try{const ge=W8e(u,d,m,y);await F.mutateAsync({name:W,specUrl:J,baseUrl:ae||null,auth:ge})}catch(ge){x(ge instanceof Error?ge.message:"Failed saving source.")}};return f.jsxs("div",{className:"space-y-6 rounded-lg border border-border bg-card p-6 text-sm ring-1 ring-foreground/[0.04]",children:[f.jsx(XE,{title:"Connection",children:f.jsxs("div",{className:"grid gap-4",children:[f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Name"}),f.jsx(_t,{value:r,onChange:W=>{w(!0),s(W.target.value)},placeholder:"GitHub REST"})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Spec URL"}),f.jsx(_t,{value:a,onChange:W=>o(W.target.value),onBlur:()=>{K({mode:"manual"})},placeholder:"https://example.com/openapi.json",className:"font-mono text-xs"})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Base URL"}),f.jsx(_t,{value:i,onChange:W=>{A(!0),c(W.target.value)},placeholder:"https://api.example.com",className:"font-mono text-xs"})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Auth"}),f.jsxs(Ea,{value:u,onChange:W=>l(W.target.value),children:[f.jsx("option",{value:"none",children:"None"}),f.jsx("option",{value:"bearer",children:"Bearer Secret"})]})]}),u==="bearer"&&f.jsxs("div",{className:"space-y-4 rounded-lg border border-border bg-muted/20 p-4",children:[f.jsx(xm,{label:"Secret",value:d,emptyLabel:"Select a secret",draftNamePlaceholder:"OpenAPI bearer token",draftValuePlaceholder:"Paste the token value",onChange:h}),f.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Header Name"}),f.jsx(_t,{value:m,onChange:W=>p(W.target.value),placeholder:QE,className:"font-mono text-xs"})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Prefix"}),f.jsx(_t,{value:y,onChange:W=>g(W.target.value),placeholder:h1,className:"font-mono text-xs"})]})]})]})]})}),(k||j.status==="pending")&&f.jsx(XE,{title:"Preview",children:j.status==="pending"?f.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading preview..."}):k&&f.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 px-4 py-3 text-sm",children:[f.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-xs",children:[f.jsx("dt",{className:"font-medium text-foreground",children:"Title"}),f.jsx("dd",{className:"text-muted-foreground",children:k.title??"—"}),f.jsx("dt",{className:"font-medium text-foreground",children:"Version"}),f.jsx("dd",{className:"text-muted-foreground",children:k.version??"—"}),f.jsx("dt",{className:"font-medium text-foreground",children:"Operations"}),f.jsx("dd",{className:"text-muted-foreground",children:k.operationCount}),f.jsx("dt",{className:"font-medium text-foreground",children:"Base URL"}),f.jsx("dd",{className:"font-mono text-muted-foreground",children:k.baseUrl??"—"}),k.namespace&&f.jsxs(f.Fragment,{children:[f.jsx("dt",{className:"font-medium text-foreground",children:"Namespace"}),f.jsx("dd",{className:"text-muted-foreground",children:k.namespace})]}),k.securitySchemes.length>0&&f.jsxs(f.Fragment,{children:[f.jsx("dt",{className:"font-medium text-foreground",children:"Auth"}),f.jsx("dd",{className:"text-muted-foreground",children:k.securitySchemes.map(W=>`${W.name} (${z8e(W)})`).join(", ")})]})]}),k.warnings.length>0&&f.jsx(ts,{variant:"warning",className:"mt-3 text-xs",children:k.warnings.join(" ")})]})}),b&&f.jsx(ts,{variant:"destructive",children:b}),f.jsx("div",{className:"flex items-center justify-end",children:f.jsx(Te,{type:"button",onClick:()=>{Y()},disabled:F.status==="pending",children:F.status==="pending"?e.busyLabel:e.submitLabel})})]})}function Y8e(){const e=Qs(),t=U8e(nc()),n=Fk(),r=rs(),s=Dt(n.mutation("openapi","createSource"),{mode:"promise"});return r.enabled?f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:f.jsxs("div",{className:"mx-auto w-full max-w-3xl px-6 py-10",children:[f.jsxs("div",{className:"mb-8",children:[f.jsx("h1",{className:"font-display text-2xl tracking-tight text-foreground",children:"Add OpenAPI Source"}),f.jsx("p",{className:"mt-1.5 text-sm leading-6 text-muted-foreground",children:"Import operations from an OpenAPI specification as callable tools."})]}),f.jsx($G,{mode:"create",workspaceId:r.workspaceId,initialValue:t,submitLabel:"Create Source",busyLabel:"Creating...",onSubmit:async a=>{const o=await s({path:{workspaceId:r.workspaceId},payload:a,reactivityKeys:{sources:[r.workspaceId]}});E.startTransition(()=>{e.detail(o.id,{tab:"model"})})}})]})}):f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:f.jsx("div",{className:"mx-auto w-full max-w-3xl px-6 py-10",children:f.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading workspace..."})})})}function J8e(e){const t=rs();return t.enabled?f.jsx(Q8e,{source:e.source,workspaceId:t.workspaceId}):f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:f.jsx("div",{className:"mx-auto w-full max-w-3xl px-6 py-10",children:f.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading workspace..."})})})}function Q8e(e){const t=Qs(),n=Fk(),r=Qi(n.query("openapi","getSourceConfig",{path:{workspaceId:e.workspaceId,sourceId:e.source.id},reactivityKeys:{source:[e.workspaceId,e.source.id]},timeToLive:"30 seconds"})),s=Dt(n.mutation("openapi","updateSource"),{mode:"promise"});return Ss(r)?f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:f.jsxs("div",{className:"mx-auto w-full max-w-3xl px-6 py-10",children:[f.jsxs("div",{className:"mb-8",children:[f.jsx("h1",{className:"font-display text-2xl tracking-tight text-foreground",children:"Edit OpenAPI Source"}),f.jsxs("p",{className:"mt-1.5 text-sm leading-6 text-muted-foreground",children:["Update the connection settings for ",e.source.name,"."]})]}),f.jsx($G,{mode:"edit",workspaceId:e.workspaceId,initialValue:H8e(r.value),submitLabel:"Save Changes",busyLabel:"Saving...",onSubmit:async a=>{const o=await s({path:{workspaceId:e.workspaceId,sourceId:e.source.id},payload:a,reactivityKeys:{sources:[e.workspaceId],source:[e.workspaceId,e.source.id],sourceInspection:[e.workspaceId,e.source.id],sourceInspectionTool:[e.workspaceId,e.source.id],sourceDiscovery:[e.workspaceId,e.source.id]}});E.startTransition(()=>{t.detail(o.id,{tab:"model"})})}})]})}):f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:f.jsx("div",{className:"mx-auto w-full max-w-3xl px-6 py-10",children:Kd(r)?f.jsx(ts,{variant:"destructive",children:"Failed loading source configuration."}):f.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading configuration..."})})})}function X8e(e){const t=rs();return t.enabled?f.jsx(Z8e,{source:e.source,workspaceId:t.workspaceId}):f.jsx(XE,{title:"Source",children:f.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading workspace..."})})}function Z8e(e){const t=Qs(),n=Fk(),r=Dt(n.mutation("openapi","removeSource"),{mode:"promise"}),s=Dt(n.mutation("openapi","refreshSource"),{mode:"promise"}),a=er(async h=>s({path:{workspaceId:e.workspaceId,sourceId:h},reactivityKeys:{sources:[e.workspaceId],source:[e.workspaceId,h],sourceInspection:[e.workspaceId,h],sourceInspectionTool:[e.workspaceId,h],sourceDiscovery:[e.workspaceId,h]}})),o=er(async h=>r({path:{workspaceId:e.workspaceId,sourceId:h},reactivityKeys:{sources:[e.workspaceId],source:[e.workspaceId,h],sourceInspection:[e.workspaceId,h],sourceInspectionTool:[e.workspaceId,h],sourceDiscovery:[e.workspaceId,h]}})),i=Rk(nc()),c=i.tab==="discover"?"discover":"model",u=i.query??"",[l,d]=E.useState(!1);return f.jsx(Nk,{sourceId:e.source.id,title:e.source.name,kind:e.source.kind,search:i,navigate:h=>t.updateSearch({tab:h.tab??c,...h.tool!==void 0?{tool:h.tool||void 0}:{tool:i.tool},...h.query!==void 0?{query:h.query||void 0}:{query:u}}),actions:f.jsxs(f.Fragment,{children:[f.jsx(Te,{variant:"outline",size:"sm",type:"button",onClick:()=>{a.mutateAsync(e.source.id)},disabled:a.status==="pending",children:a.status==="pending"?"Refreshing...":"Refresh"}),f.jsxs(Te,{variant:"outline",size:"sm",type:"button",onClick:()=>{t.edit(e.source.id)},children:[f.jsx(Im,{className:"size-3"}),"Edit"]}),l?f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-[11px] font-medium text-destructive",children:"Confirm delete?"}),f.jsx(Te,{variant:"outline",size:"sm",type:"button",onClick:()=>d(!1),disabled:o.status==="pending",children:"Cancel"}),f.jsx(Te,{variant:"destructive-outline",size:"sm",type:"button",onClick:()=>{o.mutateAsync(e.source.id).then(()=>{E.startTransition(()=>{t.home()})}).finally(()=>{d(!1)})},disabled:o.status==="pending",children:o.status==="pending"?"Deleting...":"Delete"})]}):f.jsx(Te,{variant:"destructive-outline",size:"sm",type:"button",onClick:()=>d(!0),disabled:o.status==="pending",children:"Delete"})]}),renderHeaderMeta:eBe,renderSchemaExtras:tBe})}const eBe=e=>e.summary.pathTemplate?f.jsx("span",{className:"font-mono text-[11px] text-muted-foreground/60",children:e.summary.pathTemplate}):null,tBe=e=>f.jsxs(f.Fragment,{children:[e.contract.input.exampleJson&&f.jsx(hs,{title:"Example request",body:e.contract.input.exampleJson,empty:"",compact:!0}),e.contract.output.exampleJson&&f.jsx(hs,{title:"Example response",body:e.contract.output.exampleJson,empty:"",compact:!0})]});function jG(e){const t=Ep(),n=typeof t.sourceId=="string"?t.sourceId:null,r=Zx(n??"");return n===null||r.status==="error"?f.jsx("div",{className:"px-6 py-8 text-sm text-destructive",children:"This OpenAPI source is unavailable."}):r.status==="loading"?f.jsx("div",{className:"px-6 py-8 text-sm text-muted-foreground",children:"Loading source..."}):r.data.kind!=="openapi"?f.jsxs("div",{className:"px-6 py-8 text-sm text-destructive",children:["Expected an `openapi` source, but received `",r.data.kind,"`."]}):e.children(r.data)}function nBe(){return f.jsx(jG,{children:e=>f.jsx(X8e,{source:e})})}function rBe(){return f.jsx(jG,{children:e=>f.jsx(J8e,{source:e})})}const sBe=_p({key:"openapi",displayName:"OpenAPI",routes:[{key:"add",path:"add",component:Br(()=>Y8e)},{key:"detail",path:"sources/$sourceId",component:Br(()=>nBe)},{key:"edit",path:"sources/$sourceId/edit",component:Br(()=>rBe)}]});function aBe(e,t){return e.endsWith(t)?e.length===t.length||e[e.length-t.length-1]===".":!1}function oBe(e,t){const n=e.length-t.length-2,r=e.lastIndexOf(".",n);return r===-1?e:e.slice(r+1)}function iBe(e,t,n){if(n.validHosts!==null){const s=n.validHosts;for(const a of s)if(aBe(t,a))return a}let r=0;if(t.startsWith("."))for(;r<t.length&&t[r]===".";)r+=1;return e.length===t.length-r?null:oBe(t,e)}function cBe(e,t){return e.slice(0,-t.length-1)}function Aj(e,t){let n=0,r=e.length,s=!1;if(!t){if(e.startsWith("data:"))return null;for(;n<e.length&&e.charCodeAt(n)<=32;)n+=1;for(;r>n+1&&e.charCodeAt(r-1)<=32;)r-=1;if(e.charCodeAt(n)===47&&e.charCodeAt(n+1)===47)n+=2;else{const u=e.indexOf(":/",n);if(u!==-1){const l=u-n,d=e.charCodeAt(n),h=e.charCodeAt(n+1),m=e.charCodeAt(n+2),p=e.charCodeAt(n+3),y=e.charCodeAt(n+4);if(!(l===5&&d===104&&h===116&&m===116&&p===112&&y===115)){if(!(l===4&&d===104&&h===116&&m===116&&p===112)){if(!(l===3&&d===119&&h===115&&m===115)){if(!(l===2&&d===119&&h===115))for(let g=n;g<u;g+=1){const b=e.charCodeAt(g)|32;if(!(b>=97&&b<=122||b>=48&&b<=57||b===46||b===45||b===43))return null}}}}for(n=u+2;e.charCodeAt(n)===47;)n+=1}}let o=-1,i=-1,c=-1;for(let u=n;u<r;u+=1){const l=e.charCodeAt(u);if(l===35||l===47||l===63){r=u;break}else l===64?o=u:l===93?i=u:l===58?c=u:l>=65&&l<=90&&(s=!0)}if(o!==-1&&o>n&&o<r&&(n=o+1),e.charCodeAt(n)===91)return i!==-1?e.slice(n+1,i).toLowerCase():null;c!==-1&&c>n&&c<r&&(r=c)}for(;r>n+1&&e.charCodeAt(r-1)===46;)r-=1;const a=n!==0||r!==e.length?e.slice(n,r):e;return s?a.toLowerCase():a}function uBe(e){if(e.length<7||e.length>15)return!1;let t=0;for(let n=0;n<e.length;n+=1){const r=e.charCodeAt(n);if(r===46)t+=1;else if(r<48||r>57)return!1}return t===3&&e.charCodeAt(0)!==46&&e.charCodeAt(e.length-1)!==46}function lBe(e){if(e.length<3)return!1;let t=e.startsWith("[")?1:0,n=e.length;if(e[n-1]==="]"&&(n-=1),n-t>39)return!1;let r=!1;for(;t<n;t+=1){const s=e.charCodeAt(t);if(s===58)r=!0;else if(!(s>=48&&s<=57||s>=97&&s<=102||s>=65&&s<=90))return!1}return r}function dBe(e){return lBe(e)||uBe(e)}function Nj(e){return e>=97&&e<=122||e>=48&&e<=57||e>127}function Rj(e){if(e.length>255||e.length===0||!Nj(e.charCodeAt(0))&&e.charCodeAt(0)!==46&&e.charCodeAt(0)!==95)return!1;let t=-1,n=-1;const r=e.length;for(let s=0;s<r;s+=1){const a=e.charCodeAt(s);if(a===46){if(s-t>64||n===46||n===45||n===95)return!1;t=s}else if(!(Nj(a)||a===45||a===95))return!1;n=a}return r-t-1<=63&&n!==45}function MG({allowIcannDomains:e=!0,allowPrivateDomains:t=!1,detectIp:n=!0,extractHostname:r=!0,mixedInputs:s=!0,validHosts:a=null,validateHostname:o=!0}){return{allowIcannDomains:e,allowPrivateDomains:t,detectIp:n,extractHostname:r,mixedInputs:s,validHosts:a,validateHostname:o}}const fBe=MG({});function hBe(e){return e===void 0?fBe:MG(e)}function mBe(e,t){return t.length===e.length?"":e.slice(0,-t.length-1)}function pBe(){return{domain:null,domainWithoutSuffix:null,hostname:null,isIcann:null,isIp:null,isPrivate:null,publicSuffix:null,subdomain:null}}function gBe(e,t,n,r,s){const a=hBe(r);return typeof e!="string"||(a.extractHostname?a.mixedInputs?s.hostname=Aj(e,Rj(e)):s.hostname=Aj(e,!1):s.hostname=e,a.detectIp&&s.hostname!==null&&(s.isIp=dBe(s.hostname),s.isIp))?s:a.validateHostname&&a.extractHostname&&s.hostname!==null&&!Rj(s.hostname)?(s.hostname=null,s):(s.hostname===null||(n(s.hostname,a,s),s.publicSuffix===null)||(s.domain=iBe(s.publicSuffix,s.hostname,a),s.domain===null)||(s.subdomain=mBe(s.hostname,s.domain),s.domainWithoutSuffix=cBe(s.domain,s.publicSuffix)),s)}function bBe(e,t,n){if(!t.allowPrivateDomains&&e.length>3){const r=e.length-1,s=e.charCodeAt(r),a=e.charCodeAt(r-1),o=e.charCodeAt(r-2),i=e.charCodeAt(r-3);if(s===109&&a===111&&o===99&&i===46)return n.isIcann=!0,n.isPrivate=!1,n.publicSuffix="com",!0;if(s===103&&a===114&&o===111&&i===46)return n.isIcann=!0,n.isPrivate=!1,n.publicSuffix="org",!0;if(s===117&&a===100&&o===101&&i===46)return n.isIcann=!0,n.isPrivate=!1,n.publicSuffix="edu",!0;if(s===118&&a===111&&o===103&&i===46)return n.isIcann=!0,n.isPrivate=!1,n.publicSuffix="gov",!0;if(s===116&&a===101&&o===110&&i===46)return n.isIcann=!0,n.isPrivate=!1,n.publicSuffix="net",!0;if(s===101&&a===100&&o===46)return n.isIcann=!0,n.isPrivate=!1,n.publicSuffix="de",!0}return!1}const yBe=(function(){const e=[1,{}],t=[0,{city:e}];return[0,{ck:[0,{www:e}],jp:[0,{kawasaki:t,kitakyushu:t,kobe:t,nagoya:t,sapporo:t,sendai:t,yokohama:t}]}]})(),xBe=(function(){const e=[1,{}],t=[2,{}],n=[1,{com:e,edu:e,gov:e,net:e,org:e}],r=[1,{com:e,edu:e,gov:e,mil:e,net:e,org:e}],s=[0,{"*":t}],a=[2,{s}],o=[0,{relay:t}],i=[2,{id:t}],c=[1,{gov:e}],u=[0,{airflow:s,"lambda-url":t,"transfer-webapp":t}],l=[0,{airflow:s,"transfer-webapp":t}],d=[0,{"transfer-webapp":t}],h=[0,{"transfer-webapp":t,"transfer-webapp-fips":t}],m=[0,{notebook:t,studio:t}],p=[0,{labeling:t,notebook:t,studio:t}],y=[0,{notebook:t}],g=[0,{labeling:t,notebook:t,"notebook-fips":t,studio:t}],b=[0,{notebook:t,"notebook-fips":t,studio:t,"studio-fips":t}],x=[0,{shop:t}],k=[0,{"*":e}],_=[1,{co:t}],S=[0,{objects:t}],w=[2,{"eu-west-1":t,"us-east-1":t}],T=[2,{nodes:t}],A=[0,{my:t}],L=[0,{s3:t,"s3-accesspoint":t,"s3-website":t}],R=[0,{s3:t,"s3-accesspoint":t}],j=[0,{direct:t}],F=[0,{"webview-assets":t}],K=[0,{vfs:t,"webview-assets":t}],Y=[0,{"execute-api":t,"emrappui-prod":t,"emrnotebooks-prod":t,"emrstudio-prod":t,dualstack:L,s3:t,"s3-accesspoint":t,"s3-object-lambda":t,"s3-website":t,"aws-cloud9":F,cloud9:K}],W=[0,{"execute-api":t,"emrappui-prod":t,"emrnotebooks-prod":t,"emrstudio-prod":t,dualstack:R,s3:t,"s3-accesspoint":t,"s3-object-lambda":t,"s3-website":t,"aws-cloud9":F,cloud9:K}],J=[0,{"execute-api":t,"emrappui-prod":t,"emrnotebooks-prod":t,"emrstudio-prod":t,dualstack:L,s3:t,"s3-accesspoint":t,"s3-object-lambda":t,"s3-website":t,"analytics-gateway":t,"aws-cloud9":F,cloud9:K}],ae=[0,{"execute-api":t,"emrappui-prod":t,"emrnotebooks-prod":t,"emrstudio-prod":t,dualstack:L,s3:t,"s3-accesspoint":t,"s3-object-lambda":t,"s3-website":t}],ge=[0,{s3:t,"s3-accesspoint":t,"s3-accesspoint-fips":t,"s3-fips":t,"s3-website":t}],le=[0,{"execute-api":t,"emrappui-prod":t,"emrnotebooks-prod":t,"emrstudio-prod":t,dualstack:ge,s3:t,"s3-accesspoint":t,"s3-accesspoint-fips":t,"s3-fips":t,"s3-object-lambda":t,"s3-website":t,"aws-cloud9":F,cloud9:K}],I=[0,{"execute-api":t,"emrappui-prod":t,"emrnotebooks-prod":t,"emrstudio-prod":t,dualstack:ge,s3:t,"s3-accesspoint":t,"s3-accesspoint-fips":t,"s3-fips":t,"s3-object-lambda":t,"s3-website":t}],U=[0,{"execute-api":t,"emrappui-prod":t,"emrnotebooks-prod":t,"emrstudio-prod":t,dualstack:ge,s3:t,"s3-accesspoint":t,"s3-accesspoint-fips":t,"s3-deprecated":t,"s3-fips":t,"s3-object-lambda":t,"s3-website":t,"analytics-gateway":t,"aws-cloud9":F,cloud9:K}],V=[0,{auth:t}],N=[0,{auth:t,"auth-fips":t}],P=[0,{"auth-fips":t}],D=[0,{apps:t}],Q=[0,{paas:t}],pe=[2,{eu:t}],ce=[0,{app:t}],Ee=[0,{site:t}],Ne=[1,{com:e,edu:e,net:e,org:e}],G=[0,{j:t}],X=[0,{dyn:t}],ee=[2,{web:t}],oe=[1,{co:e,com:e,edu:e,gov:e,net:e,org:e}],be=[0,{p:t}],Oe=[0,{user:t}],fe=[1,{ms:t}],ve=[0,{cdn:t}],ze=[2,{raw:s}],Se=[0,{cust:t,reservd:t}],re=[0,{cust:t}],Ie=[0,{s3:t}],We=[1,{biz:e,com:e,edu:e,gov:e,info:e,net:e,org:e}],Ft=[0,{ipfs:t}],an=[1,{framer:t}],te=[0,{forgot:t}],ue=[0,{blob:t,file:t,web:t}],$e=[0,{core:ue,servicebus:t}],we=[1,{gs:e}],Ge=[0,{nes:e}],Re=[1,{k12:e,cc:e,lib:e}],as=[1,{cc:e}],yr=[1,{cc:e,lib:e}];return[0,{ac:[1,{com:e,edu:e,gov:e,mil:e,net:e,org:e,drr:t,feedback:t,forms:t}],ad:e,ae:[1,{ac:e,co:e,gov:e,mil:e,net:e,org:e,sch:e}],aero:[1,{airline:e,airport:e,"accident-investigation":e,"accident-prevention":e,aerobatic:e,aeroclub:e,aerodrome:e,agents:e,"air-surveillance":e,"air-traffic-control":e,aircraft:e,airtraffic:e,ambulance:e,association:e,author:e,ballooning:e,broker:e,caa:e,cargo:e,catering:e,certification:e,championship:e,charter:e,civilaviation:e,club:e,conference:e,consultant:e,consulting:e,control:e,council:e,crew:e,design:e,dgca:e,educator:e,emergency:e,engine:e,engineer:e,entertainment:e,equipment:e,exchange:e,express:e,federation:e,flight:e,freight:e,fuel:e,gliding:e,government:e,groundhandling:e,group:e,hanggliding:e,homebuilt:e,insurance:e,journal:e,journalist:e,leasing:e,logistics:e,magazine:e,maintenance:e,marketplace:e,media:e,microlight:e,modelling:e,navigation:e,parachuting:e,paragliding:e,"passenger-association":e,pilot:e,press:e,production:e,recreation:e,repbody:e,res:e,research:e,rotorcraft:e,safety:e,scientist:e,services:e,show:e,skydiving:e,software:e,student:e,taxi:e,trader:e,trading:e,trainer:e,union:e,workinggroup:e,works:e}],af:n,ag:[1,{co:e,com:e,net:e,nom:e,org:e,obj:t}],ai:[1,{com:e,net:e,off:e,org:e,uwu:t,framer:t,kiloapps:t}],al:r,am:[1,{co:e,com:e,commune:e,net:e,org:e,radio:t}],ao:[1,{co:e,ed:e,edu:e,gov:e,gv:e,it:e,og:e,org:e,pb:e}],aq:e,ar:[1,{bet:e,com:e,coop:e,edu:e,gob:e,gov:e,int:e,mil:e,musica:e,mutual:e,net:e,org:e,seg:e,senasa:e,tur:e}],arpa:[1,{e164:e,home:e,"in-addr":e,ip6:e,iris:e,uri:e,urn:e}],as:c,asia:[1,{cloudns:t,daemon:t,dix:t}],at:[1,{4:t,ac:[1,{sth:e}],co:e,gv:e,or:e,funkfeuer:[0,{wien:t}],futurecms:[0,{"*":t,ex:s,in:s}],futurehosting:t,futuremailing:t,ortsinfo:[0,{ex:s,kunden:s}],biz:t,info:t,"123webseite":t,priv:t,my:t,myspreadshop:t,"12hp":t,"2ix":t,"4lima":t,"lima-city":t}],au:[1,{asn:e,com:[1,{cloudlets:[0,{mel:t}],myspreadshop:t}],edu:[1,{act:e,catholic:e,nsw:e,nt:e,qld:e,sa:e,tas:e,vic:e,wa:e}],gov:[1,{qld:e,sa:e,tas:e,vic:e,wa:e}],id:e,net:e,org:e,conf:e,oz:e,act:e,nsw:e,nt:e,qld:e,sa:e,tas:e,vic:e,wa:e,hrsn:[0,{vps:t}]}],aw:[1,{com:e}],ax:e,az:[1,{biz:e,co:e,com:e,edu:e,gov:e,info:e,int:e,mil:e,name:e,net:e,org:e,pp:e,pro:e}],ba:[1,{com:e,edu:e,gov:e,mil:e,net:e,org:e,brendly:x,rs:t}],bb:[1,{biz:e,co:e,com:e,edu:e,gov:e,info:e,net:e,org:e,store:e,tv:e}],bd:[1,{ac:e,ai:e,co:e,com:e,edu:e,gov:e,id:e,info:e,it:e,mil:e,net:e,org:e,sch:e,tv:e}],be:[1,{ac:e,cloudns:t,webhosting:t,interhostsolutions:[0,{cloud:t}],kuleuven:[0,{ezproxy:t}],my:t,"123website":t,myspreadshop:t,transurl:s}],bf:c,bg:[1,{0:e,1:e,2:e,3:e,4:e,5:e,6:e,7:e,8:e,9:e,a:e,b:e,c:e,d:e,e,f:e,g:e,h:e,i:e,j:e,k:e,l:e,m:e,n:e,o:e,p:e,q:e,r:e,s:e,t:e,u:e,v:e,w:e,x:e,y:e,z:e,barsy:t}],bh:n,bi:[1,{co:e,com:e,edu:e,or:e,org:e}],biz:[1,{activetrail:t,"cloud-ip":t,cloudns:t,jozi:t,dyndns:t,"for-better":t,"for-more":t,"for-some":t,"for-the":t,selfip:t,webhop:t,orx:t,mmafan:t,myftp:t,"no-ip":t,dscloud:t}],bj:[1,{africa:e,agro:e,architectes:e,assur:e,avocats:e,co:e,com:e,eco:e,econo:e,edu:e,info:e,loisirs:e,money:e,net:e,org:e,ote:e,restaurant:e,resto:e,tourism:e,univ:e}],bm:n,bn:[1,{com:e,edu:e,gov:e,net:e,org:e,co:t}],bo:[1,{com:e,edu:e,gob:e,int:e,mil:e,net:e,org:e,tv:e,web:e,academia:e,agro:e,arte:e,blog:e,bolivia:e,ciencia:e,cooperativa:e,democracia:e,deporte:e,ecologia:e,economia:e,empresa:e,indigena:e,industria:e,info:e,medicina:e,movimiento:e,musica:e,natural:e,nombre:e,noticias:e,patria:e,plurinacional:e,politica:e,profesional:e,pueblo:e,revista:e,salud:e,tecnologia:e,tksat:e,transporte:e,wiki:e}],br:[1,{"9guacu":e,abc:e,adm:e,adv:e,agr:e,aju:e,am:e,anani:e,aparecida:e,api:e,app:e,arq:e,art:e,ato:e,b:e,barueri:e,belem:e,bet:e,bhz:e,bib:e,bio:e,blog:e,bmd:e,boavista:e,bsb:e,campinagrande:e,campinas:e,caxias:e,cim:e,cng:e,cnt:e,com:[1,{simplesite:t}],contagem:e,coop:e,coz:e,cri:e,cuiaba:e,curitiba:e,def:e,des:e,det:e,dev:e,ecn:e,eco:e,edu:e,emp:e,enf:e,eng:e,esp:e,etc:e,eti:e,far:e,feira:e,flog:e,floripa:e,fm:e,fnd:e,fortal:e,fot:e,foz:e,fst:e,g12:e,geo:e,ggf:e,goiania:e,gov:[1,{ac:e,al:e,am:e,ap:e,ba:e,ce:e,df:e,es:e,go:e,ma:e,mg:e,ms:e,mt:e,pa:e,pb:e,pe:e,pi:e,pr:e,rj:e,rn:e,ro:e,rr:e,rs:e,sc:e,se:e,sp:e,to:e}],gru:e,ia:e,imb:e,ind:e,inf:e,jab:e,jampa:e,jdf:e,joinville:e,jor:e,jus:e,leg:[1,{ac:t,al:t,am:t,ap:t,ba:t,ce:t,df:t,es:t,go:t,ma:t,mg:t,ms:t,mt:t,pa:t,pb:t,pe:t,pi:t,pr:t,rj:t,rn:t,ro:t,rr:t,rs:t,sc:t,se:t,sp:t,to:t}],leilao:e,lel:e,log:e,londrina:e,macapa:e,maceio:e,manaus:e,maringa:e,mat:e,med:e,mil:e,morena:e,mp:e,mus:e,natal:e,net:e,niteroi:e,nom:k,not:e,ntr:e,odo:e,ong:e,org:e,osasco:e,palmas:e,poa:e,ppg:e,pro:e,psc:e,psi:e,pvh:e,qsl:e,radio:e,rec:e,recife:e,rep:e,ribeirao:e,rio:e,riobranco:e,riopreto:e,salvador:e,sampa:e,santamaria:e,santoandre:e,saobernardo:e,saogonca:e,seg:e,sjc:e,slg:e,slz:e,social:e,sorocaba:e,srv:e,taxi:e,tc:e,tec:e,teo:e,the:e,tmp:e,trd:e,tur:e,tv:e,udi:e,vet:e,vix:e,vlog:e,wiki:e,xyz:e,zlg:e,tche:t}],bs:[1,{com:e,edu:e,gov:e,net:e,org:e,we:t}],bt:n,bv:e,bw:[1,{ac:e,co:e,gov:e,net:e,org:e}],by:[1,{gov:e,mil:e,com:e,of:e,mediatech:t}],bz:[1,{co:e,com:e,edu:e,gov:e,net:e,org:e,za:t,mydns:t,gsj:t}],ca:[1,{ab:e,bc:e,mb:e,nb:e,nf:e,nl:e,ns:e,nt:e,nu:e,on:e,pe:e,qc:e,sk:e,yk:e,gc:e,barsy:t,awdev:s,co:t,"no-ip":t,onid:t,myspreadshop:t,box:t}],cat:e,cc:[1,{cleverapps:t,"cloud-ip":t,cloudns:t,ccwu:t,ftpaccess:t,"game-server":t,myphotos:t,scrapping:t,twmail:t,csx:t,fantasyleague:t,spawn:[0,{instances:t}],ec:t,eu:t,gu:t,uk:t,us:t}],cd:[1,{gov:e,cc:t}],cf:e,cg:e,ch:[1,{square7:t,cloudns:t,cloudscale:[0,{cust:t,lpg:S,rma:S}],objectstorage:[0,{lpg:t,rma:t}],flow:[0,{ae:[0,{alp1:t}],appengine:t}],"linkyard-cloud":t,gotdns:t,dnsking:t,"123website":t,myspreadshop:t,firenet:[0,{"*":t,svc:s}],"12hp":t,"2ix":t,"4lima":t,"lima-city":t}],ci:[1,{ac:e,"xn--aroport-bya":e,aéroport:e,asso:e,co:e,com:e,ed:e,edu:e,go:e,gouv:e,int:e,net:e,or:e,org:e,us:t}],ck:k,cl:[1,{co:e,gob:e,gov:e,mil:e,cloudns:t}],cm:[1,{co:e,com:e,gov:e,net:e}],cn:[1,{ac:e,com:[1,{amazonaws:[0,{"cn-north-1":[0,{"execute-api":t,"emrappui-prod":t,"emrnotebooks-prod":t,"emrstudio-prod":t,rds:s,dualstack:L,s3:t,"s3-accesspoint":t,"s3-deprecated":t,"s3-object-lambda":t,"s3-website":t}],"cn-northwest-1":[0,{"execute-api":t,"emrappui-prod":t,"emrnotebooks-prod":t,"emrstudio-prod":t,rds:s,dualstack:R,s3:t,"s3-accesspoint":t,"s3-object-lambda":t,"s3-website":t}],compute:s,airflow:[0,{"cn-north-1":s,"cn-northwest-1":s}],eb:[0,{"cn-north-1":t,"cn-northwest-1":t}],elb:s}],amazonwebservices:[0,{on:[0,{"cn-north-1":l,"cn-northwest-1":l}]}],sagemaker:[0,{"cn-north-1":m,"cn-northwest-1":m}]}],edu:e,gov:e,mil:e,net:e,org:e,"xn--55qx5d":e,公司:e,"xn--od0alg":e,網絡:e,"xn--io0a7i":e,网络:e,ah:e,bj:e,cq:e,fj:e,gd:e,gs:e,gx:e,gz:e,ha:e,hb:e,he:e,hi:e,hk:e,hl:e,hn:e,jl:e,js:e,jx:e,ln:e,mo:e,nm:e,nx:e,qh:e,sc:e,sd:e,sh:[1,{as:t}],sn:e,sx:e,tj:e,tw:e,xj:e,xz:e,yn:e,zj:e,"canva-apps":t,canvasite:A,myqnapcloud:t,quickconnect:j}],co:[1,{com:e,edu:e,gov:e,mil:e,net:e,nom:e,org:e,carrd:t,crd:t,otap:s,hidns:t,leadpages:t,lpages:t,mypi:t,xmit:s,rdpa:[0,{clusters:s,srvrless:s}],firewalledreplit:i,repl:i,supabase:[2,{realtime:t,storage:t}],umso:t}],com:[1,{a2hosted:t,cpserver:t,adobeaemcloud:[2,{dev:s}],africa:t,auiusercontent:s,aivencloud:t,alibabacloudcs:t,kasserver:t,amazonaws:[0,{"af-south-1":Y,"ap-east-1":W,"ap-northeast-1":J,"ap-northeast-2":J,"ap-northeast-3":Y,"ap-south-1":J,"ap-south-2":ae,"ap-southeast-1":J,"ap-southeast-2":J,"ap-southeast-3":ae,"ap-southeast-4":ae,"ap-southeast-5":[0,{"execute-api":t,dualstack:L,s3:t,"s3-accesspoint":t,"s3-deprecated":t,"s3-object-lambda":t,"s3-website":t}],"ca-central-1":le,"ca-west-1":I,"eu-central-1":J,"eu-central-2":ae,"eu-north-1":W,"eu-south-1":Y,"eu-south-2":ae,"eu-west-1":[0,{"execute-api":t,"emrappui-prod":t,"emrnotebooks-prod":t,"emrstudio-prod":t,dualstack:L,s3:t,"s3-accesspoint":t,"s3-deprecated":t,"s3-object-lambda":t,"s3-website":t,"analytics-gateway":t,"aws-cloud9":F,cloud9:K}],"eu-west-2":W,"eu-west-3":Y,"il-central-1":[0,{"execute-api":t,"emrappui-prod":t,"emrnotebooks-prod":t,"emrstudio-prod":t,dualstack:L,s3:t,"s3-accesspoint":t,"s3-object-lambda":t,"s3-website":t,"aws-cloud9":F,cloud9:[0,{vfs:t}]}],"me-central-1":ae,"me-south-1":W,"sa-east-1":Y,"us-east-1":[2,{"execute-api":t,"emrappui-prod":t,"emrnotebooks-prod":t,"emrstudio-prod":t,dualstack:ge,s3:t,"s3-accesspoint":t,"s3-accesspoint-fips":t,"s3-deprecated":t,"s3-fips":t,"s3-object-lambda":t,"s3-website":t,"analytics-gateway":t,"aws-cloud9":F,cloud9:K}],"us-east-2":U,"us-gov-east-1":I,"us-gov-west-1":I,"us-west-1":le,"us-west-2":U,compute:s,"compute-1":s,airflow:[0,{"af-south-1":s,"ap-east-1":s,"ap-northeast-1":s,"ap-northeast-2":s,"ap-northeast-3":s,"ap-south-1":s,"ap-south-2":s,"ap-southeast-1":s,"ap-southeast-2":s,"ap-southeast-3":s,"ap-southeast-4":s,"ap-southeast-5":s,"ap-southeast-7":s,"ca-central-1":s,"ca-west-1":s,"eu-central-1":s,"eu-central-2":s,"eu-north-1":s,"eu-south-1":s,"eu-south-2":s,"eu-west-1":s,"eu-west-2":s,"eu-west-3":s,"il-central-1":s,"me-central-1":s,"me-south-1":s,"sa-east-1":s,"us-east-1":s,"us-east-2":s,"us-west-1":s,"us-west-2":s}],rds:[0,{"af-south-1":s,"ap-east-1":s,"ap-east-2":s,"ap-northeast-1":s,"ap-northeast-2":s,"ap-northeast-3":s,"ap-south-1":s,"ap-south-2":s,"ap-southeast-1":s,"ap-southeast-2":s,"ap-southeast-3":s,"ap-southeast-4":s,"ap-southeast-5":s,"ap-southeast-6":s,"ap-southeast-7":s,"ca-central-1":s,"ca-west-1":s,"eu-central-1":s,"eu-central-2":s,"eu-west-1":s,"eu-west-2":s,"eu-west-3":s,"il-central-1":s,"me-central-1":s,"me-south-1":s,"mx-central-1":s,"sa-east-1":s,"us-east-1":s,"us-east-2":s,"us-gov-east-1":s,"us-gov-west-1":s,"us-northeast-1":s,"us-west-1":s,"us-west-2":s}],s3:t,"s3-1":t,"s3-ap-east-1":t,"s3-ap-northeast-1":t,"s3-ap-northeast-2":t,"s3-ap-northeast-3":t,"s3-ap-south-1":t,"s3-ap-southeast-1":t,"s3-ap-southeast-2":t,"s3-ca-central-1":t,"s3-eu-central-1":t,"s3-eu-north-1":t,"s3-eu-west-1":t,"s3-eu-west-2":t,"s3-eu-west-3":t,"s3-external-1":t,"s3-fips-us-gov-east-1":t,"s3-fips-us-gov-west-1":t,"s3-global":[0,{accesspoint:[0,{mrap:t}]}],"s3-me-south-1":t,"s3-sa-east-1":t,"s3-us-east-2":t,"s3-us-gov-east-1":t,"s3-us-gov-west-1":t,"s3-us-west-1":t,"s3-us-west-2":t,"s3-website-ap-northeast-1":t,"s3-website-ap-southeast-1":t,"s3-website-ap-southeast-2":t,"s3-website-eu-west-1":t,"s3-website-sa-east-1":t,"s3-website-us-east-1":t,"s3-website-us-gov-west-1":t,"s3-website-us-west-1":t,"s3-website-us-west-2":t,elb:s}],amazoncognito:[0,{"af-south-1":V,"ap-east-1":V,"ap-northeast-1":V,"ap-northeast-2":V,"ap-northeast-3":V,"ap-south-1":V,"ap-south-2":V,"ap-southeast-1":V,"ap-southeast-2":V,"ap-southeast-3":V,"ap-southeast-4":V,"ap-southeast-5":V,"ap-southeast-7":V,"ca-central-1":V,"ca-west-1":V,"eu-central-1":V,"eu-central-2":V,"eu-north-1":V,"eu-south-1":V,"eu-south-2":V,"eu-west-1":V,"eu-west-2":V,"eu-west-3":V,"il-central-1":V,"me-central-1":V,"me-south-1":V,"mx-central-1":V,"sa-east-1":V,"us-east-1":N,"us-east-2":N,"us-gov-east-1":P,"us-gov-west-1":P,"us-west-1":N,"us-west-2":N}],amplifyapp:t,awsapprunner:s,awsapps:t,elasticbeanstalk:[2,{"af-south-1":t,"ap-east-1":t,"ap-northeast-1":t,"ap-northeast-2":t,"ap-northeast-3":t,"ap-south-1":t,"ap-southeast-1":t,"ap-southeast-2":t,"ap-southeast-3":t,"ap-southeast-5":t,"ap-southeast-7":t,"ca-central-1":t,"eu-central-1":t,"eu-north-1":t,"eu-south-1":t,"eu-south-2":t,"eu-west-1":t,"eu-west-2":t,"eu-west-3":t,"il-central-1":t,"me-central-1":t,"me-south-1":t,"sa-east-1":t,"us-east-1":t,"us-east-2":t,"us-gov-east-1":t,"us-gov-west-1":t,"us-west-1":t,"us-west-2":t}],awsglobalaccelerator:t,siiites:t,appspacehosted:t,appspaceusercontent:t,"on-aptible":t,myasustor:t,"balena-devices":t,boutir:t,bplaced:t,cafjs:t,"canva-apps":t,"canva-hosted-embed":t,canvacode:t,"rice-labs":t,"cdn77-storage":t,br:t,cn:t,de:t,eu:t,jpn:t,mex:t,ru:t,sa:t,uk:t,us:t,za:t,"clever-cloud":[0,{services:s}],abrdns:t,dnsabr:t,"ip-ddns":t,jdevcloud:t,wpdevcloud:t,"cf-ipfs":t,"cloudflare-ipfs":t,trycloudflare:t,co:t,devinapps:s,builtwithdark:t,datadetect:[0,{demo:t,instance:t}],dattolocal:t,dattorelay:t,dattoweb:t,mydatto:t,digitaloceanspaces:s,discordsays:t,discordsez:t,drayddns:t,dreamhosters:t,durumis:t,blogdns:t,cechire:t,dnsalias:t,dnsdojo:t,doesntexist:t,dontexist:t,doomdns:t,"dyn-o-saur":t,dynalias:t,"dyndns-at-home":t,"dyndns-at-work":t,"dyndns-blog":t,"dyndns-free":t,"dyndns-home":t,"dyndns-ip":t,"dyndns-mail":t,"dyndns-office":t,"dyndns-pics":t,"dyndns-remote":t,"dyndns-server":t,"dyndns-web":t,"dyndns-wiki":t,"dyndns-work":t,"est-a-la-maison":t,"est-a-la-masion":t,"est-le-patron":t,"est-mon-blogueur":t,"from-ak":t,"from-al":t,"from-ar":t,"from-ca":t,"from-ct":t,"from-dc":t,"from-de":t,"from-fl":t,"from-ga":t,"from-hi":t,"from-ia":t,"from-id":t,"from-il":t,"from-in":t,"from-ks":t,"from-ky":t,"from-ma":t,"from-md":t,"from-mi":t,"from-mn":t,"from-mo":t,"from-ms":t,"from-mt":t,"from-nc":t,"from-nd":t,"from-ne":t,"from-nh":t,"from-nj":t,"from-nm":t,"from-nv":t,"from-oh":t,"from-ok":t,"from-or":t,"from-pa":t,"from-pr":t,"from-ri":t,"from-sc":t,"from-sd":t,"from-tn":t,"from-tx":t,"from-ut":t,"from-va":t,"from-vt":t,"from-wa":t,"from-wi":t,"from-wv":t,"from-wy":t,getmyip:t,gotdns:t,"hobby-site":t,homelinux:t,homeunix:t,iamallama:t,"is-a-anarchist":t,"is-a-blogger":t,"is-a-bookkeeper":t,"is-a-bulls-fan":t,"is-a-caterer":t,"is-a-chef":t,"is-a-conservative":t,"is-a-cpa":t,"is-a-cubicle-slave":t,"is-a-democrat":t,"is-a-designer":t,"is-a-doctor":t,"is-a-financialadvisor":t,"is-a-geek":t,"is-a-green":t,"is-a-guru":t,"is-a-hard-worker":t,"is-a-hunter":t,"is-a-landscaper":t,"is-a-lawyer":t,"is-a-liberal":t,"is-a-libertarian":t,"is-a-llama":t,"is-a-musician":t,"is-a-nascarfan":t,"is-a-nurse":t,"is-a-painter":t,"is-a-personaltrainer":t,"is-a-photographer":t,"is-a-player":t,"is-a-republican":t,"is-a-rockstar":t,"is-a-socialist":t,"is-a-student":t,"is-a-teacher":t,"is-a-techie":t,"is-a-therapist":t,"is-an-accountant":t,"is-an-actor":t,"is-an-actress":t,"is-an-anarchist":t,"is-an-artist":t,"is-an-engineer":t,"is-an-entertainer":t,"is-certified":t,"is-gone":t,"is-into-anime":t,"is-into-cars":t,"is-into-cartoons":t,"is-into-games":t,"is-leet":t,"is-not-certified":t,"is-slick":t,"is-uberleet":t,"is-with-theband":t,"isa-geek":t,"isa-hockeynut":t,issmarterthanyou:t,"likes-pie":t,likescandy:t,"neat-url":t,"saves-the-whales":t,selfip:t,"sells-for-less":t,"sells-for-u":t,servebbs:t,"simple-url":t,"space-to-rent":t,"teaches-yoga":t,writesthisblog:t,"1cooldns":t,bumbleshrimp:t,ddnsfree:t,ddnsgeek:t,ddnsguru:t,dynuddns:t,dynuhosting:t,giize:t,gleeze:t,kozow:t,loseyourip:t,ooguy:t,pivohosting:t,theworkpc:t,wiredbladehosting:t,emergentagent:[0,{preview:t}],mytuleap:t,"tuleap-partners":t,encoreapi:t,evennode:[0,{"eu-1":t,"eu-2":t,"eu-3":t,"eu-4":t,"us-1":t,"us-2":t,"us-3":t,"us-4":t}],onfabrica:t,"fastly-edge":t,"fastly-terrarium":t,"fastvps-server":t,mydobiss:t,firebaseapp:t,fldrv:t,framercanvas:t,"freebox-os":t,freeboxos:t,freemyip:t,aliases121:t,gentapps:t,gentlentapis:t,githubusercontent:t,"0emm":s,appspot:[2,{r:s}],blogspot:t,codespot:t,googleapis:t,googlecode:t,pagespeedmobilizer:t,withgoogle:t,withyoutube:t,grayjayleagues:t,hatenablog:t,hatenadiary:t,"hercules-app":t,"hercules-dev":t,herokuapp:t,gr:t,smushcdn:t,wphostedmail:t,wpmucdn:t,pixolino:t,"apps-1and1":t,"live-website":t,"webspace-host":t,dopaas:t,"hosted-by-previder":Q,hosteur:[0,{"rag-cloud":t,"rag-cloud-ch":t}],"ik-server":[0,{jcloud:t,"jcloud-ver-jpc":t}],jelastic:[0,{demo:t}],massivegrid:Q,wafaicloud:[0,{jed:t,ryd:t}],"eu1-plenit":t,"la1-plenit":t,"us1-plenit":t,webadorsite:t,"on-forge":t,"on-vapor":t,lpusercontent:t,linode:[0,{members:t,nodebalancer:s}],linodeobjects:s,linodeusercontent:[0,{ip:t}],localtonet:t,lovableproject:t,barsycenter:t,barsyonline:t,lutrausercontent:s,magicpatternsapp:t,modelscape:t,mwcloudnonprod:t,polyspace:t,mazeplay:t,miniserver:t,atmeta:t,fbsbx:D,meteorapp:pe,routingthecloud:t,"same-app":t,"same-preview":t,mydbserver:t,mochausercontent:t,hostedpi:t,"mythic-beasts":[0,{caracal:t,customer:t,fentiger:t,lynx:t,ocelot:t,oncilla:t,onza:t,sphinx:t,vs:t,x:t,yali:t}],nospamproxy:[0,{cloud:[2,{o365:t}]}],"4u":t,nfshost:t,"3utilities":t,blogsyte:t,ciscofreak:t,damnserver:t,ddnsking:t,ditchyourip:t,dnsiskinky:t,dynns:t,geekgalaxy:t,"health-carereform":t,homesecuritymac:t,homesecuritypc:t,myactivedirectory:t,mysecuritycamera:t,myvnc:t,"net-freaks":t,onthewifi:t,point2this:t,quicksytes:t,securitytactics:t,servebeer:t,servecounterstrike:t,serveexchange:t,serveftp:t,servegame:t,servehalflife:t,servehttp:t,servehumour:t,serveirc:t,servemp3:t,servep2p:t,servepics:t,servequake:t,servesarcasm:t,stufftoread:t,unusualperson:t,workisboring:t,myiphost:t,observableusercontent:[0,{static:t}],simplesite:t,oaiusercontent:s,orsites:t,operaunite:t,"customer-oci":[0,{"*":t,oci:s,ocp:s,ocs:s}],oraclecloudapps:s,oraclegovcloudapps:s,"authgear-staging":t,authgearapps:t,outsystemscloud:t,ownprovider:t,pgfog:t,pagexl:t,gotpantheon:t,paywhirl:s,forgeblocks:t,upsunapp:t,"postman-echo":t,prgmr:[0,{xen:t}],"project-study":[0,{dev:t}],pythonanywhere:pe,qa2:t,"alpha-myqnapcloud":t,"dev-myqnapcloud":t,mycloudnas:t,mynascloud:t,myqnapcloud:t,qualifioapp:t,ladesk:t,qualyhqpartner:s,qualyhqportal:s,qbuser:t,quipelements:s,rackmaze:t,"readthedocs-hosted":t,rhcloud:t,onrender:t,render:ce,"subsc-pay":t,"180r":t,dojin:t,sakuratan:t,sakuraweb:t,x0:t,code:[0,{builder:s,"dev-builder":s,"stg-builder":s}],salesforce:[0,{platform:[0,{"code-builder-stg":[0,{test:[0,{"001":s}]}]}]}],logoip:t,scrysec:t,"firewall-gateway":t,myshopblocks:t,myshopify:t,shopitsite:t,"1kapp":t,appchizi:t,applinzi:t,sinaapp:t,vipsinaapp:t,streamlitapp:t,"try-snowplow":t,"playstation-cloud":t,myspreadshop:t,"w-corp-staticblitz":t,"w-credentialless-staticblitz":t,"w-staticblitz":t,"stackhero-network":t,stdlib:[0,{api:t}],strapiapp:[2,{media:t}],"streak-link":t,streaklinks:t,streakusercontent:t,"temp-dns":t,dsmynas:t,familyds:t,mytabit:t,taveusercontent:t,"tb-hosting":Ee,reservd:t,thingdustdata:t,"townnews-staging":t,typeform:[0,{pro:t}],hk:t,it:t,"deus-canvas":t,vultrobjects:s,wafflecell:t,hotelwithflight:t,"reserve-online":t,cprapid:t,pleskns:t,remotewd:t,wiardweb:[0,{pages:t}],"drive-platform":t,"base44-sandbox":t,wixsite:t,wixstudio:t,messwithdns:t,"woltlab-demo":t,wpenginepowered:[2,{js:t}],xnbay:[2,{u2:t,"u2-local":t}],xtooldevice:t,yolasite:t}],coop:e,cr:[1,{ac:e,co:e,ed:e,fi:e,go:e,or:e,sa:e}],cu:[1,{com:e,edu:e,gob:e,inf:e,nat:e,net:e,org:e}],cv:[1,{com:e,edu:e,id:e,int:e,net:e,nome:e,org:e,publ:e}],cw:Ne,cx:[1,{gov:e,cloudns:t,ath:t,info:t,assessments:t,calculators:t,funnels:t,paynow:t,quizzes:t,researched:t,tests:t}],cy:[1,{ac:e,biz:e,com:[1,{scaleforce:G}],ekloges:e,gov:e,ltd:e,mil:e,net:e,org:e,press:e,pro:e,tm:e}],cz:[1,{gov:e,contentproxy9:[0,{rsc:t}],realm:t,e4:t,co:t,metacentrum:[0,{cloud:s,custom:t}],muni:[0,{cloud:[0,{flt:t,usr:t}]}]}],de:[1,{bplaced:t,square7:t,"bwcloud-os-instance":s,com:t,cosidns:X,dnsupdater:t,"dynamisches-dns":t,"internet-dns":t,"l-o-g-i-n":t,ddnss:[2,{dyn:t,dyndns:t}],"dyn-ip24":t,dyndns1:t,"home-webserver":[2,{dyn:t}],"myhome-server":t,dnshome:t,fuettertdasnetz:t,isteingeek:t,istmein:t,lebtimnetz:t,leitungsen:t,traeumtgerade:t,frusky:s,goip:t,"xn--gnstigbestellen-zvb":t,günstigbestellen:t,"xn--gnstigliefern-wob":t,günstigliefern:t,"hs-heilbronn":[0,{it:[0,{pages:t,"pages-research":t}]}],"dyn-berlin":t,"in-berlin":t,"in-brb":t,"in-butter":t,"in-dsl":t,"in-vpn":t,iservschule:t,"mein-iserv":t,schuldock:t,schulplattform:t,schulserver:t,"test-iserv":t,keymachine:t,co:t,"git-repos":t,"lcube-server":t,"svn-repos":t,barsy:t,webspaceconfig:t,"123webseite":t,rub:t,"ruhr-uni-bochum":[2,{noc:[0,{io:t}]}],logoip:t,"firewall-gateway":t,"my-gateway":t,"my-router":t,spdns:t,my:t,speedpartner:[0,{customer:t}],myspreadshop:t,"taifun-dns":t,"12hp":t,"2ix":t,"4lima":t,"lima-city":t,"virtual-user":t,virtualuser:t,"community-pro":t,diskussionsbereich:t,xenonconnect:s}],dj:e,dk:[1,{biz:t,co:t,firm:t,reg:t,store:t,"123hjemmeside":t,myspreadshop:t}],dm:oe,do:[1,{art:e,com:e,edu:e,gob:e,gov:e,mil:e,net:e,org:e,sld:e,web:e}],dz:[1,{art:e,asso:e,com:e,edu:e,gov:e,net:e,org:e,pol:e,soc:e,tm:e}],ec:[1,{abg:e,adm:e,agron:e,arqt:e,art:e,bar:e,chef:e,com:e,cont:e,cpa:e,cue:e,dent:e,dgn:e,disco:e,doc:e,edu:e,eng:e,esm:e,fin:e,fot:e,gal:e,gob:e,gov:e,gye:e,ibr:e,info:e,k12:e,lat:e,loj:e,med:e,mil:e,mktg:e,mon:e,net:e,ntr:e,odont:e,org:e,pro:e,prof:e,psic:e,psiq:e,pub:e,rio:e,rrpp:e,sal:e,tech:e,tul:e,tur:e,uio:e,vet:e,xxx:e,base:t,official:t}],edu:[1,{rit:[0,{"git-pages":t}]}],ee:[1,{aip:e,com:e,edu:e,fie:e,gov:e,lib:e,med:e,org:e,pri:e,riik:e}],eg:[1,{ac:e,com:e,edu:e,eun:e,gov:e,info:e,me:e,mil:e,name:e,net:e,org:e,sci:e,sport:e,tv:e}],er:k,es:[1,{com:e,edu:e,gob:e,nom:e,org:e,"123miweb":t,myspreadshop:t}],et:[1,{biz:e,com:e,edu:e,gov:e,info:e,name:e,net:e,org:e}],eu:[1,{amazonwebservices:[0,{on:[0,{"eusc-de-east-1":[0,{"cognito-idp":V}]}]}],cloudns:t,prvw:t,deuxfleurs:t,dogado:[0,{jelastic:t}],barsy:t,spdns:t,nxa:s,directwp:t,transurl:s}],fi:[1,{aland:e,dy:t,"xn--hkkinen-5wa":t,häkkinen:t,iki:t,cloudplatform:[0,{fi:t}],datacenter:[0,{demo:t,paas:t}],kapsi:t,"123kotisivu":t,myspreadshop:t}],fj:[1,{ac:e,biz:e,com:e,edu:e,gov:e,id:e,info:e,mil:e,name:e,net:e,org:e,pro:e}],fk:k,fm:[1,{com:e,edu:e,net:e,org:e,radio:t,user:s}],fo:e,fr:[1,{asso:e,com:e,gouv:e,nom:e,prd:e,tm:e,avoues:e,cci:e,greta:e,"huissier-justice":e,"fbx-os":t,fbxos:t,"freebox-os":t,freeboxos:t,goupile:t,kdns:t,"123siteweb":t,"on-web":t,"chirurgiens-dentistes-en-france":t,dedibox:t,aeroport:t,avocat:t,chambagri:t,"chirurgiens-dentistes":t,"experts-comptables":t,medecin:t,notaires:t,pharmacien:t,port:t,veterinaire:t,myspreadshop:t,ynh:t}],ga:e,gb:e,gd:[1,{edu:e,gov:e}],ge:[1,{com:e,edu:e,gov:e,net:e,org:e,pvt:e,school:e}],gf:e,gg:[1,{co:e,net:e,org:e,ply:[0,{at:s,d6:t}],botdash:t,kaas:t,stackit:t,panel:[2,{daemon:t}]}],gh:[1,{biz:e,com:e,edu:e,gov:e,mil:e,net:e,org:e}],gi:[1,{com:e,edu:e,gov:e,ltd:e,mod:e,org:e}],gl:[1,{co:e,com:e,edu:e,net:e,org:e}],gm:e,gn:[1,{ac:e,com:e,edu:e,gov:e,net:e,org:e}],gov:e,gp:[1,{asso:e,com:e,edu:e,mobi:e,net:e,org:e}],gq:e,gr:[1,{com:e,edu:e,gov:e,net:e,org:e,barsy:t,simplesite:t}],gs:e,gt:[1,{com:e,edu:e,gob:e,ind:e,mil:e,net:e,org:e}],gu:[1,{com:e,edu:e,gov:e,guam:e,info:e,net:e,org:e,web:e}],gw:[1,{nx:t}],gy:oe,hk:[1,{com:e,edu:e,gov:e,idv:e,net:e,org:e,"xn--ciqpn":e,个人:e,"xn--gmqw5a":e,個人:e,"xn--55qx5d":e,公司:e,"xn--mxtq1m":e,政府:e,"xn--lcvr32d":e,敎育:e,"xn--wcvs22d":e,教育:e,"xn--gmq050i":e,箇人:e,"xn--uc0atv":e,組織:e,"xn--uc0ay4a":e,組织:e,"xn--od0alg":e,網絡:e,"xn--zf0avx":e,網络:e,"xn--mk0axi":e,组織:e,"xn--tn0ag":e,组织:e,"xn--od0aq3b":e,网絡:e,"xn--io0a7i":e,网络:e,inc:t,ltd:t}],hm:e,hn:[1,{com:e,edu:e,gob:e,mil:e,net:e,org:e}],hr:[1,{com:e,from:e,iz:e,name:e,brendly:x}],ht:[1,{adult:e,art:e,asso:e,com:e,coop:e,edu:e,firm:e,gouv:e,info:e,med:e,net:e,org:e,perso:e,pol:e,pro:e,rel:e,shop:e,rt:t}],hu:[1,{2e3:e,agrar:e,bolt:e,casino:e,city:e,co:e,erotica:e,erotika:e,film:e,forum:e,games:e,hotel:e,info:e,ingatlan:e,jogasz:e,konyvelo:e,lakas:e,media:e,news:e,org:e,priv:e,reklam:e,sex:e,shop:e,sport:e,suli:e,szex:e,tm:e,tozsde:e,utazas:e,video:e}],id:[1,{ac:e,biz:e,co:e,desa:e,go:e,kop:e,mil:e,my:e,net:e,or:e,ponpes:e,sch:e,web:e,"xn--9tfky":e,"ᬩᬮᬶ":e,e:t,zone:t}],ie:[1,{gov:e,myspreadshop:t}],il:[1,{ac:e,co:[1,{ravpage:t,mytabit:t,tabitorder:t}],gov:e,idf:e,k12:e,muni:e,net:e,org:e}],"xn--4dbrk0ce":[1,{"xn--4dbgdty6c":e,"xn--5dbhl8d":e,"xn--8dbq2a":e,"xn--hebda8b":e}],ישראל:[1,{אקדמיה:e,ישוב:e,צהל:e,ממשל:e}],im:[1,{ac:e,co:[1,{ltd:e,plc:e}],com:e,net:e,org:e,tt:e,tv:e}],in:[1,{"5g":e,"6g":e,ac:e,ai:e,am:e,bank:e,bihar:e,biz:e,business:e,ca:e,cn:e,co:e,com:e,coop:e,cs:e,delhi:e,dr:e,edu:e,er:e,fin:e,firm:e,gen:e,gov:e,gujarat:e,ind:e,info:e,int:e,internet:e,io:e,me:e,mil:e,net:e,nic:e,org:e,pg:e,post:e,pro:e,res:e,travel:e,tv:e,uk:e,up:e,us:e,cloudns:t,barsy:t,web:t,indevs:t,supabase:t}],info:[1,{cloudns:t,"dynamic-dns":t,"barrel-of-knowledge":t,"barrell-of-knowledge":t,dyndns:t,"for-our":t,"groks-the":t,"groks-this":t,"here-for-more":t,knowsitall:t,selfip:t,webhop:t,barsy:t,mayfirst:t,mittwald:t,mittwaldserver:t,typo3server:t,dvrcam:t,ilovecollege:t,"no-ip":t,forumz:t,nsupdate:t,dnsupdate:t,"v-info":t}],int:[1,{eu:e}],io:[1,{2038:t,co:e,com:e,edu:e,gov:e,mil:e,net:e,nom:e,org:e,"on-acorn":s,myaddr:t,apigee:t,"b-data":t,beagleboard:t,bitbucket:t,bluebite:t,boxfuse:t,brave:a,browsersafetymark:t,bubble:ve,bubbleapps:t,bigv:[0,{uk0:t}],cleverapps:t,cloudbeesusercontent:t,dappnode:[0,{dyndns:t}],darklang:t,definima:t,dedyn:t,icp0:ze,icp1:ze,qzz:t,"fh-muenster":t,gitbook:t,github:t,gitlab:t,lolipop:t,"hasura-app":t,hostyhosting:t,hypernode:t,moonscale:s,beebyte:Q,beebyteapp:[0,{sekd1:t}],jele:t,keenetic:t,kiloapps:t,webthings:t,loginline:t,barsy:t,azurecontainer:s,ngrok:[2,{ap:t,au:t,eu:t,in:t,jp:t,sa:t,us:t}],nodeart:[0,{stage:t}],pantheonsite:t,forgerock:[0,{id:t}],pstmn:[2,{mock:t}],protonet:t,qcx:[2,{sys:s}],qoto:t,vaporcloud:t,myrdbx:t,"rb-hosting":Ee,"on-k3s":s,"on-rio":s,readthedocs:t,resindevice:t,resinstaging:[0,{devices:t}],hzc:t,sandcats:t,scrypted:[0,{client:t}],"mo-siemens":t,lair:D,stolos:s,musician:t,utwente:t,edugit:t,telebit:t,thingdust:[0,{dev:Se,disrec:Se,prod:re,testing:Se}],tickets:t,webflow:t,webflowtest:t,"drive-platform":t,editorx:t,wixstudio:t,basicserver:t,virtualserver:t}],iq:r,ir:[1,{ac:e,co:e,gov:e,id:e,net:e,org:e,sch:e,"xn--mgba3a4f16a":e,ایران:e,"xn--mgba3a4fra":e,ايران:e,arvanedge:t,vistablog:t}],is:e,it:[1,{edu:e,gov:e,abr:e,abruzzo:e,"aosta-valley":e,aostavalley:e,bas:e,basilicata:e,cal:e,calabria:e,cam:e,campania:e,"emilia-romagna":e,emiliaromagna:e,emr:e,"friuli-v-giulia":e,"friuli-ve-giulia":e,"friuli-vegiulia":e,"friuli-venezia-giulia":e,"friuli-veneziagiulia":e,"friuli-vgiulia":e,"friuliv-giulia":e,"friulive-giulia":e,friulivegiulia:e,"friulivenezia-giulia":e,friuliveneziagiulia:e,friulivgiulia:e,fvg:e,laz:e,lazio:e,lig:e,liguria:e,lom:e,lombardia:e,lombardy:e,lucania:e,mar:e,marche:e,mol:e,molise:e,piedmont:e,piemonte:e,pmn:e,pug:e,puglia:e,sar:e,sardegna:e,sardinia:e,sic:e,sicilia:e,sicily:e,taa:e,tos:e,toscana:e,"trentin-sud-tirol":e,"xn--trentin-sd-tirol-rzb":e,"trentin-süd-tirol":e,"trentin-sudtirol":e,"xn--trentin-sdtirol-7vb":e,"trentin-südtirol":e,"trentin-sued-tirol":e,"trentin-suedtirol":e,trentino:e,"trentino-a-adige":e,"trentino-aadige":e,"trentino-alto-adige":e,"trentino-altoadige":e,"trentino-s-tirol":e,"trentino-stirol":e,"trentino-sud-tirol":e,"xn--trentino-sd-tirol-c3b":e,"trentino-süd-tirol":e,"trentino-sudtirol":e,"xn--trentino-sdtirol-szb":e,"trentino-südtirol":e,"trentino-sued-tirol":e,"trentino-suedtirol":e,"trentinoa-adige":e,trentinoaadige:e,"trentinoalto-adige":e,trentinoaltoadige:e,"trentinos-tirol":e,trentinostirol:e,"trentinosud-tirol":e,"xn--trentinosd-tirol-rzb":e,"trentinosüd-tirol":e,trentinosudtirol:e,"xn--trentinosdtirol-7vb":e,trentinosüdtirol:e,"trentinosued-tirol":e,trentinosuedtirol:e,"trentinsud-tirol":e,"xn--trentinsd-tirol-6vb":e,"trentinsüd-tirol":e,trentinsudtirol:e,"xn--trentinsdtirol-nsb":e,trentinsüdtirol:e,"trentinsued-tirol":e,trentinsuedtirol:e,tuscany:e,umb:e,umbria:e,"val-d-aosta":e,"val-daosta":e,"vald-aosta":e,valdaosta:e,"valle-aosta":e,"valle-d-aosta":e,"valle-daosta":e,valleaosta:e,"valled-aosta":e,valledaosta:e,"vallee-aoste":e,"xn--valle-aoste-ebb":e,"vallée-aoste":e,"vallee-d-aoste":e,"xn--valle-d-aoste-ehb":e,"vallée-d-aoste":e,valleeaoste:e,"xn--valleaoste-e7a":e,valléeaoste:e,valleedaoste:e,"xn--valledaoste-ebb":e,valléedaoste:e,vao:e,vda:e,ven:e,veneto:e,ag:e,agrigento:e,al:e,alessandria:e,"alto-adige":e,altoadige:e,an:e,ancona:e,"andria-barletta-trani":e,"andria-trani-barletta":e,andriabarlettatrani:e,andriatranibarletta:e,ao:e,aosta:e,aoste:e,ap:e,aq:e,aquila:e,ar:e,arezzo:e,"ascoli-piceno":e,ascolipiceno:e,asti:e,at:e,av:e,avellino:e,ba:e,balsan:e,"balsan-sudtirol":e,"xn--balsan-sdtirol-nsb":e,"balsan-südtirol":e,"balsan-suedtirol":e,bari:e,"barletta-trani-andria":e,barlettatraniandria:e,belluno:e,benevento:e,bergamo:e,bg:e,bi:e,biella:e,bl:e,bn:e,bo:e,bologna:e,bolzano:e,"bolzano-altoadige":e,bozen:e,"bozen-sudtirol":e,"xn--bozen-sdtirol-2ob":e,"bozen-südtirol":e,"bozen-suedtirol":e,br:e,brescia:e,brindisi:e,bs:e,bt:e,bulsan:e,"bulsan-sudtirol":e,"xn--bulsan-sdtirol-nsb":e,"bulsan-südtirol":e,"bulsan-suedtirol":e,bz:e,ca:e,cagliari:e,caltanissetta:e,"campidano-medio":e,campidanomedio:e,campobasso:e,"carbonia-iglesias":e,carboniaiglesias:e,"carrara-massa":e,carraramassa:e,caserta:e,catania:e,catanzaro:e,cb:e,ce:e,"cesena-forli":e,"xn--cesena-forl-mcb":e,"cesena-forlì":e,cesenaforli:e,"xn--cesenaforl-i8a":e,cesenaforlì:e,ch:e,chieti:e,ci:e,cl:e,cn:e,co:e,como:e,cosenza:e,cr:e,cremona:e,crotone:e,cs:e,ct:e,cuneo:e,cz:e,"dell-ogliastra":e,dellogliastra:e,en:e,enna:e,fc:e,fe:e,fermo:e,ferrara:e,fg:e,fi:e,firenze:e,florence:e,fm:e,foggia:e,"forli-cesena":e,"xn--forl-cesena-fcb":e,"forlì-cesena":e,forlicesena:e,"xn--forlcesena-c8a":e,forlìcesena:e,fr:e,frosinone:e,ge:e,genoa:e,genova:e,go:e,gorizia:e,gr:e,grosseto:e,"iglesias-carbonia":e,iglesiascarbonia:e,im:e,imperia:e,is:e,isernia:e,kr:e,"la-spezia":e,laquila:e,laspezia:e,latina:e,lc:e,le:e,lecce:e,lecco:e,li:e,livorno:e,lo:e,lodi:e,lt:e,lu:e,lucca:e,macerata:e,mantova:e,"massa-carrara":e,massacarrara:e,matera:e,mb:e,mc:e,me:e,"medio-campidano":e,mediocampidano:e,messina:e,mi:e,milan:e,milano:e,mn:e,mo:e,modena:e,monza:e,"monza-brianza":e,"monza-e-della-brianza":e,monzabrianza:e,monzaebrianza:e,monzaedellabrianza:e,ms:e,mt:e,na:e,naples:e,napoli:e,no:e,novara:e,nu:e,nuoro:e,og:e,ogliastra:e,"olbia-tempio":e,olbiatempio:e,or:e,oristano:e,ot:e,pa:e,padova:e,padua:e,palermo:e,parma:e,pavia:e,pc:e,pd:e,pe:e,perugia:e,"pesaro-urbino":e,pesarourbino:e,pescara:e,pg:e,pi:e,piacenza:e,pisa:e,pistoia:e,pn:e,po:e,pordenone:e,potenza:e,pr:e,prato:e,pt:e,pu:e,pv:e,pz:e,ra:e,ragusa:e,ravenna:e,rc:e,re:e,"reggio-calabria":e,"reggio-emilia":e,reggiocalabria:e,reggioemilia:e,rg:e,ri:e,rieti:e,rimini:e,rm:e,rn:e,ro:e,roma:e,rome:e,rovigo:e,sa:e,salerno:e,sassari:e,savona:e,si:e,siena:e,siracusa:e,so:e,sondrio:e,sp:e,sr:e,ss:e,"xn--sdtirol-n2a":e,südtirol:e,suedtirol:e,sv:e,ta:e,taranto:e,te:e,"tempio-olbia":e,tempioolbia:e,teramo:e,terni:e,tn:e,to:e,torino:e,tp:e,tr:e,"trani-andria-barletta":e,"trani-barletta-andria":e,traniandriabarletta:e,tranibarlettaandria:e,trapani:e,trento:e,treviso:e,trieste:e,ts:e,turin:e,tv:e,ud:e,udine:e,"urbino-pesaro":e,urbinopesaro:e,va:e,varese:e,vb:e,vc:e,ve:e,venezia:e,venice:e,verbania:e,vercelli:e,verona:e,vi:e,"vibo-valentia":e,vibovalentia:e,vicenza:e,viterbo:e,vr:e,vs:e,vt:e,vv:e,ibxos:t,iliadboxos:t,neen:[0,{jc:t}],"123homepage":t,"16-b":t,"32-b":t,"64-b":t,myspreadshop:t,syncloud:t}],je:[1,{co:e,net:e,org:e,of:t}],jm:k,jo:[1,{agri:e,ai:e,com:e,edu:e,eng:e,fm:e,gov:e,mil:e,net:e,org:e,per:e,phd:e,sch:e,tv:e}],jobs:e,jp:[1,{ac:e,ad:e,co:e,ed:e,go:e,gr:e,lg:e,ne:[1,{aseinet:Oe,gehirn:t,ivory:t,"mail-box":t,mints:t,mokuren:t,opal:t,sakura:t,sumomo:t,topaz:t}],or:e,aichi:[1,{aisai:e,ama:e,anjo:e,asuke:e,chiryu:e,chita:e,fuso:e,gamagori:e,handa:e,hazu:e,hekinan:e,higashiura:e,ichinomiya:e,inazawa:e,inuyama:e,isshiki:e,iwakura:e,kanie:e,kariya:e,kasugai:e,kira:e,kiyosu:e,komaki:e,konan:e,kota:e,mihama:e,miyoshi:e,nishio:e,nisshin:e,obu:e,oguchi:e,oharu:e,okazaki:e,owariasahi:e,seto:e,shikatsu:e,shinshiro:e,shitara:e,tahara:e,takahama:e,tobishima:e,toei:e,togo:e,tokai:e,tokoname:e,toyoake:e,toyohashi:e,toyokawa:e,toyone:e,toyota:e,tsushima:e,yatomi:e}],akita:[1,{akita:e,daisen:e,fujisato:e,gojome:e,hachirogata:e,happou:e,higashinaruse:e,honjo:e,honjyo:e,ikawa:e,kamikoani:e,kamioka:e,katagami:e,kazuno:e,kitaakita:e,kosaka:e,kyowa:e,misato:e,mitane:e,moriyoshi:e,nikaho:e,noshiro:e,odate:e,oga:e,ogata:e,semboku:e,yokote:e,yurihonjo:e}],aomori:[1,{aomori:e,gonohe:e,hachinohe:e,hashikami:e,hiranai:e,hirosaki:e,itayanagi:e,kuroishi:e,misawa:e,mutsu:e,nakadomari:e,noheji:e,oirase:e,owani:e,rokunohe:e,sannohe:e,shichinohe:e,shingo:e,takko:e,towada:e,tsugaru:e,tsuruta:e}],chiba:[1,{abiko:e,asahi:e,chonan:e,chosei:e,choshi:e,chuo:e,funabashi:e,futtsu:e,hanamigawa:e,ichihara:e,ichikawa:e,ichinomiya:e,inzai:e,isumi:e,kamagaya:e,kamogawa:e,kashiwa:e,katori:e,katsuura:e,kimitsu:e,kisarazu:e,kozaki:e,kujukuri:e,kyonan:e,matsudo:e,midori:e,mihama:e,minamiboso:e,mobara:e,mutsuzawa:e,nagara:e,nagareyama:e,narashino:e,narita:e,noda:e,oamishirasato:e,omigawa:e,onjuku:e,otaki:e,sakae:e,sakura:e,shimofusa:e,shirako:e,shiroi:e,shisui:e,sodegaura:e,sosa:e,tako:e,tateyama:e,togane:e,tohnosho:e,tomisato:e,urayasu:e,yachimata:e,yachiyo:e,yokaichiba:e,yokoshibahikari:e,yotsukaido:e}],ehime:[1,{ainan:e,honai:e,ikata:e,imabari:e,iyo:e,kamijima:e,kihoku:e,kumakogen:e,masaki:e,matsuno:e,matsuyama:e,namikata:e,niihama:e,ozu:e,saijo:e,seiyo:e,shikokuchuo:e,tobe:e,toon:e,uchiko:e,uwajima:e,yawatahama:e}],fukui:[1,{echizen:e,eiheiji:e,fukui:e,ikeda:e,katsuyama:e,mihama:e,minamiechizen:e,obama:e,ohi:e,ono:e,sabae:e,sakai:e,takahama:e,tsuruga:e,wakasa:e}],fukuoka:[1,{ashiya:e,buzen:e,chikugo:e,chikuho:e,chikujo:e,chikushino:e,chikuzen:e,chuo:e,dazaifu:e,fukuchi:e,hakata:e,higashi:e,hirokawa:e,hisayama:e,iizuka:e,inatsuki:e,kaho:e,kasuga:e,kasuya:e,kawara:e,keisen:e,koga:e,kurate:e,kurogi:e,kurume:e,minami:e,miyako:e,miyama:e,miyawaka:e,mizumaki:e,munakata:e,nakagawa:e,nakama:e,nishi:e,nogata:e,ogori:e,okagaki:e,okawa:e,oki:e,omuta:e,onga:e,onojo:e,oto:e,saigawa:e,sasaguri:e,shingu:e,shinyoshitomi:e,shonai:e,soeda:e,sue:e,tachiarai:e,tagawa:e,takata:e,toho:e,toyotsu:e,tsuiki:e,ukiha:e,umi:e,usui:e,yamada:e,yame:e,yanagawa:e,yukuhashi:e}],fukushima:[1,{aizubange:e,aizumisato:e,aizuwakamatsu:e,asakawa:e,bandai:e,date:e,fukushima:e,furudono:e,futaba:e,hanawa:e,higashi:e,hirata:e,hirono:e,iitate:e,inawashiro:e,ishikawa:e,iwaki:e,izumizaki:e,kagamiishi:e,kaneyama:e,kawamata:e,kitakata:e,kitashiobara:e,koori:e,koriyama:e,kunimi:e,miharu:e,mishima:e,namie:e,nango:e,nishiaizu:e,nishigo:e,okuma:e,omotego:e,ono:e,otama:e,samegawa:e,shimogo:e,shirakawa:e,showa:e,soma:e,sukagawa:e,taishin:e,tamakawa:e,tanagura:e,tenei:e,yabuki:e,yamato:e,yamatsuri:e,yanaizu:e,yugawa:e}],gifu:[1,{anpachi:e,ena:e,gifu:e,ginan:e,godo:e,gujo:e,hashima:e,hichiso:e,hida:e,higashishirakawa:e,ibigawa:e,ikeda:e,kakamigahara:e,kani:e,kasahara:e,kasamatsu:e,kawaue:e,kitagata:e,mino:e,minokamo:e,mitake:e,mizunami:e,motosu:e,nakatsugawa:e,ogaki:e,sakahogi:e,seki:e,sekigahara:e,shirakawa:e,tajimi:e,takayama:e,tarui:e,toki:e,tomika:e,wanouchi:e,yamagata:e,yaotsu:e,yoro:e}],gunma:[1,{annaka:e,chiyoda:e,fujioka:e,higashiagatsuma:e,isesaki:e,itakura:e,kanna:e,kanra:e,katashina:e,kawaba:e,kiryu:e,kusatsu:e,maebashi:e,meiwa:e,midori:e,minakami:e,naganohara:e,nakanojo:e,nanmoku:e,numata:e,oizumi:e,ora:e,ota:e,shibukawa:e,shimonita:e,shinto:e,showa:e,takasaki:e,takayama:e,tamamura:e,tatebayashi:e,tomioka:e,tsukiyono:e,tsumagoi:e,ueno:e,yoshioka:e}],hiroshima:[1,{asaminami:e,daiwa:e,etajima:e,fuchu:e,fukuyama:e,hatsukaichi:e,higashihiroshima:e,hongo:e,jinsekikogen:e,kaita:e,kui:e,kumano:e,kure:e,mihara:e,miyoshi:e,naka:e,onomichi:e,osakikamijima:e,otake:e,saka:e,sera:e,seranishi:e,shinichi:e,shobara:e,takehara:e}],hokkaido:[1,{abashiri:e,abira:e,aibetsu:e,akabira:e,akkeshi:e,asahikawa:e,ashibetsu:e,ashoro:e,assabu:e,atsuma:e,bibai:e,biei:e,bifuka:e,bihoro:e,biratori:e,chippubetsu:e,chitose:e,date:e,ebetsu:e,embetsu:e,eniwa:e,erimo:e,esan:e,esashi:e,fukagawa:e,fukushima:e,furano:e,furubira:e,haboro:e,hakodate:e,hamatonbetsu:e,hidaka:e,higashikagura:e,higashikawa:e,hiroo:e,hokuryu:e,hokuto:e,honbetsu:e,horokanai:e,horonobe:e,ikeda:e,imakane:e,ishikari:e,iwamizawa:e,iwanai:e,kamifurano:e,kamikawa:e,kamishihoro:e,kamisunagawa:e,kamoenai:e,kayabe:e,kembuchi:e,kikonai:e,kimobetsu:e,kitahiroshima:e,kitami:e,kiyosato:e,koshimizu:e,kunneppu:e,kuriyama:e,kuromatsunai:e,kushiro:e,kutchan:e,kyowa:e,mashike:e,matsumae:e,mikasa:e,minamifurano:e,mombetsu:e,moseushi:e,mukawa:e,muroran:e,naie:e,nakagawa:e,nakasatsunai:e,nakatombetsu:e,nanae:e,nanporo:e,nayoro:e,nemuro:e,niikappu:e,niki:e,nishiokoppe:e,noboribetsu:e,numata:e,obihiro:e,obira:e,oketo:e,okoppe:e,otaru:e,otobe:e,otofuke:e,otoineppu:e,oumu:e,ozora:e,pippu:e,rankoshi:e,rebun:e,rikubetsu:e,rishiri:e,rishirifuji:e,saroma:e,sarufutsu:e,shakotan:e,shari:e,shibecha:e,shibetsu:e,shikabe:e,shikaoi:e,shimamaki:e,shimizu:e,shimokawa:e,shinshinotsu:e,shintoku:e,shiranuka:e,shiraoi:e,shiriuchi:e,sobetsu:e,sunagawa:e,taiki:e,takasu:e,takikawa:e,takinoue:e,teshikaga:e,tobetsu:e,tohma:e,tomakomai:e,tomari:e,toya:e,toyako:e,toyotomi:e,toyoura:e,tsubetsu:e,tsukigata:e,urakawa:e,urausu:e,uryu:e,utashinai:e,wakkanai:e,wassamu:e,yakumo:e,yoichi:e}],hyogo:[1,{aioi:e,akashi:e,ako:e,amagasaki:e,aogaki:e,asago:e,ashiya:e,awaji:e,fukusaki:e,goshiki:e,harima:e,himeji:e,ichikawa:e,inagawa:e,itami:e,kakogawa:e,kamigori:e,kamikawa:e,kasai:e,kasuga:e,kawanishi:e,miki:e,minamiawaji:e,nishinomiya:e,nishiwaki:e,ono:e,sanda:e,sannan:e,sasayama:e,sayo:e,shingu:e,shinonsen:e,shiso:e,sumoto:e,taishi:e,taka:e,takarazuka:e,takasago:e,takino:e,tamba:e,tatsuno:e,toyooka:e,yabu:e,yashiro:e,yoka:e,yokawa:e}],ibaraki:[1,{ami:e,asahi:e,bando:e,chikusei:e,daigo:e,fujishiro:e,hitachi:e,hitachinaka:e,hitachiomiya:e,hitachiota:e,ibaraki:e,ina:e,inashiki:e,itako:e,iwama:e,joso:e,kamisu:e,kasama:e,kashima:e,kasumigaura:e,koga:e,miho:e,mito:e,moriya:e,naka:e,namegata:e,oarai:e,ogawa:e,omitama:e,ryugasaki:e,sakai:e,sakuragawa:e,shimodate:e,shimotsuma:e,shirosato:e,sowa:e,suifu:e,takahagi:e,tamatsukuri:e,tokai:e,tomobe:e,tone:e,toride:e,tsuchiura:e,tsukuba:e,uchihara:e,ushiku:e,yachiyo:e,yamagata:e,yawara:e,yuki:e}],ishikawa:[1,{anamizu:e,hakui:e,hakusan:e,kaga:e,kahoku:e,kanazawa:e,kawakita:e,komatsu:e,nakanoto:e,nanao:e,nomi:e,nonoichi:e,noto:e,shika:e,suzu:e,tsubata:e,tsurugi:e,uchinada:e,wajima:e}],iwate:[1,{fudai:e,fujisawa:e,hanamaki:e,hiraizumi:e,hirono:e,ichinohe:e,ichinoseki:e,iwaizumi:e,iwate:e,joboji:e,kamaishi:e,kanegasaki:e,karumai:e,kawai:e,kitakami:e,kuji:e,kunohe:e,kuzumaki:e,miyako:e,mizusawa:e,morioka:e,ninohe:e,noda:e,ofunato:e,oshu:e,otsuchi:e,rikuzentakata:e,shiwa:e,shizukuishi:e,sumita:e,tanohata:e,tono:e,yahaba:e,yamada:e}],kagawa:[1,{ayagawa:e,higashikagawa:e,kanonji:e,kotohira:e,manno:e,marugame:e,mitoyo:e,naoshima:e,sanuki:e,tadotsu:e,takamatsu:e,tonosho:e,uchinomi:e,utazu:e,zentsuji:e}],kagoshima:[1,{akune:e,amami:e,hioki:e,isa:e,isen:e,izumi:e,kagoshima:e,kanoya:e,kawanabe:e,kinko:e,kouyama:e,makurazaki:e,matsumoto:e,minamitane:e,nakatane:e,nishinoomote:e,satsumasendai:e,soo:e,tarumizu:e,yusui:e}],kanagawa:[1,{aikawa:e,atsugi:e,ayase:e,chigasaki:e,ebina:e,fujisawa:e,hadano:e,hakone:e,hiratsuka:e,isehara:e,kaisei:e,kamakura:e,kiyokawa:e,matsuda:e,minamiashigara:e,miura:e,nakai:e,ninomiya:e,odawara:e,oi:e,oiso:e,sagamihara:e,samukawa:e,tsukui:e,yamakita:e,yamato:e,yokosuka:e,yugawara:e,zama:e,zushi:e}],kochi:[1,{aki:e,geisei:e,hidaka:e,higashitsuno:e,ino:e,kagami:e,kami:e,kitagawa:e,kochi:e,mihara:e,motoyama:e,muroto:e,nahari:e,nakamura:e,nankoku:e,nishitosa:e,niyodogawa:e,ochi:e,okawa:e,otoyo:e,otsuki:e,sakawa:e,sukumo:e,susaki:e,tosa:e,tosashimizu:e,toyo:e,tsuno:e,umaji:e,yasuda:e,yusuhara:e}],kumamoto:[1,{amakusa:e,arao:e,aso:e,choyo:e,gyokuto:e,kamiamakusa:e,kikuchi:e,kumamoto:e,mashiki:e,mifune:e,minamata:e,minamioguni:e,nagasu:e,nishihara:e,oguni:e,ozu:e,sumoto:e,takamori:e,uki:e,uto:e,yamaga:e,yamato:e,yatsushiro:e}],kyoto:[1,{ayabe:e,fukuchiyama:e,higashiyama:e,ide:e,ine:e,joyo:e,kameoka:e,kamo:e,kita:e,kizu:e,kumiyama:e,kyotamba:e,kyotanabe:e,kyotango:e,maizuru:e,minami:e,minamiyamashiro:e,miyazu:e,muko:e,nagaokakyo:e,nakagyo:e,nantan:e,oyamazaki:e,sakyo:e,seika:e,tanabe:e,uji:e,ujitawara:e,wazuka:e,yamashina:e,yawata:e}],mie:[1,{asahi:e,inabe:e,ise:e,kameyama:e,kawagoe:e,kiho:e,kisosaki:e,kiwa:e,komono:e,kumano:e,kuwana:e,matsusaka:e,meiwa:e,mihama:e,minamiise:e,misugi:e,miyama:e,nabari:e,shima:e,suzuka:e,tado:e,taiki:e,taki:e,tamaki:e,toba:e,tsu:e,udono:e,ureshino:e,watarai:e,yokkaichi:e}],miyagi:[1,{furukawa:e,higashimatsushima:e,ishinomaki:e,iwanuma:e,kakuda:e,kami:e,kawasaki:e,marumori:e,matsushima:e,minamisanriku:e,misato:e,murata:e,natori:e,ogawara:e,ohira:e,onagawa:e,osaki:e,rifu:e,semine:e,shibata:e,shichikashuku:e,shikama:e,shiogama:e,shiroishi:e,tagajo:e,taiwa:e,tome:e,tomiya:e,wakuya:e,watari:e,yamamoto:e,zao:e}],miyazaki:[1,{aya:e,ebino:e,gokase:e,hyuga:e,kadogawa:e,kawaminami:e,kijo:e,kitagawa:e,kitakata:e,kitaura:e,kobayashi:e,kunitomi:e,kushima:e,mimata:e,miyakonojo:e,miyazaki:e,morotsuka:e,nichinan:e,nishimera:e,nobeoka:e,saito:e,shiiba:e,shintomi:e,takaharu:e,takanabe:e,takazaki:e,tsuno:e}],nagano:[1,{achi:e,agematsu:e,anan:e,aoki:e,asahi:e,azumino:e,chikuhoku:e,chikuma:e,chino:e,fujimi:e,hakuba:e,hara:e,hiraya:e,iida:e,iijima:e,iiyama:e,iizuna:e,ikeda:e,ikusaka:e,ina:e,karuizawa:e,kawakami:e,kiso:e,kisofukushima:e,kitaaiki:e,komagane:e,komoro:e,matsukawa:e,matsumoto:e,miasa:e,minamiaiki:e,minamimaki:e,minamiminowa:e,minowa:e,miyada:e,miyota:e,mochizuki:e,nagano:e,nagawa:e,nagiso:e,nakagawa:e,nakano:e,nozawaonsen:e,obuse:e,ogawa:e,okaya:e,omachi:e,omi:e,ookuwa:e,ooshika:e,otaki:e,otari:e,sakae:e,sakaki:e,saku:e,sakuho:e,shimosuwa:e,shinanomachi:e,shiojiri:e,suwa:e,suzaka:e,takagi:e,takamori:e,takayama:e,tateshina:e,tatsuno:e,togakushi:e,togura:e,tomi:e,ueda:e,wada:e,yamagata:e,yamanouchi:e,yasaka:e,yasuoka:e}],nagasaki:[1,{chijiwa:e,futsu:e,goto:e,hasami:e,hirado:e,iki:e,isahaya:e,kawatana:e,kuchinotsu:e,matsuura:e,nagasaki:e,obama:e,omura:e,oseto:e,saikai:e,sasebo:e,seihi:e,shimabara:e,shinkamigoto:e,togitsu:e,tsushima:e,unzen:e}],nara:[1,{ando:e,gose:e,heguri:e,higashiyoshino:e,ikaruga:e,ikoma:e,kamikitayama:e,kanmaki:e,kashiba:e,kashihara:e,katsuragi:e,kawai:e,kawakami:e,kawanishi:e,koryo:e,kurotaki:e,mitsue:e,miyake:e,nara:e,nosegawa:e,oji:e,ouda:e,oyodo:e,sakurai:e,sango:e,shimoichi:e,shimokitayama:e,shinjo:e,soni:e,takatori:e,tawaramoto:e,tenkawa:e,tenri:e,uda:e,yamatokoriyama:e,yamatotakada:e,yamazoe:e,yoshino:e}],niigata:[1,{aga:e,agano:e,gosen:e,itoigawa:e,izumozaki:e,joetsu:e,kamo:e,kariwa:e,kashiwazaki:e,minamiuonuma:e,mitsuke:e,muika:e,murakami:e,myoko:e,nagaoka:e,niigata:e,ojiya:e,omi:e,sado:e,sanjo:e,seiro:e,seirou:e,sekikawa:e,shibata:e,tagami:e,tainai:e,tochio:e,tokamachi:e,tsubame:e,tsunan:e,uonuma:e,yahiko:e,yoita:e,yuzawa:e}],oita:[1,{beppu:e,bungoono:e,bungotakada:e,hasama:e,hiji:e,himeshima:e,hita:e,kamitsue:e,kokonoe:e,kuju:e,kunisaki:e,kusu:e,oita:e,saiki:e,taketa:e,tsukumi:e,usa:e,usuki:e,yufu:e}],okayama:[1,{akaiwa:e,asakuchi:e,bizen:e,hayashima:e,ibara:e,kagamino:e,kasaoka:e,kibichuo:e,kumenan:e,kurashiki:e,maniwa:e,misaki:e,nagi:e,niimi:e,nishiawakura:e,okayama:e,satosho:e,setouchi:e,shinjo:e,shoo:e,soja:e,takahashi:e,tamano:e,tsuyama:e,wake:e,yakage:e}],okinawa:[1,{aguni:e,ginowan:e,ginoza:e,gushikami:e,haebaru:e,higashi:e,hirara:e,iheya:e,ishigaki:e,ishikawa:e,itoman:e,izena:e,kadena:e,kin:e,kitadaito:e,kitanakagusuku:e,kumejima:e,kunigami:e,minamidaito:e,motobu:e,nago:e,naha:e,nakagusuku:e,nakijin:e,nanjo:e,nishihara:e,ogimi:e,okinawa:e,onna:e,shimoji:e,taketomi:e,tarama:e,tokashiki:e,tomigusuku:e,tonaki:e,urasoe:e,uruma:e,yaese:e,yomitan:e,yonabaru:e,yonaguni:e,zamami:e}],osaka:[1,{abeno:e,chihayaakasaka:e,chuo:e,daito:e,fujiidera:e,habikino:e,hannan:e,higashiosaka:e,higashisumiyoshi:e,higashiyodogawa:e,hirakata:e,ibaraki:e,ikeda:e,izumi:e,izumiotsu:e,izumisano:e,kadoma:e,kaizuka:e,kanan:e,kashiwara:e,katano:e,kawachinagano:e,kishiwada:e,kita:e,kumatori:e,matsubara:e,minato:e,minoh:e,misaki:e,moriguchi:e,neyagawa:e,nishi:e,nose:e,osakasayama:e,sakai:e,sayama:e,sennan:e,settsu:e,shijonawate:e,shimamoto:e,suita:e,tadaoka:e,taishi:e,tajiri:e,takaishi:e,takatsuki:e,tondabayashi:e,toyonaka:e,toyono:e,yao:e}],saga:[1,{ariake:e,arita:e,fukudomi:e,genkai:e,hamatama:e,hizen:e,imari:e,kamimine:e,kanzaki:e,karatsu:e,kashima:e,kitagata:e,kitahata:e,kiyama:e,kouhoku:e,kyuragi:e,nishiarita:e,ogi:e,omachi:e,ouchi:e,saga:e,shiroishi:e,taku:e,tara:e,tosu:e,yoshinogari:e}],saitama:[1,{arakawa:e,asaka:e,chichibu:e,fujimi:e,fujimino:e,fukaya:e,hanno:e,hanyu:e,hasuda:e,hatogaya:e,hatoyama:e,hidaka:e,higashichichibu:e,higashimatsuyama:e,honjo:e,ina:e,iruma:e,iwatsuki:e,kamiizumi:e,kamikawa:e,kamisato:e,kasukabe:e,kawagoe:e,kawaguchi:e,kawajima:e,kazo:e,kitamoto:e,koshigaya:e,kounosu:e,kuki:e,kumagaya:e,matsubushi:e,minano:e,misato:e,miyashiro:e,miyoshi:e,moroyama:e,nagatoro:e,namegawa:e,niiza:e,ogano:e,ogawa:e,ogose:e,okegawa:e,omiya:e,otaki:e,ranzan:e,ryokami:e,saitama:e,sakado:e,satte:e,sayama:e,shiki:e,shiraoka:e,soka:e,sugito:e,toda:e,tokigawa:e,tokorozawa:e,tsurugashima:e,urawa:e,warabi:e,yashio:e,yokoze:e,yono:e,yorii:e,yoshida:e,yoshikawa:e,yoshimi:e}],shiga:[1,{aisho:e,gamo:e,higashiomi:e,hikone:e,koka:e,konan:e,kosei:e,koto:e,kusatsu:e,maibara:e,moriyama:e,nagahama:e,nishiazai:e,notogawa:e,omihachiman:e,otsu:e,ritto:e,ryuoh:e,takashima:e,takatsuki:e,torahime:e,toyosato:e,yasu:e}],shimane:[1,{akagi:e,ama:e,gotsu:e,hamada:e,higashiizumo:e,hikawa:e,hikimi:e,izumo:e,kakinoki:e,masuda:e,matsue:e,misato:e,nishinoshima:e,ohda:e,okinoshima:e,okuizumo:e,shimane:e,tamayu:e,tsuwano:e,unnan:e,yakumo:e,yasugi:e,yatsuka:e}],shizuoka:[1,{arai:e,atami:e,fuji:e,fujieda:e,fujikawa:e,fujinomiya:e,fukuroi:e,gotemba:e,haibara:e,hamamatsu:e,higashiizu:e,ito:e,iwata:e,izu:e,izunokuni:e,kakegawa:e,kannami:e,kawanehon:e,kawazu:e,kikugawa:e,kosai:e,makinohara:e,matsuzaki:e,minamiizu:e,mishima:e,morimachi:e,nishiizu:e,numazu:e,omaezaki:e,shimada:e,shimizu:e,shimoda:e,shizuoka:e,susono:e,yaizu:e,yoshida:e}],tochigi:[1,{ashikaga:e,bato:e,haga:e,ichikai:e,iwafune:e,kaminokawa:e,kanuma:e,karasuyama:e,kuroiso:e,mashiko:e,mibu:e,moka:e,motegi:e,nasu:e,nasushiobara:e,nikko:e,nishikata:e,nogi:e,ohira:e,ohtawara:e,oyama:e,sakura:e,sano:e,shimotsuke:e,shioya:e,takanezawa:e,tochigi:e,tsuga:e,ujiie:e,utsunomiya:e,yaita:e}],tokushima:[1,{aizumi:e,anan:e,ichiba:e,itano:e,kainan:e,komatsushima:e,matsushige:e,mima:e,minami:e,miyoshi:e,mugi:e,nakagawa:e,naruto:e,sanagochi:e,shishikui:e,tokushima:e,wajiki:e}],tokyo:[1,{adachi:e,akiruno:e,akishima:e,aogashima:e,arakawa:e,bunkyo:e,chiyoda:e,chofu:e,chuo:e,edogawa:e,fuchu:e,fussa:e,hachijo:e,hachioji:e,hamura:e,higashikurume:e,higashimurayama:e,higashiyamato:e,hino:e,hinode:e,hinohara:e,inagi:e,itabashi:e,katsushika:e,kita:e,kiyose:e,kodaira:e,koganei:e,kokubunji:e,komae:e,koto:e,kouzushima:e,kunitachi:e,machida:e,meguro:e,minato:e,mitaka:e,mizuho:e,musashimurayama:e,musashino:e,nakano:e,nerima:e,ogasawara:e,okutama:e,ome:e,oshima:e,ota:e,setagaya:e,shibuya:e,shinagawa:e,shinjuku:e,suginami:e,sumida:e,tachikawa:e,taito:e,tama:e,toshima:e}],tottori:[1,{chizu:e,hino:e,kawahara:e,koge:e,kotoura:e,misasa:e,nanbu:e,nichinan:e,sakaiminato:e,tottori:e,wakasa:e,yazu:e,yonago:e}],toyama:[1,{asahi:e,fuchu:e,fukumitsu:e,funahashi:e,himi:e,imizu:e,inami:e,johana:e,kamiichi:e,kurobe:e,nakaniikawa:e,namerikawa:e,nanto:e,nyuzen:e,oyabe:e,taira:e,takaoka:e,tateyama:e,toga:e,tonami:e,toyama:e,unazuki:e,uozu:e,yamada:e}],wakayama:[1,{arida:e,aridagawa:e,gobo:e,hashimoto:e,hidaka:e,hirogawa:e,inami:e,iwade:e,kainan:e,kamitonda:e,katsuragi:e,kimino:e,kinokawa:e,kitayama:e,koya:e,koza:e,kozagawa:e,kudoyama:e,kushimoto:e,mihama:e,misato:e,nachikatsuura:e,shingu:e,shirahama:e,taiji:e,tanabe:e,wakayama:e,yuasa:e,yura:e}],yamagata:[1,{asahi:e,funagata:e,higashine:e,iide:e,kahoku:e,kaminoyama:e,kaneyama:e,kawanishi:e,mamurogawa:e,mikawa:e,murayama:e,nagai:e,nakayama:e,nanyo:e,nishikawa:e,obanazawa:e,oe:e,oguni:e,ohkura:e,oishida:e,sagae:e,sakata:e,sakegawa:e,shinjo:e,shirataka:e,shonai:e,takahata:e,tendo:e,tozawa:e,tsuruoka:e,yamagata:e,yamanobe:e,yonezawa:e,yuza:e}],yamaguchi:[1,{abu:e,hagi:e,hikari:e,hofu:e,iwakuni:e,kudamatsu:e,mitou:e,nagato:e,oshima:e,shimonoseki:e,shunan:e,tabuse:e,tokuyama:e,toyota:e,ube:e,yuu:e}],yamanashi:[1,{chuo:e,doshi:e,fuefuki:e,fujikawa:e,fujikawaguchiko:e,fujiyoshida:e,hayakawa:e,hokuto:e,ichikawamisato:e,kai:e,kofu:e,koshu:e,kosuge:e,"minami-alps":e,minobu:e,nakamichi:e,nanbu:e,narusawa:e,nirasaki:e,nishikatsura:e,oshino:e,otsuki:e,showa:e,tabayama:e,tsuru:e,uenohara:e,yamanakako:e,yamanashi:e}],"xn--ehqz56n":e,三重:e,"xn--1lqs03n":e,京都:e,"xn--qqqt11m":e,佐賀:e,"xn--f6qx53a":e,兵庫:e,"xn--djrs72d6uy":e,北海道:e,"xn--mkru45i":e,千葉:e,"xn--0trq7p7nn":e,和歌山:e,"xn--5js045d":e,埼玉:e,"xn--kbrq7o":e,大分:e,"xn--pssu33l":e,大阪:e,"xn--ntsq17g":e,奈良:e,"xn--uisz3g":e,宮城:e,"xn--6btw5a":e,宮崎:e,"xn--1ctwo":e,富山:e,"xn--6orx2r":e,山口:e,"xn--rht61e":e,山形:e,"xn--rht27z":e,山梨:e,"xn--nit225k":e,岐阜:e,"xn--rht3d":e,岡山:e,"xn--djty4k":e,岩手:e,"xn--klty5x":e,島根:e,"xn--kltx9a":e,広島:e,"xn--kltp7d":e,徳島:e,"xn--c3s14m":e,愛媛:e,"xn--vgu402c":e,愛知:e,"xn--efvn9s":e,新潟:e,"xn--1lqs71d":e,東京:e,"xn--4pvxs":e,栃木:e,"xn--uuwu58a":e,沖縄:e,"xn--zbx025d":e,滋賀:e,"xn--8pvr4u":e,熊本:e,"xn--5rtp49c":e,石川:e,"xn--ntso0iqx3a":e,神奈川:e,"xn--elqq16h":e,福井:e,"xn--4it168d":e,福岡:e,"xn--klt787d":e,福島:e,"xn--rny31h":e,秋田:e,"xn--7t0a264c":e,群馬:e,"xn--uist22h":e,茨城:e,"xn--8ltr62k":e,長崎:e,"xn--2m4a15e":e,長野:e,"xn--32vp30h":e,青森:e,"xn--4it797k":e,静岡:e,"xn--5rtq34k":e,香川:e,"xn--k7yn95e":e,高知:e,"xn--tor131o":e,鳥取:e,"xn--d5qv7z876c":e,鹿児島:e,kawasaki:k,kitakyushu:k,kobe:k,nagoya:k,sapporo:k,sendai:k,yokohama:k,buyshop:t,fashionstore:t,handcrafted:t,kawaiishop:t,supersale:t,theshop:t,"0am":t,"0g0":t,"0j0":t,"0t0":t,mydns:t,pgw:t,wjg:t,usercontent:t,angry:t,babyblue:t,babymilk:t,backdrop:t,bambina:t,bitter:t,blush:t,boo:t,boy:t,boyfriend:t,but:t,candypop:t,capoo:t,catfood:t,cheap:t,chicappa:t,chillout:t,chips:t,chowder:t,chu:t,ciao:t,cocotte:t,coolblog:t,cranky:t,cutegirl:t,daa:t,deca:t,deci:t,digick:t,egoism:t,fakefur:t,fem:t,flier:t,floppy:t,fool:t,frenchkiss:t,girlfriend:t,girly:t,gloomy:t,gonna:t,greater:t,hacca:t,heavy:t,her:t,hiho:t,hippy:t,holy:t,hungry:t,icurus:t,itigo:t,jellybean:t,kikirara:t,kill:t,kilo:t,kuron:t,littlestar:t,lolipopmc:t,lolitapunk:t,lomo:t,lovepop:t,lovesick:t,main:t,mods:t,mond:t,mongolian:t,moo:t,namaste:t,nikita:t,nobushi:t,noor:t,oops:t,parallel:t,parasite:t,pecori:t,peewee:t,penne:t,pepper:t,perma:t,pigboat:t,pinoko:t,punyu:t,pupu:t,pussycat:t,pya:t,raindrop:t,readymade:t,sadist:t,schoolbus:t,secret:t,staba:t,stripper:t,sub:t,sunnyday:t,thick:t,tonkotsu:t,under:t,upper:t,velvet:t,verse:t,versus:t,vivian:t,watson:t,weblike:t,whitesnow:t,zombie:t,hateblo:t,hatenablog:t,hatenadiary:t,"2-d":t,bona:t,crap:t,daynight:t,eek:t,flop:t,halfmoon:t,jeez:t,matrix:t,mimoza:t,netgamers:t,nyanta:t,o0o0:t,rdy:t,rgr:t,rulez:t,sakurastorage:[0,{isk01:Ie,isk02:Ie}],saloon:t,sblo:t,skr:t,tank:t,"uh-oh":t,undo:t,webaccel:[0,{rs:t,user:t}],websozai:t,xii:t}],ke:[1,{ac:e,co:e,go:e,info:e,me:e,mobi:e,ne:e,or:e,sc:e}],kg:[1,{com:e,edu:e,gov:e,mil:e,net:e,org:e,us:t,xx:t,ae:t}],kh:n,ki:We,km:[1,{ass:e,com:e,edu:e,gov:e,mil:e,nom:e,org:e,prd:e,tm:e,asso:e,coop:e,gouv:e,medecin:e,notaires:e,pharmaciens:e,presse:e,veterinaire:e}],kn:[1,{edu:e,gov:e,net:e,org:e}],kp:[1,{com:e,edu:e,gov:e,org:e,rep:e,tra:e}],kr:[1,{ac:e,ai:e,co:e,es:e,go:e,hs:e,io:e,it:e,kg:e,me:e,mil:e,ms:e,ne:e,or:e,pe:e,re:e,sc:e,busan:e,chungbuk:e,chungnam:e,daegu:e,daejeon:e,gangwon:e,gwangju:e,gyeongbuk:e,gyeonggi:e,gyeongnam:e,incheon:e,jeju:e,jeonbuk:e,jeonnam:e,seoul:e,ulsan:e,c01:t,"eliv-api":t,"eliv-cdn":t,"eliv-dns":t,mmv:t,vki:t}],kw:[1,{com:e,edu:e,emb:e,gov:e,ind:e,net:e,org:e}],ky:Ne,kz:[1,{com:e,edu:e,gov:e,mil:e,net:e,org:e,jcloud:t}],la:[1,{com:e,edu:e,gov:e,info:e,int:e,net:e,org:e,per:e,bnr:t}],lb:n,lc:[1,{co:e,com:e,edu:e,gov:e,net:e,org:e,oy:t}],li:e,lk:[1,{ac:e,assn:e,com:e,edu:e,gov:e,grp:e,hotel:e,int:e,ltd:e,net:e,ngo:e,org:e,sch:e,soc:e,web:e}],lr:n,ls:[1,{ac:e,biz:e,co:e,edu:e,gov:e,info:e,net:e,org:e,sc:e}],lt:c,lu:[1,{"123website":t}],lv:[1,{asn:e,com:e,conf:e,edu:e,gov:e,id:e,mil:e,net:e,org:e}],ly:[1,{com:e,edu:e,gov:e,id:e,med:e,net:e,org:e,plc:e,sch:e}],ma:[1,{ac:e,co:e,gov:e,net:e,org:e,press:e}],mc:[1,{asso:e,tm:e}],md:[1,{ir:t}],me:[1,{ac:e,co:e,edu:e,gov:e,its:e,net:e,org:e,priv:e,c66:t,craft:t,edgestack:t,mybox:t,filegear:t,"filegear-sg":t,lohmus:t,barsy:t,mcdir:t,brasilia:t,ddns:t,dnsfor:t,hopto:t,loginto:t,noip:t,webhop:t,soundcast:t,tcp4:t,vp4:t,diskstation:t,dscloud:t,i234:t,myds:t,synology:t,transip:Ee,nohost:t}],mg:[1,{co:e,com:e,edu:e,gov:e,mil:e,nom:e,org:e,prd:e}],mh:e,mil:e,mk:[1,{com:e,edu:e,gov:e,inf:e,name:e,net:e,org:e}],ml:[1,{ac:e,art:e,asso:e,com:e,edu:e,gouv:e,gov:e,info:e,inst:e,net:e,org:e,pr:e,presse:e}],mm:k,mn:[1,{edu:e,gov:e,org:e,nyc:t}],mo:n,mobi:[1,{barsy:t,dscloud:t}],mp:[1,{ju:t}],mq:e,mr:c,ms:[1,{com:e,edu:e,gov:e,net:e,org:e,minisite:t}],mt:Ne,mu:[1,{ac:e,co:e,com:e,gov:e,net:e,or:e,org:e}],museum:e,mv:[1,{aero:e,biz:e,com:e,coop:e,edu:e,gov:e,info:e,int:e,mil:e,museum:e,name:e,net:e,org:e,pro:e}],mw:[1,{ac:e,biz:e,co:e,com:e,coop:e,edu:e,gov:e,int:e,net:e,org:e}],mx:[1,{com:e,edu:e,gob:e,net:e,org:e}],my:[1,{biz:e,com:e,edu:e,gov:e,mil:e,name:e,net:e,org:e}],mz:[1,{ac:e,adv:e,co:e,edu:e,gov:e,mil:e,net:e,org:e}],na:[1,{alt:e,co:e,com:e,gov:e,net:e,org:e}],name:[1,{her:te,his:te,ispmanager:t,keenetic:t}],nc:[1,{asso:e,nom:e}],ne:e,net:[1,{adobeaemcloud:t,"adobeio-static":t,adobeioruntime:t,akadns:t,akamai:t,"akamai-staging":t,akamaiedge:t,"akamaiedge-staging":t,akamaihd:t,"akamaihd-staging":t,akamaiorigin:t,"akamaiorigin-staging":t,akamaized:t,"akamaized-staging":t,edgekey:t,"edgekey-staging":t,edgesuite:t,"edgesuite-staging":t,alwaysdata:t,myamaze:t,cloudfront:t,appudo:t,"atlassian-dev":[0,{prod:ve}],myfritz:t,shopselect:t,blackbaudcdn:t,boomla:t,bplaced:t,square7:t,cdn77:[0,{r:t}],"cdn77-ssl":t,gb:t,hu:t,jp:t,se:t,uk:t,clickrising:t,"ddns-ip":t,"dns-cloud":t,"dns-dynamic":t,cloudaccess:t,cloudflare:[2,{cdn:t}],cloudflareanycast:ve,cloudflarecn:ve,cloudflareglobal:ve,ctfcloud:t,"feste-ip":t,"knx-server":t,"static-access":t,cryptonomic:s,dattolocal:t,mydatto:t,debian:t,definima:t,deno:[2,{sandbox:t}],icp:s,de5:t,"at-band-camp":t,blogdns:t,"broke-it":t,buyshouses:t,dnsalias:t,dnsdojo:t,"does-it":t,dontexist:t,dynalias:t,dynathome:t,endofinternet:t,"from-az":t,"from-co":t,"from-la":t,"from-ny":t,"gets-it":t,"ham-radio-op":t,homeftp:t,homeip:t,homelinux:t,homeunix:t,"in-the-band":t,"is-a-chef":t,"is-a-geek":t,"isa-geek":t,"kicks-ass":t,"office-on-the":t,podzone:t,"scrapper-site":t,selfip:t,"sells-it":t,servebbs:t,serveftp:t,thruhere:t,webhop:t,casacam:t,dynu:t,dynuddns:t,mysynology:t,opik:t,spryt:t,dynv6:t,twmail:t,ru:t,channelsdvr:[2,{u:t}],fastly:[0,{freetls:t,map:t,prod:[0,{a:t,global:t}],ssl:[0,{a:t,b:t,global:t}]}],fastlylb:[2,{map:t}],"keyword-on":t,"live-on":t,"server-on":t,"cdn-edges":t,heteml:t,cloudfunctions:t,"grafana-dev":t,iobb:t,moonscale:t,"in-dsl":t,"in-vpn":t,oninferno:t,botdash:t,"apps-1and1":t,ipifony:t,cloudjiffy:[2,{"fra1-de":t,"west1-us":t}],elastx:[0,{"jls-sto1":t,"jls-sto2":t,"jls-sto3":t}],massivegrid:[0,{paas:[0,{"fr-1":t,"lon-1":t,"lon-2":t,"ny-1":t,"ny-2":t,"sg-1":t}]}],saveincloud:[0,{jelastic:t,"nordeste-idc":t}],scaleforce:G,kinghost:t,uni5:t,krellian:t,ggff:t,localto:s,barsy:t,luyani:t,memset:t,"azure-api":t,"azure-mobile":t,azureedge:t,azurefd:t,azurestaticapps:[2,{1:t,2:t,3:t,4:t,5:t,6:t,7:t,centralus:t,eastasia:t,eastus2:t,westeurope:t,westus2:t}],azurewebsites:t,cloudapp:t,trafficmanager:t,usgovcloudapi:$e,usgovcloudapp:t,usgovtrafficmanager:t,windows:$e,mynetname:[0,{sn:t}],routingthecloud:t,bounceme:t,ddns:t,"eating-organic":t,mydissent:t,myeffect:t,mymediapc:t,mypsx:t,mysecuritycamera:t,nhlfan:t,"no-ip":t,pgafan:t,privatizehealthinsurance:t,redirectme:t,serveblog:t,serveminecraft:t,sytes:t,dnsup:t,hicam:t,"now-dns":t,ownip:t,vpndns:t,cloudycluster:t,ovh:[0,{hosting:s,webpaas:s}],rackmaze:t,myradweb:t,in:t,"subsc-pay":t,squares:t,schokokeks:t,"firewall-gateway":t,seidat:t,senseering:t,siteleaf:t,mafelo:t,myspreadshop:t,"vps-host":[2,{jelastic:[0,{atl:t,njs:t,ric:t}]}],srcf:[0,{soc:t,user:t}],supabase:t,dsmynas:t,familyds:t,ts:[2,{c:s}],torproject:[2,{pages:t}],tunnelmole:t,vusercontent:t,"reserve-online":t,localcert:t,"community-pro":t,meinforum:t,yandexcloud:[2,{storage:t,website:t}],za:t,zabc:t}],nf:[1,{arts:e,com:e,firm:e,info:e,net:e,other:e,per:e,rec:e,store:e,web:e}],ng:[1,{com:e,edu:e,gov:e,i:e,mil:e,mobi:e,name:e,net:e,org:e,sch:e,biz:[2,{co:t,dl:t,go:t,lg:t,on:t}],col:t,firm:t,gen:t,ltd:t,ngo:t,plc:t}],ni:[1,{ac:e,biz:e,co:e,com:e,edu:e,gob:e,in:e,info:e,int:e,mil:e,net:e,nom:e,org:e,web:e}],nl:[1,{co:t,"hosting-cluster":t,gov:t,khplay:t,"123website":t,myspreadshop:t,transurl:s,cistron:t,demon:t}],no:[1,{fhs:e,folkebibl:e,fylkesbibl:e,idrett:e,museum:e,priv:e,vgs:e,dep:e,herad:e,kommune:e,mil:e,stat:e,aa:we,ah:we,bu:we,fm:we,hl:we,hm:we,"jan-mayen":we,mr:we,nl:we,nt:we,of:we,ol:we,oslo:we,rl:we,sf:we,st:we,svalbard:we,tm:we,tr:we,va:we,vf:we,akrehamn:e,"xn--krehamn-dxa":e,åkrehamn:e,algard:e,"xn--lgrd-poac":e,ålgård:e,arna:e,bronnoysund:e,"xn--brnnysund-m8ac":e,brønnøysund:e,brumunddal:e,bryne:e,drobak:e,"xn--drbak-wua":e,drøbak:e,egersund:e,fetsund:e,floro:e,"xn--flor-jra":e,florø:e,fredrikstad:e,hokksund:e,honefoss:e,"xn--hnefoss-q1a":e,hønefoss:e,jessheim:e,jorpeland:e,"xn--jrpeland-54a":e,jørpeland:e,kirkenes:e,kopervik:e,krokstadelva:e,langevag:e,"xn--langevg-jxa":e,langevåg:e,leirvik:e,mjondalen:e,"xn--mjndalen-64a":e,mjøndalen:e,"mo-i-rana":e,mosjoen:e,"xn--mosjen-eya":e,mosjøen:e,nesoddtangen:e,orkanger:e,osoyro:e,"xn--osyro-wua":e,osøyro:e,raholt:e,"xn--rholt-mra":e,råholt:e,sandnessjoen:e,"xn--sandnessjen-ogb":e,sandnessjøen:e,skedsmokorset:e,slattum:e,spjelkavik:e,stathelle:e,stavern:e,stjordalshalsen:e,"xn--stjrdalshalsen-sqb":e,stjørdalshalsen:e,tananger:e,tranby:e,vossevangen:e,aarborte:e,aejrie:e,afjord:e,"xn--fjord-lra":e,åfjord:e,agdenes:e,akershus:Ge,aknoluokta:e,"xn--koluokta-7ya57h":e,ákŋoluokta:e,al:e,"xn--l-1fa":e,ål:e,alaheadju:e,"xn--laheadju-7ya":e,álaheadju:e,alesund:e,"xn--lesund-hua":e,ålesund:e,alstahaug:e,alta:e,"xn--lt-liac":e,áltá:e,alvdal:e,amli:e,"xn--mli-tla":e,åmli:e,amot:e,"xn--mot-tla":e,åmot:e,andasuolo:e,andebu:e,andoy:e,"xn--andy-ira":e,andøy:e,ardal:e,"xn--rdal-poa":e,årdal:e,aremark:e,arendal:e,"xn--s-1fa":e,ås:e,aseral:e,"xn--seral-lra":e,åseral:e,asker:e,askim:e,askoy:e,"xn--asky-ira":e,askøy:e,askvoll:e,asnes:e,"xn--snes-poa":e,åsnes:e,audnedaln:e,aukra:e,aure:e,aurland:e,"aurskog-holand":e,"xn--aurskog-hland-jnb":e,"aurskog-høland":e,austevoll:e,austrheim:e,averoy:e,"xn--avery-yua":e,averøy:e,badaddja:e,"xn--bdddj-mrabd":e,bådåddjå:e,"xn--brum-voa":e,bærum:e,bahcavuotna:e,"xn--bhcavuotna-s4a":e,báhcavuotna:e,bahccavuotna:e,"xn--bhccavuotna-k7a":e,báhccavuotna:e,baidar:e,"xn--bidr-5nac":e,báidár:e,bajddar:e,"xn--bjddar-pta":e,bájddar:e,balat:e,"xn--blt-elab":e,bálát:e,balestrand:e,ballangen:e,balsfjord:e,bamble:e,bardu:e,barum:e,batsfjord:e,"xn--btsfjord-9za":e,båtsfjord:e,bearalvahki:e,"xn--bearalvhki-y4a":e,bearalváhki:e,beardu:e,beiarn:e,berg:e,bergen:e,berlevag:e,"xn--berlevg-jxa":e,berlevåg:e,bievat:e,"xn--bievt-0qa":e,bievát:e,bindal:e,birkenes:e,bjerkreim:e,bjugn:e,bodo:e,"xn--bod-2na":e,bodø:e,bokn:e,bomlo:e,"xn--bmlo-gra":e,bømlo:e,bremanger:e,bronnoy:e,"xn--brnny-wuac":e,brønnøy:e,budejju:e,buskerud:Ge,bygland:e,bykle:e,cahcesuolo:e,"xn--hcesuolo-7ya35b":e,čáhcesuolo:e,davvenjarga:e,"xn--davvenjrga-y4a":e,davvenjárga:e,davvesiida:e,deatnu:e,dielddanuorri:e,divtasvuodna:e,divttasvuotna:e,donna:e,"xn--dnna-gra":e,dønna:e,dovre:e,drammen:e,drangedal:e,dyroy:e,"xn--dyry-ira":e,dyrøy:e,eid:e,eidfjord:e,eidsberg:e,eidskog:e,eidsvoll:e,eigersund:e,elverum:e,enebakk:e,engerdal:e,etne:e,etnedal:e,evenassi:e,"xn--eveni-0qa01ga":e,evenášši:e,evenes:e,"evje-og-hornnes":e,farsund:e,fauske:e,fedje:e,fet:e,finnoy:e,"xn--finny-yua":e,finnøy:e,fitjar:e,fjaler:e,fjell:e,fla:e,"xn--fl-zia":e,flå:e,flakstad:e,flatanger:e,flekkefjord:e,flesberg:e,flora:e,folldal:e,forde:e,"xn--frde-gra":e,førde:e,forsand:e,fosnes:e,"xn--frna-woa":e,fræna:e,frana:e,frei:e,frogn:e,froland:e,frosta:e,froya:e,"xn--frya-hra":e,frøya:e,fuoisku:e,fuossko:e,fusa:e,fyresdal:e,gaivuotna:e,"xn--givuotna-8ya":e,gáivuotna:e,galsa:e,"xn--gls-elac":e,gálsá:e,gamvik:e,gangaviika:e,"xn--ggaviika-8ya47h":e,gáŋgaviika:e,gaular:e,gausdal:e,giehtavuoatna:e,gildeskal:e,"xn--gildeskl-g0a":e,gildeskål:e,giske:e,gjemnes:e,gjerdrum:e,gjerstad:e,gjesdal:e,gjovik:e,"xn--gjvik-wua":e,gjøvik:e,gloppen:e,gol:e,gran:e,grane:e,granvin:e,gratangen:e,grimstad:e,grong:e,grue:e,gulen:e,guovdageaidnu:e,ha:e,"xn--h-2fa":e,hå:e,habmer:e,"xn--hbmer-xqa":e,hábmer:e,hadsel:e,"xn--hgebostad-g3a":e,hægebostad:e,hagebostad:e,halden:e,halsa:e,hamar:e,hamaroy:e,hammarfeasta:e,"xn--hmmrfeasta-s4ac":e,hámmárfeasta:e,hammerfest:e,hapmir:e,"xn--hpmir-xqa":e,hápmir:e,haram:e,hareid:e,harstad:e,hasvik:e,hattfjelldal:e,haugesund:e,hedmark:[0,{os:e,valer:e,"xn--vler-qoa":e,våler:e}],hemne:e,hemnes:e,hemsedal:e,hitra:e,hjartdal:e,hjelmeland:e,hobol:e,"xn--hobl-ira":e,hobøl:e,hof:e,hol:e,hole:e,holmestrand:e,holtalen:e,"xn--holtlen-hxa":e,holtålen:e,hordaland:[0,{os:e}],hornindal:e,horten:e,hoyanger:e,"xn--hyanger-q1a":e,høyanger:e,hoylandet:e,"xn--hylandet-54a":e,høylandet:e,hurdal:e,hurum:e,hvaler:e,hyllestad:e,ibestad:e,inderoy:e,"xn--indery-fya":e,inderøy:e,iveland:e,ivgu:e,jevnaker:e,jolster:e,"xn--jlster-bya":e,jølster:e,jondal:e,kafjord:e,"xn--kfjord-iua":e,kåfjord:e,karasjohka:e,"xn--krjohka-hwab49j":e,kárášjohka:e,karasjok:e,karlsoy:e,karmoy:e,"xn--karmy-yua":e,karmøy:e,kautokeino:e,klabu:e,"xn--klbu-woa":e,klæbu:e,klepp:e,kongsberg:e,kongsvinger:e,kraanghke:e,"xn--kranghke-b0a":e,kråanghke:e,kragero:e,"xn--krager-gya":e,kragerø:e,kristiansand:e,kristiansund:e,krodsherad:e,"xn--krdsherad-m8a":e,krødsherad:e,"xn--kvfjord-nxa":e,kvæfjord:e,"xn--kvnangen-k0a":e,kvænangen:e,kvafjord:e,kvalsund:e,kvam:e,kvanangen:e,kvinesdal:e,kvinnherad:e,kviteseid:e,kvitsoy:e,"xn--kvitsy-fya":e,kvitsøy:e,laakesvuemie:e,"xn--lrdal-sra":e,lærdal:e,lahppi:e,"xn--lhppi-xqa":e,láhppi:e,lardal:e,larvik:e,lavagis:e,lavangen:e,leangaviika:e,"xn--leagaviika-52b":e,leaŋgaviika:e,lebesby:e,leikanger:e,leirfjord:e,leka:e,leksvik:e,lenvik:e,lerdal:e,lesja:e,levanger:e,lier:e,lierne:e,lillehammer:e,lillesand:e,lindas:e,"xn--linds-pra":e,lindås:e,lindesnes:e,loabat:e,"xn--loabt-0qa":e,loabát:e,lodingen:e,"xn--ldingen-q1a":e,lødingen:e,lom:e,loppa:e,lorenskog:e,"xn--lrenskog-54a":e,lørenskog:e,loten:e,"xn--lten-gra":e,løten:e,lund:e,lunner:e,luroy:e,"xn--lury-ira":e,lurøy:e,luster:e,lyngdal:e,lyngen:e,malatvuopmi:e,"xn--mlatvuopmi-s4a":e,málatvuopmi:e,malselv:e,"xn--mlselv-iua":e,målselv:e,malvik:e,mandal:e,marker:e,marnardal:e,masfjorden:e,masoy:e,"xn--msy-ula0h":e,måsøy:e,"matta-varjjat":e,"xn--mtta-vrjjat-k7af":e,"mátta-várjjat":e,meland:e,meldal:e,melhus:e,meloy:e,"xn--mely-ira":e,meløy:e,meraker:e,"xn--merker-kua":e,meråker:e,midsund:e,"midtre-gauldal":e,moareke:e,"xn--moreke-jua":e,moåreke:e,modalen:e,modum:e,molde:e,"more-og-romsdal":[0,{heroy:e,sande:e}],"xn--mre-og-romsdal-qqb":[0,{"xn--hery-ira":e,sande:e}],"møre-og-romsdal":[0,{herøy:e,sande:e}],moskenes:e,moss:e,muosat:e,"xn--muost-0qa":e,muosát:e,naamesjevuemie:e,"xn--nmesjevuemie-tcba":e,nååmesjevuemie:e,"xn--nry-yla5g":e,nærøy:e,namdalseid:e,namsos:e,namsskogan:e,nannestad:e,naroy:e,narviika:e,narvik:e,naustdal:e,navuotna:e,"xn--nvuotna-hwa":e,návuotna:e,"nedre-eiker":e,nesna:e,nesodden:e,nesseby:e,nesset:e,nissedal:e,nittedal:e,"nord-aurdal":e,"nord-fron":e,"nord-odal":e,norddal:e,nordkapp:e,nordland:[0,{bo:e,"xn--b-5ga":e,bø:e,heroy:e,"xn--hery-ira":e,herøy:e}],"nordre-land":e,nordreisa:e,"nore-og-uvdal":e,notodden:e,notteroy:e,"xn--nttery-byae":e,nøtterøy:e,odda:e,oksnes:e,"xn--ksnes-uua":e,øksnes:e,omasvuotna:e,oppdal:e,oppegard:e,"xn--oppegrd-ixa":e,oppegård:e,orkdal:e,orland:e,"xn--rland-uua":e,ørland:e,orskog:e,"xn--rskog-uua":e,ørskog:e,orsta:e,"xn--rsta-fra":e,ørsta:e,osen:e,osteroy:e,"xn--ostery-fya":e,osterøy:e,ostfold:[0,{valer:e}],"xn--stfold-9xa":[0,{"xn--vler-qoa":e}],østfold:[0,{våler:e}],"ostre-toten":e,"xn--stre-toten-zcb":e,"østre-toten":e,overhalla:e,"ovre-eiker":e,"xn--vre-eiker-k8a":e,"øvre-eiker":e,oyer:e,"xn--yer-zna":e,øyer:e,oygarden:e,"xn--ygarden-p1a":e,øygarden:e,"oystre-slidre":e,"xn--ystre-slidre-ujb":e,"øystre-slidre":e,porsanger:e,porsangu:e,"xn--porsgu-sta26f":e,porsáŋgu:e,porsgrunn:e,rade:e,"xn--rde-ula":e,råde:e,radoy:e,"xn--rady-ira":e,radøy:e,"xn--rlingen-mxa":e,rælingen:e,rahkkeravju:e,"xn--rhkkervju-01af":e,ráhkkerávju:e,raisa:e,"xn--risa-5na":e,ráisa:e,rakkestad:e,ralingen:e,rana:e,randaberg:e,rauma:e,rendalen:e,rennebu:e,rennesoy:e,"xn--rennesy-v1a":e,rennesøy:e,rindal:e,ringebu:e,ringerike:e,ringsaker:e,risor:e,"xn--risr-ira":e,risør:e,rissa:e,roan:e,rodoy:e,"xn--rdy-0nab":e,rødøy:e,rollag:e,romsa:e,romskog:e,"xn--rmskog-bya":e,rømskog:e,roros:e,"xn--rros-gra":e,røros:e,rost:e,"xn--rst-0na":e,røst:e,royken:e,"xn--ryken-vua":e,røyken:e,royrvik:e,"xn--ryrvik-bya":e,røyrvik:e,ruovat:e,rygge:e,salangen:e,salat:e,"xn--slat-5na":e,sálat:e,"xn--slt-elab":e,sálát:e,saltdal:e,samnanger:e,sandefjord:e,sandnes:e,sandoy:e,"xn--sandy-yua":e,sandøy:e,sarpsborg:e,sauda:e,sauherad:e,sel:e,selbu:e,selje:e,seljord:e,siellak:e,sigdal:e,siljan:e,sirdal:e,skanit:e,"xn--sknit-yqa":e,skánit:e,skanland:e,"xn--sknland-fxa":e,skånland:e,skaun:e,skedsmo:e,ski:e,skien:e,skierva:e,"xn--skierv-uta":e,skiervá:e,skiptvet:e,skjak:e,"xn--skjk-soa":e,skjåk:e,skjervoy:e,"xn--skjervy-v1a":e,skjervøy:e,skodje:e,smola:e,"xn--smla-hra":e,smøla:e,snaase:e,"xn--snase-nra":e,snåase:e,snasa:e,"xn--snsa-roa":e,snåsa:e,snillfjord:e,snoasa:e,sogndal:e,sogne:e,"xn--sgne-gra":e,søgne:e,sokndal:e,sola:e,solund:e,somna:e,"xn--smna-gra":e,sømna:e,"sondre-land":e,"xn--sndre-land-0cb":e,"søndre-land":e,songdalen:e,"sor-aurdal":e,"xn--sr-aurdal-l8a":e,"sør-aurdal":e,"sor-fron":e,"xn--sr-fron-q1a":e,"sør-fron":e,"sor-odal":e,"xn--sr-odal-q1a":e,"sør-odal":e,"sor-varanger":e,"xn--sr-varanger-ggb":e,"sør-varanger":e,sorfold:e,"xn--srfold-bya":e,sørfold:e,sorreisa:e,"xn--srreisa-q1a":e,sørreisa:e,sortland:e,sorum:e,"xn--srum-gra":e,sørum:e,spydeberg:e,stange:e,stavanger:e,steigen:e,steinkjer:e,stjordal:e,"xn--stjrdal-s1a":e,stjørdal:e,stokke:e,"stor-elvdal":e,stord:e,stordal:e,storfjord:e,strand:e,stranda:e,stryn:e,sula:e,suldal:e,sund:e,sunndal:e,surnadal:e,sveio:e,svelvik:e,sykkylven:e,tana:e,telemark:[0,{bo:e,"xn--b-5ga":e,bø:e}],time:e,tingvoll:e,tinn:e,tjeldsund:e,tjome:e,"xn--tjme-hra":e,tjøme:e,tokke:e,tolga:e,tonsberg:e,"xn--tnsberg-q1a":e,tønsberg:e,torsken:e,"xn--trna-woa":e,træna:e,trana:e,tranoy:e,"xn--trany-yua":e,tranøy:e,troandin:e,trogstad:e,"xn--trgstad-r1a":e,trøgstad:e,tromsa:e,tromso:e,"xn--troms-zua":e,tromsø:e,trondheim:e,trysil:e,tvedestrand:e,tydal:e,tynset:e,tysfjord:e,tysnes:e,"xn--tysvr-vra":e,tysvær:e,tysvar:e,ullensaker:e,ullensvang:e,ulvik:e,unjarga:e,"xn--unjrga-rta":e,unjárga:e,utsira:e,vaapste:e,vadso:e,"xn--vads-jra":e,vadsø:e,"xn--vry-yla5g":e,værøy:e,vaga:e,"xn--vg-yiab":e,vågå:e,vagan:e,"xn--vgan-qoa":e,vågan:e,vagsoy:e,"xn--vgsy-qoa0j":e,vågsøy:e,vaksdal:e,valle:e,vang:e,vanylven:e,vardo:e,"xn--vard-jra":e,vardø:e,varggat:e,"xn--vrggt-xqad":e,várggát:e,varoy:e,vefsn:e,vega:e,vegarshei:e,"xn--vegrshei-c0a":e,vegårshei:e,vennesla:e,verdal:e,verran:e,vestby:e,vestfold:[0,{sande:e}],vestnes:e,"vestre-slidre":e,"vestre-toten":e,vestvagoy:e,"xn--vestvgy-ixa6o":e,vestvågøy:e,vevelstad:e,vik:e,vikna:e,vindafjord:e,voagat:e,volda:e,voss:e,co:t,"123hjemmeside":t,myspreadshop:t}],np:k,nr:We,nu:[1,{merseine:t,mine:t,shacknet:t,enterprisecloud:t}],nz:[1,{ac:e,co:e,cri:e,geek:e,gen:e,govt:e,health:e,iwi:e,kiwi:e,maori:e,"xn--mori-qsa":e,māori:e,mil:e,net:e,org:e,parliament:e,school:e,cloudns:t}],om:[1,{co:e,com:e,edu:e,gov:e,med:e,museum:e,net:e,org:e,pro:e}],onion:e,org:[1,{altervista:t,pimienta:t,poivron:t,potager:t,sweetpepper:t,cdn77:[0,{c:t,rsc:t}],"cdn77-secure":[0,{origin:[0,{ssl:t}]}],ae:t,cloudns:t,"ip-dynamic":t,ddnss:t,dpdns:t,duckdns:t,tunk:t,blogdns:t,blogsite:t,boldlygoingnowhere:t,dnsalias:t,dnsdojo:t,doesntexist:t,dontexist:t,doomdns:t,dvrdns:t,dynalias:t,dyndns:[2,{go:t,home:t}],endofinternet:t,endoftheinternet:t,"from-me":t,"game-host":t,gotdns:t,"hobby-site":t,homedns:t,homeftp:t,homelinux:t,homeunix:t,"is-a-bruinsfan":t,"is-a-candidate":t,"is-a-celticsfan":t,"is-a-chef":t,"is-a-geek":t,"is-a-knight":t,"is-a-linux-user":t,"is-a-patsfan":t,"is-a-soxfan":t,"is-found":t,"is-lost":t,"is-saved":t,"is-very-bad":t,"is-very-evil":t,"is-very-good":t,"is-very-nice":t,"is-very-sweet":t,"isa-geek":t,"kicks-ass":t,misconfused:t,podzone:t,readmyblog:t,selfip:t,sellsyourhome:t,servebbs:t,serveftp:t,servegame:t,"stuff-4-sale":t,webhop:t,accesscam:t,camdvr:t,freeddns:t,mywire:t,roxa:t,webredirect:t,twmail:t,eu:[2,{al:t,asso:t,at:t,au:t,be:t,bg:t,ca:t,cd:t,ch:t,cn:t,cy:t,cz:t,de:t,dk:t,edu:t,ee:t,es:t,fi:t,fr:t,gr:t,hr:t,hu:t,ie:t,il:t,in:t,int:t,is:t,it:t,jp:t,kr:t,lt:t,lu:t,lv:t,me:t,mk:t,mt:t,my:t,net:t,ng:t,nl:t,no:t,nz:t,pl:t,pt:t,ro:t,ru:t,se:t,si:t,sk:t,tr:t,uk:t,us:t}],fedorainfracloud:t,fedorapeople:t,fedoraproject:[0,{cloud:t,os:ce,stg:[0,{os:ce}]}],freedesktop:t,hatenadiary:t,hepforge:t,"in-dsl":t,"in-vpn":t,js:t,barsy:t,mayfirst:t,routingthecloud:t,bmoattachments:t,"cable-modem":t,collegefan:t,couchpotatofries:t,hopto:t,mlbfan:t,myftp:t,mysecuritycamera:t,nflfan:t,"no-ip":t,"read-books":t,ufcfan:t,zapto:t,dynserv:t,"now-dns":t,"is-local":t,httpbin:t,pubtls:t,jpn:t,"my-firewall":t,myfirewall:t,spdns:t,"small-web":t,dsmynas:t,familyds:t,teckids:Ie,tuxfamily:t,hk:t,us:t,toolforge:t,wmcloud:[2,{beta:t}],wmflabs:t,za:t}],pa:[1,{abo:e,ac:e,com:e,edu:e,gob:e,ing:e,med:e,net:e,nom:e,org:e,sld:e}],pe:[1,{com:e,edu:e,gob:e,mil:e,net:e,nom:e,org:e}],pf:[1,{com:e,edu:e,org:e}],pg:k,ph:[1,{com:e,edu:e,gov:e,i:e,mil:e,net:e,ngo:e,org:e,cloudns:t}],pk:[1,{ac:e,biz:e,com:e,edu:e,fam:e,gkp:e,gob:e,gog:e,gok:e,gop:e,gos:e,gov:e,net:e,org:e,web:e}],pl:[1,{com:e,net:e,org:e,agro:e,aid:e,atm:e,auto:e,biz:e,edu:e,gmina:e,gsm:e,info:e,mail:e,media:e,miasta:e,mil:e,nieruchomosci:e,nom:e,pc:e,powiat:e,priv:e,realestate:e,rel:e,sex:e,shop:e,sklep:e,sos:e,szkola:e,targi:e,tm:e,tourism:e,travel:e,turystyka:e,gov:[1,{ap:e,griw:e,ic:e,is:e,kmpsp:e,konsulat:e,kppsp:e,kwp:e,kwpsp:e,mup:e,mw:e,oia:e,oirm:e,oke:e,oow:e,oschr:e,oum:e,pa:e,pinb:e,piw:e,po:e,pr:e,psp:e,psse:e,pup:e,rzgw:e,sa:e,sdn:e,sko:e,so:e,sr:e,starostwo:e,ug:e,ugim:e,um:e,umig:e,upow:e,uppo:e,us:e,uw:e,uzs:e,wif:e,wiih:e,winb:e,wios:e,witd:e,wiw:e,wkz:e,wsa:e,wskr:e,wsse:e,wuoz:e,wzmiuw:e,zp:e,zpisdn:e}],augustow:e,"babia-gora":e,bedzin:e,beskidy:e,bialowieza:e,bialystok:e,bielawa:e,bieszczady:e,boleslawiec:e,bydgoszcz:e,bytom:e,cieszyn:e,czeladz:e,czest:e,dlugoleka:e,elblag:e,elk:e,glogow:e,gniezno:e,gorlice:e,grajewo:e,ilawa:e,jaworzno:e,"jelenia-gora":e,jgora:e,kalisz:e,karpacz:e,kartuzy:e,kaszuby:e,katowice:e,"kazimierz-dolny":e,kepno:e,ketrzyn:e,klodzko:e,kobierzyce:e,kolobrzeg:e,konin:e,konskowola:e,kutno:e,lapy:e,lebork:e,legnica:e,lezajsk:e,limanowa:e,lomza:e,lowicz:e,lubin:e,lukow:e,malbork:e,malopolska:e,mazowsze:e,mazury:e,mielec:e,mielno:e,mragowo:e,naklo:e,nowaruda:e,nysa:e,olawa:e,olecko:e,olkusz:e,olsztyn:e,opoczno:e,opole:e,ostroda:e,ostroleka:e,ostrowiec:e,ostrowwlkp:e,pila:e,pisz:e,podhale:e,podlasie:e,polkowice:e,pomorskie:e,pomorze:e,prochowice:e,pruszkow:e,przeworsk:e,pulawy:e,radom:e,"rawa-maz":e,rybnik:e,rzeszow:e,sanok:e,sejny:e,skoczow:e,slask:e,slupsk:e,sosnowiec:e,"stalowa-wola":e,starachowice:e,stargard:e,suwalki:e,swidnica:e,swiebodzin:e,swinoujscie:e,szczecin:e,szczytno:e,tarnobrzeg:e,tgory:e,turek:e,tychy:e,ustka:e,walbrzych:e,warmia:e,warszawa:e,waw:e,wegrow:e,wielun:e,wlocl:e,wloclawek:e,wodzislaw:e,wolomin:e,wroclaw:e,zachpomor:e,zagan:e,zarow:e,zgora:e,zgorzelec:e,art:t,gliwice:t,krakow:t,poznan:t,wroc:t,zakopane:t,beep:t,"ecommerce-shop":t,cfolks:t,dfirma:t,dkonto:t,you2:t,shoparena:t,homesklep:t,sdscloud:t,unicloud:t,lodz:t,pabianice:t,plock:t,sieradz:t,skierniewice:t,zgierz:t,krasnik:t,leczna:t,lubartow:t,lublin:t,poniatowa:t,swidnik:t,co:t,torun:t,simplesite:t,myspreadshop:t,gda:t,gdansk:t,gdynia:t,med:t,sopot:t,bielsko:t}],pm:[1,{own:t,name:t}],pn:[1,{co:e,edu:e,gov:e,net:e,org:e}],post:e,pr:[1,{biz:e,com:e,edu:e,gov:e,info:e,isla:e,name:e,net:e,org:e,pro:e,ac:e,est:e,prof:e}],pro:[1,{aaa:e,aca:e,acct:e,avocat:e,bar:e,cpa:e,eng:e,jur:e,law:e,med:e,recht:e,cloudns:t,keenetic:t,barsy:t,ngrok:t}],ps:[1,{com:e,edu:e,gov:e,net:e,org:e,plo:e,sec:e}],pt:[1,{com:e,edu:e,gov:e,int:e,net:e,nome:e,org:e,publ:e,"123paginaweb":t}],pw:[1,{gov:e,cloudns:t,x443:t}],py:[1,{com:e,coop:e,edu:e,gov:e,mil:e,net:e,org:e}],qa:[1,{com:e,edu:e,gov:e,mil:e,name:e,net:e,org:e,sch:e}],re:[1,{asso:e,com:e,netlib:t,can:t}],ro:[1,{arts:e,com:e,firm:e,info:e,nom:e,nt:e,org:e,rec:e,store:e,tm:e,www:e,co:t,shop:t,barsy:t}],rs:[1,{ac:e,co:e,edu:e,gov:e,in:e,org:e,brendly:x,barsy:t,ox:t}],ru:[1,{ac:t,edu:t,gov:t,int:t,mil:t,eurodir:t,adygeya:t,bashkiria:t,bir:t,cbg:t,com:t,dagestan:t,grozny:t,kalmykia:t,kustanai:t,marine:t,mordovia:t,msk:t,mytis:t,nalchik:t,nov:t,pyatigorsk:t,spb:t,vladikavkaz:t,vladimir:t,na4u:t,mircloud:t,myjino:[2,{hosting:s,landing:s,spectrum:s,vps:s}],cldmail:[0,{hb:t}],mcdir:[2,{vps:t}],mcpre:t,net:t,org:t,pp:t,ras:t}],rw:[1,{ac:e,co:e,coop:e,gov:e,mil:e,net:e,org:e}],sa:[1,{com:e,edu:e,gov:e,med:e,net:e,org:e,pub:e,sch:e}],sb:n,sc:n,sd:[1,{com:e,edu:e,gov:e,info:e,med:e,net:e,org:e,tv:e}],se:[1,{a:e,ac:e,b:e,bd:e,brand:e,c:e,d:e,e,f:e,fh:e,fhsk:e,fhv:e,g:e,h:e,i:e,k:e,komforb:e,kommunalforbund:e,komvux:e,l:e,lanbib:e,m:e,n:e,naturbruksgymn:e,o:e,org:e,p:e,parti:e,pp:e,press:e,r:e,s:e,t:e,tm:e,u:e,w:e,x:e,y:e,z:e,com:t,iopsys:t,"123minsida":t,itcouldbewor:t,myspreadshop:t}],sg:[1,{com:e,edu:e,gov:e,net:e,org:e,enscaled:t}],sh:[1,{com:e,gov:e,mil:e,net:e,org:e,hashbang:t,botda:t,lovable:t,platform:[0,{ent:t,eu:t,us:t}],teleport:t,now:t}],si:[1,{f5:t,gitapp:t,gitpage:t}],sj:e,sk:[1,{org:e}],sl:n,sm:e,sn:[1,{art:e,com:e,edu:e,gouv:e,org:e,univ:e}],so:[1,{com:e,edu:e,gov:e,me:e,net:e,org:e,surveys:t}],sr:e,ss:[1,{biz:e,co:e,com:e,edu:e,gov:e,me:e,net:e,org:e,sch:e}],st:[1,{co:e,com:e,consulado:e,edu:e,embaixada:e,mil:e,net:e,org:e,principe:e,saotome:e,store:e,helioho:t,cn:s,kirara:t,noho:t}],su:[1,{abkhazia:t,adygeya:t,aktyubinsk:t,arkhangelsk:t,armenia:t,ashgabad:t,azerbaijan:t,balashov:t,bashkiria:t,bryansk:t,bukhara:t,chimkent:t,dagestan:t,"east-kazakhstan":t,exnet:t,georgia:t,grozny:t,ivanovo:t,jambyl:t,kalmykia:t,kaluga:t,karacol:t,karaganda:t,karelia:t,khakassia:t,krasnodar:t,kurgan:t,kustanai:t,lenug:t,mangyshlak:t,mordovia:t,msk:t,murmansk:t,nalchik:t,navoi:t,"north-kazakhstan":t,nov:t,obninsk:t,penza:t,pokrovsk:t,sochi:t,spb:t,tashkent:t,termez:t,togliatti:t,troitsk:t,tselinograd:t,tula:t,tuva:t,vladikavkaz:t,vladimir:t,vologda:t}],sv:[1,{com:e,edu:e,gob:e,org:e,red:e}],sx:c,sy:r,sz:[1,{ac:e,co:e,org:e}],tc:e,td:e,tel:e,tf:[1,{sch:t}],tg:e,th:[1,{ac:e,co:e,go:e,in:e,mi:e,net:e,or:e,online:t,shop:t}],tj:[1,{ac:e,biz:e,co:e,com:e,edu:e,go:e,gov:e,int:e,mil:e,name:e,net:e,nic:e,org:e,test:e,web:e}],tk:e,tl:c,tm:[1,{co:e,com:e,edu:e,gov:e,mil:e,net:e,nom:e,org:e}],tn:[1,{com:e,ens:e,fin:e,gov:e,ind:e,info:e,intl:e,mincom:e,nat:e,net:e,org:e,perso:e,tourism:e,orangecloud:t}],to:[1,{611:t,com:e,edu:e,gov:e,mil:e,net:e,org:e,oya:t,x0:t,quickconnect:j,vpnplus:t,nett:t}],tr:[1,{av:e,bbs:e,bel:e,biz:e,com:e,dr:e,edu:e,gen:e,gov:e,info:e,k12:e,kep:e,mil:e,name:e,net:e,org:e,pol:e,tel:e,tsk:e,tv:e,web:e,nc:c}],tt:[1,{biz:e,co:e,com:e,edu:e,gov:e,info:e,mil:e,name:e,net:e,org:e,pro:e}],tv:[1,{"better-than":t,dyndns:t,"on-the-web":t,"worse-than":t,from:t,sakura:t}],tw:[1,{club:e,com:[1,{mymailer:t}],ebiz:e,edu:e,game:e,gov:e,idv:e,mil:e,net:e,org:e,url:t,mydns:t}],tz:[1,{ac:e,co:e,go:e,hotel:e,info:e,me:e,mil:e,mobi:e,ne:e,or:e,sc:e,tv:e}],ua:[1,{com:e,edu:e,gov:e,in:e,net:e,org:e,cherkassy:e,cherkasy:e,chernigov:e,chernihiv:e,chernivtsi:e,chernovtsy:e,ck:e,cn:e,cr:e,crimea:e,cv:e,dn:e,dnepropetrovsk:e,dnipropetrovsk:e,donetsk:e,dp:e,if:e,"ivano-frankivsk":e,kh:e,kharkiv:e,kharkov:e,kherson:e,khmelnitskiy:e,khmelnytskyi:e,kiev:e,kirovograd:e,km:e,kr:e,kropyvnytskyi:e,krym:e,ks:e,kv:e,kyiv:e,lg:e,lt:e,lugansk:e,luhansk:e,lutsk:e,lv:e,lviv:e,mk:e,mykolaiv:e,nikolaev:e,od:e,odesa:e,odessa:e,pl:e,poltava:e,rivne:e,rovno:e,rv:e,sb:e,sebastopol:e,sevastopol:e,sm:e,sumy:e,te:e,ternopil:e,uz:e,uzhgorod:e,uzhhorod:e,vinnica:e,vinnytsia:e,vn:e,volyn:e,yalta:e,zakarpattia:e,zaporizhzhe:e,zaporizhzhia:e,zhitomir:e,zhytomyr:e,zp:e,zt:e,cc:t,inf:t,ltd:t,cx:t,biz:t,co:t,pp:t,v:t}],ug:[1,{ac:e,co:e,com:e,edu:e,go:e,gov:e,mil:e,ne:e,or:e,org:e,sc:e,us:e}],uk:[1,{ac:e,co:[1,{bytemark:[0,{dh:t,vm:t}],layershift:G,barsy:t,barsyonline:t,retrosnub:re,"nh-serv":t,"no-ip":t,adimo:t,myspreadshop:t}],gov:[1,{api:t,campaign:t,service:t}],ltd:e,me:e,net:e,nhs:e,org:[1,{glug:t,lug:t,lugs:t,affinitylottery:t,raffleentry:t,weeklylottery:t}],plc:e,police:e,sch:k,conn:t,copro:t,hosp:t,"independent-commission":t,"independent-inquest":t,"independent-inquiry":t,"independent-panel":t,"independent-review":t,"public-inquiry":t,"royal-commission":t,pymnt:t,barsy:t,nimsite:t,oraclegovcloudapps:s}],us:[1,{dni:e,isa:e,nsn:e,ak:Re,al:Re,ar:Re,as:Re,az:Re,ca:Re,co:Re,ct:Re,dc:Re,de:as,fl:Re,ga:Re,gu:Re,hi:yr,ia:Re,id:Re,il:Re,in:Re,ks:Re,ky:Re,la:Re,ma:[1,{k12:[1,{chtr:e,paroch:e,pvt:e}],cc:e,lib:e}],md:Re,me:Re,mi:[1,{k12:e,cc:e,lib:e,"ann-arbor":e,cog:e,dst:e,eaton:e,gen:e,mus:e,tec:e,washtenaw:e}],mn:Re,mo:Re,ms:[1,{k12:e,cc:e}],mt:Re,nc:Re,nd:yr,ne:Re,nh:Re,nj:Re,nm:Re,nv:Re,ny:Re,oh:Re,ok:Re,or:Re,pa:Re,pr:Re,ri:yr,sc:Re,sd:yr,tn:Re,tx:Re,ut:Re,va:Re,vi:Re,vt:Re,wa:Re,wi:Re,wv:as,wy:Re,cloudns:t,"is-by":t,"land-4-sale":t,"stuff-4-sale":t,heliohost:t,enscaled:[0,{phx:t}],mircloud:t,"azure-api":t,azurewebsites:t,ngo:t,golffan:t,noip:t,pointto:t,freeddns:t,srv:[2,{gh:t,gl:t}],servername:t}],uy:[1,{com:e,edu:e,gub:e,mil:e,net:e,org:e,gv:t}],uz:[1,{co:e,com:e,net:e,org:e}],va:e,vc:[1,{com:e,edu:e,gov:e,mil:e,net:e,org:e,gv:[2,{d:t}],"0e":s,mydns:t}],ve:[1,{arts:e,bib:e,co:e,com:e,e12:e,edu:e,emprende:e,firm:e,gob:e,gov:e,ia:e,info:e,int:e,mil:e,net:e,nom:e,org:e,rar:e,rec:e,store:e,tec:e,web:e}],vg:[1,{edu:e}],vi:[1,{co:e,com:e,k12:e,net:e,org:e}],vn:[1,{ac:e,ai:e,biz:e,com:e,edu:e,gov:e,health:e,id:e,info:e,int:e,io:e,name:e,net:e,org:e,pro:e,angiang:e,bacgiang:e,backan:e,baclieu:e,bacninh:e,"baria-vungtau":e,bentre:e,binhdinh:e,binhduong:e,binhphuoc:e,binhthuan:e,camau:e,cantho:e,caobang:e,daklak:e,daknong:e,danang:e,dienbien:e,dongnai:e,dongthap:e,gialai:e,hagiang:e,haiduong:e,haiphong:e,hanam:e,hanoi:e,hatinh:e,haugiang:e,hoabinh:e,hue:e,hungyen:e,khanhhoa:e,kiengiang:e,kontum:e,laichau:e,lamdong:e,langson:e,laocai:e,longan:e,namdinh:e,nghean:e,ninhbinh:e,ninhthuan:e,phutho:e,phuyen:e,quangbinh:e,quangnam:e,quangngai:e,quangninh:e,quangtri:e,soctrang:e,sonla:e,tayninh:e,thaibinh:e,thainguyen:e,thanhhoa:e,thanhphohochiminh:e,thuathienhue:e,tiengiang:e,travinh:e,tuyenquang:e,vinhlong:e,vinhphuc:e,yenbai:e}],vu:Ne,wf:[1,{biz:t,sch:t}],ws:[1,{com:e,edu:e,gov:e,net:e,org:e,advisor:s,cloud66:t,dyndns:t,mypets:t}],yt:[1,{org:t}],"xn--mgbaam7a8h":e,امارات:e,"xn--y9a3aq":e,հայ:e,"xn--54b7fta0cc":e,বাংলা:e,"xn--90ae":e,бг:e,"xn--mgbcpq6gpa1a":e,البحرين:e,"xn--90ais":e,бел:e,"xn--fiqs8s":e,中国:e,"xn--fiqz9s":e,中國:e,"xn--lgbbat1ad8j":e,الجزائر:e,"xn--wgbh1c":e,مصر:e,"xn--e1a4c":e,ею:e,"xn--qxa6a":e,ευ:e,"xn--mgbah1a3hjkrd":e,موريتانيا:e,"xn--node":e,გე:e,"xn--qxam":e,ελ:e,"xn--j6w193g":[1,{"xn--gmqw5a":e,"xn--55qx5d":e,"xn--mxtq1m":e,"xn--wcvs22d":e,"xn--uc0atv":e,"xn--od0alg":e}],香港:[1,{個人:e,公司:e,政府:e,教育:e,組織:e,網絡:e}],"xn--2scrj9c":e,ಭಾರತ:e,"xn--3hcrj9c":e,ଭାରତ:e,"xn--45br5cyl":e,ভাৰত:e,"xn--h2breg3eve":e,भारतम्:e,"xn--h2brj9c8c":e,भारोत:e,"xn--mgbgu82a":e,ڀارت:e,"xn--rvc1e0am3e":e,ഭാരതം:e,"xn--h2brj9c":e,भारत:e,"xn--mgbbh1a":e,بارت:e,"xn--mgbbh1a71e":e,بھارت:e,"xn--fpcrj9c3d":e,భారత్:e,"xn--gecrj9c":e,ભારત:e,"xn--s9brj9c":e,ਭਾਰਤ:e,"xn--45brj9c":e,ভারত:e,"xn--xkc2dl3a5ee0h":e,இந்தியா:e,"xn--mgba3a4f16a":e,ایران:e,"xn--mgba3a4fra":e,ايران:e,"xn--mgbtx2b":e,عراق:e,"xn--mgbayh7gpa":e,الاردن:e,"xn--3e0b707e":e,한국:e,"xn--80ao21a":e,қаз:e,"xn--q7ce6a":e,ລາວ:e,"xn--fzc2c9e2c":e,ලංකා:e,"xn--xkc2al3hye2a":e,இலங்கை:e,"xn--mgbc0a9azcg":e,المغرب:e,"xn--d1alf":e,мкд:e,"xn--l1acc":e,мон:e,"xn--mix891f":e,澳門:e,"xn--mix082f":e,澳门:e,"xn--mgbx4cd0ab":e,مليسيا:e,"xn--mgb9awbf":e,عمان:e,"xn--mgbai9azgqp6j":e,پاکستان:e,"xn--mgbai9a5eva00b":e,پاكستان:e,"xn--ygbi2ammx":e,فلسطين:e,"xn--90a3ac":[1,{"xn--80au":e,"xn--90azh":e,"xn--d1at":e,"xn--c1avg":e,"xn--o1ac":e,"xn--o1ach":e}],срб:[1,{ак:e,обр:e,од:e,орг:e,пр:e,упр:e}],"xn--p1ai":e,рф:e,"xn--wgbl6a":e,قطر:e,"xn--mgberp4a5d4ar":e,السعودية:e,"xn--mgberp4a5d4a87g":e,السعودیة:e,"xn--mgbqly7c0a67fbc":e,السعودیۃ:e,"xn--mgbqly7cvafr":e,السعوديه:e,"xn--mgbpl2fh":e,سودان:e,"xn--yfro4i67o":e,新加坡:e,"xn--clchc0ea0b2g2a9gcd":e,சிங்கப்பூர்:e,"xn--ogbpf8fl":e,سورية:e,"xn--mgbtf8fl":e,سوريا:e,"xn--o3cw4h":[1,{"xn--o3cyx2a":e,"xn--12co0c3b4eva":e,"xn--m3ch0j3a":e,"xn--h3cuzk1di":e,"xn--12c1fe0br":e,"xn--12cfi8ixb8l":e}],ไทย:[1,{ทหาร:e,ธุรกิจ:e,เน็ต:e,รัฐบาล:e,ศึกษา:e,องค์กร:e}],"xn--pgbs0dh":e,تونس:e,"xn--kpry57d":e,台灣:e,"xn--kprw13d":e,台湾:e,"xn--nnx388a":e,臺灣:e,"xn--j1amh":e,укр:e,"xn--mgb2ddes":e,اليمن:e,xxx:e,ye:r,za:[0,{ac:e,agric:e,alt:e,co:e,edu:e,gov:e,grondar:e,law:e,mil:e,net:e,ngo:e,nic:e,nis:e,nom:e,org:e,school:e,tm:e,web:e}],zm:[1,{ac:e,biz:e,co:e,com:e,edu:e,gov:e,info:e,mil:e,net:e,org:e,sch:e}],zw:[1,{ac:e,co:e,gov:e,mil:e,org:e}],aaa:e,aarp:e,abb:e,abbott:e,abbvie:e,abc:e,able:e,abogado:e,abudhabi:e,academy:[1,{official:t}],accenture:e,accountant:e,accountants:e,aco:e,actor:e,ads:e,adult:e,aeg:e,aetna:e,afl:e,africa:e,agakhan:e,agency:e,aig:e,airbus:e,airforce:e,airtel:e,akdn:e,alibaba:e,alipay:e,allfinanz:e,allstate:e,ally:e,alsace:e,alstom:e,amazon:e,americanexpress:e,americanfamily:e,amex:e,amfam:e,amica:e,amsterdam:e,analytics:e,android:e,anquan:e,anz:e,aol:e,apartments:e,app:[1,{adaptable:t,aiven:t,beget:s,brave:a,clerk:t,clerkstage:t,cloudflare:t,wnext:t,csb:[2,{preview:t}],convex:t,corespeed:t,deta:t,ondigitalocean:t,easypanel:t,encr:[2,{frontend:t}],evervault:o,expo:[2,{staging:t}],edgecompute:t,"on-fleek":t,flutterflow:t,sprites:t,e2b:t,framer:t,gadget:t,github:t,hosted:s,run:[0,{"*":t,mtls:s}],web:t,hackclub:t,hasura:t,onhercules:t,botdash:t,shiptoday:t,leapcell:t,loginline:t,lovable:t,luyani:t,magicpatterns:t,medusajs:t,messerli:t,miren:t,mocha:t,netlify:t,ngrok:t,"ngrok-free":t,developer:s,noop:t,northflank:s,upsun:s,railway:[0,{up:t}],replit:i,nyat:t,snowflake:[0,{"*":t,privatelink:s}],streamlit:t,spawnbase:t,telebit:t,typedream:t,vercel:t,wal:t,wasmer:t,bookonline:t,windsurf:t,base44:t,zeabur:t,zerops:s}],apple:[1,{int:[2,{cloud:[0,{"*":t,r:[0,{"*":t,"ap-north-1":s,"ap-south-1":s,"ap-south-2":s,"eu-central-1":s,"eu-north-1":s,"us-central-1":s,"us-central-2":s,"us-east-1":s,"us-east-2":s,"us-west-1":s,"us-west-2":s,"us-west-3":s}]}]}]}],aquarelle:e,arab:e,aramco:e,archi:e,army:e,art:e,arte:e,asda:e,associates:e,athleta:e,attorney:e,auction:e,audi:e,audible:e,audio:e,auspost:e,author:e,auto:e,autos:e,aws:[1,{on:[0,{"af-south-1":u,"ap-east-1":u,"ap-northeast-1":u,"ap-northeast-2":u,"ap-northeast-3":u,"ap-south-1":u,"ap-south-2":l,"ap-southeast-1":u,"ap-southeast-2":u,"ap-southeast-3":u,"ap-southeast-4":l,"ap-southeast-5":l,"ca-central-1":u,"ca-west-1":l,"eu-central-1":u,"eu-central-2":l,"eu-north-1":u,"eu-south-1":u,"eu-south-2":l,"eu-west-1":u,"eu-west-2":u,"eu-west-3":u,"il-central-1":l,"me-central-1":l,"me-south-1":u,"sa-east-1":u,"us-east-1":u,"us-east-2":u,"us-west-1":u,"us-west-2":u,"ap-southeast-7":d,"mx-central-1":d,"us-gov-east-1":h,"us-gov-west-1":h}],sagemaker:[0,{"ap-northeast-1":p,"ap-northeast-2":p,"ap-south-1":p,"ap-southeast-1":p,"ap-southeast-2":p,"ca-central-1":g,"eu-central-1":p,"eu-west-1":p,"eu-west-2":p,"us-east-1":g,"us-east-2":g,"us-west-2":g,"af-south-1":m,"ap-east-1":m,"ap-northeast-3":m,"ap-south-2":y,"ap-southeast-3":m,"ap-southeast-4":y,"ca-west-1":[0,{notebook:t,"notebook-fips":t}],"eu-central-2":m,"eu-north-1":m,"eu-south-1":m,"eu-south-2":m,"eu-west-3":m,"il-central-1":m,"me-central-1":m,"me-south-1":m,"sa-east-1":m,"us-gov-east-1":b,"us-gov-west-1":b,"us-west-1":[0,{notebook:t,"notebook-fips":t,studio:t}],experiments:s}],repost:[0,{private:s}]}],axa:e,azure:e,baby:e,baidu:e,banamex:e,band:e,bank:e,bar:e,barcelona:e,barclaycard:e,barclays:e,barefoot:e,bargains:e,baseball:e,basketball:[1,{aus:t,nz:t}],bauhaus:e,bayern:e,bbc:e,bbt:e,bbva:e,bcg:e,bcn:e,beats:e,beauty:e,beer:e,berlin:e,best:e,bestbuy:e,bet:e,bharti:e,bible:e,bid:e,bike:e,bing:e,bingo:e,bio:e,black:e,blackfriday:e,blockbuster:e,blog:e,bloomberg:e,blue:e,bms:e,bmw:e,bnpparibas:e,boats:e,boehringer:e,bofa:e,bom:e,bond:e,boo:e,book:e,booking:e,bosch:e,bostik:e,boston:e,bot:e,boutique:e,box:e,bradesco:e,bridgestone:e,broadway:e,broker:e,brother:e,brussels:e,build:[1,{shiptoday:t,v0:t,windsurf:t}],builders:[1,{cloudsite:t}],business:_,buy:e,buzz:e,bzh:e,cab:e,cafe:e,cal:e,call:e,calvinklein:e,cam:e,camera:e,camp:[1,{emf:[0,{at:t}]}],canon:e,capetown:e,capital:e,capitalone:e,car:e,caravan:e,cards:e,care:e,career:e,careers:e,cars:e,casa:[1,{nabu:[0,{ui:t}]}],case:[1,{sav:t}],cash:e,casino:e,catering:e,catholic:e,cba:e,cbn:e,cbre:e,center:e,ceo:e,cern:e,cfa:e,cfd:e,chanel:e,channel:e,charity:e,chase:e,chat:e,cheap:e,chintai:e,christmas:e,chrome:e,church:e,cipriani:e,circle:e,cisco:e,citadel:e,citi:e,citic:e,city:e,claims:e,cleaning:e,click:e,clinic:e,clinique:e,clothing:e,cloud:[1,{antagonist:t,begetcdn:s,convex:w,elementor:t,emergent:t,encoway:[0,{eu:t}],statics:s,ravendb:t,axarnet:[0,{"es-1":t}],diadem:t,jelastic:[0,{vip:t}],jele:t,"jenv-aruba":[0,{aruba:[0,{eur:[0,{it1:t}]}],it1:t}],keliweb:[2,{cs:t}],oxa:[2,{tn:t,uk:t}],primetel:[2,{uk:t}],reclaim:[0,{ca:t,uk:t,us:t}],trendhosting:[0,{ch:t,de:t}],jote:t,jotelulu:t,kuleuven:t,laravel:t,linkyard:t,magentosite:s,matlab:t,observablehq:t,perspecta:t,vapor:t,"on-rancher":s,scw:[0,{baremetal:[0,{"fr-par-1":t,"fr-par-2":t,"nl-ams-1":t}],"fr-par":[0,{cockpit:t,ddl:t,dtwh:t,fnc:[2,{functions:t}],ifr:t,k8s:T,kafk:t,mgdb:t,rdb:t,s3:t,"s3-website":t,scbl:t,whm:t}],instances:[0,{priv:t,pub:t}],k8s:t,"nl-ams":[0,{cockpit:t,ddl:t,dtwh:t,ifr:t,k8s:T,kafk:t,mgdb:t,rdb:t,s3:t,"s3-website":t,scbl:t,whm:t}],"pl-waw":[0,{cockpit:t,ddl:t,dtwh:t,ifr:t,k8s:T,kafk:t,mgdb:t,rdb:t,s3:t,"s3-website":t,scbl:t}],scalebook:t,smartlabeling:t}],servebolt:t,onstackit:[0,{runs:t}],trafficplex:t,"unison-services":t,urown:t,voorloper:t,zap:t}],club:[1,{cloudns:t,jele:t,barsy:t}],clubmed:e,coach:e,codes:[1,{owo:s}],coffee:e,college:e,cologne:e,commbank:e,community:[1,{nog:t,ravendb:t,myforum:t}],company:[1,{mybox:t}],compare:e,computer:e,comsec:e,condos:e,construction:e,consulting:e,contact:e,contractors:e,cooking:e,cool:[1,{elementor:t,de:t}],corsica:e,country:e,coupon:e,coupons:e,courses:e,cpa:e,credit:e,creditcard:e,creditunion:e,cricket:e,crown:e,crs:e,cruise:e,cruises:e,cuisinella:e,cymru:e,cyou:e,dad:e,dance:e,data:e,date:e,dating:e,datsun:e,day:e,dclk:e,dds:e,deal:e,dealer:e,deals:e,degree:e,delivery:e,dell:e,deloitte:e,delta:e,democrat:e,dental:e,dentist:e,desi:e,design:[1,{graphic:t,bss:t}],dev:[1,{myaddr:t,panel:t,bearblog:t,brave:a,lcl:s,lclstage:s,stg:s,stgstage:s,pages:t,r2:t,workers:t,deno:t,"deno-staging":t,deta:t,lp:[2,{api:t,objects:t}],evervault:o,fly:t,githubpreview:t,gateway:s,grebedoc:t,botdash:t,inbrowser:s,"is-a-good":t,iserv:t,leapcell:t,runcontainers:t,localcert:[0,{user:s}],loginline:t,barsy:t,mediatech:t,"mocha-sandbox":t,modx:t,ngrok:t,"ngrok-free":t,"is-a-fullstack":t,"is-cool":t,"is-not-a":t,localplayer:t,xmit:t,"platter-app":t,replit:[2,{archer:t,bones:t,canary:t,global:t,hacker:t,id:t,janeway:t,kim:t,kira:t,kirk:t,odo:t,paris:t,picard:t,pike:t,prerelease:t,reed:t,riker:t,sisko:t,spock:t,staging:t,sulu:t,tarpit:t,teams:t,tucker:t,wesley:t,worf:t}],crm:[0,{aa:s,ab:s,ac:s,ad:s,ae:s,af:s,ci:s,d:s,pa:s,pb:s,pc:s,pd:s,pe:s,pf:s,w:s,wa:s,wb:s,wc:s,wd:s,we:s,wf:s}],erp:ee,vercel:t,webhare:s,hrsn:t,"is-a":t}],dhl:e,diamonds:e,diet:e,digital:[1,{cloudapps:[2,{london:t}]}],direct:[1,{libp2p:t}],directory:e,discount:e,discover:e,dish:e,diy:[1,{discourse:t,imagine:t}],dnp:e,docs:e,doctor:e,dog:e,domains:e,dot:e,download:e,drive:e,dtv:e,dubai:e,dupont:e,durban:e,dvag:e,dvr:e,earth:e,eat:e,eco:e,edeka:e,education:_,email:[1,{crisp:[0,{on:t}],intouch:t,tawk:be,tawkto:be}],emerck:e,energy:e,engineer:e,engineering:e,enterprises:e,epson:e,equipment:e,ericsson:e,erni:e,esq:e,estate:[1,{compute:s}],eurovision:e,eus:[1,{party:Oe}],events:[1,{koobin:t,co:t}],exchange:e,expert:e,exposed:e,express:e,extraspace:e,fage:e,fail:e,fairwinds:e,faith:e,family:e,fan:e,fans:e,farm:[1,{storj:t}],farmers:e,fashion:e,fast:e,fedex:e,feedback:e,ferrari:e,ferrero:e,fidelity:e,fido:e,film:e,final:e,finance:e,financial:_,fire:e,firestone:e,firmdale:e,fish:e,fishing:e,fit:e,fitness:e,flickr:e,flights:e,flir:e,florist:e,flowers:e,fly:e,foo:e,food:e,football:e,ford:e,forex:e,forsale:e,forum:e,foundation:e,fox:e,free:e,fresenius:e,frl:e,frogans:e,frontier:e,ftr:e,fujitsu:e,fun:fe,fund:e,furniture:e,futbol:e,fyi:e,gal:e,gallery:e,gallo:e,gallup:e,game:e,games:[1,{pley:t,sheezy:t}],gap:e,garden:e,gay:[1,{pages:t}],gbiz:e,gdn:[1,{cnpy:t}],gea:e,gent:e,genting:e,george:e,ggee:e,gift:e,gifts:e,gives:e,giving:e,glass:e,gle:e,global:[1,{appwrite:t}],globo:e,gmail:e,gmbh:e,gmo:e,gmx:e,godaddy:e,gold:e,goldpoint:e,golf:e,goodyear:e,goog:[1,{cloud:t,translate:t,usercontent:s}],google:e,gop:e,got:e,grainger:e,graphics:e,gratis:e,green:e,gripe:e,grocery:e,group:[1,{discourse:t}],gucci:e,guge:e,guide:e,guitars:e,guru:e,hair:e,hamburg:e,hangout:e,haus:e,hbo:e,hdfc:e,hdfcbank:e,health:[1,{hra:t}],healthcare:e,help:e,helsinki:e,here:e,hermes:e,hiphop:e,hisamitsu:e,hitachi:e,hiv:e,hkt:e,hockey:e,holdings:e,holiday:e,homedepot:e,homegoods:e,homes:e,homesense:e,honda:e,horse:e,hospital:e,host:[1,{cloudaccess:t,freesite:t,easypanel:t,emergent:t,fastvps:t,myfast:t,gadget:t,tempurl:t,wpmudev:t,iserv:t,jele:t,mircloud:t,bolt:t,wp2:t,half:t}],hosting:[1,{opencraft:t}],hot:e,hotel:e,hotels:e,hotmail:e,house:e,how:e,hsbc:e,hughes:e,hyatt:e,hyundai:e,ibm:e,icbc:e,ice:e,icu:e,ieee:e,ifm:e,ikano:e,imamat:e,imdb:e,immo:e,immobilien:e,inc:e,industries:e,infiniti:e,ing:e,ink:e,institute:e,insurance:e,insure:e,international:e,intuit:e,investments:e,ipiranga:e,irish:e,ismaili:e,ist:e,istanbul:e,itau:e,itv:e,jaguar:e,java:e,jcb:e,jeep:e,jetzt:e,jewelry:e,jio:e,jll:e,jmp:e,jnj:e,joburg:e,jot:e,joy:e,jpmorgan:e,jprs:e,juegos:e,juniper:e,kaufen:e,kddi:e,kerryhotels:e,kerryproperties:e,kfh:e,kia:e,kids:e,kim:e,kindle:e,kitchen:e,kiwi:e,koeln:e,komatsu:e,kosher:e,kpmg:e,kpn:e,krd:[1,{co:t,edu:t}],kred:e,kuokgroup:e,kyoto:e,lacaixa:e,lamborghini:e,lamer:e,land:e,landrover:e,lanxess:e,lasalle:e,lat:e,latino:e,latrobe:e,law:e,lawyer:e,lds:e,lease:e,leclerc:e,lefrak:e,legal:e,lego:e,lexus:e,lgbt:e,lidl:e,life:e,lifeinsurance:e,lifestyle:e,lighting:e,like:e,lilly:e,limited:e,limo:e,lincoln:e,link:[1,{myfritz:t,cyon:t,joinmc:t,dweb:s,inbrowser:s,keenetic:t,nftstorage:Ft,mypep:t,storacha:Ft,w3s:Ft}],live:[1,{aem:t,hlx:t,ewp:s}],living:e,llc:e,llp:e,loan:e,loans:e,locker:e,locus:e,lol:[1,{omg:t}],london:e,lotte:e,lotto:e,love:e,lpl:e,lplfinancial:e,ltd:e,ltda:e,lundbeck:e,luxe:e,luxury:e,madrid:e,maif:e,maison:e,makeup:e,man:e,management:e,mango:e,map:e,market:e,marketing:e,markets:e,marriott:e,marshalls:e,mattel:e,mba:e,mckinsey:e,med:e,media:an,meet:e,melbourne:e,meme:e,memorial:e,men:e,menu:[1,{barsy:t,barsyonline:t}],merck:e,merckmsd:e,miami:e,microsoft:e,mini:e,mint:e,mit:e,mitsubishi:e,mlb:e,mls:e,mma:e,mobile:e,moda:e,moe:e,moi:e,mom:e,monash:e,money:e,monster:e,mormon:e,mortgage:e,moscow:e,moto:e,motorcycles:e,mov:e,movie:e,msd:e,mtn:e,mtr:e,music:e,nab:e,nagoya:e,navy:e,nba:e,nec:e,netbank:e,netflix:e,network:[1,{aem:t,alces:s,appwrite:t,co:t,arvo:t,azimuth:t,tlon:t}],neustar:e,new:e,news:[1,{noticeable:t}],next:e,nextdirect:e,nexus:e,nfl:e,ngo:e,nhk:e,nico:e,nike:e,nikon:e,ninja:e,nissan:e,nissay:e,nokia:e,norton:e,now:e,nowruz:e,nowtv:e,nra:e,nrw:e,ntt:e,nyc:e,obi:e,observer:e,office:e,okinawa:e,olayan:e,olayangroup:e,ollo:e,omega:e,one:[1,{kin:s,service:t,website:t}],ong:e,onl:e,online:[1,{eero:t,"eero-stage":t,websitebuilder:t,leapcell:t,barsy:t}],ooo:e,open:e,oracle:e,orange:[1,{tech:t}],organic:e,origins:e,osaka:e,otsuka:e,ott:e,ovh:[1,{nerdpol:t}],page:[1,{aem:t,hlx:t,codeberg:t,deuxfleurs:t,mybox:t,heyflow:t,prvcy:t,rocky:t,statichost:t,pdns:t,plesk:t}],panasonic:e,paris:e,pars:e,partners:e,parts:e,party:e,pay:e,pccw:e,pet:e,pfizer:e,pharmacy:e,phd:e,philips:e,phone:e,photo:e,photography:e,photos:an,physio:e,pics:e,pictet:e,pictures:[1,{1337:t}],pid:e,pin:e,ping:e,pink:e,pioneer:e,pizza:[1,{ngrok:t}],place:_,play:e,playstation:e,plumbing:e,plus:[1,{playit:[2,{at:s,with:t}]}],pnc:e,pohl:e,poker:e,politie:e,porn:e,praxi:e,press:e,prime:e,prod:e,productions:e,prof:e,progressive:e,promo:e,properties:e,property:e,protection:e,pru:e,prudential:e,pub:[1,{id:s,kin:s,barsy:t}],pwc:e,qpon:e,quebec:e,quest:e,racing:e,radio:e,read:e,realestate:e,realtor:e,realty:e,recipes:e,red:e,redumbrella:e,rehab:e,reise:e,reisen:e,reit:e,reliance:e,ren:e,rent:e,rentals:e,repair:e,report:e,republican:e,rest:e,restaurant:e,review:e,reviews:[1,{aem:t}],rexroth:e,rich:e,richardli:e,ricoh:e,ril:e,rio:e,rip:[1,{clan:t}],rocks:[1,{myddns:t,stackit:t,"lima-city":t,webspace:t}],rodeo:e,rogers:e,room:e,rsvp:e,rugby:e,ruhr:e,run:[1,{appwrite:s,canva:t,development:t,ravendb:t,liara:[2,{iran:t}],lovable:t,needle:t,build:s,code:s,database:s,migration:s,onporter:t,repl:t,stackit:t,val:ee,vercel:t,wix:t}],rwe:e,ryukyu:e,saarland:e,safe:e,safety:e,sakura:e,sale:e,salon:e,samsclub:e,samsung:e,sandvik:e,sandvikcoromant:e,sanofi:e,sap:e,sarl:e,sas:e,save:e,saxo:e,sbi:e,sbs:e,scb:e,schaeffler:e,schmidt:e,scholarships:e,school:e,schule:e,schwarz:e,science:e,scot:[1,{co:t,me:t,org:t,gov:[2,{service:t}]}],search:e,seat:e,secure:e,security:e,seek:e,select:e,sener:e,services:[1,{loginline:t}],seven:e,sew:e,sex:e,sexy:e,sfr:e,shangrila:e,sharp:e,shell:e,shia:e,shiksha:e,shoes:e,shop:[1,{base:t,hoplix:t,barsy:t,barsyonline:t,shopware:t}],shopping:e,shouji:e,show:fe,silk:e,sina:e,singles:e,site:[1,{square:t,canva:A,cloudera:s,convex:w,cyon:t,caffeine:t,fastvps:t,figma:t,"figma-gov":t,preview:t,heyflow:t,jele:t,jouwweb:t,loginline:t,barsy:t,co:t,notion:t,omniwe:t,opensocial:t,madethis:t,support:t,platformsh:s,tst:s,byen:t,sol:t,srht:t,novecore:t,cpanel:t,wpsquared:t,sourcecraft:t}],ski:e,skin:e,sky:e,skype:e,sling:e,smart:e,smile:e,sncf:e,soccer:e,social:e,softbank:e,software:e,sohu:e,solar:e,solutions:e,song:e,sony:e,soy:e,spa:e,space:[1,{myfast:t,heiyu:t,hf:[2,{static:t}],"app-ionos":t,project:t,uber:t,xs4all:t}],sport:e,spot:e,srl:e,stada:e,staples:e,star:e,statebank:e,statefarm:e,stc:e,stcgroup:e,stockholm:e,storage:e,store:[1,{barsy:t,sellfy:t,shopware:t,storebase:t}],stream:e,studio:e,study:e,style:e,sucks:e,supplies:e,supply:e,support:[1,{barsy:t}],surf:e,surgery:e,suzuki:e,swatch:e,swiss:e,sydney:e,systems:[1,{knightpoint:t,miren:t}],tab:e,taipei:e,talk:e,taobao:e,target:e,tatamotors:e,tatar:e,tattoo:e,tax:e,taxi:e,tci:e,tdk:e,team:[1,{discourse:t,jelastic:t}],tech:[1,{cleverapps:t}],technology:_,temasek:e,tennis:e,teva:e,thd:e,theater:e,theatre:e,tiaa:e,tickets:e,tienda:e,tips:e,tires:e,tirol:e,tjmaxx:e,tjx:e,tkmaxx:e,tmall:e,today:[1,{prequalifyme:t}],tokyo:e,tools:[1,{addr:X,myaddr:t}],top:[1,{ntdll:t,wadl:s}],toray:e,toshiba:e,total:e,tours:e,town:e,toyota:e,toys:e,trade:e,trading:e,training:e,travel:e,travelers:e,travelersinsurance:e,trust:e,trv:e,tube:e,tui:e,tunes:e,tushu:e,tvs:e,ubank:e,ubs:e,unicom:e,university:e,uno:e,uol:e,ups:e,vacations:e,vana:e,vanguard:e,vegas:e,ventures:e,verisign:e,versicherung:e,vet:e,viajes:e,video:e,vig:e,viking:e,villas:e,vin:e,vip:[1,{hidns:t}],virgin:e,visa:e,vision:e,viva:e,vivo:e,vlaanderen:e,vodka:e,volvo:e,vote:e,voting:e,voto:e,voyage:e,wales:e,walmart:e,walter:e,wang:e,wanggou:e,watch:e,watches:e,weather:e,weatherchannel:e,webcam:e,weber:e,website:an,wed:e,wedding:e,weibo:e,weir:e,whoswho:e,wien:e,wiki:an,williamhill:e,win:e,windows:e,wine:e,winners:e,wme:e,woodside:e,work:[1,{"imagine-proxy":t}],works:e,world:e,wow:e,wtc:e,wtf:e,xbox:e,xerox:e,xihuan:e,xin:e,"xn--11b4c3d":e,कॉम:e,"xn--1ck2e1b":e,セール:e,"xn--1qqw23a":e,佛山:e,"xn--30rr7y":e,慈善:e,"xn--3bst00m":e,集团:e,"xn--3ds443g":e,在线:e,"xn--3pxu8k":e,点看:e,"xn--42c2d9a":e,คอม:e,"xn--45q11c":e,八卦:e,"xn--4gbrim":e,موقع:e,"xn--55qw42g":e,公益:e,"xn--55qx5d":e,公司:e,"xn--5su34j936bgsg":e,香格里拉:e,"xn--5tzm5g":e,网站:e,"xn--6frz82g":e,移动:e,"xn--6qq986b3xl":e,我爱你:e,"xn--80adxhks":e,москва:e,"xn--80aqecdr1a":e,католик:e,"xn--80asehdb":e,онлайн:e,"xn--80aswg":e,сайт:e,"xn--8y0a063a":e,联通:e,"xn--9dbq2a":e,קום:e,"xn--9et52u":e,时尚:e,"xn--9krt00a":e,微博:e,"xn--b4w605ferd":e,淡马锡:e,"xn--bck1b9a5dre4c":e,ファッション:e,"xn--c1avg":e,орг:e,"xn--c2br7g":e,नेट:e,"xn--cck2b3b":e,ストア:e,"xn--cckwcxetd":e,アマゾン:e,"xn--cg4bki":e,삼성:e,"xn--czr694b":e,商标:e,"xn--czrs0t":e,商店:e,"xn--czru2d":e,商城:e,"xn--d1acj3b":e,дети:e,"xn--eckvdtc9d":e,ポイント:e,"xn--efvy88h":e,新闻:e,"xn--fct429k":e,家電:e,"xn--fhbei":e,كوم:e,"xn--fiq228c5hs":e,中文网:e,"xn--fiq64b":e,中信:e,"xn--fjq720a":e,娱乐:e,"xn--flw351e":e,谷歌:e,"xn--fzys8d69uvgm":e,電訊盈科:e,"xn--g2xx48c":e,购物:e,"xn--gckr3f0f":e,クラウド:e,"xn--gk3at1e":e,通販:e,"xn--hxt814e":e,网店:e,"xn--i1b6b1a6a2e":e,संगठन:e,"xn--imr513n":e,餐厅:e,"xn--io0a7i":e,网络:e,"xn--j1aef":e,ком:e,"xn--jlq480n2rg":e,亚马逊:e,"xn--jvr189m":e,食品:e,"xn--kcrx77d1x4a":e,飞利浦:e,"xn--kput3i":e,手机:e,"xn--mgba3a3ejt":e,ارامكو:e,"xn--mgba7c0bbn0a":e,العليان:e,"xn--mgbab2bd":e,بازار:e,"xn--mgbca7dzdo":e,ابوظبي:e,"xn--mgbi4ecexp":e,كاثوليك:e,"xn--mgbt3dhd":e,همراه:e,"xn--mk1bu44c":e,닷컴:e,"xn--mxtq1m":e,政府:e,"xn--ngbc5azd":e,شبكة:e,"xn--ngbe9e0a":e,بيتك:e,"xn--ngbrx":e,عرب:e,"xn--nqv7f":e,机构:e,"xn--nqv7fs00ema":e,组织机构:e,"xn--nyqy26a":e,健康:e,"xn--otu796d":e,招聘:e,"xn--p1acf":[1,{"xn--90amc":t,"xn--j1aef":t,"xn--j1ael8b":t,"xn--h1ahn":t,"xn--j1adp":t,"xn--c1avg":t,"xn--80aaa0cvac":t,"xn--h1aliz":t,"xn--90a1af":t,"xn--41a":t}],рус:[1,{биз:t,ком:t,крым:t,мир:t,мск:t,орг:t,самара:t,сочи:t,спб:t,я:t}],"xn--pssy2u":e,大拿:e,"xn--q9jyb4c":e,みんな:e,"xn--qcka1pmc":e,グーグル:e,"xn--rhqv96g":e,世界:e,"xn--rovu88b":e,書籍:e,"xn--ses554g":e,网址:e,"xn--t60b56a":e,닷넷:e,"xn--tckwe":e,コム:e,"xn--tiq49xqyj":e,天主教:e,"xn--unup4y":e,游戏:e,"xn--vermgensberater-ctb":e,vermögensberater:e,"xn--vermgensberatung-pwb":e,vermögensberatung:e,"xn--vhquv":e,企业:e,"xn--vuq861b":e,信息:e,"xn--w4r85el8fhu5dnra":e,嘉里大酒店:e,"xn--w4rs40l":e,嘉里:e,"xn--xhq521b":e,广东:e,"xn--zfr164b":e,政务:e,xyz:[1,{caffeine:t,botdash:t,telebit:s}],yachts:e,yahoo:e,yamaxun:e,yandex:e,yodobashi:e,yoga:e,yokohama:e,you:e,youtube:e,yun:e,zappos:e,zara:e,zero:e,zip:e,zone:[1,{triton:s,stackit:t,lima:t}],zuerich:e}]})();function Pj(e,t,n,r){let s=null,a=t;for(;a!==void 0&&((a[0]&r)!==0&&(s={index:n+1,isIcann:(a[0]&1)!==0,isPrivate:(a[0]&2)!==0}),n!==-1);){const o=a[1];a=Object.prototype.hasOwnProperty.call(o,e[n])?o[e[n]]:o["*"],n-=1}return s}function kBe(e,t,n){var r;if(bBe(e,t,n))return;const s=e.split("."),a=(t.allowPrivateDomains?2:0)|(t.allowIcannDomains?1:0),o=Pj(s,yBe,s.length-1,a);if(o!==null){n.isIcann=o.isIcann,n.isPrivate=o.isPrivate,n.publicSuffix=s.slice(o.index+1).join(".");return}const i=Pj(s,xBe,s.length-1,a);if(i!==null){n.isIcann=i.isIcann,n.isPrivate=i.isPrivate,n.publicSuffix=s.slice(i.index).join(".");return}n.isIcann=!1,n.isPrivate=!1,n.publicSuffix=(r=s[s.length-1])!==null&&r!==void 0?r:null}function DG(e,t={}){return gBe(e,5,kBe,t,pBe())}const vBe=new Set(["raw.githubusercontent.com","cdn.jsdelivr.net","raw.github.com","unpkg.com"]),FG={anilist:"anilist.co",axiom:"axiom.co",chrome:"developer.chrome.com",deepwiki:"deepwiki.com",github:"github.com",gitlab:"gitlab.com",linear:"linear.app",neon:"neon.tech",openai:"openai.com",stripe:"stripe.com",vercel:"vercel.com"},SBe=new Set(["api","app","apps","cli","cloud","com","console","dev","docs","doc","graphql","http","https","json","latest","mcp","net","none","npm","npx","openapi","org","plugin","plugins","raw","rest","sdk","server","service","services","source","sources","stdio","transport","uv","uvx","yaml","yarn","yml"]),Oj=e=>{try{return new URL(e)}catch{return null}},XS=e=>{const n=DG(e).domain??FG[e]??null;return n?`https://${n}`:null},wBe=e=>e.length<=1||SBe.has(e)||/^v?\d+$/.test(e),_Be=e=>{const t=e.trim().toLowerCase().split(/[^a-z0-9]+/g).find(n=>!wBe(n));return t&&t.length>0?t:null},ZS=e=>{const t=_Be(e);return t?`https://${FG[t]??`${t}.com`}`:null},EBe=e=>{const t=e?.trim();if(!t)return null;const n=Oj(t)??Oj(`https://${t}`);if(n){if(vBe.has(n.hostname)){const r=n.pathname.split("/").map(s=>s.trim()).filter(s=>s.length>0);for(const s of r){const a=s.replace(/\.(ya?ml|json)$/i,""),o=XS(a)??ZS(a);if(o)return o}}return XS(n.hostname)??ZS(n.hostname)}return XS(t)??ZS(t)},m1=e=>{const t=EBe(e);if(!t)return null;try{const n=new URL(t).hostname,s=DG(n).domain??n;return`https://www.google.com/s2/favicons?domain=${encodeURIComponent(s)}&sz=32`}catch{return null}},TBe=e=>m1(e.namespace)??m1(e.name),CBe=[gFe,d8e,DFe,aFe,sBe],Bk=Cve(CBe),Lj=(e,t)=>(e.routes??[]).some(n=>n.key===t),BG=e=>Lj(e,"add")&&Lj(e,"detail"),UG=Bk.plugins,zG=Bk.routes,$j=zG.filter(({route:e})=>e.nav!==void 0).map(({plugin:e,route:t})=>({plugin:e,route:t,to:o2(e.key).route(t.path??"")})),Eb=UG.filter(BG),HG=e=>Bk.getPlugin(e),IBe=(e,t)=>Bk.getRoute(e,t),ABe=e=>VG(e)?"google-discovery":e,NBe=e=>{const t=HG(ABe(e));return t&&BG(t)?t:null},qG=e=>{const t=NBe(e);return t?km(t.key):null},VG=e=>e==="google_discovery"||e==="google-discovery",RBe=e=>(VG(e.kind)?q4e(e):null)??TBe(e),PBe=e=>UG.find(t=>t.secretStore?.kind===e)??null;function ZE({source:e,className:t,size:n=16}){return f.jsx(GG,{kind:e.kind,faviconUrl:RBe(e),className:t,size:n})}function OBe({preset:e,className:t,size:n=16}){const r=e.kind==="google_discovery"?QV(e.service):m1(e.previewUrl);return f.jsx(GG,{kind:e.kind,faviconUrl:r??m1(e.name),className:t,size:n})}function GG({kind:e,faviconUrl:t,className:n,size:r=16}){const[s,a]=E.useState(null);return!t||!!(t&&s===t)?f.jsx(LBe,{kind:e,className:n}):f.jsx("img",{src:t,alt:"",width:r,height:r,className:jt("size-full object-contain",n),loading:"lazy",referrerPolicy:"no-referrer",onError:()=>a(t)},t)}function LBe({kind:e,className:t}){const n=jt("shrink-0",t);switch(e){case"mcp":return f.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:n,children:[f.jsx("rect",{x:"2",y:"3",width:"12",height:"10",rx:"1.5",stroke:"currentColor",strokeWidth:"1.2"}),f.jsx("path",{d:"M5 7h1M5 9h4",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]});case"graphql":return f.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:n,children:[f.jsx("path",{d:"M8 2L14 5.5V10.5L8 14L2 10.5V5.5L8 2Z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),f.jsx("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor",opacity:"0.5"})]});case"google_discovery":return f.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:n,children:[f.jsx("path",{d:"M8 2.5a5.5 5.5 0 1 0 0 11 5.3 5.3 0 0 0 3.82-1.55",stroke:"currentColor",strokeWidth:"1.2"}),f.jsx("path",{d:"M13 8H8",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),f.jsx("circle",{cx:"12.5",cy:"8",r:"1.2",fill:"currentColor"})]});case"openapi":return f.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:n,children:[f.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.2"}),f.jsx("path",{d:"M5 6h6M5 8h4M5 10h5",stroke:"currentColor",strokeWidth:"1.1",strokeLinecap:"round"})]});default:return f.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:n,children:[f.jsx("rect",{x:"2.5",y:"2.5",width:"11",height:"11",rx:"2",stroke:"currentColor",strokeWidth:"1.2"}),f.jsx("path",{d:"M5 6h6M5 8h4M5 10h3",stroke:"currentColor",strokeWidth:"1.1",strokeLinecap:"round"})]})}}const $Be={VITE_APP_VERSION:"1.3.0-beta.5",VITE_GITHUB_URL:"https://github.com/RhysSullivan/executor"},jj={connected:"bg-primary",probing:"bg-amber-400",draft:"bg-muted-foreground/30",auth_required:"bg-amber-500",error:"bg-destructive"},{VITE_APP_VERSION:KG,VITE_GITHUB_URL:jBe}=$Be,MBe="/v1/app/npm/dist-tags",DBe=/^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(?:-(?<prerelease>[0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/,FBe=e=>e.includes("-beta.")?"beta":"latest",Mj=e=>{const t=e.trim().match(DBe);return t?.groups?{major:Number(t.groups.major),minor:Number(t.groups.minor),patch:Number(t.groups.patch),prerelease:t.groups.prerelease?t.groups.prerelease.split(".").map(n=>/^\d+$/.test(n)?Number(n):n):null}:null},BBe=(e,t)=>{if(e===null&&t===null)return 0;if(e===null)return 1;if(t===null)return-1;const n=Math.max(e.length,t.length);for(let r=0;r<n;r+=1){const s=e[r],a=t[r];if(s!==a)return s===void 0?-1:a===void 0?1:typeof s=="number"&&typeof a=="number"?s<a?-1:1:typeof s=="number"?-1:typeof a=="number"?1:s<a?-1:1}return 0},UBe=(e,t)=>{const n=Mj(e),r=Mj(t);return!n||!r?null:n.major!==r.major?n.major<r.major?-1:1:n.minor!==r.minor?n.minor<r.minor?-1:1:n.patch!==r.patch?n.patch<r.patch?-1:1:BBe(n.prerelease,r.prerelease)};function zBe(e){const t=FBe(e),[n,r]=E.useState(null);E.useEffect(()=>{let a=!1;return fetch(MBe).then(async o=>{if(!o.ok)throw new Error(`Failed to load dist tags: ${o.status}`);return o.json()}).then(o=>{a||r(o[t]??null)}).catch(()=>{}),()=>{a=!0}},[t]);const s=n!==null&&UBe(e,n)===-1;return{latestVersion:n,updateAvailable:s,channel:t}}function HBe(e){const t=`npm i -g executor@${e.channel}`,[n,r]=E.useState(!1),s=E.useCallback(()=>{navigator.clipboard.writeText(t).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})},[t]);return f.jsxs("div",{className:"mx-2 mb-2 rounded-xl border border-primary/25 bg-primary/[0.06] p-3",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"flex size-5 shrink-0 items-center justify-center rounded-full bg-primary/15",children:f.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:"size-3 text-primary",children:[f.jsx("path",{d:"M8 3v7M5 7l3 3 3-3",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),f.jsx("path",{d:"M3 12h10",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-[11px] font-semibold text-foreground",children:"Update available"}),f.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["v",e.latestVersion]})]})]}),f.jsxs(Te,{type:"button",variant:"outline",onClick:s,className:"mt-2.5 flex w-full items-center justify-between gap-2 rounded-lg border-border/60 bg-background/50 px-2.5 py-1.5 text-left hover:bg-background/80",children:[f.jsx("code",{className:"truncate font-mono text-[10px] text-sidebar-foreground",children:t}),f.jsx("span",{className:"shrink-0 text-muted-foreground transition-colors group-hover:text-foreground",children:n?f.jsx(qV,{className:"size-3 text-primary"}):f.jsx(HV,{className:"size-3"})})]})]})}function qBe(){const e=iz(),t=aY(),n=eY(),[r,s]=E.useState(!1),a=n({to:"/"}),o=n({to:"/secrets"}),i=n({to:"/policies"}),{latestVersion:c,updateAvailable:u,channel:l}=zBe(KG),d=$j.filter(({route:m})=>(m.nav?.section??"main")==="main"),h=$j.filter(({route:m})=>m.nav?.section==="sources");return E.useEffect(()=>{s(!1)},[t.pathname]),E.useEffect(()=>{if(!r)return;const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=m}},[r]),f.jsxs("div",{className:"flex h-screen overflow-hidden",children:[f.jsx("aside",{className:"hidden w-52 shrink-0 border-r border-sidebar-border bg-sidebar md:flex md:flex-col lg:w-56",children:f.jsx(Dj,{isHome:!!a,isSecrets:!!o,isPolicies:!!i,latestVersion:c,updateAvailable:u,channel:l,locationPathname:t.pathname,mainPluginNavItems:d,sourcePluginNavItems:h,sources:e})}),r&&f.jsxs("div",{className:"fixed inset-0 z-50 flex md:hidden",children:[f.jsx("button",{type:"button","aria-label":"Close navigation",className:"absolute inset-0 bg-black/45 backdrop-blur-[1px]",onClick:()=>s(!1)}),f.jsxs("div",{className:"relative flex h-full w-[84vw] max-w-xs flex-col border-r border-sidebar-border bg-sidebar shadow-2xl",children:[f.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b border-sidebar-border px-4",children:[f.jsxs(bs,{to:"/",className:"flex items-center gap-1.5",children:[f.jsx("span",{className:"font-display text-base tracking-tight text-foreground",children:"executor"}),f.jsx("span",{className:"rounded bg-primary/15 px-1.5 py-0.5 text-[10px] font-medium text-primary",children:"v3"})]}),f.jsx(Te,{type:"button",variant:"ghost",size:"icon","aria-label":"Close navigation",onClick:()=>s(!1),className:"size-8 text-sidebar-foreground hover:bg-sidebar-active hover:text-foreground",children:f.jsx(A4e,{className:"size-3.5"})})]}),f.jsx(Dj,{isHome:!!a,isSecrets:!!o,isPolicies:!!i,latestVersion:c,updateAvailable:u,channel:l,locationPathname:t.pathname,mainPluginNavItems:d,sourcePluginNavItems:h,sources:e,onNavigate:()=>s(!1),showBrand:!1})]})]}),f.jsxs("main",{className:"flex min-h-0 flex-1 flex-col min-w-0 overflow-hidden",children:[f.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b border-border bg-background px-4 md:hidden",children:[f.jsx(Te,{type:"button",variant:"outline",size:"icon","aria-label":"Open navigation",onClick:()=>s(!0),className:"size-8 bg-card hover:bg-accent/50",children:f.jsx(N4e,{className:"size-4"})}),f.jsxs(bs,{to:"/",className:"flex items-center gap-1.5",children:[f.jsx("span",{className:"font-display text-base tracking-tight text-foreground",children:"executor"}),f.jsx("span",{className:"rounded bg-primary/15 px-1.5 py-0.5 text-[10px] font-medium text-primary",children:"v3"})]}),f.jsx("div",{className:"w-8 shrink-0"})]}),f.jsx(lM,{})]})]})}function Dj(e){return f.jsxs(f.Fragment,{children:[e.showBrand!==!1&&f.jsx("div",{className:"flex h-12 shrink-0 items-center border-b border-sidebar-border px-4",children:f.jsxs(bs,{to:"/",className:"flex items-center gap-1.5",children:[f.jsx("span",{className:"font-display text-base tracking-tight text-foreground",children:"executor"}),f.jsx("span",{className:"rounded bg-primary/15 px-1.5 py-0.5 text-[10px] font-medium text-primary",children:"v3"})]})}),f.jsxs("nav",{className:"flex flex-1 flex-col overflow-y-auto p-2",children:[f.jsx(zf,{to:"/",label:"Dashboard",active:e.isHome,onNavigate:e.onNavigate}),f.jsx(zf,{to:"/secrets",label:"Secrets",active:e.isSecrets,onNavigate:e.onNavigate}),f.jsx(zf,{to:"/policies",label:"Policies",active:e.isPolicies,onNavigate:e.onNavigate}),e.mainPluginNavItems.map(({plugin:t,route:n,to:r})=>f.jsx(zf,{to:r,label:n.nav?.label??n.key,active:e.locationPathname===r||e.locationPathname.startsWith(`${r}/`),onNavigate:e.onNavigate},`${t.key}:${n.key}`)),f.jsx("div",{className:"mt-5 mb-1 px-2.5 text-[10px] font-medium uppercase tracking-widest text-muted-foreground/50",children:f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsx("span",{children:"Sources"}),f.jsxs(bs,{to:N0,onClick:e.onNavigate,className:"inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-[10px] font-medium normal-case tracking-normal text-primary transition-colors hover:bg-sidebar-active hover:text-foreground",children:[f.jsx(eo,{className:"size-3"}),"Add"]})]})}),e.sourcePluginNavItems.length>0&&f.jsx("div",{className:"mb-2 flex flex-col gap-px",children:e.sourcePluginNavItems.map(({plugin:t,route:n,to:r})=>f.jsx(zf,{to:r,label:n.nav?.label??n.key,active:e.locationPathname===r||e.locationPathname.startsWith(`${r}/`),onNavigate:e.onNavigate},`${t.key}:${n.key}`))}),f.jsx(Om,{loadable:e.sources,loading:"Loading...",children:t=>Array.isArray(t)?t.length===0?f.jsx("div",{className:"px-2.5 py-2 text-[11px] leading-relaxed text-muted-foreground/40",children:"No sources yet"}):f.jsx("div",{className:"flex flex-col gap-px",children:t.map(n=>f.jsx(VBe,{pathname:e.locationPathname,source:n,onNavigate:e.onNavigate},n.id))}):f.jsx("div",{className:"px-2.5 py-2 text-[11px] leading-relaxed text-destructive",children:"Sources returned an unexpected payload."})})]}),e.updateAvailable&&e.latestVersion&&f.jsx(HBe,{latestVersion:e.latestVersion,channel:e.channel}),f.jsx("div",{className:"shrink-0 border-t border-sidebar-border px-4 py-2.5",children:f.jsxs("div",{className:"flex items-center justify-between text-[10px] leading-none",children:[f.jsxs("span",{className:"text-muted-foreground/70 tabular-nums",children:["v",KG]}),f.jsx("a",{href:jBe,target:"_blank",rel:"noreferrer",className:"text-muted-foreground/70 transition-colors hover:text-foreground",children:"GitHub"})]})})]})}function VBe(e){const t=qG(e.source.kind);if(!t)return f.jsxs("div",{className:"group flex items-center gap-2 rounded-md px-2.5 py-1.5 text-[13px] text-sidebar-foreground/60",children:[f.jsx("div",{className:"flex size-3 shrink-0 items-center justify-center text-muted-foreground/50",children:f.jsx(ZE,{source:e.source,className:"size-3"})}),f.jsx("span",{className:"flex-1 truncate",children:e.source.name}),f.jsx("span",{className:jt("size-1.5 shrink-0 rounded-full",jj[e.source.status]??"bg-muted-foreground/30"),title:e.source.status})]});const n=t.detail(e.source.id),r=e.pathname===n||e.pathname.startsWith(`${n}/`);return f.jsxs(bs,{to:n,search:{tab:"model"},onClick:e.onNavigate,className:jt("group flex items-center gap-2 rounded-md px-2.5 py-1.5 text-[13px] transition-colors",r?"bg-sidebar-active text-foreground font-medium":"text-sidebar-foreground hover:bg-sidebar-active/60 hover:text-foreground"),children:[f.jsx("div",{className:"flex size-3 shrink-0 items-center justify-center text-muted-foreground/50",children:f.jsx(ZE,{source:e.source,className:"size-3"})}),f.jsx("span",{className:"flex-1 truncate",children:e.source.name}),f.jsx("span",{className:jt("size-1.5 shrink-0 rounded-full",jj[e.source.status]??"bg-muted-foreground/30"),title:e.source.status})]})}function zf(e){return f.jsx(bs,{to:e.to,onClick:e.onNavigate,className:jt("flex items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[13px] transition-colors",e.active?"bg-sidebar-active text-foreground font-medium":"text-sidebar-foreground hover:bg-sidebar-active/60 hover:text-foreground"),children:e.label})}const GBe=["json","xml","yaml","shellscript","typescript","javascript","python","html","css","markdown","sql","graphql","go","rust","java","ruby","php","swift","kotlin","c","cpp","csharp","tsx","jsx","toml","dockerfile","diff","http","jsonc","log","proto"],eT={sh:"shellscript",shell:"shellscript",bash:"shellscript",zsh:"shellscript",ts:"typescript",js:"javascript",py:"python",rb:"ruby",rs:"rust","c++":"cpp","c#":"csharp",cs:"csharp",kt:"kotlin",md:"markdown",gql:"graphql",yml:"yaml"},WG={json:()=>Le(()=>import("./json-Cp-IABpG.js"),[]),xml:()=>Le(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([0,1])),yaml:()=>Le(()=>import("./yaml-Buea-lGh.js"),[]),shellscript:()=>Le(()=>import("./shellscript-Yzrsuije.js"),[]),typescript:()=>Le(()=>import("./typescript-BPQ3VLAy.js"),[]),javascript:()=>Le(()=>import("./javascript-wDzz0qaB.js"),[]),python:()=>Le(()=>import("./python-B6aJPvgy.js"),[]),html:()=>Le(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([2,3,4])),css:()=>Le(()=>import("./css-DPfMkruS.js"),[]),markdown:()=>Le(()=>import("./markdown-Cvjx9yec.js"),[]),sql:()=>Le(()=>import("./sql-BLtJtn59.js"),[]),graphql:()=>Le(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([5,3,6,7,8])),go:()=>Le(()=>import("./go-CxLEBnE3.js"),[]),rust:()=>Le(()=>import("./rust-B1yitclQ.js"),[]),java:()=>Le(()=>import("./java-CylS5w8V.js"),[]),ruby:()=>Le(()=>import("./ruby-xesJ3fNi.js"),__vite__mapDeps([9,2,3,4,0,1,10,5,6,7,8,11,12,13,14])),php:()=>Le(()=>import("./php-Dhbhpdrm.js"),__vite__mapDeps([15,2,3,4,0,1,10,16])),swift:()=>Le(()=>import("./swift-D82vCrfD.js"),[]),kotlin:()=>Le(()=>import("./kotlin-BdnUsdx6.js"),[]),c:()=>Le(()=>import("./c-BIGW1oBm.js"),[]),cpp:()=>Le(()=>import("./cpp-BRuaLJcg.js"),__vite__mapDeps([11,12,10])),csharp:()=>Le(()=>import("./csharp-COcwbKMJ.js"),[]),tsx:()=>Le(()=>import("./tsx-COt5Ahok.js"),[]),jsx:()=>Le(()=>import("./jsx-g9-lgVsj.js"),[]),toml:()=>Le(()=>import("./toml-vGWfd6FD.js"),[]),dockerfile:()=>Le(()=>import("./dockerfile-BcOcwvcX.js"),[]),diff:()=>Le(()=>import("./diff-D97Zzqfu.js"),[]),http:()=>Le(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([17,13,16,0,1,5,3,6,7,8])),jsonc:()=>Le(()=>import("./jsonc-Des-eS-w.js"),[]),log:()=>Le(()=>import("./log-2UxHyX5q.js"),[]),proto:()=>Le(()=>import("./proto-C7zT0LnQ.js"),[])};[...GBe,...Object.keys(eT)];function YG(e){const t=e.trim().toLowerCase();return t in WG?t:t in eT?eT[t]:null}const KBe=V9({forgiving:!0});let ew=null,Tb=null;async function JG(){return ew||Tb||(Tb=k9({themes:[Le(()=>import("./vitesse-dark-D0r3Knsf.js"),[])],langs:Object.values(WG).map(e=>e()),engine:KBe}).then(e=>(ew=e,e)),Tb)}JG();async function WBe(e,t){const n=await JG(),r=YG(t.lang)??"json";return n.codeToHtml(e,{lang:r,theme:"vitesse-dark"})}const Fj=new Map;function YBe(e,t){return`${t}::${e.length}::${e.slice(0,64)}`}function JBe(e,t){if(t)return YG(t)??"json";const n=e.trimStart();return n.startsWith("{")||n.startsWith("[")?"json":n.startsWith("<")?"xml":n.startsWith("---")?"yaml":"json"}function QBe(e){const{code:t,lang:n,className:r}=e,[s,a]=E.useState(null),[o,i]=E.useState(!1),c=E.useRef(!0),u=JBe(t,n),l=YBe(t,u);E.useEffect(()=>(c.current=!0,()=>{c.current=!1}),[]),E.useEffect(()=>{const h=Fj.get(l);if(h){a(h);return}let m=!1;return WBe(t,{lang:u}).then(p=>{m||(Fj.set(l,p),c.current&&a(p))}),()=>{m=!0}},[t,l,u]);const d=E.useCallback(()=>{navigator.clipboard.writeText(t).then(()=>{i(!0),setTimeout(()=>i(!1),1500)})},[t]);return f.jsxs("div",{className:jt("group relative overflow-auto",r),children:[f.jsx(Te,{type:"button",variant:"ghost",size:"icon",onClick:d,className:"absolute right-2 top-2 z-10 size-7 rounded-md border border-border bg-card/90 text-muted-foreground/40 opacity-0 backdrop-blur-sm transition-all hover:text-foreground group-hover:opacity-100",title:"Copy to clipboard",children:o?f.jsx(qV,{className:"size-3"}):f.jsx(HV,{className:"size-3"})}),s?f.jsx("div",{className:"shiki-container text-[12px] leading-relaxed [&_pre]:!bg-transparent [&_pre]:p-3 [&_code]:font-mono",dangerouslySetInnerHTML:{__html:s}}):f.jsx("pre",{className:"p-3 font-mono text-[12px] leading-relaxed text-foreground/60",children:t})]})}function QG(e){const[t,n]=E.useState(null),[r,s]=E.useState("stdio");E.useEffect(()=>{n(window.location.origin)},[]);const a=r==="stdio"?'npx add-mcp "executor mcp --stdio" --name "executor-stdio"':t?`npx add-mcp "${t}/mcp" --transport http --name "executor"`:'npx add-mcp "<this-server>/mcp" --transport http --name "executor"';return f.jsxs("section",{className:e.className??"rounded-2xl border border-border bg-card/80 p-5",children:[f.jsxs("div",{className:"mb-3 space-y-1",children:[f.jsx("h2",{className:"text-sm font-semibold text-foreground",children:e.title??"Install local MCP"}),f.jsx("p",{className:"text-[13px] text-muted-foreground",children:e.description??(r==="stdio"?"Preferred for local agents. This installs executor as a stdio MCP command and starts a local web sidecar automatically when needed.":"Use the current web origin as a remote MCP endpoint over HTTP.")})]}),f.jsx("div",{className:"mb-3 inline-flex rounded-lg border border-border bg-background/70 p-1",children:[{key:"stdio",label:"Standard I/O"},{key:"http",label:"Remote HTTP"}].map(o=>f.jsx(Te,{type:"button",variant:r===o.key?"default":"ghost",size:"sm",onClick:()=>s(o.key),className:"rounded-md px-3 py-1.5",children:o.label},o.key))}),f.jsx(QBe,{code:a,lang:"bash",className:"rounded-xl border border-border bg-background/70"}),r==="stdio"?f.jsx("div",{className:"mt-3 space-y-1 text-[12px] text-muted-foreground",children:f.jsx("p",{children:"Requires the `executor` CLI on your PATH. Uses a distinct MCP name to avoid colliding with an existing remote `executor` entry."})}):null]})}function EA(e){return f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:f.jsx("div",{className:"mx-auto max-w-3xl px-6 py-10 lg:px-10 lg:py-14",children:f.jsxs("div",{className:"rounded-2xl border border-border bg-card p-8",children:[f.jsx("h2",{className:"font-display text-xl tracking-tight text-foreground",children:e.title}),f.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-muted-foreground",children:e.message}),e.action?f.jsx("div",{className:"mt-5",children:e.action}):null]})})})}const tT="google-discovery",XBe="google_discovery",Pn=e=>({id:e.id,pluginKey:tT,kind:XBe,name:e.name,summary:e.summary,previewUrl:e.discoveryUrl,service:e.service,version:e.version,discoveryUrl:e.discoveryUrl}),TA=[{id:"deepwiki-mcp",pluginKey:"mcp",kind:"mcp",name:"DeepWiki MCP",summary:"Repository docs and knowledge graphs via MCP.",previewUrl:"https://mcp.deepwiki.com/mcp",endpoint:"https://mcp.deepwiki.com/mcp",transport:"auto"},{id:"axiom-mcp",pluginKey:"mcp",kind:"mcp",name:"Axiom MCP",summary:"Query, stream, and analyze logs, traces, and event data.",previewUrl:"https://mcp.axiom.co/mcp",endpoint:"https://mcp.axiom.co/mcp",transport:"auto"},{id:"neon-mcp",pluginKey:"mcp",kind:"mcp",name:"Neon MCP",summary:"Manage Postgres databases, branches, and queries via MCP.",previewUrl:"https://mcp.neon.tech/mcp",endpoint:"https://mcp.neon.tech/mcp",transport:"auto"},{id:"chrome-devtools-mcp",pluginKey:"mcp",kind:"mcp",name:"Chrome DevTools MCP",summary:"Debug a live Chrome browser session over a local MCP stdio transport.",previewUrl:"npx -y chrome-devtools-mcp@latest",transport:"stdio",command:"npx",args:["-y","chrome-devtools-mcp@latest"]},{id:"neon-api",pluginKey:"openapi",kind:"openapi",name:"Neon API",summary:"Projects, branches, endpoints, databases, and API keys.",previewUrl:"https://console.neon.tech/api/v2",baseUrl:"https://console.neon.tech/api/v2",specUrl:"https://neon.com/api_spec/release/v2.json"},{id:"github-rest",pluginKey:"openapi",kind:"openapi",name:"GitHub REST API",summary:"Repos, issues, pull requests, actions, and org settings.",previewUrl:"https://api.github.com",baseUrl:"https://api.github.com",specUrl:"https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.yaml"},{id:"github-graphql",pluginKey:"graphql",kind:"graphql",name:"GitHub GraphQL",summary:"Issues, pull requests, discussions, and repository objects via GraphQL.",previewUrl:"https://api.github.com/graphql",endpoint:"https://api.github.com/graphql"},{id:"gitlab-graphql",pluginKey:"graphql",kind:"graphql",name:"GitLab GraphQL",summary:"Projects, merge requests, issues, CI pipelines, and users.",previewUrl:"https://gitlab.com/api/graphql",endpoint:"https://gitlab.com/api/graphql"},{id:"openai-api",pluginKey:"openapi",kind:"openapi",name:"OpenAI API",summary:"Models, files, responses, and fine-tuning.",previewUrl:"https://api.openai.com/v1",baseUrl:"https://api.openai.com/v1",specUrl:"https://app.stainless.com/api/spec/documented/openai/openapi.documented.yml"},{id:"vercel-api",pluginKey:"openapi",kind:"openapi",name:"Vercel API",summary:"Deployments, projects, domains, and environments.",previewUrl:"https://api.vercel.com",baseUrl:"https://api.vercel.com",specUrl:"https://openapi.vercel.sh"},{id:"stripe-api",pluginKey:"openapi",kind:"openapi",name:"Stripe API",summary:"Payments, billing, subscriptions, and invoices.",previewUrl:"https://api.stripe.com",baseUrl:"https://api.stripe.com",specUrl:"https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json"},{id:"linear-graphql",pluginKey:"graphql",kind:"graphql",name:"Linear GraphQL",summary:"Issues, teams, cycles, and projects.",previewUrl:"https://api.linear.app/graphql",endpoint:"https://api.linear.app/graphql"},{id:"monday-graphql",pluginKey:"graphql",kind:"graphql",name:"Monday GraphQL",summary:"Boards, items, updates, users, and workspace metadata.",previewUrl:"https://api.monday.com/v2",endpoint:"https://api.monday.com/v2"},{id:"anilist-graphql",pluginKey:"graphql",kind:"graphql",name:"AniList GraphQL",summary:"Anime, manga, characters, media lists, and recommendations.",previewUrl:"https://graphql.anilist.co",endpoint:"https://graphql.anilist.co"},Pn({id:"google-calendar",name:"Google Calendar",summary:"Calendars, events, ACLs, and scheduling workflows.",service:"calendar",version:"v3",discoveryUrl:"https://calendar-json.googleapis.com/$discovery/rest?version=v3"}),Pn({id:"google-drive",name:"Google Drive",summary:"Files, folders, permissions, comments, and shared drives.",service:"drive",version:"v3",discoveryUrl:"https://www.googleapis.com/discovery/v1/apis/drive/v3/rest"}),Pn({id:"google-gmail",name:"Gmail",summary:"Messages, threads, labels, drafts, and mailbox automation.",service:"gmail",version:"v1",discoveryUrl:"https://gmail.googleapis.com/$discovery/rest?version=v1"}),Pn({id:"google-docs",name:"Google Docs",summary:"Documents, structural edits, text ranges, and formatting.",service:"docs",version:"v1",discoveryUrl:"https://docs.googleapis.com/$discovery/rest?version=v1"}),Pn({id:"google-sheets",name:"Google Sheets",summary:"Spreadsheets, values, ranges, formatting, and batch updates.",service:"sheets",version:"v4",discoveryUrl:"https://sheets.googleapis.com/$discovery/rest?version=v4"}),Pn({id:"google-slides",name:"Google Slides",summary:"Presentations, slides, page elements, and deck updates.",service:"slides",version:"v1",discoveryUrl:"https://slides.googleapis.com/$discovery/rest?version=v1"}),Pn({id:"google-forms",name:"Google Forms",summary:"Forms, questions, responses, quizzes, and form metadata.",service:"forms",version:"v1",discoveryUrl:"https://forms.googleapis.com/$discovery/rest?version=v1"}),Pn({id:"google-search-console",name:"Google Search Console",summary:"Sites, sitemaps, URL inspection, and search and Discover performance.",service:"searchconsole",version:"v1",discoveryUrl:"https://searchconsole.googleapis.com/$discovery/rest?version=v1"}),Pn({id:"google-people",name:"Google People",summary:"Contacts, profiles, directory people, and contact groups.",service:"people",version:"v1",discoveryUrl:"https://people.googleapis.com/$discovery/rest?version=v1"}),Pn({id:"google-tasks",name:"Google Tasks",summary:"Task lists, task items, notes, and due dates.",service:"tasks",version:"v1",discoveryUrl:"https://tasks.googleapis.com/$discovery/rest?version=v1"}),Pn({id:"google-chat",name:"Google Chat",summary:"Spaces, messages, members, reactions, and chat workflows.",service:"chat",version:"v1",discoveryUrl:"https://chat.googleapis.com/$discovery/rest?version=v1"}),Pn({id:"google-keep",name:"Google Keep",summary:"Notes, lists, attachments, and collaborative annotations.",service:"keep",version:"v1",discoveryUrl:"https://keep.googleapis.com/$discovery/rest?version=v1"}),Pn({id:"google-classroom",name:"Google Classroom",summary:"Courses, rosters, coursework, submissions, and grading data.",service:"classroom",version:"v1",discoveryUrl:"https://classroom.googleapis.com/$discovery/rest?version=v1"}),Pn({id:"google-admin-directory",name:"Google Admin Directory",summary:"Users, groups, org units, roles, and domain directory resources.",service:"admin",version:"directory_v1",discoveryUrl:"https://admin.googleapis.com/$discovery/rest?version=directory_v1"}),Pn({id:"google-admin-reports",name:"Google Admin Reports",summary:"Audit events, usage reports, and admin activity logs.",service:"admin",version:"reports_v1",discoveryUrl:"https://admin.googleapis.com/$discovery/rest?version=reports_v1"}),Pn({id:"google-apps-script",name:"Google Apps Script",summary:"Projects, deployments, script execution, and Apps Script metadata.",service:"script",version:"v1",discoveryUrl:"https://script.googleapis.com/$discovery/rest?version=v1"}),Pn({id:"google-bigquery",name:"Google BigQuery",summary:"Datasets, tables, jobs, routines, and analytical query workflows.",service:"bigquery",version:"v2",discoveryUrl:"https://bigquery.googleapis.com/$discovery/rest?version=v2"}),Pn({id:"google-cloud-resource-manager",name:"Google Cloud Resource Manager",summary:"Projects, folders, organizations, and IAM-oriented resource hierarchy.",service:"cloudresourcemanager",version:"v3",discoveryUrl:"https://cloudresourcemanager.googleapis.com/$discovery/rest?version=v3"}),Pn({id:"google-youtube-data",name:"YouTube Data",summary:"Channels, playlists, videos, comments, captions, and uploads.",service:"youtube",version:"v3",discoveryUrl:"https://youtube.googleapis.com/$discovery/rest?version=v3"})],nT=e=>{switch(e.pluginKey){case"openapi":return{preset:e.id,presetName:e.name,presetBaseUrl:e.baseUrl,presetSpecUrl:e.specUrl};case"graphql":return{preset:e.id,presetName:e.name,presetEndpoint:e.endpoint};case"mcp":return{preset:e.id,presetName:e.name,...e.endpoint?{presetEndpoint:e.endpoint}:{},...e.transport?{presetTransport:e.transport}:{},...e.command?{presetCommand:e.command}:{},...e.args?{presetArgs:JSON.stringify(e.args)}:{},...e.env?{presetEnv:JSON.stringify(e.env)}:{},...e.cwd?{presetCwd:e.cwd}:{}};default:return{preset:e.id,presetName:e.name,presetService:e.service,presetVersion:e.version,presetDiscoveryUrl:e.discoveryUrl}}},al=e=>{const t=e.trim();try{const n=new URL(t);return n.pathname.length>1&&n.pathname.endsWith("/")&&(n.pathname=n.pathname.slice(0,-1)),n.toString()}catch{return t}},XG=e=>{try{return new URL(e.trim())}catch{return null}},Cb=(e,t)=>{const n=e.hostname.replace(/^www\./,"");if(n.length===0)return t;const r=n.split(".")[0]?.trim();return r?`${r.charAt(0).toUpperCase()}${r.slice(1)} ${t}`:t},ZBe=e=>{const t=XG(e);if(!t)return null;const n=t.pathname.match(/^\/discovery\/v1\/apis\/([^/]+)\/([^/]+)\/rest$/);if(n)return{service:decodeURIComponent(n[1]??""),version:decodeURIComponent(n[2]??""),discoveryUrl:t.toString()};const r=t.searchParams.get("version")?.trim(),s=t.pathname==="/$discovery/rest"&&t.hostname.endsWith(".googleapis.com")&&t.hostname!=="www.googleapis.com";if(r&&s){const a=t.hostname.split(".")[0]?.trim();return a?{service:a,version:r,discoveryUrl:t.toString()}:null}return null},eUe=e=>{const t=e.pathname.toLowerCase(),n=e.hostname.toLowerCase();return t.endsWith("/graphql")||t==="/graphql"||n.startsWith("graphql.")||n.includes("graphql")},tUe=e=>{const t=e.pathname.toLowerCase(),n=e.hostname.toLowerCase();return t.endsWith("/mcp")||t.includes("/mcp/")||n.startsWith("mcp.")},nUe=e=>{const t=e.pathname.toLowerCase();return t.endsWith(".json")||t.endsWith(".yaml")||t.endsWith(".yml")||t.includes("openapi")||t.includes("swagger")},rUe=e=>{const t=al(e);for(const n of TA){if(al(n.previewUrl)===t)return n;if(n.pluginKey==="openapi"){if(al(n.baseUrl)===t||al(n.specUrl)===t)return n;continue}if(n.pluginKey==="graphql"||n.pluginKey==="mcp"){if(n.endpoint&&al(n.endpoint)===t)return n;continue}if(al(n.discoveryUrl)===t)return n}return null},sUe=e=>{const t=e.trim();if(t.length===0)return null;const n=t.match(/[^\s"]+|"([^"]*)"/g)?.map(o=>o.startsWith('"')&&o.endsWith('"')?o.slice(1,-1):o)??null;if(n&&n.length>0){const[o,...i]=n;if(o==="npx"||o==="bunx"||o==="uvx"||o==="pnpm"&&i[0]==="dlx")return{pluginKey:"mcp",search:{presetName:"Local MCP",presetTransport:"stdio",presetCommand:o,...i.length>0?{presetArgs:JSON.stringify(i)}:{},quickInput:t}}}const r=rUe(t);if(r)return{pluginKey:r.pluginKey,search:nT(r)};const s=ZBe(t);if(s){const o=TA.find(i=>i.pluginKey===tT&&i.service===s.service&&i.version===s.version);return{pluginKey:tT,search:{...o?nT(o):{},presetName:o?.name??`Google ${s.service} ${s.version}`,presetService:s.service,presetVersion:s.version,presetDiscoveryUrl:s.discoveryUrl,quickInput:t}}}const a=XG(t);return a?eUe(a)?{pluginKey:"graphql",search:{presetName:Cb(a,"GraphQL"),presetEndpoint:t,quickInput:t}}:tUe(a)?{pluginKey:"mcp",search:{presetName:Cb(a,"MCP"),presetEndpoint:t,presetTransport:"auto",quickInput:t}}:nUe(a)?{pluginKey:"openapi",search:{presetName:Cb(a,"OpenAPI"),presetSpecUrl:t,quickInput:t}}:{pluginKey:"openapi",search:{presetName:Cb(a,"OpenAPI"),presetBaseUrl:t,quickInput:t}}:null},aUe=()=>f.jsx(EA,{title:"Plugins unavailable",message:"No plugins are available in this build."}),oUe=()=>f.jsx(EA,{title:"No source plugins available",message:"No source plugins are available in this build."}),iUe=()=>{const e=Gl(),[t,n]=E.useState(""),[r,s]=E.useState(null),a=o=>{o.preventDefault();const i=sUe(t);if(i===null){s("Could not recognize that input. Try a GraphQL endpoint, MCP URL, Google Discovery URL, OpenAPI spec URL, or a local MCP command.");return}s(null),e({to:km(i.pluginKey).add,search:i.search})};return f.jsxs(ac,{className:"rounded-2xl",children:[f.jsx("h2",{className:"font-display text-lg font-semibold tracking-tight text-foreground",children:"Quick add"}),f.jsx("p",{className:"mt-1 text-sm leading-6 text-muted-foreground",children:"Paste a URL or command and we'll detect the right plugin automatically."}),f.jsxs("form",{onSubmit:a,className:"mt-4",children:[f.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row",children:[f.jsx(_t,{value:t,onChange:o=>n(o.target.value),placeholder:"https://api.github.com/graphql or npx -y chrome-devtools-mcp@latest",className:"h-10 flex-1 px-3.5 text-sm"}),f.jsx(Te,{type:"submit",className:"h-10",children:"Add source"})]}),r&&f.jsx(ts,{variant:"destructive",className:"mt-3",children:r})]})]})};function cUe(e){const t=HG(e.pluginKey);if(t===null)return f.jsx(aUe,{});const n=IBe(e.pluginKey,e.routeKey);if(n===null)return f.jsx(EA,{title:"Route unavailable",message:`The route "${e.routeKey}" is not available for this plugin.`});const r=n.route.component;return f.jsx(Ive,{value:{plugin:t,route:n.route,params:e.params,search:e.search,navigation:e.navigation},children:f.jsx("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:f.jsx(r,{})})})}function uUe(){if(Eb.length===0)return f.jsx(oUe,{});const e=Eb.some(n=>n.key==="mcp"),t=Eb.map(n=>({plugin:n,presets:TA.filter(r=>r.pluginKey===n.key)})).filter(n=>n.presets.length>0);return f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:f.jsxs("div",{className:"mx-auto max-w-5xl px-6 py-10 lg:px-10 lg:py-14",children:[f.jsxs("div",{className:"mb-8",children:[f.jsx("h1",{className:"font-display text-3xl tracking-tight text-foreground lg:text-4xl",children:"Add source"}),f.jsx("p",{className:"mt-1.5 text-[14px] text-muted-foreground",children:"Connect a new tool provider to this workspace."})]}),f.jsx(iUe,{}),e&&f.jsx(QG,{className:"mt-8",title:"Install this executor as MCP",description:"Prefer a one-command setup? Install this local executor server into your MCP client, or add an external MCP source below."}),t.length>0&&f.jsxs("div",{className:"mt-10",children:[f.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Popular sources"}),f.jsx("p",{className:"mt-1 text-sm leading-6 text-muted-foreground",children:"One-click presets for common APIs and tools."}),f.jsx("div",{className:"mt-5 space-y-8",children:t.map(({plugin:n,presets:r})=>{const s=km(n.key);return f.jsxs("section",{children:[f.jsx("h3",{className:"mb-3 text-sm font-semibold text-foreground",children:n.displayName??n.key}),f.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:r.map(a=>f.jsxs(bs,{to:s.add,search:nT(a),className:"rounded-xl border border-border bg-card px-4 py-3 text-left transition-colors hover:border-primary/25 hover:bg-card/90",children:[f.jsxs("div",{className:"mb-2 flex items-center gap-2.5",children:[f.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground",children:f.jsx(OBe,{preset:a,className:"size-4"})}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-sm font-semibold text-foreground",children:a.name}),f.jsx("div",{className:"mt-0.5 text-[11px] text-muted-foreground",children:a.kind})]})]}),f.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:a.summary})]},a.id))})]},n.key)})})]}),f.jsxs("div",{className:"mt-10",children:[f.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"All source plugins"}),f.jsx("p",{className:"mt-1 text-sm leading-6 text-muted-foreground",children:"Start from a clean configuration page for any installed source plugin."}),f.jsx("div",{className:"mt-5 grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:Eb.map(n=>{const r=km(n.key);return f.jsxs(bs,{to:r.add,className:"rounded-xl border border-border bg-card px-4 py-3 text-left transition-colors hover:border-primary/25 hover:bg-card/90",children:[f.jsx("div",{className:"mb-2 text-sm font-semibold text-foreground",children:n.displayName??n.key}),f.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:n.description??"Configure a new source for this plugin."})]},n.key)})})]})]})})}const lUe=e=>e==="connected"?"default":e==="error"?"destructive":"muted";function dUe(){const e=iz();return f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:f.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-10 lg:px-10 lg:py-14",children:[f.jsxs("div",{className:"flex items-end justify-between mb-8",children:[f.jsxs("div",{children:[f.jsx("h1",{className:"font-display text-3xl tracking-tight text-foreground lg:text-4xl",children:"Sources"}),f.jsx("p",{className:"mt-1.5 text-[14px] text-muted-foreground",children:"Connected tool providers in this workspace."})]}),f.jsx(bs,{to:N0,children:f.jsxs(Te,{size:"sm",children:[f.jsx(eo,{className:"size-3.5"}),"Add source"]})})]}),f.jsx(QG,{className:"mb-8"}),f.jsx(Om,{loadable:e,loading:"Loading sources...",children:t=>Array.isArray(t)?t.length===0?f.jsxs("div",{className:"flex flex-col items-center justify-center rounded-2xl border border-dashed border-border py-20",children:[f.jsx("div",{className:"flex size-12 items-center justify-center rounded-2xl bg-muted text-muted-foreground mb-4",children:f.jsx(I4e,{className:"size-5"})}),f.jsx("p",{className:"text-[14px] font-medium text-foreground/70 mb-1",children:"No sources yet"}),f.jsx("p",{className:"text-[13px] text-muted-foreground/60 mb-5",children:"Add a source to get started."}),f.jsx(bs,{to:N0,children:f.jsxs(Te,{size:"sm",children:[f.jsx(eo,{className:"size-3.5"}),"Add source"]})})]}):f.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(n=>{const r=qG(n.kind),s=f.jsx(ac,{className:"flex h-full flex-col rounded-2xl px-5 py-4 transition-colors hover:border-primary/25 hover:bg-card/90",children:f.jsxs("div",{className:"flex items-start gap-3",children:[f.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground",children:f.jsx(ZE,{source:n,className:"size-4"})}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsxs("div",{className:"flex items-start justify-between gap-2",children:[f.jsx("div",{className:"truncate text-sm font-semibold text-foreground",children:n.name}),f.jsx(Fn,{variant:lUe(n.status),className:"shrink-0",children:n.status})]}),f.jsx("div",{className:"mt-0.5 text-xs text-muted-foreground",children:n.kind})]})]})});return r?f.jsx(bs,{to:r.detail(n.id),search:{tab:"model"},children:s},n.id):f.jsx("div",{children:s},n.id)})}):f.jsx(ts,{variant:"destructive",className:"px-5 py-4",children:"Sources returned an unexpected payload."})})]})})}const fUe=(e,t)=>e==="deny"?"denied":t==="required"?"requires-approval":"auto-run",ZG={"auto-run":{label:"Auto-run",className:"border-emerald-500/20 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",dotClassName:"bg-emerald-500"},"requires-approval":{label:"Approval",className:"border-amber-500/20 bg-amber-500/10 text-amber-600 dark:text-amber-400",dotClassName:"bg-amber-500"},denied:{label:"Denied",className:"border-red-500/20 bg-red-500/10 text-red-600 dark:text-red-400",dotClassName:"bg-red-500"}},CA=e=>{const t=fUe(e.effect,e.approvalMode),n=ZG[t];return f.jsxs("span",{className:jt("inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide",n.className),children:[f.jsx("span",{className:jt("size-1.5 rounded-full",n.dotClassName)}),n.label]})};function hUe(){const e=cz(),[t,n]=E.useState(!1),[r,s]=E.useState(null);return f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:f.jsxs("div",{className:"mx-auto flex max-w-4xl flex-col gap-8 px-6 py-10 lg:px-10 lg:py-14",children:[f.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[f.jsxs("div",{children:[f.jsx("h1",{className:"font-display text-3xl tracking-tight text-foreground lg:text-4xl",children:"Policies"}),f.jsx("p",{className:"mt-1.5 text-[14px] text-muted-foreground",children:"Control which tools can auto-run, require approval, or are completely denied."})]}),f.jsxs(Te,{size:"sm",onClick:()=>{n(!0),s(null)},children:[f.jsx(eo,{className:"size-3.5"}),"Add policy"]})]}),t&&f.jsx(mUe,{className:"mb-2",onClose:()=>n(!1)}),f.jsxs("section",{className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"Active Policies"}),f.jsx("p",{className:"mt-1 text-[13px] text-muted-foreground",children:"Policies are matched by resource pattern using glob syntax. Higher priority rules take precedence."})]}),f.jsx(Om,{loadable:e,loading:"Loading policies...",children:a=>a.length===0&&!t?f.jsx(yUe,{title:"No policies configured",description:"Add a policy to control tool permissions. By default all tools require approval.",actionLabel:"Add policy",onAction:()=>{n(!0),s(null)}}):f.jsx(ac,{className:"overflow-hidden p-0",children:[...a].sort((o,i)=>i.priority-o.priority).map((o,i)=>f.jsx("div",{className:jt("px-5 py-3.5",i>0&&"border-t border-border",!o.enabled&&"opacity-50"),children:f.jsx(pUe,{policy:o,isEditing:r===o.id,onEdit:()=>s(r===o.id?null:o.id),onCancelEdit:()=>s(null)})},o.id))})})]}),f.jsxs("section",{className:"space-y-3",children:[f.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"How policies work"}),f.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[f.jsxs(tw,{level:"auto-run",children:[f.jsx("strong",{children:"Auto-run"})," tools execute immediately without asking. Use for trusted, read-only operations."]}),f.jsxs(tw,{level:"requires-approval",children:[f.jsx("strong",{children:"Approval"})," tools pause and ask before running. The default for most tools."]}),f.jsxs(tw,{level:"denied",children:[f.jsx("strong",{children:"Denied"})," tools are blocked completely and cannot be invoked."]})]}),f.jsxs("p",{className:"text-[12px] text-muted-foreground/60",children:["Patterns use glob syntax: ",f.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[11px]",children:"*"})," matches all tools, ",f.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[11px]",children:"github.*"})," matches all GitHub tools, ",f.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[11px]",children:"*.delete"})," matches all delete operations."]})]})]})})}function mUe(e){const t=uz(),[n,r]=E.useState("*"),[s,a]=E.useState("allow"),[o,i]=E.useState("auto"),[c,u]=E.useState("0"),[l,d]=E.useState(null),h=async()=>{d(null);const m=n.trim();if(!m){d("Resource pattern is required.");return}try{await t.mutateAsync({resourcePattern:m,effect:s,approvalMode:o,priority:Number(c)||0,enabled:!0}),e.onClose()}catch(p){d(p instanceof Error?p.message:"Failed creating policy.")}};return f.jsxs(bUe,{className:e.className,title:"New policy",onClose:e.onClose,children:[l&&f.jsx(eK,{children:l}),f.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[f.jsxs("div",{className:"grid gap-2 sm:col-span-2",children:[f.jsx(et,{children:"Resource pattern"}),f.jsx(_t,{value:n,onChange:m=>r(m.target.value),placeholder:"github.* or *.delete",className:"font-mono text-[12px]",autoFocus:!0}),f.jsx("p",{className:"text-[11px] text-muted-foreground/60",children:"Glob pattern matched against tool paths."})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Permission"}),f.jsxs(Ea,{value:`${s}:${o}`,onChange:m=>{const[p,y]=m.target.value.split(":");a(p),i(y)},children:[f.jsx("option",{value:"allow:auto",children:"Auto-run"}),f.jsx("option",{value:"allow:required",children:"Requires approval"}),f.jsx("option",{value:"deny:auto",children:"Denied"})]})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Priority"}),f.jsx(_t,{type:"number",value:c,onChange:m=>u(m.target.value),placeholder:"0"}),f.jsx("p",{className:"text-[11px] text-muted-foreground/60",children:"Higher priority rules win when multiple patterns match."})]})]}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx(CA,{effect:s,approvalMode:o}),f.jsxs(Te,{size:"sm",onClick:h,disabled:t.status==="pending",children:[t.status==="pending"?f.jsx(Es,{className:"size-3.5"}):f.jsx(eo,{className:"size-3.5"}),"Create policy"]})]})]})}function pUe(e){const t=vve(),[n,r]=E.useState(!1),[s,a]=E.useState(!1),o=async()=>{r(!0);try{await t.mutateAsync(e.policy.id)}catch{}finally{r(!1),a(!1)}};return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx("span",{className:"truncate font-mono text-[13px] font-medium text-foreground",children:e.policy.resourcePattern}),f.jsx(CA,{effect:e.policy.effect,approvalMode:e.policy.approvalMode}),!e.policy.enabled&&f.jsx(Fn,{variant:"outline",className:"text-[9px] uppercase",children:"disabled"}),e.policy.priority!==0&&f.jsxs(Fn,{variant:"outline",className:"text-[9px]",children:["priority ",e.policy.priority]})]}),f.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground/50",children:[f.jsx("span",{className:"font-mono",children:e.policy.id}),f.jsx("span",{children:xUe(e.policy.createdAt)})]})]}),f.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[f.jsxs(Te,{variant:"ghost",size:"sm",onClick:e.onEdit,className:jt(e.isEditing?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[f.jsx(VV,{className:"size-3"}),"Edit"]}),s?f.jsxs(f.Fragment,{children:[f.jsx(Te,{variant:"ghost",size:"sm",onClick:()=>a(!1),disabled:n,children:"Cancel"}),f.jsxs(Te,{variant:"destructive-outline",size:"sm",onClick:()=>{o()},disabled:n,children:[n?f.jsx(Es,{className:"size-3"}):f.jsx(Sd,{className:"size-3"}),"Delete"]})]}):f.jsxs(Te,{variant:"ghost",size:"sm",onClick:()=>a(!0),disabled:n,className:"text-muted-foreground hover:bg-destructive/8 hover:text-destructive",children:[n?f.jsx(Es,{className:"size-3"}):f.jsx(Sd,{className:"size-3"}),"Delete"]})]})]}),e.isEditing&&f.jsx(gUe,{policy:e.policy,onClose:e.onCancelEdit})]})}function gUe(e){const t=lz(),[n,r]=E.useState(e.policy.resourcePattern),[s,a]=E.useState(e.policy.effect),[o,i]=E.useState(e.policy.approvalMode),[c,u]=E.useState(String(e.policy.priority)),[l,d]=E.useState(e.policy.enabled),[h,m]=E.useState(null),p=async()=>{m(null);const y={},g=n.trim();g&&g!==e.policy.resourcePattern&&(y.resourcePattern=g),s!==e.policy.effect&&(y.effect=s),o!==e.policy.approvalMode&&(y.approvalMode=o);const b=Number(c)||0;if(b!==e.policy.priority&&(y.priority=b),l!==e.policy.enabled&&(y.enabled=l),Object.keys(y).length===0){e.onClose();return}try{await t.mutateAsync({policyId:e.policy.id,payload:y}),e.onClose()}catch(x){m(x instanceof Error?x.message:"Failed updating policy.")}};return f.jsxs("div",{className:"mt-3 border-t border-border/50 pt-3",children:[h&&f.jsx(eK,{className:"mb-3",children:h}),f.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[f.jsxs("div",{className:"grid gap-2 sm:col-span-2",children:[f.jsx(et,{children:"Resource pattern"}),f.jsx(_t,{value:n,onChange:y=>r(y.target.value),placeholder:"github.* or *.delete",className:"h-8 font-mono text-[12px]",autoFocus:!0})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Permission"}),f.jsxs(Ea,{value:`${s}:${o}`,onChange:y=>{const[g,b]=y.target.value.split(":");a(g),i(b)},className:"h-8 text-[12px]",children:[f.jsx("option",{value:"allow:auto",children:"Auto-run"}),f.jsx("option",{value:"allow:required",children:"Requires approval"}),f.jsx("option",{value:"deny:auto",children:"Denied"})]})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Priority"}),f.jsx(_t,{type:"number",value:c,onChange:y=>u(y.target.value),placeholder:"0",className:"h-8 text-[12px]"})]})]}),f.jsxs("div",{className:"mt-3 flex items-center justify-between",children:[f.jsxs("label",{className:"flex items-center gap-2 text-[12px] text-muted-foreground",children:[f.jsx("input",{type:"checkbox",checked:l,onChange:y=>d(y.target.checked),className:"rounded border-border"}),"Enabled"]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(CA,{effect:s,approvalMode:o}),f.jsx(Te,{variant:"ghost",size:"sm",onClick:e.onClose,children:"Cancel"}),f.jsxs(Te,{size:"sm",onClick:p,disabled:t.status==="pending",children:[t.status==="pending"&&f.jsx(Es,{className:"size-3"}),"Save"]})]})]})]})}function tw(e){const t=ZG[e.level];return f.jsxs("div",{className:jt("rounded-xl border px-4 py-3 text-[12px] leading-relaxed",t.className),children:[f.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[f.jsx("span",{className:jt("size-2 rounded-full",t.dotClassName)}),f.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wide",children:t.label})]}),f.jsx("p",{className:"text-foreground/70",children:e.children})]})}function bUe(e){return f.jsxs(ac,{className:jt("border-primary/20 p-0",e.className),children:[f.jsxs("div",{className:"flex items-center justify-between border-b border-border px-5 py-3",children:[f.jsx("h3",{className:"text-sm font-semibold text-foreground",children:e.title}),f.jsx(Te,{variant:"ghost",size:"sm",onClick:e.onClose,children:"Cancel"})]}),f.jsx("div",{className:"space-y-4 p-5",children:e.children})]})}function eK(e){return f.jsx(ts,{variant:"destructive",className:jt("text-[13px]",e.className),children:e.children})}function yUe(e){return f.jsxs("div",{className:"rounded-xl border border-dashed border-border px-6 py-10 text-center",children:[f.jsx("p",{className:"text-[14px] font-medium text-foreground/75",children:e.title}),f.jsx("p",{className:"mt-1 text-[13px] text-muted-foreground",children:e.description}),e.actionLabel&&e.onAction&&f.jsx("div",{className:"mt-4 flex justify-center",children:f.jsxs(Te,{size:"sm",onClick:e.onAction,children:[f.jsx(eo,{className:"size-3.5"}),e.actionLabel]})})]})}const xUe=e=>new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),kUe=e=>e.status==="ready"?e.data.secretStorePlugins.filter(t=>t.canCreate):[],vUe=(e,t)=>e.status==="ready"?e.data.secretStorePlugins.some(n=>n.kind===t&&n.canCreate):!1,SUe=(e,t)=>e.status!=="ready"||t.status!=="ready"||e.data.defaultSecretStoreId===null?null:t.data.find(n=>n.id===e.data.defaultSecretStoreId)?.name??null,wUe=e=>e?.capabilities.canBrowseSecrets===!0&&e.capabilities.canImportSecrets===!0;function _Ue(){const e=gve(),t=rz(),n=nz(),[r,s]=E.useState(!1),[a,o]=E.useState(!1),[i,c]=E.useState(null),u=kUe(e),l=SUe(e,t);return f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:f.jsxs("div",{className:"mx-auto flex max-w-4xl flex-col gap-8 px-6 py-10 lg:px-10 lg:py-14",children:[f.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[f.jsxs("div",{children:[f.jsx("h1",{className:"font-display text-3xl tracking-tight text-foreground lg:text-4xl",children:"Secrets"}),f.jsxs("p",{className:"mt-1.5 text-[14px] text-muted-foreground",children:["Manage secret stores and the secrets linked into sources.",l?` New secrets default to ${l}.`:""]})]}),f.jsx("div",{className:"flex gap-2",children:f.jsxs(Te,{size:"sm",onClick:()=>{o(!0),c(null)},children:[f.jsx(eo,{className:"size-3.5"}),"Add secret"]})})]}),f.jsxs("section",{className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"Stores"}),f.jsx("p",{className:"mt-1 text-[13px] text-muted-foreground",children:"Local and external backends that hold managed secrets."})]}),r&&f.jsx(EUe,{className:"mb-2",onClose:()=>s(!1),pluginOptions:u,secrets:n}),f.jsx(Om,{loadable:t,loading:"Loading stores...",children:d=>d.length===0?f.jsx(Bj,{title:"No secret stores yet",description:"External secret stores are currently unavailable in this app."}):f.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:d.map(h=>f.jsx(CUe,{store:h,canManage:vUe(e,h.kind)},h.id))})})]}),f.jsxs("section",{className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"Managed Secrets"}),f.jsx("p",{className:"mt-1 text-[13px] text-muted-foreground",children:"Secret records stay stable even if their underlying store handle changes."})]}),a&&f.jsx(TUe,{className:"mb-2",onClose:()=>o(!1),storeOptions:t.status==="ready"?t.data:[],defaultStoreId:e.status==="ready"?e.data.defaultSecretStoreId:null}),f.jsx(Om,{loadable:n,loading:"Loading secrets...",children:d=>d.length===0&&!a?f.jsx(Bj,{title:"No secrets stored",description:"Add a secret to use it in source authentication and runtime resolution.",actionLabel:"Add secret",onAction:()=>{o(!0),c(null)}}):f.jsx(ac,{className:"overflow-hidden p-0",children:d.map((h,m)=>f.jsx("div",{className:jt("px-5 py-3.5",m>0&&"border-t border-border"),children:f.jsx(IUe,{secret:h,isEditing:i===h.id,onEdit:()=>c(i===h.id?null:h.id),onCancelEdit:()=>c(null)})},h.id))})})]})]})})}function EUe(e){const t=fve(),[n,r]=E.useState(e.pluginOptions[0]?.kind??""),[s,a]=E.useState(""),[o,i]=E.useState(null),u=PBe(n)?.secretStore?.CreateStoreForm;E.useEffect(()=>{n.length>0||e.pluginOptions.length===0||r(e.pluginOptions[0].kind)},[n,e.pluginOptions]);const l=async()=>{i(null);const d=s.trim();if(!d){i("Store name is required.");return}try{await t.mutateAsync({kind:n,name:d,config:{}}),e.onClose()}catch(h){i(h instanceof Error?h.message:"Failed creating secret store.")}};return f.jsxs(tK,{className:e.className,title:"New secret store",onClose:e.onClose,children:[o&&f.jsx(IA,{children:o}),e.pluginOptions.length===0?f.jsx("div",{className:"rounded-lg border border-border bg-background/40 px-4 py-3 text-[13px] text-muted-foreground",children:"No external secret store plugins are available in this runtime."}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Store type"}),f.jsx(Ea,{value:n,onChange:d=>r(d.target.value),children:e.pluginOptions.map(d=>f.jsx("option",{value:d.kind,children:d.displayName},d.kind))})]}),!u&&f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Name"}),f.jsx(_t,{value:s,onChange:d=>a(d.target.value),placeholder:"Secret store",autoFocus:!0})]})]}),u?f.jsx(u,{isSubmitting:t.status==="pending",onCancel:e.onClose,onSubmit:async d=>{await t.mutateAsync({kind:n,name:d.name,config:d.config}),e.onClose()},secrets:e.secrets}):f.jsx("div",{className:"flex justify-end",children:f.jsxs(Te,{size:"sm",onClick:l,disabled:t.status==="pending",children:[t.status==="pending"?f.jsx(Es,{className:"size-3.5"}):f.jsx(eo,{className:"size-3.5"}),"Create store"]})})]})]})}function TUe(e){const t=az(),n=sz(),[r,s]=E.useState("create"),[a,o]=E.useState(""),[i,c]=E.useState(""),[u,l]=E.useState(e.defaultStoreId??""),[d,h]=E.useState([]),[m,p]=E.useState(""),[y,g]=E.useState([]),[b,x]=E.useState("idle"),[k,_]=E.useState(null),[S,w]=E.useState(""),[T,A]=E.useState(""),[L,R]=E.useState(null),j=e.storeOptions.find(le=>le.id===u)??null,F=wUe(j),K=j?.capabilities.canCreateSecrets!==!1,Y=d[d.length-1]?.key??null,W=E.useCallback(async le=>{const I=await fetch(`${ws()}/v1/local/secret-stores/${le.storeId}/browse`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...le.parentKey?{parentKey:le.parentKey}:{},...le.query?.trim()?{query:le.query.trim()}:{}})});if(!I.ok){let U="Failed browsing secret store.";try{const V=await I.json();U=V.message??V.details??U}catch{}throw new Error(U)}return await I.json()},[]),J=er(async()=>{const le=await fetch(`${ws()}/v1/local/secret-stores/${u}/import`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({selectionKey:S,...a.trim()?{name:a.trim()}:{}})});if(!le.ok){let I="Failed importing secret.";try{const U=await le.json();I=U.message??U.details??I}catch{}throw new Error(I)}return await le.json()});E.useEffect(()=>{if(!(u.length>0)){if(e.defaultStoreId){l(e.defaultStoreId);return}e.storeOptions.length>0&&l(e.storeOptions[0].id)}},[e.defaultStoreId,e.storeOptions,u]),E.useEffect(()=>{if(h([]),p(""),g([]),x("idle"),_(null),w(""),A(""),F&&!K){s("import");return}if(!F&&K){s("create");return}if(F){s("import");return}s("create")},[K,F,j?.id]),E.useEffect(()=>{if(r!=="import"||!F||!u)return;let le=!0;return x("pending"),W({storeId:u,parentKey:Y,query:m}).then(I=>{le&&(g(I.entries),_(null),x("idle"))}).catch(I=>{le&&(g([]),_(I instanceof Error?I.message:"Failed browsing secret store."),x("idle"))}),()=>{le=!1}},[m,W,F,Y,r,u]),E.useEffect(()=>{r!=="import"||!T||a.trim().length>0||o(T)},[r,a,T]);const ae=le=>{if(R(null),le.kind==="group"){w(""),A(""),h(I=>[...I,{key:le.key,label:le.label}]),p("");return}w(le.key),A(le.label)},ge=async()=>{R(null);const le=a.trim();try{if(r==="import"){if(!S){R("Select a secret to import.");return}await J.mutateAsync(),n()}else{if(!le){R("Name is required.");return}if(!i){R("Value is required.");return}await t.mutateAsync({name:le,value:i,...u?{storeId:u}:{}})}e.onClose()}catch(I){R(I instanceof Error?I.message:"Failed creating secret.")}};return f.jsxs(tK,{className:e.className,title:"New managed secret",onClose:e.onClose,children:[L&&f.jsx(IA,{children:L}),f.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Store"}),f.jsx(Ea,{value:u,onChange:le=>l(le.target.value),children:e.storeOptions.map(le=>f.jsx("option",{value:le.id,children:le.name},le.id))})]}),F&&K&&f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Mode"}),f.jsxs(Ea,{value:r,onChange:le=>s(le.target.value),children:[f.jsx("option",{value:"import",children:"Import from store"}),f.jsx("option",{value:"create",children:"Create new secret"})]})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Name"}),f.jsx(_t,{value:a,onChange:le=>o(le.target.value),placeholder:r==="import"?"Optional override name":"GitHub PAT",autoFocus:!0})]}),r==="create"&&f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Value"}),f.jsx(_t,{type:"password",value:i,onChange:le=>c(le.target.value),placeholder:"ghp_...",className:"font-mono text-[12px]"})]})]}),r==="import"&&F&&f.jsxs("div",{className:"mt-4 space-y-4",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.length>0&&f.jsx(Te,{size:"sm",variant:"outline",onClick:()=>{w(""),A(""),h(le=>le.slice(0,-1))},children:"Back"}),f.jsx(_t,{value:m,onChange:le=>p(le.target.value),placeholder:"Search this store",className:"min-w-0 flex-1"})]}),d.length>0&&f.jsx("div",{className:"text-[11px] text-muted-foreground",children:d.map((le,I)=>f.jsxs("span",{children:[I>0?" / ":"",le.label]},le.key))}),f.jsx("div",{className:"rounded-xl border border-border bg-background/40",children:b==="pending"?f.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 text-[13px] text-muted-foreground",children:[f.jsx(Es,{className:"size-3.5"}),"Loading store contents..."]}):y.length===0?f.jsx("div",{className:"px-4 py-3 text-[13px] text-muted-foreground",children:k??"No importable secrets found here."}):y.map((le,I)=>f.jsxs(Te,{variant:"ghost",onClick:()=>ae(le),className:jt("flex h-auto w-full items-center justify-between gap-3 rounded-none px-4 py-3 text-left",I>0&&"border-t border-border",S===le.key&&"bg-accent/60"),children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-[13px] font-medium text-foreground",children:le.label}),le.description&&f.jsx("div",{className:"truncate text-[11px] text-muted-foreground",children:le.description})]}),f.jsx(Fn,{variant:"outline",children:le.kind==="group"?"Open":"Secret"})]},le.key))}),k&&y.length>0&&f.jsx("div",{className:"text-[12px] text-destructive",children:k})]}),f.jsx("div",{className:"flex justify-end",children:f.jsxs(Te,{size:"sm",onClick:ge,disabled:t.status==="pending"||J.status==="pending",children:[t.status==="pending"||J.status==="pending"?f.jsx(Es,{className:"size-3.5"}):f.jsx(eo,{className:"size-3.5"}),r==="import"?"Import secret":"Store secret"]})})]})}function CUe(e){const t=hve(),[n,r]=E.useState(!1),[s,a]=E.useState(!1),o=async()=>{a(!0);try{await t.mutateAsync(e.store.id)}catch{}finally{a(!1),r(!1)}};return f.jsx(ac,{className:"p-4",children:f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx("span",{className:"truncate text-[13px] font-medium text-foreground",children:e.store.name}),f.jsx(Fn,{variant:"outline",className:"text-[9px] uppercase",children:e.store.kind}),f.jsx(Fn,{variant:"outline",className:"text-[9px]",children:e.store.status})]}),f.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground/55",children:[f.jsx("span",{className:"font-mono",children:e.store.id}),f.jsxs("span",{children:["Created ",nK(e.store.createdAt)]})]})]}),e.canManage?n?f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(Te,{variant:"ghost",size:"sm",onClick:()=>r(!1),disabled:s,children:"Cancel"}),f.jsxs(Te,{variant:"destructive-outline",size:"sm",onClick:()=>{o()},disabled:s,children:[s?f.jsx(Es,{className:"size-3"}):f.jsx(Sd,{className:"size-3"}),"Delete"]})]}):f.jsxs(Te,{variant:"ghost",size:"sm",onClick:()=>r(!0),disabled:s,className:"text-muted-foreground hover:bg-destructive/8 hover:text-destructive",children:[s?f.jsx(Es,{className:"size-3"}):f.jsx(Sd,{className:"size-3"}),"Remove"]}):f.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.12em] text-muted-foreground/45",children:"Built-in"})]})})}function IUe(e){const t=pve(),[n,r]=E.useState(!1),[s,a]=E.useState(!1),o=async()=>{r(!0);try{await t.mutateAsync(e.secret.id)}catch{}finally{r(!1),a(!1)}};return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx("span",{className:"truncate text-[13px] font-medium text-foreground",children:e.secret.name||"Unnamed secret"}),f.jsx(Fn,{variant:"outline",className:"text-[9px] shrink-0",children:e.secret.purpose.replace(/_/g," ")}),f.jsx(Fn,{variant:"outline",className:"text-[9px] shrink-0",children:e.secret.storeName}),f.jsx(Fn,{variant:"outline",className:"text-[9px] shrink-0 uppercase",children:e.secret.storeKind})]}),f.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground/50",children:[f.jsx("span",{className:"font-mono",children:e.secret.id}),f.jsx("span",{children:nK(e.secret.createdAt)})]}),e.secret.linkedSources.length>0&&f.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[f.jsx("span",{className:"text-[10px] text-muted-foreground/50",children:"Used by"}),e.secret.linkedSources.map(i=>f.jsx("span",{className:"inline-flex items-center rounded-md bg-accent/60 px-1.5 py-0.5 text-[10px] font-medium text-foreground/70",children:i.sourceName},i.sourceId))]})]}),f.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[f.jsxs(Te,{variant:"ghost",size:"sm",onClick:e.onEdit,className:jt(e.isEditing?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[f.jsx(VV,{className:"size-3"}),"Edit"]}),s?f.jsxs(f.Fragment,{children:[f.jsx(Te,{variant:"ghost",size:"sm",onClick:()=>a(!1),disabled:n,children:"Cancel"}),f.jsxs(Te,{variant:"destructive-outline",size:"sm",onClick:()=>{o()},disabled:n,children:[n?f.jsx(Es,{className:"size-3"}):f.jsx(Sd,{className:"size-3"}),"Delete"]})]}):f.jsxs(Te,{variant:"ghost",size:"sm",onClick:()=>a(!0),disabled:n,className:"text-muted-foreground hover:bg-destructive/8 hover:text-destructive",children:[n?f.jsx(Es,{className:"size-3"}):f.jsx(Sd,{className:"size-3"}),"Delete"]})]})]}),e.isEditing&&f.jsx(AUe,{secret:e.secret,onClose:e.onCancelEdit})]})}function AUe(e){const t=mve(),[n,r]=E.useState(e.secret.name??""),[s,a]=E.useState(""),[o,i]=E.useState(null),c=async()=>{i(null);const u={},l=n.trim();if(l&&l!==(e.secret.name??"")&&(u.name=l),s.length>0&&(u.value=s),Object.keys(u).length===0){e.onClose();return}try{await t.mutateAsync({secretId:e.secret.id,payload:u}),e.onClose()}catch(d){i(d instanceof Error?d.message:"Failed updating secret.")}};return f.jsxs("div",{className:"mt-3 border-t border-border/50 pt-3",children:[o&&f.jsx(IA,{className:"mb-3",children:o}),f.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"Name"}),f.jsx(_t,{value:n,onChange:u=>r(u.target.value),placeholder:"Secret name",className:"h-8 text-[12px]",autoFocus:!0})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(et,{children:"New value"}),f.jsx(_t,{type:"password",value:s,onChange:u=>a(u.target.value),placeholder:"Leave empty to keep existing",className:"h-8 font-mono text-[11px]"})]})]}),f.jsxs("div",{className:"mt-3 flex items-center justify-end gap-2",children:[f.jsx(Te,{variant:"ghost",size:"sm",onClick:e.onClose,children:"Cancel"}),f.jsxs(Te,{size:"sm",onClick:c,disabled:t.status==="pending",children:[t.status==="pending"&&f.jsx(Es,{className:"size-3"}),"Save"]})]})]})}function tK(e){return f.jsxs(ac,{className:jt("border-primary/20 p-0",e.className),children:[f.jsxs("div",{className:"flex items-center justify-between border-b border-border px-5 py-3",children:[f.jsx("h3",{className:"text-sm font-semibold text-foreground",children:e.title}),f.jsx(Te,{variant:"ghost",size:"sm",onClick:e.onClose,children:"Cancel"})]}),f.jsx("div",{className:"space-y-4 p-5",children:e.children})]})}function IA(e){return f.jsx(ts,{variant:"destructive",className:jt("text-[13px]",e.className),children:e.children})}function Bj(e){return f.jsxs("div",{className:"rounded-xl border border-dashed border-border px-6 py-10 text-center",children:[f.jsx("p",{className:"text-[14px] font-medium text-foreground/75",children:e.title}),f.jsx("p",{className:"mt-1 text-[13px] text-muted-foreground",children:e.description}),e.actionLabel&&e.onAction&&f.jsx("div",{className:"mt-4 flex justify-center",children:f.jsxs(Te,{size:"sm",onClick:e.onAction,children:[f.jsx(eo,{className:"size-3.5"}),e.actionLabel]})})]})}const nK=e=>new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),cf=GW({component:qBe}),NUe=wd({getParentRoute:()=>cf,path:"/",component:dUe}),RUe=wd({getParentRoute:()=>cf,path:N0,component:uUe}),PUe=wd({getParentRoute:()=>cf,path:"/secrets",component:_Ue}),OUe=wd({getParentRoute:()=>cf,path:"/policies",component:hUe}),LUe=(e,t)=>{const n=o2(e);return{paths:n,home:()=>t.navigateTo("/"),route:(r="",s)=>t.navigateTo(n.route(r),s),updateSearch:r=>t.updateSearch?.(r)}},$Ue=zG.map(({plugin:e,route:t})=>{const n=o2(e.key),r=()=>{const a=s.useParams(),o=s.useSearch(),i=Gl(),c=Gl({from:s.fullPath}),u=LUe(e.key,{navigateTo:(l,d)=>i(d===void 0?{to:l}:{to:l,search:d}),updateSearch:l=>c({search:l})});return f.jsx(cUe,{pluginKey:e.key,routeKey:t.key,params:a,search:o,navigation:u})},s=wd({getParentRoute:()=>cf,path:n.routePattern(t.path??""),component:r});return s}),jUe=cf.addChildren([NUe,PUe,OUe,RUe,...$Ue]),MUe=tY({routeTree:jUe,defaultPreload:"intent",defaultPreloadStaleTime:0}),DUe=()=>f.jsx(dve,{children:f.jsx(sY,{router:MUe})}),Pze=Object.freeze(Object.defineProperty({__proto__:null,App:DUe},Symbol.toStringTag,{value:"Module"})),FUe=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:Vq},Symbol.toStringTag,{value:"Module"}));export{pMe as B,Nze as M,_s as R,Pze as m,E as r};
|