executor 1.2.4-beta.4 → 1.2.4-beta.6
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/README.md +4 -2
- package/bin/executor.mjs +44539 -42777
- package/package.json +1 -1
- package/resources/web/assets/{highlighted-body-TPN3WLV5-BNzQ45td.js → highlighted-body-TPN3WLV5-DYg1rqdL.js} +1 -1
- package/resources/web/assets/{index-C81r_B2h.js → index-BuXgGpBl.js} +2 -2
- package/resources/web/assets/mermaid-O7DHMXV3-Du9Efp9a.js +332 -0
- package/resources/web/index.html +1 -1
- package/resources/web/assets/__vite-browser-external-BIHI7g3E.js +0 -1
- package/resources/web/assets/mermaid-O7DHMXV3-DYFvhbe6.js +0 -667
- package/resources/web/assets/openapi_extractor_bg-IMRXzuHp.wasm +0 -0
|
@@ -0,0 +1,332 @@
|
|
|
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-DYg1rqdL.js","assets/index-CRuElBS1.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as Uw,j as m,b as HU,r as qU,_ as ft}from"./index-CRuElBS1.js";function W0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var O=Uw();const nf=W0(O);var Gt=(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))(Gt||{});function z3({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 f=h!==void 0?h.nextDep:l.deps;if(f!==void 0&&f.dep===u){f.version=d,l.depsTail=f;return}const p=u.subsTail;if(p!==void 0&&p.version===d&&p.sub===l)return;const x=l.depsTail=u.subsTail={version:d,dep:u,sub:l,prevDep:h,nextDep:f,prevSub:p,nextSub:void 0};f!==void 0&&(f.prevDep=x),h!==void 0?h.nextDep=x:l.deps=x,p!==void 0?p.nextSub=x:u.subs=x}function s(u,l=u.sub){const d=u.dep,h=u.prevDep,f=u.nextDep,p=u.nextSub,x=u.prevSub;return f!==void 0?f.prevDep=h:l.depsTail=h,h!==void 0?h.nextDep=f:l.deps=f,p!==void 0?p.prevSub=x:d.subsTail=x,x!==void 0?x.nextSub=p:(d.subs=p)===void 0&&n(d),f}function a(u){let l=u.nextSub,d;e:do{const h=u.sub;let f=h.flags;if(f&60?f&12?f&4?!(f&48)&&c(u,h)?(h.flags=f|40,f&=1):f=0:h.flags=f&-9|32:f=0:h.flags=f|32,f&2&&t(h),f&1){const p=h.subs;if(p!==void 0){const x=(u=p).nextSub;x!==void 0&&(d={value:l,prev:d},l=x);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,f=!1;e:do{const p=u.dep,x=p.flags;if(l.flags&16)f=!0;else if((x&17)===17){if(e(p)){const g=p.subs;g.nextSub!==void 0&&i(g),f=!0}}else if((x&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(d={value:u,prev:d}),u=p.deps,l=p,++h;continue}if(!f){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,f){if(e(l)){b&&i(g),l=u.sub;continue}f=!1}else l.flags&=-33;l=u.sub;const y=u.nextDep;if(y!==void 0){u=y;continue e}}return f}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 Hw=0,ji=0,wh=0;const ro=[],{link:W$e,unlink:U3,propagate:Y$e,checkDirty:VU,shallowPropagate:J$e}=z3({update(e){return e.depsTail!==void 0?YU(e):JU(e)},notify(e){let t=wh,n=t;do if(ro[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(wh=t;n<--t;){const r=ro[n];ro[n++]=ro[t],ro[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Y0(e)):ZU.call(e)}});function GU(){return Hw}function KU(){++Hw}function WU(){--Hw||XU()}function YU(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,Y0(e)}}function JU(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function QU(e){const t=e.flags;if(t&16||t&32&&VU(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Y0(e)}}else e.flags=2}function XU(){try{for(;ji<wh;){const e=ro[ji];ro[ji++]=void 0,QU(e)}}finally{for(;ji<wh;){const e=ro[ji];ro[ji++]=void 0,e.flags|=10}ji=0,wh=0}}function ZU(){this.depsTail=void 0,this.flags=0,Y0(this);const e=this.subs;e!==void 0&&U3(e)}function Y0(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=U3(n,e)}function qw(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 i_=[];let Ig=0;const{link:t2,unlink:e7,propagate:t7,checkDirty:H3,shallowPropagate:n2}=z3({update(e){return e._update()},notify(e){i_[c_++]=e,e.flags&=~Gt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Gt.Mutable|Gt.Dirty,ub(e))}});let Jm=0,c_=0,ya;function ub(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=e7(n,e)}function q3(){if(!(GU()>0)){for(;Jm<c_;){const e=i_[Jm];i_[Jm++]=void 0,e.notify()}Jm=0,c_=0}}function V3(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?Gt.None:Gt.Mutable,get(){return ya!==void 0&&t2(s,ya,Ig),s._snapshot},subscribe(a){const o=qw(a),i={current:!1},c=n7(()=>{s.get(),i.current?o.next?.(s._snapshot):i.current=!0});return{unsubscribe:()=>{c.stop()}}},_update(a){const o=ya,i=Object.is;if(n)ya=s,++Ig,s.depsTail=void 0;else if(a===void 0)return!1;n&&(s.flags=Gt.Mutable|Gt.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{ya=o,n&&(s.flags&=~Gt.RecursedCheck),ub(s)}}};return n?(s.flags=Gt.Mutable|Gt.Dirty,s.get=function(){const a=s.flags;if(a&Gt.Dirty||a&Gt.Pending&&H3(s.deps,s)){if(s._update()){const o=s.subs;o!==void 0&&n2(o)}}else a&Gt.Pending&&(s.flags=a&~Gt.Pending);return ya!==void 0&&t2(s,ya,Ig),s._snapshot}):s.set=function(a){if(s._update(a)){const o=s.subs;o!==void 0&&(t7(o),n2(o),q3())}},s}function n7(e){const t=()=>{const r=ya;ya=n,++Ig,n.depsTail=void 0,n.flags=Gt.Watching|Gt.RecursedCheck;try{return e()}finally{ya=r,n.flags&=~Gt.RecursedCheck,ub(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Gt.Watching|Gt.RecursedCheck,notify(){const r=this.flags;r&Gt.Dirty||r&Gt.Pending&&H3(this.deps,this)?t():this.flags=Gt.Watching},stop(){this.flags=Gt.None,this.depsTail=void 0,ub(this)}};return t(),n}class r7{constructor(t){this.atom=V3(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(qw(t))}}class s7{constructor(t){this.atom=V3(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(qw(t))}}function a7(e){return typeof e=="function"?new s7(e):new r7(e)}function o7(e){try{KU(),e()}finally{WU(),q3()}}const Zo="__TSR_index",r2="popstate",s2="beforeunload";function i7(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 f=lb(c.path,c.state);if(await h.blockerFn({currentLocation:t,nextLocation:f,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[Zo];i=a2(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[Zo];i=a2(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[Zo]!==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 a2(e,t){t||(t={});const n=Vw();return{...t,key:n,__TSR_key:n,[Zo]:e}}function c7(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let s=[];const a=()=>s,o=I=>s=I,i=(I=>I),c=(()=>lb(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const I=Vw();t.history.replaceState({[Zo]:0,key:I,__TSR_key:I},"")}let u=c(),l,d=!1,h=!1,f=!1,p=!1;const x=()=>u;let g,b;const y=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,"",g.href),C._ignoreSubscribers=!1,g=void 0,b=void 0,l=void 0)},_=(I,R,N)=>{const z=i(R);b||(l=u),u=lb(R,N),g={href:z,state:N,isPush:g?.isPush||I==="push"},b||(b=Promise.resolve().then(()=>y()))},S=I=>{u=c(),C.notify({type:I})},w=async()=>{if(h){h=!1;return}const I=c(),R=I.state[Zo]-u.state[Zo],N=R===1,z=R===-1,V=!N&&!z||d;d=!1;const ne=V?"GO":z?"BACK":"FORWARD",J=V?{type:"GO",index:R}:{type:z?"BACK":"FORWARD"};if(f)f=!1;else{const te=a();if(typeof document<"u"&&te.length){for(const se of te)if(await se.blockerFn({currentLocation:u,nextLocation:I,action:ne})){h=!0,t.history.go(1),C.notify(J);return}}}u=c(),C.notify(J)},v=I=>{if(p){p=!1;return}let R=!1;const N=a();if(typeof document<"u"&&N.length)for(const z of N){const V=z.enableBeforeUnload??!0;if(V===!0){R=!0;break}if(typeof V=="function"&&V()===!0){R=!0;break}}if(R)return I.preventDefault(),I.returnValue=""},C=i7({getLocation:x,getLength:()=>t.history.length,pushState:(I,R)=>_("push",I,R),replaceState:(I,R)=>_("replace",I,R),back:I=>(I&&(f=!0),p=!0,t.history.back()),forward:I=>{I&&(f=!0),p=!0,t.history.forward()},go:I=>{d=!0,t.history.go(I)},createHref:I=>i(I),flush:y,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(s2,v,{capture:!0}),t.removeEventListener(r2,w)},onBlocked:()=>{l&&u!==l&&(u=l)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(s2,v,{capture:!0}),t.addEventListener(r2,w),t.history.pushState=function(...I){const R=n.apply(t.history,I);return C._ignoreSubscribers||S("PUSH"),R},t.history.replaceState=function(...I){const R=r.apply(t.history,I);return C._ignoreSubscribers||S("REPLACE"),R},C}function u7(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function lb(e,t){const n=u7(e),r=n.indexOf("#"),s=n.indexOf("?"),a=Vw();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||{[Zo]:0,key:a,__TSR_key:a}}}function Vw(){return(Math.random()+1).toString(36).substring(7)}const l7=!1;function Sh(e){let t;return o7(()=>{t=e()}),t}function rf(e){return e[e.length-1]}function d7(e){return typeof e=="function"}function Go(e,t){return d7(e)?e(t):e}const h7=Object.prototype.hasOwnProperty,o2=Object.prototype.propertyIsEnumerable;function Wr(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=t,s=u2(e)&&u2(r);if(!s&&!(db(e)&&db(r)))return r;const a=s?e:i2(e);if(!a)return r;const o=s?r:i2(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],f=e[h],p=r[h];if(f===p){u[h]=f,(s?d<i:h7.call(e,h))&&l++;continue}if(f===null||p===null||typeof f!="object"||typeof p!="object"){u[h]=p;continue}const x=Wr(f,p,n+1);u[h]=x,x===f&&l++}return i===c&&l===i?e:u}function i2(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!o2.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(!o2.call(e,s))return!1;r.push(s)}return r}function db(e){if(!c2(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!c2(n)||!n.hasOwnProperty("isPrototypeOf"))}function c2(e){return Object.prototype.toString.call(e)==="[object Object]"}function u2(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function mc(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(!mc(e[r],t[r],n))return!1;return!0}if(db(e)&&db(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const o in t)if((!r||t[o]!==void 0)&&!mc(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||!mc(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 sf(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function f7(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function l2(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 f7(t)}const m7=["http:","https:","mailto:","tel:"];function hb(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Td(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+=l2(e.slice(n,s.index))+s[0],n=t.lastIndex;r=r+l2(n?e.slice(n):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function p7(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var g7="Invariant failed";function mi(e,t){if(!e)throw new Error(g7)}function fb(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 fl=0,Ec=1,Tc=2,af=3,ac=4,G3=5;function b7(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 Gw(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]=fl,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]=Tc,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}if(a.charCodeAt(0)===36)return n[0]=Ec,n[1]=t,n[2]=t+1,n[3]=s,n[4]=s,n[5]=s,n;const o=b7(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]=af,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]=Tc,n[1]=t+i,n[2]=t+l,n[3]=t+d,n[4]=t+c+1,n[5]=e.length,n):(n[0]=Ec,n[1]=t+i,n[2]=t+d,n[3]=t+c,n[4]=t+c+1,n[5]=s,n)}}return n[0]=fl,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n}function J0(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 f=Gw(c,i,t);let p;const x=i,g=f[5];switch(i=g+1,a++,f[0]){case fl:{const y=c.substring(f[2],f[3]);if(l){const _=s.static?.get(y);if(_)p=_;else{s.static??=new Map;const S=oc(n.fullPath??n.from);S.parent=s,S.depth=a,p=S,s.static.set(y,S)}}else{const _=y.toLowerCase(),S=s.staticInsensitive?.get(_);if(S)p=S;else{s.staticInsensitive??=new Map;const w=oc(n.fullPath??n.from);w.parent=s,w.depth=a,p=w,s.staticInsensitive.set(_,w)}}break}case Ec:{const y=c.substring(x,f[1]),_=c.substring(f[4],g),S=l&&!!(y||_),w=y?S?y:y.toLowerCase():void 0,v=_?S?_:_.toLowerCase():void 0,C=!d&&s.dynamic?.find(I=>!I.skipOnParamError&&I.caseSensitive===S&&I.prefix===w&&I.suffix===v);if(C)p=C;else{const I=uk(Ec,n.fullPath??n.from,S,w,v);p=I,I.depth=a,I.parent=s,s.dynamic??=[],s.dynamic.push(I)}break}case af:{const y=c.substring(x,f[1]),_=c.substring(f[4],g),S=l&&!!(y||_),w=y?S?y:y.toLowerCase():void 0,v=_?S?_:_.toLowerCase():void 0,C=!d&&s.optional?.find(I=>!I.skipOnParamError&&I.caseSensitive===S&&I.prefix===w&&I.suffix===v);if(C)p=C;else{const I=uk(af,n.fullPath??n.from,S,w,v);p=I,I.parent=s,I.depth=a,s.optional??=[],s.optional.push(I)}break}case Tc:{const y=c.substring(x,f[1]),_=c.substring(f[4],g),S=l&&!!(y||_),w=y?S?y:y.toLowerCase():void 0,v=_?S?_:_.toLowerCase():void 0,C=uk(Tc,n.fullPath??n.from,S,w,v);p=C,C.parent=s,C.depth=a,s.wildcard??=[],s.wildcard.push(C)}}s=p}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const f=oc(n.fullPath??n.from);f.kind=G3,f.parent=s,a++,f.depth=a,s.pathless??=[],s.pathless.push(f),s=f}const h=(n.path||!n.children)&&!n.isRoot;if(h&&c.endsWith("/")){const f=oc(n.fullPath??n.from);f.kind=ac,f.parent=s,a++,f.depth=a,s.index=f,s=f}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)J0(e,t,c,i,s,a,o)}function ck(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 Ho(e){if(e.pathless)for(const t of e.pathless)Ho(t);if(e.static)for(const t of e.static.values())Ho(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Ho(t);if(e.dynamic?.length){e.dynamic.sort(ck);for(const t of e.dynamic)Ho(t)}if(e.optional?.length){e.optional.sort(ck);for(const t of e.optional)Ho(t)}if(e.wildcard?.length){e.wildcard.sort(ck);for(const t of e.wildcard)Ho(t)}}function oc(e){return{kind:fl,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 uk(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 y7(e,t){const n=oc("/"),r=new Uint16Array(6);for(const s of e)J0(!1,r,s,1,n,0);Ho(n),t.masksTree=n,t.flatCache=fb(1e3)}function k7(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=Kw(e,t.masksTree);return t.flatCache.set(e,r),r}function x7(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);J0(t,i,{from:e},1,o,0),s.singleCache.set(a,o)}return Kw(r,o,n)}function _7(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=Kw(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)a=null;else throw o}return a&&(a.branch=S7(a.route)),t.matchCache.set(r,a),a}function v7(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function w7(e,t=!1,n){const r=oc(e.fullPath),s=new Uint16Array(6),a={},o={};let i=0;return J0(t,s,e,1,r,0,u=>{if(n?.(u,i),mi(!(u.id in a),`Duplicate routes found with id: ${String(u.id)}`),a[u.id]=u,i!==0&&u.path){const l=v7(u.fullPath);(!o[l]||u.fullPath.endsWith("/"))&&(o[l]=u)}i++}),Ho(r),{processedTree:{segmentTree:r,singleCache:fb(1e3),matchCache:fb(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Kw(e,t,n=!1){const r=e.split("/"),s=T7(e,r,t,n);if(!s)return null;const[a]=K3(e,r,s);return{route:s.node.route,rawParams:a,parsedParams:s.parsedParams}}function K3(e,t,n){const r=E7(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===ac)break;if(l.kind===G3){u--,o--,c--;continue}const d=t[o],h=c;if(d&&(c+=d.length),l.kind===Ec){s??=n.node.fullPath.split("/");const f=s[u],p=l.prefix?.length??0;if(f.charCodeAt(p)===123){const g=l.suffix?.length??0,b=f.substring(p+2,f.length-g-1),y=d.substring(p,d.length-g);a[b]=decodeURIComponent(y)}else{const g=f.substring(1);a[g]=decodeURIComponent(d)}}else if(l.kind===af){if(n.skipped&1<<i){o--,c=h-1;continue}s??=n.node.fullPath.split("/");const f=s[u],p=l.prefix?.length??0,x=l.suffix?.length??0,g=f.substring(p+3,f.length-x-1),b=l.suffix||l.prefix?d.substring(p,d.length-x):d;b&&(a[g]=decodeURIComponent(b))}else if(l.kind===Tc){const f=l,p=e.substring(h+(f.prefix?.length??0),e.length-(f.suffix?.length??0)),x=decodeURIComponent(p);a["*"]=x,a._splat=x;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:i,path:c,segment:u}]}function S7(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function E7(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function T7(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const s=!rf(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:f,skipped:p,depth:x,statics:g,dynamics:b,optionals:y}=d;let{extract:_,rawParams:S,parsedParams:w}=d;if(h.skipOnParamError){if(!lk(e,t,d))continue;S=d.rawParams,_=d.extract,w=d.parsedParams}r&&h.route&&h.kind!==ac&&Cd(u,d)&&(u=d);const v=f===o;if(v&&(h.route&&!a&&Cd(l,d)&&(l=d),!h.optional&&!h.wildcard&&!h.index&&!h.pathless))continue;const C=v?void 0:t[f];let I;if(v&&h.index){const R={node:h.index,index:f,skipped:p,depth:x+1,statics:g,dynamics:b,optionals:y,extract:_,rawParams:S,parsedParams:w};let N=!0;if(h.index.skipOnParamError&&(lk(e,t,R)||(N=!1)),N){if(g===o&&!b&&!y&&!p)return R;Cd(l,R)&&(l=R)}}if(h.wildcard&&Cd(c,d))for(const R of h.wildcard){const{prefix:N,suffix:z}=R;if(N&&(v||!(R.caseSensitive?C:I??=C.toLowerCase()).startsWith(N)))continue;if(z){if(v)continue;const ne=t.slice(f).join("/").slice(-z.length);if((R.caseSensitive?ne:ne.toLowerCase())!==z)continue}const V={node:R,index:o,skipped:p,depth:x,statics:g,dynamics:b,optionals:y,extract:_,rawParams:S,parsedParams:w};if(!(R.skipOnParamError&&!lk(e,t,V))){c=V;break}}if(h.optional){const R=p|1<<x,N=x+1;for(let z=h.optional.length-1;z>=0;z--){const V=h.optional[z];i.push({node:V,index:f,skipped:R,depth:N,statics:g,dynamics:b,optionals:y,extract:_,rawParams:S,parsedParams:w})}if(!v)for(let z=h.optional.length-1;z>=0;z--){const V=h.optional[z],{prefix:ne,suffix:J}=V;if(ne||J){const te=V.caseSensitive?C:I??=C.toLowerCase();if(ne&&!te.startsWith(ne)||J&&!te.endsWith(J))continue}i.push({node:V,index:f+1,skipped:p,depth:N,statics:g,dynamics:b,optionals:y+1,extract:_,rawParams:S,parsedParams:w})}}if(!v&&h.dynamic&&C)for(let R=h.dynamic.length-1;R>=0;R--){const N=h.dynamic[R],{prefix:z,suffix:V}=N;if(z||V){const ne=N.caseSensitive?C:I??=C.toLowerCase();if(z&&!ne.startsWith(z)||V&&!ne.endsWith(V))continue}i.push({node:N,index:f+1,skipped:p,depth:x+1,statics:g,dynamics:b+1,optionals:y,extract:_,rawParams:S,parsedParams:w})}if(!v&&h.staticInsensitive){const R=h.staticInsensitive.get(I??=C.toLowerCase());R&&i.push({node:R,index:f+1,skipped:p,depth:x+1,statics:g+1,dynamics:b,optionals:y,extract:_,rawParams:S,parsedParams:w})}if(!v&&h.static){const R=h.static.get(C);R&&i.push({node:R,index:f+1,skipped:p,depth:x+1,statics:g+1,dynamics:b,optionals:y,extract:_,rawParams:S,parsedParams:w})}if(h.pathless){const R=x+1;for(let N=h.pathless.length-1;N>=0;N--){const z=h.pathless[N];i.push({node:z,index:f,skipped:p,depth:R,statics:g,dynamics:b,optionals:y,extract:_,rawParams:S,parsedParams:w})}}}if(l&&c)return Cd(c,l)?l:c;if(l)return l;if(c)return c;if(r&&u){let d=u.index;for(let f=0;f<u.index;f++)d+=t[f].length;const h=d===e.length?"/":e.slice(d);return u.rawParams??={},u.rawParams["**"]=decodeURIComponent(h),u}return null}function lk(e,t,n){try{const[r,s]=K3(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 Cd(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===ac)>(e.node.kind===ac)||t.node.kind===ac==(e.node.kind===ac)&&t.depth>e.depth))):!0}function Ag(e){return Ww(e.filter(t=>t!==void 0).join("/"))}function Ww(e){return e.replace(/\/{2,}/g,"/")}function W3(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function ei(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function Y3(e){return ei(W3(e))}function mb(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function C7(e,t,n){return mb(e,n)===mb(t,n)}function I7({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&&rf(i)==="";)i.pop();const d=t.split("/");for(let h=0,f=d.length;h<f;h++){const p=d[h];p===""?h?h===f-1&&i.push(p):i=[p]:p===".."?i.pop():p==="."||i.push(p)}}i.length>1&&(rf(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=Gw(h,0,c);const f=c[0];if(f===fl){u+=h;continue}const p=c[5],x=h.substring(0,c[1]),g=h.substring(c[4],p),b=h.substring(c[2],c[3]);f===Ec?u+=x||g?`${x}{$${b}}${g}`:`$${b}`:f===Tc?u+=x||g?`${x}{$}${g}`:"$":u+=`${x}{-$${b}}${g}`}u=Ww(u);const l=u||"/";return o&&r&&r.set(o,l),l}function A7(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 dk(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=>h2(s,n)).join("/"):h2(r,n)}function d2({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=Gw(e,d,c);const h=c[5];if(i=h+1,d===h)continue;const f=c[0];if(f===fl){u+="/"+e.substring(d,h);continue}if(f===Tc){const p=t._splat;a._splat=p,a["*"]=p;const x=e.substring(d,c[1]),g=e.substring(c[4],h);if(!p){s=!0,(x||g)&&(u+="/"+x+g);continue}const b=dk("_splat",t,n);u+="/"+x+b+g;continue}if(f===Ec){const p=e.substring(c[2],c[3]);!s&&!(p in t)&&(s=!0),a[p]=t[p];const x=e.substring(d,c[1]),g=e.substring(c[4],h),b=dk(p,t,n)??"undefined";u+="/"+x+b+g;continue}if(f===af){const p=e.substring(c[2],c[3]),x=t[p];if(x==null)continue;a[p]=x;const g=e.substring(d,c[1]),b=e.substring(c[4],h),y=dk(p,t,n)??"";u+="/"+g+y+b;continue}}return e.endsWith("/")&&(u+="/"),{usedParams:a,interpolatedPath:u||"/",isMissingParams:s}}function h2(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function jr(e){return!!e?.isNotFound}function N7(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const u_="tsr-scroll-restoration-v1_3",R7=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function P7(){const e=N7();if(!e)return null;const t=e.getItem(u_);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=Go(r,n)||n;try{e.setItem(u_,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Qm=P7(),O7=e=>e.state.__TSR_key||e.href;function L7(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 pb=!1;function $7({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];pb=!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 f=document.querySelector(d);f&&(f.scrollLeft=h.scrollX,f.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)}}pb=!1}function M7(e,t){if(!Qm||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Qm))return;e.isScrollRestorationSetup=!0,pb=!1;const r=e.options.getScrollRestorationKey||O7;window.history.scrollRestoration="manual";const s=a=>{if(pb||!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=L7(a.target)}const i=r(e.state.location);Qm.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",R7(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})||($7({storageKey:u_,key:o,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Qm.set(i=>(i[o]||={},i)))})}function j7(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 D7(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 hk(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function F7(e){const t=new URLSearchParams(e),n={};for(const[r,s]of t.entries()){const a=n[r];a==null?n[r]=hk(s):Array.isArray(a)?a.push(hk(s)):n[r]=[a,hk(s)]}return n}const B7=U7(JSON.parse),z7=H7(JSON.stringify,JSON.parse);function U7(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=F7(t);for(const r in n){const s=n[r];if(typeof s=="string")try{n[r]=e(s)}catch{}}return n}}function H7(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=D7(s,r);return a?`?${a}`:""}}const hs="__root__";function q7(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 Qr(e){return e instanceof Response&&!!e.options}const l_=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Q0=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Ju=(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},f2=(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},Ko=(e,t,n)=>{if(!(!Qr(n)&&!jr(n)))throw Qr(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:Qr(n)?"redirected":r.status==="pending"?"success":r.status,context:Ju(e,t.index),isFetching:!1,error:n})),jr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Qr(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},J3=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,Id=(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,Ko(e,e.router.getMatch(s),n);try{o.options.onError?.(n)}catch(i){n=i,Ko(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&&!Qr(n)&&!jr(n)&&(e.serialError??=n)},Q3=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const s=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!Q0(e,t)&&(n.options.loader||n.options.beforeLoad||Z3(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const o=setTimeout(()=>{l_(e)},s);r._nonReactive.pendingTimeout=o}},V7=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Q3(e,t,n,r);const s=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&Ko(e,a,a.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(s):s()},G7=(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&&Id(e,n,o,"PARSE_PARAMS"),i&&Id(e,n,i,"VALIDATE_SEARCH"),Q3(e,t,r,s);const c=new AbortController;let u=!1;const l=()=>{u||(u=!0,e.updateMatch(t,S=>({...S,isFetching:"beforeLoad",fetchCount:S.fetchCount+1,abortController:c})))},d=()=>{s._nonReactive.beforeLoadPromise?.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,S=>({...S,isFetching:!1}))};if(!r.options.beforeLoad){Sh(()=>{l(),d()});return}s._nonReactive.beforeLoadPromise=hl();const h={...Ju(e,n,!1),...s.__routeContext},{search:f,params:p,cause:x}=s,g=Q0(e,t),b={search:f,abortController:c,params:p,preload:g,context:h,location:e.location,navigate:S=>e.router.navigate({...S,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?"preload":x,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},y=S=>{if(S===void 0){Sh(()=>{l(),d()});return}(Qr(S)||jr(S))&&(l(),Id(e,n,S,"BEFORE_LOAD")),Sh(()=>{l(),e.updateMatch(t,w=>({...w,__beforeLoadContext:S})),d()})};let _;try{if(_=r.options.beforeLoad(b),sf(_))return l(),_.catch(S=>{Id(e,n,S,"BEFORE_LOAD")}).then(y)}catch(S){l(),Id(e,n,S,"BEFORE_LOAD")}y(_)},K7=(e,t)=>{const{id:n,routeId:r}=e.matches[t],s=e.router.looseRoutesById[r],a=()=>i(),o=()=>G7(e,n,t,s),i=()=>{if(J3(e,n))return;const c=V7(e,n,s);return sf(c)?c.then(o):o()};return a()},W7=(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}})},X3=(e,t,n,r,s)=>{const a=t[r-1],{params:o,loaderDeps:i,abortController:c,cause:u}=e.router.getMatch(n),l=Ju(e,r),d=Q0(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}},m2=async(e,t,n,r,s)=>{try{const a=e.router.getMatch(n);try{(!(l7??e.router.isServer)||a.ssr===!0)&&gb(s);const o=s.options.loader?.(X3(e,t,n,r,s)),i=s.options.loader&&sf(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;Ko(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:Ju(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:Ju(e,r)}));return}const c=a._nonReactive.minPendingPromise;c&&await c,jr(o)&&await s.options.notFoundComponent?.preload?.(),Ko(e,e.router.getMatch(n),o);try{s.options.onError?.(o)}catch(u){i=u,Ko(e,e.router.getMatch(n),u)}e.updateMatch(n,u=>({...u,error:i,context:Ju(e,r),status:"error",isFetching:!1}))}}catch(a){const o=e.router.getMatch(n);o&&(o._nonReactive.loaderPromise=void 0),Ko(e,o,a)}},Y7=async(e,t,n)=>{async function r(d,h,f,p){const x=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,y=typeof b=="function"?b(X3(e,t,s,n,p)):b,{status:_,invalid:S}=f;o=_==="success"&&(S||(y??x>g)),d&&p.options.preload===!1||(o&&!e.sync?(i=!0,(async()=>{try{await m2(e,t,s,n,p);const w=e.router.getMatch(s);w._nonReactive.loaderPromise?.resolve(),w._nonReactive.loadPromise?.resolve(),w._nonReactive.loaderPromise=void 0}catch(w){Qr(w)&&await e.router.navigate(w.options)}})()):(_!=="success"||o&&e.sync)&&await m2(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(!J3(e,s)){const d=e.router.getMatch(s),h=Q0(e,s);if(d._nonReactive.loaderPromise){if(d.status==="success"&&!e.sync&&!d.preload)return d;await d._nonReactive.loaderPromise;const f=e.router.getMatch(s),p=f._nonReactive.error||f.error;p&&Ko(e,f,p),f.status==="pending"&&await r(h,d,f,c)}else{const f=h&&!e.router.state.matches.some(x=>x.id===s),p=e.router.getMatch(s);p._nonReactive.loaderPromise=hl(),f!==p.preload&&e.updateMatch(s,x=>({...x,preload:f})),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 p2(e){const t=e,n=[];t.router.state.matches.some(h=>h._forcePending)&&l_(t);let r;for(let h=0;h<t.matches.length;h++){try{const f=K7(t,h);sf(f)&&await f}catch(f){if(Qr(f))throw f;if(jr(f))r=f;else if(!t.preload)throw f;break}if(t.serialError)break}const s=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?f2(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(Y7(t,n,h));try{await Promise.all(n)}catch{const h=await Promise.allSettled(n);for(const f of h){if(f.status!=="rejected")continue;const p=f.reason;if(Qr(p))throw p;jr(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=f2(t,u);mi(h!==void 0);const f=t.matches[h],p=t.router.looseRoutesById[f.routeId],x=t.router.options?.defaultNotFoundComponent;!p.options.notFoundComponent&&x&&(p.options.notFoundComponent=x),u.routeId=f.routeId;const g=f.routeId===t.router.routeTree.id;t.updateMatch(f.id,b=>({...b,...g?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:u},isFetching:!1})),l=h,await gb(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 gb(h)}for(let h=0;h<=l;h++){const f=t.matches[h],{id:p,routeId:x}=f,g=t.router.looseRoutesById[x];try{const b=W7(t,p,g);if(b){const y=await b;t.updateMatch(p,_=>({..._,...y}))}}catch(b){console.error(`Error executing head for route ${x}:`,b)}}const d=l_(t);if(sf(d)&&await d,u)throw u;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}async function gb(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 eL){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 Z3(e){for(const t of eL)if(e.options[t]?.preload)return!0;return!1}const eL=["component","errorComponent","pendingComponent","notFoundComponent"];function J7(e){return{input:({url:t})=>{for(const n of e)t=d_(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=tL(e[n],t);return t}}}function Q7(e){const t=Y3(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=Ag(["/",t,o.pathname]),o)}}function d_(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 tL(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 pc(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 X7(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}class Z7{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=A7(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=c7()),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=fb(1e3),h=this.buildRouteTree(),this.setRoutes(h)}!this.__store&&this.latestLocation&&(this.__store=a7(tH(this.latestLocation)),M7(this));let i=!1;const c=this.options.basepath??"/",u=this.options.rewrite;if(a||s!==c||o!==u){this.basepath=c;const h=[],f=Y3(c);f&&f!=="/"&&h.push(Q7({basepath:c})),u&&h.push(u),this.rewrite=h.length===0?void 0:h.length===1?h[0]:J7(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=w7(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&y7(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 y=this.options.parseSearch(u),_=this.options.stringifySearch(y);return{href:c+_+l,publicHref:d,pathname:Td(c).path,external:!1,searchStr:_,search:Wr(r?.search,y),hash:Td(l.slice(1)).path,state:Wr(r?.state,h)}}const f=new URL(d,this.origin),p=d_(this.rewrite,f),x=this.options.parseSearch(p.search),g=this.options.stringifySearch(x);return p.search=g,{href:p.href.replace(p.origin,""),publicHref:d,pathname:Td(p.pathname).path,external:!!this.rewrite&&p.origin!==this.origin,searchStr:g,search:Wr(r?.search,x),hash:Td(p.hash.slice(1)).path,state:Wr(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)=>I7({base:n,to:Ww(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=>nH({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,"."),f=a.params===!1||a.params===null?{}:(a.params??!0)===!0?d:Object.assign(d,Go(a.params,d)),p=this.getMatchedRoutes(h);let x=p.matchedRoutes;if((!p.foundRoute||p.foundRoute.path!=="/"&&p.routeParams["**"])&&this.options.notFoundRoute&&(x=[...x,this.options.notFoundRoute]),Object.keys(f).length>0)for(const z of x){const V=z.options.params?.stringify??z.options.stringifyParams;if(V)try{Object.assign(f,V(f))}catch{}}const b=n.leaveParams?h:Td(d2({path:h,params:f,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let y=l;if(n._includeValidateSearch&&this.options.search?.strict){const z={};x.forEach(V=>{if(V.options.validateSearch)try{Object.assign(z,Ng(V.options.validateSearch,{...z,...y}))}catch{}}),y=z}y=rH({search:y,dest:a,destRoutes:x,_includeValidateSearch:n._includeValidateSearch}),y=Wr(l,y);const _=this.options.stringifySearch(y),S=a.hash===!0?o.hash:a.hash?Go(a.hash,o.hash):void 0,w=S?`#${S}`:"";let v=a.state===!0?o.state:a.state?Go(a.state,o.state):{};v=Wr(o.state,v);const C=`${b}${_}${w}`;let I,R,N=!1;if(this.rewrite){const z=new URL(C,this.origin),V=tL(this.rewrite,z);I=z.href.replace(z.origin,""),V.origin!==this.origin?(R=V.href,N=!0):R=V.pathname+V.search+V.hash}else I=p7(C),R=I;return{publicHref:R,href:I,pathname:b,search:y,searchStr:_,state:v,hash:S??"",external:N,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=k7(i.pathname,this.processedTree);if(l){Object.assign(u,l.rawParams);const{from:d,params:h,...f}=l.route,p=h===!1||h===null?{}:(h??!0)===!0?u:Object.assign(u,Go(h,u));o={from:n.from,...f,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=mc(s.state,this.latestLocation.state);return c.forEach(l=>{delete s.state[l]}),u},o=ei(this.latestLocation.href)===ei(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=lb(i,{__TSR_index:n?d:d+1}),f=new URL(h.pathname,this.origin),p=d_(this.rewrite,f);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(hb(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",...pc({resolvedLocation:u,location:c})}),this.emit({type:"onBeforeLoad",...pc({resolvedLocation:u,location:c})}),await p2({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=[],f=[];Sh(()=>{this.__store.setState(p=>{const x=p.matches,g=p.pendingMatches||p.matches;return l=x.filter(b=>!g.some(y=>y.id===b.id)),d=x.filter(b=>!g.some(y=>y.routeId===b.routeId)),h=g.filter(b=>!x.some(y=>y.routeId===b.routeId)),f=g.filter(b=>x.some(y=>y.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"],[f,"onStay"]].forEach(([p,x])=>{p.forEach(g=>{this.looseRoutesById[g.routeId].options[x]?.(g)})})})})}})}catch(c){Qr(c)?(r=c,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):jr(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(pc({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:X7(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&&hb(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=gb,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)]);Sh(()=>{s.forEach(i=>{o.has(i.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,i]}))})});try{return s=await p2({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(Qr(i))return i.options.reloadDocument?void 0:await this.preloadRoute({...i.options,_fromLocation:r});jr(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=x7(a.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,i.pathname,this.processedTree);return!c||n.params&&!mc(c.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?mc(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??z7,parseSearch:t.parseSearch??B7,protocolAllowlist:t.protocolAllowlist??m7}),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["**"]:ei(t.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:c=!0);const u=c?aH(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 f=i[h],p=l[h-1];let x,g,b;{const J=p?.search??t.search,te=p?._strictSearch??void 0;try{const se=Ng(f.options.validateSearch,{...J})??void 0;x={...J,...se},g={...te,...se},b=void 0}catch(se){let oe=se;if(se instanceof bb||(oe=new bb(se.message,{cause:se})),n?.throwOnError)throw oe;x=J,g={},b=oe}}const y=f.options.loaderDeps?.({search:x})??"",_=y?JSON.stringify(y):"",{interpolatedPath:S,usedParams:w}=d2({path:f.fullPath,params:a,decoder:this.pathParamsDecoder,server:this.isServer}),v=f.id+S+_,C=this.getMatch(v),I=d.get(f.id),R=C?._strictParams??w;let N;if(!C)try{g2(f,w,o,R)}catch(J){if(jr(J)||Qr(J)?N=J:N=new eH(J.message,{cause:J}),n?.throwOnError)throw N}Object.assign(a,R);const z=I?"stay":"enter";let V;if(C)V={...C,cause:z,params:I?.params??a,_strictParams:R,search:Wr(I?I.search:C.search,x),_strictSearch:g};else{const J=f.options.loader||f.options.beforeLoad||f.lazyFn||Z3(f)?"pending":"success";V={id:v,ssr:f.options.ssr,index:h,routeId:f.id,params:I?.params??a,_strictParams:R,pathname:S,updatedAt:Date.now(),search:I?Wr(I.search,x):x,_strictSearch:g,searchError:void 0,status:J,isFetching:!1,error:void 0,paramsError:N,__routeContext:void 0,_nonReactive:{loadPromise:hl()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:z,loaderDeps:I?Wr(I.loaderDeps,y):y,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:f.options.staticData||{},fullPath:f.fullPath}}n?.preload||(V.globalNotFound=u===f.id),V.searchError=b;const ne=this.getParentContext(p);V.context={...ne,...V.__routeContext,...V.__beforeLoadContext},l[h]=V}for(let h=0;h<l.length;h++){const f=l[h],p=this.looseRoutesById[f.routeId],x=this.getMatch(f.id),g=d.get(f.routeId);if(f.params=g?Wr(g.params,a):a,!x){const b=l[h-1],y=this.getParentContext(b);if(p.options.context){const _={deps:f.loaderDeps,params:f.params,context:y??{},location:t,navigate:S=>this.navigate({...S,_fromLocation:t}),buildLocation:this.buildLocation,cause:f.cause,abortController:f.abortController,preload:!!f.preload,matches:l,routeId:p.id};f.__routeContext=p.options.context(_)??void 0}f.context={...y,...f.__routeContext,...f.__beforeLoadContext}}}return l}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:r,parsedParams:s}=this.getMatchedRoutes(t.pathname),a=rf(n),o={...t.search};for(const l of n)try{Object.assign(o,Ng(l.options.validateSearch,o))}catch{}const i=rf(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{g2(d,r,s??{},l)}catch{}u=l}return{matchedRoutes:n,fullPath:a.fullPath,search:o,params:u}}}class bb extends Error{}class eH extends Error{}function tH(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Ng(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new bb("Async validation not supported");if(n.issues)throw new bb(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 nH({pathname:e,routesById:t,processedTree:n}){const r={},s=ei(e);let a,o;const i=_7(s,n,!0);return i&&(a=i.route,Object.assign(r,i.rawParams),o=Object.assign({},i.parsedParams)),{matchedRoutes:i?.branch||[t[hs]],routeParams:r,foundRoute:a,parsedParams:o}}function rH({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return sH(n)(e,t,r??!1)}function sH(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,...Ng(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:Go(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 aH(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 hs}function g2(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 oH="Error preloading route! ☝️";class nL{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=hs:this.parentRoute||mi(!1);let a=s?hs:r?.path;a&&a!=="/"&&(a=W3(a));const o=r?.id||a;let i=s?hs:Ag([this.parentRoute.id===hs?"":this.parentRoute.id,o]);a===hs&&(a="/"),i!==hs&&(i=Ag(["/",i]));const c=i===hs?"/":Ag([this.parentRoute.fullPath,a]);this._path=a,this._id=i,this._fullPath=c,this._to=ei(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=>q7({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 iH extends nL{constructor(t){super(t)}}const Xm=typeof window<"u"?O.useLayoutEffect:O.useEffect;function fk(e){const t=O.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function cH(e,t,n={},r={}){O.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 uH(e){const t=O.useRef(null);return O.useImperativeHandle(e,()=>t.current,[]),t}function Yw(e){const t=e.errorComponent??Jw;return m.jsx(lH,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?O.createElement(t,{error:n,reset:r}):e.children})}class lH extends O.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 Jw({error:e}){const[t,n]=O.useState(!1);return m.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[m.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),m.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"})]}),m.jsx("div",{style:{height:".25rem"}}),t?m.jsx("div",{children:m.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?m.jsx("code",{children:e.message}):null})}):null]})}function dH({children:e,fallback:t=null}){return rL()?m.jsx(nf.Fragment,{children:e}):m.jsx(nf.Fragment,{children:t})}function rL(){return nf.useSyncExternalStore(hH,()=>!0,()=>!1)}function hH(){return()=>{}}var mk={exports:{}},pk={},gk={exports:{}},bk={};var b2;function fH(){if(b2)return bk;b2=1;var e=Uw();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 f=h(),p=r({inst:{value:f,getSnapshot:h}}),x=p[0].inst,g=p[1];return a(function(){x.value=f,x.getSnapshot=h,c(x)&&g({inst:x})},[d,f,h]),s(function(){return c(x)&&g({inst:x}),d(function(){c(x)&&g({inst:x})})},[d]),o(f),f}function c(d){var h=d.getSnapshot;d=d.value;try{var f=h();return!n(d,f)}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 bk.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,bk}var y2;function mH(){return y2||(y2=1,gk.exports=fH()),gk.exports}var k2;function pH(){if(k2)return pk;k2=1;var e=Uw(),t=mH();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 pk.useSyncExternalStoreWithSelector=function(u,l,d,h,f){var p=a(null);if(p.current===null){var x={hasValue:!1,value:null};p.current=x}else x=p.current;p=i(function(){function b(v){if(!y){if(y=!0,_=v,v=h(v),f!==void 0&&x.hasValue){var C=x.value;if(f(C,v))return S=C}return S=v}if(C=S,r(_,v))return C;var I=h(v);return f!==void 0&&f(C,I)?(_=v,C):(_=v,S=I)}var y=!1,_,S,w=d===void 0?null:d;return[function(){return b(l())},w===null?void 0:function(){return b(w())}]},[l,d,h,f]);var g=s(u,p[0],p[1]);return o(function(){x.hasValue=!0,x.value=g},[g]),c(g),g},pk}var x2;function gH(){return x2||(x2=1,mk.exports=pH()),mk.exports}var bH=gH();function yH(e,t){return e===t}function kH(e,t,n=yH){const r=O.useCallback(o=>{if(!e)return()=>{};const{unsubscribe:i}=e.subscribe(o);return i},[e]),s=O.useCallback(()=>e?.get(),[e]);return bH.useSyncExternalStoreWithSelector(r,s,s,t,n)}const sL=O.createContext(null);function ss(e){const t=O.useContext(sL);return e?.warn,t}function Zr(e){const t=ss({warn:e?.router===void 0}),n=e?.router||t,r=O.useRef(void 0);return kH(n.__store,s=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const a=Wr(r.current,e.select(s));return r.current=a,a}return e.select(s)}return s})}const X0=O.createContext(void 0),xH=O.createContext(void 0);function Na(e){const t=O.useContext(e.from?xH:X0);return Zr({select:r=>{const s=r.matches.find(a=>e.from?e.from===a.routeId:a.id===t);if(mi(!((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 Qw(e){return Na({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Xw(e){const{select:t,...n}=e;return Na({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Zw(e){return Na({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 eS(e){return Na({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Ul(e){const t=ss();return O.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var tS=HU();function _H(e,t){const n=ss(),r=uH(t),{activeProps:s,inactiveProps:a,activeOptions:o,to:i,preload:c,preloadDelay:u,hashScrollIntoView:l,replace:d,startTransition:h,resetScroll:f,viewTransition:p,children:x,target:g,disabled:b,style:y,className:_,onClick:S,onBlur:w,onFocus:v,onMouseEnter:C,onMouseLeave:I,onTouchStart:R,ignoreBlocker:N,params:z,search:V,hash:ne,state:J,mask:te,reloadDocument:se,unsafeRelative:oe,from:me,_fromLocation:Xe,...T}=e,q=rL(),X=Zr({select:Z=>{const ue=Z.matches[Z.matches.length-1];return{search:ue?.search,hash:Z.location.hash,path:ue?.pathname}},structuralSharing:!0}),A=e.from,P=O.useMemo(()=>({...e,from:A}),[n,X,A,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),D=O.useMemo(()=>n.buildLocation({...P}),[n,P]),Y=D.maskedLocation?D.maskedLocation.publicHref:D.publicHref,ke=D.maskedLocation?D.maskedLocation.external:D.external,ye=O.useMemo(()=>CH(Y,ke,n.history,b),[b,ke,Y,n.history]),we=O.useMemo(()=>{if(ye?.external)return hb(ye.href,n.protocolAllowlist)?void 0:ye.href;if(!IH(i)&&!(typeof i!="string"||i.indexOf(":")===-1))try{return new URL(i),hb(i,n.protocolAllowlist)?void 0:i}catch{}},[i,ye,n.protocolAllowlist]),Oe=Zr({select:Z=>{if(we)return!1;if(o?.exact){if(!C7(Z.location.pathname,D.pathname,n.basepath))return!1}else{const ue=mb(Z.location.pathname,n.basepath),Ae=mb(D.pathname,n.basepath);if(!(ue.startsWith(Ae)&&(ue.length===Ae.length||ue[Ae.length]==="/")))return!1}return(o?.includeSearch??!0)&&!mc(Z.location.search,D.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?q&&Z.location.hash===D.hash:!0}}),G=Oe?Go(s,{})??vH:yk,W=Oe?yk:Go(a,{})??yk,ae=[_,G.className,W.className].filter(Boolean).join(" "),ce=(y||G.style||W.style)&&{...y,...G.style,...W.style},[_e,Re]=O.useState(!1),H=O.useRef(!1),ie=e.reloadDocument||we?!1:c??n.options.defaultPreload,Se=u??n.options.defaultPreloadDelay??0,$e=O.useCallback(()=>{n.preloadRoute({...P,_builtLocation:D}).catch(Z=>{console.warn(Z),console.warn(oH)})},[n,P,D]),Je=O.useCallback(Z=>{Z?.isIntersecting&&$e()},[$e]);cH(r,Je,TH,{disabled:!!b||ie!=="viewport"}),O.useEffect(()=>{H.current||!b&&ie==="render"&&($e(),H.current=!0)},[b,$e,ie]);const Gn=Z=>{const ue=Z.currentTarget.getAttribute("target"),Ae=g!==void 0?g:ue;if(!b&&!AH(Z)&&!Z.defaultPrevented&&(!Ae||Ae==="_self")&&Z.button===0){Z.preventDefault(),tS.flushSync(()=>{Re(!0)});const Ce=n.subscribe("onResolved",()=>{Ce(),Re(!1)});n.navigate({...P,replace:d,resetScroll:f,hashScrollIntoView:l,startTransition:h,viewTransition:p,ignoreBlocker:N})}};if(we)return{...T,ref:r,href:we,...x&&{children:x},...g&&{target:g},...b&&{disabled:b},...y&&{style:y},..._&&{className:_},...S&&{onClick:S},...w&&{onBlur:w},...v&&{onFocus:v},...C&&{onMouseEnter:C},...I&&{onMouseLeave:I},...R&&{onTouchStart:R}};const hn=Z=>{if(b||ie!=="intent")return;if(!Se){$e();return}const ue=Z.currentTarget;if(Ad.has(ue))return;const Ae=setTimeout(()=>{Ad.delete(ue),$e()},Se);Ad.set(ue,Ae)},Os=Z=>{b||ie!=="intent"||$e()},Ur=Z=>{if(b||!ie||!Se)return;const ue=Z.currentTarget,Ae=Ad.get(ue);Ae&&(clearTimeout(Ae),Ad.delete(ue))};return{...T,...G,...W,href:ye?.href,ref:r,onClick:gu([S,Gn]),onBlur:gu([w,Ur]),onFocus:gu([v,hn]),onMouseEnter:gu([C,hn]),onMouseLeave:gu([I,Ur]),onTouchStart:gu([R,Os]),disabled:!!b,target:g,...ce&&{style:ce},...ae&&{className:ae},...b&&wH,...Oe&&SH,...q&&_e&&EH}}const yk={},vH={className:"active"},wH={role:"link","aria-disabled":!0},SH={"data-status":"active","aria-current":"page"},EH={"data-transitioning":"transitioning"},Ad=new WeakMap,TH={rootMargin:"100px"},gu=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function CH(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function IH(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const nr=O.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:s,...a}=_H(r,t),o=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;if(!n){const{disabled:i,...c}=a;return O.createElement("a",c,o)}return O.createElement(n,a,o)});function AH(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class NH extends nL{constructor(t){super(t),this.useMatch=n=>Na({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Na({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>eS({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Zw({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Xw({...n,from:this.id}),this.useLoaderData=n=>Qw({...n,from:this.id}),this.useNavigate=()=>Ul({from:this.fullPath}),this.Link=nf.forwardRef((n,r)=>m.jsx(nr,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function Yc(e){return new NH(e)}class RH extends iH{constructor(t){super(t),this.useMatch=n=>Na({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Na({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>eS({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Zw({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Xw({...n,from:this.id}),this.useLoaderData=n=>Qw({...n,from:this.id}),this.useNavigate=()=>Ul({from:this.fullPath}),this.Link=nf.forwardRef((n,r)=>m.jsx(nr,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function PH(e){return new RH(e)}function _2(e){return typeof e=="object"?new v2(e,{silent:!0}).createRoute(e):new v2(e,{silent:!0}).createRoute}class v2{constructor(t,n){this.path=t,this.createRoute=r=>{const s=Yc(r);return s.isRoot=!1,s},this.silent=n?.silent}}class w2{constructor(t){this.useMatch=n=>Na({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Na({from:this.options.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>eS({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Zw({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>Xw({...n,from:this.options.id}),this.useLoaderData=n=>Qw({...n,from:this.options.id}),this.useNavigate=()=>{const n=ss();return Ul({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function S2(e){return typeof e=="object"?new w2(e):t=>new w2({id:e,...t})}function OH(){const e=ss(),t=O.useRef({router:e,mounted:!1}),[n,r]=O.useState(!1),{hasPendingMatches:s,isLoading:a}=Zr({select:d=>({isLoading:d.isLoading,hasPendingMatches:d.matches.some(h=>h.status==="pending")}),structuralSharing:!0}),o=fk(a),i=a||n||s,c=fk(i),u=a||s,l=fk(u);return e.startTransition=d=>{r(!0),O.startTransition(()=>{d(),r(!1)})},O.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 ei(e.latestLocation.publicHref)!==ei(h.publicHref)&&e.commitLocation({...h,replace:!0}),()=>{d()}},[e,e.history]),Xm(()=>{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]),Xm(()=>{o&&!a&&e.emit({type:"onLoad",...pc(e.state)})},[o,e,a]),Xm(()=>{l&&!u&&e.emit({type:"onBeforeRouteMount",...pc(e.state)})},[u,l,e]),Xm(()=>{if(c&&!i){const d=pc(e.state);e.emit({type:"onResolved",...d}),e.__store.setState(h=>({...h,status:"idle",resolvedLocation:h.location})),d.hrefChanged&&j7(e)}},[i,c,e]),null}function LH(e){const t=Zr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return m.jsx(Yw,{getResetKey:()=>t,onCatch:(n,r)=>{if(jr(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(jr(n))return e.fallback?.(n);throw n},children:e.children})}function $H(){return m.jsx("p",{children:"Not Found"})}function Lu(e){return m.jsx(m.Fragment,{children:e.children})}function aL(e,t,n){return t.options.notFoundComponent?m.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?m.jsx(e.options.defaultNotFoundComponent,{...n}):m.jsx($H,{})}function MH(){return ss().isScrollRestoring,null}const oL=O.memo(function({matchId:t}){const n=ss(),r=Zr({select:x=>{const g=x.matches.findIndex(y=>y.id===t),b=x.matches[g];return mi(b),{routeId:b.routeId,ssr:b.ssr,_displayPending:b._displayPending,resetKey:x.loadedAt,parentRouteId:x.matches[g-1]?.routeId}},structuralSharing:!0}),s=n.routesById[r.routeId],a=s.options.pendingComponent??n.options.defaultPendingComponent,o=a?m.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))?O.Suspense:Lu,h=i?Yw:Lu,f=u?LH:Lu,p=s.isRoot?s.options.shellComponent??Lu:Lu;return m.jsxs(p,{children:[m.jsx(X0.Provider,{value:t,children:m.jsx(d,{fallback:o,children:m.jsx(h,{getResetKey:()=>r.resetKey,errorComponent:i||Jw,onCatch:(x,g)=>{if(jr(x))throw x;c?.(x,g)},children:m.jsx(f,{fallback:x=>{if(!u||x.routeId&&x.routeId!==r.routeId||!x.routeId&&!s.isRoot)throw x;return O.createElement(u,x)},children:l||r._displayPending?m.jsx(dH,{fallback:o,children:m.jsx(E2,{matchId:t})}):m.jsx(E2,{matchId:t})})})})}),r.parentRouteId===hs&&n.options.scrollRestoration?m.jsxs(m.Fragment,{children:[m.jsx(jH,{}),m.jsx(MH,{})]}):null]})});function jH(){const e=ss(),t=O.useRef(void 0);return m.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...pc(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const E2=O.memo(function({matchId:t}){const n=ss(),{match:r,key:s,routeId:a}=Zr({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=O.useMemo(()=>{const c=o.options.component??n.options.defaultComponent;return c?m.jsx(c,{},s):m.jsx(iL,{})},[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 mi(jr(r.error)),aL(n,o,r.error);if(r.status==="redirected")throw mi(Qr(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return i}),iL=O.memo(function(){const t=ss(),n=O.useContext(X0),r=Zr({select:u=>u.matches.find(l=>l.id===n)?.routeId}),s=t.routesById[r],a=Zr({select:u=>{const d=u.matches.find(h=>h.id===n);return mi(d),d.globalNotFound}}),o=Zr({select:u=>{const l=u.matches,d=l.findIndex(h=>h.id===n);return l[d+1]?.id}}),i=t.options.defaultPendingComponent?m.jsx(t.options.defaultPendingComponent,{}):null;if(a)return aL(t,s,void 0);if(!o)return null;const c=m.jsx(oL,{matchId:o});return r===hs?m.jsx(O.Suspense,{fallback:i,children:c}):c});function DH(){const e=ss(),n=e.routesById[hs].options.pendingComponent??e.options.defaultPendingComponent,r=n?m.jsx(n,{}):null,s=typeof document<"u"&&e.ssr?Lu:O.Suspense,a=m.jsxs(s,{fallback:r,children:[m.jsx(OH,{}),m.jsx(FH,{})]});return e.options.InnerWrap?m.jsx(e.options.InnerWrap,{children:a}):a}function FH(){const e=ss(),t=Zr({select:s=>s.matches[0]?.id}),n=Zr({select:s=>s.loadedAt}),r=t?m.jsx(oL,{matchId:t}):null;return m.jsx(X0.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:m.jsx(Yw,{getResetKey:()=>n,errorComponent:Jw,onCatch:void 0,children:r})})}function BH(){const e=ss();return Zr({select:t=>[t.location.href,t.resolvedLocation?.href,t.status],structuralSharing:!0}),O.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 zH=e=>new UH(e);class UH extends Z7{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=_2,globalThis.createLazyFileRoute=S2):typeof window<"u"&&(window.createFileRoute=_2,window.createLazyFileRoute=S2);function HH({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=m.jsx(sL.Provider,{value:e,children:t});return e.options.Wrap?m.jsx(e.options.Wrap,{children:r}):r}function qH({router:e,...t}){return m.jsx(HH,{router:e,...t,children:m.jsx(DH,{})})}const VH=e=>typeof e=="function",L=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)}}}},Ue=e=>e,Z0=e=>()=>e,T2=Z0(!0),fo=Z0(!1),cL=Z0(void 0),ml=cL;function F(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 C2="effect/GlobalValue";let Nd;const Fe=(e,t)=>(Nd||(globalThis[C2]??=new Map,Nd=globalThis[C2]),Nd.has(e)||Nd.set(e,t()),Nd.get(e)),Cn=e=>typeof e=="string",Js=e=>typeof e=="number",Cc=e=>typeof e=="boolean",ey=e=>typeof e=="bigint",h_=e=>typeof e=="symbol",Hl=VH,GH=e=>e===void 0,KH=e=>!1,nS=e=>typeof e=="object"&&e!==null,Qs=e=>nS(e)||Hl(e),Le=L(2,(e,t)=>Qs(e)&&t in e),uL=L(2,(e,t)=>Le(e,"_tag")&&e._tag===t),bu=e=>e==null,WH=e=>e!=null,YH=e=>e instanceof Uint8Array,JH=e=>e instanceof Date,lL=e=>typeof e=="string"||Le(e,Symbol.iterator),of=e=>nS(e)&&!Array.isArray(e),QH=e=>Le(e,"then")&&Hl(e.then),ty=e=>`BUG: ${e} - please report an issue at https://github.com/Effect-TS/effect/issues`;let dL=class hL{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 hL(this.self)}};const XH=335903614,ZH=4150755663,eq=1481765933,tq=1284865837,nq=9007199254740992,rq=134217728;class sq{_state;constructor(t,n,r,s){return bu(n)&&bu(t)?(n=Math.random()*4294967295>>>0,t=0):bu(n)&&(n=t,t=0),bu(s)&&bu(r)?(s=this._state?this._state[3]:ZH,r=this._state?this._state[2]:XH):bu(s)&&(s=r,r=0),this._state=new Int32Array([0,0,r>>>0,((s||0)|1)>>>0]),this._next(),I2(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*rq+n)/nq}_next(){const t=this._state[0]>>>0,n=this._state[1]>>>0;aq(this._state,t,n,eq,tq),I2(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 aq(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 I2(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 f_=Symbol.for("effect/Utils/YieldWrap");class Kf{#e;constructor(t){this.#e=t}[f_](){return this.#e}}function oq(e){if(typeof e=="object"&&e!==null&&f_ in e)return e[f_]();throw new Error(ty("yieldWrapGet"))}const cs=Fe("effect/Utils/isStructuralRegion",()=>({enabled:!1,tester:void 0})),fL={effect_internal_function:e=>e()},iq={effect_internal_function:e=>e()},cq=fL.effect_internal_function(()=>new Error().stack)?.includes("effect_internal_function")===!0,Qn=cq?fL.effect_internal_function:iq.effect_internal_function,kk=Fe(Symbol.for("effect/Hash/randomHashCache"),()=>new WeakMap),We=Symbol.for("effect/Hash"),Ne=e=>{if(cs.enabled===!0)return 0;switch(typeof e){case"number":return sS(e);case"bigint":return Yt(e.toString(10));case"boolean":return Yt(String(e));case"symbol":return Yt(String(e));case"string":return Yt(e);case"undefined":return Yt("undefined");case"function":case"object":return e===null?Yt("null"):e instanceof Date?Number.isNaN(e.getTime())?Yt("Invalid Date"):Ne(e.toISOString()):e instanceof URL?Ne(e.href):uq(e)?e[We]():rS(e);default:throw new Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},rS=e=>(kk.has(e)||kk.set(e,sS(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER))),kk.get(e)),ot=e=>t=>t*53^e,ny=e=>e&3221225471|e>>>1&1073741824,uq=e=>Le(e,We),sS=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 ny(t)},Yt=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return ny(t)},lq=(e,t)=>{let n=12289;for(let r=0;r<t.length;r++)n^=F(Yt(t[r]),ot(Ne(e[t[r]])));return ny(n)},mL=e=>lq(e,Object.keys(e)),Wf=e=>{let t=6151;for(let n=0;n<e.length;n++)t=F(t,ot(Ne(e[n])));return ny(t)},Ft=function(){if(arguments.length===1){const n=arguments[0];return function(r){return Object.defineProperty(n,We,{value(){return r},enumerable:!1}),r}}const e=arguments[0],t=arguments[1];return Object.defineProperty(e,We,{value(){return t},enumerable:!1}),t},Ye=Symbol.for("effect/Equal");function Be(){return arguments.length===1?e=>yb(e,arguments[0]):yb(arguments[0],arguments[1])}function yb(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(cf(e)&&cf(t))return Ne(e)===Ne(t)&&e[Ye](t)?!0:cs.enabled&&cs.tester?cs.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(cs.enabled){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((r,s)=>yb(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&&yb(e[a],t[a])))return cs.tester?cs.tester(e,t):!1;return!0}}return cs.tester?cs.tester(e,t):!1}}return cs.enabled&&cs.tester?cs.tester(e,t):!1}const cf=e=>Le(e,Ye),aS=()=>Be,ht=Symbol.for("nodejs.util.inspect.custom"),Wt=e=>{try{if(Le(e,"toJSON")&&Hl(e.toJSON)&&e.toJSON.length===0)return e.toJSON();if(Array.isArray(e))return e.map(Wt)}catch{return{}}return oS(e)},xk="[Circular]";function dq(e){try{return e.toISOString()}catch{return"Invalid Date"}}function hq(e){try{const t=e.toString();return typeof t=="string"?t:String(t)}catch{return"[toString threw]"}}function Yf(e){return Cn(e)?JSON.stringify(e):String(e)}function vo(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)?xk:(n.add(o),`[${o.map(c=>a(c,i)).join(",")}]`);if(JH(o))return dq(o);if(Le(o,"toString")&&Hl(o.toString)&&o.toString!==Object.prototype.toString&&o.toString!==Array.prototype.toString){const c=hq(o);return o instanceof Error&&o.cause?`${c} (cause: ${a(o.cause,i)})`:c}if(Cn(o))return JSON.stringify(o);if(Js(o)||o==null||Cc(o)||h_(o))return String(o);if(ey(o))return String(o)+"n";if(o instanceof Set||o instanceof Map)return n.has(o)?xk:(n.add(o),`${o.constructor.name}(${a(Array.from(o),i)})`);if(Qs(o)){if(n.has(o))return xk;n.add(o);const c=s(o);{const u=`{${c.map(l=>`${Yf(l)}:${a(o[l],i)}`).join(",")}}`;return r(o,u)}}return String(o)}return a(e,0)}const Lt=e=>JSON.stringify(e,null,2),ry={toJSON(){return Wt(this)},[ht](){return this.toJSON()},toString(){return Lt(this.toJSON())}};let fq=class{[ht](){return this.toJSON()}toString(){return Lt(this.toJSON())}};const pl=(e,t=2)=>{if(typeof e=="string")return e;try{return typeof e=="object"?pL(e,t):String(e)}catch{return String(e)}},pL=(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&&gL(a)?a[sy](gc.fiberRefs):a):a,t);return n=void 0,r},sy=Symbol.for("effect/Inspectable/Redactable"),gL=e=>typeof e=="object"&&e!==null&&sy in e,gc=Fe("effect/Inspectable/redactableState",()=>({fiberRefs:void 0})),mq=(e,t)=>{const n=gc.fiberRefs;gc.fiberRefs=e;try{return t()}finally{gc.fiberRefs=n}},oS=e=>gL(e)&&gc.fiberRefs!==void 0?e[sy](gc.fiberRefs):e,Ee=(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}}},Eh="Async",ay="Commit",Hn="Failure",Rg="OnFailure",kb="OnSuccess",xb="OnSuccessAndFailure",qn="Success",bL="Sync",pq="Tag",ql="UpdateRuntimeFlags",_b="While",Th="Iterator",yL="WithRuntime",Pg="Yield",iS="RevertFlags";let gq="3.19.19";const cS=()=>gq,bq=Symbol.for("effect/Effect"),yq=Symbol.for("effect/Stream"),kq=Symbol.for("effect/Sink"),xq=Symbol.for("effect/Channel"),gl={_R:e=>e,_E:e=>e,_A:e=>e,_V:cS()},_q={_A:e=>e,_In:e=>e,_L:e=>e,_E:e=>e,_R:e=>e},vq={_Env:e=>e,_InErr:e=>e,_InElem:e=>e,_InDone:e=>e,_OutErr:e=>e,_OutElem:e=>e,_OutDone:e=>e},Jf={[bq]:gl,[yq]:gl,[kq]:_q,[xq]:vq,[Ye](e){return this===e},[We](){return Ft(this,rS(this))},[Symbol.iterator](){return new dL(new Kf(this))},pipe(){return Ee(this,arguments)}},uS={[We](){return Ft(this,mL(this))},[Ye](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&&Be(this[r],e[r])))return!1;return!0}},Qf={...Jf,_op:ay},wq={...Qf,...uS},Sq=(function(){function e(){}return e.prototype=Qf,e})(),kL=Symbol.for("effect/Option"),xL={...Jf,[kL]:{_A:e=>e},[ht](){return this.toJSON()},toString(){return Lt(this.toJSON())}},Eq=Object.assign(Object.create(xL),{_tag:"Some",_op:"Some",[Ye](e){return _L(e)&&wL(e)&&Be(this.value,e.value)},[We](){return Ft(this,ot(Ne(this._tag))(Ne(this.value)))},toJSON(){return{_id:"Option",_tag:this._tag,value:Wt(this.value)}}}),Tq=Ne("None"),Cq=Object.assign(Object.create(xL),{_tag:"None",_op:"None",[Ye](e){return _L(e)&&vL(e)},[We](){return Tq},toJSON(){return{_id:"Option",_tag:this._tag}}}),_L=e=>Le(e,kL),vL=e=>e._tag==="None",wL=e=>e._tag==="Some",oy=Object.create(Cq),uf=e=>{const t=Object.create(Eq);return t.value=e,t},SL=Symbol.for("effect/Context/Tag"),vb=Symbol.for("effect/Context/Reference"),Iq="effect/STM",Aq=Symbol.for(Iq),lS={...Jf,_op:"Tag",[Aq]:gl,[SL]:{_Service:e=>e,_Identifier:e=>e},toString(){return Lt(this.toJSON())},toJSON(){return{_id:"Tag",key:this.key,stack:this.stack}},[ht](){return this.toJSON()},of(e){return e},context(e){return IL(this,e)}},Nq={...lS,[vb]:vb},Rq=e=>{const t=Error.stackTraceLimit;Error.stackTraceLimit=2;const n=new Error;Error.stackTraceLimit=t;const r=Object.create(lS);return Object.defineProperty(r,"stack",{get(){return n.stack}}),r.key=e,r},Pq=e=>()=>{const t=Error.stackTraceLimit;Error.stackTraceLimit=2;const n=new Error;Error.stackTraceLimit=t;function r(){}return Object.setPrototypeOf(r,lS),r.key=e,Object.defineProperty(r,"stack",{get(){return n.stack}}),r},Oq=()=>(e,t)=>{const n=Error.stackTraceLimit;Error.stackTraceLimit=2;const r=new Error;Error.stackTraceLimit=n;function s(){}return Object.setPrototypeOf(s,Nq),s.key=e,s.defaultValue=t.defaultValue,Object.defineProperty(s,"stack",{get(){return r.stack}}),s},EL=Symbol.for("effect/Context"),Lq={[EL]:{_Services:e=>e},[Ye](e){if(TL(e)&&this.unsafeMap.size===e.unsafeMap.size){for(const t of this.unsafeMap.keys())if(!e.unsafeMap.has(t)||!Be(this.unsafeMap.get(t),e.unsafeMap.get(t)))return!1;return!0}return!1},[We](){return Ft(this,sS(this.unsafeMap.size))},pipe(){return Ee(this,arguments)},toString(){return Lt(this.toJSON())},toJSON(){return{_id:"Context",services:Array.from(this.unsafeMap).map(Wt)}},[ht](){return this.toJSON()}},pi=e=>{const t=Object.create(Lq);return t.unsafeMap=e,t},$q=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},TL=e=>Le(e,EL),Mq=e=>Le(e,SL),CL=e=>Le(e,vb),jq=pi(new Map),Dq=()=>jq,IL=(e,t)=>pi(new Map([[e.key,t]])),Fq=L(3,(e,t,n)=>{const r=new Map(e.unsafeMap);return r.set(t.key,n),pi(r)}),_k=Fe("effect/Context/defaultValueCache",()=>new Map),iy=e=>{if(_k.has(e.key))return _k.get(e.key);const t=e.defaultValue();return _k.set(e.key,t),t},Bq=(e,t)=>e.unsafeMap.has(t.key)?e.unsafeMap.get(t.key):iy(t),AL=L(2,(e,t)=>{if(!e.unsafeMap.has(t.key)){if(vb in t)return iy(t);throw $q(t)}return e.unsafeMap.get(t.key)}),zq=AL,Uq=L(3,(e,t,n)=>e.unsafeMap.has(t.key)?e.unsafeMap.get(t.key):CL(t)?iy(t):n()),Hq=L(2,(e,t)=>e.unsafeMap.has(t.key)?uf(e.unsafeMap.get(t.key)):CL(t)?uf(iy(t)):oy),qq=L(2,(e,t)=>{const n=new Map(e.unsafeMap);for(const[r,s]of t.unsafeMap)n.set(r,s);return pi(n)}),Vq=(...e)=>{const t=new Map;for(let n=0;n<e.length;n++)e[n].unsafeMap.forEach((r,s)=>{t.set(s,r)});return pi(t)},Ti=Rq,Gq=pi,Kq=TL,NL=Mq,Xs=Dq,dS=IL,Yr=Fq,Gs=zq,Rd=Uq,RL=AL,Ci=Hq,Dr=qq,Wq=Vq,Ar=Pq,Jc=Oq,hS=e=>(t,n)=>t===n||e(t,n),Yq=L(2,(e,t)=>hS((n,r)=>e(t(n),t(r)))),Jq=e=>hS((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}),fS=Symbol.for("effect/Either"),PL={...Jf,[fS]:{_R:e=>e},[ht](){return this.toJSON()},toString(){return Lt(this.toJSON())}},Qq=Object.assign(Object.create(PL),{_tag:"Right",_op:"Right",[Ye](e){return mS(e)&&OL(e)&&Be(this.right,e.right)},[We](){return ot(Ne(this._tag))(Ne(this.right))},toJSON(){return{_id:"Either",_tag:this._tag,right:Wt(this.right)}}}),Xq=Object.assign(Object.create(PL),{_tag:"Left",_op:"Left",[Ye](e){return mS(e)&&pS(e)&&Be(this.left,e.left)},[We](){return ot(Ne(this._tag))(Ne(this.left))},toJSON(){return{_id:"Either",_tag:this._tag,left:Wt(this.left)}}}),mS=e=>Le(e,fS),pS=e=>e._tag==="Left",OL=e=>e._tag==="Right",Zq=e=>{const t=Object.create(Xq);return t.left=e,t},eV=e=>{const t=Object.create(Qq);return t.right=e,t},tV=e=>pS(e)?oy:uf(e.right),nV=fS,He=eV,ze=Zq,rV=e=>{if(Hl(e))try{return He(e())}catch(t){return ze(t)}else try{return He(e.try())}catch(t){return ze(e.catch(t))}},sV=mS,Dn=pS,_a=OL,LL=L(2,(e,t)=>Dn(e)?ze(t(e.left)):He(e.right)),aV=L(2,(e,t)=>_a(e)?He(t(e.right)):ze(e.left)),Lr=L(2,(e,{onLeft:t,onRight:n})=>Dn(e)?t(e.left):n(e.right)),oV=Lr({onLeft:Ue,onRight:Ue}),$L=L(2,(e,t)=>{if(_a(e))return e.right;throw t(e.left)}),ML=$L(()=>new Error("getOrThrow called on a Left")),jL=e=>e.length>0,DL=e=>(t,n)=>t===n?0:e(t,n),iV=DL((e,t)=>e<t?-1:1),FL=L(2,(e,t)=>DL((n,r)=>e(t(n),t(r)))),cV=e=>L(2,(t,n)=>e(t,n)===1),uV=Symbol.for("effect/Option"),fe=()=>oy,xe=uf,un=vL,kt=wL,ln=L(2,(e,{onNone:t,onSome:n})=>un(e)?t():n(e.value)),lV=tV,zt=L(2,(e,t)=>un(e)?t():e.value),Ta=L(2,(e,t)=>un(e)?t():e),dV=L(2,(e,t)=>un(e)?xe(t()):e),Vl=e=>e==null?fe():xe(e),_r=zt(cL),hV=e=>(...t)=>{try{return xe(e(...t))}catch{return fe()}},BL=L(2,(e,t)=>{if(kt(e))return e.value;throw t()}),fV=BL(()=>new Error("getOrThrow called on a None")),$r=L(2,(e,t)=>un(e)?fe():xe(t(e.value))),Ii=L(2,(e,t)=>un(e)?fe():t(e.value)),zL=L(2,(e,t)=>un(e)?fe():Vl(t(e.value))),mV=Ii,UL=L(2,(e,t)=>mV(e,n=>t(n)?uf(n):oy)),pV=e=>L(2,(t,n)=>un(t)?!1:e(t.value,n)),gV=aS(),bV=pV(gV),yV=L(2,(e,t)=>un(e)?!1:t(e.value)),kV=(...e)=>e,xV=()=>({}),_V=e=>HL(e).length===0,vV=L(2,(e,t)=>Object.prototype.hasOwnProperty.call(e,t)),Uu=L(2,(e,t)=>{const n={...e};for(const r of HL(e))n[r]=t(e[r],r);return n}),HL=e=>Object.keys(e),wV=L(3,(e,t,n)=>({...e,[t]:n})),cy=e=>new Array(e),SV=L(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}),wt=e=>Array.isArray(e)?e:Array.from(e),EV=e=>Array.isArray(e)?e:[e],TV=L(2,(e,{onEmpty:t,onNonEmpty:n})=>Qt(e)?n(e):t()),CV=L(2,(e,{onEmpty:t,onNonEmpty:n})=>Qt(e)?n(Cr(e),Ic(e)):t()),wb=L(2,(e,t)=>[t,...e]),IV=L(2,(e,t)=>[...e,t]),gS=L(2,(e,t)=>wt(e).concat(wt(t))),AV=Array.isArray,NV=e=>e.length===0,RV=NV,Qu=jL,Qt=jL,qL=(e,t)=>e<0||e>=t.length,PV=(e,t)=>Math.floor(Math.min(Math.max(0,e),t.length)),OV=L(2,(e,t)=>{const n=Math.floor(t);return qL(n,e)?fe():xe(e[n])}),VL=L(2,(e,t)=>{const n=Math.floor(t);if(qL(n,e))throw new Error(`Index ${n} out of bounds`);return e[n]}),Ch=OV(0),Cr=VL(0),LV=e=>Qt(e)?xe(GL(e)):fe(),GL=e=>e[e.length-1],Ic=e=>e.slice(1),$V=(e,t)=>{let n=0;for(const r of e){if(!t(r,n))break;n++}return n},MV=L(2,(e,t)=>KL(e,$V(e,t))),jV=L(2,(e,t)=>{const n=wt(e);return n.slice(PV(t,n),n.length)}),A2=e=>Array.from(e).reverse(),lf=L(2,(e,t)=>{const n=Array.from(e);return n.sort(t),n}),N2=L(2,(e,t)=>DV(e,t,kV)),DV=L(3,(e,t,n)=>{const r=wt(e),s=wt(t);if(Qt(r)&&Qt(s)){const a=[n(Cr(r),Cr(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[]}),FV=aS(),KL=L(2,(e,t)=>{const n=Array.from(e),r=Math.floor(t);return Qt(n)?r>=1?BV(n,r):[[],n]:[n,[]]}),BV=L(2,(e,t)=>{const n=Math.max(1,Math.floor(t));return n>=e.length?[ah(e),[]]:[wb(e.slice(1,n),Cr(e)),e.slice(n)]}),ah=e=>e.slice(),zV=L(3,(e,t,n)=>{const r=wt(e),s=wt(t);return Qt(r)?Qt(s)?JL(n)(gS(r,s)):r:s}),Og=L(2,(e,t)=>zV(e,t,FV)),gi=()=>[],Ms=e=>[e],bc=L(2,(e,t)=>e.map(t)),Sb=L(2,(e,t)=>{if(RV(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}),WL=Sb(Ue),YL=L(2,(e,t)=>{const n=wt(e),r=[];for(let s=0;s<n.length;s++){const a=t(n[s],s);kt(a)&&r.push(a.value)}return r}),UV=L(2,(e,t)=>{const n=wt(e),r=[];for(let s=0;s<n.length;s++)t(n[s],s)&&r.push(n[s]);return r}),bS=L(3,(e,t,n)=>wt(e).reduce((r,s,a)=>n(r,s,a),t)),R2=(e,t)=>{const n=[];let r=e,s;for(;kt(s=t(r));){const[a,o]=s.value;n.push(a),r=o}return n},uy=Jq,JL=L(2,(e,t)=>{const n=wt(e);if(Qt(n)){const r=[Cr(n)],s=Ic(n);for(const a of s)r.every(o=>!t(a,o))&&r.push(a);return r}return[]}),HV=e=>JL(e,aS()),Gl=L(2,(e,t)=>wt(e).join(t)),QL=Symbol.for("effect/Chunk");function qV(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 XL=[],VV=e=>hS((t,n)=>t.length===n.length&&ws(t).every((r,s)=>e(r,ti(n,s)))),GV=VV(Be),KV={[QL]:{_A:e=>e},toString(){return Lt(this.toJSON())},toJSON(){return{_id:"Chunk",values:ws(this).map(Wt)}},[ht](){return this.toJSON()},[Ye](e){return yS(e)&&GV(this,e)},[We](){return Ft(this,Wf(ws(this)))},[Symbol.iterator](){switch(this.backing._tag){case"IArray":return this.backing.array[Symbol.iterator]();case"IEmpty":return XL[Symbol.iterator]();default:return ws(this)[Symbol.iterator]()}},pipe(){return Ee(this,arguments)}},Xt=e=>{const t=Object.create(KV);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=js,t.right=js;break}case"ISingleton":{t.length=1,t.depth=0,t.left=js,t.right=js;break}case"ISlice":{t.length=e.length,t.depth=e.chunk.depth+1,t.left=js,t.right=js;break}}return t},yS=e=>Le(e,QL),js=Xt({_tag:"IEmpty"}),rr=()=>js,vk=(...e)=>JV(e),xn=e=>Xt({_tag:"ISingleton",a:e}),bl=e=>yS(e)?e:br(wt(e)),m_=(e,t,n)=>{switch(e.backing._tag){case"IArray":{qV(e.backing.array,0,t,n,e.length);break}case"IConcat":{m_(e.left,t,n),m_(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]=ti(e,r),r+=1,s+=1;break}}},WV=e=>{switch(e.backing._tag){case"IEmpty":return XL;case"IArray":return e.backing.array;default:{const t=new Array(e.length);return m_(e,t,0),e.backing={_tag:"IArray",array:t},e.left=js,e.right=js,e.depth=0,t}}},ws=WV,YV=e=>{switch(e.backing._tag){case"IEmpty":case"ISingleton":return e;case"IArray":return Xt({_tag:"IArray",array:A2(e.backing.array)});case"IConcat":return Xt({_tag:"IConcat",left:bo(e.backing.right),right:bo(e.backing.left)});case"ISlice":return br(A2(ws(e)))}},bo=YV,ZL=L(2,(e,t)=>t<0||t>=e.length?fe():xe(ti(e,t))),br=e=>e.length===0?rr():e.length===1?xn(e[0]):Xt({_tag:"IArray",array:e}),JV=e=>br(e),ti=L(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?ti(e.left,t):ti(e.right,t-e.left.length);case"ISlice":return ti(e.backing.chunk,t+e.backing.offset)}}),p_=L(2,(e,t)=>yn(e,xn(t))),dr=L(2,(e,t)=>yn(xn(t),e)),Eb=L(2,(e,t)=>{if(t<=0)return js;if(t>=e.length)return e;switch(e.backing._tag){case"ISlice":return Xt({_tag:"ISlice",chunk:e.backing.chunk,length:t,offset:e.backing.offset});case"IConcat":return t>e.left.length?Xt({_tag:"IConcat",left:e.left,right:Eb(e.right,t-e.left.length)}):Eb(e.left,t);default:return Xt({_tag:"ISlice",chunk:e,offset:0,length:t})}}),Wo=L(2,(e,t)=>{if(t<=0)return e;if(t>=e.length)return js;switch(e.backing._tag){case"ISlice":return Xt({_tag:"ISlice",chunk:e.backing.chunk,offset:e.backing.offset+t,length:e.backing.length-t});case"IConcat":return t>e.left.length?Wo(e.right,t-e.left.length):Xt({_tag:"IConcat",left:Wo(e.left,t),right:e.right});default:return Xt({_tag:"ISlice",chunk:e,offset:t,length:e.length-t})}}),yn=L(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 Xt({_tag:"IConcat",left:e,right:t});if(n<-1)if(e.left.depth>=e.right.depth){const r=yn(e.right,t);return Xt({_tag:"IConcat",left:e.left,right:r})}else{const r=yn(e.right.right,t);if(r.depth===e.depth-3){const s=Xt({_tag:"IConcat",left:e.right.left,right:r});return Xt({_tag:"IConcat",left:e.left,right:s})}else{const s=Xt({_tag:"IConcat",left:e.left,right:e.right.left});return Xt({_tag:"IConcat",left:s,right:r})}}else if(t.right.depth>=t.left.depth){const r=yn(e,t.left);return Xt({_tag:"IConcat",left:r,right:t.right})}else{const r=yn(e,t.left.left);if(r.depth===t.depth-3){const s=Xt({_tag:"IConcat",left:r,right:t.left.right});return Xt({_tag:"IConcat",left:s,right:t.right})}else{const s=Xt({_tag:"IConcat",left:t.left.right,right:t.right});return Xt({_tag:"IConcat",left:r,right:s})}}}),kS=L(2,(e,t)=>br(UV(e,t))),xS=e=>e.length===0,yo=e=>e.length>0,_S=ZL(0),vS=e=>ti(e,0),va=vS,QV=e=>ZL(e,e.length-1),XV=L(2,(e,t)=>e.backing._tag==="ISingleton"?xn(t(e.backing.a,0)):br(F(ws(e),bc((n,r)=>t(n,r))))),oo=e=>Wo(e,1),ZV=L(2,(e,t)=>Wo(e,e.length-t)),eG=bS,Ac=5,wS=Math.pow(2,Ac),tG=wS-1,nG=wS/2,rG=wS/4;function sG(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 yl(e,t){return t>>>e&tG}function Hu(e){return 1<<e}function e$(e,t){return sG(e&t-1)}const aG=(e,t)=>({value:e,previous:t});function Xu(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 t$(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 oG(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 bi{_tag="EmptyNode";modify(t,n,r,s,a,o){const i=r(fe());return un(i)?new bi:(++o.value,new yc(t,s,a,i))}}function qs(e){return uL(e,"EmptyNode")}function iG(e){return qs(e)||e._tag==="LeafNode"||e._tag==="CollisionNode"}function ly(e,t){return qs(e)?!1:t===e.edit}class yc{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(Be(a,this.key)){const c=r(this.value);return c===this.value?this:un(c)?(--o.value,new bi):ly(this,t)?(this.value=c,this):new yc(t,s,a,c)}const i=r(fe());return un(i)?this:(++o.value,n$(t,n,this.hash,this,s,new yc(t,s,a,i)))}}class SS{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=ly(this,t),u=this.updateCollisionList(c,t,this.hash,this.children,r,a,o);return u===this.children?this:u.length>1?new SS(t,this.hash,u):u[0]}const i=r(fe());return un(i)?this:(++o.value,n$(t,n,this.hash,this,s,new yc(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&&Be(o,d.key)){const h=d.value,f=a(h);return f===h?s:un(f)?(--i.value,t$(t,l,s)):Xu(t,l,new yc(n,r,o,f),s)}}const u=a(fe());return un(u)?s:(++i.value,Xu(t,c,new yc(n,r,o,u),s))}}class kl{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=yl(n,s),l=Hu(u),d=e$(i,l),h=i&l,f=ly(this,t);if(!h){const y=new bi().modify(t,n+Ac,r,s,a,o);return y?c.length>=nG?uG(t,u,y,i,c):new kl(t,i|l,oG(f,d,y,c)):this}const p=c[d],x=p.modify(t,n+Ac,r,s,a,o);if(p===x)return this;let g=i,b;if(qs(x)){if(g&=~l,!g)return new bi;if(c.length<=2&&iG(c[d^1]))return c[d^1];b=t$(f,d,c)}else b=Xu(f,d,x,c);return f?(this.mask=g,this.children=b,this):new kl(t,g,b)}}class ES{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=yl(n,s),l=c[u],d=(l||new bi).modify(t,n+Ac,r,s,a,o);if(l===d)return this;const h=ly(this,t);let f;if(qs(l)&&!qs(d))++i,f=Xu(h,u,d,c);else if(!qs(l)&&qs(d)){if(--i,i<=rG)return cG(t,i,u,c);f=Xu(h,u,new bi,c)}else f=Xu(h,u,d,c);return h?(this.size=i,this.children=f,this):new ES(t,i,f)}}function cG(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&&!qs(u)&&(s[a++]=u,o|=1<<i)}return new kl(e,o,s)}function uG(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 ES(e,i+1,a)}function lG(e,t,n,r,s,a){if(n===s)return new SS(e,n,[a,r]);const o=yl(t,n),i=yl(t,s);if(o===i)return c=>new kl(e,Hu(o)|Hu(i),[c]);{const c=o<i?[r,a]:[a,r];return new kl(e,Hu(o)|Hu(i),c)}}function n$(e,t,n,r,s,a){let o,i=t;for(;;){const c=lG(e,i,n,r,s,a);if(typeof c=="function")o=aG(c,o),i=i+Ac;else{let u=c;for(;o!=null;)u=o.value(u),o=o.previous;return u}}}const r$="effect/HashMap",g_=Symbol.for(r$),dG={[g_]:g_,[Symbol.iterator](){return new dy(this,(e,t)=>[e,t])},[We](){let e=Ne(r$);for(const t of this)e^=F(Ne(t[0]),ot(Ne(t[1])));return Ft(this,e)},[Ye](e){if(mG(e)){if(e._size!==this._size)return!1;for(const t of this){const n=F(e,CS(t[0],Ne(t[0])));if(un(n))return!1;if(!Be(t[1],n.value))return!1}return!0}return!1},toString(){return Lt(this.toJSON())},toJSON(){return{_id:"HashMap",values:Array.from(this).map(Wt)}},[ht](){return this.toJSON()},pipe(){return Ee(this,arguments)}},TS=(e,t,n,r)=>{const s=Object.create(dG);return s._editable=e,s._edit=t,s._root=n,s._size=r,s};class dy{map;f;v;constructor(t,n){this.map=t,this.f=n,this.v=s$(this.map._root,this.f,void 0)}next(){if(un(this.v))return{done:!0,value:void 0};const t=this.v.value;return this.v=Tb(t.cont),{done:!1,value:t.value}}[Symbol.iterator](){return new dy(this.map,this.f)}}const Tb=e=>e?a$(e[0],e[1],e[2],e[3],e[4]):fe(),s$=(e,t,n=void 0)=>{switch(e._tag){case"LeafNode":return kt(e.value)?xe({value:t(e.key,e.value.value),cont:n}):Tb(n);case"CollisionNode":case"ArrayNode":case"IndexedNode":{const r=e.children;return a$(r.length,r,0,t,n)}default:return Tb(n)}},a$=(e,t,n,r,s)=>{for(;n<e;){const a=t[n++];if(a&&!qs(a))return s$(a,r,[e,t,n,r,s])}return Tb(s)},hG=TS(!1,0,new bi,0),hy=()=>hG,fG=e=>{const t=i$(hy());for(const n of e)df(t,n[0],n[1]);return kG(t)},mG=e=>Le(e,g_),pG=e=>e&&qs(e._root),gG=L(2,(e,t)=>CS(e,t,Ne(t))),CS=L(3,(e,t,n)=>{let r=e._root,s=0;for(;;)switch(r._tag){case"LeafNode":return Be(t,r.key)?r.value:fe();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&&Be(t,c.key))return c.value}}return fe()}case"IndexedNode":{const a=yl(s,n),o=Hu(a);if(r.mask&o){r=r.children[e$(r.mask,o)],s+=Ac;break}return fe()}case"ArrayNode":{if(r=r.children[yl(s,n)],r){s+=Ac;break}return fe()}default:return fe()}}),bG=L(2,(e,t)=>kt(CS(e,t,Ne(t)))),df=L(3,(e,t,n)=>IS(e,t,()=>xe(n))),yG=L(3,(e,t,n)=>e._editable?(e._root=t,e._size=n,e):t===e._root?e:TS(e._editable,e._edit,t,n)),o$=e=>new dy(e,t=>t),b_=e=>e._size,i$=e=>TS(!0,e._edit+1,e._root,e._size),kG=e=>(e._editable=!1,e),IS=L(3,(e,t,n)=>xG(e,t,Ne(t),n)),xG=L(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 F(e,yG(a,s.value))}),P2=L(2,(e,t)=>IS(e,t,fe)),_G=L(2,(e,t)=>fy(e,hy(),(n,r,s)=>df(n,s,t(r,s)))),c$=L(2,(e,t)=>fy(e,void 0,(n,r,s)=>t(r,s))),fy=L(3,(e,t,n)=>{const r=e._root;if(r._tag==="LeafNode")return kt(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&&!qs(c)&&(c._tag==="LeafNode"?kt(c.value)&&(t=n(t,c.value.value,c.key)):s.push(c.children))}return t}),u$="effect/HashSet",y_=Symbol.for(u$),vG={[y_]:y_,[Symbol.iterator](){return o$(this._keyMap)},[We](){return Ft(this,ot(Ne(this._keyMap))(Ne(u$)))},[Ye](e){return wG(e)?b_(this._keyMap)===b_(e._keyMap)&&Be(this._keyMap,e._keyMap):!1},toString(){return Lt(this.toJSON())},toJSON(){return{_id:"HashSet",values:Array.from(this).map(Wt)}},[ht](){return this.toJSON()},pipe(){return Ee(this,arguments)}},my=e=>{const t=Object.create(vG);return t._keyMap=e,t},wG=e=>Le(e,y_),SG=my(hy()),py=()=>SG,EG=e=>{const t=AS(py());for(const n of e)hf(t,n);return NS(t)},TG=(...e)=>{const t=AS(py());for(const n of e)hf(t,n);return NS(t)},CG=L(2,(e,t)=>bG(e._keyMap,t)),IG=e=>b_(e._keyMap),AS=e=>my(i$(e._keyMap)),NS=e=>(e._keyMap._editable=!1,e),l$=L(2,(e,t)=>{const n=AS(e);return t(n),NS(n)}),hf=L(2,(e,t)=>e._keyMap._editable?(df(t,!0)(e._keyMap),e):my(df(t,!0)(e._keyMap))),d$=L(2,(e,t)=>e._keyMap._editable?(P2(t)(e._keyMap),e):my(P2(t)(e._keyMap))),AG=L(2,(e,t)=>l$(e,n=>{for(const r of t)d$(n,r)})),NG=L(2,(e,t)=>l$(py(),n=>{RG(e,r=>hf(n,r));for(const r of t)hf(n,r)})),RG=L(2,(e,t)=>c$(e._keyMap,(n,r)=>t(r))),PG=L(3,(e,t,n)=>fy(e._keyMap,t,(r,s,a)=>n(r,a))),Nc=py,OG=EG,RS=TG,h$=CG,PS=IG,Ih=hf,f$=d$,O2=AG,ff=NG,mf=PG,Kl="Die",Rc="Empty",Qc="Fail",Wl="Interrupt",xl="Parallel",_l="Sequential",m$="effect/Cause",p$=Symbol.for(m$),LG={_E:e=>e},Yl={[p$]:LG,[We](){return F(Ne(m$),ot(Ne(VG(this))),Ft(this))},[Ye](e){return $G(e)&&qG(this,e)},pipe(){return Ee(this,arguments)},toJSON(){switch(this._tag){case"Empty":return{_id:"Cause",_tag:this._tag};case"Die":return{_id:"Cause",_tag:this._tag,defect:Wt(this.defect)};case"Interrupt":return{_id:"Cause",_tag:this._tag,fiberId:this.fiberId.toJSON()};case"Fail":return{_id:"Cause",_tag:this._tag,failure:Wt(this.error)};case"Sequential":case"Parallel":return{_id:"Cause",_tag:this._tag,left:Wt(this.left),right:Wt(this.right)}}},toString(){return Jl(this)},[ht](){return this.toJSON()}},yi=(()=>{const e=Object.create(Yl);return e._tag=Rc,e})(),Pc=e=>{const t=Object.create(Yl);return t._tag=Qc,t.error=e,t},Ss=e=>{const t=Object.create(Yl);return t._tag=Kl,t.defect=e,t},Bs=e=>{const t=Object.create(Yl);return t._tag=Wl,t.fiberId=e,t},ki=(e,t)=>{const n=Object.create(Yl);return n._tag=xl,n.left=e,n.right=t,n},ir=(e,t)=>{const n=Object.create(Yl);return n._tag=_l,n.left=e,n.right=t,n},$G=e=>Le(e,p$),MG=e=>e._tag===Rc,jG=e=>e._tag===Qc,g$=e=>e._tag===Kl,DG=e=>e._tag===Rc?!0:vl(e,!0,(t,n)=>{switch(n._tag){case Rc:return xe(t);case Kl:case Qc:case Wl:return xe(!1);default:return fe()}}),b$=e=>kt(BG(e)),gy=e=>by(void 0,KG)(e),FG=e=>bo(vl(e,rr(),(t,n)=>n._tag===Qc?xe(F(t,dr(n.error))):fe())),y$=e=>bo(vl(e,rr(),(t,n)=>n._tag===Kl?xe(F(t,dr(n.defect))):fe())),OS=e=>vl(e,Nc(),(t,n)=>n._tag===Wl?xe(F(t,Ih(n.fiberId))):fe()),k$=e=>LS(e,t=>t._tag===Qc?xe(t.error):fe()),x$=e=>{const t=k$(e);switch(t._tag){case"None":return He(e);case"Some":return ze(t.value)}},BG=e=>LS(e,t=>t._tag===Wl?xe(t.fiberId):fe()),L2=e=>$S(e,{onEmpty:yi,onFail:()=>yi,onDie:Ss,onInterrupt:Bs,onSequential:ir,onParallel:ki}),zG=e=>$S(e,{onEmpty:yi,onFail:Ss,onDie:Ss,onInterrupt:Bs,onSequential:ir,onParallel:ki}),UG=L(2,(e,t)=>HG(e,n=>Pc(t(n)))),HG=L(2,(e,t)=>$S(e,{onEmpty:yi,onFail:n=>t(n),onDie:n=>Ss(n),onInterrupt:n=>Bs(n),onSequential:(n,r)=>ir(n,r),onParallel:(n,r)=>ki(n,r)})),qG=(e,t)=>{let n=xn(e),r=xn(t);for(;yo(n)&&yo(r);){const[s,a]=F(va(n),vl([Nc(),rr()],([c,u],l)=>{const[d,h]=k_(l);return xe([F(c,ff(d)),F(u,yn(h))])})),[o,i]=F(va(r),vl([Nc(),rr()],([c,u],l)=>{const[d,h]=k_(l);return xe([F(c,ff(d)),F(u,yn(h))])}));if(!Be(s,o))return!1;n=a,r=i}return!0},VG=e=>GG(xn(e),rr()),GG=(e,t)=>{for(;;){const[n,r]=F(e,bS([Nc(),rr()],([a,o],i)=>{const[c,u]=k_(i);return[F(a,ff(c)),F(o,yn(u))]})),s=PS(n)>0?F(t,dr(n)):t;if(xS(r))return bo(s);e=r,t=s}throw new Error(ty("Cause.flattenCauseLoop"))},LS=L(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 _l:case xl:{n.push(r.right),n.push(r.left);break}}break}case"Some":return s}}return fe()}),k_=e=>{let t=e;const n=[];let r=Nc(),s=rr();for(;t!==void 0;)switch(t._tag){case Rc:{if(n.length===0)return[r,s];t=n.pop();break}case Qc:{if(r=Ih(r,vk(t._tag,t.error)),n.length===0)return[r,s];t=n.pop();break}case Kl:{if(r=Ih(r,vk(t._tag,t.defect)),n.length===0)return[r,s];t=n.pop();break}case Wl:{if(r=Ih(r,vk(t._tag,t.fiberId)),n.length===0)return[r,s];t=n.pop();break}case _l:{switch(t.left._tag){case Rc:{t=t.right;break}case _l:{t=ir(t.left.left,ir(t.left.right,t.right));break}case xl:{t=ki(ir(t.left.left,t.right),ir(t.left.right,t.right));break}default:{s=dr(s,t.right),t=t.left;break}}break}case xl:{n.push(t.right),t=t.left;break}}throw new Error(ty("Cause.evaluateCauseLoop"))},KG={emptyCase:T2,failCase:fo,dieCase:fo,interruptCase:T2,sequentialCase:(e,t,n)=>t&&n,parallelCase:(e,t,n)=>t&&n},$2="SequentialCase",M2="ParallelCase",$S=L(2,(e,{onDie:t,onEmpty:n,onFail:r,onInterrupt:s,onParallel:a,onSequential:o})=>by(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)})),vl=L(3,(e,t,n)=>{let r=t,s=e;const a=[];for(;s!==void 0;){const o=n(r,s);switch(r=kt(o)?o.value:r,s._tag){case _l:{a.push(s.right),s=s.left;break}case xl:{a.push(s.right),s=s.left;break}default:{s=void 0;break}}s===void 0&&a.length>0&&(s=a.pop())}return r}),by=L(3,(e,t,n)=>{const r=[e],s=[];for(;r.length>0;){const o=r.pop();switch(o._tag){case Rc:{s.push(He(n.emptyCase(t)));break}case Qc:{s.push(He(n.failCase(t,o.error)));break}case Kl:{s.push(He(n.dieCase(t,o.defect)));break}case Wl:{s.push(He(n.interruptCase(t,o.fiberId)));break}case _l:{r.push(o.right),r.push(o.left),s.push(ze({_tag:$2}));break}case xl:{r.push(o.right),r.push(o.left),s.push(ze({_tag:M2}));break}}}const a=[];for(;s.length>0;){const o=s.pop();switch(o._tag){case"Left":{switch(o.left._tag){case $2:{const i=a.pop(),c=a.pop(),u=n.sequentialCase(t,i,c);a.push(u);break}case M2:{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()}),Jl=(e,t)=>gy(e)?"All fibers interrupted without errors.":v$(e).map(function(n){return t?.renderErrorCause!==!0||n.cause===void 0?n.stack:`${n.stack} {
|
|
6
|
+
${_$(n.cause," ")}
|
|
7
|
+
}`}).join(`
|
|
8
|
+
`),_$=(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
|
+
${_$(e.cause,`${t} `)}
|
|
12
|
+
${t}}`),r};class Cb extends globalThis.Error{span=void 0;constructor(t){const n=typeof t=="object"&&t!==null,r=Error.stackTraceLimit;Error.stackTraceLimit=1,super(WG(t),n&&"cause"in t&&typeof t.cause<"u"?{cause:new Cb(t.cause)}:void 0),this.message===""&&(this.message="An error has occurred"),Error.stackTraceLimit=r,this.name=t instanceof Error?t.name:"Error",n&&(wl in t&&(this.span=t[wl]),Object.keys(t).forEach(s=>{s in this||(this[s]=t[s])})),this.stack=JG(`${this.name}: ${this.message}`,t instanceof Error&&t.stack?t.stack:"",this.span)}}const WG=e=>{if(typeof e=="string")return e;if(typeof e=="object"&&e!==null&&e instanceof Error)return e.message;try{if(Le(e,"toString")&&Hl(e.toString)&&e.toString!==Object.prototype.toString&&e.toString!==globalThis.Array.prototype.toString)return e.toString()}catch{}return pL(e)},YG=/\((.*)\)/g,Ib=Fe("effect/Tracer/spanToTrace",()=>new WeakMap),JG=(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=Ib.get(a);if(typeof i=="function"){const c=i();if(typeof c=="string"){const u=c.matchAll(YG);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=_r(a.parent),o++}}return r.join(`
|
|
15
|
+
`)},wl=Symbol.for("effect/SpanAnnotation"),v$=e=>by(e,void 0,{emptyCase:()=>[],dieCase:(t,n)=>[new Cb(n)],failCase:(t,n)=>[new Cb(n)],interruptCase:()=>[],parallelCase:(t,n,r)=>[...n,...r],sequentialCase:(t,n,r)=>[...n,...r]}),x_=Symbol.for("effect/Duration"),w$=BigInt(0),j2=BigInt(24),Zm=BigInt(60),__=BigInt(1e3),D2=BigInt(1e6),F2=BigInt(1e9),QG=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,Zs=e=>{if(S$(e))return e;if(Js(e))return El(e);if(ey(e))return wk(e);if(Array.isArray(e)&&e.length===2&&e.every(Js))return e[0]===-1/0||e[1]===-1/0||Number.isNaN(e[0])||Number.isNaN(e[1])?Sl:e[0]===1/0||e[1]===1/0?nK:wk(BigInt(Math.round(e[0]*1e9))+BigInt(Math.round(e[1])));if(Cn(e)){const t=QG.exec(e);if(t){const[n,r,s]=t,a=Number(r);switch(s){case"nano":case"nanos":return wk(BigInt(r));case"micro":case"micros":return rK(BigInt(r));case"milli":case"millis":return El(a);case"second":case"seconds":return E$(a);case"minute":case"minutes":return sK(a);case"hour":case"hours":return aK(a);case"day":case"days":return oK(a);case"week":case"weeks":return iK(a)}}}throw new Error("Invalid DurationInput")},B2={_tag:"Millis",millis:0},XG={_tag:"Infinity"},ZG={[x_]:x_,[We](){return Ft(this,mL(this.value))},[Ye](e){return S$(e)&&mK(this,e)},toString(){return`Duration(${gK(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:uK(this)};case"Infinity":return{_id:"Duration",_tag:"Infinity"}}},[ht](){return this.toJSON()},pipe(){return Ee(this,arguments)}},Oa=e=>{const t=Object.create(ZG);return Js(e)?isNaN(e)||e<=0?t.value=B2:Number.isFinite(e)?Number.isInteger(e)?t.value={_tag:"Millis",millis:e}:t.value={_tag:"Nanos",nanos:BigInt(Math.round(e*1e6))}:t.value=XG:e<=w$?t.value=B2:t.value={_tag:"Nanos",nanos:e},t},S$=e=>Le(e,x_),eK=e=>e.value._tag!=="Infinity",tK=e=>{switch(e.value._tag){case"Millis":return e.value.millis===0;case"Nanos":return e.value.nanos===w$;case"Infinity":return!1}},Sl=Oa(0),nK=Oa(1/0),wk=e=>Oa(e),rK=e=>Oa(e*__),El=e=>Oa(e),E$=e=>Oa(e*1e3),sK=e=>Oa(e*6e4),aK=e=>Oa(e*36e5),oK=e=>Oa(e*864e5),iK=e=>Oa(e*6048e5),Ab=e=>lK(e,{onMillis:t=>t,onNanos:t=>Number(t)/1e6}),cK=e=>{const t=Zs(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))}},uK=e=>{const t=Zs(e);switch(t.value._tag){case"Infinity":return[1/0,0];case"Nanos":return[Number(t.value.nanos/F2),Number(t.value.nanos%F2)];case"Millis":return[Math.floor(t.value.millis/1e3),Math.round(t.value.millis%1e3*1e6)]}},lK=L(2,(e,t)=>{const n=Zs(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)}}),MS=L(3,(e,t,n)=>{const r=Zs(e),s=Zs(t);if(r.value._tag==="Infinity"||s.value._tag==="Infinity")return n.onMillis(Ab(r),Ab(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)}),dK=(e,t)=>MS(e,t,{onMillis:(n,r)=>n===r,onNanos:(n,r)=>n===r}),hK=L(2,(e,t)=>MS(e,t,{onMillis:(n,r)=>n<=r,onNanos:(n,r)=>n<=r})),fK=L(2,(e,t)=>MS(e,t,{onMillis:(n,r)=>n>=r,onNanos:(n,r)=>n>=r})),mK=L(2,(e,t)=>dK(Zs(e),Zs(t))),pK=e=>{const t=Zs(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=cK(t),r=n/D2,s=r/__,a=s/Zm,o=a/Zm,i=o/j2;return{days:Number(i),hours:Number(o%j2),minutes:Number(a%Zm),seconds:Number(s%Zm),millis:Number(r%__),nanos:Number(n%D2)}},gK=e=>{const t=Zs(e);if(t.value._tag==="Infinity")return"Infinity";if(tK(t))return"0";const n=pK(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(" ")},z2=Symbol.for("effect/MutableRef"),bK={[z2]:z2,toString(){return Lt(this.toJSON())},toJSON(){return{_id:"MutableRef",current:Wt(this.current)}},[ht](){return this.toJSON()},pipe(){return Ee(this,arguments)}},Xf=e=>{const t=Object.create(bK);return t.current=e,t},yK=L(3,(e,t,n)=>Be(t,e.current)?(e.current=n,!0):!1),Sn=e=>e.current,Zf=L(2,(e,t)=>(e.current=t,e)),yy="effect/FiberId",Oc=Symbol.for(yy),Tl="None",v_="Runtime",w_="Composite",kK=Yt(`${yy}-${Tl}`);let xK=class{[Oc]=Oc;_tag=Tl;id=-1;startTimeMillis=-1;[We](){return kK}[Ye](t){return jS(t)&&t._tag===Tl}toString(){return Lt(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag}}[ht](){return this.toJSON()}};class T${id;startTimeMillis;[Oc]=Oc;_tag=v_;constructor(t,n){this.id=t,this.startTimeMillis=n}[We](){return Ft(this,Yt(`${yy}-${this._tag}-${this.id}-${this.startTimeMillis}`))}[Ye](t){return jS(t)&&t._tag===v_&&this.id===t.id&&this.startTimeMillis===t.startTimeMillis}toString(){return Lt(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag,id:this.id,startTimeMillis:this.startTimeMillis}}[ht](){return this.toJSON()}}let _K=class{left;right;[Oc]=Oc;_tag=w_;constructor(t,n){this.left=t,this.right=n}_hash;[We](){return F(Yt(`${yy}-${this._tag}`),ot(Ne(this.left)),ot(Ne(this.right)),Ft(this))}[Ye](t){return jS(t)&&t._tag===w_&&Be(this.left,t.left)&&Be(this.right,t.right)}toString(){return Lt(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag,left:Wt(this.left),right:Wt(this.right)}}[ht](){return this.toJSON()}};const C$=new xK,jS=e=>Le(e,Oc),I$=L(2,(e,t)=>e._tag===Tl?t:t._tag===Tl?e:new _K(e,t)),vK=e=>F(e,mf(C$,(t,n)=>I$(n)(t))),Nb=e=>{switch(e._tag){case Tl:return Nc();case v_:return RS(e.id);case w_:return F(Nb(e.left),ff(Nb(e.right)))}},U2=Fe(Symbol.for("effect/Fiber/Id/_fiberCounter"),()=>Xf(0)),wK=(e,t)=>new T$(e,t),A$=e=>Array.from(Nb(e)).map(n=>`#${n}`).join(","),SK=()=>{const e=Sn(U2);return F(U2,Zf(e+1)),new T$(e,Date.now())},es=C$,Ah=I$,EK=vK,N$=Nb,TK=wK,CK=A$,R$=SK,ky=hy,IK=fG,AK=pG,P$=gG,O$=df,L$=o$,NK=IS,RK=_G,PK=c$,$$=fy,pf=Symbol.for("effect/List"),S_=e=>wt(e),OK=e=>Yq(uy(e),S_),LK=OK(Be),$K={[pf]:pf,_tag:"Cons",toString(){return Lt(this.toJSON())},toJSON(){return{_id:"List",_tag:"Cons",values:S_(this).map(Wt)}},[ht](){return this.toJSON()},[Ye](e){return j$(e)&&this._tag===e._tag&&LK(this,e)},[We](){return Ft(this,Wf(S_(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 Ee(this,arguments)}},Rb=(e,t)=>{const n=Object.create($K);return n.head=e,n.tail=t,n},MK=Yt("Nil"),jK={[pf]:pf,_tag:"Nil",toString(){return Lt(this.toJSON())},toJSON(){return{_id:"List",_tag:"Nil"}},[ht](){return this.toJSON()},[We](){return MK},[Ye](e){return j$(e)&&this._tag===e._tag},[Symbol.iterator](){return{next(){return{done:!0,value:void 0}}}},pipe(){return Ee(this,arguments)}},M$=Object.create(jK),j$=e=>Le(e,pf),mo=e=>e._tag==="Nil",DK=e=>e._tag==="Cons",FK=()=>M$,Lc=(e,t)=>Rb(e,t),Cl=FK,DS=e=>Rb(e,M$),BK=L(2,(e,t)=>UK(t,e)),zK=L(2,(e,t)=>Lc(t,e)),UK=L(2,(e,t)=>{if(mo(e))return t;if(mo(t))return e;{const n=Rb(t.head,e);let r=n,s=t.tail;for(;!mo(s);){const a=Rb(s.head,e);r.tail=a,r=a,s=s.tail}return n}}),HK=L(3,(e,t,n)=>{let r=t,s=e;for(;!mo(s);)r=n(r,s.head),s=s.tail;return r}),qK=e=>{let t=Cl(),n=e;for(;!mo(n);)t=zK(t,n.head),n=n.tail;return t},FS=(function(){function e(t){t&&Object.assign(this,t)}return e.prototype=uS,e})(),VK=Symbol.for("effect/DifferContextPatch");function H2(e){return e}const em={...FS.prototype,[VK]:{_Value:H2,_Patch:H2}},GK=Object.assign(Object.create(em),{_tag:"Empty"}),KK=Object.create(GK),D$=()=>KK,WK=Object.assign(Object.create(em),{_tag:"AndThen"}),YK=(e,t)=>{const n=Object.create(WK);return n.first=e,n.second=t,n},JK=Object.assign(Object.create(em),{_tag:"AddService"}),QK=(e,t)=>{const n=Object.create(JK);return n.key=e,n.service=t,n},XK=Object.assign(Object.create(em),{_tag:"RemoveService"}),ZK=e=>{const t=Object.create(XK);return t.key=e,t},eW=Object.assign(Object.create(em),{_tag:"UpdateService"}),tW=(e,t)=>{const n=Object.create(eW);return n.key=e,n.update=t,n},nW=(e,t)=>{const n=new Map(e.unsafeMap);let r=D$();for(const[s,a]of t.unsafeMap.entries())if(n.has(s)){const o=n.get(s);n.delete(s),Be(o,a)||(r=Lg(tW(s,()=>a))(r))}else n.delete(s),r=Lg(QK(s,a))(r);for(const[s]of n.entries())r=Lg(ZK(s))(r);return r},Lg=L(2,(e,t)=>YK(e,t)),rW=L(2,(e,t)=>{if(e._tag==="Empty")return t;let n=!1,r=xn(e);const s=new Map(t.unsafeMap);for(;yo(r);){const o=va(r),i=oo(r);switch(o._tag){case"Empty":{r=i;break}case"AddService":{s.set(o.key,o.service),r=i;break}case"AndThen":{r=dr(dr(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 pi(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 pi(a)}),sW=Symbol.for("effect/DifferHashSetPatch");function Sk(e){return e}const xy={...FS.prototype,[sW]:{_Value:Sk,_Key:Sk,_Patch:Sk}},aW=Object.assign(Object.create(xy),{_tag:"Empty"}),oW=Object.create(aW),F$=()=>oW,iW=Object.assign(Object.create(xy),{_tag:"AndThen"}),cW=(e,t)=>{const n=Object.create(iW);return n.first=e,n.second=t,n},uW=Object.assign(Object.create(xy),{_tag:"Add"}),lW=e=>{const t=Object.create(uW);return t.value=e,t},dW=Object.assign(Object.create(xy),{_tag:"Remove"}),hW=e=>{const t=Object.create(dW);return t.value=e,t},fW=(e,t)=>{const[n,r]=mf([e,F$()],([s,a],o)=>h$(o)(s)?[f$(o)(s),a]:[s,E_(lW(o))(a)])(t);return mf(r,(s,a)=>E_(hW(a))(s))(n)},E_=L(2,(e,t)=>cW(e,t)),mW=L(2,(e,t)=>{if(e._tag==="Empty")return t;let n=t,r=xn(e);for(;yo(r);){const s=va(r),a=oo(r);switch(s._tag){case"Empty":{r=a;break}case"AndThen":{r=dr(s.first)(dr(s.second)(a));break}case"Add":{n=Ih(s.value)(n),r=a;break}case"Remove":n=f$(s.value)(n),r=a}}return n}),pW=Symbol.for("effect/DifferReadonlyArrayPatch");function q2(e){return e}const tm={...FS.prototype,[pW]:{_Value:q2,_Patch:q2}},gW=Object.assign(Object.create(tm),{_tag:"Empty"}),bW=Object.create(gW),B$=()=>bW,yW=Object.assign(Object.create(tm),{_tag:"AndThen"}),kW=(e,t)=>{const n=Object.create(yW);return n.first=e,n.second=t,n},xW=Object.assign(Object.create(tm),{_tag:"Append"}),_W=e=>{const t=Object.create(xW);return t.values=e,t},vW=Object.assign(Object.create(tm),{_tag:"Slice"}),wW=(e,t)=>{const n=Object.create(vW);return n.from=e,n.until=t,n},SW=Object.assign(Object.create(tm),{_tag:"Update"}),EW=(e,t)=>{const n=Object.create(SW);return n.index=e,n.patch=t,n},TW=e=>{let t=0,n=B$();for(;t<e.oldValue.length&&t<e.newValue.length;){const r=e.oldValue[t],s=e.newValue[t],a=e.differ.diff(r,s);Be(a,e.differ.empty)||(n=$g(n,EW(t,a))),t=t+1}return t<e.oldValue.length&&(n=$g(n,wW(0,t))),t<e.newValue.length&&(n=$g(n,_W(jV(t)(e.newValue)))),n},$g=L(2,(e,t)=>kW(e,t)),CW=L(3,(e,t,n)=>{if(e._tag==="Empty")return t;let r=t.slice(),s=Ms(e);for(;Qu(s);){const a=Cr(s),o=Ic(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}),IW=Symbol.for("effect/Differ"),AW={[IW]:{_P:Ue,_V:Ue},pipe(){return Ee(this,arguments)}},Ql=e=>{const t=Object.create(AW);return t.empty=e.empty,t.diff=e.diff,t.combine=e.combine,t.patch=e.patch,t},NW=()=>Ql({empty:D$(),combine:(e,t)=>Lg(t)(e),diff:(e,t)=>nW(e,t),patch:(e,t)=>rW(t)(e)}),RW=()=>Ql({empty:F$(),combine:(e,t)=>E_(t)(e),diff:(e,t)=>fW(e,t),patch:(e,t)=>mW(t)(e)}),PW=e=>Ql({empty:B$(),combine:(t,n)=>$g(t,n),diff:(t,n)=>TW({oldValue:t,newValue:n,differ:e}),patch:(t,n)=>CW(t,n,e)}),z$=()=>OW((e,t)=>t),OW=e=>Ql({empty:Ue,combine:(t,n)=>t===Ue?n:n===Ue?t:r=>n(t(r)),diff:(t,n)=>Be(t,n)?Ue:Z0(n),patch:(t,n)=>e(n,t(n))}),gf=255,U$=8,T_=e=>e&gf,C_=e=>e>>U$&gf,nm=(e,t)=>(e&gf)+((t&e&gf)<<U$),LW=nm(0,0),$W=e=>nm(e,e),MW=e=>nm(e,0),jW=L(2,(e,t)=>nm(T_(e)&~t,C_(e))),DW=L(2,(e,t)=>e|t),FW=e=>~e>>>0&gf,BW=0,Xc=1,zW=2,H$=4,I_=16,q$=32,UW=e=>_y(e,q$),HW=L(2,(e,t)=>e&~t),qW=L(2,(e,t)=>e|t),qo=e=>V$(e)&&!GW(e),V$=e=>_y(e,Xc),_y=L(2,(e,t)=>(e&t)!==0),G$=(...e)=>e.reduce((t,n)=>t|n,0),VW=G$(BW),V2=e=>_y(e,H$),GW=e=>_y(e,I_),ni=L(2,(e,t)=>nm(e^t,t)),Zu=L(2,(e,t)=>e&(FW(T_(t))|C_(t))|T_(t)&C_(t)),G2=Ql({empty:LW,diff:(e,t)=>ni(e,t),combine:(e,t)=>DW(t)(e),patch:(e,t)=>Zu(t,e)}),KW=$W,K$=MW,K2=jW,W$=(e,t)=>({_tag:"Par",left:e,right:t}),ep=(e,t)=>({_tag:"Seq",left:e,right:t}),WW=e=>{let t=DS(e),n=Cl();for(;;){const[r,s]=HK(t,[Y$(),Cl()],([a,o],i)=>{const[c,u]=YW(i);return[eY(a,c),BK(o,u)]});if(n=JW(n,r),mo(s))return qK(n);t=s}throw new Error("BUG: BlockedRequests.flatten - please report an issue at https://github.com/Effect-TS/effect/issues")},YW=e=>{let t=e,n=Y$(),r=Cl(),s=Cl();for(;;)switch(t._tag){case"Empty":{if(mo(r))return[n,s];t=r.head,r=r.tail;break}case"Par":{r=Lc(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=W$(ep(i,o),ep(c,o));break}case"Seq":{const i=a.left,c=a.right;t=ep(i,ep(c,o));break}case"Single":{t=a,s=Lc(o,s);break}}break}case"Single":{if(n=ZW(n,t),mo(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")},JW=(e,t)=>{if(mo(e))return DS(Ek(t));if(tY(t))return e;const n=iY(e.head),r=nY(t);return n.length===1&&r.length===1&&Be(n[0],r[0])?Lc(oY(e.head,Ek(t)),e.tail):Lc(Ek(t),e)},QW=Symbol.for("effect/RequestBlock/RequestBlockParallel"),XW={_R:e=>e};class BS{map;[QW]=XW;constructor(t){this.map=t}}const Y$=()=>new BS(ky()),ZW=(e,t)=>new BS(NK(e.map,t.dataSource,n=>dV($r(n,p_(t.blockedRequest)),()=>xn(t.blockedRequest)))),eY=(e,t)=>new BS($$(e.map,t.map,(n,r,s)=>O$(n,s,ln(P$(n,s),{onNone:()=>r,onSome:a=>yn(r,a)})))),tY=e=>AK(e.map),nY=e=>Array.from(L$(e.map)),Ek=e=>aY(RK(e.map,t=>xn(t))),rY=Symbol.for("effect/RequestBlock/RequestBlockSequential"),sY={_R:e=>e};class J${map;[rY]=sY;constructor(t){this.map=t}}const aY=e=>new J$(e),oY=(e,t)=>new J$($$(t.map,e.map,(n,r,s)=>O$(n,s,ln(P$(n,s),{onNone:()=>rr(),onSome:a=>yn(a,r)})))),iY=e=>Array.from(L$(e.map)),cY=e=>Array.from(e.map),rm="Pending",vy="Done",uY="effect/Deferred",lY=Symbol.for(uY),dY={_E:e=>e,_A:e=>e},hY=e=>({_tag:rm,joiners:e}),Q$=e=>({_tag:vy,effect:e});class sm{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 sm(this.self)}}const X$=(e,t)=>{const n=new _n("Blocked");return n.effect_instruction_i0=e,n.effect_instruction_i1=t,n},fY=e=>{const t=new _n("RunBlocked");return t.effect_instruction_i0=e,t},$c=Symbol.for("effect/Effect");class mY{patch;op;_op=iS;constructor(t,n){this.patch=t,this.op=n}}class _n{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[$c]=gl;constructor(t){this._op=t}[Ye](t){return this===t}[We](){return Ft(this,rS(this))}pipe(){return Ee(this,arguments)}toJSON(){return{_id:"Effect",_op:this._op,effect_instruction_i0:Wt(this.effect_instruction_i0),effect_instruction_i1:Wt(this.effect_instruction_i1),effect_instruction_i2:Wt(this.effect_instruction_i2)}}toString(){return Lt(this.toJSON())}[ht](){return this.toJSON()}[Symbol.iterator](){return new sm(new Kf(this))}}class Z${_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[$c]=gl;constructor(t){this._op=t,this._tag=t}[Ye](t){return Py(t)&&t._op==="Failure"&&Be(this.effect_instruction_i0,t.effect_instruction_i0)}[We](){return F(Yt(this._tag),ot(Ne(this.effect_instruction_i0)),Ft(this))}get cause(){return this.effect_instruction_i0}pipe(){return Ee(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,cause:this.cause.toJSON()}}toString(){return Lt(this.toJSON())}[ht](){return this.toJSON()}[Symbol.iterator](){return new sm(new Kf(this))}}class eM{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[$c]=gl;constructor(t){this._op=t,this._tag=t}[Ye](t){return Py(t)&&t._op==="Success"&&Be(this.effect_instruction_i0,t.effect_instruction_i0)}[We](){return F(Yt(this._tag),ot(Ne(this.effect_instruction_i0)),Ft(this))}get value(){return this.effect_instruction_i0}pipe(){return Ee(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,value:Wt(this.value)}}toString(){return Lt(this.toJSON())}[ht](){return this.toJSON()}[Symbol.iterator](){return new sm(new Kf(this))}}const wo=e=>Le(e,$c),gt=e=>{const t=new _n(yL);return t.effect_instruction_i0=e,t},tM=L(3,(e,t,n)=>ta(r=>de(e,s=>de(ri(Ke(()=>r(t(s)))),a=>Ke(()=>n(s,a)).pipe(Is({onFailure:o=>{switch(a._tag){case Hn:return Nn(ir(a.effect_instruction_i0,o));case qn:return Nn(o)}},onSuccess:()=>a})))))),Ir=L(2,(e,t)=>de(e,()=>ve(t))),Ns=e=>Ir(e,void 0),nM=function(){const e=new _n(ay);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(ty("you're not supposed to end up here"))}return e},Pb=(e,t=es)=>{const n=new _n(Eh);let r;return n.effect_instruction_i0=s=>{r=e(s)},n.effect_instruction_i1=t,om(n,s=>wo(r)?r:Nt)},Yo=(e,t=es)=>Ke(()=>Pb(e,t)),ea=(e,t=es)=>nM(e,function(){let n,r;function s(c){n?n(c):r===void 0&&(r=c)}const a=new _n(Eh);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=Qn(()=>this.effect_instruction_i0(s,i.signal))):o=Qn(()=>this.effect_instruction_i0(s)),o||i?om(a,c=>(i&&i.abort(),o??Nt)):a}),rM=L(2,(e,t)=>{const n=new _n(Rg);return n.effect_instruction_i0=e,n.effect_instruction_i1=t,n}),bf=L(2,(e,t)=>ko(e,{onFailure:t,onSuccess:ve})),W2=Symbol.for("effect/OriginalAnnotation"),zS=(e,t)=>kt(t)?new Proxy(e,{has(n,r){return r===wl||r===W2||r in n},get(n,r){return r===wl?t.value:r===W2?e:n[r]}}):e,Jo=e=>Qs(e)&&!(wl in e)?gt(t=>Nn(Ss(zS(e,nE(t))))):Nn(Ss(e)),sM=e=>aM(()=>Ss(new KY(e))),Il=e=>ko(e,{onFailure:t=>ve(ze(t)),onSuccess:t=>ve(He(t))}),ri=e=>oM(e,{onFailure:It,onSuccess:At}),an=e=>Qs(e)&&!(wl in e)?gt(t=>Nn(Pc(zS(e,nE(t))))):Nn(Pc(e)),wy=e=>de(be(e),an),Nn=e=>{const t=new Z$(Hn);return t.effect_instruction_i0=e,t},aM=e=>de(be(e),Nn),Sy=gt(e=>ve(e.id())),am=e=>gt(t=>e(t.id())),de=L(2,(e,t)=>{const n=new _n(kb);return n.effect_instruction_i0=e,n.effect_instruction_i1=t,n}),pY=e=>{const t=new _n("OnStep");return t.effect_instruction_i0=e,t},Ey=e=>de(e,Ue),oM=L(2,(e,t)=>Is(e,{onFailure:n=>ve(t.onFailure(n)),onSuccess:n=>ve(t.onSuccess(n))})),Is=L(2,(e,t)=>{const n=new _n(xb);return n.effect_instruction_i0=e,n.effect_instruction_i1=t.onFailure,n.effect_instruction_i2=t.onSuccess,n}),ko=L(2,(e,t)=>Is(e,{onFailure:n=>{if(y$(n).length>0)return Nn(zG(n));const s=FG(n);return s.length>0?t.onFailure(vS(s)):Nn(n)},onSuccess:t.onSuccess})),io=L(2,(e,t)=>Ke(()=>{const n=wt(e),r=cy(n.length);let s=0;return Ir(VS({while:()=>s<n.length,body:()=>t(n[s],s),step:a=>{r[s++]=a}}),r)})),Ty=L(2,(e,t)=>Ke(()=>{const n=wt(e);let r=0;return VS({while:()=>r<n.length,body:()=>t(n[r],r),step:()=>{r++}})})),eo=de(Sy,e=>iM(e)),iM=e=>Nn(Bs(e)),US=e=>{const t=new _n(ql);return t.effect_instruction_i0=KW(Xc),t.effect_instruction_i1=()=>e,t},cM=L(2,(e,t)=>ta(n=>de(ri(n(e)),r=>EM(t,r)))),et=L(2,(e,t)=>de(e,n=>be(()=>t(n)))),uM=L(2,(e,t)=>ko(e,{onFailure:n=>wy(()=>t.onFailure(n)),onSuccess:n=>be(()=>t.onSuccess(n))})),Cy=L(2,(e,t)=>Is(e,{onFailure:n=>{const r=x$(n);switch(r._tag){case"Left":return wy(()=>t(r.left));case"Right":return Nn(r.right)}},onSuccess:ve})),Mc=L(2,(e,t)=>ta(n=>Is(n(e),{onFailure:r=>{const s=It(r);return Is(t(s),{onFailure:a=>It(ir(r,a)),onSuccess:()=>s})},onSuccess:r=>{const s=At(r);return Zt(t(s),s)}}))),om=L(2,(e,t)=>Mc(e,Oy({onFailure:n=>gy(n)?Ns(t(OS(n))):Nt,onSuccess:()=>Nt}))),gY=e=>bY(e,Ue),bY=L(2,(e,t)=>ko(e,{onFailure:n=>Jo(t(n)),onSuccess:ve})),yY=gt((e,t)=>ve(t.runtimeFlags)),ve=e=>{const t=new eM(qn);return t.effect_instruction_i0=e,t},Ke=e=>{const t=new _n(ay);return t.commit=e,t},be=e=>{const t=new _n(bL);return t.effect_instruction_i0=e,t},HS=L(e=>e.length===3||e.length===2&&!(Qs(e[1])&&"onlyEffect"in e[1]),(e,t)=>de(e,n=>{const r=typeof t=="function"?t(n):t;return wo(r)?Ir(r,n):QH(r)?Pb(s=>{r.then(a=>s(ve(n)),a=>s(an(new QS(a,"An unknown error occurred in Effect.tap"))))}):ve(n)})),kY=e=>gt(t=>{const n=t.getFiberRef(R_),r=F(n,zt(()=>t.scope()));return e(Xl(R_,xe(r)))}),im=e=>{const t=new _n(ql);return t.effect_instruction_i0=K$(Xc),t.effect_instruction_i1=()=>e,t},ta=e=>nM(e,function(){const t=new _n(ql);return t.effect_instruction_i0=K$(Xc),t.effect_instruction_i1=n=>V$(n)?Qn(()=>this.effect_instruction_i0(US)):Qn(()=>this.effect_instruction_i0(im)),t}),Nt=ve(void 0),lM=e=>{const t=new _n(ql);return t.effect_instruction_i0=e,t.effect_instruction_i1=void 0,t},qS=L(2,(e,t)=>de(t,n=>n?F(e,et(xe)):ve(fe()))),VS=e=>{const t=new _n(_b);return t.effect_instruction_i0=e.while,t.effect_instruction_i1=e.body,t.effect_instruction_i2=e.step,t},A_=e=>Ke(()=>{const t=new _n(Th);return t.effect_instruction_i0=e(),t}),dM=function(){const e=arguments.length===1?arguments[0]:arguments[1].bind(arguments[0]);return A_(()=>e(F))},hM=(e,...t)=>Object.defineProperty(t.length===0?function(...n){return A_(()=>e.apply(this,n))}:function(...n){let r=A_(()=>e.apply(this,n));for(const s of t)r=s(r,...n);return r},"length",{value:e.length,configurable:!0}),xY=L(2,(e,t)=>{const n=new _n(ql);return n.effect_instruction_i0=t,n.effect_instruction_i1=()=>e,n}),GS=e=>{const t=new _n(Pg);return typeof e?.priority<"u"?DY(t,e.priority):t},Iy=L(2,(e,t)=>de(e,n=>et(t,r=>[n,r]))),Ay=L(2,(e,t)=>de(e,n=>Ir(t,n))),Zt=L(2,(e,t)=>de(e,()=>t)),fM=L(3,(e,t,n)=>de(e,r=>et(t,s=>n(r,s)))),_Y=Yo(()=>{const e=setInterval(()=>{},2147483647);return be(()=>clearInterval(e))}),KS=e=>de(Sy,t=>F(e,yf(t))),yf=L(2,(e,t)=>de(e.interruptAsFork(t),()=>e.await)),vY={_tag:"All",syslog:0,label:"ALL",ordinal:Number.MIN_SAFE_INTEGER,pipe(){return Ee(this,arguments)}},wY={_tag:"Fatal",syslog:2,label:"FATAL",ordinal:5e4,pipe(){return Ee(this,arguments)}},SY={_tag:"Error",syslog:3,label:"ERROR",ordinal:4e4,pipe(){return Ee(this,arguments)}},mM={_tag:"Warning",syslog:4,label:"WARN",ordinal:3e4,pipe(){return Ee(this,arguments)}},pM={_tag:"Info",syslog:6,label:"INFO",ordinal:2e4,pipe(){return Ee(this,arguments)}},gM={_tag:"Debug",syslog:7,label:"DEBUG",ordinal:1e4,pipe(){return Ee(this,arguments)}},EY={_tag:"Trace",syslog:7,label:"TRACE",ordinal:0,pipe(){return Ee(this,arguments)}},TY={_tag:"None",syslog:7,label:"OFF",ordinal:Number.MAX_SAFE_INTEGER,pipe(){return Ee(this,arguments)}},CY="effect/FiberRef",IY=Symbol.for(CY),AY={_A:e=>e},WS=e=>gt(t=>At(t.getFiberRef(e))),Ny=L(2,(e,t)=>de(WS(e),t)),Y2=L(2,(e,t)=>NY(e,()=>[void 0,t])),NY=L(2,(e,t)=>gt(n=>{const[r,s]=t(n.getFiberRef(e));return n.setFiberRef(e,s),ve(r)})),Xl=L(3,(e,t,n)=>tM(Ay(WS(t),Y2(t,n)),()=>e,r=>Y2(t,r))),RY=L(3,(e,t,n)=>Ny(t,r=>Xl(e,t,n(r)))),Rn=(e,t)=>Zl(e,{differ:z$(),fork:t?.fork??Ue,join:t?.join}),PY=e=>{const t=RW();return Zl(e,{differ:t,fork:t.empty})},OY=e=>{const t=PW(z$());return Zl(e,{differ:t,fork:t.empty})},bM=e=>{const t=NW();return Zl(e,{differ:t,fork:t.empty})},Zl=(e,t)=>({...Qf,[IY]:AY,initial:e,commit(){return WS(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)}),LY=e=>Zl(e,{differ:G2,fork:G2.empty}),La=Fe(Symbol.for("effect/FiberRef/currentContext"),()=>bM(Xs())),ed=Fe(Symbol.for("effect/FiberRef/currentSchedulingPriority"),()=>Rn(0)),yM=Fe(Symbol.for("effect/FiberRef/currentMaxOpsBeforeYield"),()=>Rn(2048)),$Y=Fe(Symbol.for("effect/FiberRef/currentLogAnnotation"),()=>Rn(ky())),MY=Fe(Symbol.for("effect/FiberRef/currentLogLevel"),()=>Rn(pM)),jY=Fe(Symbol.for("effect/FiberRef/currentLogSpan"),()=>Rn(Cl())),DY=L(2,(e,t)=>Xl(e,ed,t)),FY=Fe(Symbol.for("effect/FiberRef/currentConcurrency"),()=>Rn("unbounded")),BY=Fe(Symbol.for("effect/FiberRef/currentRequestBatching"),()=>Rn(!0)),zY=Fe(Symbol.for("effect/FiberRef/currentUnhandledErrorLogLevel"),()=>Rn(xe(gM))),UY=Fe(Symbol.for("effect/FiberRef/versionMismatchErrorLogLevel"),()=>Rn(xe(mM))),N_=Fe(Symbol.for("effect/FiberRef/currentMetricLabels"),()=>OY(gi())),R_=Fe(Symbol.for("effect/FiberRef/currentForkScopeOverride"),()=>Rn(fe(),{fork:()=>fe(),join:(e,t)=>e})),tp=Fe(Symbol.for("effect/FiberRef/currentInterruptedCause"),()=>Rn(yi,{fork:()=>yi,join:(e,t)=>e})),kM=Fe(Symbol.for("effect/FiberRef/currentTracerEnabled"),()=>Rn(!0)),xM=Fe(Symbol.for("effect/FiberRef/currentTracerTiming"),()=>Rn(!0)),HY=Fe(Symbol.for("effect/FiberRef/currentTracerSpanAnnotations"),()=>Rn(ky())),qY=Fe(Symbol.for("effect/FiberRef/currentTracerSpanLinks"),()=>Rn(rr())),J2=Symbol.for("effect/Scope"),Q2=Symbol.for("effect/CloseableScope"),_M=(e,t)=>e.addFinalizer(()=>Ns(t)),Ob=(e,t)=>e.addFinalizer(t),P_=(e,t)=>e.close(t),so=(e,t)=>e.fork(t),VY=e=>GY(Ue)(e),GY=L(2,(e,t)=>{const n=F(e,k$,$r(t));switch(n._tag){case"None":return F(y$(e),_S,ln({onNone:()=>{const r=wt(OS(e)).flatMap(s=>wt(N$(s)).map(a=>`#${a}`));return new WY(r?`Interrupted by fibers: ${r.join(", ")}`:void 0)},onSome:Ue}));case"Some":return n.value}}),YS=(function(){class e extends globalThis.Error{commit(){return an(this)}toJSON(){const n={...this};return this.message&&(n.message=this.message),this.cause&&(n.cause=this.cause),n}[ht](){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?Jl(Pc(this),{renderErrorCause:!0}):this}}return Object.assign(e.prototype,wq),e})(),JS=(e,t)=>{class n extends YS{_tag=t}return Object.assign(n.prototype,e),n.prototype.name=t,n},X2=Symbol.for("effect/Cause/errors/RuntimeException"),KY=JS({[X2]:X2},"RuntimeException"),O_=Symbol.for("effect/Cause/errors/InterruptedException"),WY=JS({[O_]:O_},"InterruptedException"),YY=e=>Le(e,O_),Z2=Symbol.for("effect/Cause/errors/NoSuchElement"),Ry=JS({[Z2]:Z2},"NoSuchElementException"),eI=Symbol.for("effect/Cause/errors/UnknownException"),QS=(function(){class e extends YS{_tag="UnknownException";error;constructor(n,r){super(r??"An unknown error occurred",{cause:n}),this.error=n}}return Object.assign(e.prototype,{[eI]:eI,name:"UnknownException"}),e})(),Py=e=>wo(e)&&"_tag"in e&&(e._tag==="Success"||e._tag==="Failure"),vM=e=>e._tag==="Failure",JY=e=>e._tag==="Success",Mg=L(2,(e,t)=>{switch(e._tag){case Hn:return It(e.effect_instruction_i0);case qn:return At(t)}}),Tk=e=>Mg(e,void 0),el=(e,t)=>tJ(e,t?.parallel?ki:ir),wM=e=>It(Ss(e)),kf=e=>It(Pc(e)),It=e=>{const t=new Z$(Hn);return t.effect_instruction_i0=e,t},QY=L(2,(e,t)=>{switch(e._tag){case Hn:return It(e.effect_instruction_i0);case qn:return t(e.effect_instruction_i0)}}),XY=e=>F(e,QY(Ue)),ZY=e=>It(Bs(e)),jg=L(2,(e,t)=>{switch(e._tag){case Hn:return It(e.effect_instruction_i0);case qn:return At(t(e.effect_instruction_i0))}}),Oy=L(2,(e,{onFailure:t,onSuccess:n})=>{switch(e._tag){case Hn:return t(e.effect_instruction_i0);case qn:return n(e.effect_instruction_i0)}}),L_=L(2,(e,{onFailure:t,onSuccess:n})=>{switch(e._tag){case Hn:return t(e.effect_instruction_i0);case qn:return n(e.effect_instruction_i0)}}),At=e=>{const t=new eM(qn);return t.effect_instruction_i0=e,t},cr=At(void 0),eJ=L(2,(e,t)=>XS(e,t,{onSuccess:(n,r)=>[n,r],onFailure:ir})),SM=L(2,(e,t)=>XS(e,t,{onSuccess:(n,r)=>r,onFailure:ir})),XS=L(3,(e,t,{onFailure:n,onSuccess:r})=>{switch(e._tag){case Hn:switch(t._tag){case qn:return It(e.effect_instruction_i0);case Hn:return It(n(e.effect_instruction_i0,t.effect_instruction_i0))}case qn:switch(t._tag){case qn:return At(r(e.effect_instruction_i0,t.effect_instruction_i0));case Hn:return It(t.effect_instruction_i0)}}}),tJ=(e,t)=>{const n=bl(e);return yo(n)?F(oo(n),bS(F(va(n),jg(xn)),(r,s)=>F(r,XS(s,{onSuccess:(a,o)=>F(a,dr(o)),onFailure:t}))),jg(bo),jg(r=>ws(r)),xe):fe()},Ly=e=>({...Qf,[lY]:dY,state:Xf(hY([])),commit(){return xi(this)},blockingOn:e}),$y=()=>de(Sy,e=>nJ(e)),nJ=e=>be(()=>Ly(e)),xi=e=>Yo(t=>{const n=Sn(e.state);switch(n._tag){case vy:return t(n.effect);case rm:return n.joiners.push(t),sJ(e,t)}},e.blockingOn),My=L(2,(e,t)=>be(()=>{const n=Sn(e.state);switch(n._tag){case vy:return!1;case rm:{Zf(e.state,Q$(t));for(let r=0,s=n.joiners.length;r<s;r++)n.joiners[r](t);return!0}}})),EM=L(2,(e,t)=>My(e,t)),TM=L(2,(e,t)=>My(e,Nn(t))),CM=L(2,(e,t)=>My(e,iM(t))),rJ=e=>be(()=>Sn(e.state)._tag===vy),ZS=L(2,(e,t)=>My(e,ve(t))),jy=(e,t)=>{const n=Sn(e.state);if(n._tag===rm){Zf(e.state,Q$(t));for(let r=0,s=n.joiners.length;r<s;r++)n.joiners[r](t)}},sJ=(e,t)=>be(()=>{const n=Sn(e.state);if(n._tag===rm){const r=n.joiners.indexOf(t);r>=0&&n.joiners.splice(r,1)}}),aJ=gt(e=>At(e.currentContext)),eE=()=>aJ,Zc=e=>de(eE(),e),Dy=L(2,(e,t)=>Xl(La,t)(e)),tE=L(2,(e,t)=>RY(La,n=>Dr(n,t))(e)),IM=L(2,(e,t)=>Zc(n=>Dy(e,t(n)))),nE=e=>{const t=e.currentSpan;return t!==void 0&&t._tag==="Span"?xe(t):fe()},oJ={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:BigInt(0),endTime:BigInt(0),exit:cr},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},iJ=e=>Object.assign(Object.create(oJ),e),cJ="effect/Clock",tI=Symbol.for(cJ),td=Ti("effect/Clock"),uJ=2**31-1,nI={unsafeSchedule(e,t){const n=Ab(t);if(n>uJ)return fo;let r=!1;const s=setTimeout(()=>{r=!0,e()},n);return()=>(clearTimeout(s),!r)}},rI=(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)))})(),lJ=(function(){const e=typeof process=="object"&&"hrtime"in process&&typeof process.hrtime.bigint=="function"?process.hrtime:void 0;if(!e)return rI;const t=rI()-e.bigint();return()=>t+e.bigint()})();class dJ{[tI]=tI;unsafeCurrentTimeMillis(){return Date.now()}unsafeCurrentTimeNanos(){return lJ()}currentTimeMillis=be(()=>this.unsafeCurrentTimeMillis());currentTimeNanos=be(()=>this.unsafeCurrentTimeNanos());scheduler(){return ve(nI)}sleep(t){return ea(n=>{const r=nI.unsafeSchedule(()=>n(Nt),t);return Ns(be(r))})}}const hJ=()=>new dJ,Al=iV,Lb=e=>e.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&"),AM="And",NM="Or",RM="InvalidData",PM="MissingData",OM="SourceUnavailable",LM="Unsupported",fJ="effect/ConfigError",sI=Symbol.for(fJ),nd={_tag:"ConfigError",[sI]:sI},$M=(e,t)=>{const n=Object.create(nd);return n._op=AM,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},MM=(e,t)=>{const n=Object.create(nd);return n._op=NM,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},mJ=(e,t,n={pathDelim:"."})=>{const r=Object.create(nd);return r._op=RM,r.path=e,r.message=t,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`(Invalid data at ${F(this.path,Gl(n.pathDelim))}: "${this.message}")`}}),r},jc=(e,t,n={pathDelim:"."})=>{const r=Object.create(nd);return r._op=PM,r.path=e,r.message=t,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`(Missing data at ${F(this.path,Gl(n.pathDelim))}: "${this.message}")`}}),r},pJ=(e,t,n,r={pathDelim:"."})=>{const s=Object.create(nd);return s._op=OM,s.path=e,s.message=t,s.cause=n,Object.defineProperty(s,"toString",{enumerable:!1,value(){return`(Source unavailable at ${F(this.path,Gl(r.pathDelim))}: "${this.message}")`}}),s},gJ=(e,t,n={pathDelim:"."})=>{const r=Object.create(nd);return r._op=LM,r.path=e,r.message=t,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`(Unsupported operation at ${F(this.path,Gl(n.pathDelim))}: "${this.message}")`}}),r},ic=L(2,(e,t)=>{switch(e._op){case AM:return $M(ic(e.left,t),ic(e.right,t));case NM:return MM(ic(e.left,t),ic(e.right,t));case RM:return mJ([...t,...e.path],e.message);case PM:return jc([...t,...e.path],e.message);case OM:return pJ([...t,...e.path],e.message,e.cause);case LM:return gJ([...t,...e.path],e.message)}}),bJ={_tag:"Empty"},Ck=L(2,(e,t)=>{let n=DS(t),r=e;for(;DK(n);){const s=n.head;switch(s._tag){case"Empty":{n=n.tail;break}case"AndThen":{n=Lc(s.first,Lc(s.second,n.tail));break}case"MapName":{r=bc(r,s.f),n=n.tail;break}case"Nested":{r=wb(r,s.name),n=n.tail;break}case"Unnested":{if(F(Ch(r),bV(s.name)))r=Ic(r),n=n.tail;else return ze(jc(r,`Expected ${s.name} to be in path in ConfigProvider#unnested`));break}}}return He(r)}),yJ="Constant",kJ="Fail",xJ="Fallback",_J="Described",vJ="Lazy",wJ="MapOrFail",SJ="Nested",EJ="Primitive",TJ="Sequence",CJ="HashMap",IJ="ZipWith";var aI={};const $b=(e,t)=>[...e,...t],AJ="effect/ConfigProvider",oI=Symbol.for(AJ),NJ=Ti("effect/ConfigProvider"),RJ="effect/ConfigProviderFlat",iI=Symbol.for(RJ),PJ=e=>({[oI]:oI,pipe(){return Ee(this,arguments)},...e}),OJ=e=>({[iI]:iI,patch:e.patch,load:(t,n,r=!0)=>e.load(t,n,r),enumerateChildren:e.enumerateChildren}),LJ=e=>PJ({load:t=>de(us(e,gi(),t,!1),n=>ln(Ch(n),{onNone:()=>an(jc(gi(),`Expected a single value having structure: ${t}`)),onSome:ve})),flattened:e}),$J=e=>{const{pathDelim:t,seqDelim:n}=Object.assign({},{pathDelim:"_",seqDelim:","},e),r=c=>F(c,Gl(t)),s=c=>c.split(t),a=()=>typeof process<"u"&&"env"in process&&typeof aI=="object"?aI:{};return LJ(OJ({load:(c,u,l=!0)=>{const d=r(c),h=a(),f=d in h?xe(h[d]):fe();return F(f,Cy(()=>jc(c,`Expected ${d} to exist in the process context`)),de(p=>BJ(p,c,u,n,l)))},enumerateChildren:c=>be(()=>{const u=a(),h=Object.keys(u).map(f=>s(f.toUpperCase())).filter(f=>{for(let p=0;p<c.length;p++){const x=F(c,VL(p)),g=f[p];if(g===void 0||x!==g)return!1}return!0}).flatMap(f=>f.slice(c.length,c.length+1));return OG(h)}),patch:bJ}))},MJ=(e,t,n,r)=>{const s=R2(n.length,c=>c>=r.length?fe():xe([e(c),c+1])),a=R2(r.length,c=>c>=n.length?fe():xe([t(c),c+1])),o=$b(n,s),i=$b(r,a);return[o,i]},jJ=(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},us=(e,t,n,r)=>{const s=n;switch(s._tag){case yJ:return ve(Ms(s.value));case _J:return Ke(()=>us(e,t,s.config,r));case kJ:return an(jc(t,s.message));case xJ:return F(Ke(()=>us(e,t,s.first,r)),bf(a=>s.condition(a)?F(us(e,t,s.second,r),bf(o=>an(MM(a,o)))):an(a)));case vJ:return Ke(()=>us(e,t,s.config(),r));case wJ:return Ke(()=>F(us(e,t,s.original,r),de(io(a=>F(s.mapOrFail(a),Cy(ic(jJ(t,s.original))))))));case SJ:return Ke(()=>us(e,$b(t,Ms(s.name)),s.config,r));case EJ:return F(Ck(t,e.patch),de(a=>F(e.load(a,s,r),de(o=>{if(o.length===0){const i=F(LV(a),zt(()=>"<n/a>"));return an(jc([],`Expected ${s.description} with name ${i}`))}return ve(o)}))));case TJ:return F(Ck(t,e.patch),de(a=>F(e.enumerateChildren(a),de(UJ),de(o=>o.length===0?Ke(()=>et(us(e,t,s.config,!0),Ms)):F(io(o,i=>us(e,IV(t,`[${i}]`),s.config,!0)),et(i=>{const c=WL(i);return c.length===0?Ms(gi()):Ms(c)}))))));case CJ:return Ke(()=>F(Ck(t,e.patch),de(a=>F(e.enumerateChildren(a),de(o=>F(o,io(i=>us(e,$b(a,Ms(i)),s.valueConfig,r)),et(i=>i.length===0?Ms(ky()):F(zJ(i),bc(c=>IK(N2(wt(o),c)))))))))));case IJ:return Ke(()=>F(us(e,t,s.left,r),Il,de(a=>F(us(e,t,s.right,r),Il,de(o=>{if(Dn(a)&&Dn(o))return an($M(a.left,o.left));if(Dn(a)&&_a(o))return an(a.left);if(_a(a)&&Dn(o))return an(o.left);if(_a(a)&&_a(o)){const i=F(t,Gl(".")),c=DJ(t,i),[u,l]=MJ(c,c,F(a.right,bc(He)),F(o.right,bc(He)));return F(u,N2(l),io(([d,h])=>F(Iy(d,h),et(([f,p])=>s.zip(f,p)))))}throw new Error("BUG: ConfigProvider.fromFlatLoop - please report an issue at https://github.com/Effect-TS/effect/issues")})))))}},DJ=(e,t)=>n=>ze(jc(e,`The element at index ${n} in a sequence at path "${t}" was missing`)),FJ=(e,t)=>e.split(new RegExp(`\\s*${Lb(t)}\\s*`)),BJ=(e,t,n,r,s)=>s?F(FJ(e,r),io(a=>n.parse(a.trim())),Cy(ic(t))):F(n.parse(e),uM({onFailure:ic(t),onSuccess:Ms})),zJ=e=>Object.keys(e[0]).map(t=>e.map(n=>n[t])),UJ=e=>F(io(e,qJ),uM({onFailure:()=>gi(),onSuccess:lf(Al)}),Il,et(oV)),HJ=/^(\[(\d+)\])$/,qJ=e=>{const t=e.match(HJ);if(t!==null){const n=t[2];return F(n!==void 0&&n.length>0?xe(n):fe(),Ii(VJ))}return fe()},VJ=e=>{const t=Number.parseInt(e);return Number.isNaN(t)?fe():xe(t)},cI=Symbol.for("effect/Console"),jM=Ti("effect/Console"),GJ={[cI]:cI,assert(e,...t){return be(()=>{console.assert(e,...t)})},clear:be(()=>{console.clear()}),count(e){return be(()=>{console.count(e)})},countReset(e){return be(()=>{console.countReset(e)})},debug(...e){return be(()=>{console.debug(...e)})},dir(e,t){return be(()=>{console.dir(e,t)})},dirxml(...e){return be(()=>{console.dirxml(...e)})},error(...e){return be(()=>{console.error(...e)})},group(e){return e?.collapsed?be(()=>console.groupCollapsed(e?.label)):be(()=>console.group(e?.label))},groupEnd:be(()=>{console.groupEnd()}),info(...e){return be(()=>{console.info(...e)})},log(...e){return be(()=>{console.log(...e)})},table(e,t){return be(()=>{console.table(e,t)})},time(e){return be(()=>console.time(e))},timeEnd(e){return be(()=>console.timeEnd(e))},timeLog(e,...t){return be(()=>{console.timeLog(e,...t)})},trace(...e){return be(()=>{console.trace(...e)})},warn(...e){return be(()=>{console.warn(...e)})},unsafe:console},KJ="effect/Random",uI=Symbol.for(KJ),WJ=Ti("effect/Random");class YJ{seed;[uI]=uI;PRNG;constructor(t){this.seed=t,this.PRNG=new sq(t)}get next(){return be(()=>this.PRNG.number())}get nextBoolean(){return et(this.next,t=>t>.5)}get nextInt(){return be(()=>this.PRNG.integer(Number.MAX_SAFE_INTEGER))}nextRange(t,n){return et(this.next,r=>(n-t)*r+t)}nextIntBetween(t,n){return be(()=>this.PRNG.integer(n-t)+t)}shuffle(t){return JJ(t,n=>this.nextIntBetween(0,n))}}const JJ=(e,t)=>Ke(()=>F(be(()=>Array.from(e)),de(n=>{const r=[];for(let s=n.length;s>=2;s=s-1)r.push(s);return F(r,Ty(s=>F(t(s),et(a=>QJ(n,s-1,a)))),Ir(bl(n)))}))),QJ=(e,t,n)=>{const r=e[t];return e[t]=e[n],e[n]=r,e},XJ=e=>new YJ(Ne(e)),lI=Symbol.for("effect/Tracer"),ZJ=e=>({[lI]:lI,...e}),rE=Ti("effect/Tracer"),Fy=Ti("effect/ParentSpan"),dI=(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 eQ{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:dI(32),this.spanId=dI(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 tQ=ZJ({span:(e,t,n,r,s,a)=>new eQ(e,t,n,r,s,a),context:e=>e()}),nQ=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}}}},$_=Jc()("effect/Tracer/DisablePropagation",{defaultValue:fo}),rQ=F(Xs(),Yr(td,hJ()),Yr(jM,GJ),Yr(WJ,XJ(Math.random())),Yr(NJ,$J()),Yr(rE,tQ)),Nl=Fe(Symbol.for("effect/DefaultServices/currentServices"),()=>bM(rQ)),sQ=e=>{const t=Zs(e);return DM(n=>n.sleep(t))},aQ=e=>gt(t=>e(t.currentDefaultServices)),DM=e=>aQ(t=>e(t.unsafeMap.get(td.key))),oQ=DM(e=>e.currentTimeMillis),iQ=Jf,cQ=Sq;class rd extends cQ{}const FM="Sequential",BM="Parallel",uQ="ParallelN",kc={_tag:FM},M_={_tag:BM},lQ=e=>({_tag:uQ,parallelism:e}),dQ=e=>e._tag===FM,hQ=e=>e._tag===BM,Mb=kc,j_=M_,D_=lQ;function fQ(e){return new _i(e)}function mQ(){return fQ(new Map)}const hI=Symbol.for("effect/FiberRefs");class _i{locals;[hI]=hI;constructor(t){this.locals=t}pipe(){return Ee(this,arguments)}}const pQ=(e,t,n,r=!1)=>{const s=e;let a=t,o=n,i=r,c;for(;c===void 0;)if(Qt(a)&&Qt(o)){const u=Cr(a)[0],l=Ic(a),d=Cr(o)[0],h=Cr(o)[1],f=Ic(o);u.startTimeMillis<d.startTimeMillis?(o=f,i=!0):u.startTimeMillis>d.startTimeMillis?a=l:u.id<d.id?(o=f,i=!0):u.id>d.id?a=l:c=[h,i]}else c=[s.initial,!0];return c},gQ=L(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][Ye](t)){if(!r.has(a)){if(Be(o,a.initial))return;r.set(a,[[t,a.join(a.initial,o)]]);return}const i=r.get(a),[c,u]=pQ(a,i,s);if(u){const l=a.diff(c,o),d=i[0][1],h=a.join(d,a.patch(l)(d));if(!Be(d,h)){let f;const p=i[0][0];p[Ye](t)?f=[[p,h],...i.slice(1)]:f=[[t,h],...i],r.set(a,f)}}}}),new _i(r)}),bQ=L(2,(e,t)=>{const n=new Map;return zM(e,n,t),new _i(n)}),zM=(e,t,n)=>{e.locals.forEach((r,s)=>{const a=r[0][1],o=s.patch(s.fork)(a);Be(a,o)?t.set(s,r):t.set(s,[[n,o],...r])})},UM=L(2,(e,t)=>{const n=new Map(e.locals);return n.delete(t),new _i(n)}),HM=L(2,(e,t)=>e.locals.has(t)?xe(Cr(e.locals.get(t))[1]):fe()),xf=L(2,(e,t)=>F(HM(e,t),zt(()=>t.initial))),F_=L(2,(e,{fiberId:t,fiberRef:n,value:r})=>{if(e.locals.size===0)return new _i(new Map([[n,[[t,r]]]]));const s=new Map(e.locals);return B_(s,t,n,r),new _i(s)}),B_=(e,t,n,r)=>{const s=e.get(n)??[];let a;if(Qt(s)){const[o,i]=Cr(s);if(o[Ye](t)){if(Be(i,r))return;a=[[t,r],...s.slice(1)]}else a=[[t,r],...s]}else a=[[t,r]];e.set(n,a)},yQ=L(2,(e,{entries:t,forkAs:n})=>{if(e.locals.size===0)return new _i(new Map(t));const r=new Map(e.locals);return n!==void 0&&zM(e,r,n),t.forEach(([s,a])=>{a.length===1?B_(r,a[0][0],s,a[0][1]):a.forEach(([o,i])=>{B_(r,o,s,i)})}),new _i(r)}),fI=HM,qM=xf,kQ=yQ,xQ=mQ,VM="Empty",GM="Add",KM="Remove",WM="Update",YM="AndThen",_Q={_tag:VM},sE=(e,t)=>{const n=new Map(e.locals);let r=_Q;for(const[s,a]of t.locals.entries()){const o=Cr(a)[1],i=n.get(s);if(i!==void 0){const c=Cr(i)[1];Be(c,o)||(r=Ik({_tag:WM,fiberRef:s,patch:s.diff(c,o)})(r))}else r=Ik({_tag:GM,fiberRef:s,value:o})(r);n.delete(s)}for(const[s]of n.entries())r=Ik({_tag:KM,fiberRef:s})(r);return r},Ik=L(2,(e,t)=>({_tag:YM,first:e,second:t})),JM=L(3,(e,t,n)=>{let r=n,s=Ms(e);for(;Qt(s);){const a=Cr(s),o=Ic(s);switch(a._tag){case VM:{s=o;break}case GM:{r=F_(r,{fiberId:t,fiberRef:a.fiberRef,value:a.value}),s=o;break}case KM:{r=UM(r,a.fiberRef),s=o;break}case WM:{const i=xf(r,a.fiberRef);r=F_(r,{fiberId:t,fiberRef:a.fiberRef,value:a.fiberRef.patch(a.patch)(i)}),s=o;break}case YM:{s=wb(a.first)(wb(a.second)(o));break}}}return r}),_f=sE,vf=JM,By="effect/FiberStatus",Dc=Symbol.for(By),jb="Done",mI="Running",pI="Suspended",vQ=Yt(`${By}-${jb}`);let wQ=class{[Dc]=Dc;_tag=jb;[We](){return vQ}[Ye](t){return aE(t)&&t._tag===jb}};class SQ{runtimeFlags;[Dc]=Dc;_tag=mI;constructor(t){this.runtimeFlags=t}[We](){return F(Ne(By),ot(Ne(this._tag)),ot(Ne(this.runtimeFlags)),Ft(this))}[Ye](t){return aE(t)&&t._tag===mI&&this.runtimeFlags===t.runtimeFlags}}class EQ{runtimeFlags;blockingOn;[Dc]=Dc;_tag=pI;constructor(t,n){this.runtimeFlags=t,this.blockingOn=n}[We](){return F(Ne(By),ot(Ne(this._tag)),ot(Ne(this.runtimeFlags)),ot(Ne(this.blockingOn)),Ft(this))}[Ye](t){return aE(t)&&t._tag===pI&&this.runtimeFlags===t.runtimeFlags&&Be(this.blockingOn,t.blockingOn)}}const TQ=new wQ,CQ=e=>new SQ(e),IQ=(e,t)=>new EQ(e,t),aE=e=>Le(e,Dc),AQ=e=>e._tag===jb,NQ=TQ,QM=CQ,RQ=IQ,PQ=AQ,OQ=vY,LQ=wY,$Q=SY,MQ=mM,jQ=pM,DQ=gM,FQ=EY,BQ=TY,zQ=F(Al,FL(e=>e.ordinal)),UQ=cV(zQ),HQ=e=>{switch(e){case"All":return OQ;case"Debug":return DQ;case"Error":return $Q;case"Fatal":return LQ;case"Info":return jQ;case"Trace":return FQ;case"None":return BQ;case"Warning":return MQ}},qQ=Symbol.for("effect/Micro"),Db=Symbol.for("effect/Micro/MicroExit"),gI=Symbol.for("effect/Micro/MicroCause"),VQ={_E:Ue};class XM extends globalThis.Error{_tag;traces;[gI];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=pl(n,0),i=`${a}: ${o}`;r.length>0&&(i+=`
|
|
23
|
+
${r.join(`
|
|
24
|
+
`)}`),super(o),this._tag=t,this.traces=r,this[gI]=VQ,this.name=a,this.stack=i}pipe(){return Ee(this,arguments)}toString(){return this.stack}[ht](){return this.stack}}class GQ extends XM{defect;constructor(t,n=[]){super("Die",t,n),this.defect=t}}const KQ=(e,t=[])=>new GQ(e,t);let WQ=class extends XM{constructor(t=[]){super("Interrupt","interrupted",t)}};const YQ=(e=[])=>new WQ(e),JQ=e=>e._tag==="Interrupt",bI=Symbol.for("effect/Micro/MicroFiber"),QQ={_A:Ue,_E:Ue};class XQ{context;interruptible;[bI];_stack=[];_observers=[];_exit;_children;currentOpCount=0;constructor(t,n=!0){this.context=t,this.interruptible=n,this[bI]=QQ}getRef(t){return Bq(this.context,t)}addObserver(t){return this._exit?(t(this._exit),ml):(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(lE))}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===np)return;const r=yI.interruptChildren&&yI.interruptChildren(this);if(r!==void 0)return this.evaluate(Bb(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(dE).shouldYield(this)){n=!0;const s=r;r=Bb(rX,()=>s)}if(r=r[z_](this),r===np){const s=this._yielded;return Db in s?(this._yielded=void 0,s):np}}}catch(s){return Le(r,z_)?U_(s):U_(`MicroFiber.runLoop: Not a valid effect: ${String(r)}`)}}getCont(t){for(;;){const n=this._stack.pop();if(!n)return;const r=n[Fb]&&n[Fb](this);if(r)return{[t]:r};if(n[t])return n}}_yielded=void 0;yieldWith(t){return this._yielded=t,np}children(){return this._children??=new Set}}const yI=Fe("effect/Micro/fiberMiddleware",()=>({interruptChildren:void 0})),ZM=Symbol.for("effect/Micro/identifier"),In=Symbol.for("effect/Micro/args"),z_=Symbol.for("effect/Micro/evaluate"),Rl=Symbol.for("effect/Micro/successCont"),tl=Symbol.for("effect/Micro/failureCont"),Fb=Symbol.for("effect/Micro/ensureCont"),np=Symbol.for("effect/Micro/Yield"),ZQ={_A:Ue,_E:Ue,_R:Ue},eX={...iQ,_op:"Micro",[qQ]:ZQ,pipe(){return Ee(this,arguments)},[Symbol.iterator](){return new dL(new Kf(this))},toJSON(){return{_id:"Micro",op:this[ZM],...In in this?{args:this[In]}:void 0}},toString(){return Lt(this)},[ht](){return Lt(this)}};function tX(e){return U_("Micro.evaluate: Not implemented")}const zy=e=>({...eX,[ZM]:e.op,[z_]:e.eval??tX,[Rl]:e.contA,[tl]:e.contE,[Fb]:e.ensure}),oE=e=>{const t=zy(e);return function(){const n=Object.create(t);return n[In]=e.single===!1?arguments:arguments[0],n}},ej=e=>{const t={...zy(e),[Db]:Db,_tag:e.op,get[e.prop](){return this[In]},toJSON(){return{_id:"MicroExit",_tag:e.op,[e.prop]:this[In]}},[Ye](n){return oX(n)&&n._tag===e.op&&Be(this[In],n[In])},[We](){return Ft(this,ot(Yt(e.op))(Ne(this[In])))}};return function(n){const r=Object.create(t);return r[In]=n,r[Rl]=void 0,r[tl]=void 0,r[Fb]=void 0,r}},iE=ej({op:"Success",prop:"value",eval(e){const t=e.getCont(Rl);return t?t[Rl](this[In],e):e.yieldWith(this)}}),tj=ej({op:"Failure",prop:"cause",eval(e){let t=e.getCont(tl);for(;JQ(this[In])&&t&&e.interruptible;)t=e.getCont(tl);return t?t[tl](this[In],e):e.yieldWith(this)}}),nX=oE({op:"Yield",eval(e){let t=!1;return e.getRef(dE).scheduleTask(()=>{t||e.evaluate(iX)},this[In]??0),e.yieldWith(()=>{t=!0})}}),rX=nX(0),sX=iE(void 0),cE=oE({op:"WithMicroFiber",eval(e){return this[In](e)}}),Bb=L(2,(e,t)=>{const n=Object.create(aX);return n[In]=e,n[Rl]=t,n}),aX=zy({op:"OnSuccess",eval(e){return e._stack.push(this),this[In]}}),oX=e=>Le(e,Db),nj=iE,uE=tj,lE=uE(YQ()),U_=e=>uE(KQ(e)),iX=nj(void 0),cX="setImmediate"in globalThis?globalThis.setImmediate:e=>setTimeout(e,0);class rj{tasks=[];running=!1;scheduleTask(t,n){this.tasks.push(t),this.running||(this.running=!0,cX(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(dX)}flush(){for(;this.tasks.length>0;)this.runTasks()}}const uX=L(2,(e,t)=>cE(n=>{const r=n.context;return n.context=t(r),mX(e,()=>(n.context=r,sX))})),lX=L(2,(e,t)=>uX(e,Dr(t)));class dX extends Jc()("effect/Micro/currentMaxOpsBeforeYield",{defaultValue:()=>2048}){}class dE extends Jc()("effect/Micro/currentScheduler",{defaultValue:()=>new rj}){}const hX=L(2,(e,t)=>{const n=Object.create(fX);return n[In]=e,n[Rl]=t.onSuccess,n[tl]=t.onFailure,n}),fX=zy({op:"OnSuccessAndFailure",eval(e){return e._stack.push(this),this[In]}}),mX=L(2,(e,t)=>gX(n=>hX(n(e),{onFailure:r=>Bb(t(uE(r)),()=>tj(r)),onSuccess:r=>Bb(t(nj(r)),()=>iE(r))}))),sj=oE({op:"SetInterruptible",ensure(e){if(e.interruptible=this[In],e._interrupted&&e.interruptible)return()=>lE}}),pX=e=>cE(t=>t.interruptible?e:(t.interruptible=!0,t._stack.push(sj(!1)),t._interrupted?lE:e)),gX=e=>cE(t=>t.interruptible?(t.interruptible=!1,t._stack.push(sj(!0)),e(pX)):e(Ue)),bX=(e,t)=>{const n=new XQ(dE.context(new rj));return n.evaluate(e),n},zb=Symbol.for("effect/Readable"),aj=Symbol.for("effect/Ref"),oj={_A:e=>e};class yX extends rd{ref;commit(){return this.get}[aj]=oj;[zb]=zb;constructor(t){super(),this.ref=t,this.get=be(()=>Sn(this.ref))}get;modify(t){return be(()=>{const n=Sn(this.ref),[r,s]=t(n);return n!==s&&Zf(s)(this.ref),r})}}const hE=e=>new yX(Xf(e)),Ub=e=>be(()=>hE(e)),Ca=e=>e.get,nl=L(2,(e,t)=>e.modify(()=>[void 0,t])),kX=L(2,(e,t)=>e.modify(n=>[n,t])),ij=L(2,(e,t)=>e.modify(t)),Hb=L(2,(e,t)=>e.modify(n=>[void 0,t(n)])),fE=Ub,xX=Ca,_X=kX,Pd=ij,vX=nl,wX=Hb;class cj{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 SX{maxNextTickBeforeTimer;running=!1;tasks=new cj;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(yM)?t.getFiberRef(ed):!1}scheduleTask(t,n){this.tasks.scheduleTask(t,n),this.running||(this.running=!0,this.starve())}}const uj=Fe(Symbol.for("effect/Scheduler/defaultScheduler"),()=>new SX(2048));class Uy{tasks=new cj;deferred=!1;scheduleTask(t,n){this.deferred?uj.scheduleTask(t,n):this.tasks.scheduleTask(t,n)}shouldYield(t){return t.currentOpCount>t.getFiberRef(yM)?t.getFiberRef(ed):!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 mE=Fe(Symbol.for("effect/FiberRef/currentScheduler"),()=>Rn(uj)),lj=Fe(Symbol.for("effect/FiberRef/currentRequestMap"),()=>Rn(new Map)),kI=(e,t,n,r)=>{switch(e){case void 0:return t();case"unbounded":return n();case"inherit":return Ny(FY,s=>s==="unbounded"?n():s>1?r(s):t());default:return e>1?r(e):t()}},EX=sQ,TX=oQ,CX=td,dj=e=>e.replace(/[\s="]/g,"_"),IX=e=>t=>`${dj(t.label)}=${e-t.startTime}ms`,hj="effect/MetricLabel",H_=Symbol.for(hj);class AX{key;value;[H_]=H_;_hash;constructor(t,n){this.key=t,this.value=n,this._hash=Yt(hj+this.key+this.value)}[We](){return this._hash}[Ye](t){return RX(t)&&this.key===t.key&&this.value===t.value}pipe(){return Ee(this,arguments)}}const NX=(e,t)=>new AX(e,t),RX=e=>Le(e,H_),PX=e=>et(e,xe),fj=e=>{let t,n;return typeof e=="function"?t=e:(t=e.try,n=e.catch),Ke(()=>{try{return ve(Qn(t))}catch(r){return an(n?Qn(()=>n(r)):new QS(r,"An unknown error occurred in Effect.try"))}})},OX=e=>yj(e,pj,sE),LX=e=>yj(e,Iy(pj,yY),([t,n],[r,s])=>[sE(t,r),ni(n,s)]),mj=L(2,(e,t)=>ko(e,{onFailure:n=>ve(t.onFailure(n)),onSuccess:n=>ve(t.onSuccess(n))})),pj=gt(e=>ve(e.getFiberRefs())),$X=e=>mj(e,{onFailure:ml,onSuccess:ml}),xI=L(2,(e,t)=>Is(e,{onFailure:n=>aM(()=>t(n)),onSuccess:ve})),MX=e=>F($y(),de(t=>F(LX(e),cM(t),DX,et(n=>Zt(n,F(xi(t),de(([r,s])=>Ir(Iy(gj(r[0]),lM(r[1])),s)))))))),jX=e=>et(e,t=>!t),DX=e=>et(fE(!0),t=>Ns(qS(e,_X(t,!1)))),gj=e=>VX((t,n)=>F(e,JM(t,n))),FX=e=>e.length>=1?ea((t,n)=>{try{e(n).then(r=>t(ve(r)),r=>t(Jo(r)))}catch(r){t(Jo(r))}}):ea(t=>{try{e().then(n=>t(ve(n)),n=>t(Jo(n)))}catch(n){t(Jo(n))}}),bj=L(3,(e,t,n)=>Zc(r=>Dy(e,Yr(r,t,n)))),_I=L(3,(e,t,n)=>Zc(r=>de(n,s=>Dy(e,F(r,Yr(t,s)))))),BX=EX,zX=ve(fe()),yj=L(3,(e,t,n)=>de(t,r=>de(e,s=>et(t,a=>[n(r,a),s])))),UX=L(2,(e,t)=>Is(e,{onFailure:n=>Zt(t(n),Nn(n)),onSuccess:ve})),HX=e=>{let t,n;typeof e=="function"?t=e:(t=e.try,n=e.catch);const r=s=>n?wy(()=>n(s)):an(new QS(s,"An unknown error occurred in Effect.tryPromise"));return t.length>=1?ea((s,a)=>{try{t(a).then(o=>s(ve(o)),o=>s(r(o)))}catch(o){s(r(o))}}):ea(s=>{try{t().then(a=>s(ve(a)),a=>s(r(a)))}catch(a){s(r(a))}})},qX=L(2,(e,t)=>de(e,n=>fj({try:()=>t.try(n),catch:t.catch}))),VX=e=>gt(t=>(t.setFiberRefs(e(t.id(),t.getFiberRefs())),Nt)),GX=L(2,(e,t)=>Ke(()=>t()?et(e,xe):ve(fe()))),KX=e=>new Proxy({},{get(t,n,r){return(...s)=>de(e,a=>a[n](...s))}}),kj=BigInt(0),xj=Ii(e=>Gs(e.context,$_)?e._tag==="Span"?xj(e.parent):fe():xe(e)),WX=(e,t,n)=>{const r=!e.getFiberRef(kM)||n.context&&Gs(n.context,$_),s=e.getFiberRef(La),a=n.parent?xe(n.parent):n.root?fe():xj(Ci(s,Fy));let o;if(r)o=iJ({name:t,parent:a,context:Yr(n.context??Xs(),$_,!0)});else{const i=e.getFiberRef(Nl),c=Gs(i,rE),u=Gs(i,CX),l=e.getFiberRef(xM),d=e.getFiberRefs(),h=fI(d,HY),f=fI(d,qY),p=f._tag==="Some"?n.links!==void 0?[...ws(f.value),...n.links??[]]:ws(f.value):n.links??gi();o=c.span(t,a,n.context??Xs(),p,l?u.unsafeCurrentTimeNanos():kj,n.kind??"internal",n),h._tag==="Some"&&PK(h.value,(x,g)=>o.attribute(g,x)),n.attributes!==void 0&&Object.entries(n.attributes).forEach(([x,g])=>o.attribute(x,g))}return typeof n.captureStackTrace=="function"&&Ib.set(o,n.captureStackTrace),o},YX=(e,t,n,r)=>be(()=>{e.status._tag!=="Ended"&&(vM(t)&&Ib.has(e)&&e.attribute("code.stacktrace",Ib.get(e)()),e.end(r?n.unsafeCurrentTimeNanos():kj,t))}),JX=(e,...t)=>{const n=nQ(t.length===1?void 0:t[0]),r=t[t.length-1];return gt(s=>{const a=WX(s,e,n),o=s.getFiberRef(xM),i=Gs(s.getFiberRef(Nl),td);return Mc(r(a),c=>YX(a,c,i,o))})},QX=L(2,(e,t)=>bj(e,Fy,t)),pE=vM,_j=JY,XX=el,ZX=wM,qb=kf,ur=It,eZ=XY,tZ=jg,co=Oy,Jr=At,gE=cr,vI=eJ,wf=SM,bE="InterruptSignal",yE="Stateful",kE="Resume",xE="YieldNow",Ak=e=>({_tag:bE,cause:e}),Dg=e=>({_tag:yE,onFiber:e}),yu=e=>({_tag:kE,effect:e}),nZ=()=>({_tag:xE}),rZ="effect/FiberScope",Vb=Symbol.for(rZ);class sZ{[Vb]=Vb;fiberId=es;roots=new Set;add(t,n){this.roots.add(n),n.addObserver(()=>{this.roots.delete(n)})}}class aZ{fiberId;parent;[Vb]=Vb;constructor(t,n){this.fiberId=t,this.parent=n}add(t,n){this.parent.tell(Dg(r=>{r.addChild(n),n.addObserver(()=>{r.removeChild(n)})}))}}const oZ=e=>new aZ(e.id(),e),Hy=Fe(Symbol.for("effect/FiberScope/Global"),()=>new sZ),iZ="effect/Fiber",cZ=Symbol.for(iZ),uZ={_E:e=>e,_A:e=>e},lZ="effect/Fiber",dZ=Symbol.for(lZ),hZ=e=>e.await,fZ=e=>e.inheritAll,Sf=e=>Ay(Ey(e.await),e.inheritAll);({...Qf});const jo="effect/FiberCurrent",mZ=()=>Vl(globalThis[jo]),pZ="effect/Logger",gZ=Symbol.for(pZ),bZ={_Message:e=>e,_Output:e=>e},_E=e=>({[gZ]:bZ,log:e,pipe(){return Ee(this,arguments)}}),yZ=/^[^\s"=]*$/,kZ=(e,t)=>({annotations:n,cause:r,date:s,fiberId:a,logLevel:o,message:i,spans:c})=>{const u=p=>p.match(yZ)?p:e(p),l=(p,x)=>`${dj(p)}=${u(x)}`,d=(p,x)=>" "+l(p,x);let h=l("timestamp",s.toISOString());h+=d("level",o.label),h+=d("fiber",A$(a));const f=EV(i);for(let p=0;p<f.length;p++)h+=d("message",pl(f[p],t));MG(r)||(h+=d("cause",Jl(r,{renderErrorCause:!0})));for(const p of c)h+=" "+IX(s.getTime())(p);for(const[p,x]of n)h+=d(p,pl(x,t));return h},xZ=e=>`"${e.replace(/\\([\s\S])|(")/g,"\\$1$2")}"`,_Z=_E(kZ(xZ)),vZ=typeof process=="object"&&process!==null&&typeof process.stdout=="object"&&process.stdout!==null;vZ&&process.stdout.isTTY;const vj="effect/MetricBoundaries",q_=Symbol.for(vj);class wZ{values;[q_]=q_;constructor(t){this.values=t,this._hash=F(Yt(vj),ot(Wf(this.values)))}_hash;[We](){return this._hash}[Ye](t){return SZ(t)&&Be(this.values,t.values)}pipe(){return Ee(this,arguments)}}const SZ=e=>Le(e,q_),EZ=e=>{const t=F(e,gS(xn(Number.POSITIVE_INFINITY)),HV);return new wZ(t)},TZ=e=>F(SV(e.count-1,t=>e.start*Math.pow(e.factor,t)),br,EZ),CZ="effect/MetricKeyType",wj=Symbol.for(CZ),Sj="effect/MetricKeyType/Counter",V_=Symbol.for(Sj),IZ="effect/MetricKeyType/Frequency",AZ=Symbol.for(IZ),NZ="effect/MetricKeyType/Gauge",RZ=Symbol.for(NZ),Ej="effect/MetricKeyType/Histogram",G_=Symbol.for(Ej),PZ="effect/MetricKeyType/Summary",OZ=Symbol.for(PZ),Tj={_In:e=>e,_Out:e=>e};class LZ{incremental;bigint;[wj]=Tj;[V_]=V_;constructor(t,n){this.incremental=t,this.bigint=n,this._hash=Yt(Sj)}_hash;[We](){return this._hash}[Ye](t){return Cj(t)}pipe(){return Ee(this,arguments)}}class $Z{boundaries;[wj]=Tj;[G_]=G_;constructor(t){this.boundaries=t,this._hash=F(Yt(Ej),ot(Ne(this.boundaries)))}_hash;[We](){return this._hash}[Ye](t){return Ij(t)&&Be(this.boundaries,t.boundaries)}pipe(){return Ee(this,arguments)}}const MZ=e=>new LZ(e?.incremental??!1,e?.bigint??!1),jZ=e=>new $Z(e),Cj=e=>Le(e,V_),DZ=e=>Le(e,AZ),FZ=e=>Le(e,RZ),Ij=e=>Le(e,G_),BZ=e=>Le(e,OZ),zZ="effect/MetricKey",Aj=Symbol.for(zZ),UZ={_Type:e=>e},HZ=uy(Be);class vE{name;keyType;description;tags;[Aj]=UZ;constructor(t,n,r,s=[]){this.name=t,this.keyType=n,this.description=r,this.tags=s,this._hash=F(Yt(this.name+this.description),ot(Ne(this.keyType)),ot(Wf(this.tags)))}_hash;[We](){return this._hash}[Ye](t){return qZ(t)&&this.name===t.name&&Be(this.keyType,t.keyType)&&Be(this.description,t.description)&&HZ(this.tags,t.tags)}pipe(){return Ee(this,arguments)}}const qZ=e=>Le(e,Aj),VZ=(e,t)=>new vE(e,MZ(t),Vl(t?.description)),GZ=(e,t,n)=>new vE(e,jZ(t),Vl(n)),KZ=L(2,(e,t)=>t.length===0?e:new vE(e.name,e.keyType,e.description,Og(e.tags,t))),wI=Symbol.for("effect/MutableHashMap"),WZ={[wI]:wI,[Symbol.iterator](){return new wE(this)},toString(){return Lt(this.toJSON())},toJSON(){return{_id:"MutableHashMap",values:Array.from(this).map(Wt)}},[ht](){return this.toJSON()},pipe(){return Ee(this,arguments)}};class wE{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 YZ(this.self.buckets.values()),this.next()):t}[Symbol.iterator](){return new wE(this.self)}}class YZ{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 K_=()=>{const e=Object.create(WZ);return e.referential=new Map,e.buckets=new Map,e.bucketsSize=0,e},no=L(2,(e,t)=>{if(cf(t)===!1)return e.referential.has(t)?xe(e.referential.get(t)):fe();const n=t[We](),r=e.buckets.get(n);return r===void 0?fe():JZ(e,r,t)}),JZ=(e,t,n,r=!1)=>{for(let s=0,a=t.length;s<a;s++)if(n[Ye](t[s][0])){const o=t[s][1];return r&&(t.splice(s,1),e.bucketsSize--),xe(o)}return fe()},Od=L(2,(e,t)=>kt(no(e,t))),Zi=L(3,(e,t,n)=>{if(cf(t)===!1)return e.referential.set(t,n),e;const r=t[We](),s=e.buckets.get(r);return s===void 0?(e.buckets.set(r,[[t,n]]),e.bucketsSize++,e):(Nj(e,s,t),s.push([t,n]),e.bucketsSize++,e)}),Nj=(e,t,n)=>{for(let r=0,s=t.length;r<s;r++)if(n[Ye](t[r][0])){t.splice(r,1),e.bucketsSize--;return}},QZ=L(2,(e,t)=>{if(cf(t)===!1)return e.referential.delete(t),e;const n=t[We](),r=e.buckets.get(n);return r===void 0||(Nj(e,r,t),r.length===0&&e.buckets.delete(n)),e}),XZ="effect/MetricState",cm=Symbol.for(XZ),Rj="effect/MetricState/Counter",W_=Symbol.for(Rj),Pj="effect/MetricState/Frequency",Y_=Symbol.for(Pj),Oj="effect/MetricState/Gauge",J_=Symbol.for(Oj),Lj="effect/MetricState/Histogram",Q_=Symbol.for(Lj),$j="effect/MetricState/Summary",X_=Symbol.for($j),um={_A:e=>e};class ZZ{count;[cm]=um;[W_]=W_;constructor(t){this.count=t}[We](){return F(Ne(Rj),ot(Ne(this.count)),Ft(this))}[Ye](t){return lee(t)&&this.count===t.count}pipe(){return Ee(this,arguments)}}const eee=uy(Be);class tee{occurrences;[cm]=um;[Y_]=Y_;constructor(t){this.occurrences=t}_hash;[We](){return F(Yt(Pj),ot(Wf(wt(this.occurrences.entries()))),Ft(this))}[Ye](t){return dee(t)&&eee(wt(this.occurrences.entries()),wt(t.occurrences.entries()))}pipe(){return Ee(this,arguments)}}class nee{value;[cm]=um;[J_]=J_;constructor(t){this.value=t}[We](){return F(Ne(Oj),ot(Ne(this.value)),Ft(this))}[Ye](t){return hee(t)&&this.value===t.value}pipe(){return Ee(this,arguments)}}class ree{buckets;count;min;max;sum;[cm]=um;[Q_]=Q_;constructor(t,n,r,s,a){this.buckets=t,this.count=n,this.min=r,this.max=s,this.sum=a}[We](){return F(Ne(Lj),ot(Ne(this.buckets)),ot(Ne(this.count)),ot(Ne(this.min)),ot(Ne(this.max)),ot(Ne(this.sum)),Ft(this))}[Ye](t){return fee(t)&&Be(this.buckets,t.buckets)&&this.count===t.count&&this.min===t.min&&this.max===t.max&&this.sum===t.sum}pipe(){return Ee(this,arguments)}}class see{error;quantiles;count;min;max;sum;[cm]=um;[X_]=X_;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}[We](){return F(Ne($j),ot(Ne(this.error)),ot(Ne(this.quantiles)),ot(Ne(this.count)),ot(Ne(this.min)),ot(Ne(this.max)),ot(Ne(this.sum)),Ft(this))}[Ye](t){return mee(t)&&this.error===t.error&&Be(this.quantiles,t.quantiles)&&this.count===t.count&&this.min===t.min&&this.max===t.max&&this.sum===t.sum}pipe(){return Ee(this,arguments)}}const aee=e=>new ZZ(e),oee=e=>new tee(e),iee=e=>new nee(e),cee=e=>new ree(e.buckets,e.count,e.min,e.max,e.sum),uee=e=>new see(e.error,e.quantiles,e.count,e.min,e.max,e.sum),lee=e=>Le(e,W_),dee=e=>Le(e,Y_),hee=e=>Le(e,J_),fee=e=>Le(e,Q_),mee=e=>Le(e,X_),pee="effect/MetricHook",gee=Symbol.for(pee),bee={_In:e=>e,_Out:e=>e},lm=e=>({[gee]:bee,pipe(){return Ee(this,arguments)},...e}),SI=BigInt(0),yee=e=>{let t=e.keyType.bigint?SI:0;const n=e.keyType.incremental?e.keyType.bigint?s=>s>=SI:s=>s>=0:s=>!0,r=s=>{n(s)&&(t=t+s)};return lm({get:()=>aee(t),update:r,modify:r})},kee=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 lm({get:()=>oee(t),update:n,modify:n})},xee=(e,t)=>{let n=t;return lm({get:()=>iee(n),update:r=>{n=r},modify:r=>{n=n+r}})},_ee=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;F(t,lf(Al),bc((d,h)=>{s[h]=d}));const u=d=>{let h=0,f=n;for(;h!==f;){const p=Math.floor(h+(f-h)/2),x=s[p];d<=x?f=p:h=p,f===h+1&&(d<=s[h]?f=h:h=f)}r[h]=r[h]+1,a=a+1,o=o+d,d<i&&(i=d),d>c&&(c=d)},l=()=>{const d=cy(n);let h=0;for(let f=0;f<n;f++){const p=s[f],x=r[f];h=h+x,d[f]=[p,h]}return d};return lm({get:()=>cee({buckets:l(),count:a,min:i,max:c,sum:o}),update:u,modify:u})},vee=e=>{const{error:t,maxAge:n,maxSize:r,quantiles:s}=e.keyType,a=F(s,lf(Al)),o=cy(r);let i=0,c=0,u=0,l=0,d=0;const h=p=>{const x=[];let g=0;for(;g!==r-1;){const b=o[g];if(b!=null){const[y,_]=b,S=El(p-y);fK(S,Sl)&&hK(S,n)&&x.push(_)}g=g+1}return wee(t,a,lf(x,Al))},f=(p,x)=>{if(r>0){i=i+1;const g=i%r;o[g]=[x,p]}l=c===0?p:Math.min(l,p),d=c===0?p:Math.max(d,p),c=c+1,u=u+p};return lm({get:()=>uee({error:t,quantiles:h(Date.now()),count:c,min:l,max:d,sum:u}),update:([p,x])=>f(p,x),modify:([p,x])=>f(p,x)})},wee=(e,t,n)=>{const r=n.length;if(!Qt(t))return gi();const s=t[0],a=t.slice(1),o=EI(e,r,fe(),0,s,n),i=Ms(o);return a.forEach(c=>{i.push(EI(e,r,o.value,o.consumed,c,o.rest))}),bc(i,c=>[c.quantile,c.value])},EI=(e,t,n,r,s,a)=>{let o=e,i=t,c=n,u=r,l=s,d=a,h=e,f=t,p=n,x=r,g=s,b=a;for(;;){if(!Qt(d))return{quantile:l,value:fe(),consumed:u,rest:[]};if(l===1)return{quantile:l,value:xe(GL(d)),consumed:u+d.length,rest:[]};const y=Cr(d),_=MV(d,I=>I===y),S=l*i,w=o/2*S,v=u+_[0].length,C=Math.abs(v-S);if(v<S-w){h=o,f=i,p=Ch(d),x=v,g=l,b=_[1],o=h,i=f,c=p,u=x,l=g,d=b;continue}if(v>S+w){const I=un(c)?xe(y):c;return{quantile:l,value:I,consumed:u,rest:d}}switch(c._tag){case"None":{h=o,f=i,p=Ch(d),x=v,g=l,b=_[1],o=h,i=f,c=p,u=x,l=g,d=b;continue}case"Some":{const I=Math.abs(S-c.value);if(C<I){h=o,f=i,p=Ch(d),x=v,g=l,b=_[1],o=h,i=f,c=p,u=x,l=g,d=b;continue}return{quantile:l,value:xe(c.value),consumed:u,rest:d}}}}throw new Error("BUG: MetricHook.resolveQuantiles - please report an issue at https://github.com/Effect-TS/effect/issues")},See="effect/MetricPair",Eee=Symbol.for(See),Tee={_Type:e=>e},Cee=(e,t)=>({[Eee]:Tee,metricKey:e,metricState:t,pipe(){return Ee(this,arguments)}}),Iee="effect/MetricRegistry",TI=Symbol.for(Iee);class Aee{[TI]=TI;map=K_();snapshot(){const t=[];for(const[n,r]of this.map)t.push(Cee(n,r.get()));return t}get(t){const n=F(this.map,no(t),_r);if(n==null){if(Cj(t.keyType))return this.getCounter(t);if(FZ(t.keyType))return this.getGauge(t);if(DZ(t.keyType))return this.getFrequency(t);if(Ij(t.keyType))return this.getHistogram(t);if(BZ(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=F(this.map,no(t),_r);if(n==null){const r=yee(t);F(this.map,Od(t))||F(this.map,Zi(t,r)),n=r}return n}getFrequency(t){let n=F(this.map,no(t),_r);if(n==null){const r=kee(t);F(this.map,Od(t))||F(this.map,Zi(t,r)),n=r}return n}getGauge(t){let n=F(this.map,no(t),_r);if(n==null){const r=xee(t,t.keyType.bigint?BigInt(0):0);F(this.map,Od(t))||F(this.map,Zi(t,r)),n=r}return n}getHistogram(t){let n=F(this.map,no(t),_r);if(n==null){const r=_ee(t);F(this.map,Od(t))||F(this.map,Zi(t,r)),n=r}return n}getSummary(t){let n=F(this.map,no(t),_r);if(n==null){const r=vee(t);F(this.map,Od(t))||F(this.map,Zi(t,r)),n=r}return n}}const Nee=()=>new Aee,Ree="effect/Metric",Pee=Symbol.for(Ree),Oee={_Type:e=>e,_In:e=>e,_Out:e=>e},CI=Fe(Symbol.for("effect/Metric/globalMetricRegistry"),()=>Nee()),Mj=function(e,t,n,r){const s=Object.assign(a=>HS(a,o=>jee(s,o)),{[Pee]:Oee,keyType:e,unsafeUpdate:t,unsafeValue:n,unsafeModify:r,register(){return this.unsafeValue([]),this},pipe(){return Ee(this,arguments)}});return s},qy=(e,t)=>jj(VZ(e,t)),jj=e=>{let t;const n=new WeakMap,r=s=>{if(s.length===0)return t!==void 0||(t=CI.get(e)),t;let a=n.get(s);return a!==void 0||(a=CI.get(KZ(e,s)),n.set(s,a)),a};return Mj(e.keyType,(s,a)=>r(a).update(s),s=>r(s).get(),(s,a)=>r(a).modify(s))},Lee=(e,t,n)=>jj(GZ(e,t,n)),$ee=L(3,(e,t,n)=>Mee(e,[NX(t,n)])),Mee=L(2,(e,t)=>Mj(e.keyType,(n,r)=>e.unsafeUpdate(n,Og(t,r)),n=>e.unsafeValue(Og(t,n)),(n,r)=>e.unsafeModify(n,Og(t,r)))),jee=L(2,(e,t)=>Ny(N_,n=>be(()=>e.unsafeUpdate(t,n))));({...uS});const Dee=L(2,(e,t)=>Ny(lj,n=>be(()=>{if(n.has(e)){const r=n.get(e);r.state.completed||(r.state.completed=!0,jy(r.result,t))}}))),Fee="effect/Supervisor",Vy=Symbol.for(Fee),SE={_T:e=>e};class Gy{underlying;value0;[Vy]=SE;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 Gy(this,F(this.value,et(t)))}zip(t){return new Ky(this,t)}}class Ky{left;right;_tag="Zip";[Vy]=SE;constructor(t,n){this.left=t,this.right=n}get value(){return Iy(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 Gy(this,F(this.value,et(t)))}zip(t){return new Ky(this,t)}}const Dj=e=>Le(e,Vy)&&uL(e,"Zip");class Bee{effect;[Vy]=SE;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 Gy(this,F(this.value,et(t)))}zip(t){return new Ky(this,t)}onRun(t,n){return t()}}const zee=e=>new Bee(e),Wy=Fe("effect/Supervisor/none",()=>zee(Nt)),Uee=Ql,Fj="Empty",Bj="AddSupervisor",zj="RemoveSupervisor",Uj="AndThen",Nh={_tag:Fj},Fg=(e,t)=>({_tag:Uj,first:e,second:t}),Hee=(e,t)=>qee(t,xn(e)),qee=(e,t)=>{let n=e,r=t;for(;yo(r);){const s=va(r);switch(s._tag){case Fj:{r=oo(r);break}case Bj:{n=n.zip(s.supervisor),r=oo(r);break}case zj:{n=Z_(n,s.supervisor),r=oo(r);break}case Uj:{r=dr(s.first)(dr(s.second)(oo(r)));break}}}return n},Z_=(e,t)=>Be(e,t)?Wy:Dj(e)?Z_(e.left,t).zip(Z_(e.right,t)):e,Gb=e=>Be(e,Wy)?Nc():Dj(e)?F(Gb(e.left),ff(Gb(e.right))):RS(e),Vee=(e,t)=>{if(Be(e,t))return Nh;const n=Gb(e),r=Gb(t),s=F(r,O2(n),mf(Nh,(o,i)=>Fg(o,{_tag:Bj,supervisor:i}))),a=F(n,O2(r),mf(Nh,(o,i)=>Fg(o,{_tag:zj,supervisor:i})));return Fg(s,a)},Gee=Uee({empty:Nh,patch:Hee,combine:Fg,diff:Vee}),Kee=qy("effect_fiber_started",{incremental:!0}),II=qy("effect_fiber_active"),Wee=qy("effect_fiber_successes",{incremental:!0}),Yee=qy("effect_fiber_failures",{incremental:!0}),Jee=$ee(Lee("effect_fiber_lifetimes",TZ({start:.5,factor:2,count:35})),"time_unit","milliseconds"),Ld="Continue",Qee="Done",AI="Yield",Xee={_E:e=>e,_A:e=>e},rp=e=>{throw new Error(`BUG: FiberRuntime - ${pl(e)} - please report an issue at https://github.com/Effect-TS/effect/issues`)},qa=Symbol.for("effect/internal/fiberRuntime/YieldedOp"),Va=Fe("effect/internal/fiberRuntime/yieldedOpChannel",()=>({currentOp:null})),$d={[kb]:(e,t,n)=>Qn(()=>t.effect_instruction_i1(n)),OnStep:(e,t,n)=>At(At(n)),[xb]:(e,t,n)=>Qn(()=>t.effect_instruction_i2(n)),[iS]:(e,t,n)=>(e.patchRuntimeFlags(e.currentRuntimeFlags,t.patch),qo(e.currentRuntimeFlags)&&e.isInterrupted()?It(e.getInterruptedCause()):At(n)),[_b]:(e,t,n)=>(Qn(()=>t.effect_instruction_i2(n)),Qn(()=>t.effect_instruction_i0())?(e.pushStack(t),Qn(()=>t.effect_instruction_i1())):Nt),[Th]:(e,t,n)=>{for(;;){const r=Qn(()=>t.effect_instruction_i0.next(n));if(r.done)return At(r.value);const s=oq(r.value);if(Py(s)){if(s._tag==="Failure")return s}else return e.pushStack(t),s;n=s.value}}},Zee={[bE]:(e,t,n,r)=>(e.processNewInterruptSignal(r.cause),qo(t)?It(r.cause):n),[kE]:(e,t,n,r)=>{throw new Error("It is illegal to have multiple concurrent run loops in a single fiber")},[yE]:(e,t,n,r)=>(r.onFiber(e,QM(t)),n),[xE]:(e,t,n,r)=>de(GS(),()=>n)},ete=e=>Ty(WW(e),t=>Ia(cY(t),([n,r])=>{const s=new Map,a=[];for(const i of r){a.push(ws(i));for(const c of i)s.set(c.request,c)}const o=a.flat();return Xl(wte(n.runAll(a),o,()=>o.forEach(i=>{i.listeners.interrupted=!0})),lj,s)},!1,!1)),tte=cS();class Hj extends rd{[cZ]=uZ;[dZ]=Xee;_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,V2(r)){const s=this.getFiberRef(N_);Kee.unsafeUpdate(1,s),II.unsafeUpdate(1,s)}this.refreshRefCache()}commit(){return Sf(this)}id(){return this._fiberId}resume(t){this.tell(yu(t))}get status(){return this.ask((t,n)=>n)}get runtimeFlags(){return this.ask((t,n)=>PQ(n)?t.currentRuntimeFlags:n.runtimeFlags)}scope(){return oZ(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(tp)}fiberRefs(){return this.ask(t=>t.getFiberRefs())}ask(t){return Ke(()=>{const n=Ly(this._fiberId);return this.tell(Dg((r,s)=>{jy(n,be(()=>t(r,s)))})),xi(n)})}tell(t){this._queue.push(t),this._running||(this._running=!0,this.drainQueueLaterOnExecutor())}get await(){return ea(t=>{const n=r=>t(ve(r));if(this._exitValue!==null){n(this._exitValue);return}return this.tell(Dg((r,s)=>{r._exitValue!==null?n(this._exitValue):r.addObserver(n)})),be(()=>this.tell(Dg((r,s)=>{r.removeObserver(n)})))},this.id())}get inheritAll(){return gt((t,n)=>{const r=t.id(),s=t.getFiberRefs(),a=n.runtimeFlags,o=this.getFiberRefs(),i=gQ(s,r,o);t.setFiberRefs(i);const c=t.getFiberRef(OI),u=F(ni(a,c),K2(Xc),K2(I_));return lM(u)})}get poll(){return be(()=>Vl(this._exitValue))}unsafePoll(){return this._exitValue}interruptAsFork(t){return be(()=>this.tell(Ak(Bs(t))))}unsafeInterruptAsFork(t){this.tell(Ak(Bs(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(OI,this.currentRuntimeFlags),this._fiberRefs}unsafeDeleteFiberRef(t){this._fiberRefs=UM(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=F_(this._fiberRefs,{fiberId:this._fiberId,fiberRef:t,value:n}),this.refreshRefCache()}refreshRefCache(){this.currentDefaultServices=this.getFiberRef(Nl),this.currentTracer=this.currentDefaultServices.unsafeMap.get(rE.key),this.currentSupervisor=this.getFiberRef(xte),this.currentScheduler=this.getFiberRef(mE),this.currentContext=this.getFiberRef(La),this.currentSpan=this.currentContext.unsafeMap.get(Fy.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=Ld;const r=globalThis[jo];globalThis[jo]=this;try{for(;n===Ld;)n=this._queue.length===0?Qee:this.evaluateMessageWhileSuspended(this._queue.splice(0,1)[0])}finally{this._running=!1,globalThis[jo]=r}this._queue.length>0&&!this._running?(this._running=!0,n===AI?(this.drainQueueLaterOnExecutor(),t=!1):t=!0):t=!1}}drainQueueLaterOnExecutor(){this.currentScheduler.scheduleTask(this.run,this.getFiberRef(ed))}drainQueueWhileRunning(t,n){let r=n;for(;this._queue.length>0;){const s=this._queue.splice(0,1)[0];r=Zee[s._tag](this,t,r,s)}return r}isInterrupted(){return!DG(this.getFiberRef(tp))}addInterruptedCause(t){const n=this.getFiberRef(tp);this.setFiberRef(tp,ir(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(Ak(Bs(this.id()))),t=!0;return t}interruptAllChildren(){if(this.sendInterruptSignalToAllChildren()){const t=this._children.values();this._children=null;let n=!1;return VS({while:()=>!n,body:()=>{const s=t.next();return s.done?be(()=>{n=!0}):Ns(s.value.await)},step:()=>{}})}return null}reportExitValue(t){if(V2(this.currentRuntimeFlags)){const n=this.getFiberRef(N_),r=this.id().startTimeMillis,s=Date.now();switch(Jee.unsafeUpdate(s-r,n),II.unsafeUpdate(-1,n),t._tag){case qn:{Wee.unsafeUpdate(1,n);break}case Hn:{Yee.unsafeUpdate(1,n);break}}}if(t._tag==="Failure"){const n=this.getFiberRef(zY);!gy(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(ote)}log(t,n,r){const s=kt(r)?r.value:this.getFiberRef(MY),a=this.getFiberRef(nte);if(UQ(a,s))return;const o=this.getFiberRef(jY),i=this.getFiberRef($Y),c=this.getLoggers(),u=this.getFiberRefs();if(PS(c)>0){const l=Gs(this.getFiberRef(Nl),td),d=new Date(l.unsafeCurrentTimeMillis());mq(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 xE:return AI;case bE:return this.processNewInterruptSignal(t.cause),this._asyncInterruptor!==null&&(this._asyncInterruptor(It(t.cause)),this._asyncInterruptor=null),Ld;case kE:return this._asyncInterruptor=null,this._asyncBlockingOn=null,this.evaluateEffect(t.effect),Ld;case yE:return t.onFiber(this,this._exitValue!==null?NQ:RQ(this.currentRuntimeFlags,this._asyncBlockingOn)),Ld;default:return rp(t)}}evaluateEffect(t){this.currentSupervisor.onResume(this);try{let n=qo(this.currentRuntimeFlags)&&this.isInterrupted()?It(this.getInterruptedCause()):t;for(;n!==null;){const r=n,s=this.runLoop(r);if(s===qa){const a=Va.currentOp;Va.currentOp=null,a._op===Pg?UW(this.currentRuntimeFlags)?(this.tell(nZ()),this.tell(yu(cr)),n=null):n=cr:a._op===Eh&&(n=null)}else{this.currentRuntimeFlags=F(this.currentRuntimeFlags,qW(I_));const a=this.interruptAllChildren();a!==null?n=de(a,()=>s):(this._queue.length===0?this.setExitValue(s):this.tell(yu(s)),n=null)}}}finally{this.currentSupervisor.onSuspend(this)}}start(t){if(this._running)this.tell(yu(t));else{this._running=!0;const n=globalThis[jo];globalThis[jo]=this;try{this.evaluateEffect(t)}finally{this._running=!1,globalThis[jo]=n,this._queue.length>0&&this.drainQueueLaterOnExecutor()}}}startFork(t){this.tell(yu(t))}patchRuntimeFlags(t,n){const r=Zu(t,n);return globalThis[jo]=this,this.currentRuntimeFlags=r,r}initiateAsync(t,n){let r=!1;const s=a=>{r||(r=!0,this.tell(yu(a)))};qo(t)&&(this._asyncInterruptor=s);try{n(s)}catch(a){s(Nn(Ss(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!==Rg)return t;t=this.popStack()}}getNextFailCont(){let t=this.popStack();for(;t;){if(t._op!==kb&&t._op!==_b&&t._op!==Th)return t;t=this.popStack()}}[pq](t){return be(()=>RL(this.currentContext,t))}Left(t){return an(t.left)}None(t){return an(new Ry)}Right(t){return At(t.right)}Some(t){return At(t.value)}Micro(t){return Pb(n=>{let r=n;const s=bX(lX(t,this.currentContext));return s.addObserver(a=>{if(a._tag==="Success")return r(At(a.value));switch(a.cause._tag){case"Interrupt":return r(It(Bs(es)));case"Fail":return r(an(a.cause.error));case"Die":return r(Jo(a.cause.defect))}}),Pb(a=>{r=o=>{a(Nt)},s.unsafeInterrupt()})})}[bL](t){const n=Qn(()=>t.effect_instruction_i0()),r=this.getNextSuccessCont();return r!==void 0?(r._op in $d||rp(r),$d[r._op](this,r,n)):(Va.currentOp=At(n),qa)}[qn](t){const n=t,r=this.getNextSuccessCont();return r!==void 0?(r._op in $d||rp(r),$d[r._op](this,r,n.effect_instruction_i0)):(Va.currentOp=n,qa)}[Hn](t){const n=t.effect_instruction_i0,r=this.getNextFailCont();if(r!==void 0)switch(r._op){case Rg:case xb:return qo(this.currentRuntimeFlags)&&this.isInterrupted()?It(L2(n)):Qn(()=>r.effect_instruction_i1(n));case"OnStep":return qo(this.currentRuntimeFlags)&&this.isInterrupted()?It(L2(n)):At(It(n));case iS:return this.patchRuntimeFlags(this.currentRuntimeFlags,r.patch),qo(this.currentRuntimeFlags)&&this.isInterrupted()?It(ir(n,this.getInterruptedCause())):It(n);default:rp(r)}else return Va.currentOp=It(n),qa}[yL](t){return Qn(()=>t.effect_instruction_i0(this,QM(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=_f(a.refs,n),c=ni(a.flags,r);return At(X$(t.effect_instruction_i0,gt(u=>{for(;s.length>0;)u.pushStack(s.pop());return u.setFiberRefs(vf(u.id(),u.getFiberRefs())(i)),u.currentRuntimeFlags=Zu(c)(u.currentRuntimeFlags),t.effect_instruction_i1})))}return ta(s=>de(EE(fY(t.effect_instruction_i0)),()=>s(t.effect_instruction_i1)))}RunBlocked(t){return ete(t.effect_instruction_i0)}[ql](t){const n=t.effect_instruction_i0,r=this.currentRuntimeFlags,s=Zu(r,n);if(qo(s)&&this.isInterrupted())return It(this.getInterruptedCause());if(this.patchRuntimeFlags(this.currentRuntimeFlags,n),t.effect_instruction_i1){const a=ni(s,r);return this.pushStack(new mY(a,t)),Qn(()=>t.effect_instruction_i1(r))}else return cr}[kb](t){return this.pushStack(t),t.effect_instruction_i0}OnStep(t){return this.pushStack(t),t.effect_instruction_i0}[Rg](t){return this.pushStack(t),t.effect_instruction_i0}[xb](t){return this.pushStack(t),t.effect_instruction_i0}[Eh](t){return this._asyncBlockingOn=t.effect_instruction_i1,this.initiateAsync(this.currentRuntimeFlags,t.effect_instruction_i0),Va.currentOp=t,qa}[Pg](t){return this._isYielding=!1,Va.currentOp=t,qa}[_b](t){const n=t.effect_instruction_i0,r=t.effect_instruction_i1;return n()?(this.pushStack(t),r()):cr}[Th](t){return $d[Th](this,t,void 0)}[ay](t){return Qn(()=>t.commit())}runLoop(t){let n=t;for(this.currentOpCount=0;;){if((this.currentRuntimeFlags&zW)!==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=de(GS({priority:r}),()=>s)}}try{if(n=this.currentTracer.context(()=>{if(tte!==n[$c]._V){const r=this.getFiberRef(UY);if(r._tag==="Some"){const s=n[$c]._V;this.log(`Executing an Effect versioned ${s} with a Runtime of version ${cS()}, 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`,yi,r)}}return this[n._op](n)},this),n===qa){const r=Va.currentOp;return r._op===Pg||r._op===Eh?qa:(Va.currentOp=null,r._op===qn||r._op===Hn?r:It(Ss(r)))}}catch(r){n!==qa&&!Le(n,"_op")||!(n._op in this)?n=sM(`Not a valid effect: ${pl(n)}`):YY(r)?n=It(ir(Ss(r),Bs(es))):n=Jo(r)}}}run=()=>{this.drainQueueOnCurrentThread()}}const nte=Fe("effect/FiberRef/currentMinimumLogLevel",()=>Rn(HQ("Info"))),rte=e=>_E(t=>{const n=qM(t.context,Nl);Gs(n,jM).unsafe.log(e.log(t))}),ste=Fe(Symbol.for("effect/Logger/defaultLogger"),()=>rte(_Z)),ate=Fe(Symbol.for("effect/Logger/tracerLogger"),()=>_E(({annotations:e,cause:t,context:n,fiberId:r,logLevel:s,message:a})=>{const o=Ci(xf(n,La),Fy);if(o._tag==="None"||o.value._tag==="ExternalSpan")return;const i=RL(xf(n,Nl),td),c={};for(const[u,l]of e)c[u]=l;c["effect.fiberId"]=CK(r),c["effect.logLevel"]=s.label,t!==null&&t._tag!=="Empty"&&(c["effect.cause"]=Jl(t,{renderErrorCause:!0})),o.value.event(pl(Array.isArray(a)&&a.length===1?a[0]:a),i.unsafeCurrentTimeNanos(),c)})),ote=Fe(Symbol.for("effect/FiberRef/currentLoggers"),()=>PY(RS(ste,ate))),ite=L(e=>wo(e[0]),(e,t)=>im(HS(e,n=>cte(r=>t(n,r))))),cte=e=>gt(t=>{const n=t.getFiberRefs(),r=HW(t.currentRuntimeFlags,Xc);return de(Yj,s=>Ob(s,a=>gt(o=>{const i=o.getFiberRefs(),c=o.currentRuntimeFlags,u=_f(i,n),l=ni(c,r),d=_f(n,i);return o.setFiberRefs(vf(u,o.id(),n)),Ef(xY(e(a),l),be(()=>{o.setFiberRefs(vf(d,o.id(),o.getFiberRefs()))}))})))}),ute=e=>{if(Array.isArray(e)||lL(e))return[e,fe()];const t=Object.keys(e),n=t.length;return[t.map(r=>e[r]),xe(r=>{const s={};for(let a=0;a<n;a++)s[t[a]]=r[a];return s})]},lte=(e,t,n)=>{const r=[];for(const s of e)r.push(Il(s));return de(Pl(r,Ue,{concurrency:n?.concurrency,batching:n?.batching,concurrentFinalizers:n?.concurrentFinalizers}),s=>{const a=fe(),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]=xe(d.left),u=!0):(c[l]=d.right,i[l]=a)}return u?t._tag==="Some"?an(t.value(i)):an(i):n?.discard?Nt:t._tag==="Some"?ve(t.value(c)):ve(c)})},dte=(e,t,n)=>{const r=[];for(const s of e)r.push(Il(s));return n?.discard?Pl(r,Ue,{concurrency:n?.concurrency,batching:n?.batching,discard:!0,concurrentFinalizers:n?.concurrentFinalizers}):et(Pl(r,Ue,{concurrency:n?.concurrency,batching:n?.batching,concurrentFinalizers:n?.concurrentFinalizers}),s=>t._tag==="Some"?t.value(s):s)},qj=(e,t)=>{const[n,r]=ute(e);return t?.mode==="validate"?lte(n,r,t):t?.mode==="either"?dte(n,r,t):t?.discard!==!0&&r._tag==="Some"?et(Pl(n,Ue,t),r.value):Pl(n,Ue,t)},Pl=L(e=>lL(e[0]),(e,t,n)=>gt(r=>{const s=n?.batching===!0||n?.batching==="inherit"&&r.getFiberRef(BY);return n?.discard?kI(n.concurrency,()=>ku(Mb,n?.concurrentFinalizers)(a=>s?Ia(e,(o,i)=>a(t(o,i)),!0,!1,1):Ty(e,(o,i)=>a(t(o,i)))),()=>ku(j_,n?.concurrentFinalizers)(a=>Ia(e,(o,i)=>a(t(o,i)),s,!1)),a=>ku(D_(a),n?.concurrentFinalizers)(o=>Ia(e,(i,c)=>o(t(i,c)),s,!1,a))):kI(n?.concurrency,()=>ku(Mb,n?.concurrentFinalizers)(a=>s?ev(e,1,(o,i)=>a(t(o,i)),!0):io(e,(o,i)=>a(t(o,i)))),()=>ku(j_,n?.concurrentFinalizers)(a=>Vj(e,(o,i)=>a(t(o,i)),s)),a=>ku(D_(a),n?.concurrentFinalizers)(o=>ev(e,a,(i,c)=>o(t(i,c)),s)))})),Vj=(e,t,n)=>Ke(()=>{const r=wt(e),s=new Array(r.length);return Zt(Ia(r,(o,i)=>de(t(o,i),c=>be(()=>s[i]=c)),n,!1),ve(s))}),Ia=(e,t,n,r,s)=>ta(a=>kY(o=>gt(i=>{let c=Array.from(e).reverse(),u=c.length;if(u===0)return Nt;let l=0,d=!1;const h=s?Math.min(c.length,s):c.length,f=new Set,p=new Array,x=()=>f.forEach(I=>{I.currentScheduler.scheduleTask(()=>{I.unsafeInterruptAsFork(i.id())},0)}),g=new Array,b=new Array,y=new Array,_=()=>{const I=p.filter(({exit:R})=>R._tag==="Failure").sort((R,N)=>R.index<N.index?-1:R.index===N.index?0:1).map(({exit:R})=>R);return I.length===0&&I.push(cr),I},S=(I,R=!1)=>{const N=im(o(I)),z=hte(N,i,i.currentRuntimeFlags,Hy);return i.currentScheduler.scheduleTask(()=>{R&&z.unsafeInterruptAsFork(i.id()),z.resume(N)},0),z},w=()=>{r||(u-=c.length,c=[]),d=!0,x()},v=n?pY:ri,C=S(ea(I=>{const R=(z,V)=>{z._op==="Blocked"?y.push(z):(p.push({index:V,exit:z}),z._op==="Failure"&&!d&&w())},N=()=>{if(c.length>0){const z=c.pop();let V=l++;const ne=()=>{const oe=c.pop();return V=l++,de(GS(),()=>de(v(a(t(oe,V))),J))},J=oe=>c.length>0&&(R(oe,V),c.length>0)?ne():ve(oe),te=de(v(a(t(z,V))),J),se=S(te);g.push(se),f.add(se),d&&se.currentScheduler.scheduleTask(()=>{se.unsafeInterruptAsFork(i.id())},0),se.addObserver(oe=>{let me;if(oe._op==="Failure"?me=oe:me=oe.effect_instruction_i0,b.push(se),f.delete(se),R(me,V),p.length===u)I(ve(zt(el(_(),{parallel:!0}),()=>cr)));else if(y.length+p.length===u){const Xe=_(),T=y.map(q=>q.effect_instruction_i0).reduce(W$);I(ve(X$(T,Ia([zt(el(Xe,{parallel:!0}),()=>cr),...y.map(q=>q.effect_instruction_i1)],q=>q,n,!0,s))))}else N()})}};for(let z=0;z<h;z++)N()}));return Ns(Mc(Ey(a(Sf(C))),Oy({onFailure:I=>{w();const R=y.length+1,N=Math.min(typeof s=="number"?s:y.length,y.length),z=Array.from(y);return ea(V=>{let ne=0,J=0;const te=(oe,me)=>Xe=>{ne++,ne===R&&V(At(It(I))),z.length>0&&me&&se()},se=()=>{S(z.pop(),!0).addObserver(te(J,!0)),J++};C.addObserver(te(J,!1)),J++;for(let oe=0;oe<N;oe++)se()})},onSuccess:()=>io(b,I=>I.inheritAll)})))}))),ev=(e,t,n,r)=>Ke(()=>{const s=wt(e),a=new Array(s.length);return Zt(Ia(s,(i,c)=>et(n(i,c),u=>a[c]=u),r,!1,t),ve(a))}),EE=e=>fte(e,Hy),Gj=(e,t,n,r=null)=>{const s=Kb(e,t,n,r);return s.resume(e),s},hte=(e,t,n,r=null)=>Kb(e,t,n,r),Kb=(e,t,n,r=null)=>{const s=R$(),a=t.getFiberRefs(),o=bQ(a,s),i=new Hj(s,o,n),c=xf(o,La),u=i.currentSupervisor;return u.onStart(c,e,xe(t),i),i.addObserver(d=>u.onEnd(d,i)),(r!==null?r:F(t.getFiberRef(R_),zt(()=>t.scope()))).add(n,i),i},fte=(e,t)=>gt((n,r)=>ve(Gj(e,n,r.runtimeFlags,t))),NI=e=>Zc(t=>ln(Ci(t,Ai),{onNone:()=>e,onSome:n=>{switch(n.strategy._tag){case"Parallel":return e;case"Sequential":case"ParallelN":return de(so(n,j_),r=>hm(e,r))}}})),RI=e=>t=>Zc(n=>ln(Ci(n,Ai),{onNone:()=>t,onSome:r=>r.strategy._tag==="ParallelN"&&r.strategy.parallelism===e?t:de(so(r,D_(e)),s=>hm(t,s))})),ku=(e,t)=>n=>Zc(r=>ln(Ci(r,Ai),{onNone:()=>n(Ue),onSome:s=>{if(t===!0){const a=e._tag==="Parallel"?NI:e._tag==="Sequential"?PI:RI(e.parallelism);switch(s.strategy._tag){case"Parallel":return a(n(NI));case"Sequential":return a(n(PI));case"ParallelN":return a(n(RI(s.strategy.parallelism)))}}else return n(Ue)}})),Kj=e=>de(Ai,e),Wj=e=>de(TE(),t=>Mc(e(t),n=>t.close(n))),PI=e=>Zc(t=>ln(Ci(t,Ai),{onNone:()=>e,onSome:n=>{switch(n.strategy._tag){case"Sequential":return e;case"Parallel":case"ParallelN":return de(so(n,Mb),r=>hm(e,r))}}})),mte=L(e=>wo(e[1]),(e,t,n)=>dm(e,t,(r,s)=>[r,s],n)),pte=L(e=>wo(e[1]),(e,t,n)=>n?.concurrent!==!0&&(n?.batching===void 0||n.batching===!1)?Ay(e,t):dm(e,t,(r,s)=>r,n)),gte=L(e=>wo(e[1]),(e,t,n)=>n?.concurrent!==!0&&(n?.batching===void 0||n.batching===!1)?Zt(e,t):dm(e,t,(r,s)=>s,n)),dm=L(e=>wo(e[1]),(e,t,n,r)=>et(qj([e,t],{concurrency:r?.concurrent?2:1,batching:r?.batching,concurrentFinalizers:r?.concurrentFinalizers}),([s,a])=>n(s,a))),Ai=Ti("effect/Scope"),Yj=Ai,bte=(e,t)=>{e.state._tag==="Open"&&e.state.finalizers.set({},t)},yte={[J2]:J2,[Q2]:Q2,pipe(){return Ee(this,arguments)},fork(e){return be(()=>{const t=Jj(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),bte(t,s=>be(()=>{this.state._tag==="Open"&&this.state.finalizers.delete(n)})),t})},close(e){return Ke(()=>{if(this.state._tag==="Closed")return Nt;const t=Array.from(this.state.finalizers.values()).reverse();return this.state={_tag:"Closed",exit:e},t.length===0?Nt:dQ(this.strategy)?F(io(t,n=>ri(n(e))),de(n=>F(el(n),$r(Tk),zt(()=>cr)))):hQ(this.strategy)?F(Vj(t,n=>ri(n(e)),!1),de(n=>F(el(n,{parallel:!0}),$r(Tk),zt(()=>cr)))):F(ev(t,this.strategy.parallelism,n=>ri(n(e)),!1),de(n=>F(el(n,{parallel:!0}),$r(Tk),zt(()=>cr))))})},addFinalizer(e){return Ke(()=>this.state._tag==="Closed"?e(this.state.exit):(this.state.finalizers.set({},e),Nt))}},Jj=(e=kc)=>{const t=Object.create(yte);return t.strategy=e,t.state={_tag:"Open",finalizers:new Map},t},TE=(e=kc)=>be(()=>Jj(e)),hm=L(2,(e,t)=>IM(e,Dr(dS(Ai,t)))),kte=e=>Zl(e,{differ:Gee,fork:Nh}),OI=LY(VW),xte=kte(Wy),Qj=L(3,(e,t,n)=>vte(e,t,{onSelfWin:(r,s)=>de(r.await,a=>{switch(a._tag){case qn:return de(r.inheritAll,()=>n.onSelfDone(a,s));case Hn:return n.onSelfDone(a,s)}}),onOtherWin:(r,s)=>de(r.await,a=>{switch(a._tag){case qn:return de(r.inheritAll,()=>n.onOtherDone(a,s));case Hn:return n.onOtherDone(a,s)}})})),_te=L(2,(e,t)=>am(n=>Qj(e,t,{onSelfDone:(r,s)=>L_(r,{onFailure:a=>F(Sf(s),xI(o=>ki(a,o))),onSuccess:a=>F(s,yf(n),Ir(a))}),onOtherDone:(r,s)=>L_(r,{onFailure:a=>F(Sf(s),xI(o=>ki(o,a))),onSuccess:a=>F(s,yf(n),Ir(a))})}))),vte=L(3,(e,t,n)=>gt((r,s)=>{const a=s.runtimeFlags,o=Xf(!0),i=Kb(e,r,a,n.selfScope),c=Kb(t,r,a,n.otherScope);return ea(u=>{i.addObserver(()=>LI(i,c,n.onSelfWin,o,u)),c.addObserver(()=>LI(c,i,n.onOtherWin,o,u)),i.startFork(e),c.startFork(t)},Ah(i.id(),c.id()))})),LI=(e,t,n,r,s)=>{yK(!0,!1)(r)&&s(n(e,t))},Ef=L(2,(e,t)=>ta(n=>Is(n(e),{onFailure:r=>Is(t,{onFailure:s=>Nn(ir(r,s)),onSuccess:()=>Nn(r)}),onSuccess:r=>Ir(t,r)}))),wte=(e,t,n)=>am(r=>de(de(EE(US(e)),s=>ea(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"&&Py(u.result.state.current.effect)&&u.result.state.current.effect._tag==="Failure"&&b$(u.result.state.current.effect.cause)))&&(c.forEach(u=>u()),n?.(),a(KS(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(),be(()=>{c.forEach(u=>u())})})),()=>Ke(()=>{const s=t.flatMap(a=>a.state.completed?[]:[a]);return Ty(s,a=>Dee(a.request,ZY(r)))}))),Ste=yi,Xj=Pc,tv=Ss,Zj=Bs,Ete=ki,Tte=jG,Cte=g$,Wb=b$,Ite=gy,Ate=OS,Nte=x$,Rte=UG,Pte=VY,Ote=by,sd=Ry,Yy=Jl,Lte="effect/ScheduleInterval",Yb=Symbol.for(Lte),e6={[Yb]:Yb,startMillis:0,endMillis:0},t6=(e,t)=>e>t?e6:{[Yb]:Yb,startMillis:e,endMillis:t},$te=L(2,(e,t)=>Mte(e,t)===e),Mte=L(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),jte=e=>e.startMillis>=e.endMillis,Dte=L(2,(e,t)=>{const n=Math.max(e.startMillis,t.startMillis),r=Math.min(e.endMillis,t.endMillis);return t6(n,r)}),Fte=e=>t6(e,Number.POSITIVE_INFINITY),n6=e6,Bte=$te,zte=jte,Ute=Dte,Hte=Fte,qte="effect/ScheduleIntervals",$I=Symbol.for(qte),r6=e=>({[$I]:$I,intervals:e}),Vte=L(2,(e,t)=>Gte(e.intervals,t.intervals,rr())),Gte=(e,t,n)=>{let r=e,s=t,a=n;for(;yo(r)&&yo(s);){const o=F(va(r),Ute(va(s))),i=zte(o)?a:F(a,dr(o));F(va(r),Bte(va(s)))?r=oo(r):s=oo(s),a=i}return r6(bo(a))},nv=e=>F(e.intervals,_S,zt(()=>n6)).startMillis,Kte=e=>F(e.intervals,_S,zt(()=>n6)).endMillis,Wte=L(2,(e,t)=>nv(e)<nv(t)),Yte=e=>yo(e.intervals),Jte=r6,Qte=Vte,Xte=nv,MI=Kte,Zte=Wte,ene=Yte,CE="Continue",s6="Done",tne=e=>({_tag:CE,intervals:e}),nne=e=>({_tag:CE,intervals:Jte(xn(e))}),rne={_tag:s6},sne=e=>e._tag===CE,ane=e=>e._tag===s6,one=tne,ine=nne,Tf=rne,jI=sne,Jb=ane,cne=Ai,Qb=_M,une=Ob,Xb=P_,lne=hm,a6=so,o6=TE;class dne{permits;waiters=new Set;taken=0;constructor(t){this.permits=t}get free(){return this.permits-this.taken}take=t=>Yo(n=>{if(this.free<t){const r=()=>{this.free<t||(this.waiters.delete(r),n(Ke(()=>this.free<t?this.take(t):(this.taken+=t,ve(t)))))};return this.waiters.add(r),be(()=>{this.waiters.delete(r)})}n(Ke(()=>this.free<t?this.take(t):(this.taken+=t,ve(t))))});updateTakenUnsafe(t,n){return this.taken=n(this.taken),this.waiters.size>0&&t.getFiberRef(mE).scheduleTask(()=>{const r=this.waiters.values();let s=r.next();for(;s.done===!1&&this.free>0;)s.value(),s=r.next()},t.getFiberRef(ed)),ve(this.free)}updateTaken(t){return gt(n=>this.updateTakenUnsafe(n,t))}resize=t=>Ns(gt(n=>(this.permits=t,this.free<0?Nt:this.updateTakenUnsafe(n,r=>r))));release=t=>this.updateTaken(n=>n-t);releaseAll=this.updateTaken(t=>0);withPermits=t=>n=>ta(r=>de(r(this.take(t)),s=>Ef(r(n),this.release(s))));withPermitsIfAvailable=t=>n=>ta(r=>Ke(()=>this.free<t?zX:(this.taken+=t,Ef(r(PX(n)),this.release(t)))))}const IE=e=>new dne(e),hne=e=>be(()=>IE(e));class fne extends rd{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(ed))),Nt}flushWaiters=()=>{this.scheduled=!1;const t=this.waiters;this.waiters=[];for(let n=0;n<t.length;n++)t[n](cr)};open=gt(t=>this.isOpen?Nt:(this.isOpen=!0,this.unsafeSchedule(t)));unsafeOpen(){this.isOpen||(this.isOpen=!0,this.flushWaiters())}release=gt(t=>this.isOpen?Nt:this.unsafeSchedule(t));await=Yo(t=>this.isOpen?t(Nt):(this.waiters.push(t),be(()=>{const n=this.waiters.indexOf(t);n!==-1&&this.waiters.splice(n,1)})));unsafeClose(){this.isOpen=!1}close=be(()=>{this.isOpen=!1});whenOpen=t=>Zt(this.await,t)}const mne=e=>new fne(e??!1),pne=L(2,(e,t)=>gt((n,r)=>{const s=t,a=Gj(e,n,r.runtimeFlags,Hy);if(s.state._tag==="Open"){const o=()=>am(c=>Be(c,a.id())?Nt:Ns(KS(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 ve(a)})),gne="effect/Ref/SynchronizedRef",bne=Symbol.for(gne),yne={_A:e=>e};class kne extends rd{ref;withLock;[bne]=yne;[aj]=oj;[zb]=zb;constructor(t,n){super(),this.ref=t,this.withLock=n,this.get=Ca(this.ref)}get;commit(){return this.get}modify(t){return this.modifyEffect(n=>ve(t(n)))}modifyEffect(t){return this.withLock(F(de(Ca(this.ref),t),de(([n,r])=>Ir(nl(this.ref,r),n))))}}const xne=e=>be(()=>i6(e)),i6=e=>{const t=hE(e),n=IE(1);return new kne(t,n.withPermits(1))},_ne=Symbol.for("effect/ManagedRuntime"),vne="Fresh",wne="FromEffect",Sne="Scoped",Ene="Suspend",Tne="Provide",c6="ProvideMerge",Cne="MergeAll",u6=hZ,Ine=mZ,DI=fZ,si=KS,AE=yf,FI=Sf,ad=e=>function(){if(arguments.length===1){const t=arguments[0];return(n,...r)=>e(t,n,...r)}return e.apply(this,arguments)},fm=ad((e,t,n)=>{const r=R$(),s=[[La,[[r,e.context]]]];n?.scheduler&&s.push([mE,[[r,n.scheduler]]]);let a=kQ(e.fiberRefs,{entries:s,forkAs:r});n?.updateRefs&&(a=n.updateRefs(a,r));const o=new Hj(r,a,e.runtimeFlags);let i=t;n?.scope&&(i=de(a6(n.scope,kc),u=>Zt(_M(u,am(l=>Be(l,o.id())?Nt:yf(o,l))),Mc(t,l=>Xb(u,l)))));const c=o.currentSupervisor;return c!==Wy&&(c.onStart(e.context,i,fe(),o),o.addObserver(u=>c.onEnd(u,o))),Hy.add(e.runtimeFlags,o),n?.immediate===!1?o.resume(i):o.start(i),o}),l6=ad((e,t,n={})=>{const r=fm(e,t,n);return n.onExit&&r.addObserver(s=>{n.onExit(s)}),(s,a)=>l6(e)(F(r,AE(s??es)),{...a,onExit:a?.onExit?o=>a.onExit(eZ(o)):void 0})}),d6=ad((e,t)=>{const n=One(e)(t);if(n._tag==="Failure")throw h6(n.effect_instruction_i0);return n.effect_instruction_i0});class Ane 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 Nne=e=>{const t=Error.stackTraceLimit;Error.stackTraceLimit=0;const n=new Ane(e);return Error.stackTraceLimit=t,n},Bg=Symbol.for("effect/Runtime/FiberFailure"),oh=Symbol.for("effect/Runtime/FiberFailure/Cause");class Rne extends Error{[Bg];[oh];constructor(t){const n=v$(t)[0];super(n?.message||"An error has occurred"),this[Bg]=Bg,this[oh]=t,this.name=n?`(FiberFailure) ${n.name}`:"FiberFailure",n?.stack&&(this.stack=n.stack)}toJSON(){return{_id:"FiberFailure",cause:this[oh].toJSON()}}toString(){return"(FiberFailure) "+Jl(this[oh],{renderErrorCause:!0})}[ht](){return this.toString()}}const h6=e=>{const t=Error.stackTraceLimit;Error.stackTraceLimit=0;const n=new Rne(e);return Error.stackTraceLimit=t,n},Pne=e=>Le(e,Bg),f6=e=>{const t=e;switch(t._op){case"Failure":case"Success":return t;case"Left":return kf(t.left);case"Right":return At(t.right);case"Some":return At(t.value);case"None":return kf(new Ry)}},One=ad((e,t)=>{const n=f6(t);if(n)return n;const r=new Uy,s=fm(e)(t,{scheduler:r});r.flush();const a=s.unsafePoll();return a||wM(zS(Nne(s),nE(s)))}),Lne=ad((e,t,n)=>$ne(e,t,n).then(r=>{switch(r._tag){case qn:return r.effect_instruction_i0;case Hn:throw h6(r.effect_instruction_i0)}})),$ne=ad((e,t,n)=>new Promise(r=>{const s=f6(t);s&&r(s);const a=fm(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 m6{context;runtimeFlags;fiberRefs;constructor(t,n,r){this.context=t,this.runtimeFlags=n,this.fiberRefs=r}pipe(){return Ee(this,arguments)}}const p6=e=>new m6(e.context,e.runtimeFlags,e.fiberRefs),Mne=()=>gt((e,t)=>ve(new m6(e.getFiberRef(La),t.runtimeFlags,e.getFiberRefs()))),jne=G$(Xc,q$,H$),Ol=p6({context:Xs(),runtimeFlags:jne,fiberRefs:xQ()}),Dne=fm(Ol),Fne=Lne(Ol),Bne=d6(Ol),zne=L(2,(e,t)=>e.modifyEffect(t)),Une="effect/Layer",g6=Symbol.for(Une),Hne={_RIn:e=>e,_E:e=>e,_ROut:e=>e},Fc={[g6]:Hne,pipe(){return Ee(this,arguments)}},qne="effect/Layer/MemoMap",Nk=Symbol.for(qne),Vne=Jc()("effect/Layer/CurrentMemoMap",{defaultValue:()=>Wne()}),Gne=e=>Le(e,g6),Kne=e=>e._op_layer===vne;class b6{ref;[Nk];constructor(t){this.ref=t,this[Nk]=Nk}getOrElseMemoize(t,n){return F(zne(this.ref,r=>{const s=r.get(t);if(s!==void 0){const[a,o]=s,i=F(a,de(([c,u])=>F(gj(c),Ir(u))),Mc(Oy({onFailure:()=>Nt,onSuccess:()=>Ob(n,o)})));return ve([i,r])}return F(Ub(0),de(a=>F($y(),de(o=>F(Ub(()=>Nt),et(i=>{const c=ta(l=>F(TE(),de(d=>F(l(de(_6(t,d,!0),h=>OX(h(this)))),ri,de(h=>{switch(h._tag){case Hn:return F(TM(o,h.effect_instruction_i0),Zt(P_(d,h)),Zt(Nn(h.effect_instruction_i0)));case qn:return F(nl(i,f=>F(P_(d,f),qS(ij(a,p=>[p===1,p-1])),Ns)),Zt(Hb(a,f=>f+1)),Zt(Ob(n,f=>F(be(()=>r.delete(t)),Zt(Ca(i)),de(p=>p(f))))),Zt(ZS(o,h.effect_instruction_i0)),Ir(h.effect_instruction_i0[1]))}}))))),u=[F(xi(o),Mc(L_({onFailure:()=>Nt,onSuccess:()=>Hb(a,l=>l+1)}))),l=>F(Ca(i),de(d=>d(l)))];return[c,Kne(t)?r:r.set(t,u)]}))))))}),Ey)}}const y6=Ke(()=>et(xne(new Map),e=>new b6(e))),Wne=()=>new b6(i6(new Map)),k6=L(2,(e,t)=>de(y6,n=>x6(e,n,t))),x6=L(3,(e,t,n)=>de(_6(e,n),r=>bj(r(t),Vne,t))),_6=(e,t,n=!1)=>{const r=e;switch(r._op_layer){case"Locally":return be(()=>s=>r.f(s.getOrElseMemoize(r.self,t)));case"ExtendScope":return be(()=>s=>Kj(a=>s.getOrElseMemoize(r.layer,a)));case"Fold":return be(()=>s=>F(s.getOrElseMemoize(r.layer,t),Is({onFailure:a=>s.getOrElseMemoize(r.failureK(a),t),onSuccess:a=>s.getOrElseMemoize(r.successK(a),t)})));case"Fresh":return be(()=>s=>F(r.layer,k6(t)));case"FromEffect":return be(n?()=>s=>r.effect:()=>s=>s.getOrElseMemoize(e,t));case"Provide":return be(()=>s=>F(s.getOrElseMemoize(r.first,t),de(a=>F(s.getOrElseMemoize(r.second,t),Dy(a)))));case"Scoped":return be(n?()=>s=>hm(r.effect,t):()=>s=>s.getOrElseMemoize(e,t));case"Suspend":return be(()=>s=>s.getOrElseMemoize(r.evaluate(),t));case"ProvideMerge":return be(()=>s=>F(s.getOrElseMemoize(r.first,t),fM(s.getOrElseMemoize(r.second,t),r.zipK)));case"ZipWith":return dM(function*(){const s=yield*so(t,M_),a=yield*so(s,kc),o=yield*so(s,kc);return i=>F(i.getOrElseMemoize(r.first,a),dm(i.getOrElseMemoize(r.second,o),r.zipK,{concurrent:!0}))});case"MergeAll":{const s=r.layers;return et(so(t,M_),a=>o=>{const i=new Array(s.length);return et(Ia(s,hM(function*(c,u){const l=yield*so(a,kc),d=yield*o.getOrElseMemoize(c,l);i[u]=d}),!1,!1),()=>Wq(...i))})}}},Yne=()=>v6(eE()),Jne=L(2,(e,t)=>{const n=NL(e),r=n?e:t;return v6(et(n?t:e,a=>dS(r,a)))});function v6(e){const t=Object.create(Fc);return t._op_layer=wne,t.effect=e,t}const w6=(...e)=>{const t=Object.create(Fc);return t._op_layer=Cne,t.layers=e,t},Qne=L(2,(e,t)=>{const n=NL(e),r=n?e:t;return Xne(et(n?t:e,a=>dS(r,a)))}),Xne=e=>{const t=Object.create(Fc);return t._op_layer=Sne,t.effect=e,t},Zne=e=>{const t=Object.create(Fc);return t._op_layer=Ene,t.evaluate=e,t},S6=L(2,(e,t)=>Zne(()=>{const n=Object.create(Fc);return n._op_layer=Tne,n.first=Object.create(Fc,{_op_layer:{value:c6,enumerable:!0},first:{value:Yne(),enumerable:!0},second:{value:Array.isArray(t)?w6(...t):t},zipK:{value:(r,s)=>F(r,Dr(s))}}),n.second=e,n})),ere=L(2,(e,t)=>{const n=Object.create(Fc);return n._op_layer=c6,n.first=t,n.second=S6(e,t),n.zipK=(r,s)=>F(r,Dr(s)),n}),BI=L(2,(e,t)=>Wj(n=>de(k6(t,n),r=>tE(e,r)))),zI=L(2,(e,t)=>{const n=_f(Ol.fiberRefs,t.fiberRefs),r=ni(Ol.runtimeFlags,t.runtimeFlags);return ta(s=>gt(a=>{const o=a.getFiberRef(La),i=a.getFiberRefs(),c=vf(a.id(),i)(n),u=a.currentRuntimeFlags,l=Zu(r)(u),d=_f(c,i),h=ni(l,u);return a.setFiberRefs(c),a.currentRuntimeFlags=l,Ef(tE(s(e),Dr(o,t.context)),gt(f=>(f.setFiberRefs(vf(f.id(),f.getFiberRefs())(d)),f.currentRuntimeFlags=Zu(h)(f.currentRuntimeFlags),Nt)))}))}),tre=L(2,(e,t)=>Array.isArray(t)?BI(e,w6(...t)):Gne(t)?BI(e,t):Kq(t)?tE(e,t):_ne in t?de(t.runtimeEffect,n=>zI(e,n)):zI(e,t)),NE=(function(){const e=Symbol.for("effect/Data/Error/plainArgs");return{BaseEffectError:class extends YS{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})(),od=e=>{const t={BaseEffectError:class extends NE{_tag=e}};return t.BaseEffectError.prototype.name=e,t.BaseEffectError},nre="effect/Schedule",E6=Symbol.for(nre),rre=e=>Le(e,E6),sre="effect/ScheduleDriver",are=Symbol.for(sre),rv={start:0,now:0,input:void 0,output:void 0,elapsed:Sl,elapsedSincePrevious:Sl,recurrence:0},UI=Jc()("effect/Schedule/CurrentIterationMetadata",{defaultValue:()=>rv}),ore={_Out:e=>e,_In:e=>e,_R:e=>e},ire={_Out:e=>e,_In:e=>e,_R:e=>e};class cre{initial;step;[E6]=ore;constructor(t,n){this.initial=t,this.step=n}pipe(){return Ee(this,arguments)}}const HI=(e,t,n,r)=>Hb(e,s=>s.recurrence===0?{now:t,input:n,output:r,recurrence:s.recurrence+1,elapsed:Sl,elapsedSincePrevious:Sl,start:t}:{now:t,input:n,output:r,recurrence:s.recurrence+1,elapsed:El(t-s.start),elapsedSincePrevious:El(t-s.now),start:s.start});class ure{schedule;ref;[are]=ire;constructor(t,n){this.schedule=t,this.ref=n}get state(){return et(Ca(this.ref),t=>t[1])}get last(){return de(Ca(this.ref),([t,n])=>{switch(t._tag){case"None":return wy(()=>new Ry);case"Some":return ve(t.value)}})}iterationMeta=hE(rv);get reset(){return nl(this.ref,[fe(),this.schedule.initial]).pipe(Ay(nl(this.iterationMeta,rv)))}next(t){return F(et(Ca(this.ref),n=>n[1]),de(n=>F(TX,de(r=>F(Ke(()=>this.schedule.step(r,t,n)),de(([s,a,o])=>{const i=nl(this.ref,[xe(a),s]);if(Jb(o))return i.pipe(Zt(an(fe())));const c=Xte(o.intervals)-r;if(c<=0)return i.pipe(Zt(HI(this.iterationMeta,r,t,a)),Ir(a));const u=El(c);return F(i,Zt(HI(this.iterationMeta,r,t,a)),Zt(BX(u)),Ir(a))}))))))}}const mm=(e,t)=>new cre(e,t),lre=L(2,(e,t)=>RE(e,(n,r)=>be(()=>t(n,r)))),RE=L(2,(e,t)=>mm(e.initial,(n,r,s)=>de(e.step(n,r,s),([a,o,i])=>Jb(i)?ve([a,o,Tf]):et(t(r,o),c=>c?[a,o,i]:[a,o,Tf])))),dre=e=>F(Ub([fe(),e.initial]),et(t=>new ure(e,t))),hre=L(2,(e,t)=>fre(e,t,Qte)),fre=L(3,(e,t,n)=>mm([e.initial,t.initial],(r,s,a)=>F(fM(e.step(r,s,a[0]),t.step(r,s,a[1]),(o,i)=>[o,i]),de(([[o,i,c],[u,l,d]])=>jI(c)&&jI(d)?sv(e,t,s,o,i,c.intervals,u,l,d.intervals,n):ve([[o,u],[i,l],Tf]))))),sv=(e,t,n,r,s,a,o,i,c,u)=>{const l=u(a,c);return ene(l)?ve([[r,o],[s,i],one(l)]):F(a,Zte(c))?de(e.step(MI(a),n,r),([d,h,f])=>Jb(f)?ve([[d,o],[h,i],Tf]):sv(e,t,n,d,h,f.intervals,o,i,c,u)):de(t.step(MI(c),n,o),([d,h,f])=>Jb(f)?ve([[r,d],[s,h],Tf]):sv(e,t,n,r,s,a,d,h,f.intervals,u))},mre=L(2,(e,t)=>pre(e,n=>be(()=>t(n)))),pre=L(2,(e,t)=>mm(e.initial,(n,r,s)=>de(e.step(n,r,s),([a,o,i])=>et(t(o),c=>[a,c,i])))),gre=e=>mm(e.initial,(t,n,r)=>F(e.step(t,n,r),et(([s,a,o])=>[s,n,o]))),bre=e=>_re(C6,t=>t<e),yre=(e,t)=>mm(e,(n,r,s)=>be(()=>[t(s),s,ine(Hte(n))])),kre=L(2,(e,t)=>RE(e,(n,r)=>jX(t(n)))),xre=L(2,(e,t)=>RE(e,(n,r)=>t(n))),_re=L(2,(e,t)=>lre(e,(n,r)=>t(r))),zg=Symbol.for("effect/Schedule/ScheduleDefect");class vre{error;[zg];constructor(t){this.error=t,this[zg]=zg}}const wre=e=>Le(e,zg),qI=e=>bf(e,t=>Jo(new vre(t))),Sre=e=>ln(LS(e,t=>g$(t)&&wre(t.defect)?xe(t.defect):fe()),{onNone:()=>e,onSome:t=>Pc(t.error)}),Ere=e=>rM(e,t=>Nn(Sre(t))),VI=L(2,(e,t)=>Cre(e,t,(n,r)=>an(n))),Tre=L(2,(e,t)=>{if(rre(t))return VI(e,t);const n=t.schedule??gre(C6),r=t.while?xre(n,o=>{const i=t.while(o);return typeof i=="boolean"?ve(i):qI(i)}):n,s=t.until?kre(r,o=>{const i=t.until(o);return typeof i=="boolean"?ve(i):qI(i)}):r,a=t.times?hre(s,bre(t.times)).pipe(mre(o=>o[0])):s;return Ere(VI(e,a))}),Cre=L(3,(e,t,n)=>de(dre(t),r=>ko(e,{onFailure:s=>n(s,fe()),onSuccess:s=>T6(_I(e,UI,Ca(r.iterationMeta)),r,(a,o)=>_I(n(a,o),UI,Ca(r.iterationMeta)),s)}))),T6=(e,t,n,r)=>ko(t.next(r),{onFailure:()=>gY(t.last),onSuccess:s=>ko(e,{onFailure:a=>n(a,xe(s)),onSuccess:a=>T6(e,t,n,a)})}),C6=yre(0,e=>e+1),wa=$y,vr=xi,Ire=EM,Are=TM,av=rJ,uo=ZS,Nre=jy,GI=Symbol.for("effect/MutableList"),Rre={[GI]:GI,[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 Lt(this.toJSON())},toJSON(){return{_id:"MutableList",values:Array.from(this).map(Wt)}},[ht](){return this.toJSON()},pipe(){return Ee(this,arguments)}},Pre=e=>({value:e,removed:!1,prev:void 0,next:void 0}),Ore=()=>{const e=Object.create(Rre);return e.head=void 0,e.tail=void 0,e._length=0,e},I6=e=>PE(e)===0,PE=e=>e._length,Lre=L(2,(e,t)=>{const n=Pre(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}),$re=e=>{const t=e.head;if(t!==void 0)return Mre(e,t),t.value},Mre=(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))},KI=Symbol.for("effect/MutableQueue"),Or=Symbol.for("effect/mutable/MutableQueue/Empty"),jre={[KI]:KI,[Symbol.iterator](){return Array.from(this.queue)[Symbol.iterator]()},toString(){return Lt(this.toJSON())},toJSON(){return{_id:"MutableQueue",values:Array.from(this).map(Wt)}},[ht](){return this.toJSON()},pipe(){return Ee(this,arguments)}},A6=e=>{const t=Object.create(jre);return t.queue=Ore(),t.capacity=e,t},Dre=e=>A6(e),OE=()=>A6(void 0),LE=e=>PE(e.queue),ov=e=>I6(e.queue),Fre=e=>e.capacity===void 0?1/0:e.capacity,Cf=L(2,(e,t)=>{const n=PE(e.queue);return e.capacity!==void 0&&n===e.capacity?!1:(Lre(t)(e.queue),!0)}),N6=L(2,(e,t)=>{const n=t[Symbol.iterator]();let r,s=rr(),a=!0;for(;a&&(r=n.next())&&!r.done;)a=Cf(r.value)(e);for(;r!=null&&!r.done;)s=dr(r.value)(s),r=n.next();return bo(s)}),ai=L(2,(e,t)=>I6(e.queue)?t:$re(e.queue)),$E=L(2,(e,t)=>{let n=rr(),r=0;for(;r<t;){const s=ai(Or)(e);if(s===Or)break;n=dr(s)(n),r+=1}return bo(n)}),iv=$c,Ni=wo,Rk=MX,Bre=qj,Aa=Pl,cv=ea,Zb=gt,$a=an,Ks=Nn,zre=sM,rl=dM,oi=_Y,Ure=FX,Pt=ve,on=Ke,Mt=be,dt=Nt,R6=bf,ME=rM,Hre=$X,qre=fj,Vre=qX,sl=HX,Ji=eo,zs=US,Gre=om,ih=im,e0=ta,Pk=Ir,jE=Ns,St=et,DE=Cy,t0=ite,Kre=tM,qu=Ef,Jy=Yj,Wre=Kj,uv=Wj,Yre=am,Jre=EE,xc=pne,P6=eE,O6=IM,If=tre,Qre=KX,xu=Il,er=ri,L6=cM,Xre=GX,Me=de,$u=Ey,Ok=_te,$6=Qj,M6=HS,j6=UX,WI=Tre,Zre=Xl,ese=mj,lv=oM,Us=Is,tse=ko,pm=Mne,nse=IE,rse=hne,sse=mne,Qy=Dne,FE=Fne,Es=Bne,n0=mte,BE=pte,Xn=gte,Xy=dm,ase=JX,ose=QX,ise=hM,Zy=fm,cse=d6,use=l6,e1=Ol,zE=p6,lse=oh,dse=Pne,dv=Symbol.for("effect/FiberHandle"),hse=e=>Le(e,dv),fse={[dv]:dv,toString(){return Lt(this.toJSON())},toJSON(){return{_id:"FiberHandle",state:this.state}},[ht](){return this.toJSON()},pipe(){return Ee(this,arguments)}},mse=e=>{const t=Object.create(fse);return t.state={_tag:"Open",fiber:void 0},t.deferred=e,t},pse=()=>t0(St(wa(),e=>mse(e)),e=>Zb(t=>{const n=e.state;return n._tag==="Closed"?dt:(e.state={_tag:"Closed"},n.fiber?L6(jE(AE(n.fiber,Ah(t.id(),Ug))),e.deferred):Ire(e.deferred,gE))})),gse=()=>Me(pse(),e=>kse(e)()),D6=-1,Ug=TK(D6,0),bse=Ote(void 0,{emptyCase:fo,failCase:fo,dieCase:fo,interruptCase:(e,t)=>h$(N$(t),D6),sequentialCase:(e,t,n)=>t||n,parallelCase:(e,t,n)=>t||n}),yse=L(e=>hse(e[0]),(e,t,n)=>{if(e.state._tag==="Closed"){t.unsafeInterruptAsFork(Ah(n?.interruptAs??es,Ug));return}else if(e.state.fiber!==void 0){if(n?.onlyIfMissing===!0){t.unsafeInterruptAsFork(Ah(n?.interruptAs??es,Ug));return}else if(e.state.fiber===t)return;e.state.fiber.unsafeInterruptAsFork(Ah(n?.interruptAs??es,Ug)),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),pE(r)&&(n?.propagateInterruption===!0?!bse(r.cause):!Ite(r.cause))&&Nre(e.deferred,r)})}),YI=(function(){let e;return()=>(e===void 0&&(e=Qy(Ji)),e)})(),kse=e=>()=>St(pm(),t=>{const n=Zy(t);return(r,s)=>{if(e.state._tag==="Closed")return YI();if(e.state.fiber!==void 0&&s?.onlyIfMissing===!0)return YI();const a=n(r,s);return yse(e,a,s),a}}),xse=Jne,_se=Qne,vse=S6,Lk=ere,wse=y6,JI=x6,UE=Rn,F6=La,Sse=kM,Ese="effect/QueueEnqueue",Tse=Symbol.for(Ese),Cse="effect/QueueDequeue",Ise=Symbol.for(Cse),Ase="effect/QueueStrategy",B6=Symbol.for(Ase),Nse="effect/BackingQueue",Rse=Symbol.for(Nse),z6={_A:e=>e},Pse={_A:e=>e},Ose={_In:e=>e},Lse={_Out:e=>e};class $se extends rd{queue;takers;shutdownHook;shutdownFlag;strategy;[Tse]=Ose;[Ise]=Lse;constructor(t,n,r,s,a){super(),this.queue=t,this.takers=n,this.shutdownHook=r,this.shutdownFlag=s,this.strategy=a}pipe(){return Ee(this,arguments)}commit(){return this.take}capacity(){return this.queue.capacity()}get size(){return Ke(()=>bf(this.unsafeSize(),()=>eo))}unsafeSize(){return Sn(this.shutdownFlag)?fe():xe(this.queue.length()-LE(this.takers)+this.strategy.surplusSize())}get isEmpty(){return et(this.size,t=>t<=0)}get isFull(){return et(this.size,t=>t>=this.capacity())}get shutdown(){return im(gt(t=>(F(this.shutdownFlag,Zf(!0)),F(Ia(al(this.takers),n=>CM(n,t.id()),!1,!1),Zt(this.strategy.shutdown),qS(ZS(this.shutdownHook,void 0)),Ns))))}get isShutdown(){return be(()=>Sn(this.shutdownFlag))}get awaitShutdown(){return xi(this.shutdownHook)}isActive(){return!Sn(this.shutdownFlag)}unsafeOffer(t){if(Sn(this.shutdownFlag))return!1;let n;if(this.queue.length()===0){const s=F(this.takers,ai(Or));s!==Or?(_c(s,t),n=!0):n=!1}else n=!1;if(n)return!0;const r=this.queue.offer(t);return Vu(this.strategy,this.queue,this.takers),r}offer(t){return Ke(()=>{if(Sn(this.shutdownFlag))return eo;let n;if(this.queue.length()===0){const s=F(this.takers,ai(Or));s!==Or?(_c(s,t),n=!0):n=!1}else n=!1;if(n)return ve(!0);const r=this.queue.offer(t);return Vu(this.strategy,this.queue,this.takers),r?ve(!0):this.strategy.handleSurplus([t],this.queue,this.takers,this.shutdownFlag)})}offerAll(t){return Ke(()=>{if(Sn(this.shutdownFlag))return eo;const n=wt(t),r=this.queue.length()===0?wt(Qse(this.takers,n.length)):gi,[s,a]=F(n,KL(r.length));for(let i=0;i<r.length;i++){const c=r[i],u=s[i];_c(c,u)}if(a.length===0)return ve(!0);const o=this.queue.offerAll(a);return Vu(this.strategy,this.queue,this.takers),xS(o)?ve(!0):this.strategy.handleSurplus(o,this.queue,this.takers,this.shutdownFlag)})}get take(){return gt(t=>{if(Sn(this.shutdownFlag))return eo;const n=this.queue.poll(Or);if(n!==Or)return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),ve(n);{const r=Ly(t.id());return F(Ke(()=>(F(this.takers,Cf(r)),Vu(this.strategy,this.queue,this.takers),Sn(this.shutdownFlag)?eo:xi(r))),om(()=>be(()=>Xse(this.takers,r))))}})}get takeAll(){return Ke(()=>Sn(this.shutdownFlag)?eo:be(()=>{const t=this.queue.pollUpTo(Number.POSITIVE_INFINITY);return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),bl(t)}))}takeUpTo(t){return Ke(()=>Sn(this.shutdownFlag)?eo:be(()=>{const n=this.queue.pollUpTo(t);return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),bl(n)}))}takeBetween(t,n){return Ke(()=>U6(this,t,n,rr()))}}const U6=(e,t,n,r)=>n<t?ve(r):F(Vse(e,n),de(s=>{const a=t-s.length;return a===1?F(hv(e),et(o=>F(r,yn(s),p_(o)))):a>1?F(hv(e),de(o=>U6(e,a-1,n-s.length-1,F(r,yn(s),p_(o))))):ve(F(r,yn(s)))})),Mse=e=>F(be(()=>Dre(e)),de(t=>H6(q6(t),Kse()))),jse=()=>F(be(()=>OE()),de(e=>H6(q6(e),Wse()))),Dse=(e,t,n,r,s)=>new $se(e,t,n,r,s),H6=(e,t)=>F($y(),et(n=>Dse(e,OE(),n,Xf(!1),t)));class Fse{mutable;[Rse]=Pse;constructor(t){this.mutable=t}poll(t){return ai(this.mutable,t)}pollUpTo(t){return $E(this.mutable,t)}offerAll(t){return N6(this.mutable,t)}offer(t){return Cf(this.mutable,t)}capacity(){return Fre(this.mutable)}length(){return LE(this.mutable)}}const q6=e=>new Fse(e),Bse=e=>e.size,zse=e=>e.isShutdown,Use=e=>e.shutdown,Hse=L(2,(e,t)=>e.offer(t)),qse=L(2,(e,t)=>e.unsafeOffer(t)),hv=e=>e.take,Vse=L(2,(e,t)=>e.takeUpTo(t)),Gse=L(3,(e,t,n)=>e.takeBetween(t,n)),Kse=()=>new Yse,Wse=()=>new Jse;class Yse{[B6]=z6;putters=OE();surplusSize(){return LE(this.putters)}onCompleteTakersWithEmptyQueue(t){for(;!ov(this.putters)&&!ov(t);){const n=ai(t,void 0),r=ai(this.putters,void 0);r[2]&&_c(r[1],!0),_c(n,r[0])}}get shutdown(){return F(Sy,de(t=>F(be(()=>al(this.putters)),de(n=>Ia(n,([r,s,a])=>a?F(CM(s,t),Ns):Nt,!1,!1)))))}handleSurplus(t,n,r,s){return gt(a=>{const o=Ly(a.id());return F(Ke(()=>(this.unsafeOffer(t,o),this.unsafeOnQueueEmptySpace(n,r),Vu(this,n,r),Sn(s)?eo:xi(o))),om(()=>be(()=>this.unsafeRemove(o))))})}unsafeOnQueueEmptySpace(t,n){let r=!0;for(;r&&(t.capacity()===Number.POSITIVE_INFINITY||t.length()<t.capacity());){const s=F(this.putters,ai(Or));if(s===Or)r=!1;else{const a=t.offer(s[0]);a&&s[2]?_c(s[1],!0):a||r0(this.putters,F(al(this.putters),dr(s))),Vu(this,t,n)}}}unsafeOffer(t,n){const r=wt(t);for(let s=0;s<r.length;s++){const a=r[s];s===r.length-1?F(this.putters,Cf([a,n,!0])):F(this.putters,Cf([a,n,!1]))}}unsafeRemove(t){r0(this.putters,F(al(this.putters),kS(([,n])=>n!==t)))}}class Jse{[B6]=z6;surplusSize(){return 0}get shutdown(){return Nt}onCompleteTakersWithEmptyQueue(){}handleSurplus(t,n,r,s){return ve(!1)}unsafeOnQueueEmptySpace(t,n){}}const _c=(e,t)=>jy(e,ve(t)),r0=(e,t)=>F(e,N6(t)),al=e=>F(e,$E(Number.POSITIVE_INFINITY)),Qse=(e,t)=>F(e,$E(t)),Xse=(e,t)=>{r0(e,F(al(e),kS(n=>t!==n)))},Vu=(e,t,n)=>{let r=!0;for(;r&&t.length()!==0;){const s=F(n,ai(Or));if(s!==Or){const a=t.poll(Or);a!==Or?(_c(s,a),e.unsafeOnQueueEmptySpace(t,n)):r0(n,F(al(n),dr(s))),r=!0}else r=!1}r&&t.length()===0&&!ov(n)&&e.onCompleteTakersWithEmptyQueue(n)},Zse=L(2,(e,t)=>e.publish(t)),eae=Zse,V6=Mse,tae=jse,nae=Bse,rae=zse,s0=Use,_u=Hse,sae=qse,QI=hv,aae=Gse,G6="Continue",oae="Close",iae="Yield",cae="effect/ChannelChildExecutorDecision",XI=Symbol.for(cae),uae={[XI]:XI},K6=e=>{const t=Object.create(uae);return t._tag=G6,t},Hg="ContinuationK",lae="ContinuationFinalizer",W6=Symbol.for("effect/ChannelContinuation"),Y6={_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 J6{onSuccess;onHalt;_tag=Hg;[W6]=Y6;constructor(t,n){this.onSuccess=t,this.onHalt=n}onExit(t){return pE(t)?this.onHalt(t.cause):this.onSuccess(t.value)}}class dae{finalizer;_tag=lae;[W6]=Y6;constructor(t){this.finalizer=t}}const Q6="PullAfterNext",hae="PullAfterAllEnqueued",fae="effect/ChannelUpstreamPullStrategy",mae=Symbol.for(fae),pae={_A:e=>e},gae={[mae]:pae},X6=e=>{const t=Object.create(gae);return t._tag=Q6,t.emitSeparator=e,t},Z6="BracketOut",eD="Bridge",HE="ConcatAll",tD="Emit",nD="Ensuring",rD="Fail",sD="Fold",aD="FromEffect",oD="PipeTo",bae="Provide",iD="Read",cD="Succeed",uD="SucceedNow",lD="Suspend",yae="effect/Channel",dD=Symbol.for(yae),kae={_Env:e=>e,_InErr:e=>e,_InElem:e=>e,_InDone:e=>e,_OutErr:e=>e,_OutElem:e=>e,_OutDone:e=>e},Br={[dD]:kae,pipe(){return Ee(this,arguments)}},hD=e=>Le(e,dD)||Ni(e),xae=L(2,(e,t)=>{const n=Object.create(Br);return n._tag=Z6,n.acquire=()=>e,n.finalizer=t,n}),fD=(e,t,n)=>{const r=Object.create(Br);return r._tag=HE,r.combineInners=t,r.combineAll=n,r.onPull=()=>X6(fe()),r.onEmit=()=>K6,r.value=()=>e,r.k=Ue,r},_ae=L(4,(e,t,n,r)=>{const s=Object.create(Br);return s._tag=HE,s.combineInners=n,s.combineAll=r,s.onPull=()=>X6(fe()),s.onEmit=()=>K6,s.value=()=>e,s.k=t,s}),mD=L(2,(e,t)=>{const n=Object.create(Br);return n._tag=eD,n.input=t,n.channel=e,n}),vae=L(2,(e,t)=>{const n=Object.create(Br);return n._tag=nD,n.channel=e,n.finalizer=t,n}),qE=e=>ts(Xj(e)),ts=e=>wae(()=>e),wae=e=>{const t=Object.create(Br);return t._tag=rD,t.error=e,t},kn=L(2,(e,t)=>{const n=Object.create(Br);return n._tag=sD,n.channel=e,n.k=new J6(t,ts),n}),yr=e=>{const t=Object.create(Br);return t._tag=aD,t.effect=()=>e,t},Ws=L(2,(e,t)=>{const n=Object.create(Br);return n._tag=oD,n.left=()=>e,n.right=()=>t,n}),pD=e=>id({onInput:e.onInput,onFailure:t=>Lr(Nte(t),{onLeft:e.onFailure,onRight:ts}),onDone:e.onDone}),id=e=>{const t=Object.create(Br);return t._tag=iD,t.more=e.onInput,t.done=new J6(e.onDone,e.onFailure),t},gD=e=>GE(()=>e),Af=e=>{const t=Object.create(Br);return t._tag=uD,t.terminal=e,t},VE=e=>{const t=Object.create(Br);return t._tag=lD,t.channel=e,t},GE=e=>{const t=Object.create(Br);return t._tag=cD,t.evaluate=e,t},So=Af(void 0),tr=e=>{const t=Object.create(Br);return t._tag=tD,t.out=e,t},gm="Done",bm="Emit",cd="FromEffect",ym="Read",Sae=Symbol.for("effect/ChannelState"),Eae={_E:e=>e,_R:e=>e},t1={[Sae]:Eae},vu=()=>{const e=Object.create(t1);return e._tag=gm,e},$k=()=>{const e=Object.create(t1);return e._tag=bm,e},Md=e=>{const t=Object.create(t1);return t._tag=cd,t.effect=e,t},Mk=(e,t,n,r)=>{const s=Object.create(t1);return s._tag=ym,s.upstream=e,s.onEffect=t,s.onEmit=n,s.onDone=r,s},a0=e=>e._tag===cd,Tae=e=>a0(e)?e.effect:dt,ZI=e=>a0(e)?Hre(e.effect):void 0,bD="PullFromChild",fv="PullFromUpstream",mv="DrainChildExecutors",yD="Emit";class sp{childExecutor;parentSubexecutor;onEmit;_tag=bD;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?Xy(er(n),er(r),(s,a)=>F(s,wf(a))):n!==void 0?n:r!==void 0?r:void 0}enqueuePullFromChild(t){return this}}class ec{upstreamExecutor;createChild;lastDone;activeChildExecutors;combineChildResults;combineWithChildResult;onPull;onEmit;_tag=fv;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?Xy(a,er(o),(i,c)=>wf(i,c)):a!==void 0?a:o!==void 0?er(o):void 0,void 0);return s}enqueuePullFromChild(t){return new ec(this.upstreamExecutor,this.createChild,this.lastDone,[...this.activeChildExecutors,t],this.combineChildResults,this.combineWithChildResult,this.onPull,this.onEmit)}}class Gu{upstreamExecutor;lastDone;activeChildExecutors;upstreamDone;combineChildResults;combineWithChildResult;onPull;_tag=mv;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?Xy(a,er(o),(i,c)=>wf(i,c)):a!==void 0?a:o!==void 0?er(o):void 0,void 0);return s}enqueuePullFromChild(t){return new Gu(this.upstreamExecutor,this.lastDone,[...this.activeChildExecutors,t],this.upstreamDone,this.combineChildResults,this.combineWithChildResult,this.onPull)}}class jk{value;next;_tag=yD;constructor(t,n){this.value=t,this.next=n}close(t){const n=this.next.close(t);return n}enqueuePullFromChild(t){return this}}const Cae="Pulled",Iae="NoUpstream",Aae="effect/ChannelUpstreamPullRequest",Nae=Symbol.for(Aae),Rae={_A:e=>e},kD={[Nae]:Rae},eA=e=>{const t=Object.create(kD);return t._tag=Cae,t.value=e,t},Pae=e=>{const t=Object.create(kD);return t._tag=Iae,t.activeDownstreamCount=e,t};class cc{_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=vu();else switch(Ni(this._currentChannel)&&(this._currentChannel=yr(this._currentChannel)),this._currentChannel._tag){case Z6:{t=this.runBracketOut(this._currentChannel);break}case eD:{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=()=>Me(n.awaitRead(),()=>on(()=>{const a=r.run();switch(a._tag){case gm:return co(r.getDone(),{onFailure:o=>n.error(o),onSuccess:o=>n.done(o)});case bm:return Me(n.emit(r.getEmit()),()=>s());case cd:return Us(a.effect,{onFailure:o=>n.error(o),onSuccess:()=>s()});case ym:return KE(a,()=>s(),o=>n.error(o))}}));t=Md(Me(Jre(zs(s())),a=>Mt(()=>this.addFinalizer(o=>Me(si(a),()=>on(()=>{const i=this.restorePipe(o,r);return i!==void 0?i:dt}))))))}break}case HE:{const n=new cc(this._currentChannel.value(),this._providedEnv,s=>Mt(()=>{const a=this._closeLastSubstream===void 0?dt:this._closeLastSubstream;this._closeLastSubstream=F(a,Xn(s))}));n._input=this._input;const r=this._currentChannel;this._activeSubexecutor=new ec(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 tD:{this._emitted=this._currentChannel.out,this._currentChannel=this._activeSubexecutor!==void 0?void 0:So,t=$k();break}case nD:{this.runEnsuring(this._currentChannel);break}case rD:{t=this.doneHalt(this._currentChannel.error());break}case sD:{this._doneStack.push(this._currentChannel.k),this._currentChannel=this._currentChannel.channel;break}case aD:{const n=this._providedEnv===void 0?this._currentChannel.effect():F(this._currentChannel.effect(),If(this._providedEnv));t=Md(Us(n,{onFailure:r=>{const s=this.doneHalt(r);return s!==void 0&&a0(s)?s.effect:dt},onSuccess:r=>{const s=this.doneSucceed(r);return s!==void 0&&a0(s)?s.effect:dt}}));break}case oD:{const n=this._input,r=new cc(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:dt}),this._currentChannel=this._currentChannel.right();break}case bae:{const n=this._providedEnv;this._providedEnv=this._currentChannel.context(),this._currentChannel=this._currentChannel.inner,this.addFinalizer(()=>Mt(()=>{this._providedEnv=n}));break}case iD:{const n=this._currentChannel;t=Mk(this._input,Ue,r=>{try{this._currentChannel=n.more(r)}catch(s){this._currentChannel=n.done.onExit(ZX(s))}},r=>{const s=a=>n.done.onExit(a);this._currentChannel=s(r)});break}case cD:{t=this.doneSucceed(this._currentChannel.evaluate());break}case uD:{t=this.doneSucceed(this._currentChannel.terminal);break}case lD:{this._currentChannel=this._currentChannel.channel();break}}}catch(n){this._currentChannel=ts(tv(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?dt:Fk(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===Hg)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):dt}close(t){let n;const r=this._inProgressFinalizer;r!==void 0&&(n=F(r,qu(Mt(()=>this.clearInProgressFinalizer()))));let s;const a=this.popAllFinalizers(t);a!==void 0&&(s=F(a,qu(Mt(()=>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 F(er(Dk(o)),n0(er(Dk(n))),n0(er(Dk(s))),St(([[i,c],u])=>F(i,wf(c),wf(u))),ih,Me(i=>on(()=>i)))}doneSucceed(t){if(this._doneStack.length===0)return this._done=Jr(t),this._currentChannel=void 0,vu();const n=this._doneStack[this._doneStack.length-1];if(n._tag===Hg){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=Jr(t),this._currentChannel=void 0,vu();const s=Fk(r.map(o=>o.finalizer),Jr(t));this.storeInProgressFinalizer(s);const a=F(s,qu(Mt(()=>this.clearInProgressFinalizer())),ih,Me(()=>Mt(()=>this.doneSucceed(t))));return Md(a)}doneHalt(t){if(this._doneStack.length===0)return this._done=ur(t),this._currentChannel=void 0,vu();const n=this._doneStack[this._doneStack.length-1];if(n._tag===Hg){this._doneStack.pop();try{this._currentChannel=n.onHalt(t)}catch(o){this._currentChannel=ts(tv(o))}return}const r=this.popNextFinalizers();if(this._doneStack.length===0)return this._doneStack=r.reverse(),this._done=ur(t),this._currentChannel=void 0,vu();const s=Fk(r.map(o=>o.finalizer),ur(t));this.storeInProgressFinalizer(s);const a=F(s,qu(Mt(()=>this.clearInProgressFinalizer())),ih,Me(()=>Mt(()=>this.doneHalt(t))));return Md(a)}processCancellation(){return this._currentChannel=void 0,this._done=this._cancelled,this._cancelled=void 0,vu()}runBracketOut(t){const n=ih(Us(this.provide(t.acquire()),{onFailure:r=>Mt(()=>{this._currentChannel=ts(r)}),onSuccess:r=>Mt(()=>{this.addFinalizer(s=>this.provide(t.finalizer(r,s))),this._currentChannel=tr(r)})}));return Md(n)}provide(t){return this._providedEnv===void 0?t:F(t,If(this._providedEnv))}runEnsuring(t){this.addFinalizer(t.finalizer),this._currentChannel=t.channel}addFinalizer(t){this._doneStack.push(new dae(t))}runSubexecutor(){const t=this._activeSubexecutor;switch(t._tag){case bD:return this.pullFromChild(t.childExecutor,t.parentSubexecutor,t.onEmit,t);case fv:return this.pullFromUpstream(t);case mv:return this.drainChildExecutors(t);case yD:return this._emitted=t.value,this._activeSubexecutor=t.next,$k()}}replaceSubexecutor(t){this._currentChannel=void 0,this._activeSubexecutor=t}finishWithExit(t){const n=co(t,{onFailure:r=>this.doneHalt(r),onSuccess:r=>this.doneSucceed(r)});return this._activeSubexecutor=void 0,n===void 0?dt:Tae(n)}finishSubexecutorWithCloseEffect(t,...n){this.addFinalizer(()=>F(n,Aa(s=>F(Mt(()=>s(t)),Me(a=>a!==void 0?a:dt)),{discard:!0})));const r=F(t,co({onFailure:s=>this.doneHalt(s),onSuccess:s=>this.doneSucceed(s)}));return this._activeSubexecutor=void 0,r}applyUpstreamPullStrategy(t,n,r){switch(r._tag){case Q6:{const s=!t||n.some(a=>a!==void 0);return[r.emitSeparator,s?[void 0,...n]:n]}case hae:{const s=!t||n.some(a=>a!==void 0);return[r.emitSeparator,s?[...n,void 0]:n]}}}pullFromChild(t,n,r,s){return Mk(t,Ue,a=>{const o=r(a);switch(o._tag){case G6:break;case oae:{this.finishWithDoneValue(t,n,o.value);break}case iae:{const i=n.enqueuePullFromChild(s);this.replaceSubexecutor(i);break}}this._activeSubexecutor=new jk(a,this._activeSubexecutor)},co({onFailure:a=>{const o=this.handleSubexecutorFailure(t,n,a);return o===void 0?void 0:ZI(o)},onSuccess:a=>{this.finishWithDoneValue(t,n,a)}}))}finishWithDoneValue(t,n,r){const s=n;switch(s._tag){case fv:{const a=new ec(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(Jr(r)),this.replaceSubexecutor(a);break}case mv:{const a=new Gu(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(Jr(r)),this.replaceSubexecutor(a);break}}}handleSubexecutorFailure(t,n,r){return this.finishSubexecutorWithCloseEffect(ur(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 ec(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 sp(n.childExecutor,r,n.onEmit))}performPullFromUpstream(t){return Mk(t.upstreamExecutor,n=>{const r=this._closeLastSubstream===void 0?dt:this._closeLastSubstream;return this._closeLastSubstream=void 0,F(this._executeCloseLastSubstream(r),Xn(n))},n=>{if(this._closeLastSubstream!==void 0){const o=this._closeLastSubstream;return this._closeLastSubstream=void 0,F(this._executeCloseLastSubstream(o),St(()=>{const i=new cc(t.createChild(n),this._providedEnv,this._executeCloseLastSubstream);i._input=this._input;const[c,u]=this.applyUpstreamPullStrategy(!1,t.activeChildExecutors,t.onPull(eA(n)));this._activeSubexecutor=new sp(i,new ec(t.upstreamExecutor,t.createChild,t.lastDone,u,t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit),t.onEmit),kt(c)&&(this._activeSubexecutor=new jk(c.value,this._activeSubexecutor))}))}const r=new cc(t.createChild(n),this._providedEnv,this._executeCloseLastSubstream);r._input=this._input;const[s,a]=this.applyUpstreamPullStrategy(!1,t.activeChildExecutors,t.onPull(eA(n)));this._activeSubexecutor=new sp(r,new ec(t.upstreamExecutor,t.createChild,t.lastDone,a,t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit),t.onEmit),kt(s)&&(this._activeSubexecutor=new jk(s.value,this._activeSubexecutor))},n=>{if(t.activeChildExecutors.some(a=>a!==void 0)){const a=new Gu(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,F(this._executeCloseLastSubstream(o),St(()=>this.replaceSubexecutor(a)))}this.replaceSubexecutor(a);return}const r=this._closeLastSubstream,s=this.finishSubexecutorWithCloseEffect(F(n,tZ(a=>t.combineWithChildResult(t.lastDone,a))),()=>r,a=>t.upstreamExecutor.close(a));return s===void 0?void 0:ZI(s)})}drainChildExecutors(t){if(t.activeChildExecutors.length===0){const a=this._closeLastSubstream;return a!==void 0&&this.addFinalizer(()=>Pt(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(Pae(r.reduce((i,c)=>c!==void 0?i+1:i,0))));return this.replaceSubexecutor(new Gu(t.upstreamExecutor,t.lastDone,o,t.upstreamDone,t.combineChildResults,t.combineWithChildResult,t.onPull)),kt(a)?(this._emitted=a.value,$k()):void 0}const s=new Gu(t.upstreamExecutor,t.lastDone,r,t.upstreamDone,t.combineChildResults,t.combineWithChildResult,t.onPull);this.replaceSubexecutor(new sp(n.childExecutor,s,n.onEmit))}}const Dk=e=>e!==void 0?e:dt,Fk=(e,t)=>F(Aa(e,n=>er(n(t))),St(n=>F(XX(n),zt(()=>gE))),Me(n=>on(()=>n))),KE=(e,t,n)=>{const r=[e],s=()=>{const a=r.pop();if(a===void 0||a.upstream===void 0)return zre("Unexpected end of input for channel execution");const o=a.upstream.run();switch(o._tag){case bm:{const i=a.onEmit(a.upstream.getEmit());return r.length===0?i===void 0?on(t):F(i,Us({onFailure:n,onSuccess:t})):i===void 0?on(()=>s()):F(i,Us({onFailure:n,onSuccess:()=>s()}))}case gm:{const i=a.onDone(a.upstream.getDone());return r.length===0?i===void 0?on(t):F(i,Us({onFailure:n,onSuccess:t})):i===void 0?on(()=>s()):F(i,Us({onFailure:n,onSuccess:()=>s()}))}case cd:return r.push(a),F(a.onEffect(o.effect),ME(i=>on(()=>{const c=a.onDone(ur(i));return c===void 0?dt:c})),Us({onFailure:n,onSuccess:()=>s()}));case ym:return r.push(a),r.push(o),on(()=>s())}};return s()},Oae=L(2,(e,t)=>{const n=(r,s,a)=>Kre(Mt(()=>new cc(e,void 0,Ue)),o=>on(()=>qg(o.run(),o).pipe(L6(r),Xn(vr(r)),BE(vr(s)))),(o,i)=>{const c=o.close(i);return c===void 0?dt:j6(c,u=>Qb(a,Ks(u)))});return e0(r=>Bre([a6(t,Mb),wa(),wa()]).pipe(Me(([s,a,o])=>r(n(a,o,s)).pipe(xc(t),Me(i=>t.addFinalizer(c=>{const u=pE(c)?Ate(c.cause):void 0;return av(a).pipe(Me(l=>l?uo(o,void 0).pipe(Xn(u6(i)),Xn(DI(i))):uo(o,void 0).pipe(Xn(u&&PS(u)>0?AE(i,EK(u)):si(i)),Xn(DI(i)))))}).pipe(Xn(r(vr(a)))))))))}),qg=(e,t)=>{const n=e;switch(n._tag){case cd:return F(n.effect,Me(()=>qg(t.run(),t)));case bm:return qg(t.run(),t);case gm:return on(()=>t.getDone());case ym:return KE(n,()=>qg(t.run(),t),Ks)}},Lae="Done",$ae="Await",Mae="effect/ChannelMergeDecision",jae=Symbol.for(Mae),Dae={[jae]:{_R:e=>e,_E0:e=>e,_Z0:e=>e,_E:e=>e,_Z:e=>e}},tA=e=>{const t=Object.create(Dae);return t._tag=$ae,t.f=e,t},xD="BothRunning",_D="LeftDone",vD="RightDone",Fae="effect/ChannelMergeState",nA=Symbol.for(Fae),WE={[nA]:nA},Bk=(e,t)=>{const n=Object.create(WE);return n._tag=xD,n.left=e,n.right=t,n},rA=e=>{const t=Object.create(WE);return t._tag=_D,t.f=e,t},sA=e=>{const t=Object.create(WE);return t._tag=vD,t.f=e,t},wD="BackPressure",SD="BufferSliding",Bae="effect/ChannelMergeStrategy",aA=Symbol.for(Bae),ED={[aA]:aA},zae=e=>{const t=Object.create(ED);return t._tag=wD,t},Uae=e=>{const t=Object.create(ED);return t._tag=SD,t},Hae=L(2,(e,{onBackPressure:t,onBufferSliding:n})=>{switch(e._tag){case wD:return t();case SD:return n()}}),Mu="Empty",ch="Emit",uh="Error",lh="Done",TD=e=>({_tag:Mu,notifyProducer:e}),zk=e=>({_tag:ch,notifyConsumers:e}),qae=e=>({_tag:uh,cause:e}),Vae=e=>({_tag:lh,done:e});class Gae{ref;constructor(t){this.ref=t}awaitRead(){return $u(Pd(this.ref,t=>t._tag===Mu?[vr(t.notifyProducer),t]:[dt,t]))}get close(){return Yre(t=>this.error(Zj(t)))}done(t){return $u(Pd(this.ref,n=>{switch(n._tag){case Mu:return[vr(n.notifyProducer),n];case ch:return[Aa(n.notifyConsumers,r=>uo(r,ze(t)),{discard:!0}),Vae(t)];case uh:return[Ji,n];case lh:return[Ji,n]}}))}emit(t){return Me(wa(),n=>$u(Pd(this.ref,r=>{switch(r._tag){case Mu:return[vr(r.notifyProducer),r];case ch:{const s=r.notifyConsumers[0],a=r.notifyConsumers.slice(1);if(s!==void 0)return[uo(s,He(t)),a.length===0?TD(n):zk(a)];throw new Error("Bug: Channel.SingleProducerAsyncInput.emit - Queue was empty! please report an issue at https://github.com/Effect-TS/effect/issues")}case uh:return[Ji,r];case lh:return[Ji,r]}})))}error(t){return $u(Pd(this.ref,n=>{switch(n._tag){case Mu:return[vr(n.notifyProducer),n];case ch:return[Aa(n.notifyConsumers,r=>Are(r,t),{discard:!0}),qae(t)];case uh:return[Ji,n];case lh:return[Ji,n]}}))}get take(){return this.takeWith(t=>ur(Rte(t,ze)),t=>Jr(t),t=>qb(He(t)))}takeWith(t,n,r){return Me(wa(),s=>$u(Pd(this.ref,a=>{switch(a._tag){case Mu:return[Xn(uo(a.notifyProducer,void 0),lv(vr(s),{onFailure:t,onSuccess:Lr({onLeft:r,onRight:n})})),zk([s])];case ch:return[lv(vr(s),{onFailure:t,onSuccess:Lr({onLeft:r,onRight:n})}),zk([...a.notifyConsumers,s])];case uh:return[Pt(t(a.cause)),a];case lh:return[Pt(r(a.done)),a]}})))}}const CD=()=>F(wa(),Me(e=>fE(TD(e))),St(e=>new Gae(e))),pv=L(2,(e,t)=>_ae(e,t,()=>{},()=>{})),Kae=e=>{const t=id({onInput:()=>t,onFailure:ts,onDone:gD});return Ws(e,t)},ID=L(2,(e,t)=>vae(e,()=>t)),Wae=e=>kn(e,Ue),YE=e=>ii(e.takeWith(ts,t=>kn(tr(t),()=>YE(e)),gD)),AD=L(2,(e,t)=>kn(e,n=>GE(()=>t(n)))),ND=L(2,(e,t)=>{const n=pD({onInput:r=>kn(tr(t(r)),()=>n),onFailure:qE,onDone:Af});return Ws(e,n)}),Yae=e=>t=>Jae(e)(t,ml),Jae=({bufferSize:e=16,concurrency:t,mergeStrategy:n=zae()})=>(r,s)=>LD(a=>rl(function*(){const o=t==="unbounded"?Number.MAX_SAFE_INTEGER:t,i=yield*CD(),c=YE(i),u=yield*V6(e);yield*Qb(a,s0(u));const l=yield*tae();yield*Qb(a,s0(l));const d=yield*fE(fe()),h=yield*wa(),f=(yield*rse(o)).withPermits,p=yield*ol(Ws(c,r),a);function x(b){return b.pipe(Me(Lr({onLeft:y=>Pt(xe(y)),onRight:y=>Pk(_u(u,Pt(He(y))),fe())})),WI({until:y=>kt(y)}),Me(y=>wX(d,ln({onNone:()=>xe(y.value),onSome:_=>xe(s(_,y.value))}))),ME(y=>Wb(y)?Ks(y):_u(u,Ks(y)).pipe(Xn(uo(h,void 0)),jE)))}yield*p.pipe(Us({onFailure:b=>_u(u,Ks(b)).pipe(Xn(Pt(!1))),onSuccess:Lr({onLeft:b=>$6(zs(vr(h)),zs(f(o)(dt)),{onSelfDone:(y,_)=>Pk(si(_),!1),onOtherDone:(y,_)=>Xn(si(_),xX(d).pipe(Me(ln({onNone:()=>_u(u,Pt(ze(b))),onSome:S=>_u(u,Pt(ze(s(S,b))))})),Pk(!1)))}),onRight:b=>Hae(n,{onBackPressure:()=>rl(function*(){const y=yield*wa(),_=uv(w=>ol(Ws(c,b),w).pipe(Me(v=>Ok(er(x(v)),er(zs(vr(h))))),Me(Ue)));return yield*uo(y,void 0).pipe(Xn(_),f(1),xc(a)),yield*vr(y),!(yield*av(h))}),onBufferSliding:()=>rl(function*(){const y=yield*wa(),_=yield*wa(),S=yield*nae(l);yield*QI(l).pipe(Me(C=>uo(C,void 0)),Xre(()=>S>=o)),yield*_u(l,y);const w=uv(C=>ol(Ws(c,b),C).pipe(Me(I=>er(x(I)).pipe(Ok(er(zs(vr(h)))),Ok(er(zs(vr(y)))))),Me(Ue)));return yield*uo(_,void 0).pipe(Xn(w),f(1),xc(a)),yield*vr(_),!(yield*av(h))})})})}),WI({while:b=>b}),xc(a));const g=F(QI(u),$u,lv({onFailure:ts,onSuccess:Lr({onLeft:Af,onRight:b=>kn(tr(b),()=>g)})}),ii);return mD(g,i)})),RD=L(3,(e,t,n)=>Yae(n)(ND(e,t))),Qae=L(2,(e,t)=>{function n(r){return rl(function*(){const s=yield*CD(),a=YE(s),o=yield*ol(Ws(a,e),r),i=yield*ol(Ws(a,t.other),r);function c(l,d,h){return(f,p,x)=>{function g(b){const y=b;return y._tag===Lae?Pt(yr(Xn(si(d),y.effect))):St(u6(d),co({onFailure:_=>yr(y.f(ur(_))),onSuccess:Lr({onLeft:_=>yr(y.f(Jr(_))),onRight:_=>JE(tr(_),u(x(y.f)))})}))}return co(l,{onFailure:b=>g(f(ur(b))),onSuccess:Lr({onLeft:b=>g(f(Jr(b))),onRight:b=>Pt(kn(tr(b),()=>kn(yr(xc(zs(h),r)),y=>u(p(y,d)))))})})}}function u(l){switch(l._tag){case xD:{const d=zs(FI(l.left)),h=zs(FI(l.right));return ii($6(d,h,{onSelfDone:(f,p)=>Xn(si(p),c(f,l.right,o)(t.onSelfDone,Bk,x=>rA(x))),onOtherDone:(f,p)=>Xn(si(p),c(f,l.left,i)(t.onOtherDone,(x,g)=>Bk(g,x),x=>sA(x)))}))}case _D:return ii(St(er(i),co({onFailure:d=>yr(l.f(ur(d))),onSuccess:Lr({onLeft:d=>yr(l.f(Jr(d))),onRight:d=>kn(tr(d),()=>u(rA(l.f)))})})));case vD:return ii(St(er(o),co({onFailure:d=>yr(l.f(ur(d))),onSuccess:Lr({onLeft:d=>yr(l.f(Jr(d))),onRight:d=>kn(tr(d),()=>u(sA(l.f)))})})))}}return yr(Zb(l=>{const d=Zb(p=>(p.transferChildren(l.scope()),dt)),h=zs(o).pipe(qu(d),xc(r)),f=zs(i).pipe(qu(d),xc(r));return Xy(h,f,(p,x)=>Bk(p,x))})).pipe(kn(u),mD(s))})}return LD(n)}),Xae=L(2,(e,t)=>VE(()=>{let n;const r=pD({onInput:a=>kn(tr(a),()=>r),onFailure:a=>(n=soe(a),ts(tv(n))),onDone:Af}),s=id({onInput:a=>F(tr(a),kn(()=>s)),onFailure:a=>Cte(a)&&aoe(a.defect)&&Be(a.defect,n)?qE(a.defect.error):ts(a),onDone:Af});return Ws(Ws(Ws(e,r),t),s)})),Zae=e=>uv(t=>Oae(e,t)),PD=e=>Zae(Kae(e)),OD=e=>ii(e0(t=>St(o6(),n=>xae(j6(t(lne(e,n)),r=>Xb(n,ur(r))),(r,s)=>Xb(n,s))))),eoe=e=>noe(St(Jy,t=>kn(yr(e(t)),tr))),toe=e=>Me(Jy,t=>ol(e,t)),ol=L(2,(e,t)=>n0(Mt(()=>new cc(e,void 0,Ue)),pm()).pipe(M6(([n,r])=>une(t,s=>{const a=n.close(s);return a!==void 0?If(a,r):dt})),ih,St(([n])=>on(()=>gv(n.run(),n))))),gv=(e,t)=>{const n=e;switch(n._tag){case gm:return co(t.getDone(),{onFailure:Ks,onSuccess:r=>Pt(ze(r))});case bm:return Pt(He(t.getEmit()));case cd:return F(n.effect,Me(()=>gv(t.run(),t)));case ym:return KE(n,()=>gv(t.run(),t),r=>Ks(r))}},ii=e=>Wae(yr(e)),noe=e=>fD(OD(e),(t,n)=>t,(t,n)=>t),LD=e=>fD(eoe(e),(t,n)=>t,(t,n)=>t),$D=e=>MD(0,e.length,e),MD=(e,t,n)=>e===t?So:F(tr(F(n,ti(e))),kn(()=>MD(e+1,t,n))),roe=L(e=>hD(e[1]),(e,t,n)=>n?.concurrent?Qae(e,{other:t,onSelfDone:r=>tA(s=>on(()=>vI(r,s))),onOtherDone:r=>tA(s=>on(()=>vI(s,r)))}):kn(e,r=>AD(t,s=>[r,s]))),JE=L(e=>hD(e[1]),(e,t,n)=>n?.concurrent?AD(roe(e,t,{concurrent:!0}),r=>r[1]):kn(e,()=>t)),bv=Symbol.for("effect/Channel/ChannelException"),soe=e=>({_tag:"ChannelException",[bv]:bv,error:e}),aoe=e=>Le(e,bv),ooe=Symbol.for("effect/Sink"),ioe={_A:e=>e,_In:e=>e,_L:e=>e,_E:e=>e,_R:e=>e};class QE{channel;[ooe]=ioe;constructor(t){this.channel=t}pipe(){return Ee(this,arguments)}}const coe=e=>{const t=id({onInput:n=>F(yr(Aa(n,r=>e(r),{discard:!0})),kn(()=>t)),onFailure:ts,onDone:()=>So});return new QE(t)},uoe=e=>{const t=id({onInput:n=>F(yr(e(n)),kn(()=>t)),onFailure:ts,onDone:()=>So});return new QE(t)},loe=e=>new QE(yr(e)),jD=e=>Ni(e)?jD(loe(e)):e.channel,doe=()=>$a(fe()),hoe=e=>DE(Ks(e),xe),foe="effect/Stream",XE=Symbol.for(foe),moe={_R:e=>e,_E:e=>e,_A:e=>e};class na{channel;[XE]=moe;constructor(t){this.channel=t}pipe(){return Ee(this,arguments)}}const n1=e=>Le(e,XE)||Ni(e),poe=4096,DD=L(2,(e,t)=>new na(F(_s(e),ID(t)))),goe=e=>zD($a(xe(e))),boe=e=>BD(Ks(e)),yoe=L(2,(e,t)=>Soe(e,kS(t))),FD=L(e=>n1(e[0]),(e,t,n)=>{const r=n?.bufferSize??16;return n?.switch?oA(n?.concurrency,()=>iA(e,1,r,t),s=>iA(e,s,r,t)):oA(n?.concurrency,()=>new na(pv(_s(e),s=>F(s,XV(a=>_s(t(a))),eG(So,(a,o)=>F(a,JE(o)))))),s=>new na(F(_s(e),pv($D),RD(a=>_s(t(a)),n))))}),oA=(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()}},iA=L(4,(e,t,n,r)=>new na(F(_s(e),pv($D),RD(s=>_s(r(s)),{concurrency:t,mergeStrategy:Uae(),bufferSize:n})))),koe=L(e=>n1(e[0]),(e,t)=>FD(e,Ue,t)),xoe=e=>new na(e),_s=e=>{if("channel"in e)return e.channel;if(Ni(e))return _s(BD(e));throw new TypeError("Expected a Stream.")},_oe=e=>new na(xS(e)?So:tr(e)),BD=e=>F(e,DE(xe),zD),zD=e=>new na(ii(ese(e,{onFailure:ln({onNone:()=>So,onSome:qE}),onSuccess:t=>tr(xn(t))}))),voe=(e,t)=>F(aae(e,1,t?.maxChunkSize??poe),ME(n=>F(rae(e),Me(r=>r&&Wb(n)?doe():hoe(n)))),UD,t?.shutdown?DD(s0(e)):Ue),woe=(...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 VD(St(t0(Mt(()=>t().getReader()),s=>r?Mt(()=>s.releaseLock()):Ure(()=>s.cancel())),s=>Eoe(Me(sl({try:()=>s.read(),catch:a=>xe(n(a))}),({done:a,value:o})=>a?$a(fe()):Pt(o)))))},Soe=L(2,(e,t)=>new na(F(_s(e),ND(t)))),UD=e=>Poe(e,t=>F(St(t,n=>xe([n,t])),R6(ln({onNone:()=>Pt(fe()),onSome:$a})))),Eoe=e=>UD(F(e,St(xn))),HD=L(2,(e,t)=>_s(e).pipe(Xae(jD(t)),PD)),Toe=L(2,(e,t)=>HD(e,coe(t))),Coe=L(2,(e,t)=>HD(e,uoe(t))),Ioe=e=>new na(ID(OD(F(e,St(xn))),dt)),Aoe=e=>_oe(xn(e)),qD=e=>new na(VE(()=>_s(e()))),Noe=L(e=>n1(e[0]),(e,t)=>St(pm(),n=>Roe(e,n,t))),Roe=L(e=>n1(e[0]),(e,t,n)=>{const r=Zy(t);let s,a;const o=sse(!1);return new ReadableStream({start(i){a=r(Coe(e,c=>c.length===0?dt:o.whenOpen(Mt(()=>{o.unsafeClose();for(const u of c)i.enqueue(u);s(),s=void 0})))),a.addObserver(c=>{try{c._tag==="Failure"?i.error(Pte(c.cause)):i.close()}catch{}})},pull(){return new Promise(i=>{s=i,Es(o.open)})},cancel(){if(a)return FE(jE(si(a)))}},n?.strategy)}),Poe=(e,t)=>qD(()=>{const n=r=>ii(St(t(r),ln({onNone:()=>So,onSome:([s,a])=>kn(tr(s),()=>n(a))})));return new na(n(e))}),VD=e=>koe(Ioe(e)),cA=Symbol.for("effect/Mailbox"),uA=Symbol.for("effect/Mailbox/ReadonlyMailbox"),tc=rr(),lA=At(tc),ap=At(!1),op=At(!0),dA=[tc,!0];class Ooe extends rd{scheduler;capacity;strategy;[cA]=cA;[uA]=uA;state={_tag:"Open",takers:new Set,offers:new Set,awaiters:new Set};messages=[];messagesChunk=rr();constructor(t,n,r){super(),this.scheduler=t,this.capacity=n,this.strategy=r}offer(t){return Ke(()=>{if(this.state._tag!=="Open")return ap;if(this.messages.length+this.messagesChunk.length>=this.capacity)switch(this.strategy){case"dropping":return ap;case"suspend":return this.capacity<=0&&this.state.takers.size>0?(this.messages.push(t),this.releaseTaker(),op):this.offerRemainingSingle(t);case"sliding":return this.unsafeTake(),this.messages.push(t),op}return this.messages.push(t),this.scheduleReleaseTaker(),op})}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 Ke(()=>{if(this.state._tag!=="Open")return ve(bl(t));const n=this.unsafeOfferAllArray(t);return n.length===0?lA:this.strategy==="dropping"?ve(br(n)):this.offerRemainingArray(n)})}unsafeOfferAll(t){return br(this.unsafeOfferAllArray(t))}unsafeOfferAllArray(t){if(this.state._tag!=="Open")return wt(t);if(this.capacity===Number.POSITIVE_INFINITY||this.strategy==="sliding")return this.messages.length>0&&(this.messagesChunk=yn(this.messagesChunk,br(this.messages))),this.strategy==="sliding"?this.messagesChunk=this.messagesChunk.pipe(yn(bl(t)),ZV(this.capacity)):yS(t)?this.messagesChunk=yn(this.messagesChunk,t):this.messages=wt(t),this.scheduleReleaseTaker(),[];const n=this.capacity<=0?this.state.takers.size:this.capacity-this.messages.length-this.messagesChunk.length;if(n===0)return wt(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(kf(t))}failCause(t){return this.done(It(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=be(()=>{if(this.state._tag==="Done")return!0;this.messages=[],this.messagesChunk=tc;const t=this.state.offers;if(this.finalize(this.state._tag==="Open"?cr:this.state.exit),t.size>0){for(const n of t)n._tag==="Single"?n.resume(ap):n.resume(At(br(n.remaining.slice(n.offset))));t.clear()}return!0});done(t){return be(()=>this.unsafeDone(t))}end=this.done(cr);clear=Ke(()=>{if(this.state._tag==="Done")return Mg(this.state.exit,tc);const t=this.unsafeTakeAll();return this.releaseCapacity(),ve(t)});takeAll=Ke(()=>{if(this.state._tag==="Done")return Mg(this.state.exit,dA);const t=this.unsafeTakeAll();return t.length===0?Zt(this.awaitTake,this.takeAll):ve([t,this.releaseCapacity()])});takeN(t){return Ke(()=>{if(this.state._tag==="Done")return Mg(this.state.exit,dA);if(t<=0)return ve([tc,!1]);t=Math.min(t,this.capacity);let n;if(t<=this.messagesChunk.length)n=Eb(this.messagesChunk,t),this.messagesChunk=Wo(this.messagesChunk,t);else if(t<=this.messages.length+this.messagesChunk.length)this.messagesChunk=yn(this.messagesChunk,br(this.messages)),this.messages=[],n=Eb(this.messagesChunk,t),this.messagesChunk=Wo(this.messagesChunk,t);else return Zt(this.awaitTake,this.takeN(t));return ve([n,this.releaseCapacity()])})}unsafeTake(){if(this.state._tag==="Done")return SM(this.state.exit,kf(new sd));let t;if(this.messagesChunk.length>0)t=vS(this.messagesChunk),this.messagesChunk=Wo(this.messagesChunk,1);else if(this.messages.length>0)t=this.messages[0],this.messagesChunk=Wo(br(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?At(this.messages.pop()):void 0):void 0;return this.releaseCapacity(),At(t)}take=Ke(()=>this.unsafeTake()??Zt(this.awaitTake,this.take));await=Yo(t=>this.state._tag==="Done"?t(this.state.exit):(this.state.awaiters.add(t),be(()=>{this.state._tag!=="Done"&&this.state.awaiters.delete(t)})));unsafeSize(){const t=this.messages.length+this.messagesChunk.length;return this.state._tag==="Done"?fe():xe(t)}size=be(()=>this.unsafeSize());commit(){return this.takeAll}pipe(){return Ee(this,arguments)}toJSON(){return{_id:"effect/Mailbox",state:this.state._tag,size:this.unsafeSize().toJSON()}}toString(){return Lt(this)}[ht](){return Lt(this)}offerRemainingSingle(t){return Yo(n=>{if(this.state._tag!=="Open")return n(ap);const r={_tag:"Single",message:t,resume:n};return this.state.offers.add(r),be(()=>{this.state._tag==="Open"&&this.state.offers.delete(r)})})}offerRemainingArray(t){return Yo(n=>{if(this.state._tag!=="Open")return n(At(br(t)));const r={_tag:"Array",remaining:t,offset:0,resume:n};return this.state.offers.add(r),be(()=>{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(op),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(lA),this.state.offers.delete(n)}}return!1}awaitTake=Yo(t=>this.state._tag==="Done"?t(this.state.exit):(this.state.takers.add(t),be(()=>{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(cr),this.messages.length+this.messagesChunk.length===0)break}};unsafeTakeAll(){if(this.messagesChunk.length>0){const t=this.messages.length>0?yn(this.messagesChunk,br(this.messages)):this.messagesChunk;return this.messagesChunk=tc,this.messages=[],t}else if(this.messages.length>0){const t=br(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,xn(this.messages.pop());return tc}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 Loe=e=>gt(t=>ve(new Ooe(t.currentScheduler,typeof e=="number"?e:e?.capacity??Number.POSITIVE_INFINITY,typeof e=="number"?"suspend":e?.strategy??"suspend"))),$oe=e=>{const t=kn(e.takeAll,([n,r])=>r?n.length===0?So:tr(n):JE(tr(n),t));return t},Moe=e=>xoe($oe(e)),joe=Loe,Doe=Moe,Uk=XE,GD=DD,Foe=goe,Boe=boe,zoe=yoe,Uoe=FD,KD=_s,Hoe=voe,qoe=woe,Voe=Toe,Goe=Aoe,Koe=qD,Woe=Noe,WD=VD;class km extends Ar("@effect/experimental/Reactivity")(){}const Yoe=Mt(()=>{const e=new Map,t=i=>{if(Array.isArray(i))for(let c=0;c<i.length;c++){const u=e.get(yv(i[c]));if(u!==void 0)for(const l of u)l()}else{const c=i;for(const u in c){const l=YD(u,c[u]);for(let h=0;h<l.length;h++){const f=e.get(l[h]);if(f!==void 0)for(const p of f)p()}const d=e.get(u);if(d!==void 0)for(const h of d)h()}}},n=i=>Mt(()=>t(i)),r=(i,c)=>BE(c,n(i)),s=(i,c)=>{const u=Array.isArray(i)?i.map(yv):Xoe(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)=>rl(function*(){const u=yield*Jy,l=yield*joe(),d=yield*gse();let h=!1,f=!1;const p=b=>{b._tag==="Failure"?l.unsafeDone(ur(b.cause)):l.unsafeOffer(b.value),f?(f=!1,d(c).addObserver(p)):h=!1};function x(){if(h){f=!0;return}h=!0,d(c).addObserver(p)}const g=s(i,x);return yield*Qb(u,Mt(g)),x(),l}),o=(i,c)=>a(i,c).pipe(St(Doe),WD);return km.of({mutation:r,query:a,stream:o,unsafeInvalidate:t,invalidate:n,unsafeRegister:s})}),Joe=L(2,(e,t)=>Me(km,n=>n.mutation(t,e))),Qoe=e=>Me(km,t=>t.invalidate(e)),Hk=_se(km,Yoe);function yv(e){return typeof e=="string"?e:Ne(e)}const YD=(e,t)=>{const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=`${e}:${yv(t[r])}`;return n},Xoe=e=>{const t=[];for(const n in e){t.push(n);for(const r of YD(n,e[n]))t.push(r)}return t},JD="effect/Redacted",Vg=Fe("effect/Redacted/redactedRegistry",()=>new WeakMap),QD=Symbol.for(JD),Zoe={[QD]:{_A:e=>e},pipe(){return Ee(this,arguments)},toString(){return"<redacted>"},toJSON(){return"<redacted>"},[ht](){return"<redacted>"},[We](){return F(Ne(JD),ot(Ne(Vg.get(this))),Ft(this))},[Ye](e){return eie(e)&&Be(Vg.get(this),Vg.get(e))}},eie=e=>Le(e,QD),tie=e=>{const t=Object.create(Zoe);return Vg.set(t,e),t},XD=(e,t)=>{switch(t._tag){case"StringKeyword":case"TemplateLiteral":return Object.keys(e);case"SymbolKeyword":return Object.getOwnPropertySymbols(e);case"Refinement":return XD(e,t.from)}},ZD=e=>{let t=!1,n;return()=>(t||(n=e(),t=!0),n)},ZE=e=>Array.isArray(e),nie=e=>!Array.isArray(e),hA=e=>`[${Yf(e)}]`,e4=e=>ZE(e)?e.map(hA).join(""):hA(e),Rs=(e,t,n,r)=>{let s=e;return n&&Qt(n)&&(s+=`
|
|
25
|
+
at path: ${e4(n)}`),t!==void 0&&(s+=`
|
|
26
|
+
details: ${t}`),r&&(s+=`
|
|
27
|
+
schema (${r._tag}): ${r}`),s},rie=(e,t,n)=>Rs("Unsupported schema",e,t,n),t4=(e,t,n)=>Rs("Missing annotation",e,t,n),fA=(e,t)=>t4('Generating a JSON Schema for this schema requires a "jsonSchema" annotation',e,t),sie=(e,t)=>t4('Generating a JSON Schema for this schema requires an "identifier" annotation',e,t),aie=e=>Rs("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),oie=(e,t)=>Rs("Unsupported key",`Cannot encode ${Yf(e)} key to JSON Schema`,t),n4=(e,t,n)=>Rs("Unsupported schema or overlapping types",`cannot extend ${e} with ${t}`,n),mA=e=>rie(void 0,void 0,e),iie=e=>Rs("Unsupported key schema",void 0,void 0,e),cie=e=>Rs("Unsupported literal",`literal value: ${vo(e)}`),pA=e=>Rs("Duplicate index signature",`${e} index signature`),uie=Rs("Unsupported index signature parameter","An index signature parameter type must be `string`, `symbol`, a template literal type or a refinement of the previous types"),lie=Rs("Invalid element","A required element cannot follow an optional element. ts(1257)"),gA=e=>Rs("Duplicate property signature transformation",`Duplicate key ${vo(e)}`),r4=e=>Rs("Duplicate property signature",`Duplicate key ${vo(e)}`),die=Symbol.for("effect/SchemaId/Int"),hie=Symbol.for("effect/SchemaId/MinLength"),fie=Symbol.for("effect/annotation/TypeConstructor"),s4=Symbol.for("effect/annotation/Brand"),eT=Symbol.for("effect/annotation/SchemaId"),a4=Symbol.for("effect/annotation/Message"),tT=Symbol.for("effect/annotation/MissingMessage"),ud=Symbol.for("effect/annotation/Identifier"),as=Symbol.for("effect/annotation/Title"),il=Symbol.for("effect/annotation/AutoTitle"),Ri=Symbol.for("effect/annotation/Description"),nT=Symbol.for("effect/annotation/Examples"),rT=Symbol.for("effect/annotation/Default"),sT=Symbol.for("effect/annotation/JSONSchema"),o4=Symbol.for("effect/annotation/Arbitrary"),i4=Symbol.for("effect/annotation/Pretty"),c4=Symbol.for("effect/annotation/Equivalence"),mie=Symbol.for("effect/annotation/Documentation"),u4=Symbol.for("effect/annotation/Concurrency"),l4=Symbol.for("effect/annotation/Batching"),d4=Symbol.for("effect/annotation/ParseIssueTitle"),h4=Symbol.for("effect/annotation/ParseOptions"),f4=Symbol.for("effect/annotation/DecodingFallback"),o0=Symbol.for("effect/annotation/Surrogate"),pie=Symbol.for("effect/annotation/StableFilter"),Vn=L(2,(e,t)=>Object.prototype.hasOwnProperty.call(e.annotations,t)?xe(e.annotations[t]):fe()),m4=Vn(s4),gie=Vn(a4),bie=Vn(tT),aT=Vn(as),p4=Vn(il),xm=Vn(ud),oT=Vn(Ri),yie=Vn(nT),kie=Vn(rT),g4=Vn(sT),xie=Vn(u4),_ie=Vn(l4),vie=Vn(d4),wie=Vn(h4),Sie=Vn(f4),r1=Vn(o0),Eie=Vn(pie),Tie=e=>yV(Eie(e),t=>t===!0),b4=Symbol.for("effect/annotation/JSONIdentifier"),Cie=Vn(b4),y4=e=>Ta(Cie(e),()=>xm(e)),k4=Symbol.for("effect/schema/ParseJson");class s1{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 zt(Ra(this),()=>"<declaration schema>")}toJSON(){return{_tag:this._tag,typeParameters:this.typeParameters.map(t=>t.toJSON()),annotations:dn(this.annotations)}}}const os=e=>t=>t._tag===e,Iie=os("Declaration");let i0=class{literal;annotations;_tag="Literal";constructor(t,n={}){this.literal=t,this.annotations=n}toString(){return zt(Ra(this),()=>vo(this.literal))}toJSON(){return{_tag:this._tag,literal:ey(this.literal)?String(this.literal):this.literal,annotations:dn(this.annotations)}}};const Rh=os("Literal"),Aie=new i0(null);class Nie{symbol;annotations;_tag="UniqueSymbol";constructor(t,n={}){this.symbol=t,this.annotations=n}toString(){return zt(Ra(this),()=>vo(this.symbol))}toJSON(){return{_tag:this._tag,symbol:String(this.symbol),annotations:dn(this.annotations)}}}class Rie{annotations;_tag="UndefinedKeyword";constructor(t={}){this.annotations=t}toString(){return Eo(this)}toJSON(){return{_tag:this._tag,annotations:dn(this.annotations)}}}const Nf=new Rie({[as]:"undefined"});class Pie{annotations;_tag="VoidKeyword";constructor(t={}){this.annotations=t}toString(){return Eo(this)}toJSON(){return{_tag:this._tag,annotations:dn(this.annotations)}}}const Oie=new Pie({[as]:"void"}),Lie=os("VoidKeyword");class $ie{annotations;_tag="NeverKeyword";constructor(t={}){this.annotations=t}toString(){return Eo(this)}toJSON(){return{_tag:this._tag,annotations:dn(this.annotations)}}}const _m=new $ie({[as]:"never"}),x4=os("NeverKeyword");class Mie{annotations;_tag="UnknownKeyword";constructor(t={}){this.annotations=t}toString(){return Eo(this)}toJSON(){return{_tag:this._tag,annotations:dn(this.annotations)}}}const _4=new Mie({[as]:"unknown"});class jie{annotations;_tag="AnyKeyword";constructor(t={}){this.annotations=t}toString(){return Eo(this)}toJSON(){return{_tag:this._tag,annotations:dn(this.annotations)}}}const Die=new jie({[as]:"any"});class Fie{annotations;_tag="StringKeyword";constructor(t={}){this.annotations=t}toString(){return Eo(this)}toJSON(){return{_tag:this._tag,annotations:dn(this.annotations)}}}const c0=new Fie({[as]:"string",[Ri]:"a string"}),kv=os("StringKeyword");class Bie{annotations;_tag="NumberKeyword";constructor(t={}){this.annotations=t}toString(){return Eo(this)}toJSON(){return{_tag:this._tag,annotations:dn(this.annotations)}}}const u0=new Bie({[as]:"number",[Ri]:"a number"}),bA=os("NumberKeyword");class zie{annotations;_tag="BooleanKeyword";constructor(t={}){this.annotations=t}toString(){return Eo(this)}toJSON(){return{_tag:this._tag,annotations:dn(this.annotations)}}}const l0=new zie({[as]:"boolean",[Ri]:"a boolean"}),yA=os("BooleanKeyword");class Uie{annotations;_tag="SymbolKeyword";constructor(t={}){this.annotations=t}toString(){return Eo(this)}toJSON(){return{_tag:this._tag,annotations:dn(this.annotations)}}}const Hie=new Uie({[as]:"symbol",[Ri]:"a symbol"}),qie=os("SymbolKeyword");let vm=class{type;annotations;constructor(t,n={}){this.type=t,this.annotations=n}toJSON(){return{type:this.type.toJSON(),annotations:dn(this.annotations)}}toString(){return String(this.type)}};class eu extends vm{isOptional;constructor(t,n,r={}){super(t,r),this.isOptional=n}toJSON(){return{type:this.type.toJSON(),isOptional:this.isOptional,annotations:dn(this.annotations)}}toString(){return String(this.type)+(this.isOptional?"?":"")}}const iT=e=>e.map(t=>t.type);class a1{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(lie)}toString(){return zt(Ra(this),()=>Vie(this))}toJSON(){return{_tag:this._tag,elements:this.elements.map(t=>t.toJSON()),rest:this.rest.map(t=>t.toJSON()),isReadonly:this.isReadonly,annotations:dn(this.annotations)}}}const Vie=e=>{const t=e.elements.map(String).join(", ");return CV(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 Fn extends eu{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:dn(this.annotations)}}}const v4=e=>{switch(e._tag){case"StringKeyword":case"SymbolKeyword":case"TemplateLiteral":return!0;case"Refinement":return v4(e.from)}return!1};class wm{type;isReadonly;parameter;constructor(t,n,r){if(this.type=n,this.isReadonly=r,v4(t))this.parameter=t;else throw new Error(uie)}toString(){return(this.isReadonly?"readonly ":"")+`[x: ${this.parameter}]: ${this.type}`}toJSON(){return{parameter:this.parameter.toJSON(),type:this.type.toJSON(),isReadonly:this.isReadonly}}}class po{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(r4(i));s[i]=null}const a={string:!1,symbol:!1};for(let o=0;o<n.length;o++){const i=R4(n[o].parameter);if(kv(i)){if(a.string)throw new Error(pA("string"));a.string=!0}else if(qie(i)){if(a.symbol)throw new Error(pA("symbol"));a.symbol=!0}}this.propertySignatures=t,this.indexSignatures=n}toString(){return zt(Ra(this),()=>Gie(this))}toJSON(){return{_tag:this._tag,propertySignatures:this.propertySignatures.map(t=>t.toJSON()),indexSignatures:this.indexSignatures.map(t=>t.toJSON()),annotations:dn(this.annotations)}}}const kA=e=>e.map(String).join("; "),Gie=e=>{if(e.propertySignatures.length>0){const t=e.propertySignatures.map(String).join("; ");return e.indexSignatures.length>0?`{ ${t}; ${kA(e.indexSignatures)} }`:`{ ${t} }`}else return e.indexSignatures.length>0?`{ ${kA(e.indexSignatures)} }`:"{}"},xv=os("TypeLiteral"),Kie=lf(FL(Al,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})),Wie={string:"StringKeyword",number:"NumberKeyword",boolean:"BooleanKeyword",bigint:"BigIntKeyword"},w4=e=>Sb(e,t=>o1(t)?w4(t.types):[t]),Yie=e=>{const t=Kie(e),n=[],r={},s=[];for(const a of t)switch(a._tag){case"NeverKeyword":break;case"AnyKeyword":return[Die];case"UnknownKeyword":return[_4];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=Wie[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 Zn=class _v{types;annotations;static make=(t,n)=>cT(t)?new _v(t,n):t.length===1?t[0]:_m;static unify=(t,n)=>_v.make(Yie(w4(t)),n);_tag="Union";constructor(t,n={}){this.types=t,this.annotations=n}toString(){return zt(Ra(this),()=>this.types.map(String).join(" | "))}toJSON(){return{_tag:this._tag,types:this.types.map(t=>t.toJSON()),annotations:dn(this.annotations)}}};const Jie=(e,t)=>e.map(t),cT=e=>e.length>1,o1=os("Union"),qk=Fe(Symbol.for("effect/Schema/AST/toJSONMemoMap"),()=>new WeakMap);class Ll{f;annotations;_tag="Suspend";constructor(t,n={}){this.f=t,this.annotations=n,this.f=ZD(t)}toString(){return Ra(this).pipe(Ta(()=>Ii(hV(this.f)(),t=>Ra(t))),zt(()=>"<suspended schema>"))}toJSON(){const t=this.f();let n=qk.get(t);return n||(qk.set(t,{_tag:this._tag}),n={_tag:this._tag,ast:t.toJSON(),annotations:dn(this.annotations)},qk.set(t,n),n)}}const S4=os("Suspend");let uT=class{from;filter;annotations;_tag="Refinement";constructor(t,n,r={}){this.from=t,this.filter=n,this.annotations=r}toString(){return xm(this).pipe(zt(()=>ln(P4(this),{onNone:()=>`{ ${this.from} | filter }`,onSome:t=>vc(this.from)?String(this.from)+" & "+t:t})))}toJSON(){return{_tag:this._tag,from:this.from.toJSON(),annotations:dn(this.annotations)}}};const vc=os("Refinement"),Vk={};let Qo=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 zt(Ra(this),()=>`(${String(this.from)} <-> ${String(this.to)})`)}toJSON(){return{_tag:this._tag,from:this.from.toJSON(),to:this.to.toJSON(),annotations:dn(this.annotations)}}};const E4=os("Transformation");class T4{decode;encode;_tag="FinalTransformation";constructor(t,n){this.decode=t,this.encode=n}}const Qie=e=>t=>t._tag===e;class Xie{_tag="ComposeTransformation"}const C4=new Xie;let Zie=class{from;to;decode;encode;constructor(t,n,r,s){this.from=t,this.to=n,this.decode=r,this.encode=s}};const ece=e=>e.decode===Ue&&e.encode===Ue;class vv{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(gA(a));n[a]=!0;const o=s.to;if(r[o])throw new Error(gA(o));r[o]=!0}}}const wv=Qie("TypeLiteralTransformation"),ld=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={...e.annotations};delete r[ud];const s={...r,...t},a=r1(e);return kt(a)&&(s[o0]=ld(a.value,t)),n.annotations.value=s,Object.create(Object.getPrototypeOf(e),n)},tce="[\\s\\S]*?",nce="[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?",I4=(e,t)=>{switch(e._tag){case"Literal":return Lb(String(e.literal));case"StringKeyword":return tce;case"NumberKeyword":return nce;case"TemplateLiteral":return A4(e);case"Union":return e.types.map(n=>I4(n)).join("|")}},rce=(e,t,n,r)=>o1(e)?`(${t})`:t,A4=(e,t,n)=>{let r="";if(e.head!==""){const s=Lb(e.head);r+=s}for(const s of e.spans){const a=I4(s.type);if(r+=rce(s.type,a),s.literal!==""){const o=Lb(s.literal);r+=o}}return r},Sv=e=>new RegExp(`^${A4(e)}$`),xA=(e,t)=>{const n=[],r=[],s=a=>{switch(a._tag){case"NeverKeyword":break;case"StringKeyword":case"SymbolKeyword":case"TemplateLiteral":case"Refinement":r.push(new wm(a,t,!0));break;case"Literal":if(Cn(a.literal)||Js(a.literal))n.push(new Fn(a.literal,t,!1,!0));else throw new Error(cie(a.literal));break;case"Enums":{for(const[o,i]of a.enums)n.push(new Fn(i,t,!1,!0));break}case"UniqueSymbol":n.push(new Fn(a.symbol,t,!1,!0));break;case"Union":a.types.forEach(s);break;default:throw new Error(iie(a))}};return s(e),{propertySignatures:n,indexSignatures:r}},Gk=e=>Zn.make([e,Nf]),dh=(e,t)=>{switch(e._tag){case"TupleType":return new a1(e.elements.map(n=>new eu(Gk(n.type),!0)),TV(e.rest,{onEmpty:()=>e.rest,onNonEmpty:n=>[new vm(Zn.make([...iT(n),Nf]))]}),e.isReadonly);case"TypeLiteral":return new po(e.propertySignatures.map(n=>new Fn(n.name,Gk(n.type),!0,n.isReadonly,n.annotations)),e.indexSignatures.map(n=>new wm(n.parameter,Gk(n.type),n.isReadonly)));case"Union":return Zn.make(e.types.map(n=>dh(n)));case"Suspend":return new Ll(()=>dh(e.f()));case"Declaration":case"Refinement":throw new Error(mA(e));case"Transformation":{if(wv(e.transformation)&&e.transformation.propertySignatureTransformations.every(ece))return new Qo(dh(e.from),dh(e.to),e.transformation);throw new Error(mA(e))}}return e},N4=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},sce=e=>t=>{const n={...t.annotations};for(const r of e)delete n[r];return n},ace=N4([nT,rT,sT,o4,i4,c4]),gn=e=>{switch(e._tag){case"Declaration":{const t=ms(e.typeParameters,gn);return t===e.typeParameters?e:new s1(t,e.decodeUnknown,e.encodeUnknown,e.annotations)}case"TupleType":{const t=ms(e.elements,s=>{const a=gn(s.type);return a===s.type?s:new eu(a,s.isOptional)}),n=iT(e.rest),r=ms(n,gn);return t===e.elements&&r===n?e:new a1(t,r.map(s=>new vm(s)),e.isReadonly,e.annotations)}case"TypeLiteral":{const t=ms(e.propertySignatures,r=>{const s=gn(r.type);return s===r.type?r:new Fn(r.name,s,r.isOptional,r.isReadonly)}),n=ms(e.indexSignatures,r=>{const s=gn(r.type);return s===r.type?r:new wm(r.parameter,s,r.isReadonly)});return t===e.propertySignatures&&n===e.indexSignatures?e:new po(t,n,e.annotations)}case"Union":{const t=ms(e.types,gn);return t===e.types?e:Zn.make(t,e.annotations)}case"Suspend":return new Ll(()=>gn(e.f()),e.annotations);case"Refinement":{const t=gn(e.from);return t===e.from?e:new uT(t,e.filter,e.annotations)}case"Transformation":{const t=ace(e);return gn(t!==void 0?ld(e.to,t):e.to)}}return e};function ms(e,t){let n=!1;const r=cy(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 Ev=e=>{switch(e._tag){case"Transformation":return e.from;case"Refinement":return Ev(e.from);case"Suspend":return Ev(e.f())}},fa=(e,t)=>{switch(e._tag){case"Declaration":{const n=ms(e.typeParameters,r=>fa(r));return n===e.typeParameters?e:new s1(n,e.decodeUnknown,e.encodeUnknown)}case"TupleType":{const n=ms(e.elements,a=>{const o=fa(a.type);return o===a.type?a:new eu(o,a.isOptional)}),r=iT(e.rest),s=ms(r,a=>fa(a));return n===e.elements&&s===r?e:new a1(n,s.map(a=>new vm(a)),e.isReadonly)}case"TypeLiteral":{const n=ms(e.propertySignatures,s=>{const a=fa(s.type);return a===s.type?s:new Fn(s.name,a,s.isOptional,s.isReadonly)}),r=ms(e.indexSignatures,s=>{const a=fa(s.type);return a===s.type?s:new wm(s.parameter,a,s.isReadonly)});return n===e.propertySignatures&&r===e.indexSignatures?e:new po(n,r)}case"Union":{const n=ms(e.types,r=>fa(r));return n===e.types?e:Zn.make(n)}case"Suspend":{let n;const r=y4(e);return kt(r)&&(n={[b4]:`${r.value}Encoded`}),new Ll(()=>fa(e.f()),n)}case"Refinement":return fa(e.from);case"Transformation":return fa(e.from)}return e},d0=e=>fa(e),dn=e=>{const t={};for(const n of Object.getOwnPropertySymbols(e))t[String(n)]=e[n];return t},R4=e=>{switch(e._tag){case"StringKeyword":case"SymbolKeyword":case"TemplateLiteral":return e;case"Refinement":return R4(e.from)}},oce=(e,t)=>new Qo(e,t,C4),Eo=e=>zt(Ra(e),()=>e._tag);function ice(e){return ln(m4(e),{onNone:()=>"",onSome:t=>t.map(n=>` & Brand<${vo(n)}>`).join("")})}const P4=e=>aT(e).pipe(Ta(()=>oT(e)),Ta(()=>p4(e)),$r(t=>t+ice(e))),Ra=e=>Ta(xm(e),()=>P4(e)),cce=(e,t,n)=>{switch(e._tag){case"UndefinedKeyword":return _m;case"Union":{const r=[];let s=!1;for(const a of e.types){const o=t(a);o?(s=!0,x4(o)||r.push(o)):r.push(a)}if(s)return Zn.make(r);break}case"Suspend":return t(e.f());case"Transformation":return n(e)}};class Wn{path;actual;issue;_tag="Pointer";constructor(t,n,r){this.path=t,this.actual=n,this.issue=r}}class _A{actual;message;_tag="Unexpected";constructor(t,n){this.actual=t,this.message=n}}class jd{ast;message;_tag="Missing";actual=void 0;constructor(t,n){this.ast=t,this.message=n}}class nn{ast;actual;issues;output;_tag="Composite";constructor(t,n,r,s){this.ast=t,this.actual=n,this.issues=r,this.output=s}}class Kk{ast;actual;kind;issue;_tag="Refinement";constructor(t,n,r,s){this.ast=t,this.actual=n,this.kind=r,this.issue=s}}class Wk{ast;actual;kind;issue;_tag="Transformation";constructor(t,n,r,s){this.ast=t,this.actual=n,this.kind=r,this.issue=s}}class An{ast;actual;message;_tag="Type";constructor(t,n,r){this.ast=t,this.actual=n,this.message=r}}class Tv{ast;actual;message;_tag="Forbidden";constructor(t,n,r){this.ast=t,this.actual=n,this.message=r}}const vA=Symbol.for("effect/Schema/ParseErrorTypeId");class uce extends od("ParseError"){[vA]=vA;get message(){return this.toString()}toString(){return cl.formatIssueSync(this.issue)}toJSON(){return{_id:"ParseError",message:this.toString()}}[ht](){return this.toJSON()}}const i1=e=>new uce({issue:e}),Xr=He,uc=ze,h0=rV,kr=sV,Vs=L(2,(e,t)=>kr(e)?Lr(e,{onLeft:ze,onRight:t}):Me(e,t)),Jn=L(2,(e,t)=>kr(e)?aV(e,t):St(e,t)),Ph=L(2,(e,t)=>kr(e)?LL(e,t):DE(e,t)),O4=L(2,(e,t)=>kr(e)?Lr(e,{onLeft:t,onRight:He}):R6(e,t)),c1=(e,t)=>t===void 0||Js(t)?e:e===void 0?t:{...e,...t},lT=(e,t,n)=>{const r=Mn(e,t);return(s,a)=>r(s,c1(n,a))},L4=(e,t,n)=>{const r=lT(e,t,n);return(s,a)=>$L(r(s,a),i1)},dT=(e,t,n)=>{const r=lT(e,t,n);return(s,a)=>lV(r(s,a))},$4=(e,t,n)=>{const r=Mn(e,t);return(s,a)=>r(s,{...c1(n,a),isEffectAllowed:!0})},hT=(e,t)=>L4(e.ast,!0,t),Pi=(e,t)=>dT(e.ast,!0,t),lce=(e,t)=>lT(e.ast,!0,t),M4=(e,t)=>$4(e.ast,!0,t),j4=(e,t)=>$4(e.ast,!1,t),u1=(e,t)=>L4(gn(e.ast),!0,t),dce=(e,t)=>{const n=Mn(gn(e.ast),!0);return(r,s)=>_a(n(r,{exact:!0,...c1(t,s)}))},hce=Fe(Symbol.for("effect/ParseResult/decodeMemoMap"),()=>new WeakMap),fce=Fe(Symbol.for("effect/ParseResult/encodeMemoMap"),()=>new WeakMap),Mn=(e,t)=>{const n=t?hce:fce,r=n.get(e);if(r)return r;const s=mce(e,t),a=wie(e),o=kt(a)?(u,l)=>s(u,c1(l,a.value)):s,i=Sie(e),c=t&&kt(i)?(u,l)=>fh(O4(o(u,l),i.value),e,u,l):o;return n.set(e,c),c},Yk=e=>_r(xie(e)),Jk=e=>_r(_ie(e)),mce=(e,t)=>{switch(e._tag){case"Refinement":if(t){const n=Mn(e.from,!0);return(r,s)=>{s=s??Vk;const a=s?.errors==="all",o=Vs(O4(n(r,s),i=>{const c=new Kk(e,r,"From",i);return a&&Tie(e)&&z4(i)?ln(e.filter(r,s,e),{onNone:()=>ze(c),onSome:u=>ze(new nn(e,r,[c,new Kk(e,r,"Predicate",u)]))}):ze(c)}),i=>ln(e.filter(i,s,e),{onNone:()=>He(i),onSome:c=>ze(new Kk(e,r,"Predicate",c))}));return fh(o,e,r,s)}}else{const n=Mn(gn(e),!0),r=Mn(D4(e.from),!1);return(s,a)=>fh(Vs(n(s,a),o=>r(o,a)),e,s,a)}case"Transformation":{const n=bce(e.transformation,t),r=t?Mn(e.from,!0):Mn(e.to,!1),s=t?Mn(e.to,!0):Mn(e.from,!1);return(a,o)=>fh(Vs(Ph(r(a,o),i=>new Wk(e,a,t?"Encoded":"Type",i)),i=>Vs(Ph(n(i,o??Vk,e,a),c=>new Wk(e,a,"Transformation",c)),c=>Ph(s(c,o),u=>new Wk(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)=>fh(n(r,s??Vk,e),e,r,s)}case"Literal":return qr(e,n=>n===e.literal);case"UniqueSymbol":return qr(e,n=>n===e.symbol);case"UndefinedKeyword":return qr(e,GH);case"NeverKeyword":return qr(e,KH);case"UnknownKeyword":case"AnyKeyword":case"VoidKeyword":return He;case"StringKeyword":return qr(e,Cn);case"NumberKeyword":return qr(e,Js);case"BooleanKeyword":return qr(e,Cc);case"BigIntKeyword":return qr(e,ey);case"SymbolKeyword":return qr(e,h_);case"ObjectKeyword":return qr(e,Qs);case"Enums":return qr(e,n=>e.enums.some(([r,s])=>s===n));case"TemplateLiteral":{const n=Sv(e);return qr(e,r=>Cn(r)&&n.test(r))}case"TupleType":{const n=e.elements.map(u=>Mn(u.type,t)),r=e.rest.map(u=>Mn(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=Yk(e),c=Jk(e);return(u,l)=>{if(!AV(u))return ze(new An(e,u));const d=l?.errors==="all",h=[];let f=0;const p=[],x=u.length;for(let _=x;_<=a-1;_++){const S=new Wn(_,u,new jd(s[_-x]));if(d){h.push([f++,S]);continue}else return ze(new nn(e,u,S,p))}if(e.rest.length===0)for(let _=e.elements.length;_<=x-1;_++){const S=new Wn(_,u,new _A(u[_],`is unexpected, expected: ${o}`));if(d){h.push([f++,S]);continue}else return ze(new nn(e,u,S,p))}let g=0,b;for(;g<n.length;g++)if(x<g+1){if(e.elements[g].isOptional)continue}else{const _=n[g],S=_(u[g],l);if(kr(S)){if(Dn(S)){const w=new Wn(g,u,S.left);if(d){h.push([f++,w]);continue}else return ze(new nn(e,u,w,Ls(p)))}p.push([f++,S.right])}else{const w=f++,v=g;b||(b=[]),b.push(({es:C,output:I})=>Me(xu(S),R=>{if(Dn(R)){const N=new Wn(v,u,R.left);return d?(C.push([w,N]),dt):ze(new nn(e,u,N,Ls(I)))}return I.push([w,R.right]),dt}))}}if(Qt(r)){const[_,...S]=r;for(;g<x-S.length;g++){const w=_(u[g],l);if(kr(w))if(Dn(w)){const v=new Wn(g,u,w.left);if(d){h.push([f++,v]);continue}else return ze(new nn(e,u,v,Ls(p)))}else p.push([f++,w.right]);else{const v=f++,C=g;b||(b=[]),b.push(({es:I,output:R})=>Me(xu(w),N=>{if(Dn(N)){const z=new Wn(C,u,N.left);return d?(I.push([v,z]),dt):ze(new nn(e,u,z,Ls(R)))}else return R.push([v,N.right]),dt}))}}for(let w=0;w<S.length;w++)if(g+=w,!(x<g+1)){const v=S[w](u[g],l);if(kr(v)){if(Dn(v)){const C=new Wn(g,u,v.left);if(d){h.push([f++,C]);continue}else return ze(new nn(e,u,C,Ls(p)))}p.push([f++,v.right])}else{const C=f++,I=g;b||(b=[]),b.push(({es:R,output:N})=>Me(xu(v),z=>{if(Dn(z)){const V=new Wn(I,u,z.left);return d?(R.push([C,V]),dt):ze(new nn(e,u,V,Ls(N)))}return N.push([C,z.right]),dt}))}}}const y=({es:_,output:S})=>Qu(_)?ze(new nn(e,u,Ls(_),Ls(S))):He(Ls(S));if(b&&b.length>0){const _=b;return on(()=>{const S={es:ah(h),output:ah(p)};return Me(Aa(_,w=>w(S),{concurrency:i,batching:c,discard:!0}),()=>y(S))})}return y({output:p,es:h})}}case"TypeLiteral":{if(e.propertySignatures.length===0&&e.indexSignatures.length===0)return qr(e,WH);const n=[],r={},s=[];for(const l of e.propertySignatures)n.push([Mn(l.type,t),l]),r[l.name]=null,s.push(l.name);const a=e.indexSignatures.map(l=>[Mn(l.parameter,t),Mn(l.type,t),l.parameter]),o=Zn.make(e.indexSignatures.map(l=>l.parameter).concat(s.map(l=>h_(l)?new Nie(l):new i0(l)))),i=Mn(o,t),c=Yk(e),u=Jk(e);return(l,d)=>{if(!of(l))return ze(new An(e,l));const h=d?.errors==="all",f=[];let p=0;const x=d?.onExcessProperty==="error",g=d?.onExcessProperty==="preserve",b={};let y;if(x||g){y=Reflect.ownKeys(l);for(const v of y){const C=i(v,d);if(kr(C)&&Dn(C))if(x){const I=new Wn(v,l,new _A(l[v],`is unexpected, expected: ${String(o)}`));if(h){f.push([p++,I]);continue}else return ze(new nn(e,l,I,b))}else b[v]=l[v]}}let _;const S=d?.exact===!0;for(let v=0;v<n.length;v++){const C=n[v][1],I=C.name,R=Object.prototype.hasOwnProperty.call(l,I);if(!R){if(C.isOptional)continue;if(S){const V=new Wn(I,l,new jd(C));if(h){f.push([p++,V]);continue}else return ze(new nn(e,l,V,b))}}const N=n[v][0],z=N(l[I],d);if(kr(z)){if(Dn(z)){const V=new Wn(I,l,R?z.left:new jd(C));if(h){f.push([p++,V]);continue}else return ze(new nn(e,l,V,b))}b[I]=z.right}else{const V=p++,ne=I;_||(_=[]),_.push(({es:J,output:te})=>Me(xu(z),se=>{if(Dn(se)){const oe=new Wn(ne,l,R?se.left:new jd(C));return h?(J.push([V,oe]),dt):ze(new nn(e,l,oe,te))}return te[ne]=se.right,dt}))}}for(let v=0;v<a.length;v++){const C=a[v],I=C[0],R=C[1],N=XD(l,C[2]);for(const z of N){const V=I(z,d);if(kr(V)&&_a(V)){const ne=R(l[z],d);if(kr(ne))if(Dn(ne)){const J=new Wn(z,l,ne.left);if(h){f.push([p++,J]);continue}else return ze(new nn(e,l,J,b))}else Object.prototype.hasOwnProperty.call(r,z)||(b[z]=ne.right);else{const J=p++,te=z;_||(_=[]),_.push(({es:se,output:oe})=>Me(xu(ne),me=>{if(Dn(me)){const Xe=new Wn(te,l,me.left);return h?(se.push([J,Xe]),dt):ze(new nn(e,l,Xe,oe))}else return Object.prototype.hasOwnProperty.call(r,z)||(oe[z]=me.right),dt}))}}}}const w=({es:v,output:C})=>{if(Qu(v))return ze(new nn(e,l,Ls(v),C));if(d?.propertyOrder==="original"){const I=y||Reflect.ownKeys(l);for(const N of s)I.indexOf(N)===-1&&I.push(N);const R={};for(const N of I)Object.prototype.hasOwnProperty.call(C,N)&&(R[N]=C[N]);return He(R)}return He(C)};if(_&&_.length>0){const v=_;return on(()=>{const C={es:ah(f),output:Object.assign({},b)};return Me(Aa(v,I=>I(C),{concurrency:c,batching:u,discard:!0}),()=>w(C))})}return w({es:f,output:b})}}case"Union":{const n=pce(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],Mn(e.types[u],t));const i=Yk(e)??1,c=Jk(e);return(u,l)=>{const d=[];let h=0,f=[];if(s>0)if(nS(u))for(let g=0;g<s;g++){const b=r[g],y=n.keys[b].buckets;if(Object.prototype.hasOwnProperty.call(u,b)){const _=String(u[b]);if(Object.prototype.hasOwnProperty.call(y,_))f=f.concat(y[_]);else{const{candidates:S,literals:w}=n.keys[b],v=Zn.make(w),C=S.length===a?new po([new Fn(b,v,!1,!0)],[]):Zn.make(S);d.push([h++,new nn(C,u,new Wn(b,u,new An(v,u[b])))])}}else{const{candidates:_,literals:S}=n.keys[b],w=new Fn(b,Zn.make(S),!1,!0),v=_.length===a?new po([w],[]):Zn.make(_);d.push([h++,new nn(v,u,new Wn(b,u,new jd(w)))])}}else{const g=n.candidates.length===a?e:Zn.make(n.candidates);d.push([h++,new An(g,u)])}n.otherwise.length>0&&(f=f.concat(n.otherwise));let p;for(let g=0;g<f.length;g++){const b=f[g],y=o.get(b)(u,l);if(kr(y)&&(!p||p.length===0)){if(_a(y))return y;d.push([h++,y.left])}else{const _=h++;p||(p=[]),p.push(S=>on(()=>"finalResult"in S?dt:Me(xu(y),w=>(_a(w)?S.finalResult=w:S.es.push([_,w.left]),dt))))}}const x=g=>Qu(g)?g.length===1&&g[0][1]._tag==="Type"?ze(g[0][1]):ze(new nn(e,u,Ls(g))):ze(new An(e,u));if(p&&p.length>0){const g=p;return on(()=>{const b={es:ah(d)};return Me(Aa(g,y=>y(b),{concurrency:i,batching:c,discard:!0}),()=>"finalResult"in b?b.finalResult:x(b.es))})}return x(d)}}case"Suspend":{const n=ZD(()=>Mn(e.f(),t));return(r,s)=>n()(r,s)}}},qr=(e,t)=>n=>t(n)?He(n):ze(new An(e,n)),hh=(e,t)=>{switch(e._tag){case"Declaration":{const n=r1(e);if(kt(n))return hh(n.value,t);break}case"TypeLiteral":{const n=[];for(let r=0;r<e.propertySignatures.length;r++){const s=e.propertySignatures[r],a=t?d0(s.type):gn(s.type);Rh(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?d0(s.type):gn(s.type);Rh(a)&&!s.isOptional&&n.push([r,a])}return n}case"Refinement":return hh(e.from,t);case"Suspend":return hh(e.f(),t);case"Transformation":return hh(t?e.from:e.to,t)}return[]},pce=(e,t)=>{const n={},r=[],s=[];for(let a=0;a<e.length;a++){const o=e[a],i=hh(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}},D4=e=>vc(e)?D4(e.from):e,fh=(e,t,n,r)=>{if(r?.isEffectAllowed===!0||kr(e))return e;const s=new Uy,a=Qy(e,{scheduler:s});s.flush();const o=a.unsafePoll();if(o){if(_j(o))return He(o.value);const i=o.cause;return Tte(i)?ze(i.error):ze(new Tv(t,n,Yy(i)))}return ze(new Tv(t,n,"cannot be be resolved synchronously, this is caused by using runSync on an effect that performs async work"))},gce=([e],[t])=>e>t?1:e<t?-1:0;function Ls(e){return e.sort(gce).map(t=>t[1])}const bce=(e,t)=>{switch(e._tag){case"FinalTransformation":return t?e.decode:e.encode;case"ComposeTransformation":return He;case"TypeLiteralTransformation":return n=>{let r=He(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=Jn(r,u=>{const l=i(Object.prototype.hasOwnProperty.call(u,a)?xe(u[a]):fe());return delete u[a],kt(l)&&(u[o]=l.value),u})}return r}}},pr=(e,t=[])=>({value:e,forest:t}),cl={formatIssue:e=>Jn(ju(e),yce),formatIssueSync:e=>{const t=cl.formatIssue(e);return kr(t)?ML(t):Es(t)},formatError:e=>cl.formatIssue(e.issue),formatErrorSync:e=>cl.formatIssueSync(e.issue)},yce=e=>e.value+F4(`
|
|
28
|
+
`,e.forest),F4=(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+=F4(e+(r>1&&!o?"│ ":" "),s.forest)}return n},kce=e=>{switch(e){case"Encoded":return"Encoded side transformation failure";case"Transformation":return"Transformation process failure";case"Type":return"Type side transformation failure"}},xce=e=>{switch(e){case"From":return"From side refinement failure";case"Predicate":return"Predicate refinement failure"}},B4=e=>"ast"in e?xe(e.ast):fe(),Cv=He(void 0),_ce=e=>B4(e).pipe(Ii(gie),ln({onNone:()=>Cv,onSome:t=>{const n=t(e);return Cn(n)?He({message:n,override:!1}):Ni(n)?St(n,r=>({message:r,override:!1})):Cn(n.message)?He({message:n.message,override:n.override}):St(n.message,r=>({message:r,override:n.override}))}})),fT=e=>t=>t._tag===e,z4=fT("Composite"),wA=fT("Refinement"),SA=fT("Transformation"),ci=e=>Vs(_ce(e),t=>t!==void 0?!t.override&&(z4(e)||wA(e)&&e.kind==="From"||SA(e)&&e.kind!=="Transformation")?SA(e)||wA(e)?ci(e.issue):Cv:He(t.message):Cv),U4=e=>B4(e).pipe(Ii(vie),zL(t=>t(e)),_r);function vce(e){return oT(e).pipe(Ta(()=>aT(e)),Ta(()=>p4(e)),Ta(()=>xm(e)),zt(()=>`{ ${e.from} | filter }`))}function wce(e){return e.message!==void 0?e.message:`Expected ${vc(e.ast)?vce(e.ast):String(e.ast)}, actual ${vo(e.actual)}`}const H4=e=>Jn(ci(e),t=>t??U4(e)??wce(e)),ip=e=>U4(e)??String(e.ast),q4=e=>e.message??"is forbidden",V4=e=>e.message??"is unexpected",G4=e=>{const t=bie(e.ast);if(kt(t)){const n=t.value();return Cn(n)?He(n):n}return He(e.message??"is missing")},ju=e=>{switch(e._tag){case"Type":return Jn(H4(e),pr);case"Forbidden":return He(pr(ip(e),[pr(q4(e))]));case"Unexpected":return He(pr(V4(e)));case"Missing":return Jn(G4(e),pr);case"Transformation":return Vs(ci(e),t=>t!==void 0?He(pr(t)):Jn(ju(e.issue),n=>pr(ip(e),[pr(kce(e.kind),[n])])));case"Refinement":return Vs(ci(e),t=>t!==void 0?He(pr(t)):Jn(ju(e.issue),n=>pr(ip(e),[pr(xce(e.kind),[n])])));case"Pointer":return Jn(ju(e.issue),t=>pr(e4(e.path),[t]));case"Composite":return Vs(ci(e),t=>{if(t!==void 0)return He(pr(t));const n=ip(e);return ZE(e.issues)?Jn(Aa(e.issues,ju),r=>pr(n,r)):Jn(ju(e.issues),r=>pr(n,[r]))})}},Di=(e,t,n)=>({_tag:e,path:t,message:n}),Oh={formatIssue:e=>Du(e,void 0,[]),formatIssueSync:e=>{const t=Oh.formatIssue(e);return kr(t)?ML(t):Es(t)},formatError:e=>Oh.formatIssue(e.issue),formatErrorSync:e=>Oh.formatIssueSync(e.issue)},Du=(e,t,n)=>{const r=e._tag;switch(r){case"Type":return Jn(H4(e),s=>[Di(t??r,n,s)]);case"Forbidden":return He([Di(r,n,q4(e))]);case"Unexpected":return He([Di(r,n,V4(e))]);case"Missing":return Jn(G4(e),s=>[Di(r,n,s)]);case"Pointer":return Du(e.issue,void 0,n.concat(e.path));case"Composite":return Vs(ci(e),s=>s!==void 0?He([Di(r,n,s)]):ZE(e.issues)?Jn(Aa(e.issues,a=>Du(a,void 0,n)),WL):Du(e.issues,void 0,n));case"Refinement":return Vs(ci(e),s=>s!==void 0?He([Di(r,n,s)]):Du(e.issue,e.kind==="Predicate"?r:void 0,n));case"Transformation":return Vs(ci(e),s=>s!==void 0?He([Di(r,n,s)]):Du(e.issue,e.kind==="Transformation"?r:void 0,n))}},EA=tie,Sce=L(e=>Qs(e[0]),(e,...t)=>{const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}),K4=L(e=>Qs(e[0]),(e,...t)=>{const n={...e};for(const r of t)delete n[r];return n}),$l=Symbol.for("effect/Schema");function Et(e){return class{[$l]=Iv;static ast=e;static annotations(n){return Et(oa(this.ast,n))}static pipe(){return Ee(this,arguments)}static toString(){return String(e)}static Type;static Encoded;static Context;static[$l]=Iv}}const Iv={_A:e=>e,_I:e=>e,_R:e=>e},TA=e=>_j(e)?e.value:Ece(Yy(e.cause)),Ece=e=>({issues:[{message:e}]}),Tce=e=>St(Oh.formatIssue(e),t=>({issues:t.map(n=>({path:n.path,message:n.message}))})),Oi=(e,t)=>{const n=M4(e,{errors:"all"});return class extends Et(e.ast){static"~standard"={version:1,vendor:"effect",validate(s){const a=new Uy,o=Qy(tse(n(s,t),{onFailure:Tce,onSuccess:c=>Pt({value:c})}),{scheduler:a});a.flush();const i=o.unsafePoll();return i?TA(i):new Promise(c=>{o.addObserver(u=>{c(TA(u))})})}}}},CA={typeConstructor:fie,schemaId:eT,message:a4,missingMessage:tT,identifier:ud,title:as,description:Ri,examples:nT,default:rT,documentation:mie,jsonSchema:sT,arbitrary:o4,pretty:i4,equivalence:c4,concurrency:u4,batching:l4,parseIssueTitle:d4,parseOptions:h4,decodingFallback:f4},tu=e=>{if(!e)return{};const t={...e};for(const n in CA)if(n in e){const r=CA[n];t[r]=e[n],delete t[n]}return t},oa=(e,t)=>ld(e,tu(t)),Cce=e=>Et(d0(e.ast)),IA=e=>Et(gn(e.ast)),Dd=(e,t)=>{const n=j4(e,t);return(r,s)=>Ph(n(r,s),i1)},Ice=(e,t)=>{const n=M4(e,t);return(r,s)=>Ph(n(r,s),i1)},Ace=(e,t)=>{const n=lce(e,t);return(r,s)=>LL(n(r,s),i1)},Nce=Ice,ra=e=>Le(e,$l)&&Qs(e[$l]);function Rce(e){return cT(e)?Zn.make(Jie(e,t=>new i0(t))):new i0(e[0])}function W4(e,t=Rce(e)){return class extends Et(t){static annotations(r){return W4(this.literals,oa(this.ast,r))}static literals=[...e]}}function ee(...e){return Qt(e)?W4(e):Rf}const Pce=(e,t,n)=>mT(e,new s1(e.map(r=>r.ast),(...r)=>t.decode(...r.map(Et)),(...r)=>t.encode(...r.map(Et)),tu(n))),Oce=(e,t)=>{const n=()=>(s,a,o)=>e(s)?Xr(s):uc(new An(o,s)),r=n;return mT([],new s1([],n,r,tu(t)))};function mT(e,t){return class extends Et(t){static annotations(r){return mT(this.typeParameters,oa(this.ast,r))}static typeParameters=[...e]}}const pT=function(){if(Array.isArray(arguments[0])){const n=arguments[0],r=arguments[1],s=arguments[2];return Pce(n,r,s)}const e=arguments[0],t=arguments[1];return Oce(e,t)};class Lce extends Et(Nf){}class $ce extends Et(Oie){}class l1 extends Et(Aie){}class Rf extends Et(_m){}class Un extends Et(_4){}class Mce extends Et(Hie){}class E extends Et(c0){}class st extends Et(u0){}class Ve extends Et(l0){}const jce=e=>Zn.make(e.map(t=>t.ast));function Y4(e,t=jce(e)){return class extends Et(t){static annotations(r){return Y4(this.members,oa(this.ast,r))}static members=[...e]}}function Tt(...e){return cT(e)?Y4(e):Qt(e)?e[0]:Rf}const K=e=>Tt(e,l1),Dce=e=>Tt(e,Lce),Fce=(e,t)=>new a1(e.map(n=>ra(n)?new eu(n.ast,!1):n.ast),t.map(n=>ra(n)?new vm(n.ast):n.ast),!0);function f0(e,t,n=Fce(e,t)){return class extends Et(n){static annotations(s){return f0(this.elements,this.rest,oa(this.ast,s))}static elements=[...e];static rest=[...t]}}function Bce(...e){return Array.isArray(e[0])?f0(e[0],e.slice(1)):f0(e,[])}function J4(e,t){return class extends f0([],[e],t){static annotations(r){return J4(this.value,oa(this.ast,r))}static value=e}}const ge=e=>J4(e),Av=e=>e?'"?:"':'":"';class d1 extends eu{isReadonly;defaultValue;_tag="PropertySignatureDeclaration";constructor(t,n,r,s,a){super(t,n,s),this.isReadonly=r,this.defaultValue=a}toString(){const t=Av(this.isOptional),n=String(this.type);return`PropertySignature<${t}, ${n}, never, ${t}, ${n}>`}}class Q4 extends eu{isReadonly;defaultValue;constructor(t,n,r,s,a){super(t,n,s),this.isReadonly=r,this.defaultValue=a}}const zce=e=>e===void 0?"never":Cn(e)?JSON.stringify(e):String(e);class X4{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<${Av(this.to.isOptional)}, ${this.to.type}, ${zce(this.from.fromKey)}, ${Av(this.from.isOptional)}, ${this.from.type}>`}}const Z4=(e,t)=>{switch(e._tag){case"PropertySignatureDeclaration":return new d1(e.type,e.isOptional,e.isReadonly,{...e.annotations,...t},e.defaultValue);case"PropertySignatureTransformation":return new X4(e.from,new Q4(e.to.type,e.to.isOptional,e.to.isReadonly,{...e.to.annotations,...t},e.to.defaultValue),e.decode,e.encode)}},e5=Symbol.for("effect/PropertySignature"),gT=e=>Le(e,e5);class h1{ast;[$l];[e5]=null;_TypeToken;_Key;_EncodedToken;_HasDefault;constructor(t){this.ast=t}pipe(){return Ee(this,arguments)}annotations(t){return new h1(Z4(this.ast,tu(t)))}toString(){return String(this.ast)}}const AA=e=>new h1(e);class f1 extends h1{from;constructor(t,n){super(t),this.from=n}annotations(t){return new f1(Z4(this.ast,tu(t)),this.from)}}const Lh=e=>new f1(new d1(e.ast,!1,!0,{},void 0),e),t5=L(2,(e,t)=>{const n=e.ast;switch(n._tag){case"PropertySignatureDeclaration":return AA(new d1(n.type,n.isOptional,n.isReadonly,n.annotations,t));case"PropertySignatureTransformation":return AA(new X4(n.from,new Q4(n.to.type,n.to.isOptional,n.to.isReadonly,n.to.annotations,t),n.decode,n.encode))}}),M=e=>{const t=e.ast===Nf||e.ast===_m?Nf:Dce(e).ast;return new f1(new d1(t,!0,!0,{},void 0),e)},Uce=N4([tT]),Hce=(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(gT(l)){const d=l.ast;switch(d._tag){case"PropertySignatureDeclaration":{const h=d.type,f=d.isOptional,p=d.annotations;a.push(new Fn(u,h,f,!0,Uce(d))),o.push(new Fn(u,gn(h),f,!0,p)),r.push(new Fn(u,h,f,!0,p));break}case"PropertySignatureTransformation":{const h=d.from.fromKey??u;a.push(new Fn(h,d.from.type,d.from.isOptional,!0,d.from.annotations)),o.push(new Fn(u,d.to.type,d.to.isOptional,!0,d.to.annotations)),i.push(new Zie(h,u,d.decode,d.encode));break}}}else a.push(new Fn(u,l.ast,!1,!0)),o.push(new Fn(u,gn(l.ast),!1,!0)),r.push(new Fn(u,l.ast,!1,!0))}if(Qt(i)){const c=[],u=[];for(const l of t){const{indexSignatures:d,propertySignatures:h}=xA(l.key.ast,l.value.ast);h.forEach(f=>{a.push(f),o.push(new Fn(f.name,gn(f.type),f.isOptional,f.isReadonly,f.annotations))}),d.forEach(f=>{c.push(f),u.push(new wm(f.parameter,gn(f.type),f.isReadonly))})}return new Qo(new po(a,c,{[il]:"Struct (Encoded side)"}),new po(o,u,{[il]:"Struct (Type side)"}),new vv(i))}}const s=[];for(const a of t){const{indexSignatures:o,propertySignatures:i}=xA(a.key.ast,a.value.ast);i.forEach(c=>r.push(c)),o.forEach(c=>s.push(c))}return new po(r,s)},n5=(e,t)=>{const n=Reflect.ownKeys(e);for(const r of n){const s=e[r];if(t[r]===void 0&&gT(s)){const a=s.ast,o=a._tag==="PropertySignatureDeclaration"?a.defaultValue:a.to.defaultValue;o!==void 0&&(t[r]=o())}}return t};function bT(e,t,n=Hce(e,t)){return class extends Et(n){static annotations(s){return bT(this.fields,this.records,oa(this.ast,s))}static fields={...e};static records=[...t];static make=(s,a)=>{const o=n5(e,{...s});return m1(a)?o:u1(this)(o)};static pick(...s){return B(Sce(e,...s))}static omit(...s){return B(K4(e,...s))}}}function B(e,...t){return bT(e,t)}const qce=e=>ee(e).pipe(Lh,t5(()=>e)),Vce=(e,t)=>B({_tag:qce(e),...t});function r5(e,t,n){return class extends bT({},[{key:e,value:t}],n){static annotations(s){return r5(e,t,oa(this.ast,s))}static key=e;static value=t}}const Qe=e=>r5(e.key,e.value);function s5(e,t){return class extends Et(t){static annotations(r){return s5(this.from,oa(this.ast,r))}static make=(r,s)=>m1(s)?r:u1(this)(r);static from=e}}const Rt=(e,t)=>n=>{const r=ln(m4(n.ast),{onNone:()=>[e],onSome:a=>[...a,e]}),s=ld(n.ast,tu({[s4]:r,...t}));return s5(n,s)},Sm=e=>Et(dh(e.ast)),Fd=(e,t,n)=>{if(xv(e)&&xv(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 Fn(a,m0(c,s.type,n.concat(a)),i,!0)}}return new po(r,e.indexSignatures.concat(t.indexSignatures))}throw new Error(n4(e,t,n))},Gce=sce([ud]),Bd=(e,t)=>t.map(n=>new uT(n,e.filter,Gce(e))),m0=(e,t,n)=>Zn.make(Za([e],[t],n)),Fi=e=>o1(e)?e.types:[e],Za=(e,t,n)=>Sb(e,r=>Sb(t,s=>{switch(s._tag){case"Literal":{if(Cn(s.literal)&&kv(r)||Js(s.literal)&&bA(r)||Cc(s.literal)&&yA(r))return[s];break}case"StringKeyword":{if(s===c0){if(kv(r)||Rh(r)&&Cn(r.literal))return[r];if(vc(r))return Bd(r,Za(Fi(r.from),[s],n))}else if(r===c0)return[s];break}case"NumberKeyword":{if(s===u0){if(bA(r)||Rh(r)&&Js(r.literal))return[r];if(vc(r))return Bd(r,Za(Fi(r.from),[s],n))}else if(r===u0)return[s];break}case"BooleanKeyword":{if(s===l0){if(yA(r)||Rh(r)&&Cc(r.literal))return[r];if(vc(r))return Bd(r,Za(Fi(r.from),[s],n))}else if(r===l0)return[s];break}case"Union":return Za(Fi(r),s.types,n);case"Suspend":return[new Ll(()=>m0(r,s.f(),n))];case"Refinement":return Bd(s,Za(Fi(r),Fi(s.from),n));case"TypeLiteral":{switch(r._tag){case"Union":return Za(r.types,[s],n);case"Suspend":return[new Ll(()=>m0(r.f(),s,n))];case"Refinement":return Bd(r,Za(Fi(r.from),[s],n));case"TypeLiteral":return[Fd(r,s,n)];case"Transformation":{const a=r.transformation,o=Fd(r.from,s,n),i=Fd(r.to,gn(s),n);switch(a._tag){case"TypeLiteralTransformation":return[new Qo(o,i,new vv(a.propertySignatureTransformations))];case"ComposeTransformation":return[new Qo(o,i,C4)];case"FinalTransformation":return[new Qo(o,i,new T4((c,u,l,d)=>Jn(a.decode(c,u,l,d),h=>({...c,...h})),(c,u,l,d)=>Jn(a.encode(c,u,l,d),h=>({...c,...h}))))]}}}break}case"Transformation":{if(E4(r)){if(wv(s.transformation)&&wv(r.transformation))return[new Qo(Fd(r.from,s.from,n),Fd(r.to,s.to,n),new vv(s.transformation.propertySignatureTransformations.concat(r.transformation.propertySignatureTransformations)))]}else return Za([s],[r],n);break}}throw new Error(n4(r,s,n))})),Bt=L(2,(e,t)=>Et(m0(e.ast,t.ast,[]))),lc=L(e=>ra(e[1]),(e,t)=>kT(e,t,oce(e.ast,t.ast))),yT=e=>Et(new Ll(()=>e().ast)),a5=Symbol.for("effect/SchemaId/Refine");function o5(e,t,n){return class extends Et(n){static annotations(s){return o5(this.from,this.filter,oa(this.ast,s))}static[a5]=e;static from=e;static filter=t;static make=(s,a)=>m1(a)?s:u1(this)(s)}}const NA=(e,t,n)=>{if(Cc(e))return e?fe():xe(new An(t,n));if(Cn(e))return xe(new An(t,n,e));if(e!==void 0){if("_tag"in e)return xe(e);const r=new An(t,n,e.message);return xe(Qt(e.path)?new Wn(e.path,n,r):r)}return fe()},Kce=(e,t,n)=>{if(nie(e))return NA(e,t,n);if(Qt(e)){const r=YL(e,s=>NA(s,t,n));if(Qt(r))return xe(r.length===1?r[0]:new nn(t,n,r))}return fe()};function i5(e,t){return n=>{function r(a,o,i){return Kce(e(a,o,i),i,a)}const s=new uT(n.ast,r,tu(t));return o5(n,r,s)}}function kT(e,t,n){return class extends Et(n){static annotations(s){return kT(this.from,this.to,oa(this.ast,s))}static from=e;static to=t}}const Bc=L(e=>ra(e[0])&&ra(e[1]),(e,t,n)=>kT(e,t,new Qo(e.ast,t.ast,new T4(n.decode,n.encode)))),nu=L(e=>ra(e[0])&&ra(e[1]),(e,t,n)=>Bc(e,t,{strict:!0,decode:(r,s,a,o)=>Xr(n.decode(r,o)),encode:(r,s,a,o)=>Xr(n.encode(r,o))})),Wce=Symbol.for("effect/SchemaId/Trimmed"),Yce=e=>t=>t.pipe(i5(n=>n===n.trim(),{schemaId:Wce,title:"trimmed",description:"a string with no leading or trailing whitespace",jsonSchema:{pattern:"^\\S[\\s\\S]*\\S$|^\\S$|^$"},...e})),Jce=hie,Qce=(e,t)=>n=>n.pipe(i5(r=>r.length>=e,{schemaId:Jce,title:`minLength(${e})`,description:`a string at least ${e} character(s) long`,jsonSchema:{minLength:e},...t})),p0=e=>Qce(1,{title:"nonEmptyString",description:"a non empty string",...e});class Xce extends E.pipe(Yce({identifier:"Trimmed"})){}class g0 extends nu(E.annotations({description:"a string that will be trimmed"}),Xce,{strict:!0,decode:t=>t.trim(),encode:Ue}).annotations({identifier:"Trim"}){}const RA=e=>e instanceof Error?e.message:String(e),Zce=e=>Bc(E.annotations({description:"a string to be decoded into JSON"}),Un,{strict:!0,decode:(t,n,r)=>h0({try:()=>JSON.parse(t,e?.reviver),catch:s=>new An(r,t,RA(s))}),encode:(t,n,r)=>h0({try:()=>JSON.stringify(t,e?.replacer,e?.space),catch:s=>new An(r,t,RA(s))})}).annotations({title:"parseJson",schemaId:k4}),hr=(e,t)=>ra(e)?lc(hr(t),e):Zce(e),eue=(e,t)=>{const n=Symbol.keyFor(e);return n===void 0?uc(new An(t,e,`Unable to encode a unique symbol ${String(e)} into a string`)):Xr(n)},tue=e=>Xr(Symbol.for(e));class nue extends pT(YH,{typeConstructor:{_tag:"Uint8Array"},identifier:"Uint8ArrayFromSelf",pretty:()=>t=>`new Uint8Array(${JSON.stringify(Array.from(t))})`,arbitrary:()=>t=>t.uint8Array(),equivalence:()=>uy(Be)}){}const rue=e=>ra(e)||gT(e),c5=e=>Reflect.ownKeys(e).every(t=>rue(e[t])),xT=e=>"fields"in e?e.fields:xT(e[a5]),u5=e=>c5(e)?B(e):ra(e)?e:B(xT(e)),l5=e=>c5(e)?e:xT(e),sue=e=>t5(Lh(ee(e)),()=>e),dd=e=>(t,n,r)=>{class s extends NE{}s.prototype.name=t;const a=l5(n),o=u5(n),i={_tag:sue(t)},c=Gg(i,a),u="message"in c;class l extends Kg({kind:"TaggedError",identifier:t,schema:Bt(o,B(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=>`${Yf(d)}: ${vo(this[d])}`).join(", ")} }`},enumerable:!1,configurable:!0}),l},Gg=(e,t)=>{const n={...e};for(const r of Reflect.ownKeys(t)){if(r in e)throw new Error(r4(r));n[r]=t[r]}return n};function m1(e){return Cc(e)?e:e?.disableValidation??!1}const PA=Fe("effect/Schema/astCache",()=>new WeakMap),aue=e=>e===void 0?[]:Array.isArray(e)?e:[e],Kg=({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]=aue(t),d=IA(o),h=d.annotations({identifier:s,...c}),f=d.annotations({[il]:`${s} (Type side)`,...c}),p=o.annotations({[il]:`${s} (Constructor)`,...c}),x=o.annotations({[il]:`${s} (Encoded side)`,...l}),g=o.annotations({...l,...c,...u}),b=_=>Le(_,i)&&dce(f)(_),y=class extends e{constructor(_={},S=!1){_={..._},delete _._tag,_=n5(r,_),m1(S)||(_=u1(p)(_)),super(_,!0)}static[$l]=Iv;static get ast(){let _=PA.get(this);if(_)return _;const S=pT([o],{decode:()=>(w,v,C)=>w instanceof this||b(w)?Xr(w):uc(new An(C,w)),encode:()=>(w,v)=>w instanceof this?Xr(w):Jn(j4(f)(w,v),C=>new this(C,!0))},{identifier:s,pretty:w=>v=>`${s}(${w(v)})`,arbitrary:w=>v=>w(v).map(C=>new this(C)),equivalence:Ue,[o0]:h.ast,...c});return _=nu(x,S,{strict:!0,decode:w=>new this(w,!0),encode:Ue}).annotations({[o0]:g.ast,...u}).ast,PA.set(this,_),_}static pipe(){return Ee(this,arguments)}static annotations(_){return Et(this.ast).annotations(_)}static toString(){return`(${String(x)} <-> ${s})`}static make(..._){return new this(..._)}static fields={...r};static identifier=s;static extend(_){return(S,w)=>{const v=l5(S),C=u5(S),I=Gg(r,v);return Kg({kind:a,identifier:_,schema:Bt(o,C),fields:I,Base:this,annotations:w})}}static transformOrFail(_){return(S,w,v)=>{const C=Gg(r,S);return Kg({kind:a,identifier:_,schema:Bc(o,IA(B(C)),w),fields:C,Base:this,annotations:v})}}static transformOrFailFrom(_){return(S,w,v)=>{const C=Gg(r,S);return Kg({kind:a,identifier:_,schema:Bc(Cce(o),B(C),w),fields:C,Base:this,annotations:v})}}get[i](){return i}};return n!==!0&&Object.defineProperty(y.prototype,"toString",{value(){return`${s}({ ${Reflect.ownKeys(r).map(_=>`${Yf(_)}: ${vo(this[_])}`).join(", ")} })`},configurable:!0,writable:!0}),y},OA=Vce("symbol",{key:E}).annotations({description:"an object to be decoded into a globally shared symbol"}),oue=Bc(OA,Mce,{strict:!0,decode:e=>tue(e.key),encode:(e,t,n)=>Jn(eue(e,n),r=>OA.make({key:r}))});class iue extends Tt(E,st,oue).annotations({identifier:"PropertyKey"}){}class cue extends B({_tag:Lh(ee("Pointer","Unexpected","Missing","Composite","Refinement","Transformation","Type","Forbidden")).annotations({description:"The tag identifying the type of parse issue"}),path:Lh(ge(iue)).annotations({description:"The path to the property where the issue occurred"}),message:Lh(E).annotations({description:"A descriptive message explaining the issue"})}).annotations({identifier:"ArrayFormatterIssue",description:"Represents an issue returned by the ArrayFormatter formatter"}){}const d5=(e,t)=>{class n extends NE{_tag=t}return n.prototype[e]=e,n.prototype.name=t,n},uue=Ws,lue=id,due=PD,hue=VE,LA=GE,fue=toe,h5=Symbol.for("effect/Subscribable"),f5=e=>Le(e,h5),mue="effect/SubscriptionRef",pue=Symbol.for(mue),gue=L(2,(e,t)=>F(vX(e.ref,t),BE(eae(e.pubsub,t)),e.semaphore.withPermits(1))),Nv=pue,$A=gue,bue="~effect-atom/atom/Result",p1={[bue]:{E:Ue,A:Ue},pipe(){return Ee(this,arguments)},[Ye](e){if(this._tag!==e._tag||this.waiting!==e.waiting)return!1;switch(this._tag){case"Initial":return!0;case"Success":return Be(this.value,e.value);case"Failure":return Be(this.cause,e.cause)}},[We](){const e=Yt(`${this._tag}:${this.waiting}`);return this._tag==="Initial"?Ft(this,e):Ft(this,ot(e)(this._tag==="Success"?Ne(this.value):Ne(this.cause)))}},m5=(e,t)=>e._tag==="Success"?vi(e.value):Em(e.cause,{previous:t}),_T=e=>e._tag==="None"?ui(!0):g1(e.value),yue=e=>e._tag!=="Initial",ui=(e=!1)=>{const t=Object.create(p1);return t._tag="Initial",t.waiting=e,t},zc=e=>e._tag==="Success",vi=(e,t)=>{const n=Object.create(p1);return n._tag="Success",n.value=e,n.waiting=t?.waiting??!1,n.timestamp=t?.timestamp??Date.now(),n},p5=e=>e._tag==="Failure",kue=(e,t)=>{const n=Object.create(p1);return n._tag="Failure",n.cause=e,n.previousSuccess=t?.previousSuccess??fe(),n.waiting=t?.waiting??!1,n},Em=(e,t)=>kue(e,{previousSuccess:Ii(t.previous,n=>zc(n)?xe(n):p5(n)?n.previousSuccess:fe()),waiting:t.waiting}),xue=(e,t)=>Em(Xj(e),t),g1=(e,t)=>{if(e.waiting)return t?.touch?_ue(e):e;const n=Object.assign(Object.create(p1),e);return n.waiting=!0,n},_ue=e=>zc(e)?vi(e.value,{waiting:e.waiting}):e,mh=(e,t)=>e._tag==="Failure"?Em(e.cause,{previous:t,waiting:e.waiting}):e,g5=e=>e._tag==="Success"?xe(e.value):e._tag==="Failure"?$r(e.previousSuccess,t=>t.value):fe(),Rv=e=>BL(g5(e),()=>new sd("Result.getOrThrow: no value found")),MA=e=>{switch(e._tag){case"Success":return Jr(e.value);case"Failure":return ur(e.cause);default:return qb(new sd)}},vue={immediate:!0},wue=e=>{e()},Qk="~effect-atom/atom/Registry",Sue=e=>new Eue(e?.initialValues,e?.scheduleTask,e?.timeoutResolution,e?.defaultIdleTTL),Pv="~effect-atom/atom/Atom/Serializable",zd=e=>Pv in e?e[Pv].key:e;class Eue{scheduleTask;defaultIdleTTL;[Qk];timeoutResolution;constructor(t,n=a=>queueMicrotask(a),r,s){if(this.scheduleTask=n,this.defaultIdleTTL=s,this[Qk]=Qk,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,ml,vue)}atomHasTtl(t){return!t.keepAlive&&t.idleTTL!==0&&(t.idleTTL!==void 0||this.defaultIdleTTL!==void 0)}ensureNode(t){const n=zd(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[Pv].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 Tue(this,t)}invalidateAtom=t=>{this.ensureNode(t).invalidate()};scheduleAtomRemoval(t){this.scheduleTask(()=>{const n=this.nodes.get(zd(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(zd(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(zd(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(zd(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 Ku;(function(e){e[e.alive=1]="alive",e[e.initialized=2]="initialized",e[e.waitingForValue=4]="waitingForValue"})(Ku||(Ku={}));var Ds;(function(e){e[e.uninitialized=5]="uninitialized",e[e.stale=7]="stale",e[e.valid=3]="valid",e[e.removed=0]="removed"})(Ds||(Ds={}));class Tue{registry;atom;constructor(t,n){this.registry=t,this.atom=n,this.writeContext=new Nue(t,this)}state=Ds.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&Ku.waitingForValue)!==0){this.lifetime=Aue(this);const t=this.atom.read(this.lifetime);if((this.state&Ku.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&Ku.initialized)===0?fe():xe(this._value)}setValue(t){if((this.state&Ku.initialized)===0){this.state=Ds.valid,this._value=t,pn.phase===Sa.collect?pn.notify.add(this):this.notify();return}this.state=Ds.valid,!Be(this._value,t)&&(this._value=t,this.skipInvalidation?this.skipInvalidation=!1:this.invalidateChildren(),this.listeners.size>0&&(pn.phase===Sa.collect?pn.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===Ds.valid&&(this.state=Ds.stale,this.disposeLifetime()),pn.phase===Sa.collect?pn.stale.push(this):this.atom.lazy&&this.listeners.size===0&&!Cue(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(wue),pn.phase===Sa.commit&&pn.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=Ds.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 Cue(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 Yn=e=>new Error(`Cannot use context of disposed Atom: ${e}`),Iue={get registry(){return this.node.registry},addFinalizer(e){if(this.disposed)throw Yn(this.node.atom);this.finalizers??=[],this.finalizers.push(e)},get(e){if(this.disposed)throw Yn(this.node.atom);const t=this.node.registry.ensureNode(e);return this.node.addParent(t),t.value()},result(e,t){if(this.disposed)throw Yn(this.node.atom);if(this.isFn)return this.resultOnce(e,t);const n=this.get(e);if(t?.suspendOnWaiting&&n.waiting)return oi;switch(n._tag){case"Initial":return oi;case"Failure":return ur(n.cause);case"Success":return Pt(n.value)}},resultOnce(e,t){if(this.disposed)throw Yn(this.node.atom);return cv(n=>{const r=this.once(e);if(r._tag!=="Initial"&&!(t?.suspendOnWaiting&&r.waiting))return n(MA(r));const s=this.node.registry.subscribe(e,a=>{a._tag==="Initial"||t?.suspendOnWaiting&&a.waiting||(s(),n(MA(a)))},{immediate:!1});return Mt(s)})},setResult(e,t){if(this.disposed)throw Yn(this.node.atom);return this.node.registry.set(e,t),this.resultOnce(e,{suspendOnWaiting:!0})},some(e){if(this.disposed)throw Yn(this.node.atom);if(this.isFn)return this.someOnce(e);const t=this.get(e);return t._tag==="None"?oi:Pt(t.value)},someOnce(e){if(this.disposed)throw Yn(this.node.atom);return cv(t=>{const n=this.once(e);if(kt(n))return t(Pt(n.value));const r=this.node.registry.subscribe(e,s=>{un(s)||(r(),t(Pt(s.value)))},{immediate:!1});return Mt(r)})},once(e){if(this.disposed)throw Yn(this.node.atom);return this.node.registry.get(e)},self(){if(this.disposed)throw Yn(this.node.atom);return this.node.valueOption()},refresh(e){if(this.disposed)throw Yn(this.node.atom);this.node.registry.refresh(e)},refreshSelf(){if(this.disposed)throw Yn(this.node.atom);this.node.invalidate()},mount(e){if(this.disposed)throw Yn(this.node.atom);this.addFinalizer(this.node.registry.mount(e))},subscribe(e,t,n){if(this.disposed)throw Yn(this.node.atom);this.addFinalizer(this.node.registry.subscribe(e,t,n))},setSelf(e){if(this.disposed)throw Yn(this.node.atom);this.node.setValue(e)},set(e,t){if(this.disposed)throw Yn(this.node.atom);this.node.registry.set(e,t)},stream(e,t){if(this.disposed)throw Yn(this.node.atom);return F(t0(V6(t?.bufferSize??16),s0),M6(n=>t0(Mt(()=>this.node.registry.subscribe(e,r=>{sae(n,r)},{immediate:t?.withoutInitialValue!==!0})),r=>Mt(r))),St(n=>Hoe(n)),WD)},streamResult(e,t){return F(this.stream(e,t),zoe(yue),Uoe(n=>n._tag==="Success"?Goe(n.value):Boe(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]()}},Aue=e=>{function t(n){if(t.disposed)throw Yn(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,Iue),t.isFn=!1,t.disposed=!1,t.finalizers=void 0,t.node=e,t};class Nue{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 Sa;(function(e){e[e.disabled=0]="disabled",e[e.collect=1]="collect",e[e.commit=2]="commit"})(Sa||(Sa={}));const pn=Fe("@effect-atom/atom/Registry/batchState",()=>({phase:Sa.disabled,depth:0,stale:[],notify:new Set}));function Rue(e){pn.phase=Sa.collect,pn.depth++;try{if(e(),pn.depth===1){for(let t=0;t<pn.stale.length;t++)b5(pn.stale[t]);pn.phase=Sa.commit;for(const t of pn.notify)t.notify();pn.notify.clear()}}finally{pn.depth--,pn.depth===0&&(pn.phase=Sa.disabled,pn.stale=[])}}function b5(e){if(e.state!==Ds.valid){for(let t=0;t<e.parents.length;t++){const n=e.parents[t];n.state!==Ds.valid&&b5(n)}e.state!==Ds.valid&&e.value()}}const Pue=e=>{const t=e;switch(t._tag){case"Failure":case"Success":return t;case"Left":return qb(t.left);case"Right":return Jr(t.right);case"Some":return Jr(t.value);case"None":return qb(new sd)}},vT=e=>{const t=Zy(e);return(n,r,s=!1)=>{const a=Pue(n);if(a){r(a);return}const o=new Uy,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(es)}return u}},y5=Sue;class k5 extends Ar("@effect/atom/Registry/CurrentRegistry")(){}const Ov="~effect-atom/atom/Atom",Lv="~effect-atom/atom/Atom/Writable",Oue=L(2,(e,t)=>{const n=Zs(t),r=eK(n);return Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,keepAlive:!r,idleTTL:r?Ab(n):void 0})}),Pf=Oue(0),wT={[Ov]:Ov,pipe(){return Ee(this,arguments)},toJSON(){return{_id:"Atom",keepAlive:this.keepAlive,lazy:this.lazy,label:this.label}},toString(){return Lt(this)},[ht](){return this.toJSON()}},Lue={...wT,atom(e,t){const n=x5(e,t);return Ea(r=>{const s=r.self(),a=r(this);return a._tag!=="Success"?mh(a,s):n(r,a.value)})},fn(e,t){return arguments.length===0?(n,r)=>jA(this,n,r):jA(this,e,t)},pull(e,t){const n=Pf(b0(0)),r=Ea(s=>{const a=s.self(),o=s(this);return o._tag!=="Success"?mh(o,a):$h(s,Gue(s,n,e,t),ui(!0),o.value)});return Kue(n,r)},subscriptionRef(e){return zue(Pf(Ea(t=>{const n=t.self(),r=t(this);if(r._tag!=="Success")return mh(r,n);const s=typeof e=="function"?e(t):e;return Nv in s?s:$h(t,s,ui(!0),r.value)})),(t,n)=>{const r=Rv(t(this));return BA(t,n,r)})},subscribable(e){return Uue(Ea(t=>{const n=t.self(),r=t(this);if(r._tag!=="Success")return mh(r,n);const s=typeof e=="function"?e(t):e;return f5(s)?s:$h(t,s,ui(!0),r.value)}),(t,n)=>{const r=Rv(t(this));return BA(t,n,r)})}},jA=(e,t,n)=>{const[r,s,a]=que(n?.reactivityKeys?(o,i)=>{const c=t(o,i);return Ni(c)?Joe(c,n.reactivityKeys):GD(c,Qoe(n.reactivityKeys))}:t,n);return Tm(o=>{o.get(a);const i=o.self(),c=o.get(e);return c._tag!=="Success"?mh(c,i):r(o,c.value)},s)},$ue={...wT,[Lv]:Lv},Mue=e=>Lv in e,Ea=(e,t)=>{const n=Object.create(wT);return n.keepAlive=!1,n.lazy=!0,n.read=e,n.refresh=t,n},Tm=(e,t,n)=>{const r=Object.create($ue);return r.keepAlive=!1,r.lazy=!0,r.read=e,r.write=t,r.refresh=n,r};function jue(e,t){e.setSelf(t)}const Ma=(e,t)=>{const n=x5(e,t);return Ov in n?n:Ea(n)},DA=e=>uV in e||nV in e,x5=(e,t)=>{if(typeof e=="function"&&!Ni(e)&&!(Uk in e)){const n=e;return function(r,s){const a=n(r);if(Qs(a)){if(DA(a))return a;if(iv in a)return $v(r,a,t,s);if(Uk in a)return FA(r,a,t,s)}return a}}else if(Qs(e)){if(DA(e))return b0(e);if(iv in e)return function(n,r){return $v(n,e,t,r)};if(Uk in e)return function(n,r){return FA(n,e,t,r)}}return b0(e)},b0=e=>Tm(function(t){return e},jue),$v=(e,t,n,r)=>{const s=n?.initialValue!==void 0?vi(n.initialValue):ui();return $h(e,t,s,r,n?.uninterruptible)};function $h(e,t,n,r=e1,s=!1){const a=e.self(),o=Es(o6());e.addFinalizer(()=>{Qy(Xb(o,gE))});const i=new Map(r.context.unsafeMap);i.set(cne.key,o),i.set(k5.key,e.registry);const c=zE({context:Gq(i),fiberRefs:r.fiberRefs,runtimeFlags:r.runtimeFlags});let u,l=!1;const d=vT(c)(t,function(h){u=m5(h,a),l&&e.setSelf(u)},s);return l=!0,d!==void 0&&e.addFinalizer(d),u!==void 0?u:a._tag==="Some"?_T(a):g1(n)}const Due=e=>{let t=Hk;function n(s){const a=Object.create(Lue);a.keepAlive=!1,a.lazy=!0,a.refresh=void 0,a.factory=n;const o=ja(Ea(typeof s=="function"?i=>Lk(s(i),t):()=>Lk(s,t)));return a.layer=o,a.read=function(c){const u=c(o),l=Me(Me(Jy,d=>JI(u,e.memoMap,d)),d=>If(pm(),d));return $v(c,l,{uninterruptible:!0})},a}n.memoMap=e.memoMap,n.addGlobalLayer=s=>{t=Lk(t,vse(s,Hk))};const r=Pf(Ma(Wre(s=>JI(Hk,e.memoMap,s)).pipe(St(Gs(km)))));return n.withReactivity=s=>a=>Wue(a,o=>{const i=Rv(o(r));return o.addFinalizer(i.unsafeRegister(s,()=>{o.refresh(a)})),o.subscribe(a,c=>o.setSelf(c)),o.once(a)}),n},Fue=Fe("@effect-atom/atom/Atom/defaultMemoMap",()=>Es(wse)),Bue=Fe("@effect-atom/atom/Atom/defaultContext",()=>Due({memoMap:Fue}));Bue.withReactivity;const FA=(e,t,n,r)=>{const s=n?.initialValue!==void 0?vi(n.initialValue):ui();return ST(e,t,s,r)};function ST(e,t,n,r=e1){const s=e.self(),a=lue({onInput(c){return hue(()=>{const u=QV(c);return u._tag==="Some"&&e.setSelf(vi(u.value,{waiting:!0})),a})},onFailure(c){return LA(()=>{e.setSelf(Em(c,{previous:e.self()}))})},onDone(c){return LA(()=>{F(e.self(),Ii(g5),ln({onNone:()=>e.setSelf(xue(new sd,{previous:e.self()})),onSome:u=>e.setSelf(vi(u))}))})}}),o=zE({context:Yr(r.context,k5,e.registry),fiberRefs:r.fiberRefs,runtimeFlags:r.runtimeFlags}),i=vT(o)(due(uue(KD(t),a)),ml,!1);return i!==void 0&&e.addFinalizer(i),s._tag==="Some"?_T(s):g1(n)}const BA=(e,t,n=e1)=>h5 in t?(e.addFinalizer(t.changes.pipe(Voe(r=>(e.setSelf(r),dt)),use(n))),cse(n)(t.get)):t._tag!=="Success"?t:ST(e,t.value.changes,ui(!0),n),zue=(e,t)=>{function n(r,s){const a=r.get(e);Nv in a?Es($A(a,s)):zc(a)&&Es($A(a.value,s))}return Tm(r=>{const s=r(e);return Nv in s||zc(s)?t(r,s):s},n)},Uue=(e,t)=>Ea(n=>{const r=n(e);return f5(r)||zc(r)?t(n,r):r}),Hue=Symbol.for("@effect-atom/atom/Atom/Reset"),Xk=Symbol.for("@effect-atom/atom/Atom/Interrupt");function que(e,t){const n=Pf(b0([0,void 0])),r=t?.initialValue!==void 0?vi(t.initialValue):ui(),s=t?.concurrent?Pf(Ea(i=>{const c=new Set;return i.addFinalizer(()=>c.forEach(u=>u.unsafeInterruptAsFork(es))),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===Xk)return Em(Zj(es),{previous:i.self()});let h=e(d,i);if(iv in h){if(u){const f=h;h=Me(pm(),p=>{const x=Zy(p,f);u.add(x);const g=Array.from(u);return x.addObserver(()=>u.delete(x)),Vue(g)})}return $h(i,h,r,c,!1)}return ST(i,h,r,c)}function o(i,c){Yue(()=>{c===Hue?i.set(n,[0,void 0]):c===Xk?i.set(n,[i.get(n)[0]+1,Xk]):i.set(n,[i.get(n)[0]+1,c]),i.refreshSelf()})}return[a,o,n]}const Vue=e=>cv(t=>{let n=0,r,s;function a(i,c=!1){i._tag==="Failure"?r=r?Ete(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?ur(r):s||ur(Ste))}return o(),Mt(()=>{n<e.length&&e[n].removeObserver(a)})}),Gue=(e,t,n,r)=>Me(fue(KD(typeof n=="function"?n(e):n)),s=>{const a=nse(1),o=fV(Ine()),i=o.currentContext;let c=rr();const u=Me(Zre(on(()=>s),F6,i),Lr({onLeft:()=>{const f=ws(c);return Qu(f)?Pt({done:!0,items:f}):$a(new sd("Atom.pull: no items"))},onRight(f){let p;r?.disableAccumulation?p=f:(p=yn(c,f),c=p);const x=ws(p);return Qu(x)?Pt({done:!1,items:x}):u}})),l=a.withPermits(1)(u),d=vT(zE({context:i,fiberRefs:o.getFiberRefs(),runtimeFlags:e1.runtimeFlags})),h=new Set;return e.addFinalizer(()=>{for(const f of h)f()}),e.once(t),e.subscribe(t,()=>{e.setSelf(_T(e.self()));let f;f=d(l,p=>{f&&h.delete(f);const x=m5(p,e.self()),g=h.size>0;e.setSelf(g?g1(x):x)}),f&&h.add(f)}),u}),Kue=(e,t)=>Tm(t.read,function(n,r){n.set(e,n.get(e)+1)}),To=typeof WeakRef>"u"||typeof FinalizationRegistry>"u"?e=>{const t=K_();return function(n){const r=no(t,n);if(r._tag==="Some")return r.value;const s=e(n);return Zi(t,n,s),s}}:e=>{const t=K_(),n=new FinalizationRegistry(r=>{QZ(t,r)});return function(r){const s=no(t,r).pipe(zL(o=>o.deref()));if(s._tag==="Some")return s.value;const a=e(r);return Zi(t,r,new WeakRef(a)),n.register(a,r),a}},ja=e=>Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,keepAlive:!0}),Wue=L(2,(e,t)=>Mue(e)?Tm(t,function(n,r){n.set(e,r)},e.refresh??function(n){n(e)}):Ea(t,e.refresh??function(n){n(e)})),Yue=Rue,zA="~effect-atom/atom/Atom/ServerValue",Jue=L(2,(e,t)=>zA in e?e[zA](n=>t.get(n)):t.get(e)),Wg=Symbol.for("@effect/platform/HttpApiSchema/AnnotationMultipart"),Yg=Symbol.for("@effect/platform/HttpApiSchema/AnnotationMultipartStream"),Mh=Symbol.for("@effect/platform/HttpApiSchema/AnnotationStatus"),Jg=Symbol.for("@effect/platform/HttpApiSchema/AnnotationEmptyDecodeable"),jh=Symbol.for("@effect/platform/HttpApiSchema/AnnotationEncoding"),Dh=Symbol.for("@effect/platform/HttpApiSchema/AnnotationParam"),_5=e=>{const t={};return Mh in e&&(t[Mh]=e[Mh]),Jg in e&&(t[Jg]=e[Jg]),jh in e&&(t[jh]=e[jh]),Dh in e&&(t[Dh]=e[Dh]),Wg in e&&(t[Wg]=e[Wg]),Yg in e&&(t[Yg]=e[Yg]),t},Que=e=>e._tag==="Transformation"?{...e.to.annotations,...e.annotations}:e.annotations,Cm=(e,t)=>Que(e)[t],v5=(e,t)=>Cm(e,Mh)??t,w5=e=>Cm(e,Jg)??!1,Xue=e=>Cm(e,Wg),Zue=e=>Cm(e,Yg),ele={kind:"Json",contentType:"application/json"},Im=(e,t=ele)=>Cm(e,jh)??t,tle=e=>(e._tag==="PropertySignatureTransformation"?e.to.annotations:e.annotations)[Dh]?.name,sa=e=>{const t=K4(e,"status");return e.status!==void 0&&(t[Mh]=e.status),t},Mv=e=>{switch(e._tag){case"VoidKeyword":return!0;case"Transformation":return Mv(e.from);case"Suspend":return Mv(e.f());default:return!1}},nle=e=>v5(e,Mv(e)?204:200),Zk=e=>v5(e,500),jv=e=>{function t(r){if(o1(r))for(const s of r.types)t(s);else n.push(r)}const n=[];return t(e),n},S5=(e,t)=>Zn.make(Array.from(new Set([...jv(e),...jv(t)]))),li=(e,t)=>Et(S5(e.ast,t.ast)),As=L(2,(e,t)=>{const n={[Dh]:{name:e,schema:t}};if(ra(t)){const r=xm(t.ast);kt(r)&&(n[ud]=r.value)}return t.annotations(n)}),rle=e=>$ce.annotations(sa({status:e})),Dv=rle(204),sle=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"}},ale=L(2,(e,t)=>e.annotations({[jh]:{kind:t.kind,contentType:t.contentType??sle(t.kind)},...t.kind==="Uint8Array"?{jsonSchema:{type:"string",format:"binary"}}:void 0})),E5=e=>ale(E,{kind:"Text",...e});class ole extends cue.annotations({identifier:"Issue",description:"Represents an error encountered while parsing a value to match the schema"}){}class y0 extends dd()("HttpApiDecodeError",{issues:ge(ole),message:E},sa({status:400,description:"The request did not match the expected schema"})){static fromParseError(t){return Oh.formatError(t).pipe(n0(cl.formatError(t)),St(([n,r])=>new y0({issues:n,message:r})))}static refailParseError(t){return Me(y0.fromParseError(t),$a)}}const UA=Symbol.for("@effect/platform/HttpApi"),ile={[UA]:UA,pipe(){return Ee(this,arguments)},add(e){return Do({identifier:this.identifier,groups:wV(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(Xs());r.annotations=Dr(e.annotations,r.annotations),r.middlewares=new Set([...e.middlewares,...r.middlewares]),t[n]=r}return Do({identifier:this.identifier,groups:t,errorSchema:li(this.errorSchema,e.errorSchema),annotations:this.annotations,middlewares:this.middlewares})},addError(e,t){return Do({identifier:this.identifier,groups:this.groups,errorSchema:li(this.errorSchema,t?.status?e.annotations(sa({status:t.status})):e),annotations:this.annotations,middlewares:this.middlewares})},prefix(e){return Do({identifier:this.identifier,groups:Uu(this.groups,t=>t.prefix(e)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},middleware(e){return Do({identifier:this.identifier,groups:this.groups,errorSchema:li(this.errorSchema,e.failure),annotations:this.annotations,middlewares:new Set([...this.middlewares,e])})},annotate(e,t){return Do({identifier:this.identifier,groups:this.groups,errorSchema:this.errorSchema,annotations:Yr(this.annotations,e,t),middlewares:this.middlewares})},annotateContext(e){return Do({identifier:this.identifier,groups:this.groups,errorSchema:this.errorSchema,annotations:Dr(this.annotations,e),middlewares:this.middlewares})}},Do=e=>{function t(){}return Object.setPrototypeOf(t,ile),t.groups=e.groups,t.errorSchema=e.errorSchema,t.annotations=e.annotations,t.middlewares=e.middlewares,t},cle=e=>Do({groups:new Map,errorSchema:y0,annotations:Xs(),middlewares:new Set}),T5=(e,t)=>{const n=cp(e.errorSchema.ast,new Map,Zk),r=Object.values(e.groups);for(const s of r){const a=cp(s.errorSchema.ast,n,Zk),o=Dr(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=cp(c.errorSchema.ast,a,Zk);t.onEndpoint({group:s,endpoint:c,middleware:new Set([...s.middlewares,...c.middlewares]),mergedAnnotations:Dr(o,c.annotations),payloads:c.payloadSchema._tag==="Some"?lle(c.payloadSchema.value.ast):ule,successes:cp(c.successSchema.ast,new Map,nle),errors:u})}}},ule=new Map,cp=(e,t,n)=>{const r=new Map(t);function s(a){if(x4(a))return;const o=_5(e.annotations);_V(o)||(a=ld(a,{...o,...a.annotations}));const i=n(a),c=w5(a),u=r.get(i);r.set(i,{description:(u?u.description:fe()).pipe(Ta(()=>dle(a))),ast:(u?u.ast:fe()).pipe($r(l=>S5(l,a)),Ta(()=>!c&&Lie(d0(a))?fe():xe(a)))})}return jv(e).forEach(s),r},lle=e=>{const t=new Map;function n(r){if(r._tag==="NeverKeyword")return;r=ld(r,{..._5(e.annotations),...r.annotations});const s=Im(r),a=Xue(r)||Zue(r)?"multipart/form-data":s.contentType,o=t.get(a);o===void 0?t.set(a,{encoding:s,ast:r}):o.ast=Zn.make([o.ast,r])}if(e._tag==="Union")for(const r of e.types)n(r);else n(e);return t},dle=e=>{const t="to"in e?{...e.to.annotations,...e.annotations}:e.annotations;return Vl(t[Ri]??t[ud])};class hle extends Ar("@effect/platform/HttpApi/AdditionalSchemas")(){}const ru=e=>{const t=C5(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},C5=e=>{const t=Symbol.iterator in e?wt(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=C5(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},I5=ge(Bce(E,E)).annotations({identifier:"UrlParams"}),fle=[],mle=L(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}),ple=L(2,(e,t)=>gS(e,ru(t))),gle=(e,t,n)=>{try{const r=new URL(e,ble());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),He(r)}catch(r){return ze(r)}},A5=e=>new URLSearchParams(e).toString(),ble=()=>{if("location"in globalThis&&globalThis.location!==void 0&&globalThis.location.origin!==void 0&&globalThis.location.pathname!==void 0)return location.origin+location.pathname},yle=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}},kle=nu(E,I5,{decode(e){return ru(new URLSearchParams(e))},encode(e){return A5(e)}}),xle=e=>nu(I5,e,{decode(t){return yle(t)},encode(t){return ru(t)}}),_le=e=>lc(kle,xle(e)),Qg=Symbol.for("@effect/platform/HttpBody");class ET{[Qg];constructor(){this[Qg]=Qg}[ht](){return this.toJSON()}toString(){return Lt(this)}}class vle extends ET{_tag="Empty";toJSON(){return{_id:"@effect/platform/HttpBody",_tag:"Empty"}}}const wle=new vle;class Sle extends ET{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 N5=(e,t)=>new Sle(e,t??"application/octet-stream"),Ele=new TextEncoder,R5=(e,t)=>N5(Ele.encode(e),t??"text/plain"),Tle=(e,t)=>R5(A5(e),t??"application/x-www-form-urlencoded");class Cle extends ET{formData;_tag="FormData";constructor(t){super(),this.formData=t}toJSON(){return{_id:"@effect/platform/HttpBody",_tag:"FormData",formData:this.formData}}}const Ile=e=>new Cle(e),Ale=Qg,Nle=e=>Le(e,Ale),Rle=N5,HA=R5,Ple=Tle,qA=Symbol.for("@effect/platform/Cookies"),VA=Symbol.for("@effect/platform/Cookies/Cookie"),Ole={[qA]:qA,...ry,toJSON(){return{_id:"@effect/platform/Cookies",cookies:Uu(this.cookies,e=>e.toJSON())}},pipe(){return Ee(this,arguments)}},Lle=e=>{const t=Object.create(Ole);return t.cookies=e,t},$le=e=>{const t={};for(const n of e)t[n.name]=n;return Lle(t)},Mle=e=>{const t=typeof e=="string"?[e]:e,n=[];for(const r of t){const s=jle(r.trim());kt(s)&&n.push(s.value)}return $le(n)};function jle(e){const t=e.split(";").map(i=>i.trim()).filter(i=>i!=="");if(t.length===0)return fe();const n=t[0].indexOf("=");if(n===-1)return fe();const r=t[0].slice(0,n);if(!Dle.test(r))return fe();const s=t[0].slice(n+1),a=Fle(s);if(t.length===1)return xe(Object.assign(Object.create(GA),{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=E$(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 xe(Object.assign(Object.create(GA),{name:r,value:a,valueEncoded:s,options:Object.keys(o).length>0?o:void 0}))}const Dle=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,GA={[VA]:VA,...ry,toJSON(){return{_id:"@effect/platform/Cookies/Cookie",name:this.name,value:this.value,options:this.options}}},Fle=e=>{try{return decodeURIComponent(e)}catch{return e}},KA=Symbol.for("@effect/platform/Headers"),Of=Object.assign(Object.create(null),{[KA]:KA,[sy](e){return Bv(this,qM(e,O5))}}),b1=e=>Object.assign(Object.create(Of),e),P5=Object.create(Of),TT=e=>{if(e===void 0)return P5;if(Symbol.iterator in e){const n=Object.create(Of);for(const[r,s]of e)n[r.toLowerCase()]=s;return n}const t=Object.create(Of);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},Ble=e=>Object.setPrototypeOf(e,Of),Fv=L(3,(e,t,n)=>{const r=b1(e);return r[t.toLowerCase()]=n,r}),zle=L(2,(e,t)=>b1({...e,...TT(t)})),Ule=L(2,(e,t)=>{const n=b1(e);return Object.assign(n,t),n}),Hle=L(2,(e,t)=>{const n=b1(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}),Bv=L(2,(e,t)=>{const n={...e},r=s=>{if(typeof s=="string"){const a=s.toLowerCase();a in e&&(n[a]=EA(e[a]))}else for(const a in e)s.test(a)&&(n[a]=EA(e[a]))};if(Array.isArray(t))for(let s=0;s<t.length;s++)r(t[s]);else r(t);return n}),O5=Fe("@effect/platform/Headers/currentRedactedNames",()=>UE(["authorization","cookie","set-cookie","x-api-key"])),qle=Symbol.for("@effect/platform/HttpClientError"),L5=qle;class $5 extends d5(L5,"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 to extends d5(L5,"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 Fh=Symbol.for("@effect/platform/HttpIncomingMessage"),Vle=(e,t)=>{const n=e.headers["content-type"]??"";let r;if(n.includes("application/json"))try{r=Es(e.json)}catch{}else if(n.includes("text/")||n.includes("urlencoded"))try{r=Es(e.text)}catch{}const s={...t,headers:oS(e.headers),remoteAddress:e.remoteAddress.toJSON()};return r!==void 0&&(s.body=r),s},Gle=e=>Ble({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"}`}),WA=Symbol.for("@effect/platform/HttpClientRequest"),Kle={[WA]:WA,...ry,toJSON(){return{_id:"@effect/platform/HttpClientRequest",method:this.method,url:this.url,urlParams:this.urlParams,hash:this.hash,headers:oS(this.headers),body:this.body.toJSON()}},pipe(){return Ee(this,arguments)}};function aa(e,t,n,r,s,a){const o=Object.create(Kle);return o.method=e,o.url=t,o.urlParams=n,o.hash=r,o.headers=s,o.body=a,o}const Wle=aa("GET","",fle,fe(),P5,wle),Li=e=>(t,n)=>nde(Wle,{method:e,url:t,...n??void 0}),Yle=Li("GET"),Jle=Li("POST"),Qle=Li("PUT"),Xle=Li("PATCH"),Zle=Li("DELETE"),ede=Li("HEAD"),tde=Li("OPTIONS"),nde=L(2,(e,t)=>{let n=e;return t.method&&(n=ade(n,t.method)),t.url&&(n=j5(n,t.url)),t.headers&&(n=CT(n,t.headers)),t.urlParams&&(n=D5(n,t.urlParams)),t.hash&&(n=cde(n,t.hash)),t.body&&(n=IT(n,t.body)),t.accept&&(n=M5(n,t.accept)),t.acceptJson&&(n=sde(n)),n}),rde=L(3,(e,t,n)=>aa(e.method,e.url,e.urlParams,e.hash,Fv(e.headers,t,n),e.body)),CT=L(2,(e,t)=>aa(e.method,e.url,e.urlParams,e.hash,zle(e.headers,t),e.body)),M5=L(2,(e,t)=>rde(e,"Accept",t)),sde=M5("application/json"),ade=L(2,(e,t)=>aa(t,e.url,e.urlParams,e.hash,e.headers,e.body)),j5=L(2,(e,t)=>{if(typeof t=="string")return aa(e.method,t,e.urlParams,e.hash,e.headers,e.body);const n=new URL(t.toString()),r=ru(n.searchParams),s=n.hash?xe(n.hash.slice(1)):fe();return n.search="",n.hash="",aa(e.method,n.toString(),r,s,e.headers,e.body)}),ode=L(2,(e,t)=>aa(e.method,t.endsWith("/")&&e.url.startsWith("/")?t+e.url.slice(1):t+e.url,e.urlParams,e.hash,e.headers,e.body)),ide=L(2,(e,t)=>aa(e.method,e.url,ple(e.urlParams,t),e.hash,e.headers,e.body)),D5=L(2,(e,t)=>aa(e.method,e.url,mle(e.urlParams,t),e.hash,e.headers,e.body)),cde=L(2,(e,t)=>aa(e.method,e.url,e.urlParams,xe(t),e.headers,e.body)),IT=L(2,(e,t)=>{let n=e.headers;if(t._tag==="Empty"||t._tag==="FormData")n=Hle(n,["Content-type","Content-length"]);else{const r=t.contentType;r&&(n=Fv(n,"content-type",r));const s=t.contentLength;s&&(n=Fv(n,"content-length",s.toString()))}return aa(e.method,e.url,e.urlParams,e.hash,n,t)}),ude=L(2,(e,t)=>IT(e,Ile(t))),Bh=Symbol.for("@effect/platform/HttpClientResponse"),lde=(e,t)=>new dde(e,t);class dde extends fq{request;source;[Fh];[Bh];constructor(t,n){super(),this.request=t,this.source=n,this[Fh]=Fh,this[Bh]=Bh}toJSON(){return Vle(this,{_id:"@effect/platform/HttpClientResponse",request:this.request.toJSON(),status:this.status})}get status(){return this.source.status}get headers(){return TT(this.source.headers)}cachedCookies;get cookies(){return this.cachedCookies?this.cachedCookies:this.cachedCookies=Mle(this.source.headers.getSetCookie())}get remoteAddress(){return fe()}get stream(){return this.source.body?qoe(()=>this.source.body,t=>new to({request:this.request,response:this,reason:"Decode",cause:t})):Foe(new to({request:this.request,response:this,reason:"EmptyBody",description:"can not create stream from empty body"}))}get json(){return Vre(this.text,{try:t=>t===""?null:JSON.parse(t),catch:t=>new to({request:this.request,response:this,reason:"Decode",cause:t})})}textBody;get text(){return this.textBody??=sl({try:()=>this.source.text(),catch:t=>new to({request:this.request,response:this,reason:"Decode",cause:t})}).pipe(Rk,Es)}get urlParamsBody(){return Me(this.text,t=>qre({try:()=>ru(new URLSearchParams(t)),catch:n=>new to({request:this.request,response:this,reason:"Decode",cause:n})}))}formDataBody;get formData(){return this.formDataBody??=sl({try:()=>this.source.formData(),catch:t=>new to({request:this.request,response:this,reason:"Decode",cause:t})}).pipe(Rk,Es)}arrayBufferBody;get arrayBuffer(){return this.arrayBufferBody??=sl({try:()=>this.source.arrayBuffer(),catch:t=>new to({request:this.request,response:this,reason:"Decode",cause:t})}).pipe(Rk,Es)}}const hde=L(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)}),fde=e=>`http.request.header.${e}`,mde="http.request.method",pde=e=>`http.response.header.${e}`,gde="http.response.status_code",bde="server.address",yde="server.port",kde="url.full",xde="url.path",_de="url.scheme",vde="url.query",YA=Symbol.for("@effect/platform/HttpClient"),AT=Ti("@effect/platform/HttpClient"),wde=Fe(Symbol.for("@effect/platform/HttpClient/tracerDisabledWhen"),()=>UE(fo)),Sde=Fe(Symbol.for("@effect/platform/HttpClient/currentTracerPropagation"),()=>UE(!0)),Ede=Jc()("@effect/platform/HttpClient/SpanNameGenerator",{defaultValue:()=>e=>`http.client ${e.method}`}),Tde={[YA]:YA,pipe(){return Ee(this,arguments)},...ry,toJSON(){return{_id:"@effect/platform/HttpClient"}},get(e,t){return this.execute(Yle(e,t))},head(e,t){return this.execute(ede(e,t))},post(e,t){return this.execute(Jle(e,t))},put(e,t){return this.execute(Qle(e,t))},patch(e,t){return this.execute(Xle(e,t))},del(e,t){return this.execute(Zle(e,t))},options(e,t){return this.execute(tde(e,t))}},NT=(e,t)=>{const n=Object.create(Tde);return n.preprocess=t,n.postprocess=e,n.execute=function(r){return e(t(r))},n},k0=Fe("@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))}}}),Cde=Fe("@effect/platform/HttpClient/scopedRequests",()=>new WeakMap),Ide=e=>NT(t=>Me(t,n=>Zb(r=>{const s=Cde.get(n),a=s??new AbortController,o=gle(n.url,n.urlParams,n.hash);if(o._tag==="Left")return $a(new $5({request:n,reason:"InvalidUrl",cause:o.left}));const i=o.right;if(!r.getFiberRef(Sse)||r.getFiberRef(wde)(n)){const l=e(n,i,a.signal,r);return s?l:e0(d=>Us(d(l),{onSuccess(h){return k0.register(h,a),Pt(new JA(h,a))},onFailure(h){return Wb(h)&&a.abort(),Ks(h)}}))}const u=Gs(r.currentContext,Ede);return ase(u(n),{kind:"client",captureStackTrace:!1},l=>{l.attribute(mde,n.method),l.attribute(bde,i.origin),i.port!==""&&l.attribute(yde,+i.port),l.attribute(kde,i.toString()),l.attribute(xde,i.pathname),l.attribute(_de,i.protocol.slice(0,-1));const d=i.search.slice(1);d!==""&&l.attribute(vde,d);const h=r.getFiberRef(O5),f=Bv(n.headers,h);for(const p in f)l.attribute(fde(p),String(f[p]));return n=r.getFiberRef(Sde)?CT(n,Gle(l)):n,e0(p=>p(e(n,i,a.signal,r)).pipe(ose(l),Us({onSuccess:x=>{l.attribute(gde,x.status);const g=Bv(x.headers,h);for(const b in g)l.attribute(pde(b),String(g[b]));return s?Pt(x):(k0.register(x,a),Pt(new JA(x,a)))},onFailure(x){return!s&&Wb(x)&&a.abort(),Ks(x)}})))})})),Pt);class JA{original;controller;constructor(t,n){this.original=t,this.controller=n}[Bh]=Bh;[Fh]=Fh;applyInterrupt(t){return on(()=>(k0.unregister(this.original),Gre(t,()=>Mt(()=>{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 Koe(()=>(k0.unregister(this.original),GD(this.original.stream,Mt(()=>{this.controller.abort()}))))}toJSON(){return this.original.toJSON()}[ht](){return this.original[ht]()}}const{del:kMe,execute:xMe,get:_Me,head:vMe,options:wMe,patch:SMe,post:EMe,put:TMe}=Qre(AT),Ade=L(2,(e,t)=>{const n=e;return NT(r=>t(n.postprocess(r)),n.preprocess)}),Nde=L(2,(e,t)=>{const n=e;return NT(n.postprocess,r=>St(n.preprocess(r),t))}),Rde=e=>xse(AT,Me(P6(),t=>St(e,n=>Ade(n,O6(r=>Dr(t,r)))))),Pde=AT,Ode=Nde,Lde=Li,$de=CT,Mde=j5,jde=ode,Dde=D5,Fde=ide,Bde=IT,zde=ude,Ude=hde,zv=e=>e!=="GET"&&e!=="HEAD"&&e!=="OPTIONS",Hde=(e,t)=>rl(function*(){const n=yield*P6(),r=t.httpClient.pipe(t?.baseUrl===void 0?Ue:Ode(jde(t.baseUrl.toString())));T5(e,{predicate:t?.predicate,onGroup(s){t.onGroup?.(s)},onEndpoint(s){const{endpoint:a,errors:o,successes:i}=s,c=Kde(a.path),u={orElse:Qde},l=Ude(u);o.forEach(({ast:g},b)=>{if(g._tag==="None"){u[b]=Xde;return}const y=QA(g.value);u[b]=_=>Me(y(_),$a)}),i.forEach(({ast:g},b)=>{u[b]=g._tag==="None"?Zde:QA(g.value)});const d=a.pathSchema.pipe($r(Dd)),h=a.payloadSchema.pipe($r(g=>zv(a.method)?Dd(the(g)):Dd(g))),f=a.headersSchema.pipe($r(Dd)),p=a.urlParamsSchema.pipe($r(Dd)),x=ise(function*(g){let b=Lde(a.method)(a.path);if(g&&g.path){const S=d._tag==="Some"?yield*d.value(g.path):g.path;b=Mde(b,c(S))}if(g&&g.payload instanceof FormData)b=zde(b,g.payload);else if(h._tag==="Some")if(zv(a.method)){const S=yield*h.value(g.payload);b=Bde(b,S)}else{const S=yield*h.value(g.payload);b=Dde(b,S)}f._tag==="Some"&&(b=$de(b,yield*f.value(g.headers))),p._tag==="Some"&&(b=Fde(b,yield*p.value(g.urlParams)));const y=yield*r.execute(b),_=yield*t.transformResponse===void 0?l(y):t.transformResponse(l(y));return g?.withResponse===!0?[_,y]:_},O6(g=>Dr(n,g)));t.onEndpoint({...s,endpointFn:x})}})}),qde=(e,t)=>Me(Pde,n=>Vde(e,{...t,httpClient:t?.transformClient?t.transformClient(n):n})),Vde=(e,t)=>{const n={};return Hde(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(St(()=>n))},Gde=/:(\w+)\??/g,Kde=e=>{const t=e.split(Gde),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}},QA=e=>{const t=Im(e),n=Nce(F5(e,t));return r=>Me(r.arrayBuffer,n)},Wde=nu(Un,nue,{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)}}),Uv=nu(Un,E,{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)}}),Yde=Bc(E,Un,{strict:!0,decode:(e,t,n)=>e===""?Xr(void 0):h0({try:()=>JSON.parse(e),catch:()=>new An(n,e,"Could not parse JSON")}),encode:(e,t,n)=>e===void 0?Xr(""):h0({try:()=>JSON.stringify(e),catch:()=>new An(n,e,"Could not encode as JSON")})}),Jde=lc(Uv,Yde),F5=(e,t)=>{if(e._tag==="Union")return Tt(...e.types.map(r=>F5(r,Im(r,t))));const n=Et(e);switch(t.kind){case"Json":return lc(Jde,n);case"UrlParams":return lc(Uv,_le(n));case"Uint8Array":return lc(Wde,n);case"Text":return lc(Uv,n)}},Qde=e=>$a(new to({reason:"Decode",request:e.request,response:e})),Xde=e=>$a(new to({reason:"StatusCode",request:e.request,response:e})),Zde=e=>dt,ehe=pT(Nle),the=e=>{const t=e.ast._tag==="Union"?e.ast.types:[e.ast];return Tt(...t.map(nhe))},ex=Fe("@effect/platform/HttpApiClient/bodyFromPayloadCache",()=>new WeakMap),nhe=e=>{if(ex.has(e))return ex.get(e);const t=Et(e),n=Im(e),r=Bc(ehe,t,{decode(s,a,o){return uc(new Tv(o,s,"encode only schema"))},encode(s,a,o){switch(n.kind){case"Json":try{return Xr(HA(JSON.stringify(s),n.contentType))}catch{return uc(new An(o,s,"Could not encode as JSON"))}case"Text":return typeof s!="string"?uc(new An(o,s,"Expected a string")):Xr(HA(s,n.contentType));case"UrlParams":return Xr(Ple(ru(s)));case"Uint8Array":return s instanceof Uint8Array?Xr(Rle(s,n.contentType)):uc(new An(o,s,"Expected a Uint8Array"))}}});return ex.set(e,r),r},rhe=(e,t)=>{const n=t.definitionPath??"#/$defs/",r=i=>n+i,s=t.target??"jsonSchema7",a=t.topLevelReferenceStrategy??"keep";return rn(e,t.definitions,"handle-identifier",[],{getRef:r,target:s,topLevelReferenceStrategy:a,additionalPropertiesStrategy:"strict"},"handle-annotation","handle-errors")},zh={$id:"/schemas/never",not:{}},Qi={$id:"/schemas/any"},B5={$id:"/schemas/unknown"},z5={$id:"/schemas/void"},she={$id:"/schemas/object",anyOf:[{type:"object"},{type:"array"}]},ahe={$id:"/schemas/%7B%7D",anyOf:[{type:"object"},{type:"array"}]};function U5(e){if(e!==void 0)return _r(oT(e))}function H5(e){if(e!==void 0)return _r(aT(e))}function q5(e){return e!==void 0?kie(e):fe()}function ohe(e,t){return dT(e,!1)(t)}function V5(e){if(e!==void 0)return _r(yie(e))}function ihe(e,t){const n=dT(e,!1),r=YL(t,s=>n(s).pipe(UL(x0)));return r.length>0?r:void 0}function XA(e,t,n){if(t!==void 0)switch(e._tag){case"StringKeyword":return t!==c0.annotations[n]?t:void 0;case"NumberKeyword":return t!==u0.annotations[n]?t:void 0;case"BooleanKeyword":return t!==l0.annotations[n]?t:void 0}return t}function x0(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=>x0(r,t));const n=Object.getPrototypeOf(e);return n!==null&&n!==Object.prototype||Object.getOwnPropertySymbols(e).length>0?!1:Object.values(e).every(r=>x0(r,t))}finally{t.delete(e)}}return!1}function G5(e,t,n,r,s){const a={};if(t!==void 0&&(a.description=t),n!==void 0&&(a.title=n),kt(r)){const o=ohe(e,r.value);kt(o)&&x0(o.value)&&(a.default=o.value)}if(s!==void 0){const o=ihe(e,s);o!==void 0&&(a.examples=o)}if(Object.keys(a).length!==0)return a}function tx(e,t){return G5(e,U5(t),H5(t),q5(t),V5(t))}function K5(e){return G5(e,XA(e,U5(e),Ri),XA(e,H5(e),as),q5(e),V5(e))}function nx(e,t){return t?"$ref"in e?{allOf:[e],...t}:{...e,...t}:e}const _0=e=>{if(un(g4(e)))return cce(e,_0,t=>_0(t.from))},che=e=>e.annotations[eT]===k4,uhe=(e,t)=>vc(e)&&e.annotations[eT]===die?"type"in t&&t.type!=="integer":"type"in t||"oneOf"in t||"anyOf"in t||"$ref"in t,lhe=(e,t,n)=>{const r={...e,...K5(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 dhe(e){switch(e.target){case"jsonSchema7":return!1;case"jsonSchema2019-09":case"jsonSchema2020-12":case"openApi3.1":return!0}}function hhe(e){switch(e.additionalPropertiesStrategy){case"allow":return!0;case"strict":return!1}}function $t(e,t){return W5(e,K5(t))}function W5(e,t){return t===void 0||Object.keys(t).length===0?e:"$ref"in e?{allOf:[e],...t}:{...e,...t}}function Hv(e){const t=_r(y4(e));if(t===void 0){if(S4(e))return Hv(e.f());if(E4(e)&&xv(e.from)&&Iie(e.to)){const n=e.to,r=r1(n);if(kt(r))return Hv(n)}}return t}function rn(e,t,n,r,s,a,o){if(n==="handle-identifier"&&(s.topLevelReferenceStrategy!=="skip"||S4(e))){const c=Hv(e);if(c!==void 0){const u=c.replace(/~/ig,"~0").replace(/\//ig,"~1"),l={$ref:s.getRef(u)};return vV(t,c)||(t[c]=l,t[c]=rn(e,t,"ignore-identifier",r,s,"handle-annotation",o)),l}}if(a==="handle-annotation"){const c=g4(e);if(kt(c)){const u=c.value;if(uhe(e,u))return e._tag==="Declaration"?$t(u,e):u;if(e._tag==="Refinement"){const l=Ev(e);return l===void 0?lhe(rn(e.from,t,n,r,s,"handle-annotation",o),u,e):rn(l,t,n,r,s,"handle-annotation",o)}else return{...rn(e,t,n,r,s,"ignore-annotation",o),...u}}}const i=r1(e);if(kt(i))return rn(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 $t(Qi,e);throw new Error(fA(r,e))}case"Suspend":{if(n==="handle-identifier"){if(o==="ignore-errors")return $t(Qi,e);throw new Error(sie(r,e))}return rn(e.f(),t,"ignore-identifier",r,s,"handle-annotation",o)}case"NeverKeyword":return $t(zh,e);case"VoidKeyword":return $t(z5,e);case"UnknownKeyword":return $t(B5,e);case"AnyKeyword":return $t(Qi,e);case"ObjectKeyword":return $t(she,e);case"StringKeyword":return $t({type:"string"},e);case"NumberKeyword":return $t({type:"number"},e);case"BooleanKeyword":return $t({type:"boolean"},e);case"Literal":{const c=e.literal;if(c===null)return $t({type:"null"},e);if(Cn(c))return $t({type:"string",enum:[c]},e);if(Js(c))return $t({type:"number",enum:[c]},e);if(Cc(c))return $t({type:"boolean",enum:[c]},e);if(o==="ignore-errors")return $t(Qi,e);throw new Error(fA(r,e))}case"Enums":{const c=e.enums.map(u=>({type:Js(u[1])?"number":"string",title:u[0],enum:[u[1]]}));return c.length>=1?$t({$comment:"/schemas/enums",anyOf:c},e):$t(zh,e)}case"TupleType":{const c=e.elements.map((f,p)=>nx(rn(f.type,t,"handle-identifier",r.concat(p),s,"handle-annotation",o),tx(f.type,f))),u=e.rest.map(f=>nx(rn(f.type,t,"handle-identifier",r,s,"handle-annotation",o),tx(f.type,f))),l={type:"array"},d=e.elements.length;d>0&&(l.minItems=d-e.elements.filter(f=>f.isOptional).length,s.target==="jsonSchema7"?l.items=c:l.prefixItems=c);const h=u.length;if(h>0){const f=u[0];if(h===1&&e.elements.every(x=>x.type===e.rest[0].type)?s.target==="jsonSchema7"?l.items=f:(l.items=f,delete l.prefixItems):s.target==="jsonSchema7"?l.additionalItems=f:l.items=f,h>1){if(o==="ignore-errors")return $t(Qi,e);throw new Error(aie(r))}}else d>0?s.target==="jsonSchema7"?l.additionalItems=!1:l.items=!1:l.maxItems=0;return $t(l,e)}case"TypeLiteral":{if(e.propertySignatures.length===0&&e.indexSignatures.length===0)return $t(ahe,e);const c={type:"object",required:[],properties:{},additionalProperties:hhe(s)};let u,l;for(const d of e.indexSignatures){const h=_0(d.type)??d.type,f=d.parameter;switch(f._tag){case"StringKeyword":{c.additionalProperties=rn(h,t,"handle-identifier",r,s,"handle-annotation",o);break}case"TemplateLiteral":{u=rn(h,t,"handle-identifier",r,s,"handle-annotation",o),l={type:"string",pattern:Sv(f).source};break}case"Refinement":{u=rn(h,t,"handle-identifier",r,s,"handle-annotation",o),l=rn(f,t,"handle-identifier",r,s,"handle-annotation",o);break}case"SymbolKeyword":{const p=r.concat("[symbol]");c.additionalProperties=rn(h,t,"handle-identifier",p,s,"handle-annotation",o),l=rn(f,t,"handle-identifier",p,s,"handle-annotation",o);break}}}for(let d=0;d<e.propertySignatures.length;d++){const h=e.propertySignatures[d],f=h.name;if(Cn(f)){const p=_0(h.type),x=p??h.type;c.properties[f]=nx(rn(x,t,"handle-identifier",r.concat(h.name),s,"handle-annotation",o),tx(x,h)),!h.isOptional&&p===void 0&&c.required.push(f)}else{if(o==="ignore-errors")return $t(Qi,e);throw new Error(oie(f,r))}}return u!==void 0&&(delete c.additionalProperties,c.patternProperties={"":u}),l!==void 0&&(c.propertyNames=l),$t(c,e)}case"Union":{const c=e.types.map(l=>rn(l,t,"handle-identifier",r,s,"handle-annotation",o)),u=bhe(c);switch(u.length){case 0:return zh;case 1:return $t(u[0],e);default:return $t({anyOf:u},e)}}case"Refinement":return rn(e.from,t,n,r,s,"handle-annotation",o);case"TemplateLiteral":{const c=Sv(e);return $t({type:"string",title:String(e),description:"a template literal",pattern:c.source},e)}case"Transformation":{if(che(e.from)){const u={type:"string",contentMediaType:"application/json"};return dhe(s)&&(u.contentSchema=rn(e.to,t,n,r,s,"handle-annotation",o)),u}const c=rn(e.from,t,n,r,s,"handle-annotation",o);if(e.transformation._tag==="TypeLiteralTransformation"&&ZA(c)){const u=rn(e.to,{},"ignore-identifier",r,s,"handle-annotation","ignore-errors");if(ZA(u))for(const l of e.transformation.propertySignatureTransformations){const d=l.to,h=l.from;if(Cn(d)&&Cn(h)){const f=u.properties[d];if(of(f)){const p=c.properties[h];if(of(p)){const x={};Cn(f.title)&&(x.title=f.title),Cn(f.description)&&(x.description=f.description),Array.isArray(f.examples)&&(x.examples=f.examples),Object.hasOwn(f,"default")&&f.default!==void 0&&(x.default=f.default),c.properties[h]=W5(p,x)}}}}}return $t(c,e)}}}function ZA(e){return of(e)&&e.type==="object"&&of(e.properties)}function fhe(e){return e===zh||Le(e,"$id")&&e.$id===zh.$id&&Object.keys(e).length===3&&e.title===_m.annotations[as]}function mhe(e){return"$id"in e&&e.$id===Qi.$id}function phe(e){return"$id"in e&&e.$id===B5.$id}function ghe(e){return"$id"in e&&e.$id===z5.$id}function eN(e){return Le(e,"enum")&&"type"in e&&Object.keys(e).length===2}function bhe(e){const t=[];for(const n of e)if(!fhe(n)){if(mhe(n)||phe(n)||ghe(n))return[n];if(eN(n)&&t.length>0){const r=t[t.length-1];if(eN(r)&&r.type===n.type){t[t.length-1]={type:r.type,enum:[...r.enum,...n.enum]};continue}}t.push(n)}return t}var tN=qU();function Y5(e){tN.unstable_scheduleCallback(tN.unstable_LowPriority,e)}const Am=O.createContext(y5({scheduleTask:Y5,defaultIdleTTL:400})),yhe=e=>{const t=O.useRef(null);return t.current===null&&(t.current={registry:y5({scheduleTask:e.scheduleTask??Y5,initialValues:e.initialValues,timeoutResolution:e.timeoutResolution,defaultIdleTTL:e.defaultIdleTTL})}),O.useEffect(()=>(t.current?.timeout!==void 0&&clearTimeout(t.current.timeout),()=>{t.current.timeout=setTimeout(()=>{t.current?.registry.dispose(),t.current=null},500)}),[t]),O.createElement(Am.Provider,{value:t.current.registry},e?.children)},nN=Fe("@effect-atom/atom-react/storeRegistry",()=>new WeakMap);function khe(e,t){let n=nN.get(e);n===void 0&&(n=new WeakMap,nN.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 Jue(t,e)}};return n.set(t,s),s}function xhe(e,t){const n=khe(e,t);return O.useSyncExternalStore(n.subscribe,n.snapshot,n.getServerSnapshot)}const _he=(e,t)=>{const n=O.useContext(Am);return xhe(n,e)},vhe="@effect/platform/FetchHttpClient/Fetch",whe="@effect/platform/FetchHttpClient/FetchOptions",She=Ide((e,t,n,r)=>{const s=r.getFiberRef(F6),a=s.unsafeMap.get(vhe)??globalThis.fetch,o=s.unsafeMap.get(whe)??{},i=o.headers?Ule(TT(o.headers),e.headers):e.headers,c=u=>St(sl({try:()=>a(t,{...o,method:e.method,headers:i,body:u,duplex:e.body._tag==="Stream"?"half":void 0,signal:n}),catch:l=>new $5({request:e,reason:"Transport",cause:l})}),l=>lde(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 Me(Woe(e.body.stream),c)}return c(void 0)}),Ehe=Rde(Pt(She)),The=Ehe,Che=Symbol.for("@effect/platform/HttpApiMiddleware/Security"),rN=e=>Le(e,Che),Ihe=e=>e.endsWith("/")?e.slice(0,-1):e,Ahe=L(2,(e,t)=>(t=Ihe(t),e==="/"?t:t+e)),Nhe=Ahe,Rhe=(e,t)=>rhe(e,{definitions:t.defs,definitionPath:t.defsPath??"#/components/schemas/",target:"openApi3.1",topLevelReferenceStrategy:t.topLevelReferenceStrategy});class J5 extends Ar("@effect/platform/OpenApi/Identifier")(){}class Xg extends Ar("@effect/platform/OpenApi/Title")(){}class Q5 extends Ar("@effect/platform/OpenApi/Version")(){}class Uh extends Ar("@effect/platform/OpenApi/Description")(){}class X5 extends Ar("@effect/platform/OpenApi/License")(){}class qv extends Ar("@effect/platform/OpenApi/ExternalDocs")(){}class Z5 extends Ar("@effect/platform/OpenApi/Servers")(){}class eF extends Ar("@effect/platform/OpenApi/Format")(){}class Vv extends Ar("@effect/platform/OpenApi/Summary")(){}class tF extends Ar("@effect/platform/OpenApi/Deprecated")(){}class Zg extends Ar("@effect/platform/OpenApi/Override")(){}class Gv extends Jc()("@effect/platform/OpenApi/Exclude",{defaultValue:fo}){}class eb extends Ar("@effect/platform/OpenApi/Transform")(){}const Phe=e=>{const t=Object.entries(e);return n=>{let r=Xs();for(const[s,a]of t)n[s]!==void 0&&(r=Yr(r,a,n[s]));return r}},Ohe=Phe({identifier:J5,title:Xg,version:Q5,description:Uh,license:X5,summary:Vv,deprecated:tF,externalDocs:qv,servers:Z5,format:eF,override:Zg,exclude:Gv,transform:eb}),sN=Fe("@effect/platform/OpenApi/apiCache",()=>new WeakMap);function Ln(e,t,n){const r=Ci(e,t);kt(r)&&n(r.value)}const Lhe=(e,t)=>{const n=sN.get(e);if(n!==void 0)return n;const r={};let s={openapi:"3.1.0",info:{title:Rd(e.annotations,Xg,()=>"Api"),version:Rd(e.annotations,Q5,()=>"0.0.1")},paths:{},components:{schemas:r,securitySchemes:{}},security:[],tags:[]};function a(i){return Rhe(i,{defs:r})}function o(i,c){s.components.securitySchemes[i]===void 0&&(s.components.securitySchemes[i]=$he(c))}return Ln(e.annotations,hle,i=>{i.forEach(c=>a(c.ast))}),Ln(e.annotations,Uh,i=>{s.info.description=i}),Ln(e.annotations,X5,i=>{s.info.license=i}),Ln(e.annotations,Vv,i=>{s.info.summary=i}),Ln(e.annotations,Z5,i=>{s.servers=[...i]}),e.middlewares.forEach(i=>{if(rN(i))for(const[c,u]of Object.entries(i.security))o(c,u),s.security.push({[c]:[]})}),T5(e,{onGroup({group:i}){if(Gs(i.annotations,Gv))return;let c={name:Rd(i.annotations,Xg,()=>i.identifier)};Ln(i.annotations,Uh,u=>{c.description=u}),Ln(i.annotations,qv,u=>{c.externalDocs=u}),Ln(i.annotations,Zg,u=>{Object.assign(c,u)}),Ln(i.annotations,eb,u=>{c=u(c)}),s.tags.push(c)},onEndpoint({endpoint:i,errors:c,group:u,mergedAnnotations:l,middleware:d,payloads:h,successes:f}){if(Gs(l,Gv))return;let p={tags:[Rd(u.annotations,Xg,()=>u.identifier)],operationId:Rd(i.annotations,J5,()=>u.topLevel?i.name:`${u.identifier}.${i.name}`),parameters:[],security:[],responses:{}};function x(S,w){for(const[v,{ast:C,description:I}]of S)p.responses[v]||(p.responses[v]={description:zt(I,w)},C.pipe(UL(R=>!w5(R)),$r(R=>{const N=Im(R);p.responses[v].content={[N.contentType]:{schema:a(R)}}})))}function g(S,w){if(kt(S)){const v=a(S.value.ast);"properties"in v&&Object.entries(v.properties).forEach(([C,I])=>{p.parameters.push({name:C,in:w,schema:I,required:v.required.includes(C),...I.description!==void 0?{description:I.description}:void 0})})}}Ln(i.annotations,Uh,S=>{p.description=S}),Ln(i.annotations,Vv,S=>{p.summary=S}),Ln(i.annotations,tF,S=>{p.deprecated=S}),Ln(i.annotations,qv,S=>{p.externalDocs=S}),d.forEach(S=>{if(rN(S))for(const[w,v]of Object.entries(S.security))o(w,v),p.security.push({[w]:[]})});const b=zv(i.method);if(b&&h.size>0){const S={};h.forEach(({ast:w},v)=>{S[v]={schema:a(w)}}),p.requestBody={content:S,required:!0}}g(i.pathSchema,"path"),b||g(i.payloadSchema,"query"),g(i.headersSchema,"header"),g(i.urlParamsSchema,"query"),x(f,()=>"Success"),x(c,()=>"Error");const y=i.path.replace(/:(\w+)\??/g,"{$1}"),_=i.method.toLowerCase();s.paths[y]||(s.paths[y]={}),Ln(i.annotations,Zg,S=>{Object.assign(p,S)}),Ln(i.annotations,eb,S=>{p=S(p)}),s.paths[y][_]=p}}),Ln(e.annotations,Zg,i=>{Object.assign(s,i)}),Ln(e.annotations,eb,i=>{s=i(s)}),sN.set(e,s),s},$he=e=>{const t={};switch(Ln(e.annotations,Uh,n=>{t.description=n}),e._tag){case"Basic":return{...t,type:"http",scheme:"basic"};case"Bearer":{const n=Ci(e.annotations,eF).pipe($r(r=>({bearerFormat:r})),_r);return{...t,type:"http",scheme:"bearer",...n}}case"ApiKey":return{...t,type:"apiKey",name:e.key,in:e.in}}},aN=Symbol.for("@effect/platform/HttpApiEndpoint"),Mhe={[aN]:aN,pipe(){return Ee(this,arguments)},addSuccess(e,t){return e=t?.status?e.annotations(sa({status:t.status})):e,ds({...this,successSchema:this.successSchema===Dv?e:li(this.successSchema,e)})},addError(e,t){return ds({...this,errorSchema:li(this.errorSchema,t?.status?e.annotations(sa({status:t.status})):e)})},setPayload(e){return ds({...this,payloadSchema:xe(e)})},setPath(e){return ds({...this,pathSchema:xe(e)})},setUrlParams(e){return ds({...this,urlParamsSchema:xe(e)})},setHeaders(e){return ds({...this,headersSchema:xe(e)})},prefix(e){return ds({...this,path:Nhe(this.path,e)})},middleware(e){return ds({...this,errorSchema:li(this.errorSchema,e.failure),middlewares:new Set([...this.middlewares,e])})},annotate(e,t){return ds({...this,annotations:Yr(this.annotations,e,t)})},annotateContext(e){return ds({...this,annotations:Dr(this.annotations,e)})}},ds=e=>Object.assign(Object.create(Mhe),e),y1=e=>(t,...n)=>n.length===1?ds({name:t,path:n[0],method:e,pathSchema:fe(),urlParamsSchema:fe(),payloadSchema:fe(),headersSchema:fe(),successSchema:Dv,errorSchema:Rf,annotations:Xs(),middlewares:new Set}):(r,...s)=>{let a=r[0].replace(":","::"),o=fe();if(s.length>0){const i={};for(let c=0;c<s.length;c++){const u=s[c],l=tle(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=xe(B(i))}return ds({name:t,path:a,method:e,pathSchema:o,urlParamsSchema:fe(),payloadSchema:fe(),headersSchema:fe(),successSchema:Dv,errorSchema:Rf,annotations:Xs(),middlewares:new Set})},xr=y1("GET"),fs=y1("POST"),RT=y1("PATCH"),Hh=y1("DELETE"),oN=Symbol.for("@effect/platform/HttpApiGroup"),jhe={[oN]:oN,add(e){return ma({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 ma({identifier:this.identifier,topLevel:this.topLevel,endpoints:this.endpoints,errorSchema:li(this.errorSchema,t?.status?e.annotations(sa({status:t.status})):e),annotations:this.annotations,middlewares:this.middlewares})},prefix(e){return ma({identifier:this.identifier,topLevel:this.topLevel,endpoints:Uu(this.endpoints,t=>t.prefix(e)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},middleware(e){return ma({identifier:this.identifier,topLevel:this.topLevel,endpoints:this.endpoints,errorSchema:li(this.errorSchema,e.failure),annotations:this.annotations,middlewares:new Set([...this.middlewares,e])})},middlewareEndpoints(e){return ma({identifier:this.identifier,topLevel:this.topLevel,endpoints:Uu(this.endpoints,t=>t.middleware(e)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},annotateContext(e){return ma({identifier:this.identifier,topLevel:this.topLevel,endpoints:this.endpoints,errorSchema:this.errorSchema,annotations:Dr(this.annotations,e),middlewares:this.middlewares})},annotate(e,t){return ma({identifier:this.identifier,topLevel:this.topLevel,endpoints:this.endpoints,errorSchema:this.errorSchema,annotations:Yr(this.annotations,e,t),middlewares:this.middlewares})},annotateEndpointsContext(e){return ma({identifier:this.identifier,topLevel:this.topLevel,endpoints:Uu(this.endpoints,t=>t.annotateContext(e)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},annotateEndpoints(e,t){return ma({identifier:this.identifier,topLevel:this.topLevel,endpoints:Uu(this.endpoints,n=>n.annotate(e,t)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},pipe(){return Ee(this,arguments)}},ma=e=>{function t(){}return Object.setPrototypeOf(t,jhe),Object.assign(t,e)},Nm=(e,t)=>ma({identifier:e,topLevel:!1,endpoints:xV(),errorSchema:Rf,annotations:Xs(),middlewares:new Set}),Er=g0.pipe(p0()),Kv=M(Er),Dhe=B({code:Er,interactionMode:M(ee("live","live_form","detach"))}),Fhe=B({responseJson:M(E),interactionMode:M(ee("live","live_form","detach"))}),qe=st,Bhe=B({inputTypePreview:M(E),outputTypePreview:M(E),inputSchema:M(Un),outputSchema:M(Un),exampleInput:M(Un),exampleOutput:M(Un)}),PT=B({path:E,sourceKey:E,description:M(E),interaction:M(Tt(ee("auto"),ee("required"))),elicitation:M(Un),contract:M(Bhe),providerKind:M(E),providerData:M(Un)}),zhe=B({namespace:E,displayName:M(E),toolCount:M(st)});var up={exports:{}},rx={},Ga={},Bi={},sx={},ax={},ox={},iN;function v0(){return iN||(iN=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(y){if(super(),!e.IDENTIFIER.test(y))throw new Error("CodeGen: name must be a valid identifier");this.str=y}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(y){super(),this._items=typeof y=="string"?[y]:y}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const y=this._items[0];return y===""||y==='""'}get str(){var y;return(y=this._str)!==null&&y!==void 0?y:this._str=this._items.reduce((_,S)=>`${_}${S}`,"")}get names(){var y;return(y=this._names)!==null&&y!==void 0?y:this._names=this._items.reduce((_,S)=>(S instanceof n&&(_[S.str]=(_[S.str]||0)+1),_),{})}}e._Code=r,e.nil=new r("");function s(b,...y){const _=[b[0]];let S=0;for(;S<y.length;)i(_,y[S]),_.push(b[++S]);return new r(_)}e._=s;const a=new r("+");function o(b,...y){const _=[f(b[0])];let S=0;for(;S<y.length;)_.push(a),i(_,y[S]),_.push(a,f(b[++S]));return c(_),new r(_)}e.str=o;function i(b,y){y instanceof r?b.push(...y._items):y instanceof n?b.push(y):b.push(d(y))}e.addCodeArg=i;function c(b){let y=1;for(;y<b.length-1;){if(b[y]===a){const _=u(b[y-1],b[y+1]);if(_!==void 0){b.splice(y-1,3,_);continue}b[y++]="+"}y++}}function u(b,y){if(y==='""')return b;if(b==='""')return y;if(typeof b=="string")return y instanceof n||b[b.length-1]!=='"'?void 0:typeof y!="string"?`${b.slice(0,-1)}${y}"`:y[0]==='"'?b.slice(0,-1)+y.slice(1):void 0;if(typeof y=="string"&&y[0]==='"'&&!(b instanceof n))return`"${b}${y.slice(1)}`}function l(b,y){return y.emptyStr()?b:b.emptyStr()?y:o`${b}${y}`}e.strConcat=l;function d(b){return typeof b=="number"||typeof b=="boolean"||b===null?b:f(Array.isArray(b)?b.join(","):b)}function h(b){return new r(f(b))}e.stringify=h;function f(b){return JSON.stringify(b).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=f;function p(b){return typeof b=="string"&&e.IDENTIFIER.test(b)?new r(`.${b}`):s`[${b}]`}e.getProperty=p;function x(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=x;function g(b){return new r(b.toString())}e.regexpCode=g})(ox)),ox}var ix={},cN;function uN(){return cN||(cN=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=v0();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:f}=h,p=(d=l.key)!==null&&d!==void 0?d:l.ref;let x=this._values[f];if(x){const y=x.get(p);if(y)return y}else x=this._values[f]=new Map;x.set(p,h);const g=this._scope[f]||(this._scope[f]=[]),b=g.length;return g[b]=l.ref,h.setValue(l,{property:f,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 f=t.nil;for(const p in u){const x=u[p];if(!x)continue;const g=d[p]=d[p]||new Map;x.forEach(b=>{if(g.has(b))return;g.set(b,r.Started);let y=l(b);if(y){const _=this.opts.es5?e.varKinds.var:e.varKinds.const;f=(0,t._)`${f}${_} ${b} = ${y};${this.opts._n}`}else if(y=h?.(b))f=(0,t._)`${f}${y}${this.opts._n}`;else throw new n(b);g.set(b,r.Completed)})}return f}}e.ValueScope=i})(ix)),ix}var lN;function tt(){return lN||(lN=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=v0(),n=uN();var r=v0();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=uN();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,Y){super(),this.varKind=P,this.name=D,this.rhs=Y}render({es5:P,_n:D}){const Y=P?n.varKinds.var:this.varKind,ke=this.rhs===void 0?"":` = ${this.rhs}`;return`${Y} ${this.name}${ke};`+D}optimizeNames(P,D){if(P[this.name.str])return this.rhs&&(this.rhs=J(this.rhs,P,D)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class i extends a{constructor(P,D,Y){super(),this.lhs=P,this.rhs=D,this.sideEffects=Y}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=J(this.rhs,P,D),this}get names(){const P=this.lhs instanceof t.Name?{}:{...this.lhs.names};return ne(P,this.rhs)}}class c extends i{constructor(P,D,Y,ke){super(P,Y,ke),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=J(this.code,P,D),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class f extends a{constructor(P=[]){super(),this.nodes=P}render(P){return this.nodes.reduce((D,Y)=>D+Y.render(P),"")}optimizeNodes(){const{nodes:P}=this;let D=P.length;for(;D--;){const Y=P[D].optimizeNodes();Array.isArray(Y)?P.splice(D,1,...Y):Y?P[D]=Y:P.splice(D,1)}return P.length>0?this:void 0}optimizeNames(P,D){const{nodes:Y}=this;let ke=Y.length;for(;ke--;){const ye=Y[ke];ye.optimizeNames(P,D)||(te(P,ye.names),Y.splice(ke,1))}return Y.length>0?this:void 0}get names(){return this.nodes.reduce((P,D)=>V(P,D.names),{})}}class p extends f{render(P){return"{"+P._n+super.render(P)+"}"+P._n}}class x extends f{}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 Y=D.optimizeNodes();D=this.else=Array.isArray(Y)?new g(Y):Y}if(D)return P===!1?D instanceof b?D:D.nodes:this.nodes.length?this:new b(se(P),D instanceof b?[D]:D.nodes);if(!(P===!1||!this.nodes.length))return this}optimizeNames(P,D){var Y;if(this.else=(Y=this.else)===null||Y===void 0?void 0:Y.optimizeNames(P,D),!!(super.optimizeNames(P,D)||this.else))return this.condition=J(this.condition,P,D),this}get names(){const P=super.names;return ne(P,this.condition),this.else&&V(P,this.else.names),P}}b.kind="if";class y extends p{}y.kind="for";class _ extends y{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=J(this.iteration,P,D),this}get names(){return V(super.names,this.iteration.names)}}class S extends y{constructor(P,D,Y,ke){super(),this.varKind=P,this.name=D,this.from=Y,this.to=ke}render(P){const D=P.es5?n.varKinds.var:this.varKind,{name:Y,from:ke,to:ye}=this;return`for(${D} ${Y}=${ke}; ${Y}<${ye}; ${Y}++)`+super.render(P)}get names(){const P=ne(super.names,this.from);return ne(P,this.to)}}class w extends y{constructor(P,D,Y,ke){super(),this.loop=P,this.varKind=D,this.name=Y,this.iterable=ke}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=J(this.iterable,P,D),this}get names(){return V(super.names,this.iterable.names)}}class v extends p{constructor(P,D,Y){super(),this.name=P,this.args=D,this.async=Y}render(P){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(P)}}v.kind="func";class C extends f{render(P){return"return "+super.render(P)}}C.kind="return";class I 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 Y,ke;return super.optimizeNames(P,D),(Y=this.catch)===null||Y===void 0||Y.optimizeNames(P,D),(ke=this.finally)===null||ke===void 0||ke.optimizeNames(P,D),this}get names(){const P=super.names;return this.catch&&V(P,this.catch.names),this.finally&&V(P,this.finally.names),P}}class R extends p{constructor(P){super(),this.error=P}render(P){return`catch(${this.error})`+super.render(P)}}R.kind="catch";class N extends p{render(P){return"finally"+super.render(P)}}N.kind="finally";class z{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 x]}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 Y=this._extScope.value(P,D);return(this._values[Y.prefix]||(this._values[Y.prefix]=new Set)).add(Y),Y}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,Y,ke){const ye=this._scope.toName(D);return Y!==void 0&&ke&&(this._constants[ye.str]=Y),this._leafNode(new o(P,ye,Y)),ye}const(P,D,Y){return this._def(n.varKinds.const,P,D,Y)}let(P,D,Y){return this._def(n.varKinds.let,P,D,Y)}var(P,D,Y){return this._def(n.varKinds.var,P,D,Y)}assign(P,D,Y){return this._leafNode(new i(P,D,Y))}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[Y,ke]of P)D.length>1&&D.push(","),D.push(Y),(Y!==ke||this.opts.es5)&&(D.push(":"),(0,t.addCodeArg)(D,ke));return D.push("}"),new t._Code(D)}if(P,D,Y){if(this._blockNode(new b(P)),D&&Y)this.code(D).else().code(Y).endIf();else if(D)this.code(D).endIf();else if(Y)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 _(P),D)}forRange(P,D,Y,ke,ye=this.opts.es5?n.varKinds.var:n.varKinds.let){const we=this._scope.toName(P);return this._for(new S(ye,we,D,Y),()=>ke(we))}forOf(P,D,Y,ke=n.varKinds.const){const ye=this._scope.toName(P);if(this.opts.es5){const we=D instanceof t.Name?D:this.var("_arr",D);return this.forRange("_i",0,(0,t._)`${we}.length`,Oe=>{this.var(ye,(0,t._)`${we}[${Oe}]`),Y(ye)})}return this._for(new w("of",ke,ye,D),()=>Y(ye))}forIn(P,D,Y,ke=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(P,(0,t._)`Object.keys(${D})`,Y);const ye=this._scope.toName(P);return this._for(new w("in",ke,ye,D),()=>Y(ye))}endFor(){return this._endBlockNode(y)}label(P){return this._leafNode(new u(P))}break(P){return this._leafNode(new l(P))}return(P){const D=new C;if(this._blockNode(D),this.code(P),D.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(C)}try(P,D,Y){if(!D&&!Y)throw new Error('CodeGen: "try" without "catch" and "finally"');const ke=new I;if(this._blockNode(ke),this.code(P),D){const ye=this.name("e");this._currNode=ke.catch=new R(ye),D(ye)}return Y&&(this._currNode=ke.finally=new N,this.code(Y)),this._endBlockNode(R,N)}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 Y=this._nodes.length-D;if(Y<0||P!==void 0&&Y!==P)throw new Error(`CodeGen: wrong number of nodes: ${Y} vs ${P} expected`);return this._nodes.length=D,this}func(P,D=t.nil,Y,ke){return this._blockNode(new v(P,D,Y)),ke&&this.code(ke).endFunc(),this}endFunc(){return this._endBlockNode(v)}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 Y=this._currNode;if(Y instanceof P||D&&Y 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=z;function V(A,P){for(const D in P)A[D]=(A[D]||0)+(P[D]||0);return A}function ne(A,P){return P instanceof t._CodeOrName?V(A,P.names):A}function J(A,P,D){if(A instanceof t.Name)return Y(A);if(!ke(A))return A;return new t._Code(A._items.reduce((ye,we)=>(we instanceof t.Name&&(we=Y(we)),we instanceof t._Code?ye.push(...we._items):ye.push(we),ye),[]));function Y(ye){const we=D[ye.str];return we===void 0||P[ye.str]!==1?ye:(delete P[ye.str],we)}function ke(ye){return ye instanceof t._Code&&ye._items.some(we=>we instanceof t.Name&&P[we.str]===1&&D[we.str]!==void 0)}}function te(A,P){for(const D in P)A[D]=(A[D]||0)-(P[D]||0)}function se(A){return typeof A=="boolean"||typeof A=="number"||A===null?!A:(0,t._)`!${X(A)}`}e.not=se;const oe=q(e.operators.AND);function me(...A){return A.reduce(oe)}e.and=me;const Xe=q(e.operators.OR);function T(...A){return A.reduce(Xe)}e.or=T;function q(A){return(P,D)=>P===t.nil?D:D===t.nil?P:(0,t._)`${X(P)} ${A} ${X(D)}`}function X(A){return A instanceof t.Name?A:(0,t._)`(${A})`}})(ax)),ax}var nt={},dN;function ut(){if(dN)return nt;dN=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.checkStrictMode=nt.getErrorPath=nt.Type=nt.useFunc=nt.setEvaluated=nt.evaluatedPropsToName=nt.mergeEvaluated=nt.eachItem=nt.unescapeJsonPointer=nt.escapeJsonPointer=nt.escapeFragment=nt.unescapeFragment=nt.schemaRefOrVal=nt.schemaHasRulesButRef=nt.schemaHasRules=nt.checkUnknownRules=nt.alwaysValidSchema=nt.toHash=void 0;const e=tt(),t=v0();function n(w){const v={};for(const C of w)v[C]=!0;return v}nt.toHash=n;function r(w,v){return typeof v=="boolean"?v:Object.keys(v).length===0?!0:(s(w,v),!a(v,w.self.RULES.all))}nt.alwaysValidSchema=r;function s(w,v=w.schema){const{opts:C,self:I}=w;if(!C.strictSchema||typeof v=="boolean")return;const R=I.RULES.keywords;for(const N in v)R[N]||S(w,`unknown keyword: "${N}"`)}nt.checkUnknownRules=s;function a(w,v){if(typeof w=="boolean")return!w;for(const C in w)if(v[C])return!0;return!1}nt.schemaHasRules=a;function o(w,v){if(typeof w=="boolean")return!w;for(const C in w)if(C!=="$ref"&&v.all[C])return!0;return!1}nt.schemaHasRulesButRef=o;function i({topSchemaRef:w,schemaPath:v},C,I,R){if(!R){if(typeof C=="number"||typeof C=="boolean")return C;if(typeof C=="string")return(0,e._)`${C}`}return(0,e._)`${w}${v}${(0,e.getProperty)(I)}`}nt.schemaRefOrVal=i;function c(w){return d(decodeURIComponent(w))}nt.unescapeFragment=c;function u(w){return encodeURIComponent(l(w))}nt.escapeFragment=u;function l(w){return typeof w=="number"?`${w}`:w.replace(/~/g,"~0").replace(/\//g,"~1")}nt.escapeJsonPointer=l;function d(w){return w.replace(/~1/g,"/").replace(/~0/g,"~")}nt.unescapeJsonPointer=d;function h(w,v){if(Array.isArray(w))for(const C of w)v(C);else v(w)}nt.eachItem=h;function f({mergeNames:w,mergeToName:v,mergeValues:C,resultToName:I}){return(R,N,z,V)=>{const ne=z===void 0?N:z instanceof e.Name?(N instanceof e.Name?w(R,N,z):v(R,N,z),z):N instanceof e.Name?(v(R,z,N),N):C(N,z);return V===e.Name&&!(ne instanceof e.Name)?I(R,ne):ne}}nt.mergeEvaluated={props:f({mergeNames:(w,v,C)=>w.if((0,e._)`${C} !== true && ${v} !== undefined`,()=>{w.if((0,e._)`${v} === true`,()=>w.assign(C,!0),()=>w.assign(C,(0,e._)`${C} || {}`).code((0,e._)`Object.assign(${C}, ${v})`))}),mergeToName:(w,v,C)=>w.if((0,e._)`${C} !== true`,()=>{v===!0?w.assign(C,!0):(w.assign(C,(0,e._)`${C} || {}`),x(w,C,v))}),mergeValues:(w,v)=>w===!0?!0:{...w,...v},resultToName:p}),items:f({mergeNames:(w,v,C)=>w.if((0,e._)`${C} !== true && ${v} !== undefined`,()=>w.assign(C,(0,e._)`${v} === true ? true : ${C} > ${v} ? ${C} : ${v}`)),mergeToName:(w,v,C)=>w.if((0,e._)`${C} !== true`,()=>w.assign(C,v===!0?!0:(0,e._)`${C} > ${v} ? ${C} : ${v}`)),mergeValues:(w,v)=>w===!0?!0:Math.max(w,v),resultToName:(w,v)=>w.var("items",v)})};function p(w,v){if(v===!0)return w.var("props",!0);const C=w.var("props",(0,e._)`{}`);return v!==void 0&&x(w,C,v),C}nt.evaluatedPropsToName=p;function x(w,v,C){Object.keys(C).forEach(I=>w.assign((0,e._)`${v}${(0,e.getProperty)(I)}`,!0))}nt.setEvaluated=x;const g={};function b(w,v){return w.scopeValue("func",{ref:v,code:g[v.code]||(g[v.code]=new t._Code(v.code))})}nt.useFunc=b;var y;(function(w){w[w.Num=0]="Num",w[w.Str=1]="Str"})(y||(nt.Type=y={}));function _(w,v,C){if(w instanceof e.Name){const I=v===y.Num;return C?I?(0,e._)`"[" + ${w} + "]"`:(0,e._)`"['" + ${w} + "']"`:I?(0,e._)`"/" + ${w}`:(0,e._)`"/" + ${w}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return C?(0,e.getProperty)(w).toString():"/"+l(w)}nt.getErrorPath=_;function S(w,v,C=w.opts.strictSchema){if(C){if(v=`strict mode: ${v}`,C===!0)throw new Error(v);w.self.logger.warn(v)}}return nt.checkStrictMode=S,nt}var lp={},hN;function ia(){if(hN)return lp;hN=1,Object.defineProperty(lp,"__esModule",{value:!0});const e=tt(),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 lp.default=t,lp}var fN;function k1(){return fN||(fN=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=tt(),n=ut(),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,y,_){const{it:S}=g,{gen:w,compositeRule:v,allErrors:C}=S,I=d(g,b,y);_??(v||C)?c(w,I):u(S,(0,t._)`[${I}]`)}e.reportError=s;function a(g,b=e.keywordError,y){const{it:_}=g,{gen:S,compositeRule:w,allErrors:v}=_,C=d(g,b,y);c(S,C),w||v||u(_,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:y,data:_,errsCount:S,it:w}){if(S===void 0)throw new Error("ajv implementation error");const v=g.name("err");g.forRange("i",S,r.default.errors,C=>{g.const(v,(0,t._)`${r.default.vErrors}[${C}]`),g.if((0,t._)`${v}.instancePath === undefined`,()=>g.assign((0,t._)`${v}.instancePath`,(0,t.strConcat)(r.default.instancePath,w.errorPath))),g.assign((0,t._)`${v}.schemaPath`,(0,t.str)`${w.errSchemaPath}/${b}`),w.opts.verbose&&(g.assign((0,t._)`${v}.schema`,y),g.assign((0,t._)`${v}.data`,_))})}e.extendErrors=i;function c(g,b){const y=g.const("err",b);g.if((0,t._)`${r.default.vErrors} === null`,()=>g.assign(r.default.vErrors,(0,t._)`[${y}]`),(0,t._)`${r.default.vErrors}.push(${y})`),g.code((0,t._)`${r.default.errors}++`)}function u(g,b){const{gen:y,validateName:_,schemaEnv:S}=g;S.$async?y.throw((0,t._)`new ${g.ValidationError}(${b})`):(y.assign((0,t._)`${_}.errors`,b),y.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,y){const{createErrors:_}=g.it;return _===!1?(0,t._)`{}`:h(g,b,y)}function h(g,b,y={}){const{gen:_,it:S}=g,w=[f(S,y),p(g,y)];return x(g,b,w),_.object(...w)}function f({errorPath:g},{instancePath:b}){const y=b?(0,t.str)`${g}${(0,n.getErrorPath)(b,n.Type.Str)}`:g;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,y)]}function p({keyword:g,it:{errSchemaPath:b}},{schemaPath:y,parentSchema:_}){let S=_?b:(0,t.str)`${b}/${g}`;return y&&(S=(0,t.str)`${S}${(0,n.getErrorPath)(y,n.Type.Str)}`),[l.schemaPath,S]}function x(g,{params:b,message:y},_){const{keyword:S,data:w,schemaValue:v,it:C}=g,{opts:I,propertyName:R,topSchemaRef:N,schemaPath:z}=C;_.push([l.keyword,S],[l.params,typeof b=="function"?b(g):b||(0,t._)`{}`]),I.messages&&_.push([l.message,typeof y=="function"?y(g):y]),I.verbose&&_.push([l.schema,v],[l.parentSchema,(0,t._)`${N}${z}`],[r.default.data,w]),R&&_.push([l.propertyName,R])}})(sx)),sx}var mN;function Uhe(){if(mN)return Bi;mN=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.boolOrEmptySchema=Bi.topBoolOrEmptySchema=void 0;const e=k1(),t=tt(),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))}Bi.topBoolOrEmptySchema=s;function a(i,c){const{gen:u,schema:l}=i;l===!1?(u.var(c,!1),o(i)):u.var(c,!0)}Bi.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 Bi}var Kn={},zi={},pN;function nF(){if(pN)return zi;pN=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.getRules=zi.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)}zi.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 zi.getRules=r,zi}var Ka={},gN;function rF(){if(gN)return Ka;gN=1,Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.shouldUseRule=Ka.shouldUseGroup=Ka.schemaHasRulesForType=void 0;function e({schema:r,self:s},a){const o=s.RULES.types[a];return o&&o!==!0&&t(r,o)}Ka.schemaHasRulesForType=e;function t(r,s){return s.rules.some(a=>n(r,a))}Ka.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 Ka.shouldUseRule=n,Ka}var bN;function w0(){if(bN)return Kn;bN=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.reportTypeError=Kn.checkDataTypes=Kn.checkDataType=Kn.coerceAndCheckDataType=Kn.getJSONTypes=Kn.getSchemaTypes=Kn.DataType=void 0;const e=nF(),t=rF(),n=k1(),r=tt(),s=ut();var a;(function(y){y[y.Correct=0]="Correct",y[y.Wrong=1]="Wrong"})(a||(Kn.DataType=a={}));function o(y){const _=i(y.type);if(_.includes("null")){if(y.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!_.length&&y.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');y.nullable===!0&&_.push("null")}return _}Kn.getSchemaTypes=o;function i(y){const _=Array.isArray(y)?y:y?[y]:[];if(_.every(e.isJSONType))return _;throw new Error("type must be JSONType or JSONType[]: "+_.join(","))}Kn.getJSONTypes=i;function c(y,_){const{gen:S,data:w,opts:v}=y,C=l(_,v.coerceTypes),I=_.length>0&&!(C.length===0&&_.length===1&&(0,t.schemaHasRulesForType)(y,_[0]));if(I){const R=p(_,w,v.strictNumbers,a.Wrong);S.if(R,()=>{C.length?d(y,_,C):g(y)})}return I}Kn.coerceAndCheckDataType=c;const u=new Set(["string","number","integer","boolean","null"]);function l(y,_){return _?y.filter(S=>u.has(S)||_==="array"&&S==="array"):[]}function d(y,_,S){const{gen:w,data:v,opts:C}=y,I=w.let("dataType",(0,r._)`typeof ${v}`),R=w.let("coerced",(0,r._)`undefined`);C.coerceTypes==="array"&&w.if((0,r._)`${I} == 'object' && Array.isArray(${v}) && ${v}.length == 1`,()=>w.assign(v,(0,r._)`${v}[0]`).assign(I,(0,r._)`typeof ${v}`).if(p(_,v,C.strictNumbers),()=>w.assign(R,v))),w.if((0,r._)`${R} !== undefined`);for(const z of S)(u.has(z)||z==="array"&&C.coerceTypes==="array")&&N(z);w.else(),g(y),w.endIf(),w.if((0,r._)`${R} !== undefined`,()=>{w.assign(v,R),h(y,R)});function N(z){switch(z){case"string":w.elseIf((0,r._)`${I} == "number" || ${I} == "boolean"`).assign(R,(0,r._)`"" + ${v}`).elseIf((0,r._)`${v} === null`).assign(R,(0,r._)`""`);return;case"number":w.elseIf((0,r._)`${I} == "boolean" || ${v} === null
|
|
30
|
+
|| (${I} == "string" && ${v} && ${v} == +${v})`).assign(R,(0,r._)`+${v}`);return;case"integer":w.elseIf((0,r._)`${I} === "boolean" || ${v} === null
|
|
31
|
+
|| (${I} === "string" && ${v} && ${v} == +${v} && !(${v} % 1))`).assign(R,(0,r._)`+${v}`);return;case"boolean":w.elseIf((0,r._)`${v} === "false" || ${v} === 0 || ${v} === null`).assign(R,!1).elseIf((0,r._)`${v} === "true" || ${v} === 1`).assign(R,!0);return;case"null":w.elseIf((0,r._)`${v} === "" || ${v} === 0 || ${v} === false`),w.assign(R,null);return;case"array":w.elseIf((0,r._)`${I} === "string" || ${I} === "number"
|
|
32
|
+
|| ${I} === "boolean" || ${v} === null`).assign(R,(0,r._)`[${v}]`)}}}function h({gen:y,parentData:_,parentDataProperty:S},w){y.if((0,r._)`${_} !== undefined`,()=>y.assign((0,r._)`${_}[${S}]`,w))}function f(y,_,S,w=a.Correct){const v=w===a.Correct?r.operators.EQ:r.operators.NEQ;let C;switch(y){case"null":return(0,r._)`${_} ${v} null`;case"array":C=(0,r._)`Array.isArray(${_})`;break;case"object":C=(0,r._)`${_} && typeof ${_} == "object" && !Array.isArray(${_})`;break;case"integer":C=I((0,r._)`!(${_} % 1) && !isNaN(${_})`);break;case"number":C=I();break;default:return(0,r._)`typeof ${_} ${v} ${y}`}return w===a.Correct?C:(0,r.not)(C);function I(R=r.nil){return(0,r.and)((0,r._)`typeof ${_} == "number"`,R,S?(0,r._)`isFinite(${_})`:r.nil)}}Kn.checkDataType=f;function p(y,_,S,w){if(y.length===1)return f(y[0],_,S,w);let v;const C=(0,s.toHash)(y);if(C.array&&C.object){const I=(0,r._)`typeof ${_} != "object"`;v=C.null?I:(0,r._)`!${_} || ${I}`,delete C.null,delete C.array,delete C.object}else v=r.nil;C.number&&delete C.integer;for(const I in C)v=(0,r.and)(v,f(I,_,S,w));return v}Kn.checkDataTypes=p;const x={message:({schema:y})=>`must be ${y}`,params:({schema:y,schemaValue:_})=>typeof y=="string"?(0,r._)`{type: ${y}}`:(0,r._)`{type: ${_}}`};function g(y){const _=b(y);(0,n.reportError)(_,x)}Kn.reportTypeError=g;function b(y){const{gen:_,data:S,schema:w}=y,v=(0,s.schemaRefOrVal)(y,w,"type");return{gen:_,keyword:"type",data:S,schema:w.type,schemaCode:v,schemaValue:v,parentSchema:w,params:{},it:y}}return Kn}var Ud={},yN;function Hhe(){if(yN)return Ud;yN=1,Object.defineProperty(Ud,"__esModule",{value:!0}),Ud.assignDefaults=void 0;const e=tt(),t=ut();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))}Ud.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 Ud}var $s={},Ct={},kN;function ca(){if(kN)return Ct;kN=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.validateUnion=Ct.validateArray=Ct.usePattern=Ct.callValidateCode=Ct.schemaProperties=Ct.allSchemaProperties=Ct.noPropertyInData=Ct.propertyInData=Ct.isOwnProperty=Ct.hasPropFunc=Ct.reportMissingProp=Ct.checkMissingProp=Ct.checkReportMissingProp=void 0;const e=tt(),t=ut(),n=ia(),r=ut();function s(y,_){const{gen:S,data:w,it:v}=y;S.if(l(S,w,_,v.opts.ownProperties),()=>{y.setParams({missingProperty:(0,e._)`${_}`},!0),y.error()})}Ct.checkReportMissingProp=s;function a({gen:y,data:_,it:{opts:S}},w,v){return(0,e.or)(...w.map(C=>(0,e.and)(l(y,_,C,S.ownProperties),(0,e._)`${v} = ${C}`)))}Ct.checkMissingProp=a;function o(y,_){y.setParams({missingProperty:_},!0),y.error()}Ct.reportMissingProp=o;function i(y){return y.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}Ct.hasPropFunc=i;function c(y,_,S){return(0,e._)`${i(y)}.call(${_}, ${S})`}Ct.isOwnProperty=c;function u(y,_,S,w){const v=(0,e._)`${_}${(0,e.getProperty)(S)} !== undefined`;return w?(0,e._)`${v} && ${c(y,_,S)}`:v}Ct.propertyInData=u;function l(y,_,S,w){const v=(0,e._)`${_}${(0,e.getProperty)(S)} === undefined`;return w?(0,e.or)(v,(0,e.not)(c(y,_,S))):v}Ct.noPropertyInData=l;function d(y){return y?Object.keys(y).filter(_=>_!=="__proto__"):[]}Ct.allSchemaProperties=d;function h(y,_){return d(_).filter(S=>!(0,t.alwaysValidSchema)(y,_[S]))}Ct.schemaProperties=h;function f({schemaCode:y,data:_,it:{gen:S,topSchemaRef:w,schemaPath:v,errorPath:C},it:I},R,N,z){const V=z?(0,e._)`${y}, ${_}, ${w}${v}`:_,ne=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,C)],[n.default.parentData,I.parentData],[n.default.parentDataProperty,I.parentDataProperty],[n.default.rootData,n.default.rootData]];I.opts.dynamicRef&&ne.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const J=(0,e._)`${V}, ${S.object(...ne)}`;return N!==e.nil?(0,e._)`${R}.call(${N}, ${J})`:(0,e._)`${R}(${J})`}Ct.callValidateCode=f;const p=(0,e._)`new RegExp`;function x({gen:y,it:{opts:_}},S){const w=_.unicodeRegExp?"u":"",{regExp:v}=_.code,C=v(S,w);return y.scopeValue("pattern",{key:C.toString(),ref:C,code:(0,e._)`${v.code==="new RegExp"?p:(0,r.useFunc)(y,v)}(${S}, ${w})`})}Ct.usePattern=x;function g(y){const{gen:_,data:S,keyword:w,it:v}=y,C=_.name("valid");if(v.allErrors){const R=_.let("valid",!0);return I(()=>_.assign(R,!1)),R}return _.var(C,!0),I(()=>_.break()),C;function I(R){const N=_.const("len",(0,e._)`${S}.length`);_.forRange("i",0,N,z=>{y.subschema({keyword:w,dataProp:z,dataPropType:t.Type.Num},C),_.if((0,e.not)(C),R)})}}Ct.validateArray=g;function b(y){const{gen:_,schema:S,keyword:w,it:v}=y;if(!Array.isArray(S))throw new Error("ajv implementation error");if(S.some(N=>(0,t.alwaysValidSchema)(v,N))&&!v.opts.unevaluated)return;const I=_.let("valid",!1),R=_.name("_valid");_.block(()=>S.forEach((N,z)=>{const V=y.subschema({keyword:w,schemaProp:z,compositeRule:!0},R);_.assign(I,(0,e._)`${I} || ${R}`),y.mergeValidEvaluated(V,R)||_.if((0,e.not)(I))})),y.result(I,()=>y.reset(),()=>y.error(!0))}return Ct.validateUnion=b,Ct}var xN;function qhe(){if(xN)return $s;xN=1,Object.defineProperty($s,"__esModule",{value:!0}),$s.validateKeywordUsage=$s.validSchemaType=$s.funcKeywordCode=$s.macroKeywordCode=void 0;const e=tt(),t=ia(),n=ca(),r=k1();function s(h,f){const{gen:p,keyword:x,schema:g,parentSchema:b,it:y}=h,_=f.macro.call(y.self,g,b,y),S=u(p,x,_);y.opts.validateSchema!==!1&&y.self.validateSchema(_,!0);const w=p.name("valid");h.subschema({schema:_,schemaPath:e.nil,errSchemaPath:`${y.errSchemaPath}/${x}`,topSchemaRef:S,compositeRule:!0},w),h.pass(w,()=>h.error(!0))}$s.macroKeywordCode=s;function a(h,f){var p;const{gen:x,keyword:g,schema:b,parentSchema:y,$data:_,it:S}=h;c(S,f);const w=!_&&f.compile?f.compile.call(S.self,b,y,S):f.validate,v=u(x,g,w),C=x.let("valid");h.block$data(C,I),h.ok((p=f.valid)!==null&&p!==void 0?p:C);function I(){if(f.errors===!1)z(),f.modifying&&o(h),V(()=>h.error());else{const ne=f.async?R():N();f.modifying&&o(h),V(()=>i(h,ne))}}function R(){const ne=x.let("ruleErrs",null);return x.try(()=>z((0,e._)`await `),J=>x.assign(C,!1).if((0,e._)`${J} instanceof ${S.ValidationError}`,()=>x.assign(ne,(0,e._)`${J}.errors`),()=>x.throw(J))),ne}function N(){const ne=(0,e._)`${v}.errors`;return x.assign(ne,null),z(e.nil),ne}function z(ne=f.async?(0,e._)`await `:e.nil){const J=S.opts.passContext?t.default.this:t.default.self,te=!("compile"in f&&!_||f.schema===!1);x.assign(C,(0,e._)`${ne}${(0,n.callValidateCode)(h,v,J,te)}`,f.modifying)}function V(ne){var J;x.if((0,e.not)((J=f.valid)!==null&&J!==void 0?J:C),ne)}}$s.funcKeywordCode=a;function o(h){const{gen:f,data:p,it:x}=h;f.if(x.parentData,()=>f.assign(p,(0,e._)`${x.parentData}[${x.parentDataProperty}]`))}function i(h,f){const{gen:p}=h;p.if((0,e._)`Array.isArray(${f})`,()=>{p.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${f} : ${t.default.vErrors}.concat(${f})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,r.extendErrors)(h)},()=>h.error())}function c({schemaEnv:h},f){if(f.async&&!h.$async)throw new Error("async keyword in sync schema")}function u(h,f,p){if(p===void 0)throw new Error(`keyword "${f}" failed to compile`);return h.scopeValue("keyword",typeof p=="function"?{ref:p}:{ref:p,code:(0,e.stringify)(p)})}function l(h,f,p=!1){return!f.length||f.some(x=>x==="array"?Array.isArray(h):x==="object"?h&&typeof h=="object"&&!Array.isArray(h):typeof h==x||p&&typeof h>"u")}$s.validSchemaType=l;function d({schema:h,opts:f,self:p,errSchemaPath:x},g,b){if(Array.isArray(g.keyword)?!g.keyword.includes(b):g.keyword!==b)throw new Error("ajv implementation error");const y=g.dependencies;if(y?.some(_=>!Object.prototype.hasOwnProperty.call(h,_)))throw new Error(`parent schema must have dependencies of ${b}: ${y.join(",")}`);if(g.validateSchema&&!g.validateSchema(h[b])){const S=`keyword "${b}" value is invalid at path "${x}": `+p.errorsText(g.validateSchema.errors);if(f.validateSchema==="log")p.logger.error(S);else throw new Error(S)}}return $s.validateKeywordUsage=d,$s}var Wa={},_N;function Vhe(){if(_N)return Wa;_N=1,Object.defineProperty(Wa,"__esModule",{value:!0}),Wa.extendSubschemaMode=Wa.extendSubschemaData=Wa.getSubschema=void 0;const e=tt(),t=ut();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')}Wa.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:x,opts:g}=o,b=h.let("data",(0,e._)`${o.data}${(0,e.getProperty)(i)}`,!0);f(b),a.errorPath=(0,e.str)`${p}${(0,t.getErrorPath)(i,c,g.jsPropertySyntax)}`,a.parentDataProperty=(0,e._)`${i}`,a.dataPathArr=[...x,a.parentDataProperty]}if(u!==void 0){const p=u instanceof e.Name?u:h.let("data",u,!0);f(p),d!==void 0&&(a.propertyName=d)}l&&(a.dataTypes=l);function f(p){a.data=p,a.dataLevel=o.dataLevel+1,a.dataTypes=[],o.definedProperties=new Set,a.parentData=o.data,a.dataNames=[...o.dataNames,p]}}Wa.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 Wa.extendSubschemaMode=s,Wa}var gr={},cx,vN;function sF(){return vN||(vN=1,cx=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}),cx}var ux={exports:{}},wN;function Ghe(){if(wN)return ux.exports;wN=1;var e=ux.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 f in o){var p=o[f];if(Array.isArray(p)){if(f in e.arrayKeywords)for(var x=0;x<p.length;x++)t(r,s,a,p[x],i+"/"+f+"/"+x,c,i,f,o,x)}else if(f in e.propsKeywords){if(p&&typeof p=="object")for(var g in p)t(r,s,a,p[g],i+"/"+f+"/"+n(g),c,i,f,o,g)}else(f in e.keywords||r.allKeys&&!(f in e.skipKeywords))&&t(r,s,a,p,i+"/"+f,c,i,f,o)}a(o,i,c,u,l,d,h)}}function n(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}return ux.exports}var SN;function x1(){if(SN)return gr;SN=1,Object.defineProperty(gr,"__esModule",{value:!0}),gr.getSchemaRefs=gr.resolveUrl=gr.normalizeId=gr._getFullPath=gr.getFullPath=gr.inlineRef=void 0;const e=ut(),t=sF(),n=Ghe(),r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(x,g=!0){return typeof x=="boolean"?!0:g===!0?!o(x):g?i(x)<=g:!1}gr.inlineRef=s;const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function o(x){for(const g in x){if(a.has(g))return!0;const b=x[g];if(Array.isArray(b)&&b.some(o)||typeof b=="object"&&o(b))return!0}return!1}function i(x){let g=0;for(const b in x){if(b==="$ref")return 1/0;if(g++,!r.has(b)&&(typeof x[b]=="object"&&(0,e.eachItem)(x[b],y=>g+=i(y)),g===1/0))return 1/0}return g}function c(x,g="",b){b!==!1&&(g=d(g));const y=x.parse(g);return u(x,y)}gr.getFullPath=c;function u(x,g){return x.serialize(g).split("#")[0]+"#"}gr._getFullPath=u;const l=/#\/?$/;function d(x){return x?x.replace(l,""):""}gr.normalizeId=d;function h(x,g,b){return b=d(b),x.resolve(g,b)}gr.resolveUrl=h;const f=/^[a-z_][-a-z0-9._]*$/i;function p(x,g){if(typeof x=="boolean")return{};const{schemaId:b,uriResolver:y}=this.opts,_=d(x[b]||g),S={"":_},w=c(y,_,!1),v={},C=new Set;return n(x,{allKeys:!0},(N,z,V,ne)=>{if(ne===void 0)return;const J=w+z;let te=S[ne];typeof N[b]=="string"&&(te=se.call(this,N[b])),oe.call(this,N.$anchor),oe.call(this,N.$dynamicAnchor),S[z]=te;function se(me){const Xe=this.opts.uriResolver.resolve;if(me=d(te?Xe(te,me):me),C.has(me))throw R(me);C.add(me);let T=this.refs[me];return typeof T=="string"&&(T=this.refs[T]),typeof T=="object"?I(N,T.schema,me):me!==d(J)&&(me[0]==="#"?(I(N,v[me],me),v[me]=N):this.refs[me]=J),me}function oe(me){if(typeof me=="string"){if(!f.test(me))throw new Error(`invalid anchor "${me}"`);se.call(this,`#${me}`)}}}),v;function I(N,z,V){if(z!==void 0&&!t(N,z))throw R(V)}function R(N){return new Error(`reference "${N}" resolves to more than one schema`)}}return gr.getSchemaRefs=p,gr}var EN;function _1(){if(EN)return Ga;EN=1,Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.getData=Ga.KeywordCxt=Ga.validateFunctionCode=void 0;const e=Uhe(),t=w0(),n=rF(),r=w0(),s=Hhe(),a=qhe(),o=Vhe(),i=tt(),c=ia(),u=x1(),l=ut(),d=k1();function h(G){if(w(G)&&(C(G),S(G))){g(G);return}f(G,()=>(0,e.topBoolOrEmptySchema)(G))}Ga.validateFunctionCode=h;function f({gen:G,validateName:W,schema:ae,schemaEnv:ce,opts:_e},Re){_e.code.es5?G.func(W,(0,i._)`${c.default.data}, ${c.default.valCxt}`,ce.$async,()=>{G.code((0,i._)`"use strict"; ${y(ae,_e)}`),x(G,_e),G.code(Re)}):G.func(W,(0,i._)`${c.default.data}, ${p(_e)}`,ce.$async,()=>G.code(y(ae,_e)).code(Re))}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 x(G,W){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}`),W.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),W.dynamicRef&&G.var(c.default.dynamicAnchors,(0,i._)`{}`)})}function g(G){const{schema:W,opts:ae,gen:ce}=G;f(G,()=>{ae.$comment&&W.$comment&&ne(G),N(G),ce.let(c.default.vErrors,null),ce.let(c.default.errors,0),ae.unevaluated&&b(G),I(G),J(G)})}function b(G){const{gen:W,validateName:ae}=G;G.evaluated=W.const("evaluated",(0,i._)`${ae}.evaluated`),W.if((0,i._)`${G.evaluated}.dynamicProps`,()=>W.assign((0,i._)`${G.evaluated}.props`,(0,i._)`undefined`)),W.if((0,i._)`${G.evaluated}.dynamicItems`,()=>W.assign((0,i._)`${G.evaluated}.items`,(0,i._)`undefined`))}function y(G,W){const ae=typeof G=="object"&&G[W.schemaId];return ae&&(W.code.source||W.code.process)?(0,i._)`/*# sourceURL=${ae} */`:i.nil}function _(G,W){if(w(G)&&(C(G),S(G))){v(G,W);return}(0,e.boolOrEmptySchema)(G,W)}function S({schema:G,self:W}){if(typeof G=="boolean")return!G;for(const ae in G)if(W.RULES.all[ae])return!0;return!1}function w(G){return typeof G.schema!="boolean"}function v(G,W){const{schema:ae,gen:ce,opts:_e}=G;_e.$comment&&ae.$comment&&ne(G),z(G),V(G);const Re=ce.const("_errs",c.default.errors);I(G,Re),ce.var(W,(0,i._)`${Re} === ${c.default.errors}`)}function C(G){(0,l.checkUnknownRules)(G),R(G)}function I(G,W){if(G.opts.jtd)return se(G,[],!1,W);const ae=(0,t.getSchemaTypes)(G.schema),ce=(0,t.coerceAndCheckDataType)(G,ae);se(G,ae,!ce,W)}function R(G){const{schema:W,errSchemaPath:ae,opts:ce,self:_e}=G;W.$ref&&ce.ignoreKeywordsWithRef&&(0,l.schemaHasRulesButRef)(W,_e.RULES)&&_e.logger.warn(`$ref: keywords ignored in schema at path "${ae}"`)}function N(G){const{schema:W,opts:ae}=G;W.default!==void 0&&ae.useDefaults&&ae.strictSchema&&(0,l.checkStrictMode)(G,"default is ignored in the schema root")}function z(G){const W=G.schema[G.opts.schemaId];W&&(G.baseId=(0,u.resolveUrl)(G.opts.uriResolver,G.baseId,W))}function V(G){if(G.schema.$async&&!G.schemaEnv.$async)throw new Error("async schema in sync schema")}function ne({gen:G,schemaEnv:W,schema:ae,errSchemaPath:ce,opts:_e}){const Re=ae.$comment;if(_e.$comment===!0)G.code((0,i._)`${c.default.self}.logger.log(${Re})`);else if(typeof _e.$comment=="function"){const H=(0,i.str)`${ce}/$comment`,ie=G.scopeValue("root",{ref:W.root});G.code((0,i._)`${c.default.self}.opts.$comment(${Re}, ${H}, ${ie}.schema)`)}}function J(G){const{gen:W,schemaEnv:ae,validateName:ce,ValidationError:_e,opts:Re}=G;ae.$async?W.if((0,i._)`${c.default.errors} === 0`,()=>W.return(c.default.data),()=>W.throw((0,i._)`new ${_e}(${c.default.vErrors})`)):(W.assign((0,i._)`${ce}.errors`,c.default.vErrors),Re.unevaluated&&te(G),W.return((0,i._)`${c.default.errors} === 0`))}function te({gen:G,evaluated:W,props:ae,items:ce}){ae instanceof i.Name&&G.assign((0,i._)`${W}.props`,ae),ce instanceof i.Name&&G.assign((0,i._)`${W}.items`,ce)}function se(G,W,ae,ce){const{gen:_e,schema:Re,data:H,allErrors:ie,opts:Se,self:$e}=G,{RULES:Je}=$e;if(Re.$ref&&(Se.ignoreKeywordsWithRef||!(0,l.schemaHasRulesButRef)(Re,Je))){_e.block(()=>ke(G,"$ref",Je.all.$ref.definition));return}Se.jtd||me(G,W),_e.block(()=>{for(const hn of Je.rules)Gn(hn);Gn(Je.post)});function Gn(hn){(0,n.shouldUseGroup)(Re,hn)&&(hn.type?(_e.if((0,r.checkDataType)(hn.type,H,Se.strictNumbers)),oe(G,hn),W.length===1&&W[0]===hn.type&&ae&&(_e.else(),(0,r.reportTypeError)(G)),_e.endIf()):oe(G,hn),ie||_e.if((0,i._)`${c.default.errors} === ${ce||0}`))}}function oe(G,W){const{gen:ae,schema:ce,opts:{useDefaults:_e}}=G;_e&&(0,s.assignDefaults)(G,W.type),ae.block(()=>{for(const Re of W.rules)(0,n.shouldUseRule)(ce,Re)&&ke(G,Re.keyword,Re.definition,W.type)})}function me(G,W){G.schemaEnv.meta||!G.opts.strictTypes||(Xe(G,W),G.opts.allowUnionTypes||T(G,W),q(G,G.dataTypes))}function Xe(G,W){if(W.length){if(!G.dataTypes.length){G.dataTypes=W;return}W.forEach(ae=>{A(G.dataTypes,ae)||D(G,`type "${ae}" not allowed by context "${G.dataTypes.join(",")}"`)}),P(G,W)}}function T(G,W){W.length>1&&!(W.length===2&&W.includes("null"))&&D(G,"use allowUnionTypes to allow union type keyword")}function q(G,W){const ae=G.self.RULES.all;for(const ce in ae){const _e=ae[ce];if(typeof _e=="object"&&(0,n.shouldUseRule)(G.schema,_e)){const{type:Re}=_e.definition;Re.length&&!Re.some(H=>X(W,H))&&D(G,`missing type "${Re.join(",")}" for keyword "${ce}"`)}}}function X(G,W){return G.includes(W)||W==="number"&&G.includes("integer")}function A(G,W){return G.includes(W)||W==="integer"&&G.includes("number")}function P(G,W){const ae=[];for(const ce of G.dataTypes)A(W,ce)?ae.push(ce):W.includes("integer")&&ce==="number"&&ae.push("integer");G.dataTypes=ae}function D(G,W){const ae=G.schemaEnv.baseId+G.errSchemaPath;W+=` at "${ae}" (strictTypes)`,(0,l.checkStrictMode)(G,W,G.opts.strictTypes)}class Y{constructor(W,ae,ce){if((0,a.validateKeywordUsage)(W,ae,ce),this.gen=W.gen,this.allErrors=W.allErrors,this.keyword=ce,this.data=W.data,this.schema=W.schema[ce],this.$data=ae.$data&&W.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,l.schemaRefOrVal)(W,this.schema,ce,this.$data),this.schemaType=ae.schemaType,this.parentSchema=W.schema,this.params={},this.it=W,this.def=ae,this.$data)this.schemaCode=W.gen.const("vSchema",Oe(this.$data,W));else if(this.schemaCode=this.schemaValue,!(0,a.validSchemaType)(this.schema,ae.schemaType,ae.allowUndefined))throw new Error(`${ce} value must be ${JSON.stringify(ae.schemaType)}`);("code"in ae?ae.trackErrors:ae.errors!==!1)&&(this.errsCount=W.gen.const("_errs",c.default.errors))}result(W,ae,ce){this.failResult((0,i.not)(W),ae,ce)}failResult(W,ae,ce){this.gen.if(W),ce?ce():this.error(),ae?(this.gen.else(),ae(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(W,ae){this.failResult((0,i.not)(W),void 0,ae)}fail(W){if(W===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(W),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(W){if(!this.$data)return this.fail(W);const{schemaCode:ae}=this;this.fail((0,i._)`${ae} !== undefined && (${(0,i.or)(this.invalid$data(),W)})`)}error(W,ae,ce){if(ae){this.setParams(ae),this._error(W,ce),this.setParams({});return}this._error(W,ce)}_error(W,ae){(W?d.reportExtraError:d.reportError)(this,this.def.error,ae)}$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(W){this.allErrors||this.gen.if(W)}setParams(W,ae){ae?Object.assign(this.params,W):this.params=W}block$data(W,ae,ce=i.nil){this.gen.block(()=>{this.check$data(W,ce),ae()})}check$data(W=i.nil,ae=i.nil){if(!this.$data)return;const{gen:ce,schemaCode:_e,schemaType:Re,def:H}=this;ce.if((0,i.or)((0,i._)`${_e} === undefined`,ae)),W!==i.nil&&ce.assign(W,!0),(Re.length||H.validateSchema)&&(ce.elseIf(this.invalid$data()),this.$dataError(),W!==i.nil&&ce.assign(W,!1)),ce.else()}invalid$data(){const{gen:W,schemaCode:ae,schemaType:ce,def:_e,it:Re}=this;return(0,i.or)(H(),ie());function H(){if(ce.length){if(!(ae instanceof i.Name))throw new Error("ajv implementation error");const Se=Array.isArray(ce)?ce:[ce];return(0,i._)`${(0,r.checkDataTypes)(Se,ae,Re.opts.strictNumbers,r.DataType.Wrong)}`}return i.nil}function ie(){if(_e.validateSchema){const Se=W.scopeValue("validate$data",{ref:_e.validateSchema});return(0,i._)`!${Se}(${ae})`}return i.nil}}subschema(W,ae){const ce=(0,o.getSubschema)(this.it,W);(0,o.extendSubschemaData)(ce,this.it,W),(0,o.extendSubschemaMode)(ce,W);const _e={...this.it,...ce,items:void 0,props:void 0};return _(_e,ae),_e}mergeEvaluated(W,ae){const{it:ce,gen:_e}=this;ce.opts.unevaluated&&(ce.props!==!0&&W.props!==void 0&&(ce.props=l.mergeEvaluated.props(_e,W.props,ce.props,ae)),ce.items!==!0&&W.items!==void 0&&(ce.items=l.mergeEvaluated.items(_e,W.items,ce.items,ae)))}mergeValidEvaluated(W,ae){const{it:ce,gen:_e}=this;if(ce.opts.unevaluated&&(ce.props!==!0||ce.items!==!0))return _e.if(ae,()=>this.mergeEvaluated(W,i.Name)),!0}}Ga.KeywordCxt=Y;function ke(G,W,ae,ce){const _e=new Y(G,ae,W);"code"in ae?ae.code(_e,ce):_e.$data&&ae.validate?(0,a.funcKeywordCode)(_e,ae):"macro"in ae?(0,a.macroKeywordCode)(_e,ae):(ae.compile||ae.validate)&&(0,a.funcKeywordCode)(_e,ae)}const ye=/^\/(?:[^~]|~0|~1)*$/,we=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Oe(G,{dataLevel:W,dataNames:ae,dataPathArr:ce}){let _e,Re;if(G==="")return c.default.rootData;if(G[0]==="/"){if(!ye.test(G))throw new Error(`Invalid JSON-pointer: ${G}`);_e=G,Re=c.default.rootData}else{const $e=we.exec(G);if(!$e)throw new Error(`Invalid JSON-pointer: ${G}`);const Je=+$e[1];if(_e=$e[2],_e==="#"){if(Je>=W)throw new Error(Se("property/index",Je));return ce[W-Je]}if(Je>W)throw new Error(Se("data",Je));if(Re=ae[W-Je],!_e)return Re}let H=Re;const ie=_e.split("/");for(const $e of ie)$e&&(Re=(0,i._)`${Re}${(0,i.getProperty)((0,l.unescapeJsonPointer)($e))}`,H=(0,i._)`${H} && ${Re}`);return H;function Se($e,Je){return`Cannot access ${$e} ${Je} levels up, current level is ${W}`}}return Ga.getData=Oe,Ga}var dp={},TN;function OT(){if(TN)return dp;TN=1,Object.defineProperty(dp,"__esModule",{value:!0});class e extends Error{constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}return dp.default=e,dp}var hp={},CN;function v1(){if(CN)return hp;CN=1,Object.defineProperty(hp,"__esModule",{value:!0});const e=x1();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 hp.default=t,hp}var Vr={},IN;function w1(){if(IN)return Vr;IN=1,Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.resolveSchema=Vr.getCompilingSchema=Vr.resolveRef=Vr.compileSchema=Vr.SchemaEnv=void 0;const e=tt(),t=OT(),n=ia(),r=x1(),s=ut(),a=_1();class o{constructor(b){var y;this.refs={},this.dynamicAnchors={};let _;typeof b.schema=="object"&&(_=b.schema),this.schema=b.schema,this.schemaId=b.schemaId,this.root=b.root||this,this.baseId=(y=b.baseId)!==null&&y!==void 0?y:(0,r.normalizeId)(_?.[b.schemaId||"$id"]),this.schemaPath=b.schemaPath,this.localRefs=b.localRefs,this.meta=b.meta,this.$async=_?.$async,this.refs={}}}Vr.SchemaEnv=o;function i(g){const b=l.call(this,g);if(b)return b;const y=(0,r.getFullPath)(this.opts.uriResolver,g.root.baseId),{es5:_,lines:S}=this.opts.code,{ownProperties:w}=this.opts,v=new e.CodeGen(this.scope,{es5:_,lines:S,ownProperties:w});let C;g.$async&&(C=v.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const I=v.scopeName("validate");g.validateName=I;const R={gen:v,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:v.scopeValue("schema",this.opts.code.source===!0?{ref:g.schema,code:(0,e.stringify)(g.schema)}:{ref:g.schema}),validateName:I,ValidationError:C,schema:g.schema,schemaEnv:g,rootId:y,baseId:g.baseId||y,schemaPath:e.nil,errSchemaPath:g.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let N;try{this._compilations.add(g),(0,a.validateFunctionCode)(R),v.optimize(this.opts.code.optimize);const z=v.toString();N=`${v.scopeRefs(n.default.scope)}return ${z}`,this.opts.code.process&&(N=this.opts.code.process(N,g));const ne=new Function(`${n.default.self}`,`${n.default.scope}`,N)(this,this.scope.get());if(this.scope.value(I,{ref:ne}),ne.errors=null,ne.schema=g.schema,ne.schemaEnv=g,g.$async&&(ne.$async=!0),this.opts.code.source===!0&&(ne.source={validateName:I,validateCode:z,scopeValues:v._values}),this.opts.unevaluated){const{props:J,items:te}=R;ne.evaluated={props:J instanceof e.Name?void 0:J,items:te instanceof e.Name?void 0:te,dynamicProps:J instanceof e.Name,dynamicItems:te instanceof e.Name},ne.source&&(ne.source.evaluated=(0,e.stringify)(ne.evaluated))}return g.validate=ne,g}catch(z){throw delete g.validate,delete g.validateName,N&&this.logger.error("Error compiling schema, function code:",N),z}finally{this._compilations.delete(g)}}Vr.compileSchema=i;function c(g,b,y){var _;y=(0,r.resolveUrl)(this.opts.uriResolver,b,y);const S=g.refs[y];if(S)return S;let w=h.call(this,g,y);if(w===void 0){const v=(_=g.localRefs)===null||_===void 0?void 0:_[y],{schemaId:C}=this.opts;v&&(w=new o({schema:v,schemaId:C,root:g,baseId:b}))}if(w!==void 0)return g.refs[y]=u.call(this,w)}Vr.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}Vr.getCompilingSchema=l;function d(g,b){return g.schema===b.schema&&g.root===b.root&&g.baseId===b.baseId}function h(g,b){let y;for(;typeof(y=this.refs[b])=="string";)b=y;return y||this.schemas[b]||f.call(this,g,b)}function f(g,b){const y=this.opts.uriResolver.parse(b),_=(0,r._getFullPath)(this.opts.uriResolver,y);let S=(0,r.getFullPath)(this.opts.uriResolver,g.baseId,void 0);if(Object.keys(g.schema).length>0&&_===S)return x.call(this,y,g);const w=(0,r.normalizeId)(_),v=this.refs[w]||this.schemas[w];if(typeof v=="string"){const C=f.call(this,g,v);return typeof C?.schema!="object"?void 0:x.call(this,y,C)}if(typeof v?.schema=="object"){if(v.validate||i.call(this,v),w===(0,r.normalizeId)(b)){const{schema:C}=v,{schemaId:I}=this.opts,R=C[I];return R&&(S=(0,r.resolveUrl)(this.opts.uriResolver,S,R)),new o({schema:C,schemaId:I,root:g,baseId:S})}return x.call(this,y,v)}}Vr.resolveSchema=f;const p=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function x(g,{baseId:b,schema:y,root:_}){var S;if(((S=g.fragment)===null||S===void 0?void 0:S[0])!=="/")return;for(const C of g.fragment.slice(1).split("/")){if(typeof y=="boolean")return;const I=y[(0,s.unescapeFragment)(C)];if(I===void 0)return;y=I;const R=typeof y=="object"&&y[this.opts.schemaId];!p.has(C)&&R&&(b=(0,r.resolveUrl)(this.opts.uriResolver,b,R))}let w;if(typeof y!="boolean"&&y.$ref&&!(0,s.schemaHasRulesButRef)(y,this.RULES)){const C=(0,r.resolveUrl)(this.opts.uriResolver,b,y.$ref);w=f.call(this,_,C)}const{schemaId:v}=this.opts;if(w=w||new o({schema:y,schemaId:v,root:_,baseId:b}),w.schema!==w.root.schema)return w}return Vr}const Khe="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Whe="Meta-schema for $data reference (JSON AnySchema extension proposal)",Yhe="object",Jhe=["$data"],Qhe={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Xhe=!1,Zhe={$id:Khe,description:Whe,type:Yhe,required:Jhe,properties:Qhe,additionalProperties:Xhe};var fp={},Hd={exports:{}},lx,AN;function aF(){if(AN)return lx;AN=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 f="",p=0,x=0;for(x=0;x<h.length;x++)if(p=h[x].charCodeAt(0),p!==48){if(!(p>=48&&p<=57||p>=65&&p<=70||p>=97&&p<=102))return"";f+=h[x];break}for(x+=1;x<h.length;x++){if(p=h[x].charCodeAt(0),!(p>=48&&p<=57||p>=65&&p<=70||p>=97&&p<=102))return"";f+=h[x]}return f}const r=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function s(h){return h.length=0,!0}function a(h,f,p){if(h.length){const x=n(h);if(x!=="")f.push(x);else return p.error=!0,!1;h.length=0}return!0}function o(h){let f=0;const p={error:!1,address:"",zone:""},x=[],g=[];let b=!1,y=!1,_=a;for(let S=0;S<h.length;S++){const w=h[S];if(!(w==="["||w==="]"))if(w===":"){if(b===!0&&(y=!0),!_(g,x,p))break;if(++f>7){p.error=!0;break}S>0&&h[S-1]===":"&&(b=!0),x.push(":");continue}else if(w==="%"){if(!_(g,x,p))break;_=s}else{g.push(w);continue}}return g.length&&(_===s?p.zone=g.join(""):y?x.push(g.join("")):x.push(n(g))),p.address=x.join(""),p}function i(h){if(c(h,":")<2)return{host:h,isIPV6:!1};const f=o(h);if(f.error)return{host:h,isIPV6:!1};{let p=f.address,x=f.address;return f.zone&&(p+="%"+f.zone,x+="%25"+f.zone),{host:p,isIPV6:!0,escapedHost:x}}}function c(h,f){let p=0;for(let x=0;x<h.length;x++)h[x]===f&&p++;return p}function u(h){let f=h;const p=[];let x=-1,g=0;for(;g=f.length;){if(g===1){if(f===".")break;if(f==="/"){p.push("/");break}else{p.push(f);break}}else if(g===2){if(f[0]==="."){if(f[1]===".")break;if(f[1]==="/"){f=f.slice(2);continue}}else if(f[0]==="/"&&(f[1]==="."||f[1]==="/")){p.push("/");break}}else if(g===3&&f==="/.."){p.length!==0&&p.pop(),p.push("/");break}if(f[0]==="."){if(f[1]==="."){if(f[2]==="/"){f=f.slice(3);continue}}else if(f[1]==="/"){f=f.slice(2);continue}}else if(f[0]==="/"&&f[1]==="."){if(f[2]==="/"){f=f.slice(2);continue}else if(f[2]==="."&&f[3]==="/"){f=f.slice(3),p.length!==0&&p.pop();continue}}if((x=f.indexOf("/",1))===-1){p.push(f);break}else p.push(f.slice(0,x)),f=f.slice(x)}return p.join("")}function l(h,f){const p=f!==!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 f=[];if(h.userinfo!==void 0&&(f.push(h.userinfo),f.push("@")),h.host!==void 0){let p=unescape(h.host);if(!t(p)){const x=i(p);x.isIPV6===!0?p=`[${x.escapedHost}]`:p=h.host}f.push(p)}return(typeof h.port=="number"||typeof h.port=="string")&&(f.push(":"),f.push(String(h.port))),f.length?f.join(""):void 0}return lx={nonSimpleDomain:r,recomposeAuthority:d,normalizeComponentEncoding:l,removeDotSegments:u,isIPv4:t,isUUID:e,normalizeIPv6:i,stringArrayToHexStripped:n},lx}var dx,NN;function efe(){if(NN)return dx;NN=1;const{isUUID:e}=aF(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function r(w){return n.indexOf(w)!==-1}function s(w){return w.secure===!0?!0:w.secure===!1?!1:w.scheme?w.scheme.length===3&&(w.scheme[0]==="w"||w.scheme[0]==="W")&&(w.scheme[1]==="s"||w.scheme[1]==="S")&&(w.scheme[2]==="s"||w.scheme[2]==="S"):!1}function a(w){return w.host||(w.error=w.error||"HTTP URIs must have a host."),w}function o(w){const v=String(w.scheme).toLowerCase()==="https";return(w.port===(v?443:80)||w.port==="")&&(w.port=void 0),w.path||(w.path="/"),w}function i(w){return w.secure=s(w),w.resourceName=(w.path||"/")+(w.query?"?"+w.query:""),w.path=void 0,w.query=void 0,w}function c(w){if((w.port===(s(w)?443:80)||w.port==="")&&(w.port=void 0),typeof w.secure=="boolean"&&(w.scheme=w.secure?"wss":"ws",w.secure=void 0),w.resourceName){const[v,C]=w.resourceName.split("?");w.path=v&&v!=="/"?v:void 0,w.query=C,w.resourceName=void 0}return w.fragment=void 0,w}function u(w,v){if(!w.path)return w.error="URN can not be parsed",w;const C=w.path.match(t);if(C){const I=v.scheme||w.scheme||"urn";w.nid=C[1].toLowerCase(),w.nss=C[2];const R=`${I}:${v.nid||w.nid}`,N=S(R);w.path=void 0,N&&(w=N.parse(w,v))}else w.error=w.error||"URN can not be parsed.";return w}function l(w,v){if(w.nid===void 0)throw new Error("URN without nid cannot be serialized");const C=v.scheme||w.scheme||"urn",I=w.nid.toLowerCase(),R=`${C}:${v.nid||I}`,N=S(R);N&&(w=N.serialize(w,v));const z=w,V=w.nss;return z.path=`${I||v.nid}:${V}`,v.skipEscape=!0,z}function d(w,v){const C=w;return C.uuid=C.nss,C.nss=void 0,!v.tolerant&&(!C.uuid||!e(C.uuid))&&(C.error=C.error||"UUID is not valid."),C}function h(w){const v=w;return v.nss=(w.uuid||"").toLowerCase(),v}const f={scheme:"http",domainHost:!0,parse:a,serialize:o},p={scheme:"https",domainHost:f.domainHost,parse:a,serialize:o},x={scheme:"ws",domainHost:!0,parse:i,serialize:c},g={scheme:"wss",domainHost:x.domainHost,parse:x.parse,serialize:x.serialize},_={http:f,https:p,ws:x,wss:g,urn:{scheme:"urn",parse:u,serialize:l,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:d,serialize:h,skipNormalize:!0}};Object.setPrototypeOf(_,null);function S(w){return w&&(_[w]||_[w.toLowerCase()])||void 0}return dx={wsIsSecure:s,SCHEMES:_,isValidSchemeName:r,getSchemeHandler:S},dx}var RN;function tfe(){if(RN)return Hd.exports;RN=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:n,normalizeComponentEncoding:r,isIPv4:s,nonSimpleDomain:a}=aF(),{SCHEMES:o,getSchemeHandler:i}=efe();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,y){const _=y?Object.assign({scheme:"null"},y):{scheme:"null"},S=l(p(g,_),p(b,_),_,!0);return _.skipEscape=!0,h(S,_)}function l(g,b,y,_){const S={};return _||(g=p(h(g,y),y),b=p(h(b,y),y)),y=y||{},!y.tolerant&&b.scheme?(S.scheme=b.scheme,S.userinfo=b.userinfo,S.host=b.host,S.port=b.port,S.path=t(b.path||""),S.query=b.query):(b.userinfo!==void 0||b.host!==void 0||b.port!==void 0?(S.userinfo=b.userinfo,S.host=b.host,S.port=b.port,S.path=t(b.path||""),S.query=b.query):(b.path?(b.path[0]==="/"?S.path=t(b.path):((g.userinfo!==void 0||g.host!==void 0||g.port!==void 0)&&!g.path?S.path="/"+b.path:g.path?S.path=g.path.slice(0,g.path.lastIndexOf("/")+1)+b.path:S.path=b.path,S.path=t(S.path)),S.query=b.query):(S.path=g.path,b.query!==void 0?S.query=b.query:S.query=g.query),S.userinfo=g.userinfo,S.host=g.host,S.port=g.port),S.scheme=g.scheme),S.fragment=b.fragment,S}function d(g,b,y){return typeof g=="string"?(g=unescape(g),g=h(r(p(g,y),!0),{...y,skipEscape:!0})):typeof g=="object"&&(g=h(r(g,!0),{...y,skipEscape:!0})),typeof b=="string"?(b=unescape(b),b=h(r(p(b,y),!0),{...y,skipEscape:!0})):typeof b=="object"&&(b=h(r(b,!0),{...y,skipEscape:!0})),g.toLowerCase()===b.toLowerCase()}function h(g,b){const y={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:""},_=Object.assign({},b),S=[],w=i(_.scheme||y.scheme);w&&w.serialize&&w.serialize(y,_),y.path!==void 0&&(_.skipEscape?y.path=unescape(y.path):(y.path=escape(y.path),y.scheme!==void 0&&(y.path=y.path.split("%3A").join(":")))),_.reference!=="suffix"&&y.scheme&&S.push(y.scheme,":");const v=n(y);if(v!==void 0&&(_.reference!=="suffix"&&S.push("//"),S.push(v),y.path&&y.path[0]!=="/"&&S.push("/")),y.path!==void 0){let C=y.path;!_.absolutePath&&(!w||!w.absolutePath)&&(C=t(C)),v===void 0&&C[0]==="/"&&C[1]==="/"&&(C="/%2F"+C.slice(2)),S.push(C)}return y.query!==void 0&&S.push("?",y.query),y.fragment!==void 0&&S.push("#",y.fragment),S.join("")}const f=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function p(g,b){const y=Object.assign({},b),_={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let S=!1;y.reference==="suffix"&&(y.scheme?g=y.scheme+":"+g:g="//"+g);const w=g.match(f);if(w){if(_.scheme=w[1],_.userinfo=w[3],_.host=w[4],_.port=parseInt(w[5],10),_.path=w[6]||"",_.query=w[7],_.fragment=w[8],isNaN(_.port)&&(_.port=w[5]),_.host)if(s(_.host)===!1){const I=e(_.host);_.host=I.host.toLowerCase(),S=I.isIPV6}else S=!0;_.scheme===void 0&&_.userinfo===void 0&&_.host===void 0&&_.port===void 0&&_.query===void 0&&!_.path?_.reference="same-document":_.scheme===void 0?_.reference="relative":_.fragment===void 0?_.reference="absolute":_.reference="uri",y.reference&&y.reference!=="suffix"&&y.reference!==_.reference&&(_.error=_.error||"URI is not a "+y.reference+" reference.");const v=i(y.scheme||_.scheme);if(!y.unicodeSupport&&(!v||!v.unicodeSupport)&&_.host&&(y.domainHost||v&&v.domainHost)&&S===!1&&a(_.host))try{_.host=URL.domainToASCII(_.host.toLowerCase())}catch(C){_.error=_.error||"Host's domain name can not be converted to ASCII: "+C}(!v||v&&!v.skipNormalize)&&(g.indexOf("%")!==-1&&(_.scheme!==void 0&&(_.scheme=unescape(_.scheme)),_.host!==void 0&&(_.host=unescape(_.host))),_.path&&(_.path=escape(unescape(_.path))),_.fragment&&(_.fragment=encodeURI(decodeURIComponent(_.fragment)))),v&&v.parse&&v.parse(_,y)}else _.error=_.error||"URI can not be parsed.";return _}const x={SCHEMES:o,normalize:c,resolve:u,resolveComponent:l,equal:d,serialize:h,parse:p};return Hd.exports=x,Hd.exports.default=x,Hd.exports.fastUri=x,Hd.exports}var PN;function nfe(){if(PN)return fp;PN=1,Object.defineProperty(fp,"__esModule",{value:!0});const e=tfe();return e.code='require("ajv/dist/runtime/uri").default',fp.default=e,fp}var ON;function rfe(){return ON||(ON=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=_1();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=tt();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=OT(),s=v1(),a=nF(),o=w1(),i=tt(),c=x1(),u=w0(),l=ut(),d=Zhe,h=nfe(),f=(T,q)=>new RegExp(T,q);f.code="new RegExp";const p=["removeAdditional","useDefaults","coerceTypes"],x=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.'},y=200;function _(T){var q,X,A,P,D,Y,ke,ye,we,Oe,G,W,ae,ce,_e,Re,H,ie,Se,$e,Je,Gn,hn,Os,Ur;const Z=T.strict,ue=(q=T.code)===null||q===void 0?void 0:q.optimize,Ae=ue===!0||ue===void 0?1:ue||0,Ce=(A=(X=T.code)===null||X===void 0?void 0:X.regExp)!==null&&A!==void 0?A:f,xt=(P=T.uriResolver)!==null&&P!==void 0?P:h.default;return{strictSchema:(Y=(D=T.strictSchema)!==null&&D!==void 0?D:Z)!==null&&Y!==void 0?Y:!0,strictNumbers:(ye=(ke=T.strictNumbers)!==null&&ke!==void 0?ke:Z)!==null&&ye!==void 0?ye:!0,strictTypes:(Oe=(we=T.strictTypes)!==null&&we!==void 0?we:Z)!==null&&Oe!==void 0?Oe:"log",strictTuples:(W=(G=T.strictTuples)!==null&&G!==void 0?G:Z)!==null&&W!==void 0?W:"log",strictRequired:(ce=(ae=T.strictRequired)!==null&&ae!==void 0?ae:Z)!==null&&ce!==void 0?ce:!1,code:T.code?{...T.code,optimize:Ae,regExp:Ce}:{optimize:Ae,regExp:Ce},loopRequired:(_e=T.loopRequired)!==null&&_e!==void 0?_e:y,loopEnum:(Re=T.loopEnum)!==null&&Re!==void 0?Re:y,meta:(H=T.meta)!==null&&H!==void 0?H:!0,messages:(ie=T.messages)!==null&&ie!==void 0?ie:!0,inlineRefs:(Se=T.inlineRefs)!==null&&Se!==void 0?Se:!0,schemaId:($e=T.schemaId)!==null&&$e!==void 0?$e:"$id",addUsedSchema:(Je=T.addUsedSchema)!==null&&Je!==void 0?Je:!0,validateSchema:(Gn=T.validateSchema)!==null&&Gn!==void 0?Gn:!0,validateFormats:(hn=T.validateFormats)!==null&&hn!==void 0?hn:!0,unicodeRegExp:(Os=T.unicodeRegExp)!==null&&Os!==void 0?Os:!0,int32range:(Ur=T.int32range)!==null&&Ur!==void 0?Ur:!0,uriResolver:xt}}class S{constructor(q={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,q=this.opts={...q,..._(q)};const{es5:X,lines:A}=this.opts.code;this.scope=new i.ValueScope({scope:{},prefixes:x,es5:X,lines:A}),this.logger=V(q.logger);const P=q.validateFormats;q.validateFormats=!1,this.RULES=(0,a.getRules)(),w.call(this,g,q,"NOT SUPPORTED"),w.call(this,b,q,"DEPRECATED","warn"),this._metaOpts=N.call(this),q.formats&&I.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),q.keywords&&R.call(this,q.keywords),typeof q.meta=="object"&&this.addMetaSchema(q.meta),C.call(this),q.validateFormats=P}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:q,meta:X,schemaId:A}=this.opts;let P=d;A==="id"&&(P={...d},P.id=P.$id,delete P.$id),X&&q&&this.addMetaSchema(P,P[A],!1)}defaultMeta(){const{meta:q,schemaId:X}=this.opts;return this.opts.defaultMeta=typeof q=="object"?q[X]||q:void 0}validate(q,X){let A;if(typeof q=="string"){if(A=this.getSchema(q),!A)throw new Error(`no schema with key or ref "${q}"`)}else A=this.compile(q);const P=A(X);return"$async"in A||(this.errors=A.errors),P}compile(q,X){const A=this._addSchema(q,X);return A.validate||this._compileSchemaEnv(A)}compileAsync(q,X){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:A}=this.opts;return P.call(this,q,X);async function P(Oe,G){await D.call(this,Oe.$schema);const W=this._addSchema(Oe,G);return W.validate||Y.call(this,W)}async function D(Oe){Oe&&!this.getSchema(Oe)&&await P.call(this,{$ref:Oe},!0)}async function Y(Oe){try{return this._compileSchemaEnv(Oe)}catch(G){if(!(G instanceof s.default))throw G;return ke.call(this,G),await ye.call(this,G.missingSchema),Y.call(this,Oe)}}function ke({missingSchema:Oe,missingRef:G}){if(this.refs[Oe])throw new Error(`AnySchema ${Oe} is loaded but ${G} cannot be resolved`)}async function ye(Oe){const G=await we.call(this,Oe);this.refs[Oe]||await D.call(this,G.$schema),this.refs[Oe]||this.addSchema(G,Oe,X)}async function we(Oe){const G=this._loading[Oe];if(G)return G;try{return await(this._loading[Oe]=A(Oe))}finally{delete this._loading[Oe]}}}addSchema(q,X,A,P=this.opts.validateSchema){if(Array.isArray(q)){for(const Y of q)this.addSchema(Y,void 0,A,P);return this}let D;if(typeof q=="object"){const{schemaId:Y}=this.opts;if(D=q[Y],D!==void 0&&typeof D!="string")throw new Error(`schema ${Y} must be string`)}return X=(0,c.normalizeId)(X||D),this._checkUnique(X),this.schemas[X]=this._addSchema(q,A,X,P,!0),this}addMetaSchema(q,X,A=this.opts.validateSchema){return this.addSchema(q,X,!0,A),this}validateSchema(q,X){if(typeof q=="boolean")return!0;let A;if(A=q.$schema,A!==void 0&&typeof A!="string")throw new Error("$schema must be a string");if(A=A||this.opts.defaultMeta||this.defaultMeta(),!A)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const P=this.validate(A,q);if(!P&&X){const D="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(D);else throw new Error(D)}return P}getSchema(q){let X;for(;typeof(X=v.call(this,q))=="string";)q=X;if(X===void 0){const{schemaId:A}=this.opts,P=new o.SchemaEnv({schema:{},schemaId:A});if(X=o.resolveSchema.call(this,P,q),!X)return;this.refs[q]=X}return X.validate||this._compileSchemaEnv(X)}removeSchema(q){if(q instanceof RegExp)return this._removeAllSchemas(this.schemas,q),this._removeAllSchemas(this.refs,q),this;switch(typeof q){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const X=v.call(this,q);return typeof X=="object"&&this._cache.delete(X.schema),delete this.schemas[q],delete this.refs[q],this}case"object":{const X=q;this._cache.delete(X);let A=q[this.opts.schemaId];return A&&(A=(0,c.normalizeId)(A),delete this.schemas[A],delete this.refs[A]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(q){for(const X of q)this.addKeyword(X);return this}addKeyword(q,X){let A;if(typeof q=="string")A=q,typeof X=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),X.keyword=A);else if(typeof q=="object"&&X===void 0){if(X=q,A=X.keyword,Array.isArray(A)&&!A.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(J.call(this,A,X),!X)return(0,l.eachItem)(A,D=>te.call(this,D)),this;oe.call(this,X);const P={...X,type:(0,u.getJSONTypes)(X.type),schemaType:(0,u.getJSONTypes)(X.schemaType)};return(0,l.eachItem)(A,P.type.length===0?D=>te.call(this,D,P):D=>P.type.forEach(Y=>te.call(this,D,P,Y))),this}getKeyword(q){const X=this.RULES.all[q];return typeof X=="object"?X.definition:!!X}removeKeyword(q){const{RULES:X}=this;delete X.keywords[q],delete X.all[q];for(const A of X.rules){const P=A.rules.findIndex(D=>D.keyword===q);P>=0&&A.rules.splice(P,1)}return this}addFormat(q,X){return typeof X=="string"&&(X=new RegExp(X)),this.formats[q]=X,this}errorsText(q=this.errors,{separator:X=", ",dataVar:A="data"}={}){return!q||q.length===0?"No errors":q.map(P=>`${A}${P.instancePath} ${P.message}`).reduce((P,D)=>P+X+D)}$dataMetaSchema(q,X){const A=this.RULES.all;q=JSON.parse(JSON.stringify(q));for(const P of X){const D=P.split("/").slice(1);let Y=q;for(const ke of D)Y=Y[ke];for(const ke in A){const ye=A[ke];if(typeof ye!="object")continue;const{$data:we}=ye.definition,Oe=Y[ke];we&&Oe&&(Y[ke]=Xe(Oe))}}return q}_removeAllSchemas(q,X){for(const A in q){const P=q[A];(!X||X.test(A))&&(typeof P=="string"?delete q[A]:P&&!P.meta&&(this._cache.delete(P.schema),delete q[A]))}}_addSchema(q,X,A,P=this.opts.validateSchema,D=this.opts.addUsedSchema){let Y;const{schemaId:ke}=this.opts;if(typeof q=="object")Y=q[ke];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof q!="boolean")throw new Error("schema must be object or boolean")}let ye=this._cache.get(q);if(ye!==void 0)return ye;A=(0,c.normalizeId)(Y||A);const we=c.getSchemaRefs.call(this,q,A);return ye=new o.SchemaEnv({schema:q,schemaId:ke,meta:X,baseId:A,localRefs:we}),this._cache.set(ye.schema,ye),D&&!A.startsWith("#")&&(A&&this._checkUnique(A),this.refs[A]=ye),P&&this.validateSchema(q,!0),ye}_checkUnique(q){if(this.schemas[q]||this.refs[q])throw new Error(`schema with key or id "${q}" already exists`)}_compileSchemaEnv(q){if(q.meta?this._compileMetaSchema(q):o.compileSchema.call(this,q),!q.validate)throw new Error("ajv implementation error");return q.validate}_compileMetaSchema(q){const X=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,q)}finally{this.opts=X}}}S.ValidationError=r.default,S.MissingRefError=s.default,e.default=S;function w(T,q,X,A="error"){for(const P in T){const D=P;D in q&&this.logger[A](`${X}: option ${P}. ${T[D]}`)}}function v(T){return T=(0,c.normalizeId)(T),this.schemas[T]||this.refs[T]}function C(){const T=this.opts.schemas;if(T)if(Array.isArray(T))this.addSchema(T);else for(const q in T)this.addSchema(T[q],q)}function I(){for(const T in this.opts.formats){const q=this.opts.formats[T];q&&this.addFormat(T,q)}}function R(T){if(Array.isArray(T)){this.addVocabulary(T);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const q in T){const X=T[q];X.keyword||(X.keyword=q),this.addKeyword(X)}}function N(){const T={...this.opts};for(const q of p)delete T[q];return T}const z={log(){},warn(){},error(){}};function V(T){if(T===!1)return z;if(T===void 0)return console;if(T.log&&T.warn&&T.error)return T;throw new Error("logger must implement log, warn and error methods")}const ne=/^[a-z_$][a-z0-9_$:-]*$/i;function J(T,q){const{RULES:X}=this;if((0,l.eachItem)(T,A=>{if(X.keywords[A])throw new Error(`Keyword ${A} is already defined`);if(!ne.test(A))throw new Error(`Keyword ${A} has invalid name`)}),!!q&&q.$data&&!("code"in q||"validate"in q))throw new Error('$data keyword must have "code" or "validate" function')}function te(T,q,X){var A;const P=q?.post;if(X&&P)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:D}=this;let Y=P?D.post:D.rules.find(({type:ye})=>ye===X);if(Y||(Y={type:X,rules:[]},D.rules.push(Y)),D.keywords[T]=!0,!q)return;const ke={keyword:T,definition:{...q,type:(0,u.getJSONTypes)(q.type),schemaType:(0,u.getJSONTypes)(q.schemaType)}};q.before?se.call(this,Y,ke,q.before):Y.rules.push(ke),D.all[T]=ke,(A=q.implements)===null||A===void 0||A.forEach(ye=>this.addKeyword(ye))}function se(T,q,X){const A=T.rules.findIndex(P=>P.keyword===X);A>=0?T.rules.splice(A,0,q):(T.rules.push(q),this.logger.warn(`rule ${X} is not defined`))}function oe(T){let{metaSchema:q}=T;q!==void 0&&(T.$data&&this.opts.$data&&(q=Xe(q)),T.validateSchema=this.compile(q,!0))}const me={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Xe(T){return{anyOf:[T,me]}}})(rx)),rx}var mp={},pp={},gp={},LN;function sfe(){if(LN)return gp;LN=1,Object.defineProperty(gp,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return gp.default=e,gp}var Po={},$N;function LT(){if($N)return Po;$N=1,Object.defineProperty(Po,"__esModule",{value:!0}),Po.callRef=Po.getValidate=void 0;const e=v1(),t=ca(),n=tt(),r=ia(),s=w1(),a=ut(),o={keyword:"$ref",schemaType:"string",code(u){const{gen:l,schema:d,it:h}=u,{baseId:f,schemaEnv:p,validateName:x,opts:g,self:b}=h,{root:y}=p;if((d==="#"||d==="#/")&&f===y.baseId)return S();const _=s.resolveRef.call(b,y,f,d);if(_===void 0)throw new e.default(h.opts.uriResolver,f,d);if(_ instanceof s.SchemaEnv)return w(_);return v(_);function S(){if(p===y)return c(u,x,p,p.$async);const C=l.scopeValue("root",{ref:y});return c(u,(0,n._)`${C}.validate`,y,y.$async)}function w(C){const I=i(u,C);c(u,I,C,C.$async)}function v(C){const I=l.scopeValue("schema",g.code.source===!0?{ref:C,code:(0,n.stringify)(C)}:{ref:C}),R=l.name("valid"),N=u.subschema({schema:C,dataTypes:[],schemaPath:n.nil,topSchemaRef:I,errSchemaPath:d},R);u.mergeEvaluated(N),u.ok(R)}}};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`}Po.getValidate=i;function c(u,l,d,h){const{gen:f,it:p}=u,{allErrors:x,schemaEnv:g,opts:b}=p,y=b.passContext?r.default.this:n.nil;h?_():S();function _(){if(!g.$async)throw new Error("async schema referenced by sync schema");const C=f.let("valid");f.try(()=>{f.code((0,n._)`await ${(0,t.callValidateCode)(u,l,y)}`),v(l),x||f.assign(C,!0)},I=>{f.if((0,n._)`!(${I} instanceof ${p.ValidationError})`,()=>f.throw(I)),w(I),x||f.assign(C,!1)}),u.ok(C)}function S(){u.result((0,t.callValidateCode)(u,l,y),()=>v(l),()=>w(l))}function w(C){const I=(0,n._)`${C}.errors`;f.assign(r.default.vErrors,(0,n._)`${r.default.vErrors} === null ? ${I} : ${r.default.vErrors}.concat(${I})`),f.assign(r.default.errors,(0,n._)`${r.default.vErrors}.length`)}function v(C){var I;if(!p.opts.unevaluated)return;const R=(I=d?.validate)===null||I===void 0?void 0:I.evaluated;if(p.props!==!0)if(R&&!R.dynamicProps)R.props!==void 0&&(p.props=a.mergeEvaluated.props(f,R.props,p.props));else{const N=f.var("props",(0,n._)`${C}.evaluated.props`);p.props=a.mergeEvaluated.props(f,N,p.props,n.Name)}if(p.items!==!0)if(R&&!R.dynamicItems)R.items!==void 0&&(p.items=a.mergeEvaluated.items(f,R.items,p.items));else{const N=f.var("items",(0,n._)`${C}.evaluated.items`);p.items=a.mergeEvaluated.items(f,N,p.items,n.Name)}}}return Po.callRef=c,Po.default=o,Po}var MN;function afe(){if(MN)return pp;MN=1,Object.defineProperty(pp,"__esModule",{value:!0});const e=sfe(),t=LT(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return pp.default=n,pp}var bp={},yp={},jN;function ofe(){if(jN)return yp;jN=1,Object.defineProperty(yp,"__esModule",{value:!0});const e=tt(),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 yp.default=s,yp}var kp={},DN;function ife(){if(DN)return kp;DN=1,Object.defineProperty(kp,"__esModule",{value:!0});const e=tt(),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 kp.default=n,kp}var xp={},_p={},FN;function cfe(){if(FN)return _p;FN=1,Object.defineProperty(_p,"__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 _p.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',_p}var BN;function ufe(){if(BN)return xp;BN=1,Object.defineProperty(xp,"__esModule",{value:!0});const e=tt(),t=ut(),n=cfe(),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 xp.default=s,xp}var vp={},zN;function lfe(){if(zN)return vp;zN=1,Object.defineProperty(vp,"__esModule",{value:!0});const e=ca(),t=ut(),n=tt(),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:f}=d.opts.code,p=f.code==="new RegExp"?(0,n._)`new RegExp`:(0,t.useFunc)(o,f),x=o.let("valid");o.try(()=>o.assign(x,(0,n._)`${p}(${l}, ${h}).test(${i})`),()=>o.assign(x,!1)),a.fail$data((0,n._)`!${x}`)}else{const f=(0,e.usePattern)(a,u);a.fail$data((0,n._)`!${f}.test(${i})`)}}};return vp.default=s,vp}var wp={},UN;function dfe(){if(UN)return wp;UN=1,Object.defineProperty(wp,"__esModule",{value:!0});const e=tt(),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 wp.default=n,wp}var Sp={},HN;function hfe(){if(HN)return Sp;HN=1,Object.defineProperty(Sp,"__esModule",{value:!0});const e=ca(),t=tt(),n=ut(),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 f=i.length>=h.loopRequired;if(d.allErrors?p():x(),h.strictRequired){const y=a.parentSchema.properties,{definedProperties:_}=a.it;for(const S of i)if(y?.[S]===void 0&&!_.has(S)){const w=d.schemaEnv.baseId+d.errSchemaPath,v=`required property "${S}" is not defined at "${w}" (strictRequired)`;(0,n.checkStrictMode)(d,v,d.opts.strictRequired)}}function p(){if(f||l)a.block$data(t.nil,g);else for(const y of i)(0,e.checkReportMissingProp)(a,y)}function x(){const y=o.let("missing");if(f||l){const _=o.let("valid",!0);a.block$data(_,()=>b(y,_)),a.ok(_)}else o.if((0,e.checkMissingProp)(a,i,y)),(0,e.reportMissingProp)(a,y),o.else()}function g(){o.forOf("prop",c,y=>{a.setParams({missingProperty:y}),o.if((0,e.noPropertyInData)(o,u,y,h.ownProperties),()=>a.error())})}function b(y,_){a.setParams({missingProperty:y}),o.forOf(y,c,()=>{o.assign(_,(0,e.propertyInData)(o,u,y,h.ownProperties)),o.if((0,t.not)(_),()=>{a.error(),o.break()})},t.nil)}}};return Sp.default=s,Sp}var Ep={},qN;function ffe(){if(qN)return Ep;qN=1,Object.defineProperty(Ep,"__esModule",{value:!0});const e=tt(),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 Ep.default=n,Ep}var Tp={},Cp={},VN;function $T(){if(VN)return Cp;VN=1,Object.defineProperty(Cp,"__esModule",{value:!0});const e=sF();return e.code='require("ajv/dist/runtime/equal").default',Cp.default=e,Cp}var GN;function mfe(){if(GN)return Tp;GN=1,Object.defineProperty(Tp,"__esModule",{value:!0});const e=w0(),t=tt(),n=ut(),r=$T(),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:f}=o;if(!u&&!l)return;const p=i.let("valid"),x=d.items?(0,e.getSchemaTypes)(d.items):[];o.block$data(p,g,(0,t._)`${h} === false`),o.ok(p);function g(){const S=i.let("i",(0,t._)`${c}.length`),w=i.let("j");o.setParams({i:S,j:w}),i.assign(p,!0),i.if((0,t._)`${S} > 1`,()=>(b()?y:_)(S,w))}function b(){return x.length>0&&!x.some(S=>S==="object"||S==="array")}function y(S,w){const v=i.name("item"),C=(0,e.checkDataTypes)(x,v,f.opts.strictNumbers,e.DataType.Wrong),I=i.const("indices",(0,t._)`{}`);i.for((0,t._)`;${S}--;`,()=>{i.let(v,(0,t._)`${c}[${S}]`),i.if(C,(0,t._)`continue`),x.length>1&&i.if((0,t._)`typeof ${v} == "string"`,(0,t._)`${v} += "_"`),i.if((0,t._)`typeof ${I}[${v}] == "number"`,()=>{i.assign(w,(0,t._)`${I}[${v}]`),o.error(),i.assign(p,!1).break()}).code((0,t._)`${I}[${v}] = ${S}`)})}function _(S,w){const v=(0,n.useFunc)(i,r.default),C=i.name("outer");i.label(C).for((0,t._)`;${S}--;`,()=>i.for((0,t._)`${w} = ${S}; ${w}--;`,()=>i.if((0,t._)`${v}(${c}[${S}], ${c}[${w}])`,()=>{o.error(),i.assign(p,!1).break(C)})))}}};return Tp.default=a,Tp}var Ip={},KN;function pfe(){if(KN)return Ip;KN=1,Object.defineProperty(Ip,"__esModule",{value:!0});const e=tt(),t=ut(),n=$T(),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 Ip.default=s,Ip}var Ap={},WN;function gfe(){if(WN)return Ap;WN=1,Object.defineProperty(Ap,"__esModule",{value:!0});const e=tt(),t=ut(),n=$T(),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 f;const p=()=>f??(f=(0,t.useFunc)(o,n.default));let x;if(h||c)x=o.let("valid"),a.block$data(x,g);else{if(!Array.isArray(u))throw new Error("ajv implementation error");const y=o.const("vSchema",l);x=(0,e.or)(...u.map((_,S)=>b(y,S)))}a.pass(x);function g(){o.assign(x,!1),o.forOf("v",l,y=>o.if((0,e._)`${p()}(${i}, ${y})`,()=>o.assign(x,!0).break()))}function b(y,_){const S=u[_];return typeof S=="object"&&S!==null?(0,e._)`${p()}(${i}, ${y}[${_}])`:(0,e._)`${i} === ${S}`}}};return Ap.default=s,Ap}var YN;function bfe(){if(YN)return bp;YN=1,Object.defineProperty(bp,"__esModule",{value:!0});const e=ofe(),t=ife(),n=ufe(),r=lfe(),s=dfe(),a=hfe(),o=ffe(),i=mfe(),c=pfe(),u=gfe(),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 bp.default=l,bp}var Np={},wu={},JN;function oF(){if(JN)return wu;JN=1,Object.defineProperty(wu,"__esModule",{value:!0}),wu.validateAdditionalItems=void 0;const e=tt(),t=ut(),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),()=>f(p)),a.ok(p)}function f(p){i.forRange("i",o.length,h,x=>{a.subschema({keyword:l,dataProp:x,dataPropType:t.Type.Num},p),d.allErrors||i.if((0,e.not)(p),()=>i.break())})}}return wu.validateAdditionalItems=s,wu.default=r,wu}var Rp={},Su={},QN;function iF(){if(QN)return Su;QN=1,Object.defineProperty(Su,"__esModule",{value:!0}),Su.validateTuple=void 0;const e=tt(),t=ut(),n=ca(),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;x(u),h.opts.unevaluated&&i.length&&h.items!==!0&&(h.items=t.mergeEvaluated.items(c,i.length,h.items));const f=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},f)),a.ok(f))});function x(g){const{opts:b,errSchemaPath:y}=h,_=i.length,S=_===g.minItems&&(_===g.maxItems||g[o]===!1);if(b.strictTuples&&!S){const w=`"${d}" is ${_}-tuple, but minItems or maxItems/${o} are not specified or different at path "${y}"`;(0,t.checkStrictMode)(h,w,b.strictTuples)}}}return Su.validateTuple=s,Su.default=r,Su}var XN;function yfe(){if(XN)return Rp;XN=1,Object.defineProperty(Rp,"__esModule",{value:!0});const e=iF(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,e.validateTuple)(n,"items")};return Rp.default=t,Rp}var Pp={},ZN;function kfe(){if(ZN)return Pp;ZN=1,Object.defineProperty(Pp,"__esModule",{value:!0});const e=tt(),t=ut(),n=ca(),r=oF(),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 Pp.default=a,Pp}var Op={},eR;function xfe(){if(eR)return Op;eR=1,Object.defineProperty(Op,"__esModule",{value:!0});const e=tt(),t=ut(),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:f}=i;u.opts.next?(l=h===void 0?1:h,d=f):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 _=(0,e._)`${p} >= ${l}`;d!==void 0&&(_=(0,e._)`${_} && ${p} <= ${d}`),s.pass(_);return}u.items=!0;const x=a.name("valid");d===void 0&&l===1?b(x,()=>a.if(x,()=>a.break())):l===0?(a.let(x,!0),d!==void 0&&a.if((0,e._)`${c}.length > 0`,g)):(a.let(x,!1),g()),s.result(x,()=>s.reset());function g(){const _=a.name("_valid"),S=a.let("count",0);b(_,()=>a.if(_,()=>y(S)))}function b(_,S){a.forRange("i",0,p,w=>{s.subschema({keyword:"contains",dataProp:w,dataPropType:t.Type.Num,compositeRule:!0},_),S()})}function y(_){a.code((0,e._)`${_}++`),d===void 0?a.if((0,e._)`${_} >= ${l}`,()=>a.assign(x,!0).break()):(a.if((0,e._)`${_} > ${d}`,()=>a.assign(x,!1).break()),l===1?a.assign(x,!0):a.if((0,e._)`${_} >= ${l}`,()=>a.assign(x,!0)))}}};return Op.default=r,Op}var hx={},tR;function MT(){return tR||(tR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=tt(),n=ut(),r=ca();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 f=l.let("missing");for(const p in u){const x=u[p];if(x.length===0)continue;const g=(0,r.propertyInData)(l,d,p,h.opts.ownProperties);c.setParams({property:p,depsCount:x.length,deps:x.join(", ")}),h.allErrors?l.if(g,()=>{for(const b of x)(0,r.checkReportMissingProp)(c,b)}):(l.if((0,t._)`${g} && (${(0,r.checkMissingProp)(c,x,f)})`),(0,r.reportMissingProp)(c,f),l.else())}}e.validatePropertyDeps=o;function i(c,u=c.schema){const{gen:l,data:d,keyword:h,it:f}=c,p=l.name("valid");for(const x in u)(0,n.alwaysValidSchema)(f,u[x])||(l.if((0,r.propertyInData)(l,d,x,f.opts.ownProperties),()=>{const g=c.subschema({keyword:h,schemaProp:x},p);c.mergeValidEvaluated(g,p)},()=>l.var(p,!0)),c.ok(p))}e.validateSchemaDeps=i,e.default=s})(hx)),hx}var Lp={},nR;function _fe(){if(nR)return Lp;nR=1,Object.defineProperty(Lp,"__esModule",{value:!0});const e=tt(),t=ut(),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 Lp.default=r,Lp}var $p={},rR;function cF(){if(rR)return $p;rR=1,Object.defineProperty($p,"__esModule",{value:!0});const e=ca(),t=tt(),n=ia(),r=ut(),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:f,opts:p}=h;if(h.props=!0,p.removeAdditional!=="all"&&(0,r.alwaysValidSchema)(h,c))return;const x=(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,v=>{!x.length&&!g.length?S(v):i.if(y(v),()=>S(v))})}function y(v){let C;if(x.length>8){const I=(0,r.schemaRefOrVal)(h,u.properties,"properties");C=(0,e.isOwnProperty)(i,I,v)}else x.length?C=(0,t.or)(...x.map(I=>(0,t._)`${v} === ${I}`)):C=t.nil;return g.length&&(C=(0,t.or)(C,...g.map(I=>(0,t._)`${(0,e.usePattern)(o,I)}.test(${v})`))),(0,t.not)(C)}function _(v){i.code((0,t._)`delete ${l}[${v}]`)}function S(v){if(p.removeAdditional==="all"||p.removeAdditional&&c===!1){_(v);return}if(c===!1){o.setParams({additionalProperty:v}),o.error(),f||i.break();return}if(typeof c=="object"&&!(0,r.alwaysValidSchema)(h,c)){const C=i.name("valid");p.removeAdditional==="failing"?(w(v,C,!1),i.if((0,t.not)(C),()=>{o.reset(),_(v)})):(w(v,C),f||i.if((0,t.not)(C),()=>i.break()))}}function w(v,C,I){const R={keyword:"additionalProperties",dataProp:v,dataPropType:r.Type.Str};I===!1&&Object.assign(R,{compositeRule:!0,createErrors:!1,allErrors:!1}),o.subschema(R,C)}}};return $p.default=a,$p}var Mp={},sR;function vfe(){if(sR)return Mp;sR=1,Object.defineProperty(Mp,"__esModule",{value:!0});const e=_1(),t=ca(),n=ut(),r=cF(),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 f=o.name("valid");for(const g of h)p(g)?x(g):(o.if((0,t.propertyInData)(o,u,g,l.opts.ownProperties)),x(g),l.allErrors||o.else().var(f,!0),o.endIf()),a.it.definedProperties.add(g),a.ok(f);function p(g){return l.opts.useDefaults&&!l.compositeRule&&i[g].default!==void 0}function x(g){a.subschema({keyword:"properties",schemaProp:g,dataProp:g},f)}}};return Mp.default=s,Mp}var jp={},aR;function wfe(){if(aR)return jp;aR=1,Object.defineProperty(jp,"__esModule",{value:!0});const e=ca(),t=tt(),n=ut(),r=ut(),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),f=h.filter(S=>(0,n.alwaysValidSchema)(l,i[S]));if(h.length===0||f.length===h.length&&(!l.opts.unevaluated||l.props===!0))return;const p=d.strictSchema&&!d.allowMatchingProperties&&u.properties,x=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 S of h)p&&y(S),l.allErrors?_(S):(o.var(x,!0),_(S),o.if(x))}function y(S){for(const w in p)new RegExp(S).test(w)&&(0,n.checkStrictMode)(l,`property ${w} matches pattern ${S} (use allowMatchingProperties)`)}function _(S){o.forIn("key",c,w=>{o.if((0,t._)`${(0,e.usePattern)(a,S)}.test(${w})`,()=>{const v=f.includes(S);v||a.subschema({keyword:"patternProperties",schemaProp:S,dataProp:w,dataPropType:r.Type.Str},x),l.opts.unevaluated&&g!==!0?o.assign((0,t._)`${g}[${w}]`,!0):!v&&!l.allErrors&&o.if((0,t.not)(x),()=>o.break())})})}}};return jp.default=s,jp}var Dp={},oR;function Sfe(){if(oR)return Dp;oR=1,Object.defineProperty(Dp,"__esModule",{value:!0});const e=ut(),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 Dp.default=t,Dp}var Fp={},iR;function Efe(){if(iR)return Fp;iR=1,Object.defineProperty(Fp,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ca().validateUnion,error:{message:"must match a schema in anyOf"}};return Fp.default=t,Fp}var Bp={},cR;function Tfe(){if(cR)return Bp;cR=1,Object.defineProperty(Bp,"__esModule",{value:!0});const e=tt(),t=ut(),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(f),s.result(l,()=>s.reset(),()=>s.error(!0));function f(){u.forEach((p,x)=>{let g;(0,t.alwaysValidSchema)(c,p)?a.var(h,!0):g=s.subschema({keyword:"oneOf",schemaProp:x,compositeRule:!0},h),x>0&&a.if((0,e._)`${h} && ${l}`).assign(l,!1).assign(d,(0,e._)`[${d}, ${x}]`).else(),a.if(h,()=>{a.assign(l,!0),a.assign(d,x),g&&s.mergeEvaluated(g,e.Name)})})}}};return Bp.default=r,Bp}var zp={},uR;function Cfe(){if(uR)return zp;uR=1,Object.defineProperty(zp,"__esModule",{value:!0});const e=ut(),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 zp.default=t,zp}var Up={},lR;function Ife(){if(lR)return Up;lR=1,Object.defineProperty(Up,"__esModule",{value:!0});const e=tt(),t=ut(),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(f(),a.reset(),u&&l){const x=o.let("ifClause");a.setParams({ifClause:x}),o.if(h,p("then",x),p("else",x))}else u?o.if(h,p("then")):o.if((0,e.not)(h),p("else"));a.pass(d,()=>a.error(!0));function f(){const x=a.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);a.mergeEvaluated(x)}function p(x,g){return()=>{const b=a.subschema({keyword:x},h);o.assign(d,h),a.mergeValidEvaluated(b,d),g?o.assign(g,(0,e._)`${x}`):a.setParams({ifClause:x})}}}};function s(a,o){const i=a.schema[o];return i!==void 0&&!(0,t.alwaysValidSchema)(a,i)}return Up.default=r,Up}var Hp={},dR;function Afe(){if(dR)return Hp;dR=1,Object.defineProperty(Hp,"__esModule",{value:!0});const e=ut(),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 Hp.default=t,Hp}var hR;function Nfe(){if(hR)return Np;hR=1,Object.defineProperty(Np,"__esModule",{value:!0});const e=oF(),t=yfe(),n=iF(),r=kfe(),s=xfe(),a=MT(),o=_fe(),i=cF(),c=vfe(),u=wfe(),l=Sfe(),d=Efe(),h=Tfe(),f=Cfe(),p=Ife(),x=Afe();function g(b=!1){const y=[l.default,d.default,h.default,f.default,p.default,x.default,o.default,i.default,a.default,c.default,u.default];return b?y.push(t.default,r.default):y.push(e.default,n.default),y.push(s.default),y}return Np.default=g,Np}var qp={},Eu={},fR;function uF(){if(fR)return Eu;fR=1,Object.defineProperty(Eu,"__esModule",{value:!0}),Eu.dynamicAnchor=void 0;const e=tt(),t=ia(),n=w1(),r=LT(),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))}Eu.dynamicAnchor=a;function o(i){const{schemaEnv:c,schema:u,self:l}=i.it,{root:d,baseId:h,localRefs:f,meta:p}=c.root,{schemaId:x}=l.opts,g=new n.SchemaEnv({schema:u,schemaId:x,root:d,baseId:h,localRefs:f,meta:p});return n.compileSchema.call(l,g),(0,r.getValidate)(i,g)}return Eu.default=s,Eu}var Tu={},mR;function lF(){if(mR)return Tu;mR=1,Object.defineProperty(Tu,"__esModule",{value:!0}),Tu.dynamicRef=void 0;const e=tt(),t=ia(),n=LT(),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 f=i.let("valid",!1);d(f),a.ok(f)}function d(f){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,f),h(u.validateName,f))}else h(u.validateName,f)()}function h(f,p){return p?()=>i.block(()=>{(0,n.callRef)(a,f),i.let(p,!0)}):()=>(0,n.callRef)(a,f)}}return Tu.dynamicRef=s,Tu.default=r,Tu}var Vp={},pR;function Rfe(){if(pR)return Vp;pR=1,Object.defineProperty(Vp,"__esModule",{value:!0});const e=uF(),t=ut(),n={keyword:"$recursiveAnchor",schemaType:"boolean",code(r){r.schema?(0,e.dynamicAnchor)(r,""):(0,t.checkStrictMode)(r.it,"$recursiveAnchor: false is ignored")}};return Vp.default=n,Vp}var Gp={},gR;function Pfe(){if(gR)return Gp;gR=1,Object.defineProperty(Gp,"__esModule",{value:!0});const e=lF(),t={keyword:"$recursiveRef",schemaType:"string",code:n=>(0,e.dynamicRef)(n,n.schema)};return Gp.default=t,Gp}var bR;function Ofe(){if(bR)return qp;bR=1,Object.defineProperty(qp,"__esModule",{value:!0});const e=uF(),t=lF(),n=Rfe(),r=Pfe(),s=[e.default,t.default,n.default,r.default];return qp.default=s,qp}var Kp={},Wp={},yR;function Lfe(){if(yR)return Wp;yR=1,Object.defineProperty(Wp,"__esModule",{value:!0});const e=MT(),t={keyword:"dependentRequired",type:"object",schemaType:"object",error:e.error,code:n=>(0,e.validatePropertyDeps)(n)};return Wp.default=t,Wp}var Yp={},kR;function $fe(){if(kR)return Yp;kR=1,Object.defineProperty(Yp,"__esModule",{value:!0});const e=MT(),t={keyword:"dependentSchemas",type:"object",schemaType:"object",code:n=>(0,e.validateSchemaDeps)(n)};return Yp.default=t,Yp}var Jp={},xR;function Mfe(){if(xR)return Jp;xR=1,Object.defineProperty(Jp,"__esModule",{value:!0});const e=ut(),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 Jp.default=t,Jp}var _R;function jfe(){if(_R)return Kp;_R=1,Object.defineProperty(Kp,"__esModule",{value:!0});const e=Lfe(),t=$fe(),n=Mfe(),r=[e.default,t.default,n.default];return Kp.default=r,Kp}var Qp={},Xp={},vR;function Dfe(){if(vR)return Xp;vR=1,Object.defineProperty(Xp,"__esModule",{value:!0});const e=tt(),t=ut(),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),()=>f(g)))):h!==!0&&o.forIn("key",c,g=>h===void 0?f(g):o.if(x(h,g),()=>f(g))),l.props=!0,a.ok((0,e._)`${u} === ${n.default.errors}`);function f(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 x(g,b){const y=[];for(const _ in g)g[_]===!0&&y.push((0,e._)`${b} !== ${_}`);return(0,e.and)(...y)}}};return Xp.default=s,Xp}var Zp={},wR;function Ffe(){if(wR)return Zp;wR=1,Object.defineProperty(Zp,"__esModule",{value:!0});const e=tt(),t=ut(),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,f){a.forRange("i",f,l,p=>{s.subschema({keyword:"unevaluatedItems",dataProp:p,dataPropType:t.Type.Num},h),c.allErrors||a.if((0,e.not)(h),()=>a.break())})}}};return Zp.default=r,Zp}var SR;function Bfe(){if(SR)return Qp;SR=1,Object.defineProperty(Qp,"__esModule",{value:!0});const e=Dfe(),t=Ffe(),n=[e.default,t.default];return Qp.default=n,Qp}var eg={},tg={},ER;function zfe(){if(ER)return tg;ER=1,Object.defineProperty(tg,"__esModule",{value:!0});const e=tt(),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:f,self:p}=l;if(!d.validateFormats)return;i?x():g();function x(){const b=a.scopeValue("formats",{ref:p.formats,code:d.code.formats}),y=a.const("fDef",(0,e._)`${b}[${u}]`),_=a.let("fType"),S=a.let("format");a.if((0,e._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>a.assign(_,(0,e._)`${y}.type || "string"`).assign(S,(0,e._)`${y}.validate`),()=>a.assign(_,(0,e._)`"string"`).assign(S,y)),r.fail$data((0,e.or)(w(),v()));function w(){return d.strictSchema===!1?e.nil:(0,e._)`${u} && !${S}`}function v(){const C=f.$async?(0,e._)`(${y}.async ? await ${S}(${o}) : ${S}(${o}))`:(0,e._)`${S}(${o})`,I=(0,e._)`(typeof ${S} == "function" ? ${C} : ${S}.test(${o}))`;return(0,e._)`${S} && ${S} !== true && ${_} === ${s} && !${I}`}}function g(){const b=p.formats[c];if(!b){w();return}if(b===!0)return;const[y,_,S]=v(b);y===s&&r.pass(C());function w(){if(d.strictSchema===!1){p.logger.warn(I());return}throw new Error(I());function I(){return`unknown format "${c}" ignored in schema at path "${h}"`}}function v(I){const R=I instanceof RegExp?(0,e.regexpCode)(I):d.code.formats?(0,e._)`${d.code.formats}${(0,e.getProperty)(c)}`:void 0,N=a.scopeValue("formats",{key:c,ref:I,code:R});return typeof I=="object"&&!(I instanceof RegExp)?[I.type||"string",I.validate,(0,e._)`${N}.validate`]:["string",I,N]}function C(){if(typeof b=="object"&&!(b instanceof RegExp)&&b.async){if(!f.$async)throw new Error("async format in sync schema");return(0,e._)`await ${S}(${o})`}return typeof _=="function"?(0,e._)`${S}(${o})`:(0,e._)`${S}.test(${o})`}}}};return tg.default=n,tg}var TR;function Ufe(){if(TR)return eg;TR=1,Object.defineProperty(eg,"__esModule",{value:!0});const t=[zfe().default];return eg.default=t,eg}var Ui={},CR;function Hfe(){return CR||(CR=1,Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.contentVocabulary=Ui.metadataVocabulary=void 0,Ui.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Ui.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Ui}var IR;function qfe(){if(IR)return mp;IR=1,Object.defineProperty(mp,"__esModule",{value:!0});const e=afe(),t=bfe(),n=Nfe(),r=Ofe(),s=jfe(),a=Bfe(),o=Ufe(),i=Hfe(),c=[r.default,e.default,t.default,(0,n.default)(!0),o.default,i.metadataVocabulary,i.contentVocabulary,s.default,a.default];return mp.default=c,mp}var ng={},qd={},AR;function Vfe(){if(AR)return qd;AR=1,Object.defineProperty(qd,"__esModule",{value:!0}),qd.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(qd.DiscrError=e={})),qd}var NR;function Gfe(){if(NR)return ng;NR=1,Object.defineProperty(ng,"__esModule",{value:!0});const e=tt(),t=Vfe(),n=w1(),r=v1(),s=ut(),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:f}=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(!f)throw new Error("discriminator: requires oneOf keyword");const x=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(x);function b(){const S=_();c.if(!1);for(const w in S)c.elseIf((0,e._)`${g} === ${w}`),c.assign(x,y(S[w]));c.else(),i.error(!1,{discrError:t.DiscrError.Mapping,tag:g,tagName:p}),c.endIf()}function y(S){const w=c.name("valid"),v=i.subschema({keyword:"oneOf",schemaProp:S},w);return i.mergeEvaluated(v,e.Name),w}function _(){var S;const w={},v=I(d);let C=!0;for(let z=0;z<f.length;z++){let V=f[z];if(V?.$ref&&!(0,s.schemaHasRulesButRef)(V,h.self.RULES)){const J=V.$ref;if(V=n.resolveRef.call(h.self,h.schemaEnv.root,h.baseId,J),V instanceof n.SchemaEnv&&(V=V.schema),V===void 0)throw new r.default(h.opts.uriResolver,h.baseId,J)}const ne=(S=V?.properties)===null||S===void 0?void 0:S[p];if(typeof ne!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${p}"`);C=C&&(v||I(V)),R(ne,z)}if(!C)throw new Error(`discriminator: "${p}" must be required`);return w;function I({required:z}){return Array.isArray(z)&&z.includes(p)}function R(z,V){if(z.const)N(z.const,V);else if(z.enum)for(const ne of z.enum)N(ne,V);else throw new Error(`discriminator: "properties/${p}" must have "const" or "enum"`)}function N(z,V){if(typeof z!="string"||z in w)throw new Error(`discriminator: "${p}" values must be unique strings`);w[z]=V}}}};return ng.default=o,ng}var rg={};const Kfe="https://json-schema.org/draft/2020-12/schema",Wfe="https://json-schema.org/draft/2020-12/schema",Yfe={"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},Jfe="meta",Qfe="Core and Validation specifications meta-schema",Xfe=[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],Zfe=["object","boolean"],eme="This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",tme={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}},nme={$schema:Kfe,$id:Wfe,$vocabulary:Yfe,$dynamicAnchor:Jfe,title:Qfe,allOf:Xfe,type:Zfe,$comment:eme,properties:tme},rme="https://json-schema.org/draft/2020-12/schema",sme="https://json-schema.org/draft/2020-12/meta/applicator",ame={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},ome="meta",ime="Applicator vocabulary meta-schema",cme=["object","boolean"],ume={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"}},lme={schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}},dme={$schema:rme,$id:sme,$vocabulary:ame,$dynamicAnchor:ome,title:ime,type:cme,properties:ume,$defs:lme},hme="https://json-schema.org/draft/2020-12/schema",fme="https://json-schema.org/draft/2020-12/meta/unevaluated",mme={"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},pme="meta",gme="Unevaluated applicator vocabulary meta-schema",bme=["object","boolean"],yme={unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}},kme={$schema:hme,$id:fme,$vocabulary:mme,$dynamicAnchor:pme,title:gme,type:bme,properties:yme},xme="https://json-schema.org/draft/2020-12/schema",_me="https://json-schema.org/draft/2020-12/meta/content",vme={"https://json-schema.org/draft/2020-12/vocab/content":!0},wme="meta",Sme="Content vocabulary meta-schema",Eme=["object","boolean"],Tme={contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}},Cme={$schema:xme,$id:_me,$vocabulary:vme,$dynamicAnchor:wme,title:Sme,type:Eme,properties:Tme},Ime="https://json-schema.org/draft/2020-12/schema",Ame="https://json-schema.org/draft/2020-12/meta/core",Nme={"https://json-schema.org/draft/2020-12/vocab/core":!0},Rme="meta",Pme="Core vocabulary meta-schema",Ome=["object","boolean"],Lme={$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"}}},$me={anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}},Mme={$schema:Ime,$id:Ame,$vocabulary:Nme,$dynamicAnchor:Rme,title:Pme,type:Ome,properties:Lme,$defs:$me},jme="https://json-schema.org/draft/2020-12/schema",Dme="https://json-schema.org/draft/2020-12/meta/format-annotation",Fme={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},Bme="meta",zme="Format vocabulary meta-schema for annotation results",Ume=["object","boolean"],Hme={format:{type:"string"}},qme={$schema:jme,$id:Dme,$vocabulary:Fme,$dynamicAnchor:Bme,title:zme,type:Ume,properties:Hme},Vme="https://json-schema.org/draft/2020-12/schema",Gme="https://json-schema.org/draft/2020-12/meta/meta-data",Kme={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},Wme="meta",Yme="Meta-data vocabulary meta-schema",Jme=["object","boolean"],Qme={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}},Xme={$schema:Vme,$id:Gme,$vocabulary:Kme,$dynamicAnchor:Wme,title:Yme,type:Jme,properties:Qme},Zme="https://json-schema.org/draft/2020-12/schema",epe="https://json-schema.org/draft/2020-12/meta/validation",tpe={"https://json-schema.org/draft/2020-12/vocab/validation":!0},npe="meta",rpe="Validation vocabulary meta-schema",spe=["object","boolean"],ape={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"}}},ope={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:[]}},ipe={$schema:Zme,$id:epe,$vocabulary:tpe,$dynamicAnchor:npe,title:rpe,type:spe,properties:ape,$defs:ope};var RR;function cpe(){if(RR)return rg;RR=1,Object.defineProperty(rg,"__esModule",{value:!0});const e=nme,t=dme,n=kme,r=Cme,s=Mme,a=qme,o=Xme,i=ipe,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,f){return l?h.$dataMetaSchema(f,c):f}}return rg.default=u,rg}var PR;function upe(){return PR||(PR=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=rfe(),r=qfe(),s=Gfe(),a=cpe(),o="https://json-schema.org/draft/2020-12/schema";class i extends n.default{constructor(f={}){super({...f,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),r.default.forEach(f=>this.addVocabulary(f)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:f,meta:p}=this.opts;p&&(a.default.call(this,f),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=_1();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=tt();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=OT();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return l.default}});var d=v1();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return d.default}})})(up,up.exports)),up.exports}var lpe=upe();const dpe=W0(lpe);new dpe({allErrors:!0,strict:!1,validateSchema:!1,allowUnionTypes:!0});class CMe extends od("KernelCoreEffectError"){}class IMe extends od("ToolInteractionPendingError"){}class AMe extends od("ToolInteractionDeniedError"){}Oi(B({limit:M(st)}));Oi(B({namespaces:ge(zhe)}));Oi(B({namespace:M(E),query:M(E),limit:M(st),includeSchemas:M(Ve)}));Oi(B({results:ge(PT)}));Oi(B({path:E,includeSchemas:M(Ve)}));Oi(K(PT));Oi(B({query:E,limit:M(st),includeSchemas:M(Ve)}));const hpe=Bt(PT,B({score:st}));Oi(B({bestPath:K(E),results:ge(hpe),total:st}));const Rm=E.pipe(Rt("DocumentId")),Pm=E.pipe(Rt("ResourceId")),Ml=E.pipe(Rt("ScopeId")),S1=E.pipe(Rt("CapabilityId")),Lf=E.pipe(Rt("ExecutableId")),E1=E.pipe(Rt("ResponseSetId")),T1=E.pipe(Rt("DiagnosticId")),vt=E.pipe(Rt("ShapeSymbolId")),jT=E.pipe(Rt("ParameterSymbolId")),dF=E.pipe(Rt("RequestBodySymbolId")),DT=E.pipe(Rt("ResponseSymbolId")),Om=E.pipe(Rt("HeaderSymbolId")),su=E.pipe(Rt("ExampleSymbolId")),FT=E.pipe(Rt("SecuritySchemeSymbolId")),fpe=Tt(vt,jT,dF,DT,Om,su,FT),BT=ee("openapi","graphql-schema","google-discovery","mcp","custom"),mpe=ee("service","document","resource","pathItem","operation","folder"),ppe=ee("read","write","delete","action","subscribe"),gpe=ee("path","query","header","cookie"),bpe=ee("success","redirect","stream","download","upload","longRunning"),ype=ee("oauth2","http","apiKey","basic","bearer","custom"),kpe=ee("1XX","2XX","3XX","4XX","5XX"),xpe=ee("cursor","offset","token","unknown"),_pe=ee("info","warning","error"),vpe=ee("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"),wpe=ee("json","yaml","graphql","text","unknown"),Spe=ee("declared","hoisted","derived","merged","projected"),Da=B({summary:M(E),description:M(E),externalDocsUrl:M(E)}),hF=B({relation:Spe,documentId:Rm,resourceId:M(Pm),pointer:M(E),line:M(st),column:M(st)}),fF=B({sourceKind:BT,kind:E,pointer:M(E),encoding:M(wpe),summary:M(E),value:M(Un)}),Ps=B({synthetic:Ve,provenance:ge(hF),diagnosticIds:M(ge(T1)),native:M(ge(fF))}),Epe=B({sourceKind:BT,adapterKey:E,importerVersion:E,importedAt:E,sourceConfigHash:E}),mF=B({id:Rm,kind:BT,title:M(E),versionHint:M(E),fetchedAt:E,rawRef:E,entryUri:M(E),native:M(ge(fF))}),pF=B({shapeId:vt,docs:M(Da),deprecated:M(Ve),exampleIds:M(ge(su))}),Tpe=B({propertyName:E,mapping:M(Qe({key:E,value:vt}))}),Cpe=B({type:ee("scalar"),scalar:ee("string","number","integer","boolean","null","bytes"),format:M(E),constraints:M(Qe({key:E,value:Un}))}),Ipe=B({type:ee("unknown"),reason:M(E)}),Ape=B({type:ee("const"),value:Un}),Npe=B({type:ee("enum"),values:ge(Un)}),Rpe=B({type:ee("object"),fields:Qe({key:E,value:pF}),required:M(ge(E)),additionalProperties:M(Tt(Ve,vt)),patternProperties:M(Qe({key:E,value:vt}))}),Ppe=B({type:ee("array"),itemShapeId:vt,minItems:M(st),maxItems:M(st)}),Ope=B({type:ee("tuple"),itemShapeIds:ge(vt),additionalItems:M(Tt(Ve,vt))}),Lpe=B({type:ee("map"),valueShapeId:vt}),$pe=B({type:ee("allOf"),items:ge(vt)}),Mpe=B({type:ee("anyOf"),items:ge(vt)}),jpe=B({type:ee("oneOf"),items:ge(vt),discriminator:M(Tpe)}),Dpe=B({type:ee("nullable"),itemShapeId:vt}),Fpe=B({type:ee("ref"),target:vt}),Bpe=B({type:ee("not"),itemShapeId:vt}),zpe=B({type:ee("conditional"),ifShapeId:vt,thenShapeId:M(vt),elseShapeId:M(vt)}),Upe=B({type:ee("graphqlInterface"),fields:Qe({key:E,value:pF}),possibleTypeIds:ge(vt)}),Hpe=B({type:ee("graphqlUnion"),memberTypeIds:ge(vt)}),qpe=Tt(Ipe,Cpe,Ape,Npe,Rpe,Ppe,Ope,Lpe,$pe,Mpe,jpe,Dpe,Fpe,Bpe,zpe,Upe,Hpe),OR=B({shapeId:vt,pointer:M(E)}),gF=Bt(B({id:Pm,documentId:Rm,canonicalUri:E,baseUri:E,dialectUri:M(E),rootShapeId:M(vt),anchors:Qe({key:E,value:OR}),dynamicAnchors:Qe({key:E,value:OR})}),Ps),Vpe=Tt(B({location:ee("header","query","cookie"),name:E}),B({location:ee("body"),path:E})),Gpe=B({authorizationUrl:M(E),tokenUrl:M(E),refreshUrl:M(E),scopes:M(Qe({key:E,value:E}))}),Kpe=B({in:M(ee("header","query","cookie")),name:M(E)}),Wpe=Bt(B({id:FT,kind:ee("securityScheme"),schemeType:ype,docs:M(Da),placement:M(Kpe),http:M(B({scheme:E,bearerFormat:M(E)})),apiKey:M(B({in:ee("header","query","cookie"),name:E})),oauth:M(B({flows:M(Qe({key:E,value:Gpe})),scopes:M(Qe({key:E,value:E}))})),custom:M(B({placementHints:M(ge(Vpe))}))}),Ps),Ype=B({contentType:M(E),style:M(E),explode:M(Ve),allowReserved:M(Ve),headers:M(ge(Om))}),C1=B({mediaType:E,shapeId:M(vt),exampleIds:M(ge(su)),encoding:M(Qe({key:E,value:Ype}))}),Jpe=Bt(B({id:vt,kind:ee("shape"),resourceId:M(Pm),title:M(E),docs:M(Da),deprecated:M(Ve),node:qpe}),Ps),Qpe=Bt(B({id:jT,kind:ee("parameter"),name:E,location:gpe,required:M(Ve),docs:M(Da),deprecated:M(Ve),exampleIds:M(ge(su)),schemaShapeId:M(vt),content:M(ge(C1)),style:M(E),explode:M(Ve),allowReserved:M(Ve)}),Ps),Xpe=Bt(B({id:Om,kind:ee("header"),name:E,docs:M(Da),deprecated:M(Ve),exampleIds:M(ge(su)),schemaShapeId:M(vt),content:M(ge(C1)),style:M(E),explode:M(Ve)}),Ps),Zpe=Bt(B({id:dF,kind:ee("requestBody"),docs:M(Da),required:M(Ve),contents:ge(C1)}),Ps),ege=Bt(B({id:DT,kind:ee("response"),docs:M(Da),headerIds:M(ge(Om)),contents:M(ge(C1))}),Ps),tge=Bt(B({id:su,kind:ee("example"),name:M(E),docs:M(Da),exampleKind:ee("value","call"),value:M(Un),externalValue:M(E),call:M(B({args:Qe({key:E,value:Un}),result:M(Un)}))}),Ps),bF=Tt(Jpe,Qpe,Zpe,ege,Xpe,tge,Wpe),S0=yT(()=>Tt(B({kind:ee("none")}),B({kind:ee("scheme"),schemeId:FT,scopes:M(ge(E))}),B({kind:ee("allOf"),items:ge(S0)}),B({kind:ee("anyOf"),items:ge(S0)}))),nge=B({url:E,description:M(E),variables:M(Qe({key:E,value:E}))}),rge=B({servers:M(ge(nge)),auth:M(S0),parameterIds:M(ge(jT)),headerIds:M(ge(Om)),variables:M(Qe({key:E,value:E}))}),yF=Bt(B({id:Ml,kind:mpe,parentId:M(Ml),name:M(E),namespace:M(E),docs:M(Da),defaults:M(rge)}),Ps),sge=B({approval:B({mayRequire:Ve,reasons:M(ge(ee("write","delete","sensitive","externalSideEffect")))}),elicitation:B({mayRequest:Ve,shapeId:M(vt)}),resume:B({supported:Ve})}),kF=Bt(B({id:S1,serviceScopeId:Ml,surface:B({toolPath:ge(E),title:M(E),summary:M(E),description:M(E),aliases:M(ge(E)),tags:M(ge(E))}),semantics:B({effect:ppe,safe:M(Ve),idempotent:M(Ve),destructive:M(Ve)}),docs:M(Da),auth:S0,interaction:sge,executableIds:ge(Lf),preferredExecutableId:M(Lf),exampleIds:M(ge(su))}),Ps),age=B({protocol:M(E),method:M(K(E)),pathTemplate:M(K(E)),operationId:M(K(E)),group:M(K(E)),leaf:M(K(E)),rawToolId:M(K(E)),title:M(K(E)),summary:M(K(E))}),oge=B({responseSetId:E1,callShapeId:vt,resultDataShapeId:M(vt),resultErrorShapeId:M(vt),resultHeadersShapeId:M(vt),resultStatusShapeId:M(vt)}),xF=Bt(B({id:Lf,capabilityId:S1,scopeId:Ml,adapterKey:E,bindingVersion:st,binding:Un,projection:oge,display:M(age)}),Ps),ige=B({kind:xpe,tokenParamName:M(E),nextFieldPath:M(E)}),cge=Tt(B({kind:ee("exact"),status:st}),B({kind:ee("range"),value:kpe}),B({kind:ee("default")})),uge=B({match:cge,responseId:DT,traits:M(ge(bpe)),pagination:M(ige)}),_F=Bt(B({id:E1,variants:ge(uge)}),Ps),vF=B({id:T1,level:_pe,code:vpe,message:E,relatedSymbolIds:M(ge(fpe)),provenance:ge(hF)}),wF=B({version:ee("ir.v1"),documents:Qe({key:Rm,value:mF}),resources:Qe({key:Pm,value:gF}),scopes:Qe({key:Ml,value:yF}),symbols:Qe({key:E,value:bF}),capabilities:Qe({key:S1,value:kF}),executables:Qe({key:Lf,value:xF}),responseSets:Qe({key:E1,value:_F}),diagnostics:Qe({key:T1,value:vF})}),lge=B({version:ee("ir.v1.fragment"),documents:M(Qe({key:Rm,value:mF})),resources:M(Qe({key:Pm,value:gF})),scopes:M(Qe({key:Ml,value:yF})),symbols:M(Qe({key:E,value:bF})),capabilities:M(Qe({key:S1,value:kF})),executables:M(Qe({key:Lf,value:xF})),responseSets:M(Qe({key:E1,value:_F})),diagnostics:M(Qe({key:T1,value:vF}))}),dge=B({version:ee("ir.v1.snapshot"),import:Epe,catalog:wF});hT(wF);hT(dge);hT(lge);const ka=B({providerId:E,handle:E});ee("runtime","import");ee("imported","internal");const hge=E,fge=ee("draft","probing","auth_required","connected","error"),I1=ee("auto","streamable-http","sse","stdio"),au=ee("none","reuse_runtime","separate"),Ts=Qe({key:E,value:E}),SF=ge(E),Wv=yT(()=>Tt(E,st,Ve,l1,ge(Wv),Qe({key:E,value:Wv}))).annotations({identifier:"JsonValue"}),EF=Qe({key:E,value:Wv}).annotations({identifier:"JsonObject"}),LR=Tt(B({kind:ee("none")}),B({kind:ee("bearer"),headerName:E,prefix:E,token:ka}),B({kind:ee("oauth2"),headerName:E,prefix:E,accessToken:ka,refreshToken:K(ka)}),B({kind:ee("oauth2_authorized_user"),headerName:E,prefix:E,tokenEndpoint:E,clientId:E,clientAuthentication:ee("none","client_secret_post"),clientSecret:K(ka),refreshToken:ka,grantSet:K(ge(E))}),B({kind:ee("provider_grant_ref"),grantId:E,providerKey:E,requiredScopes:ge(E),headerName:E,prefix:E}),B({kind:ee("mcp_oauth"),redirectUri:E,accessToken:ka,refreshToken:K(ka),tokenType:E,expiresIn:K(st),scope:K(E),resourceMetadataUrl:K(E),authorizationServerUrl:K(E),resourceMetadataJson:K(E),authorizationServerMetadataJson:K(E),clientInformationJson:K(E)})),TF=st;B({version:TF,payload:EF});B({id:E,scopeId:E,name:E,kind:hge,endpoint:E,status:fge,enabled:Ve,namespace:K(E),bindingVersion:TF,binding:EF,importAuthPolicy:au,importAuth:LR,auth:LR,sourceHash:K(E),lastError:K(E),createdAt:st,updatedAt:st});B({id:E,bindingConfigJson:K(E)});const CF=ee("app_callback","loopback"),IF=B({clientId:g0.pipe(p0()),clientSecret:M(K(g0.pipe(p0()))),redirectMode:M(CF)}),mge=ee("mcp","openapi","google_discovery","graphql","unknown"),AF=ee("low","medium","high"),pge=ee("none","bearer","oauth2","apiKey","basic","unknown"),gge=ee("header","query","cookie"),bge=Tt(B({kind:ee("none")}),B({kind:ee("bearer"),headerName:M(K(E)),prefix:M(K(E)),token:E}),B({kind:ee("basic"),username:E,password:E}),B({kind:ee("headers"),headers:Ts})),yge=B({suggestedKind:pge,confidence:AF,supported:Ve,reason:E,headerName:K(E),prefix:K(E),parameterName:K(E),parameterLocation:K(gge),oauthAuthorizationUrl:K(E),oauthTokenUrl:K(E),oauthScopes:ge(E)}),kge=B({detectedKind:mge,confidence:AF,endpoint:E,specUrl:K(E),name:K(E),namespace:K(E),transport:K(I1),authInference:yge,toolCount:K(st),warnings:ge(E)});class NMe extends od("SourceCoreEffectError"){}const xge=g0.pipe(p0()),Mr=M(K(E)),_ge=B({kind:ee("bearer"),headerName:Mr,prefix:Mr,token:Mr,tokenRef:M(K(ka))}),vge=B({kind:ee("oauth2"),headerName:Mr,prefix:Mr,accessToken:Mr,accessTokenRef:M(K(ka)),refreshToken:Mr,refreshTokenRef:M(K(ka))}),A1=Tt(B({kind:ee("none")}),_ge,vge),zT=B({importAuthPolicy:M(au),importAuth:M(A1)}),wge=M(K(IF)),NF=B({endpoint:xge,name:Mr,namespace:Mr}),Sge=B({transport:M(K(I1)),queryParams:M(K(Ts)),headers:M(K(Ts)),command:M(K(E)),args:M(K(SF)),env:M(K(Ts)),cwd:M(K(E))});class RMe extends od("SourceCredentialRequiredError"){constructor(t,n){super({slot:t,message:n})}}const Jt=E.pipe(Rt("ScopeId")),Fa=E.pipe(Rt("SourceId")),N1=E.pipe(Rt("SourceCatalogId")),R1=E.pipe(Rt("SourceCatalogRevisionId")),hd=E.pipe(Rt("SourceAuthSessionId")),RF=E.pipe(Rt("AuthArtifactId")),Ege=E.pipe(Rt("AuthLeaseId")),Tge=E.pipe(Rt("ScopedSourceOauthClientId")),fd=E.pipe(Rt("ScopeOauthClientId")),P1=E.pipe(Rt("ProviderAuthGrantId")),Cge=E.pipe(Rt("SecretMaterialId")),PF=E.pipe(Rt("PolicyId")),Lm=E.pipe(Rt("ExecutionId")),$m=E.pipe(Rt("ExecutionInteractionId")),Ige=E.pipe(Rt("ExecutionStepId")),Tn=B({providerId:E,handle:E}),UT=ee("runtime","import"),Age=UT,Nge=E,Rge=ge(E),sg=Tt(B({kind:ee("literal"),value:E}),B({kind:ee("secret_ref"),ref:Tn})),OF=Tt(B({location:ee("header"),name:E,parts:ge(sg)}),B({location:ee("query"),name:E,parts:ge(sg)}),B({location:ee("cookie"),name:E,parts:ge(sg)}),B({location:ee("body"),path:E,parts:ge(sg)})),Pge=Tt(B({location:ee("header"),name:E,value:E}),B({location:ee("query"),name:E,value:E}),B({location:ee("cookie"),name:E,value:E}),B({location:ee("body"),path:E,value:E})),Oge=hr(ge(OF)),Lge="static_bearer",$ge="static_oauth2",Mge="static_placements",jge="oauth2_authorized_user",O1=ee("none","client_secret_post");ee(Lge,$ge,Mge,jge);const Dge=B({headerName:E,prefix:E,token:Tn}),Fge=B({headerName:E,prefix:E,accessToken:Tn,refreshToken:K(Tn)}),Bge=B({placements:ge(OF)}),zge=B({headerName:E,prefix:E,tokenEndpoint:E,clientId:E,clientAuthentication:O1,clientSecret:K(Tn),refreshToken:Tn}),Uge=B({grantId:P1,providerKey:E,requiredScopes:ge(E),headerName:E,prefix:E}),Hge=B({redirectUri:E,accessToken:Tn,refreshToken:K(Tn),tokenType:E,expiresIn:K(st),scope:K(E),resourceMetadataUrl:K(E),authorizationServerUrl:K(E),resourceMetadataJson:K(E),authorizationServerMetadataJson:K(E),clientInformationJson:K(E)}),qge=hr(Dge),Vge=hr(Fge),Gge=hr(Bge),Kge=hr(zge),Wge=hr(Uge),Yge=hr(Hge);hr(ge(Pge));const Jge=hr(Rge);Pi(qge);Pi(Vge);Pi(Gge);Pi(Kge);Pi(Wge);Pi(Yge);Pi(Jge);B({id:RF,scopeId:Jt,sourceId:Fa,actorScopeId:K(Jt),slot:UT,artifactKind:Nge,configJson:E,grantSetJson:K(E),createdAt:qe,updatedAt:qe});const Qge=E,Xge=ee("pending","completed","failed","cancelled"),Yv=yT(()=>Tt(E,st,Ve,l1,ge(Yv),Qe({key:E,value:Yv}))).annotations({identifier:"JsonValue"}),wc=Qe({key:E,value:Yv}).annotations({identifier:"JsonObject"}),Zge=B({kind:ee("mcp_oauth"),endpoint:E,redirectUri:E,scope:K(E),resourceMetadataUrl:K(E),authorizationServerUrl:K(E),resourceMetadata:K(wc),authorizationServerMetadata:K(wc),clientInformation:K(wc),codeVerifier:K(E),authorizationUrl:K(E)});hr(Zge);const ebe=B({kind:ee("oauth2_pkce"),providerKey:E,authorizationEndpoint:E,tokenEndpoint:E,redirectUri:E,clientId:E,clientAuthentication:O1,clientSecret:K(Tn),scopes:ge(E),headerName:E,prefix:E,authorizationParams:Qe({key:E,value:E}),codeVerifier:K(E),authorizationUrl:K(E)});hr(ebe);const tbe=B({sourceId:Fa,requiredScopes:ge(E)}),nbe=B({kind:ee("provider_oauth_batch"),providerKey:E,authorizationEndpoint:E,tokenEndpoint:E,redirectUri:E,oauthClientId:fd,clientAuthentication:O1,scopes:ge(E),headerName:E,prefix:E,authorizationParams:Qe({key:E,value:E}),targetSources:ge(tbe),codeVerifier:K(E),authorizationUrl:K(E)});hr(nbe);B({id:hd,scopeId:Jt,sourceId:Fa,actorScopeId:K(Jt),credentialSlot:Age,executionId:K(Lm),interactionId:K($m),providerKind:Qge,status:Xge,state:E,sessionDataJson:E,errorText:K(E),completedAt:K(qe),createdAt:qe,updatedAt:qe});const L1=E,Mm=ee("draft","probing","auth_required","connected","error"),jl=Tt(B({kind:ee("none")}),B({kind:ee("bearer"),headerName:E,prefix:E,token:Tn}),B({kind:ee("oauth2"),headerName:E,prefix:E,accessToken:Tn,refreshToken:K(Tn)}),B({kind:ee("oauth2_authorized_user"),headerName:E,prefix:E,tokenEndpoint:E,clientId:E,clientAuthentication:ee("none","client_secret_post"),clientSecret:K(Tn),refreshToken:Tn,grantSet:K(ge(E))}),B({kind:ee("provider_grant_ref"),grantId:P1,providerKey:E,requiredScopes:ge(E),headerName:E,prefix:E}),B({kind:ee("mcp_oauth"),redirectUri:E,accessToken:Tn,refreshToken:K(Tn),tokenType:E,expiresIn:K(st),scope:K(E),resourceMetadataUrl:K(E),authorizationServerUrl:K(E),resourceMetadataJson:K(E),authorizationServerMetadataJson:K(E),clientInformationJson:K(E)})),LF=st;B({version:LF,payload:wc});const rbe=B({scopeId:Jt,sourceId:Fa,catalogId:N1,catalogRevisionId:R1,name:E,kind:L1,endpoint:E,status:Mm,enabled:Ve,namespace:K(E),importAuthPolicy:au,bindingConfigJson:E,sourceHash:K(E),lastError:K(E),createdAt:qe,updatedAt:qe});nu(rbe,B({id:Fa,scopeId:Jt,catalogId:N1,catalogRevisionId:R1,name:E,kind:L1,endpoint:E,status:Mm,enabled:Ve,namespace:K(E),importAuthPolicy:au,bindingConfigJson:E,sourceHash:K(E),lastError:K(E),createdAt:qe,updatedAt:qe}),{strict:!1,decode:e=>({id:e.sourceId,scopeId:e.scopeId,catalogId:e.catalogId,catalogRevisionId:e.catalogRevisionId,name:e.name,kind:e.kind,endpoint:e.endpoint,status:e.status,enabled:e.enabled,namespace:e.namespace,importAuthPolicy:e.importAuthPolicy,bindingConfigJson:e.bindingConfigJson,sourceHash:e.sourceHash,lastError:e.lastError,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,endpoint:e.endpoint,status:e.status,enabled:e.enabled,namespace:e.namespace,importAuthPolicy:e.importAuthPolicy,bindingConfigJson:e.bindingConfigJson,sourceHash:e.sourceHash,lastError:e.lastError,createdAt:e.createdAt,updatedAt:e.updatedAt})});const lo=B({id:Fa,scopeId:Jt,name:E,kind:L1,endpoint:E,status:Mm,enabled:Ve,namespace:K(E),bindingVersion:LF,binding:wc,importAuthPolicy:au,importAuth:jl,auth:jl,sourceHash:K(E),lastError:K(E),createdAt:qe,updatedAt:qe}),sbe=ee("imported","internal"),abe=E,obe=ee("private","scope","organization","public");B({id:N1,kind:sbe,adapterKey:abe,providerKey:E,name:E,summary:K(E),visibility:obe,latestRevisionId:R1,createdAt:qe,updatedAt:qe});B({id:R1,catalogId:N1,revisionNumber:st,sourceConfigJson:E,importMetadataJson:K(E),importMetadataHash:K(E),snapshotHash:K(E),createdAt:qe,updatedAt:qe});const $F=ee("allow","deny"),MF=ee("auto","required"),ph=B({id:PF,key:E,scopeId:Jt,resourcePattern:E,effect:$F,approvalMode:MF,priority:st,enabled:Ve,createdAt:qe,updatedAt:qe});Sm(ph);B({id:Ege,authArtifactId:RF,scopeId:Jt,sourceId:Fa,actorScopeId:K(Jt),slot:UT,placementsTemplateJson:E,expiresAt:K(qe),refreshAfter:K(qe),createdAt:qe,updatedAt:qe});Pi(Oge);const ibe=B({redirectMode:M(CF)});hr(ibe);B({id:Tge,scopeId:Jt,sourceId:Fa,providerKey:E,clientId:E,clientSecretProviderId:K(E),clientSecretHandle:K(E),clientMetadataJson:K(E),createdAt:qe,updatedAt:qe});const $R=B({id:fd,scopeId:Jt,providerKey:E,label:K(E),clientId:E,clientSecretProviderId:K(E),clientSecretHandle:K(E),clientMetadataJson:K(E),createdAt:qe,updatedAt:qe});B({id:P1,scopeId:Jt,actorScopeId:K(Jt),providerKey:E,oauthClientId:fd,tokenEndpoint:E,clientAuthentication:O1,headerName:E,prefix:E,refreshToken:Tn,grantedScopes:ge(E),lastRefreshedAt:K(qe),orphanedAt:K(qe),createdAt:qe,updatedAt:qe});const jF=ee("auth_material","oauth_access_token","oauth_refresh_token","oauth_client_info");B({id:Cge,name:K(E),purpose:jF,providerId:E,handle:E,value:K(E),createdAt:qe,updatedAt:qe});const DF=B({scopeId:Jt,actorScopeId:Jt,resolutionScopeIds:ge(Jt)});Sm(DF);const cbe=ee("quickjs","ses","deno"),ube=ee("env","file","exec","params"),lbe=B({source:ee("env")}),dbe=ee("singleValue","json"),hbe=B({source:ee("file"),path:E,mode:M(dbe)}),fbe=B({source:ee("exec"),command:E,args:M(ge(E)),env:M(Qe({key:E,value:E})),allowSymlinkCommand:M(Ve),trustedDirs:M(ge(E))}),mbe=Tt(lbe,hbe,fbe),pbe=B({source:ube,provider:E,id:E}),gbe=Tt(E,pbe),bbe=B({endpoint:E,auth:M(gbe)}),$1=B({name:M(E),namespace:M(E),enabled:M(Ve),connection:bbe}),ybe=B({specUrl:E,defaultHeaders:M(K(Ts))}),kbe=B({defaultHeaders:M(K(Ts))}),xbe=B({service:E,version:E,discoveryUrl:M(K(E)),defaultHeaders:M(K(Ts)),scopes:M(ge(E))}),_be=B({transport:M(K(I1)),queryParams:M(K(Ts)),headers:M(K(Ts)),command:M(K(E)),args:M(K(SF)),env:M(K(Ts)),cwd:M(K(E))}),vbe=Bt($1,B({kind:ee("openapi"),binding:ybe})),wbe=Bt($1,B({kind:ee("graphql"),binding:kbe})),Sbe=Bt($1,B({kind:ee("google_discovery"),binding:xbe})),Ebe=Bt($1,B({kind:ee("mcp"),binding:_be})),Tbe=Tt(vbe,wbe,Sbe,Ebe),Cbe=ee("allow","deny"),Ibe=ee("auto","manual"),Abe=B({match:E,action:Cbe,approval:Ibe,enabled:M(Ve),priority:M(st)}),Nbe=B({providers:M(Qe({key:E,value:mbe})),defaults:M(B({env:M(E),file:M(E),exec:M(E)}))}),Rbe=B({name:M(E)});B({runtime:M(cbe),workspace:M(Rbe),sources:M(Qe({key:E,value:Tbe})),policies:M(Qe({key:E,value:Abe})),secrets:M(Nbe)});const FF=ee("pending","running","waiting_for_interaction","completed","failed","cancelled"),Pbe=B({id:Lm,scopeId:Jt,createdByScopeId:Jt,status:FF,code:E,resultJson:K(E),errorText:K(E),logsJson:K(E),startedAt:K(qe),completedAt:K(qe),createdAt:qe,updatedAt:qe});Sm(B({status:FF,code:E,resultJson:K(E),errorText:K(E),logsJson:K(E),startedAt:K(qe),completedAt:K(qe),updatedAt:qe}));const BF=ee("pending","resolved","cancelled"),Obe=B({id:$m,executionId:Lm,status:BF,kind:E,purpose:E,payloadJson:E,responseJson:K(E),responsePrivateJson:K(E),createdAt:qe,updatedAt:qe});Sm(B({status:BF,kind:E,purpose:E,payloadJson:E,responseJson:K(E),responsePrivateJson:K(E),updatedAt:qe}));const fx=B({execution:Pbe,pendingInteraction:K(Obe)}),Lbe=ee("tool_call"),zF=ee("pending","waiting","completed","failed");B({id:Ige,executionId:Lm,sequence:st,kind:Lbe,status:zF,path:E,argsJson:E,resultJson:K(E),errorText:K(E),interactionId:K($m),createdAt:qe,updatedAt:qe});Sm(B({status:zF,resultJson:K(E),errorText:K(E),interactionId:K($m),updatedAt:qe}));const $be=ee("ir"),Mbe=B({path:E,sourceKey:E,title:M(E),description:M(E),protocol:E,toolId:E,rawToolId:K(E),operationId:K(E),group:K(E),leaf:K(E),tags:ge(E),method:K(E),pathTemplate:K(E),inputTypePreview:M(E),outputTypePreview:M(E)}),jbe=B({label:E,value:E,mono:M(Ve)}),Dbe=B({kind:ee("facts"),title:E,items:ge(jbe)}),Fbe=B({kind:ee("markdown"),title:E,body:E}),Bbe=B({kind:ee("code"),title:E,language:E,body:E}),zbe=Tt(Dbe,Fbe,Bbe),Ube=B({path:E,method:K(E),inputTypePreview:M(E),outputTypePreview:M(E)}),MR=B({shapeId:K(E),typePreview:K(E),typeDeclaration:K(E),schemaJson:K(E),exampleJson:K(E)}),Hbe=B({callSignature:E,callDeclaration:E,callShapeId:E,resultShapeId:K(E),responseSetId:E,input:MR,output:MR}),qbe=B({source:lo,namespace:E,pipelineKind:$be,toolCount:st,tools:ge(Ube)}),Vbe=B({summary:Mbe,contract:Hbe,sections:ge(zbe)}),Gbe=B({query:E,limit:M(st)}),Kbe=B({path:E,score:st,description:M(E),inputTypePreview:M(E),outputTypePreview:M(E),reasons:ge(E)}),Wbe=B({query:E,queryTokens:ge(E),bestPath:K(E),total:st,results:ge(Kbe)});B({id:E,appliedAt:qe});const Ybe=B({id:E,name:E,canStore:Ve}),Jbe=B({platform:E,secretProviders:ge(Ybe),defaultSecretStoreProvider:E}),Qbe=B({sourceId:E,sourceName:E}),Xbe=B({id:E,providerId:E,name:K(E),purpose:E,createdAt:st,updatedAt:st,linkedSources:ge(Qbe)}),Zbe=B({name:E,value:E,purpose:M(jF),providerId:M(E)}),e0e=B({id:E,name:K(E),providerId:E,purpose:E,createdAt:st,updatedAt:st}),t0e=B({name:M(E),value:M(E)}),n0e=B({id:E,providerId:E,name:K(E),purpose:E,createdAt:st,updatedAt:st}),r0e=B({removed:Ve}),UF=B({resourcePattern:Kv,effect:M($F),approvalMode:M(MF),priority:M(st),enabled:M(Ve)}),s0e=UF,a0e=UF,o0e=B({name:Er,kind:L1,endpoint:Er}),i0e=B({status:M(Mm),enabled:M(Ve),namespace:M(K(E)),binding:M(wc),importAuthPolicy:M(au),importAuth:M(jl),auth:M(jl),sourceHash:M(K(E)),lastError:M(K(E))}),c0e=Bt(o0e,i0e),u0e=B({name:Kv,endpoint:Kv,status:M(Mm),enabled:M(Ve),namespace:M(K(E)),binding:M(wc),importAuthPolicy:M(au),importAuth:M(jl),auth:M(jl),sourceHash:M(K(E)),lastError:M(K(E))}),jR=B({interactionId:$m}),l0e=B({action:M(ee("submit","continue","cancel")),token:M(E)}),DR=B({state:E,code:M(E),error:M(E),error_description:M(E)}),d0e=B({providerKey:E}),h0e=B({providerKey:E,label:M(K(E)),oauthClient:IF}),f0e=B({service:Er,version:Er,discoveryUrl:M(K(Er)),scopes:M(ge(Er)),name:M(K(E)),namespace:M(K(E))}),m0e=B({scopeOauthClientId:fd,sources:ge(f0e)}),p0e=B({results:ge(B({source:lo,status:ee("connected","pending_oauth")})),providerOauthSession:K(B({sessionId:hd,authorizationUrl:E,sourceIds:ge(Fa)}))}),g0e=B({url:Er,probeAuth:M(bge)}),b0e=Bt(NF,Bt(zT,B({kind:ee("openapi"),specUrl:Er,auth:M(A1)}))),y0e=Bt(NF,Bt(zT,B({kind:ee("graphql"),auth:M(A1)}))),k0e=Bt(zT,B({kind:ee("google_discovery"),service:Er,version:Er,discoveryUrl:M(K(Er)),scopes:M(ge(Er)),scopeOauthClientId:M(K(fd)),oauthClient:wge,name:Mr,namespace:Mr,auth:M(A1)})),x0e=Bt(Sge,B({kind:ee("mcp"),endpoint:Mr,name:Mr,namespace:Mr})),_0e=Tt(b0e,y0e,k0e,x0e),v0e=Tt(B({kind:ee("connected"),source:lo}),B({kind:ee("credential_required"),source:lo,credentialSlot:ee("runtime","import")}),B({kind:ee("oauth_required"),source:lo,sessionId:hd,authorizationUrl:E}));class _t extends dd()("ControlPlaneBadRequestError",{operation:E,message:E,details:E},sa({status:400})){}class qt extends dd()("ControlPlaneUnauthorizedError",{operation:E,message:E,details:E},sa({status:401})){}class Vt extends dd()("ControlPlaneForbiddenError",{operation:E,message:E,details:E},sa({status:403})){}class bn extends dd()("ControlPlaneNotFoundError",{operation:E,message:E,details:E},sa({status:404})){}class mt extends dd()("ControlPlaneStorageError",{operation:E,message:E,details:E},sa({status:500})){}const mx=As("workspaceId",Jt),FR=As("executionId",Lm);class w0e extends Nm("executions").add(fs("create")`/workspaces/${mx}/executions`.setPayload(Dhe).addSuccess(fx).addError(_t).addError(qt).addError(Vt).addError(bn).addError(mt)).add(xr("get")`/workspaces/${mx}/executions/${FR}`.addSuccess(fx).addError(_t).addError(qt).addError(Vt).addError(bn).addError(mt)).add(fs("resume")`/workspaces/${mx}/executions/${FR}/resume`.setPayload(Fhe).addSuccess(fx).addError(_t).addError(qt).addError(Vt).addError(bn).addError(mt)).prefix("/v1"){}class S0e extends Nm("local").add(xr("installation")`/local/installation`.addSuccess(DF).addError(_t).addError(bn).addError(mt)).add(xr("config")`/local/config`.addSuccess(Jbe).addError(mt)).add(xr("listSecrets")`/local/secrets`.addSuccess(ge(Xbe)).addError(mt)).add(fs("createSecret")`/local/secrets`.setPayload(Zbe).addSuccess(e0e).addError(_t).addError(mt)).add(RT("updateSecret")`/local/secrets/${As("secretId",E)}`.setPayload(t0e).addSuccess(n0e).addError(_t).addError(bn).addError(mt)).add(Hh("deleteSecret")`/local/secrets/${As("secretId",E)}`.addSuccess(r0e).addError(bn).addError(mt)).prefix("/v1"){}const E0e=As("workspaceId",Jt),T0e=E5({contentType:"text/html"}),C0e=B({provider:ee("mcp"),name:M(K(E)),endpoint:Er,transport:M(I1),queryParams:M(K(Ts)),headers:M(K(Ts))}),I0e=B({sessionId:hd,authorizationUrl:E}),HF=B({kind:ee("oauth2"),headerName:E,prefix:E,accessToken:Tn,refreshToken:K(Tn)});B({sessionId:hd,auth:HF});const A0e=B({type:ee("executor:oauth-result"),ok:ee(!0),sessionId:hd,auth:HF}),N0e=B({type:ee("executor:oauth-result"),ok:ee(!1),sessionId:l1,error:E});Tt(A0e,N0e);const R0e=B({state:E,code:M(E),error:M(E),error_description:M(E)});class P0e extends Nm("oauth").add(fs("startSourceAuth")`/workspaces/${E0e}/oauth/source-auth/start`.setPayload(C0e).addSuccess(I0e).addError(_t).addError(qt).addError(Vt).addError(mt)).add(xr("sourceAuthCallback")`/oauth/source-auth/callback`.setUrlParams(R0e).addSuccess(T0e).addError(_t).addError(mt)).prefix("/v1"){}const Vd=As("workspaceId",Jt),px=As("policyId",PF);class O0e extends Nm("policies").add(xr("list")`/workspaces/${Vd}/policies`.addSuccess(ge(ph)).addError(_t).addError(qt).addError(Vt).addError(bn).addError(mt)).add(fs("create")`/workspaces/${Vd}/policies`.setPayload(s0e).addSuccess(ph).addError(_t).addError(qt).addError(Vt).addError(bn).addError(mt)).add(xr("get")`/workspaces/${Vd}/policies/${px}`.addSuccess(ph).addError(_t).addError(qt).addError(Vt).addError(bn).addError(mt)).add(RT("update")`/workspaces/${Vd}/policies/${px}`.setPayload(a0e).addSuccess(ph).addError(_t).addError(qt).addError(Vt).addError(bn).addError(mt)).add(Hh("remove")`/workspaces/${Vd}/policies/${px}`.addSuccess(B({removed:Ve})).addError(_t).addError(qt).addError(Vt).addError(bn).addError(mt)).prefix("/v1"){}const On=As("workspaceId",Jt),Ya=As("sourceId",Fa),L0e=As("toolPath",E),$0e=As("oauthClientId",fd),M0e=As("grantId",P1),ag=E5({contentType:"text/html"});class j0e extends Nm("sources").add(fs("discover")`/sources/discover`.setPayload(g0e).addSuccess(kge).addError(_t).addError(qt).addError(Vt)).add(fs("connect")`/workspaces/${On}/sources/connect`.setPayload(_0e).addSuccess(v0e).addError(_t).addError(qt).addError(Vt).addError(mt)).add(fs("connectBatch")`/workspaces/${On}/sources/connect-batch`.setPayload(m0e).addSuccess(p0e).addError(_t).addError(qt).addError(Vt).addError(mt)).add(xr("listWorkspaceOauthClients")`/workspaces/${On}/oauth-clients`.setUrlParams(d0e).addSuccess(ge($R)).addError(_t).addError(qt).addError(Vt).addError(mt)).add(fs("createWorkspaceOauthClient")`/workspaces/${On}/oauth-clients`.setPayload(h0e).addSuccess($R).addError(_t).addError(qt).addError(Vt).addError(mt)).add(Hh("removeWorkspaceOauthClient")`/workspaces/${On}/oauth-clients/${$0e}`.addSuccess(B({removed:Ve})).addError(_t).addError(qt).addError(Vt).addError(mt)).add(Hh("removeProviderAuthGrant")`/workspaces/${On}/provider-grants/${M0e}`.addSuccess(B({removed:Ve})).addError(_t).addError(qt).addError(Vt).addError(mt)).add(xr("list")`/workspaces/${On}/sources`.addSuccess(ge(lo)).addError(_t).addError(qt).addError(Vt).addError(mt)).add(fs("create")`/workspaces/${On}/sources`.setPayload(c0e).addSuccess(lo).addError(_t).addError(qt).addError(Vt).addError(mt)).add(xr("get")`/workspaces/${On}/sources/${Ya}`.addSuccess(lo).addError(_t).addError(qt).addError(Vt).addError(bn).addError(mt)).add(RT("update")`/workspaces/${On}/sources/${Ya}`.setPayload(u0e).addSuccess(lo).addError(_t).addError(qt).addError(Vt).addError(bn).addError(mt)).add(Hh("remove")`/workspaces/${On}/sources/${Ya}`.addSuccess(B({removed:Ve})).addError(_t).addError(qt).addError(Vt).addError(mt)).add(xr("credentialPage")`/workspaces/${On}/sources/${Ya}/credentials`.setUrlParams(jR).addSuccess(ag).addError(_t).addError(bn).addError(mt)).add(fs("credentialSubmit")`/workspaces/${On}/sources/${Ya}/credentials`.setUrlParams(jR).setPayload(l0e).addSuccess(ag).addError(_t).addError(bn).addError(mt)).add(xr("credentialComplete")`/workspaces/${On}/sources/${Ya}/credentials/oauth/complete`.setUrlParams(DR).addSuccess(ag).addError(_t).addError(bn).addError(mt)).add(xr("providerOauthComplete")`/workspaces/${On}/oauth/provider/callback`.setUrlParams(DR).addSuccess(ag).addError(_t).addError(bn).addError(mt)).add(xr("inspection")`/workspaces/${On}/sources/${Ya}/inspection`.addSuccess(qbe).addError(_t).addError(qt).addError(Vt).addError(bn).addError(mt)).add(xr("inspectionTool")`/workspaces/${On}/sources/${Ya}/tools/${L0e}/inspection`.addSuccess(Vbe).addError(_t).addError(qt).addError(Vt).addError(bn).addError(mt)).add(fs("inspectionDiscover")`/workspaces/${On}/sources/${Ya}/inspection/discover`.setPayload(Gbe).addSuccess(Wbe).addError(_t).addError(qt).addError(Vt).addError(bn).addError(mt)).prefix("/v1"){}class qF extends cle().add(S0e).add(P0e).add(j0e).add(O0e).add(w0e).annotateContext(Ohe({title:"Executor API",description:"Local-first API for workspace sources, policies, auth, and execution"})){}Lhe(qF);const D0e=e=>qde(qF,{baseUrl:e.baseUrl}).pipe(If(The)),F0e=e=>Array.isArray(e)&&e.length===2;function B0e(e){return F0e(e)?e[0]:e}const lt=(e,t)=>r=>e.then(s=>FE(t(s)(r))).then(B0e),z0e=async e=>{const t=FE(D0e(e));return{local:{installation:lt(t,n=>n.local.installation),config:lt(t,n=>n.local.config),listSecrets:lt(t,n=>n.local.listSecrets),createSecret:lt(t,n=>n.local.createSecret),updateSecret:lt(t,n=>n.local.updateSecret),deleteSecret:lt(t,n=>n.local.deleteSecret)},policies:{list:lt(t,n=>n.policies.list),create:lt(t,n=>n.policies.create),get:lt(t,n=>n.policies.get),update:lt(t,n=>n.policies.update),remove:lt(t,n=>n.policies.remove)},sources:{discover:lt(t,n=>n.sources.discover),connect:lt(t,n=>n.sources.connect),connectBatch:lt(t,n=>n.sources.connectBatch),listWorkspaceOauthClients:lt(t,n=>n.sources.listWorkspaceOauthClients),createWorkspaceOauthClient:lt(t,n=>n.sources.createWorkspaceOauthClient),removeWorkspaceOauthClient:lt(t,n=>n.sources.removeWorkspaceOauthClient),removeProviderAuthGrant:lt(t,n=>n.sources.removeProviderAuthGrant),list:lt(t,n=>n.sources.list),create:lt(t,n=>n.sources.create),get:lt(t,n=>n.sources.get),update:lt(t,n=>n.sources.update),remove:lt(t,n=>n.sources.remove),inspection:lt(t,n=>n.sources.inspection),inspectionTool:lt(t,n=>n.sources.inspectionTool),inspectionDiscover:lt(t,n=>n.sources.inspectionDiscover),credentialPage:lt(t,n=>n.sources.credentialPage),credentialSubmit:lt(t,n=>n.sources.credentialSubmit),credentialComplete:lt(t,n=>n.sources.credentialComplete),providerOauthComplete:lt(t,n=>n.sources.providerOauthComplete)},oauth:{startSourceAuth:lt(t,n=>n.oauth.startSourceAuth),sourceAuthCallback:lt(t,n=>n.oauth.sourceAuthCallback)},executions:{create:lt(t,n=>n.executions.create),get:lt(t,n=>n.executions.get),resume:lt(t,n=>n.executions.resume)}}},U0e="http://127.0.0.1:8788",H0e="ws_placeholder",q0e="acc_placeholder",M1="src_placeholder";let md=typeof window<"u"&&typeof window.location?.origin=="string"?window.location.origin:U0e;const VF=O.createContext(null),jm=e=>JSON.stringify(e),ps=e=>JSON.parse(e),wi=(e,t,n)=>jm([e,t,n]),Uc=(e,t,n,r)=>jm([e,t,n,r]),V0e=(e,t,n,r,s)=>jm([e,t,n,r,s]),G0e=(e,t,n,r,s,a)=>jm([e,t,n,r,s,a]),K0e=(e,t,n,r)=>jm([e,t,n,r]),GF=e=>e instanceof Error?e:new Error(String(e)),W0e=e=>new Error(Yy(e)),Y0e=()=>{if(typeof window>"u")return!1;const e=window.location.hostname;return e==="localhost"||e==="127.0.0.1"},KF=e=>{if(dse(e)){const t=e[lse];return{name:e.name,message:e.message,cause:Yy(t)}}return e instanceof Error?{name:e.name,message:e.message,stack:e.stack}:{message:String(e)}},WF=(e,t)=>{Y0e()&&console.error(`[executor react] ${e}`,t)},is=async e=>{const t=e.baseUrl??md,n=e.accountId;try{const r=await z0e({baseUrl:t,...n!==void 0?{accountId:n}:{}});return await e.execute(r)}catch(r){const s=GF(r);throw WF("control-plane request failed",{baseUrl:t,accountId:n,error:KF(s)}),s}},Co=e=>sl({try:()=>is(e),catch:GF}),J0e=To(e=>Ma(Co({baseUrl:e,execute:t=>t.local.installation({})})).pipe(ja)),Q0e=To(e=>Ma(Co({baseUrl:e,execute:t=>t.local.config({})})).pipe(ja)),HT=To(e=>Ma(Co({baseUrl:e,execute:t=>t.local.listSecrets({})})).pipe(ja)),xo=To(e=>{const[t,n,r]=ps(e);return Ma(t?Co({accountId:r,execute:s=>s.sources.list({path:{workspaceId:n}})}):oi).pipe(ja)}),Hc=To(e=>{const[t,n,r,s]=ps(e);return Ma(t?Co({accountId:r,execute:a=>a.sources.get({path:{workspaceId:n,sourceId:s}})}):oi).pipe(ja)}),YF=To(e=>{const[t,n,r,s]=ps(e);return Ma(t?Co({accountId:r,execute:a=>a.sources.inspection({path:{workspaceId:n,sourceId:s}})}):oi).pipe(ja)}),JF=To(e=>{const[t,n,r,s,a]=ps(e);return Ma(t&&a?Co({accountId:r,execute:o=>o.sources.inspectionTool({path:{workspaceId:n,sourceId:s,toolPath:a}})}):Pt(null)).pipe(ja)}),QF=To(e=>{const[t,n,r,s,a,o]=ps(e);return Ma(t?a.trim().length===0?Pt({query:"",queryTokens:[],bestPath:null,total:0,results:[]}):Co({accountId:r,execute:i=>i.sources.inspectionDiscover({path:{workspaceId:n,sourceId:s},payload:{query:a,...o!==null?{limit:o}:{}}})}):oi).pipe(ja)}),XF=To(e=>{const[t,n,r,s]=ps(e);return Ma(t?Co({accountId:r,execute:a=>a.sources.listWorkspaceOauthClients({path:{workspaceId:n},urlParams:{providerKey:s}})}):oi).pipe(ja)}),X0e=e=>zc(e)?{status:"ready",data:e.value}:p5(e)?{status:"error",error:W0e(e.cause)}:{status:"loading"},pd=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")},Io=e=>{const t=_he(e);return O.useMemo(()=>X0e(t),[t])},Z0e=()=>{const e=Io(J0e(md));return O.useMemo(()=>e.status!=="ready"?e:{status:"ready",data:{installation:e.data,workspaceId:e.data.scopeId,accountId:e.data.actorScopeId}},[e])},ou=()=>{const e=Z0e(),t=e.status==="ready",n=t?e.data.workspaceId:H0e,r=t?e.data.accountId:q0e;return O.useMemo(()=>({workspace:e,enabled:t,workspaceId:n,accountId:r}),[r,t,e,n])},di=(e,t)=>{const n=e.getNodes().get(t)??null;if(n===null||typeof n.valueOption!="function")return;const r=n.valueOption();if(!un(r)&&zc(r.value))return r.value.value},ar=(e,t,n)=>{const r=e.ensureNode;typeof r=="function"&&r.call(e,t).setValue(vi(n))},eye=()=>({sourceLists:new Set,sources:new Set,workspaceOauthClients:new Set,inspections:new Set,toolDetails:new Set,discoveries:new Set}),Cu=(e,t,n,r)=>!(e?.workspaceId!==void 0&&e.workspaceId!==t||e?.accountId!==void 0&&e.accountId!==n||e?.sourceId!==void 0&&e.sourceId!==r),tye=(e,t,n)=>{t.sourceLists.forEach(r=>{const[s,a,o]=ps(r);s&&Cu(n,a,o)&&e.refresh(xo(r))}),t.sources.forEach(r=>{const[s,a,o,i]=ps(r);s&&Cu(n,a,o,i)&&e.refresh(Hc(r))}),t.workspaceOauthClients.forEach(r=>{const[s,a,o]=ps(r);s&&Cu(n,a,o)&&e.refresh(XF(r))}),t.inspections.forEach(r=>{const[s,a,o,i]=ps(r);s&&Cu(n,a,o,i)&&e.refresh(YF(r))}),t.toolDetails.forEach(r=>{const[s,a,o,i]=ps(r);s&&Cu(n,a,o,i)&&e.refresh(JF(r))}),t.discoveries.forEach(r=>{const[s,a,o,i]=ps(r);s&&Cu(n,a,o,i)&&e.refresh(QF(r))})},qT=()=>{const e=O.useContext(VF);if(e===null)throw new Error("ExecutorReactProvider is missing from the React tree");return e},gd=(e,t,n)=>{const{activeQueries:r}=qT();O.useEffect(()=>{if(!n)return;const s=r[e];return s.add(t),()=>{s.delete(t)}},[r,e,n,t])},$f=(e,t)=>{const n=e.findIndex(s=>s.id===t.id);if(n===-1)return[t,...e];const r=e.slice();return r[n]=t,r},nye=(e,t)=>e.filter(n=>n.id!==t),rye=e=>{const t=Date.now();return{id:`src_optimistic_${crypto.randomUUID()}`,scopeId:e.workspaceId,name:e.payload.name,kind:e.payload.kind,endpoint:e.payload.endpoint,status:e.payload.status??"draft",enabled:e.payload.enabled??!0,namespace:e.payload.namespace??null,bindingVersion:1,binding:e.payload.binding??{},importAuthPolicy:e.payload.importAuthPolicy??"reuse_runtime",importAuth:e.payload.importAuth??{kind:"none"},auth:e.payload.auth??{kind:"none"},sourceHash:e.payload.sourceHash??null,lastError:e.payload.lastError??null,createdAt:t,updatedAt:t}},sye=(e,t)=>({...e,name:t.name??e.name,endpoint:t.endpoint??e.endpoint,status:t.status??e.status,enabled:t.enabled??e.enabled,namespace:t.namespace!==void 0?t.namespace:e.namespace,binding:t.binding!==void 0?t.binding:e.binding,auth:t.auth!==void 0?t.auth:e.auth,sourceHash:t.sourceHash!==void 0?t.sourceHash:e.sourceHash,lastError:t.lastError!==void 0?t.lastError:e.lastError,updatedAt:Date.now()}),Ao=(e,t)=>{const n=ou(),{registry:r,invalidateQueries:s}=qT(),[a,o]=O.useState({status:"idle",data:null,error:null}),i=O.useCallback(async u=>{if(!n.enabled){const p=new Error("Executor workspace context is not ready");throw o({status:"error",data:null,error:p}),p}const l={workspaceId:n.workspaceId,accountId:n.accountId,registry:r,invalidateQueries:s};o(p=>({status:"pending",data:p.data,error:null}));const d=t?.optimisticUpdate?.(l,u),h=typeof d=="function"?d:d?.rollback,f=typeof d=="function"?void 0:d?.value;try{const p=await e({workspaceId:n.workspaceId,accountId:n.accountId,payload:u});return t?.onSuccess?.(l,u,p,f),o({status:"success",data:p,error:null}),p}catch(p){h?.(),WF("source mutation failed",{workspaceId:n.workspaceId,accountId:n.accountId,payload:u,error:KF(p),cause:p});const x=p instanceof Error?p:new Error(String(p));throw o({status:"error",data:null,error:x}),x}},[e,s,t,r,n.accountId,n.enabled,n.workspaceId]),c=O.useCallback(()=>{o({status:"idle",data:null,error:null})},[]);return O.useMemo(()=>({...a,mutateAsync:i,reset:c}),[i,c,a])},aye=e=>{const t=O.useContext(Am),n=O.useMemo(eye,[]),r=O.useCallback(a=>{tye(t,n,a)},[n,t]),s=O.useMemo(()=>({registry:t,activeQueries:n,invalidateQueries:r}),[n,r,t]);return O.createElement(VF.Provider,{value:s},e.children)},oye=e=>O.createElement(yhe,null,O.createElement(aye,null,e.children)),iye=()=>{const{invalidateQueries:e}=qT();return O.useCallback(()=>{e()},[e])},VT=()=>Io(Q0e(md)),GT=()=>Io(HT(md)),ZF=()=>{const e=O.useContext(Am);return O.useCallback(()=>{e.refresh(HT(md))},[e])},KT=e=>{const t=O.useContext(Am),[n,r]=O.useState({status:"idle",data:null,error:null}),s=O.useCallback(async o=>{r(i=>({status:"pending",data:i.data,error:null}));try{const i=await e(o);return t.refresh(HT(md)),r({status:"success",data:i,error:null}),i}catch(i){const c=i instanceof Error?i:new Error(String(i));throw r({status:"error",data:null,error:c}),c}},[e,t]),a=O.useCallback(()=>{r({status:"idle",data:null,error:null})},[]);return O.useMemo(()=>({...n,mutateAsync:s,reset:a}),[s,a,n])},WT=()=>KT(O.useCallback(e=>is({execute:t=>t.local.createSecret({payload:e})}),[])),cye=()=>KT(O.useCallback(e=>is({execute:t=>t.local.updateSecret({path:{secretId:e.secretId},payload:e.payload})}),[])),uye=()=>KT(O.useCallback(e=>is({execute:t=>t.local.deleteSecret({path:{secretId:e}})}),[])),j1=()=>{const e=ou(),t=wi(e.enabled,e.workspaceId,e.accountId);gd("sourceLists",t,e.enabled);const n=Io(xo(t));return e.enabled?n:pd(e.workspace)},e8=e=>{const t=ou(),n=t.enabled?e:M1,r=Uc(t.enabled,t.workspaceId,t.accountId,n);gd("sources",r,t.enabled);const s=Io(Hc(r));return t.enabled?s:pd(t.workspace)},lye=e=>{const t=ou(),n=K0e(t.enabled&&e!==null,t.workspaceId,t.accountId,e);gd("workspaceOauthClients",n,t.enabled&&e!==null);const r=Io(XF(n));return t.enabled?r:pd(t.workspace)},dye=e=>{const t=ou(),n=t.enabled?e:M1,r=Uc(t.enabled,t.workspaceId,t.accountId,n);gd("inspections",r,t.enabled);const s=Io(YF(r));return t.enabled?s:pd(t.workspace)},hye=(e,t)=>{const n=ou(),r=n.enabled?e:M1,s=V0e(n.enabled,n.workspaceId,n.accountId,r,t);gd("toolDetails",s,n.enabled&&t!==null);const a=Io(JF(s));return n.enabled?a:pd(n.workspace)},fye=e=>{const t=ou(),n=t.enabled?e.sourceId:M1,r=G0e(t.enabled,t.workspaceId,t.accountId,n,e.query,e.limit??null);gd("discoveries",r,t.enabled);const s=Io(QF(r));return t.enabled?s:pd(t.workspace)},mye=()=>Ao(O.useCallback(({workspaceId:e,accountId:t,payload:n})=>is({accountId:t,execute:r=>r.sources.create({path:{workspaceId:e},payload:n})}),[]),{optimisticUpdate:(e,t)=>{const n=xo(wi(!0,e.workspaceId,e.accountId)),r=di(e.registry,n);if(r===void 0)return;const s=rye({workspaceId:e.workspaceId,payload:t});return ar(e.registry,n,[s,...r]),{value:s,rollback:()=>{ar(e.registry,n,r)}}},onSuccess:(e,t,n,r)=>{const s=xo(wi(!0,e.workspaceId,e.accountId)),a=di(e.registry,s);if(a!==void 0){const o=r?a.filter(i=>i.id!==r.id):a;ar(e.registry,s,$f(o,n))}ar(e.registry,Hc(Uc(!0,e.workspaceId,e.accountId,n.id)),n),e.invalidateQueries({workspaceId:e.workspaceId,accountId:e.accountId})}}),pye=()=>Ao(O.useCallback(({workspaceId:e,accountId:t,payload:n})=>is({accountId:t,execute:r=>r.sources.update({path:{workspaceId:e,sourceId:n.sourceId},payload:n.payload})}),[]),{optimisticUpdate:(e,t)=>{const n=xo(wi(!0,e.workspaceId,e.accountId)),r=Hc(Uc(!0,e.workspaceId,e.accountId,t.sourceId)),s=di(e.registry,n),a=di(e.registry,r)??s?.find(i=>i.id===t.sourceId);if(a===void 0)return;const o=sye(a,t.payload);return s!==void 0&&ar(e.registry,n,$f(s,o)),ar(e.registry,r,o),()=>{s!==void 0&&ar(e.registry,n,s),ar(e.registry,r,a)}},onSuccess:(e,t,n)=>{const r=xo(wi(!0,e.workspaceId,e.accountId)),s=Hc(Uc(!0,e.workspaceId,e.accountId,t.sourceId)),a=di(e.registry,r);a!==void 0&&ar(e.registry,r,$f(a,n)),ar(e.registry,s,n),e.invalidateQueries({workspaceId:e.workspaceId,accountId:e.accountId,sourceId:t.sourceId})}}),gye=()=>Ao(O.useCallback(({workspaceId:e,accountId:t,payload:n})=>is({accountId:t,execute:r=>r.oauth.startSourceAuth({path:{workspaceId:e},payload:n})}),[])),bye=()=>Ao(O.useCallback(({workspaceId:e,accountId:t,payload:n})=>is({accountId:t,execute:r=>r.sources.remove({path:{workspaceId:e,sourceId:n}})}),[]),{optimisticUpdate:(e,t)=>{const n=xo(wi(!0,e.workspaceId,e.accountId)),r=di(e.registry,n);if(r!==void 0)return ar(e.registry,n,nye(r,t)),()=>{ar(e.registry,n,r)}},onSuccess:(e,t)=>{e.invalidateQueries({workspaceId:e.workspaceId,accountId:e.accountId,sourceId:t})}}),yye=()=>Ao(O.useCallback(({accountId:e,payload:t})=>is({accountId:e,execute:n=>n.sources.discover({payload:t})}),[])),t8=()=>Ao(O.useCallback(({workspaceId:e,accountId:t,payload:n})=>is({accountId:t,execute:r=>r.sources.connect({path:{workspaceId:e},payload:n})}),[]),{onSuccess:(e,t,n)=>{const r=xo(wi(!0,e.workspaceId,e.accountId)),s=di(e.registry,r);s!==void 0&&ar(e.registry,r,$f(s,n.source)),ar(e.registry,Hc(Uc(!0,e.workspaceId,e.accountId,n.source.id)),n.source),e.invalidateQueries({workspaceId:e.workspaceId,accountId:e.accountId})}}),kye=()=>Ao(O.useCallback(({workspaceId:e,accountId:t,payload:n})=>is({accountId:t,execute:r=>r.sources.connectBatch({path:{workspaceId:e},payload:n})}),[]),{onSuccess:(e,t,n)=>{const r=xo(wi(!0,e.workspaceId,e.accountId)),s=di(e.registry,r);if(s!==void 0){let a=s;for(const o of n.results)a=$f(a,o.source),ar(e.registry,Hc(Uc(!0,e.workspaceId,e.accountId,o.source.id)),o.source);ar(e.registry,r,a)}e.invalidateQueries({workspaceId:e.workspaceId,accountId:e.accountId})}}),xye=()=>Ao(O.useCallback(({workspaceId:e,accountId:t,payload:n})=>is({accountId:t,execute:r=>r.sources.createWorkspaceOauthClient({path:{workspaceId:e},payload:n})}),[]),{onSuccess:e=>{e.invalidateQueries({workspaceId:e.workspaceId,accountId:e.accountId})}}),_ye=()=>Ao(O.useCallback(({workspaceId:e,accountId:t,payload:n})=>is({accountId:t,execute:r=>r.sources.removeProviderAuthGrant({path:{workspaceId:e,grantId:n}})}),[]),{onSuccess:e=>{e.invalidateQueries({workspaceId:e.workspaceId,accountId:e.accountId})}});function n8(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=n8(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function D1(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=n8(e))&&(r&&(r+=" "),r+=t);return r}const vye=(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},wye=(e,t)=>({classGroupId:e,validator:t}),r8=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),E0="-",BR=[],Sye="arbitrary..",Eye=e=>{const t=Cye(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return Tye(o);const i=o.split(E0),c=i[0]===""&&i.length>1?1:0;return s8(i,c,t)},getConflictingClassGroupIds:(o,i)=>{if(i){const c=r[o],u=n[o];return c?u?vye(u,c):c:u||BR}return n[o]||BR}}},s8=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],a=n.nextPart.get(s);if(a){const u=s8(e,t+1,a);if(u)return u}const o=n.validators;if(o===null)return;const i=t===0?e.join(E0):e.slice(t).join(E0),c=o.length;for(let u=0;u<c;u++){const l=o[u];if(l.validator(i))return l.classGroupId}},Tye=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?Sye+r:void 0})(),Cye=e=>{const{theme:t,classGroups:n}=e;return Iye(n,t)},Iye=(e,t)=>{const n=r8();for(const r in e){const s=e[r];YT(s,n,r,t)}return n},YT=(e,t,n,r)=>{const s=e.length;for(let a=0;a<s;a++){const o=e[a];Aye(o,t,n,r)}},Aye=(e,t,n,r)=>{if(typeof e=="string"){Nye(e,t,n);return}if(typeof e=="function"){Rye(e,t,n,r);return}Pye(e,t,n,r)},Nye=(e,t,n)=>{const r=e===""?t:a8(t,e);r.classGroupId=n},Rye=(e,t,n,r)=>{if(Oye(e)){YT(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(wye(n,e))},Pye=(e,t,n,r)=>{const s=Object.entries(e),a=s.length;for(let o=0;o<a;o++){const[i,c]=s[o];YT(c,a8(t,i),n,r)}},a8=(e,t)=>{let n=e;const r=t.split(E0),s=r.length;for(let a=0;a<s;a++){const o=r[a];let i=n.nextPart.get(o);i||(i=r8(),n.nextPart.set(o,i)),n=i}return n},Oye=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Lye=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)}}},Jv="!",zR=":",$ye=[],UR=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),Mye=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 x=0;x<l;x++){const g=s[x];if(o===0&&i===0){if(g===zR){a.push(s.slice(c,x)),c=x+1;continue}if(g==="/"){u=x;continue}}g==="["?o++:g==="]"?o--:g==="("?i++:g===")"&&i--}const d=a.length===0?s:s.slice(c);let h=d,f=!1;d.endsWith(Jv)?(h=d.slice(0,-1),f=!0):d.startsWith(Jv)&&(h=d.slice(1),f=!0);const p=u&&u>c?u-c:void 0;return UR(a,f,h,p)};if(t){const s=t+zR,a=r;r=o=>o.startsWith(s)?a(o.slice(s.length)):UR($ye,!1,o,void 0,!0)}if(n){const s=r;r=a=>n({className:a,parseClassName:s})}return r},jye=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}},Dye=e=>({cache:Lye(e.cacheSize),parseClassName:Mye(e),sortModifiers:jye(e),...Eye(e)}),Fye=/\s+/,Bye=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:a}=t,o=[],i=e.trim().split(Fye);let c="";for(let u=i.length-1;u>=0;u-=1){const l=i[u],{isExternal:d,modifiers:h,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:x}=n(l);if(d){c=l+(c.length>0?" "+c:c);continue}let g=!!x,b=r(g?p.substring(0,x):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 y=h.length===0?"":h.length===1?h[0]:a(h).join(":"),_=f?y+Jv:y,S=_+b;if(o.indexOf(S)>-1)continue;o.push(S);const w=s(b,g);for(let v=0;v<w.length;++v){const C=w[v];o.push(_+C)}c=l+(c.length>0?" "+c:c)}return c},zye=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=o8(n))&&(s&&(s+=" "),s+=r);return s},o8=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=o8(e[r]))&&(n&&(n+=" "),n+=t);return n},Uye=(e,...t)=>{let n,r,s,a;const o=c=>{const u=t.reduce((l,d)=>d(l),e());return n=Dye(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=Bye(c,n);return s(c,l),l};return a=o,(...c)=>a(zye(...c))},Hye=[],vn=e=>{const t=n=>n[e]||Hye;return t.isThemeGetter=!0,t},i8=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,c8=/^\((?:(\w[\w-]*):)?(.+)\)$/i,qye=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Vye=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Gye=/\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$/,Kye=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Wye=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Yye=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Oo=e=>qye.test(e),rt=e=>!!e&&!Number.isNaN(Number(e)),Lo=e=>!!e&&Number.isInteger(Number(e)),gx=e=>e.endsWith("%")&&rt(e.slice(0,-1)),Ja=e=>Vye.test(e),u8=()=>!0,Jye=e=>Gye.test(e)&&!Kye.test(e),JT=()=>!1,Qye=e=>Wye.test(e),Xye=e=>Yye.test(e),Zye=e=>!Te(e)&&!Ie(e),e1e=e=>$i(e,h8,JT),Te=e=>i8.test(e),Hi=e=>$i(e,f8,Jye),HR=e=>$i(e,c1e,rt),t1e=e=>$i(e,p8,u8),n1e=e=>$i(e,m8,JT),qR=e=>$i(e,l8,JT),r1e=e=>$i(e,d8,Xye),og=e=>$i(e,g8,Qye),Ie=e=>c8.test(e),Gd=e=>iu(e,f8),s1e=e=>iu(e,m8),VR=e=>iu(e,l8),a1e=e=>iu(e,h8),o1e=e=>iu(e,d8),ig=e=>iu(e,g8,!0),i1e=e=>iu(e,p8,!0),$i=(e,t,n)=>{const r=i8.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},iu=(e,t,n=!1)=>{const r=c8.exec(e);return r?r[1]?t(r[1]):n:!1},l8=e=>e==="position"||e==="percentage",d8=e=>e==="image"||e==="url",h8=e=>e==="length"||e==="size"||e==="bg-size",f8=e=>e==="length",c1e=e=>e==="number",m8=e=>e==="family-name",p8=e=>e==="number"||e==="weight",g8=e=>e==="shadow",u1e=()=>{const e=vn("color"),t=vn("font"),n=vn("text"),r=vn("font-weight"),s=vn("tracking"),a=vn("leading"),o=vn("breakpoint"),i=vn("container"),c=vn("spacing"),u=vn("radius"),l=vn("shadow"),d=vn("inset-shadow"),h=vn("text-shadow"),f=vn("drop-shadow"),p=vn("blur"),x=vn("perspective"),g=vn("aspect"),b=vn("ease"),y=vn("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],w=()=>[...S(),Ie,Te],v=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],I=()=>[Ie,Te,c],R=()=>[Oo,"full","auto",...I()],N=()=>[Lo,"none","subgrid",Ie,Te],z=()=>["auto",{span:["full",Lo,Ie,Te]},Lo,Ie,Te],V=()=>[Lo,"auto",Ie,Te],ne=()=>["auto","min","max","fr",Ie,Te],J=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],te=()=>["start","end","center","stretch","center-safe","end-safe"],se=()=>["auto",...I()],oe=()=>[Oo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],me=()=>[Oo,"screen","full","dvw","lvw","svw","min","max","fit",...I()],Xe=()=>[Oo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],T=()=>[e,Ie,Te],q=()=>[...S(),VR,qR,{position:[Ie,Te]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",a1e,e1e,{size:[Ie,Te]}],P=()=>[gx,Gd,Hi],D=()=>["","none","full",u,Ie,Te],Y=()=>["",rt,Gd,Hi],ke=()=>["solid","dashed","dotted","double"],ye=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],we=()=>[rt,gx,VR,qR],Oe=()=>["","none",p,Ie,Te],G=()=>["none",rt,Ie,Te],W=()=>["none",rt,Ie,Te],ae=()=>[rt,Ie,Te],ce=()=>[Oo,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ja],breakpoint:[Ja],color:[u8],container:[Ja],"drop-shadow":[Ja],ease:["in","out","in-out"],font:[Zye],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ja],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ja],shadow:[Ja],spacing:["px",rt],text:[Ja],"text-shadow":[Ja],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Oo,Te,Ie,g]}],container:["container"],columns:[{columns:[rt,Te,Ie,i]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"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:w()}],overflow:[{overflow:v()}],"overflow-x":[{"overflow-x":v()}],"overflow-y":[{"overflow-y":v()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{"inset-s":R(),start:R()}],end:[{"inset-e":R(),end:R()}],"inset-bs":[{"inset-bs":R()}],"inset-be":[{"inset-be":R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[Lo,"auto",Ie,Te]}],basis:[{basis:[Oo,"full","auto",i,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[rt,Oo,"auto","initial","none",Te]}],grow:[{grow:["",rt,Ie,Te]}],shrink:[{shrink:["",rt,Ie,Te]}],order:[{order:[Lo,"first","last","none",Ie,Te]}],"grid-cols":[{"grid-cols":N()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":N()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ne()}],"auto-rows":[{"auto-rows":ne()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...J(),"normal"]}],"justify-items":[{"justify-items":[...te(),"normal"]}],"justify-self":[{"justify-self":["auto",...te()]}],"align-content":[{content:["normal",...J()]}],"align-items":[{items:[...te(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...te(),{baseline:["","last"]}]}],"place-content":[{"place-content":J()}],"place-items":[{"place-items":[...te(),"baseline"]}],"place-self":[{"place-self":["auto",...te()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pbs:[{pbs:I()}],pbe:[{pbe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:se()}],mx:[{mx:se()}],my:[{my:se()}],ms:[{ms:se()}],me:[{me:se()}],mbs:[{mbs:se()}],mbe:[{mbe:se()}],mt:[{mt:se()}],mr:[{mr:se()}],mb:[{mb:se()}],ml:[{ml:se()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:oe()}],"inline-size":[{inline:["auto",...me()]}],"min-inline-size":[{"min-inline":["auto",...me()]}],"max-inline-size":[{"max-inline":["none",...me()]}],"block-size":[{block:["auto",...Xe()]}],"min-block-size":[{"min-block":["auto",...Xe()]}],"max-block-size":[{"max-block":["none",...Xe()]}],w:[{w:[i,"screen",...oe()]}],"min-w":[{"min-w":[i,"screen","none",...oe()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[o]},...oe()]}],h:[{h:["screen","lh",...oe()]}],"min-h":[{"min-h":["screen","lh","none",...oe()]}],"max-h":[{"max-h":["screen","lh",...oe()]}],"font-size":[{text:["base",n,Gd,Hi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,i1e,t1e]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",gx,Te]}],"font-family":[{font:[s1e,n1e,t]}],"font-features":[{"font-features":[Te]}],"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,Ie,Te]}],"line-clamp":[{"line-clamp":[rt,"none",Ie,HR]}],leading:[{leading:[a,...I()]}],"list-image":[{"list-image":["none",Ie,Te]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ie,Te]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ke(),"wavy"]}],"text-decoration-thickness":[{decoration:[rt,"from-font","auto",Ie,Hi]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[rt,"auto",Ie,Te]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ie,Te]}],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",Ie,Te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:q()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Lo,Ie,Te],radial:["",Ie,Te],conic:[Lo,Ie,Te]},o1e,r1e]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],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:Y()}],"border-w-x":[{"border-x":Y()}],"border-w-y":[{"border-y":Y()}],"border-w-s":[{"border-s":Y()}],"border-w-e":[{"border-e":Y()}],"border-w-bs":[{"border-bs":Y()}],"border-w-be":[{"border-be":Y()}],"border-w-t":[{"border-t":Y()}],"border-w-r":[{"border-r":Y()}],"border-w-b":[{"border-b":Y()}],"border-w-l":[{"border-l":Y()}],"divide-x":[{"divide-x":Y()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Y()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ke(),"hidden","none"]}],"divide-style":[{divide:[...ke(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-bs":[{"border-bs":T()}],"border-color-be":[{"border-be":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...ke(),"none","hidden"]}],"outline-offset":[{"outline-offset":[rt,Ie,Te]}],"outline-w":[{outline:["",rt,Gd,Hi]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",l,ig,og]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",d,ig,og]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[rt,Hi]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":Y()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",h,ig,og]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[rt,Ie,Te]}],"mix-blend":[{"mix-blend":[...ye(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ye()}],"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":[rt]}],"mask-image-linear-from-pos":[{"mask-linear-from":we()}],"mask-image-linear-to-pos":[{"mask-linear-to":we()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":we()}],"mask-image-t-to-pos":[{"mask-t-to":we()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":we()}],"mask-image-r-to-pos":[{"mask-r-to":we()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":we()}],"mask-image-b-to-pos":[{"mask-b-to":we()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":we()}],"mask-image-l-to-pos":[{"mask-l-to":we()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":we()}],"mask-image-x-to-pos":[{"mask-x-to":we()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":we()}],"mask-image-y-to-pos":[{"mask-y-to":we()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[Ie,Te]}],"mask-image-radial-from-pos":[{"mask-radial-from":we()}],"mask-image-radial-to-pos":[{"mask-radial-to":we()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"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":S()}],"mask-image-conic-pos":[{"mask-conic":[rt]}],"mask-image-conic-from-pos":[{"mask-conic-from":we()}],"mask-image-conic-to-pos":[{"mask-conic-to":we()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ie,Te]}],filter:[{filter:["","none",Ie,Te]}],blur:[{blur:Oe()}],brightness:[{brightness:[rt,Ie,Te]}],contrast:[{contrast:[rt,Ie,Te]}],"drop-shadow":[{"drop-shadow":["","none",f,ig,og]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",rt,Ie,Te]}],"hue-rotate":[{"hue-rotate":[rt,Ie,Te]}],invert:[{invert:["",rt,Ie,Te]}],saturate:[{saturate:[rt,Ie,Te]}],sepia:[{sepia:["",rt,Ie,Te]}],"backdrop-filter":[{"backdrop-filter":["","none",Ie,Te]}],"backdrop-blur":[{"backdrop-blur":Oe()}],"backdrop-brightness":[{"backdrop-brightness":[rt,Ie,Te]}],"backdrop-contrast":[{"backdrop-contrast":[rt,Ie,Te]}],"backdrop-grayscale":[{"backdrop-grayscale":["",rt,Ie,Te]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[rt,Ie,Te]}],"backdrop-invert":[{"backdrop-invert":["",rt,Ie,Te]}],"backdrop-opacity":[{"backdrop-opacity":[rt,Ie,Te]}],"backdrop-saturate":[{"backdrop-saturate":[rt,Ie,Te]}],"backdrop-sepia":[{"backdrop-sepia":["",rt,Ie,Te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ie,Te]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[rt,"initial",Ie,Te]}],ease:[{ease:["linear","initial",b,Ie,Te]}],delay:[{delay:[rt,Ie,Te]}],animate:[{animate:["none",y,Ie,Te]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,Ie,Te]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:G()}],"rotate-x":[{"rotate-x":G()}],"rotate-y":[{"rotate-y":G()}],"rotate-z":[{"rotate-z":G()}],scale:[{scale:W()}],"scale-x":[{"scale-x":W()}],"scale-y":[{"scale-y":W()}],"scale-z":[{"scale-z":W()}],"scale-3d":["scale-3d"],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[Ie,Te,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ce()}],"translate-x":[{"translate-x":ce()}],"translate-y":[{"translate-y":ce()}],"translate-z":[{"translate-z":ce()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"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",Ie,Te]}],"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":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mbs":[{"scroll-mbs":I()}],"scroll-mbe":[{"scroll-mbe":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pbs":[{"scroll-pbs":I()}],"scroll-pbe":[{"scroll-pbe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",Ie,Te]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[rt,Gd,Hi,HR]}],stroke:[{stroke:["none",...T()]}],"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"]}},QT=Uye(u1e);function je(...e){return QT(D1(e))}function l1e({className:e,...t}){return m.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:je("size-4",e),...t,children:[m.jsx("rect",{x:"2",y:"2",width:"5",height:"5",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),m.jsx("rect",{x:"9",y:"2",width:"5",height:"5",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),m.jsx("rect",{x:"2",y:"9",width:"5",height:"5",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),m.jsx("rect",{x:"9",y:"9",width:"5",height:"5",rx:"1",stroke:"currentColor",strokeWidth:"1.3"})]})}function XT({className:e,...t}){return m.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:je("size-4",e),...t,children:m.jsx("path",{d:"M4 8h8M8 4v8",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})})}function b8({className:e,...t}){return m.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:je("size-4",e),...t,children:[m.jsx("circle",{cx:"7",cy:"7",r:"4.5",stroke:"currentColor",strokeWidth:"1.3"}),m.jsx("path",{d:"M10.5 10.5L14 14",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}function GR({className:e,...t}){return m.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:je("size-3",e),...t,children:m.jsx("path",{d:"M6 4l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function d1e({className:e,...t}){return m.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:je("size-3",e),...t,children:m.jsx("path",{d:"M2 4h5l2 2h5v7H2V4z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function h1e({className:e,...t}){return m.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:je("size-4",e),...t,children:[m.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.3"}),m.jsx("path",{d:"M6.5 5.5l4.5 2-2 4.5-4.5-2z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})]})}function ZT({className:e,...t}){return m.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:je("size-3.5",e),...t,children:[m.jsx("rect",{x:"5",y:"5",width:"8",height:"8",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),m.jsx("path",{d:"M11 3H4a1 1 0 00-1 1v7",stroke:"currentColor",strokeWidth:"1.2"})]})}function hi({className:e,...t}){return m.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:je("size-3.5",e),...t,children:m.jsx("path",{d:"M4 8.5l3 3 5-6",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function f1e({className:e,...t}){return m.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:je("size-3",e),...t,children:m.jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function y8({className:e,...t}){return m.jsxs("svg",{viewBox:"0 0 48 48",fill:"none",className:je("size-12",e),...t,children:[m.jsx("rect",{x:"6",y:"6",width:"36",height:"36",rx:"4",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M16 18h16M16 24h12M16 30h8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function wr({className:e,...t}){return m.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:je("size-4 animate-spin",e),...t,children:[m.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.5",opacity:"0.2"}),m.jsx("path",{d:"M14 8a6 6 0 00-6-6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function _o({className:e,...t}){return m.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:je("size-4",e),...t,children:m.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function eC({className:e,...t}){return m.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:je("size-4",e),...t,children:[m.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"}),m.jsx("path",{d:"M9.75 5l1.25 1.25",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function Qv({className:e,...t}){return m.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:je("size-4",e),...t,children:m.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 k8({className:e,...t}){return m.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:je("size-4",e),...t,children:m.jsx("path",{d:"M12.75 8H3.25M6.75 4.5L3.25 8l3.5 3.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function cu(e){return e.loadable.status==="loading"?m.jsx("div",{className:"flex h-full min-h-48 items-center justify-center",children:m.jsxs("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[m.jsx(wr,{}),m.jsx("span",{children:e.loading??"Loading..."})]})}):e.loadable.status==="error"?m.jsx("div",{className:"flex h-full min-h-48 items-center justify-center",children:m.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})}):m.jsx(m.Fragment,{children:e.children(e.loadable.data)})}function Xv(e){return m.jsx("div",{className:`flex h-full items-center justify-center ${e.className??""}`,children:m.jsxs("div",{className:"text-center",children:[m.jsx(y8,{className:"mx-auto mb-3 text-muted-foreground/20"}),m.jsx("p",{className:"text-[13px] text-muted-foreground/60",children:e.title}),e.description&&m.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground/40",children:e.description})]})})}function m1e(e,t){return e.endsWith(t)?e.length===t.length||e[e.length-t.length-1]===".":!1}function p1e(e,t){const n=e.length-t.length-2,r=e.lastIndexOf(".",n);return r===-1?e:e.slice(r+1)}function g1e(e,t,n){if(n.validHosts!==null){const s=n.validHosts;for(const a of s)if(m1e(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:p1e(t,e)}function b1e(e,t){return e.slice(0,-t.length-1)}function KR(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),f=e.charCodeAt(n+2),p=e.charCodeAt(n+3),x=e.charCodeAt(n+4);if(!(l===5&&d===104&&h===116&&f===116&&p===112&&x===115)){if(!(l===4&&d===104&&h===116&&f===116&&p===112)){if(!(l===3&&d===119&&h===115&&f===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 y1e(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 k1e(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 x1e(e){return k1e(e)||y1e(e)}function WR(e){return e>=97&&e<=122||e>=48&&e<=57||e>127}function YR(e){if(e.length>255||e.length===0||!WR(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(!(WR(a)||a===45||a===95))return!1;n=a}return r-t-1<=63&&n!==45}function x8({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 _1e=x8({});function v1e(e){return e===void 0?_1e:x8(e)}function w1e(e,t){return t.length===e.length?"":e.slice(0,-t.length-1)}function _8(){return{domain:null,domainWithoutSuffix:null,hostname:null,isIcann:null,isIp:null,isPrivate:null,publicSuffix:null,subdomain:null}}function S1e(e){e.domain=null,e.domainWithoutSuffix=null,e.hostname=null,e.isIcann=null,e.isIp=null,e.isPrivate=null,e.publicSuffix=null,e.subdomain=null}function v8(e,t,n,r,s){const a=v1e(r);return typeof e!="string"||(a.extractHostname?a.mixedInputs?s.hostname=KR(e,YR(e)):s.hostname=KR(e,!1):s.hostname=e,a.detectIp&&s.hostname!==null&&(s.isIp=x1e(s.hostname),s.isIp))?s:a.validateHostname&&a.extractHostname&&s.hostname!==null&&!YR(s.hostname)?(s.hostname=null,s):(t===0||s.hostname===null||(n(s.hostname,a,s),t===2||s.publicSuffix===null)||(s.domain=g1e(s.publicSuffix,s.hostname,a),t===3||s.domain===null)||(s.subdomain=w1e(s.hostname,s.domain),t===4)||(s.domainWithoutSuffix=b1e(s.domain,s.publicSuffix)),s)}function E1e(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 T1e=(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}]}]})(),C1e=(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}],f=[0,{notebook:t,studio:t}],p=[0,{labeling:t,notebook:t,studio:t}],x=[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}],y=[0,{shop:t}],_=[0,{"*":e}],S=[1,{co:t}],w=[0,{objects:t}],v=[2,{"eu-west-1":t,"us-east-1":t}],C=[2,{nodes:t}],I=[0,{my:t}],R=[0,{s3:t,"s3-accesspoint":t,"s3-website":t}],N=[0,{s3:t,"s3-accesspoint":t}],z=[0,{direct:t}],V=[0,{"webview-assets":t}],ne=[0,{vfs:t,"webview-assets":t}],J=[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":V,cloud9:ne}],te=[0,{"execute-api":t,"emrappui-prod":t,"emrnotebooks-prod":t,"emrstudio-prod":t,dualstack:N,s3:t,"s3-accesspoint":t,"s3-object-lambda":t,"s3-website":t,"aws-cloud9":V,cloud9:ne}],se=[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,"analytics-gateway":t,"aws-cloud9":V,cloud9:ne}],oe=[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}],me=[0,{s3:t,"s3-accesspoint":t,"s3-accesspoint-fips":t,"s3-fips":t,"s3-website":t}],Xe=[0,{"execute-api":t,"emrappui-prod":t,"emrnotebooks-prod":t,"emrstudio-prod":t,dualstack:me,s3:t,"s3-accesspoint":t,"s3-accesspoint-fips":t,"s3-fips":t,"s3-object-lambda":t,"s3-website":t,"aws-cloud9":V,cloud9:ne}],T=[0,{"execute-api":t,"emrappui-prod":t,"emrnotebooks-prod":t,"emrstudio-prod":t,dualstack:me,s3:t,"s3-accesspoint":t,"s3-accesspoint-fips":t,"s3-fips":t,"s3-object-lambda":t,"s3-website":t}],q=[0,{"execute-api":t,"emrappui-prod":t,"emrnotebooks-prod":t,"emrstudio-prod":t,dualstack:me,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":V,cloud9:ne}],X=[0,{auth:t}],A=[0,{auth:t,"auth-fips":t}],P=[0,{"auth-fips":t}],D=[0,{apps:t}],Y=[0,{paas:t}],ke=[2,{eu:t}],ye=[0,{app:t}],we=[0,{site:t}],Oe=[1,{com:e,edu:e,net:e,org:e}],G=[0,{j:t}],W=[0,{dyn:t}],ae=[2,{web:t}],ce=[1,{co:e,com:e,edu:e,gov:e,net:e,org:e}],_e=[0,{p:t}],Re=[0,{user:t}],H=[1,{ms:t}],ie=[0,{cdn:t}],Se=[2,{raw:s}],$e=[0,{cust:t,reservd:t}],Je=[0,{cust:t}],Gn=[0,{s3:t}],hn=[1,{biz:e,com:e,edu:e,gov:e,info:e,net:e,org:e}],Os=[0,{ipfs:t}],Ur=[1,{framer:t}],Z=[0,{forgot:t}],ue=[0,{blob:t,file:t,web:t}],Ae=[0,{core:ue,servicebus:t}],Ce=[1,{gs:e}],xt=[0,{nes:e}],Pe=[1,{k12:e,cc:e,lib:e}],da=[1,{cc:e}],Nr=[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:y,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:_,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:w,rma:w}],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:_,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:R,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:N,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":f,"cn-northwest-1":f}]}],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:I,myqnapcloud:t,quickconnect:z}],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":J,"ap-east-1":te,"ap-northeast-1":se,"ap-northeast-2":se,"ap-northeast-3":J,"ap-south-1":se,"ap-south-2":oe,"ap-southeast-1":se,"ap-southeast-2":se,"ap-southeast-3":oe,"ap-southeast-4":oe,"ap-southeast-5":[0,{"execute-api":t,dualstack:R,s3:t,"s3-accesspoint":t,"s3-deprecated":t,"s3-object-lambda":t,"s3-website":t}],"ca-central-1":Xe,"ca-west-1":T,"eu-central-1":se,"eu-central-2":oe,"eu-north-1":te,"eu-south-1":J,"eu-south-2":oe,"eu-west-1":[0,{"execute-api":t,"emrappui-prod":t,"emrnotebooks-prod":t,"emrstudio-prod":t,dualstack:R,s3:t,"s3-accesspoint":t,"s3-deprecated":t,"s3-object-lambda":t,"s3-website":t,"analytics-gateway":t,"aws-cloud9":V,cloud9:ne}],"eu-west-2":te,"eu-west-3":J,"il-central-1":[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":V,cloud9:[0,{vfs:t}]}],"me-central-1":oe,"me-south-1":te,"sa-east-1":J,"us-east-1":[2,{"execute-api":t,"emrappui-prod":t,"emrnotebooks-prod":t,"emrstudio-prod":t,dualstack:me,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":V,cloud9:ne}],"us-east-2":q,"us-gov-east-1":T,"us-gov-west-1":T,"us-west-1":Xe,"us-west-2":q,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":X,"ap-east-1":X,"ap-northeast-1":X,"ap-northeast-2":X,"ap-northeast-3":X,"ap-south-1":X,"ap-south-2":X,"ap-southeast-1":X,"ap-southeast-2":X,"ap-southeast-3":X,"ap-southeast-4":X,"ap-southeast-5":X,"ap-southeast-7":X,"ca-central-1":X,"ca-west-1":X,"eu-central-1":X,"eu-central-2":X,"eu-north-1":X,"eu-south-1":X,"eu-south-2":X,"eu-west-1":X,"eu-west-2":X,"eu-west-3":X,"il-central-1":X,"me-central-1":X,"me-south-1":X,"mx-central-1":X,"sa-east-1":X,"us-east-1":A,"us-east-2":A,"us-gov-east-1":P,"us-gov-west-1":P,"us-west-1":A,"us-west-2":A}],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":Y,hosteur:[0,{"rag-cloud":t,"rag-cloud-ch":t}],"ik-server":[0,{jcloud:t,"jcloud-ver-jpc":t}],jelastic:[0,{demo:t}],massivegrid:Y,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:ke,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:ke,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:ye,"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":we,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:Oe,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:W,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:ce,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:_,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":X}]}]}],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:_,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:ce,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:y}],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:ie,bubbleapps:t,bigv:[0,{uk0:t}],cleverapps:t,cloudbeesusercontent:t,dappnode:[0,{dyndns:t}],darklang:t,definima:t,dedyn:t,icp0:Se,icp1:Se,qzz:t,"fh-muenster":t,gitbook:t,github:t,gitlab:t,lolipop:t,"hasura-app":t,hostyhosting:t,hypernode:t,moonscale:s,beebyte:Y,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":we,"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:$e,disrec:$e,prod:Je,testing:$e}],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:_,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:Re,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:_,kitakyushu:_,kobe:_,nagoya:_,sapporo:_,sendai:_,yokohama:_,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:Gn,isk02:Gn}],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:hn,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:Oe,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:we,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:_,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:Oe,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:Z,his:Z,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:ie}],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:ie,cloudflarecn:ie,cloudflareglobal:ie,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:Ae,usgovcloudapp:t,usgovtrafficmanager:t,windows:Ae,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:Ce,ah:Ce,bu:Ce,fm:Ce,hl:Ce,hm:Ce,"jan-mayen":Ce,mr:Ce,nl:Ce,nt:Ce,of:Ce,ol:Ce,oslo:Ce,rl:Ce,sf:Ce,st:Ce,svalbard:Ce,tm:Ce,tr:Ce,va:Ce,vf:Ce,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:xt,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:xt,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:_,nr:hn,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:ye,stg:[0,{os:ye}]}],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:Gn,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:_,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:y,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:z,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:Je,"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:_,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:Pe,al:Pe,ar:Pe,as:Pe,az:Pe,ca:Pe,co:Pe,ct:Pe,dc:Pe,de:da,fl:Pe,ga:Pe,gu:Pe,hi:Nr,ia:Pe,id:Pe,il:Pe,in:Pe,ks:Pe,ky:Pe,la:Pe,ma:[1,{k12:[1,{chtr:e,paroch:e,pvt:e}],cc:e,lib:e}],md:Pe,me:Pe,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:Pe,mo:Pe,ms:[1,{k12:e,cc:e}],mt:Pe,nc:Pe,nd:Nr,ne:Pe,nh:Pe,nj:Pe,nm:Pe,nv:Pe,ny:Pe,oh:Pe,ok:Pe,or:Pe,pa:Pe,pr:Pe,ri:Nr,sc:Pe,sd:Nr,tn:Pe,tx:Pe,ut:Pe,va:Pe,vi:Pe,vt:Pe,wa:Pe,wi:Pe,wv:da,wy:Pe,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:Oe,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":f,"ap-east-1":f,"ap-northeast-3":f,"ap-south-2":x,"ap-southeast-3":f,"ap-southeast-4":x,"ca-west-1":[0,{notebook:t,"notebook-fips":t}],"eu-central-2":f,"eu-north-1":f,"eu-south-1":f,"eu-south-2":f,"eu-west-3":f,"il-central-1":f,"me-central-1":f,"me-south-1":f,"sa-east-1":f,"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:S,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:v,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:C,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:C,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:C,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:ae,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:S,email:[1,{crisp:[0,{on:t}],intouch:t,tawk:_e,tawkto:_e}],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:Re}],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:S,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:H,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:Os,mypep:t,storacha:Os,w3s:Os}],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:Ur,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:Ur,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:S,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:ae,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:H,silk:e,sina:e,singles:e,site:[1,{square:t,canva:I,cloudera:s,convex:v,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:S,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:W,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:Ur,wed:e,wedding:e,weibo:e,weir:e,whoswho:e,wien:e,wiki:Ur,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 JR(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 w8(e,t,n){var r;if(E1e(e,t,n))return;const s=e.split("."),a=(t.allowPrivateDomains?2:0)|(t.allowIcannDomains?1:0),o=JR(s,T1e,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=JR(s,C1e,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}const QR=_8();function I1e(e,t={}){return v8(e,5,w8,t,_8())}function S8(e,t={}){return S1e(QR),v8(e,3,w8,t,QR).domain}const A1e=new Set(["raw.githubusercontent.com","cdn.jsdelivr.net","unpkg.com","raw.github.com"]),cg={calendar:"https://ssl.gstatic.com/calendar/images/dynamiclogo_2020q4/calendar_31_2x.png",drive:"https://ssl.gstatic.com/images/branding/product/2x/drive_2020q4_48dp.png",gmail:"https://ssl.gstatic.com/ui/v1/icons/mail/rfr/gmail.ico",docs:"https://ssl.gstatic.com/docs/documents/images/kix-favicon7.ico",sheets:"https://ssl.gstatic.com/docs/spreadsheets/favicon3.ico",slides:"https://ssl.gstatic.com/docs/presentations/images/favicon5.ico",forms:"https://ssl.gstatic.com/docs/forms/device_home/android_192.png",searchconsole:"https://ssl.gstatic.com/search-console/scfe/search_console-64.png",people:"https://ssl.gstatic.com/images/branding/product/2x/contacts_2022_48dp.png",tasks:"https://ssl.gstatic.com/tasks/images/favicon.ico",chat:"https://ssl.gstatic.com/chat/favicon/favicon_v2.ico",keep:"https://ssl.gstatic.com/keep/icon_2020q4v2_128.png",classroom:"https://ssl.gstatic.com/classroom/favicon.png",admin:"https://ssl.gstatic.com/images/branding/product/2x/admin_2020q4_48dp.png",script:"https://ssl.gstatic.com/script/images/favicon.ico",bigquery:"https://ssl.gstatic.com/bqui1/favicon.ico",cloudresourcemanager:"https://www.gstatic.com/devrel-devsite/prod/v0e0f589edd85502a40d78d7d0825db8ea5ef3b99b1571571945f0f3f764ff61b/cloud/images/favicons/onecloud/favicon.ico",youtube:"https://www.youtube.com/s/desktop/a94e1818/img/favicon_32x32.png"},N1e=e=>{if(!e)return null;try{const t=new URL(e),n=t.hostname;if(n.endsWith(".googleapis.com")){const s=n.replace(/\.googleapis\.com$/,"").replace(/-json$/,"");if(cg[s])return cg[s]}const r=t.pathname.match(/\/apis\/([^/]+)\//);if(r?.[1]&&cg[r[1]])return cg[r[1]]}catch{}return null},R1e=e=>{if(!e)return null;try{return new URL(e)}catch{return null}},P1e=e=>{const t=R1e(e);if(!t)return null;if(!A1e.has(t.hostname))return t.origin;const n=t.pathname.split("/").map(r=>r.trim()).filter(r=>r.length>0);for(const r of n){const s=r.replace(/\.(ya?ml|json)$/i,"");if(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/i.test(s))return`https://${s}`}return t.origin},O1e=N1e,XR=e=>{const t=P1e(e);if(!t)return null;try{const n=new URL(t).hostname,s=I1e(n).domain??n;return`https://www.google.com/s2/favicons?domain=${encodeURIComponent(s)}&sz=32`}catch{return null}};function Mf({endpoint:e,kind:t,className:n,size:r=16}){const s=O.useMemo(()=>t==="google_discovery"?O1e(e)??XR(e):XR(e),[e,t]),[a,o]=O.useState(null);return!s||!!(s&&a===s)?m.jsx(L1e,{kind:t,className:n}):m.jsx("img",{src:s,alt:"",width:r,height:r,className:je("size-full object-contain",n),loading:"lazy",referrerPolicy:"no-referrer",onError:()=>o(s)},s)}function L1e({kind:e,className:t}){const n=je("shrink-0",t);switch(e){case"mcp":return m.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:n,children:[m.jsx("rect",{x:"2",y:"3",width:"12",height:"10",rx:"1.5",stroke:"currentColor",strokeWidth:"1.2"}),m.jsx("path",{d:"M5 7h1M5 9h4",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]});case"graphql":return m.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:n,children:[m.jsx("path",{d:"M8 2L14 5.5V10.5L8 14L2 10.5V5.5L8 2Z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),m.jsx("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor",opacity:"0.5"})]});case"openapi":return m.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:n,children:[m.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.2"}),m.jsx("path",{d:"M5 6h6M5 8h4M5 10h5",stroke:"currentColor",strokeWidth:"1.1",strokeLinecap:"round"})]});case"google_discovery":return m.jsxs("svg",{viewBox:"0 0 16 16",className:n,children:[m.jsx("path",{d:"M8 3.2a4.8 4.8 0 00-3.39 8.2l1.02-1.02A3.36 3.36 0 018 4.64a3.33 3.33 0 012.34.96l1.03-1.03A4.78 4.78 0 008 3.2z",fill:"#EA4335"}),m.jsx("path",{d:"M12.8 8c0-.37-.04-.72-.1-1.06H8v2.12h2.7a2.4 2.4 0 01-1 1.52l1.02 1.02A4.8 4.8 0 0012.8 8z",fill:"#4285F4"}),m.jsx("path",{d:"M5.63 9.38A3.36 3.36 0 014.64 8c0-.5.11-.97.3-1.4L3.92 5.58A4.78 4.78 0 003.2 8c0 .88.26 1.7.72 2.4l1.02-1.02z",fill:"#FBBC05"}),m.jsx("path",{d:"M8 12.8c1.2 0 2.27-.4 3.1-1.1l-1.02-1.02c-.54.38-1.24.6-2.08.6a3.36 3.36 0 01-3.07-2.28l-1.02 1.02A4.8 4.8 0 008 12.8z",fill:"#34A853"})]});case"internal":return m.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:n,children:m.jsx("path",{d:"M8 2v12M4 6l4-4 4 4M4 10l4 4 4-4",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})});default:return m.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:n,children:[m.jsx("rect",{x:"2.5",y:"2.5",width:"11",height:"11",rx:"2",stroke:"currentColor",strokeWidth:"1.2"}),m.jsx("path",{d:"M5 6h6M5 8h4M5 10h3",stroke:"currentColor",strokeWidth:"1.1",strokeLinecap:"round"})]})}}const $1e={VITE_APP_VERSION:"1.2.4-beta.6",VITE_GITHUB_URL:"https://github.com/RhysSullivan/executor"},M1e={connected:"bg-primary",probing:"bg-amber-400",draft:"bg-muted-foreground/30",auth_required:"bg-amber-500",error:"bg-destructive"},{VITE_APP_VERSION:ZR,VITE_GITHUB_URL:j1e}=$1e,D1e="/v1/app/npm/dist-tags",F1e=/^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(?:-(?<prerelease>[0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/,B1e=e=>e.includes("-beta.")?"beta":"latest",eP=e=>{const t=e.trim().match(F1e);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},z1e=(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},U1e=(e,t)=>{const n=eP(e),r=eP(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:z1e(n.prerelease,r.prerelease)};function H1e(e){const t=B1e(e),[n,r]=O.useState(null);O.useEffect(()=>{let a=!1;return fetch(D1e).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&&U1e(e,n)===-1;return{latestVersion:n,updateAvailable:s,channel:t}}function q1e(e){const t=`npm i -g executor@${e.channel}`,[n,r]=O.useState(!1),s=O.useCallback(()=>{navigator.clipboard.writeText(t).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})},[t]);return m.jsxs("div",{className:"mx-2 mb-2 rounded-xl border border-primary/25 bg-primary/[0.06] p-3",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("div",{className:"flex size-5 shrink-0 items-center justify-center rounded-full bg-primary/15",children:m.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:"size-3 text-primary",children:[m.jsx("path",{d:"M8 3v7M5 7l3 3 3-3",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M3 12h10",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}),m.jsxs("div",{className:"min-w-0",children:[m.jsx("p",{className:"text-[11px] font-semibold text-foreground",children:"Update available"}),m.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["v",e.latestVersion]})]})]}),m.jsxs("button",{type:"button",onClick:s,className:"mt-2.5 flex w-full items-center justify-between gap-2 rounded-lg border border-border/60 bg-background/50 px-2.5 py-1.5 text-left transition-colors hover:bg-background/80",children:[m.jsx("code",{className:"truncate font-mono text-[10px] text-sidebar-foreground",children:t}),m.jsx("span",{className:"shrink-0 text-muted-foreground transition-colors group-hover:text-foreground",children:n?m.jsx(hi,{className:"size-3 text-primary"}):m.jsx(ZT,{className:"size-3"})})]})]})}function V1e(){const e=j1(),t=BH(),n=t({to:"/"}),r=t({to:"/secrets"}),{latestVersion:s,updateAvailable:a,channel:o}=H1e(ZR);return m.jsxs("div",{className:"flex h-screen overflow-hidden",children:[m.jsxs("aside",{className:"flex w-52 shrink-0 flex-col border-r border-sidebar-border bg-sidebar lg:w-56",children:[m.jsx("div",{className:"flex h-12 shrink-0 items-center border-b border-sidebar-border px-4",children:m.jsxs(nr,{to:"/",className:"flex items-center gap-1.5",children:[m.jsx("span",{className:"font-display text-base tracking-tight text-foreground",children:"executor"}),m.jsx("span",{className:"rounded bg-primary/15 px-1.5 py-0.5 text-[10px] font-medium text-primary",children:"v3"})]})}),m.jsxs("nav",{className:"flex flex-1 flex-col p-2 overflow-y-auto",children:[m.jsx(tP,{to:"/",label:"Dashboard",active:!!n}),m.jsx(tP,{to:"/secrets",label:"Secrets",active:!!r}),m.jsx("div",{className:"mt-5 mb-1 px-2.5 text-[10px] font-medium uppercase tracking-widest text-muted-foreground/50",children:m.jsxs("div",{className:"flex items-center justify-between gap-2",children:[m.jsx("span",{children:"Sources"}),m.jsxs(nr,{to:"/sources/add",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:[m.jsx(_o,{className:"size-3"}),"Add"]})]})}),m.jsx(cu,{loadable:e,loading:"Loading...",children:i=>i.length===0?m.jsx("div",{className:"px-2.5 py-2 text-[11px] leading-relaxed text-muted-foreground/40",children:"No sources yet"}):m.jsx("div",{className:"flex flex-col gap-px",children:i.map(c=>m.jsx(G1e,{source:c,matchRoute:t},c.id))})})]}),a&&s&&m.jsx(q1e,{latestVersion:s,channel:o}),m.jsx("div",{className:"shrink-0 border-t border-sidebar-border px-4 py-2.5",children:m.jsxs("div",{className:"flex items-center justify-between text-[10px] leading-none",children:[m.jsxs("span",{className:"text-muted-foreground/70 tabular-nums",children:["v",ZR]}),m.jsx("a",{href:j1e,target:"_blank",rel:"noreferrer",className:"text-muted-foreground/70 transition-colors hover:text-foreground",children:"GitHub"})]})})]}),m.jsx("main",{className:"flex flex-1 flex-col min-w-0 overflow-hidden",children:m.jsx(iL,{})})]})}function G1e(e){const{source:t,matchRoute:n}=e,r=n({to:"/sources/$sourceId",params:{sourceId:t.id},fuzzy:!0});return m.jsxs(nr,{to:"/sources/$sourceId",params:{sourceId:t.id},search:{tab:"model"},className:je("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:[m.jsx("div",{className:"flex size-3 shrink-0 items-center justify-center text-muted-foreground/50",children:m.jsx(Mf,{endpoint:t.endpoint,kind:t.kind,className:"size-3"})}),m.jsx("span",{className:"flex-1 truncate",children:t.name}),m.jsx("span",{className:je("size-1.5 shrink-0 rounded-full",M1e[t.status]??"bg-muted-foreground/30"),title:t.status})]})}function tP(e){return m.jsx(nr,{to:e.to,className:je("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})}var Kt=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function K1e(e){return tC(e)}function tC(e){return Array.isArray(e)?W1e(e):e instanceof RegExp?e:typeof e=="object"?Y1e(e):e}function W1e(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=tC(e[n]);return t}function Y1e(e){let t={};for(let n in e)t[n]=tC(e[n]);return t}function E8(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function T8(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?T8(e.substring(0,e.length-1)):e.substr(~t+1)}var bx=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,ug=class{static hasCaptures(e){return e===null?!1:(bx.lastIndex=0,bx.test(e))}static replaceCaptures(e,t,n){return e.replace(bx,(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 C8(e,t){return e<t?-1:e>t?1:0}function I8(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=C8(e[s],t[s]);if(a!==0)return a}return 0}return n-r}function nP(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 A8(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var N8=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}},T0=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(X1e(e),t)}static createFromParsedTheme(e,t){return eke(e,t)}_cachedMatchRoot=new N8(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=>J1e(e.parent,s.parentScopes));return r?new R8(r.fontStyle,r.foreground,r.background):null}},yx=class tb{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new tb(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new tb(n,t[r]);return n}push(t){return new tb(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 J1e(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&&!Q1e(e.scopeName,r);){if(s)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Q1e(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var R8=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function X1e(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,f=d.length;h<f;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"&&nP(o.settings.foreground)&&(u=o.settings.foreground);let l=null;typeof o.settings.background=="string"&&nP(o.settings.background)&&(l=o.settings.background);for(let d=0,h=i.length;d<h;d++){let p=i[d].trim().split(" "),x=p[p.length-1],g=null;p.length>1&&(g=p.slice(0,p.length-1),g.reverse()),n[r++]=new Z1e(x,g,s,c,u,l)}}return n}var Z1e=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}},or=(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))(or||{});function eke(e,t){e.sort((c,u)=>{let l=C8(c.scope,u.scope);return l!==0||(l=I8(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 tke(t),o=new R8(n,a.getId(r),a.getId(s)),i=new rke(new Zv(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 T0(a,o,i)}var tke=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)}},nke=Object.freeze([]),Zv=class P8{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,r,s,a){this.scopeDepth=t,this.parentScopes=n||nke,this.fontStyle=r,this.foreground=s,this.background=a}clone(){return new P8(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)}},rke=class ew{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(ew._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 ew(this._mainRule.clone(),Zv.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(I8(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 Zv(t,n,r,s,a))}},Dl=class ls{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=ls.getLanguageId(t),r=ls.getTokenType(t),s=ls.getFontStyle(t),a=ls.getForeground(t),o=ls.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=ls.getLanguageId(t),u=ls.getTokenType(t),l=ls.containsBalancedBrackets(t)?1:0,d=ls.getFontStyle(t),h=ls.getForeground(t),f=ls.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&&(f=i),(c<<0|u<<8|l<<10|d<<11|h<<15|f<<24)>>>0}};function C0(e,t){const n=[],r=ske(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(rP(s)){const c=[];do c.push(s),s=r.next();while(rP(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 rP(e){return!!e&&!!e.match(/[\w\.:]+/)}function ske(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 O8(e){typeof e.dispose=="function"&&e.dispose()}var jf=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},ake=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},oke=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))}},ike=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new jf(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new oke;for(const n of e)cke(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof jf){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 cke(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 jf?nb({baseGrammar:a,selfGrammar:s},r):tw(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 jf(i))}function tw(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];I0([r],t,n)}}function nb(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&I0(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&I0(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function I0(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const s=r.repository?E8({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&I0(r.patterns,{...t,repository:s},n);const a=r.include;if(!a)continue;const o=L8(a);switch(o.kind){case 0:nb({...t,selfGrammar:t.baseGrammar},n);break;case 1:nb(t,n);break;case 2:tw(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?tw(o.ruleName,c,n):nb(c,n)}else o.kind===4?n.add(new ake(o.scopeName,o.ruleName)):n.add(new jf(o.scopeName));break}}}var uke=class{kind=0},lke=class{kind=1},dke=class{constructor(e){this.ruleName=e}kind=2},hke=class{constructor(e){this.scopeName=e}kind=3},fke=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function L8(e){if(e==="$base")return new uke;if(e==="$self")return new lke;const t=e.indexOf("#");if(t===-1)return new hke(e);if(t===0)return new dke(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new fke(n,r)}}var mke=/\\(\d+)/,sP=/\\(\d+)/g,pke=-1,$8=-2;var Dm=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=ug.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=ug.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${T8(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:ug.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:ug.replaceCaptures(this._contentName,e,t)}},gke=class extends Dm{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!")}},bke=class extends Dm{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,s){super(e,t,n,null),this._match=new Df(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 Ff,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},aP=class extends Dm{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 Ff,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},nw=class extends Dm{_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 Df(s,this.id),this.beginCaptures=a,this._end=new Df(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 Ff;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}},A0=class extends Dm{_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 Df(s,this.id),this.beginCaptures=a,this.whileCaptures=i,this._while=new Df(o,$8),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 Ff;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 Ff,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},M8=class sr{static createCaptureRule(t,n,r,s,a){return t.registerRule(o=>new gke(n,o,r,s,a))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(s=>{if(t.id=s,t.match)return new bke(t.$vscodeTextmateLocation,t.id,t.name,t.match,sr._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=E8({},r,t.repository));let a=t.patterns;return typeof a>"u"&&t.include&&(a=[{include:t.include}]),new aP(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,sr._compilePatterns(a,n,r))}return t.while?new A0(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,sr._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,sr._compileCaptures(t.whileCaptures||t.captures,n,r),sr._compilePatterns(t.patterns,n,r)):new nw(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,sr._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,sr._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,sr._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=sr.getCompiledRuleId(t[o],n,r)),s[i]=sr.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=L8(i.include);switch(u.kind){case 0:case 1:c=sr.getCompiledRuleId(r[i.include],n,r);break;case 2:let l=r[u.ruleName];l&&(c=sr.getCompiledRuleId(l,n,r));break;case 3:case 4:const d=u.scopeName,h=u.kind===4?u.ruleName:null,f=n.getExternalGrammar(d,r);if(f)if(h){let p=f.repository[h];p&&(c=sr.getCompiledRuleId(p,n,f.repository))}else c=sr.getCompiledRuleId(f.repository.$self,n,f.repository);break}}else c=sr.getCompiledRuleId(i,n,r);if(c!==-1){const u=n.getRule(c);let l=!1;if((u instanceof aP||u instanceof nw||u instanceof A0)&&u.hasMissingPatterns&&u.patterns.length===0&&(l=!0),l)continue;s.push(c)}}return{patterns:s,hasMissingPatterns:(t?t.length:0)!==s.length}}},Df=class j8{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=mke.test(this.source):this.hasBackReferences=!1}clone(){return new j8(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 sP.lastIndex=0,this.source.replace(sP,(s,a)=>A8(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}},Ff=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 oP(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 oP(e,r,this._items.map(s=>s.ruleId))}},oP=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}},kx=class{constructor(e,t){this.languageId=e,this.tokenType=t}},yke=class rw{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new kx(t,8),this._embeddedLanguagesMatcher=new kke(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?rw._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new kx(0,0);_getBasicScopeAttributes=new N8(t=>{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new kx(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(rw.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/},kke=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])=>A8(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])}},iP=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function D8(e,t,n,r,s,a,o,i){const c=t.content.length;let u=!1,l=-1;if(o){const f=xke(e,t,n,r,s,a);s=f.stack,r=f.linePos,n=f.isFirstLine,l=f.anchorPosition}const d=Date.now();for(;!u;){if(i!==0&&Date.now()-d>i)return new iP(s,!0);h()}return new iP(s,!1);function h(){const f=_ke(e,t,n,r,s,l);if(!f){a.produce(s,c),u=!0;return}const p=f.captureIndices,x=f.matchedRuleId,g=p&&p.length>0?p[0].end>r:!1;if(x===pke){const b=s.getRule(e);a.produce(s,p[0].start),s=s.withContentNameScopesList(s.nameScopesList),gh(e,t,n,s,a,b.endCaptures,p),a.produce(s,p[0].end);const y=s;if(s=s.parent,l=y.getAnchorPos(),!g&&y.getEnterPos()===r){s=y,a.produce(s,c),u=!0;return}}else{const b=e.getRule(x);a.produce(s,p[0].start);const y=s,_=b.getName(t.content,p),S=s.contentNameScopesList.pushAttributed(_,e);if(s=s.push(x,r,l,p[0].end===c,null,S,S),b instanceof nw){const w=b;gh(e,t,n,s,a,w.beginCaptures,p),a.produce(s,p[0].end),l=p[0].end;const v=w.getContentName(t.content,p),C=S.pushAttributed(v,e);if(s=s.withContentNameScopesList(C),w.endHasBackReferences&&(s=s.withEndRule(w.getEndWithResolvedBackReferences(t.content,p))),!g&&y.hasSameRuleAs(s)){s=s.pop(),a.produce(s,c),u=!0;return}}else if(b instanceof A0){const w=b;gh(e,t,n,s,a,w.beginCaptures,p),a.produce(s,p[0].end),l=p[0].end;const v=w.getContentName(t.content,p),C=S.pushAttributed(v,e);if(s=s.withContentNameScopesList(C),w.whileHasBackReferences&&(s=s.withEndRule(w.getWhileWithResolvedBackReferences(t.content,p))),!g&&y.hasSameRuleAs(s)){s=s.pop(),a.produce(s,c),u=!0;return}}else if(gh(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 xke(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 A0&&i.push({rule:u,stack:c})}for(let c=i.pop();c;c=i.pop()){const{ruleScanner:u,findOptions:l}=Ske(c.rule,e,c.stack.endRule,n,r===o),d=u.findNextMatchSync(t,r,l);if(d){if(d.ruleId!==$8){s=c.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(a.produce(c.stack,d.captureIndices[0].start),gh(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 _ke(e,t,n,r,s,a){const o=vke(e,t,n,r,s,a),i=e.getInjections();if(i.length===0)return o;const c=wke(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 vke(e,t,n,r,s,a){const o=s.getRule(e),{ruleScanner:i,findOptions:c}=F8(o,e,s.endRule,n,r===a),u=i.findNextMatchSync(t,r,c);return u?{captureIndices:u.captureIndices,matchedRuleId:u.ruleId}:null}function wke(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,f=e.length;h<f;h++){const p=e[h];if(!p.matcher(d))continue;const x=t.getRule(p.ruleId),{ruleScanner:g,findOptions:b}=F8(x,t,null,r,s===o),y=g.findNextMatchSync(n,s,b);if(!y)continue;const _=y.captureIndices[0].start;if(!(_>=i)&&(i=_,c=y.captureIndices,u=y.ruleId,l=p.priority,i===s))break}return c?{priorityMatch:l===-1,captureIndices:c,matchedRuleId:u}:null}function F8(e,t,n,r,s){return{ruleScanner:e.compileAG(t,n,r,s),findOptions:0}}function Ske(e,t,n,r,s){return{ruleScanner:e.compileWhileAG(t,n,r,s),findOptions:0}}function gh(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 f=o[d];if(f.length===0)continue;if(f.start>l)break;for(;u.length>0&&u[u.length-1].endPos<=f.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,f.start):s.produce(r,f.start),h.retokenizeCapturedWithRuleId){const x=h.getName(i,o),g=r.contentNameScopesList.pushAttributed(x,e),b=h.getContentName(i,o),y=g.pushAttributed(b,e),_=r.push(h.retokenizeCapturedWithRuleId,f.start,-1,!1,null,g,y),S=e.createOnigString(i.substring(0,f.end));D8(e,S,n&&f.start===0,f.start,_,s,!1,0),O8(S);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 Eke(g,f.end))}}for(;u.length>0;)s.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var Eke=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Tke(e,t,n,r,s,a,o,i){return new Ike(e,t,n,r,s,a,o,i)}function cP(e,t,n,r,s){const a=C0(t,N0),o=M8.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 N0(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(Cke(t[s],r))return n=s+1,!0;return!1})}function Cke(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 Ike=class{constructor(e,t,n,r,s,a,o,i){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=i,this._basicScopeAttributesProvider=new yke(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=uP(t,null),this._injections=null,this._tokenTypeMatchers=[],s)for(const c of Object.keys(s)){const u=C0(c,N0);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)cP(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&&cP(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]=uP(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=M8.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let s;if(!t||t===sw.NULL){s=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),l=this.themeProvider.getDefaults(),d=Dl.set(0,u.languageId,u.tokenType,null,l.fontStyle,l.foregroundId,l.backgroundId),h=this.getRule(this._rootId).getName(null,null);let f;h?f=qh.createRootAndLookUpScopeName(h,d,this):f=qh.createRoot("unknown",d),t=new sw(null,this._rootId,-1,-1,!1,null,f,f)}else s=!1,t.reset();e=e+`
|
|
37
|
+
`;const a=this.createOnigString(e),o=a.content.length,i=new Nke(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=D8(this,a,s,0,t,i,!0,r);return O8(a),{lineLength:o,lineTokens:i,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function uP(e,t){return e=K1e(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 qh=class pa{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=yx.push(s,a.scopeNames),r=new pa(r,s,a.encodedTokenAttributes);return r}static createRoot(t,n){return new pa(null,new yx(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const s=r.getMetadataForScope(t),a=new yx(null,t),o=r.themeProvider.themeMatch(a),i=pa.mergeAttributes(n,s,o);return new pa(null,a,i)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return pa.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),Dl.set(t,n.languageId,n.tokenType,null,s,a,o)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return pa._pushAttributed(this,t,n);const r=t.split(/ /g);let s=this;for(const a of r)s=pa._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=pa.mergeAttributes(t.tokenAttributes,s,o);return new pa(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}},sw=class Xi{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 Xi(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:Xi._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?qh.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(){Xi._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,s,a,o,i){return new Xi(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 Xi(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=qh.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new Xi(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,qh.fromExtension(r,n.contentNameScopesList))}},Ake=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):C0(n,N0).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>C0(n,N0).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}},Nke=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=Dl.set(r,0,o.type,null,-1,0,0));this.balancedBracketSelectors&&(s=this.balancedBracketSelectors.match(a))}if(s&&(r=Dl.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}},Rke=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,Tke(e,a,t,n,r,s,this,this._onigLib))}return this._grammars.get(e)}},Pke=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new Rke(T0.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(T0.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 Ake(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,r,s,a){const o=new ike(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)}},aw=sw.NULL;function R0(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 fi(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Oke(e){return Array.isArray(e)?e:[e]}async function B8(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function F1(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Lke(e){return e==="ansi"||F1(e)}function B1(e){return e==="none"}function $ke(e){return B1(e)}function z1(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 lP={light:"#333333",dark:"#bbbbbb"},dP={light:"#fffffe",dark:"#1e1e1e"},hP="__shiki_resolved";function nC(e){if(e?.[hP])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"?lP.light:lP.dark),n||(n=t.type==="light"?dP.light:dP.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,hP,{enumerable:!1,writable:!1,value:!0}),t}async function z8(e){return Array.from(new Set((await Promise.all(e.filter(t=>!Lke(t)).map(async t=>await B8(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function U8(e){return(await Promise.all(e.map(async t=>$ke(t)?null:nC(await B8(t))))).filter(t=>!!t)}function H8(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 Kt(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}var Mke=class extends Pke{_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=nC(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=T0.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=H8(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 Kt(`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))}},jke=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 Kd=0;function Dke(e){Kd+=1,e.warnings!==!1&&Kd>=10&&Kd%10===0&&console.warn(`[Shiki] ${Kd} 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 Kt("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(nC),s=new Mke(new jke(e.engine,n),r,n,e.langAlias);let a;function o(y){return H8(y,e.langAlias)}function i(y){g();const _=s.getGrammar(typeof y=="string"?y:y.name);if(!_)throw new Kt(`Language \`${y}\` not found, you may need to load it first`);return _}function c(y){if(y==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};g();const _=s.getTheme(y);if(!_)throw new Kt(`Theme \`${y}\` not found, you may need to load it first`);return _}function u(y){g();const _=c(y);return a!==y&&(s.setTheme(_),a=y),{theme:_,colorMap:s.getColorMap()}}function l(){return g(),s.getLoadedThemes()}function d(){return g(),s.getLoadedLanguages()}function h(...y){g(),s.loadLanguages(y.flat(1))}async function f(...y){return h(await z8(y))}function p(...y){g();for(const _ of y.flat(1))s.loadTheme(_)}async function x(...y){return g(),p(await U8(y))}function g(){if(t)throw new Kt("Shiki instance has been disposed")}function b(){t||(t=!0,s.dispose(),Kd-=1)}return{setTheme:u,getTheme:c,getLanguage:i,getLoadedThemes:l,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:f,loadLanguageSync:h,loadTheme:x,loadThemeSync:p,dispose:b,[Symbol.dispose]:b}}async function Fke(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([U8(e.themes||[]),z8(e.langs||[]),e.engine]);return Dke({...e,themes:t,langs:n,engine:r})}const q8=new WeakMap;function U1(e,t){q8.set(e,t)}function Bf(e){return q8.get(e)}var H1=class V8{_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 V8(Object.fromEntries(Oke(n).map(r=>[r,aw])),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 Bke(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Bke(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 zke(e,t){if(!(e instanceof H1))throw new Kt("Invalid grammar state");return e.getInternalStack(t)}function G8(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n;if(F1(e.resolveLangAlias(n.lang||"text"))||B1(r))return z1(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 Kt(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(s.name))throw new Kt(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return Hke(t,o,s,a,n)}function Uke(...e){if(e.length===2)return Bf(e[1]);const[t,n,r={}]=e,{lang:s="text",theme:a=t.getLoadedThemes()[0]}=r;if(F1(s)||B1(a))throw new Kt("Plain language does not have grammar state");if(s==="ansi")throw new Kt("ANSI language does not have grammar state");const{theme:o,colorMap:i}=t.setTheme(a),c=t.getLanguage(s);return new H1(rC(n,c,o,i,r).stateStack,c.name,o.name)}function Hke(e,t,n,r,s){const a=rC(e,t,n,r,s),o=new H1(a.stateStack,t.name,n.name);return U1(a.tokens,o),a.tokens}function rC(e,t,n,r,s){const a=R0(n,s),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:i=500}=s,c=z1(e);let u=s.grammarState?zke(s.grammarState,n.name)??aw:s.grammarContextCode!=null?rC(s.grammarContextCode,t,n,r,{...s,grammarState:void 0,grammarContextCode:void 0}).stateStack:aw,l=[];const d=[];for(let h=0,f=c.length;h<f;h++){const[p,x]=c[h];if(p===""){l=[],d.push([]);continue}if(o>0&&p.length>=o){l=[],d.push([{content:p,offset:x,color:"",fontStyle:0}]);continue}let g,b,y;s.includeExplanation&&(g=t.tokenizeLine(p,u,i),b=g.tokens,y=0);const _=t.tokenizeLine2(p,u,i),S=_.tokens.length/2;for(let w=0;w<S;w++){const v=_.tokens[2*w],C=w+1<S?_.tokens[2*w+2]:p.length;if(v===C)continue;const I=_.tokens[2*w+1],R=fi(r[Dl.getForeground(I)],a),N=Dl.getFontStyle(I),z={content:p.substring(v,C),offset:x+v,color:R,fontStyle:N};if(s.includeExplanation){const V=[];if(s.includeExplanation!=="scopeName")for(const J of n.settings){let te;switch(typeof J.scope){case"string":te=J.scope.split(/,/).map(se=>se.trim());break;case"object":te=J.scope;break;default:continue}V.push({settings:J,selectors:te.map(se=>se.split(/ /))})}z.explanation=[];let ne=0;for(;v+ne<C;){const J=b[y],te=p.substring(J.startIndex,J.endIndex);ne+=te.length,z.explanation.push({content:te,scopes:s.includeExplanation==="scopeName"?qke(J.scopes):Vke(V,J.scopes)}),y+=1}}l.push(z)}d.push(l),l=[],u=_.ruleStack}return{tokens:d,stateStack:u}}function qke(e){return e.map(t=>({scopeName:t}))}function Vke(e,t){const n=[];for(let r=0,s=t.length;r<s;r++){const a=t[r];n[r]={scopeName:a,themeMatches:Kke(e,a,t.slice(0,r))}}return n}function fP(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function Gke(e,t,n){if(!fP(e[e.length-1],t))return!1;let r=e.length-2,s=n.length-1;for(;r>=0&&s>=0;)fP(e[r],n[s])&&(r-=1),s-=1;return r===-1}function Kke(e,t,n){const r=[];for(const{selectors:s,settings:a}of e)for(const o of s)if(Gke(o,t,n)){r.push(a);break}return r}function K8(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=G8(e,t,{...n,theme:c.theme});return{tokens:u,state:Bf(u),theme:typeof c.theme=="string"?c.theme:c.theme.name}}),a=Wke(...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((f,p)=>{const{content:x,explanation:g,offset:b,...y}=f[u][d];h.variants[r[p].color]=y}),h})),i=s[0].state?new H1(Object.fromEntries(s.map(c=>[c.theme,c.state?.getInternalStack(c.theme)])),s[0].state.lang):void 0;return i&&U1(o,i),o}function Wke(...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 W8=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Fm{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Fm.prototype.normal={};Fm.prototype.property={};Fm.prototype.space=void 0;function Y8(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new Fm(n,r,t)}function zf(e){return e.toLowerCase()}class zr{constructor(t,n){this.attribute=n,this.property=t}}zr.prototype.attribute="";zr.prototype.booleanish=!1;zr.prototype.boolean=!1;zr.prototype.commaOrSpaceSeparated=!1;zr.prototype.commaSeparated=!1;zr.prototype.defined=!1;zr.prototype.mustUseProperty=!1;zr.prototype.number=!1;zr.prototype.overloadedBoolean=!1;zr.prototype.property="";zr.prototype.spaceSeparated=!1;zr.prototype.space=void 0;let Yke=0;const Ze=uu(),mn=uu(),ow=uu(),pe=uu(),Dt=uu(),ul=uu(),Gr=uu();function uu(){return 2**++Yke}const iw=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ze,booleanish:mn,commaOrSpaceSeparated:Gr,commaSeparated:ul,number:pe,overloadedBoolean:ow,spaceSeparated:Dt},Symbol.toStringTag,{value:"Module"})),xx=Object.keys(iw);class sC extends zr{constructor(t,n,r,s){let a=-1;if(super(t,n),mP(this,"space",s),typeof r=="number")for(;++a<xx.length;){const o=xx[a];mP(this,xx[a],(r&iw[o])===iw[o])}}}sC.prototype.defined=!0;function mP(e,t,n){n&&(e[t]=n)}function bd(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const a=new sC(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[zf(r)]=r,n[zf(a.attribute)]=r}return new Fm(t,n,e.space)}const J8=bd({properties:{ariaActiveDescendant:null,ariaAtomic:mn,ariaAutoComplete:null,ariaBusy:mn,ariaChecked:mn,ariaColCount:pe,ariaColIndex:pe,ariaColSpan:pe,ariaControls:Dt,ariaCurrent:null,ariaDescribedBy:Dt,ariaDetails:null,ariaDisabled:mn,ariaDropEffect:Dt,ariaErrorMessage:null,ariaExpanded:mn,ariaFlowTo:Dt,ariaGrabbed:mn,ariaHasPopup:null,ariaHidden:mn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Dt,ariaLevel:pe,ariaLive:null,ariaModal:mn,ariaMultiLine:mn,ariaMultiSelectable:mn,ariaOrientation:null,ariaOwns:Dt,ariaPlaceholder:null,ariaPosInSet:pe,ariaPressed:mn,ariaReadOnly:mn,ariaRelevant:null,ariaRequired:mn,ariaRoleDescription:Dt,ariaRowCount:pe,ariaRowIndex:pe,ariaRowSpan:pe,ariaSelected:mn,ariaSetSize:pe,ariaSort:null,ariaValueMax:pe,ariaValueMin:pe,ariaValueNow:pe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Q8(e,t){return t in e?e[t]:t}function X8(e,t){return Q8(e,t.toLowerCase())}const Jke=bd({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ul,acceptCharset:Dt,accessKey:Dt,action:null,allow:null,allowFullScreen:Ze,allowPaymentRequest:Ze,allowUserMedia:Ze,alt:null,as:null,async:Ze,autoCapitalize:null,autoComplete:Dt,autoFocus:Ze,autoPlay:Ze,blocking:Dt,capture:null,charSet:null,checked:Ze,cite:null,className:Dt,cols:pe,colSpan:null,content:null,contentEditable:mn,controls:Ze,controlsList:Dt,coords:pe|ul,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ze,defer:Ze,dir:null,dirName:null,disabled:Ze,download:ow,draggable:mn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ze,formTarget:null,headers:Dt,height:pe,hidden:ow,high:pe,href:null,hrefLang:null,htmlFor:Dt,httpEquiv:Dt,id:null,imageSizes:null,imageSrcSet:null,inert:Ze,inputMode:null,integrity:null,is:null,isMap:Ze,itemId:null,itemProp:Dt,itemRef:Dt,itemScope:Ze,itemType:Dt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ze,low:pe,manifest:null,max:null,maxLength:pe,media:null,method:null,min:null,minLength:pe,multiple:Ze,muted:Ze,name:null,nonce:null,noModule:Ze,noValidate:Ze,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:Ze,optimum:pe,pattern:null,ping:Dt,placeholder:null,playsInline:Ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ze,referrerPolicy:null,rel:Dt,required:Ze,reversed:Ze,rows:pe,rowSpan:pe,sandbox:Dt,scope:null,scoped:Ze,seamless:Ze,selected:Ze,shadowRootClonable:Ze,shadowRootDelegatesFocus:Ze,shadowRootMode:null,shape:null,size:pe,sizes:null,slot:null,span:pe,spellCheck:mn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:pe,step:null,style:null,tabIndex:pe,target:null,title:null,translate:null,type:null,typeMustMatch:Ze,useMap:null,value:mn,width:pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Dt,axis:null,background:null,bgColor:null,border:pe,borderColor:null,bottomMargin:pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ze,declare:Ze,event:null,face:null,frame:null,frameBorder:null,hSpace:pe,leftMargin:pe,link:null,longDesc:null,lowSrc:null,marginHeight:pe,marginWidth:pe,noResize:Ze,noHref:Ze,noShade:Ze,noWrap:Ze,object:null,profile:null,prompt:null,rev:null,rightMargin:pe,rules:null,scheme:null,scrolling:mn,standby:null,summary:null,text:null,topMargin:pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:pe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ze,disableRemotePlayback:Ze,prefix:null,property:null,results:pe,security:null,unselectable:null},space:"html",transform:X8}),Qke=bd({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:Gr,accentHeight:pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:pe,amplitude:pe,arabicForm:null,ascent:pe,attributeName:null,attributeType:null,azimuth:pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:pe,by:null,calcMode:null,capHeight:pe,className:Dt,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:pe,diffuseConstant:pe,direction:null,display:null,dur:null,divisor:pe,dominantBaseline:null,download:Ze,dx:null,dy:null,edgeMode:null,editable:null,elevation:pe,enableBackground:null,end:null,event:null,exponent:pe,externalResourcesRequired:null,fill:null,fillOpacity:pe,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:ul,g2:ul,glyphName:ul,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:pe,horizOriginX:pe,horizOriginY:pe,id:null,ideographic:pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:pe,k:pe,k1:pe,k2:pe,k3:pe,k4:pe,kernelMatrix:Gr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:pe,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:pe,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:pe,overlineThickness:pe,paintOrder:null,panose1:null,path:null,pathLength:pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Dt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:pe,pointsAtY:pe,pointsAtZ:pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Gr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Gr,rev:Gr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Gr,requiredFeatures:Gr,requiredFonts:Gr,requiredFormats:Gr,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:pe,specularExponent:pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:pe,strikethroughThickness:pe,string:null,stroke:null,strokeDashArray:Gr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:pe,strokeOpacity:pe,strokeWidth:null,style:null,surfaceScale:pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Gr,tabIndex:pe,tableValues:null,target:null,targetX:pe,targetY:pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Gr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:pe,underlineThickness:pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:pe,values:null,vAlphabetic:pe,vMathematical:pe,vectorEffect:null,vHanging:pe,vIdeographic:pe,version:null,vertAdvY:pe,vertOriginX:pe,vertOriginY:pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Q8}),Z8=bd({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()}}),eB=bd({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:X8}),tB=bd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Xke={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"},Zke=/[A-Z]/g,pP=/-[a-z]/g,exe=/^data[-\w.:]+$/i;function Bm(e,t){const n=zf(t);let r=t,s=zr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&exe.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(pP,nxe);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!pP.test(a)){let o=a.replace(Zke,txe);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=sC}return new s(r,t)}function txe(e){return"-"+e.toLowerCase()}function nxe(e){return e.charAt(1).toUpperCase()}const yd=Y8([J8,Jke,Z8,eB,tB],"html"),Ba=Y8([J8,Qke,Z8,eB,tB],"svg"),gP={}.hasOwnProperty;function aC(e,t){const n=t||{};function r(s,...a){let o=r.invalid;const i=r.handlers;if(s&&gP.call(s,e)){const c=String(s[e]);o=gP.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 rxe=/["&'<>`]/g,sxe=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,axe=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,oxe=/[|\\{}()[\]^$+*?.]/g,bP=new WeakMap;function ixe(e,t){if(e=e.replace(t.subset?cxe(t.subset):rxe,r),t.subset||t.escapeOnly)return e;return e.replace(sxe,n).replace(axe,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 cxe(e){let t=bP.get(e);return t||(t=uxe(e),bP.set(e,t)),t}function uxe(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(oxe,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const lxe=/[\dA-Fa-f]/;function dxe(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!lxe.test(String.fromCharCode(t))?r:r+";"}const hxe=/\d/;function fxe(e,t,n){const r="&#"+String(e);return n&&t&&!hxe.test(String.fromCharCode(t))?r:r+";"}const mxe=["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"],_x={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:"€"},pxe=["cent","copy","divide","gt","lt","not","para","times"],nB={}.hasOwnProperty,cw={};let lg;for(lg in _x)nB.call(_x,lg)&&(cw[_x[lg]]=lg);const gxe=/[^\dA-Za-z]/;function bxe(e,t,n,r){const s=String.fromCharCode(e);if(nB.call(cw,s)){const a=cw[s],o="&"+a;return n&&mxe.includes(a)&&!pxe.includes(a)&&(!r||t&&t!==61&&gxe.test(String.fromCharCode(t)))?o:o+";"}return""}function yxe(e,t,n){let r=dxe(e,t,n.omitOptionalSemicolons),s;if((n.useNamedReferences||n.useShortestReferences)&&(s=bxe(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!s)&&n.useShortestReferences){const a=fxe(e,t,n.omitOptionalSemicolons);a.length<r.length&&(r=a)}return s&&(!n.useShortestReferences||s.length<r.length)?s:r}function ll(e,t){return ixe(e,Object.assign({format:yxe},t))}const kxe=/^>|^->|<!--|-->|--!>|<!-$/g,xxe=[">"],_xe=["<",">"];function vxe(e,t,n,r){return r.settings.bogusComments?"<?"+ll(e.value,Object.assign({},r.settings.characterReferences,{subset:xxe}))+">":"<!--"+e.value.replace(kxe,s)+"-->";function s(a){return ll(a,Object.assign({},r.settings.characterReferences,{subset:_xe}))}}function wxe(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function P0(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 yP(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 oC(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function kP(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function iC(e){return e.join(" ").trim()}const Sxe=/[ \t\n\f\r]/g;function q1(e){return typeof e=="object"?e.type==="text"?xP(e.value):!1:xP(e)}function xP(e){return e.replace(Sxe,"")===""}const Pn=sB(1),rB=sB(-1),Exe=[];function sB(e){return t;function t(n,r,s){const a=n?n.children:Exe;let o=(r||0)+e,i=a[o];if(!s)for(;i&&q1(i);)o+=e,i=a[o];return i}}const Txe={}.hasOwnProperty;function aB(e){return t;function t(n,r,s){return Txe.call(e,n.tagName)&&e[n.tagName](n,r,s)}}const cC=aB({body:Ixe,caption:vx,colgroup:vx,dd:Pxe,dt:Rxe,head:vx,html:Cxe,li:Nxe,optgroup:Oxe,option:Lxe,p:Axe,rp:_P,rt:_P,tbody:Mxe,td:vP,tfoot:jxe,th:vP,thead:$xe,tr:Dxe});function vx(e,t,n){const r=Pn(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&q1(r.value.charAt(0)))}function Cxe(e,t,n){const r=Pn(n,t);return!r||r.type!=="comment"}function Ixe(e,t,n){const r=Pn(n,t);return!r||r.type!=="comment"}function Axe(e,t,n){const r=Pn(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 Nxe(e,t,n){const r=Pn(n,t);return!r||r.type==="element"&&r.tagName==="li"}function Rxe(e,t,n){const r=Pn(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Pxe(e,t,n){const r=Pn(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function _P(e,t,n){const r=Pn(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Oxe(e,t,n){const r=Pn(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function Lxe(e,t,n){const r=Pn(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function $xe(e,t,n){const r=Pn(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Mxe(e,t,n){const r=Pn(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function jxe(e,t,n){return!Pn(n,t)}function Dxe(e,t,n){const r=Pn(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function vP(e,t,n){const r=Pn(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const Fxe=aB({body:Uxe,colgroup:Hxe,head:zxe,html:Bxe,tbody:qxe});function Bxe(e){const t=Pn(e,-1);return!t||t.type!=="comment"}function zxe(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 Uxe(e){const t=Pn(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&q1(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Hxe(e,t,n){const r=rB(n,t),s=Pn(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&cC(r,n.children.indexOf(r),n)?!1:!!(s&&s.type==="element"&&s.tagName==="col")}function qxe(e,t,n){const r=rB(n,t),s=Pn(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&cC(r,n.children.indexOf(r),n)?!1:!!(s&&s.type==="element"&&s.tagName==="tr")}const dg={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 Vxe(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=Ba);const u=Gxe(r,e.properties),l=r.all(s.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=s,l&&(o=!1),(u||!a||!Fxe(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||!cC(e,t,n))&&i.push("</"+e.tagName+">"),i.join("")}function Gxe(e,t){const n=[];let r=-1,s;if(t){for(s in t)if(t[s]!==null&&t[s]!==void 0){const a=Kxe(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 Kxe(e,t,n){const r=Bm(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=ll(r.attribute,Object.assign({},e.settings.characterReferences,{subset:dg.name[s][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?oC:iC)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(i=ll(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:dg.unquoted[s][a]}))),i!==n&&(e.settings.quoteSmart&&P0(n,o)>P0(n,e.alternative)&&(o=e.alternative),i=o+ll(n,Object.assign({},e.settings.characterReferences,{subset:(o==="'"?dg.single:dg.double)[s][a],attribute:!0}))+o),c+(i&&"="+i))}const Wxe=["<","&"];function oB(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:ll(e.value,Object.assign({},r.settings.characterReferences,{subset:Wxe}))}function Yxe(e,t,n,r){return r.settings.allowDangerousHtml?e.value:oB(e,t,n,r)}function Jxe(e,t,n,r){return r.all(e)}const Qxe=aC("type",{invalid:Xxe,unknown:Zxe,handlers:{comment:vxe,doctype:wxe,element:Vxe,raw:Yxe,root:Jxe,text:oB}});function Xxe(e){throw new Error("Expected node, not `"+e+"`")}function Zxe(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const e_e={},t_e={},n_e=[];function r_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:s_e,all:a_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||W8,characterReferences:n.characterReferences||t_e,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Ba:yd,quote:r,alternative:s}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function s_e(e,t,n){return Qxe(e,t,n,this)}function a_e(e){const t=[],n=e&&e.children||n_e;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}function iB(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 o_e(e){const t=z1(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 uC="light-dark()",i_e=["color","background-color"];function c_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 u_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?c_e(s,a):s})):e}function l_e(e,t,n,r,s="css-vars"){const a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(l=>O0(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 f=l[h]||"inherit";if(d===0&&r&&i_e.includes(h))if(r===uC&&o.length>1){const p=t.findIndex(g=>g==="light"),x=t.findIndex(g=>g==="dark");if(p===-1||x===-1)throw new Kt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');c[h]=`light-dark(${o[p][h]||"inherit"}, ${o[x][h]||"inherit"})`,s==="css-vars"&&(c[u(d,h)]=f)}else c[h]=f;else s==="css-vars"&&(c[u(d,h)]=f)}}),a.htmlStyle=c,a}function O0(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&or.Italic&&(t["font-style"]="italic"),e.fontStyle&or.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&or.Underline&&n.push("underline"),e.fontStyle&or.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function uw(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function d_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 Kt(`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 Kt(`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 Kt(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${i.length}`);return{...o,character:c,offset:r.posToIndex(o.line,c)}}};const r=o_e(n.source),a=(n.options.decorations||[]).map(o=>({...o,start:s(o.start),end:s(o.end)}));h_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 u_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 Kt(`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,f){const p=s[l];let x="",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 _=0;_<p.children.length;_++)x+=cB(p.children[_]),g===-1&&x.length===d&&(g=_+1),b===-1&&x.length===h&&(b=_+1);if(g===-1)throw new Kt(`Failed to find start index for decoration ${JSON.stringify(f.start)}`);if(b===-1)throw new Kt(`Failed to find end index for decoration ${JSON.stringify(f.end)}`);const y=p.children.slice(g,b);if(!f.alwaysWrap&&y.length===p.children.length)i(p,f,"line");else if(!f.alwaysWrap&&y.length===1&&y[0].type==="element")i(y[0],f,"token");else{const _={type:"element",tagName:"span",properties:{},children:y};i(_,f,"wrapper"),p.children.splice(g,y.length,_)}}function o(l,d){s[l]=i(s[l],d,"line")}function i(l,d,h){const f=d.properties||{},p=d.transform||(x=>x);return l.tagName=d.tagName||"span",l.properties={...l.properties,...f,class:l.properties.class},d.properties?.class&&iB(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 f=d.line+1;f<h.line;f++)c.unshift(()=>o(f,l));a(h.line,0,h.character,l)}}c.forEach(l=>l())}}}function h_e(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new Kt(`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 Kt(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(s.start)} intersect.`)}}}}function cB(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(cB).join(""):""}const f_e=[d_e()];function L0(e){const t=m_e(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...f_e]}function m_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 dc=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],wx={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function p_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 wP(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 g_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)wx[r]&&t.push({type:"setDecoration",value:wx[r]});else if(r<=29){const s=wx[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:dc[r-30]}});else if(r===38){const s=wP(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:dc[r-40]}});else if(r===48){const s=wP(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:dc[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:dc[r-100+8]}})}return t}function b_e(){let e=null,t=null,n=new Set;return{parse(r){const s=[];let a=0;do{const o=p_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=g_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 y_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 k_e(e=y_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<dc.length;u++)r.push(t(dc[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 x_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 __e(e,t,n){const r=R0(e,n),s=z1(t),a=k_e(Object.fromEntries(dc.map(i=>{const c=`terminal.ansi${i[0].toUpperCase()}${i.substring(1)}`;return[i,e.colors?.[c]||x_e[i]]}))),o=b_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=fi(u,r),l=fi(l,r),c.decorations.has("dim")&&(u=v_e(u));let d=or.None;return c.decorations.has("bold")&&(d|=or.Bold),c.decorations.has("italic")&&(d|=or.Italic),c.decorations.has("underline")&&(d|=or.Underline),c.decorations.has("strikethrough")&&(d|=or.Strikethrough),{content:c.value,offset:i[1],color:u,bgColor:l,fontStyle:d}}))}function v_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 uB(e,t,n={}){const r=e.resolveLangAlias(n.lang||"text"),{theme:s=e.getLoadedThemes()[0]}=n;if(!F1(r)&&!B1(s)&&r==="ansi"){const{theme:a}=e.setTheme(s);return __e(a,t,n)}return G8(e,t,n)}function $0(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,y)=>b.color===u?-1:y.color===u?1:0);if(h.length===0)throw new Kt("`themes` option must not be empty");const f=K8(e,t,n);if(c=Bf(f),u&&uC!==u&&!h.find(b=>b.color===u))throw new Kt(`\`themes\` option must contain the defaultColor key \`${u}\``);const p=h.map(b=>e.getTheme(b.theme)),x=h.map(b=>b.color);a=f.map(b=>b.map(y=>l_e(y,x,l,u,d))),c&&U1(a,c);const g=h.map(b=>R0(b.theme,n));s=SP(h,p,g,l,u,"fg",d),r=SP(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=R0(n.theme,n);a=uB(e,t,n);const l=e.getTheme(n.theme);r=fi(l.bg,u),s=fi(l.fg,u),o=l.name,c=Bf(a)}else throw new Kt("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:s,bg:r,themeName:o,rootStyle:i,grammarState:c}}function SP(e,t,n,r,s,a,o){return e.map((i,c)=>{const u=fi(t[c][a],n[c])||"inherit",l=`${r+i.color}${a==="bg"?"-bg":""}:${u}`;if(c===0&&s){if(s===uC&&e.length>1){const d=e.findIndex(f=>f.color==="light"),h=e.findIndex(f=>f.color==="dark");if(d===-1||h===-1)throw new Kt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${fi(t[d][a],n[d])||"inherit"}, ${fi(t[h][a],n[h])||"inherit"});${l}`}return u}return o==="css-vars"?l:null}).filter(i=>!!i).join(";")}function M0(e,t,n,r={meta:{},options:n,codeToHast:(s,a)=>M0(e,s,a),codeToTokens:(s,a)=>$0(e,s,a)}){let s=t;for(const p of L0(n))s=p.preprocess?.call(r,s,n)||s;let{tokens:a,fg:o,bg:i,themeName:c,rootStyle:u,grammarState:l}=$0(e,s,n);const{mergeWhitespaces:d=!0,mergeSameStyleTokens:h=!1}=n;d===!0?a=S_e(a):d==="never"&&(a=E_e(a)),h&&(a=T_e(a));const f={...r,get source(){return s}};for(const p of L0(n))a=p.tokens?.call(f,a)||a;return w_e(a,{...n,fg:o,bg:i,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??u},f,l)}function w_e(e,t,n,r=Bf(e)){const s=L0(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[x,g]of Object.entries(t.meta||{}))x.startsWith("_")||(u[x]=g);let l={type:"element",tagName:"pre",properties:u,children:[],data:t.data},d={type:"element",tagName:"code",properties:{},children:a};const h=[],f={...n,structure:i,addClassToHast:iB,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((x,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:[]},y=0;for(const _ of x){let S={type:"element",tagName:"span",properties:{..._.htmlAttrs},children:[{type:"text",value:_.content}]};const w=uw(_.htmlStyle||O0(_));w&&(S.properties.style=w);for(const v of s)S=v?.span?.call(f,S,g+1,y,b,_)||S;i==="inline"?o.children.push(S):i==="classic"&&b.children.push(S),y+=_.content.length}if(i==="classic"){for(const _ of s)b=_?.line?.call(f,b,g+1)||b;h.push(b),a.push(b)}else i==="inline"&&h.push(b)}),i==="classic"){for(const x of s)d=x?.code?.call(f,d)||d;l.children.push(d);for(const x of s)l=x?.pre?.call(f,l)||l;o.children.push(l)}else if(i==="inline"){const x=[];let g={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const y of o.children)y.type==="element"&&y.tagName==="br"?(x.push(g),g={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(y.type==="element"||y.type==="text")&&g.children.push(y);x.push(g);let b={type:"element",tagName:"code",properties:{},children:x};for(const y of s)b=y?.code?.call(f,b)||b;o.children=[];for(let y=0;y<b.children.length;y++){y>0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const _=b.children[y];_.type==="element"&&o.children.push(..._.children)}}let p=o;for(const x of s)p=x?.root?.call(f,p)||p;return r&&U1(p,r),p}function S_e(e){return e.map(t=>{const n=[];let r="",s;return t.forEach((a,o)=>{const i=!(a.fontStyle&&(a.fontStyle&or.Underline||a.fontStyle&or.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 E_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 T_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=uw(s.htmlStyle||O0(s)),o=uw(r.htmlStyle||O0(r)),i=s.fontStyle&&(s.fontStyle&or.Underline||s.fontStyle&or.Strikethrough),c=r.fontStyle&&(r.fontStyle&or.Underline||r.fontStyle&or.Strikethrough);!i&&!c&&a===o?s.content+=r.content:n.push({...r})}return n})}const C_e=r_e;function I_e(e,t,n){const r={meta:{},options:n,codeToHast:(a,o)=>M0(e,a,o),codeToTokens:(a,o)=>$0(e,a,o)};let s=C_e(M0(e,t,n,r));for(const a of L0(n))s=a.postprocess?.call(r,s,n)||s;return s}async function A_e(e){const t=await Fke(e);return{getLastGrammarState:(...n)=>Uke(t,...n),codeToTokensBase:(n,r)=>uB(t,n,r),codeToTokensWithThemes:(n,r)=>K8(t,n,r),codeToTokens:(n,r)=>$0(t,n,r),codeToHast:(n,r)=>M0(t,n,r),codeToHtml:(n,r)=>I_e(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}const EP=4294967295;var N_e=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:EP,end:EP,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 kd(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function R_e(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const lC=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),Bn=String.raw;function xd(e,t){if(e==null)throw new Error(t??"Value expected");return e}const lB=Bn`\[\^?`,dB=`c.? | C(?:-.?)?|${Bn`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${Bn`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${Bn`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${Bn`o\{[^\}]*\}?`}|${Bn`\d{1,3}`}`,dC=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,hg=new RegExp(Bn`
|
|
47
|
+
\\ (?:
|
|
48
|
+
${dB}
|
|
49
|
+
| [gk]<[^>]*>?
|
|
50
|
+
| [gk]'[^']*'?
|
|
51
|
+
| .
|
|
52
|
+
)
|
|
53
|
+
| \( (?:
|
|
54
|
+
\? (?:
|
|
55
|
+
[:=!>({]
|
|
56
|
+
| <[=!]
|
|
57
|
+
| <[^>]*>
|
|
58
|
+
| '[^']*'
|
|
59
|
+
| ~\|?
|
|
60
|
+
| #(?:[^)\\]|\\.?)*
|
|
61
|
+
| [^:)]*[:)]
|
|
62
|
+
)?
|
|
63
|
+
| \*[^\)]*\)?
|
|
64
|
+
)?
|
|
65
|
+
| (?:${dC.source})+
|
|
66
|
+
| ${lB}
|
|
67
|
+
| .
|
|
68
|
+
`.replace(/\s+/g,""),"gsu"),Sx=new RegExp(Bn`
|
|
69
|
+
\\ (?:
|
|
70
|
+
${dB}
|
|
71
|
+
| .
|
|
72
|
+
)
|
|
73
|
+
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
74
|
+
| ${lB}
|
|
75
|
+
| &&
|
|
76
|
+
| .
|
|
77
|
+
`.replace(/\s+/g,""),"gsu");function P_e(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=Q_e(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(hg.lastIndex=0;i=hg.exec(e);){const d=O_e(a,e,i[0],hg.lastIndex);d.tokens?o.push(...d.tokens):d.token&&o.push(d.token),d.lastIndex!==void 0&&(hg.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"?Z_e(d,l):d).flat(),flags:r}}function O_e(e,t,n,r){const[s,a]=n;if(n==="["||n==="[^"){const o=L_e(t,n,r);return{tokens:o.tokens,lastIndex:o.lastIndex}}if(s==="\\"){if("AbBGyYzZ".includes(a))return{token:TP(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:q_e(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:fB(n)}}if(a==="K")return{token:mB("keep",n)};if(a==="N"||a==="R")return{token:hc("newline",n,{negate:a==="N"})};if(a==="O")return{token:hc("any",n)};if(a==="X")return{token:hc("text_segment",n)};const o=hB(n,{inCharClass:!1});return Array.isArray(o)?{tokens:o}:{token:o}}if(s==="("){if(a==="*")return{token:W_e(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:K_e(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:Fu("group",n)};if(n==="(?>")return{token:Fu("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:Fu(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:Fu("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:Fu("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:z_e(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:hc("dot",n)};if(n==="^"||n==="$"){const o=e.singleline?{"^":Bn`\A`,$:Bn`\Z`}[n]:n;return{token:TP(o,n)}}return n==="|"?{token:M_e(n)}:dC.test(n)?{tokens:eve(n)}:{token:ho(kd(n),n)}}function L_e(e,t,n){const r=[CP(t[1]==="^",t)];let s=1,a;for(Sx.lastIndex=n;a=Sx.exec(e);){const o=a[0];if(o[0]==="["&&o[1]!==":")s++,r.push(CP(o[1]==="^",o));else if(o==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(ho(93,o));else if(s--,r.push(j_e(o)),!s)break}else{const i=$_e(o);Array.isArray(i)?r.push(...i):r.push(i)}}return{tokens:r,lastIndex:Sx.lastIndex||e.length}}function $_e(e){if(e[0]==="\\")return hB(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!lC.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return hc("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?D_e(e):e==="&&"?F_e(e):ho(kd(e),e)}function hB(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return G_e(e);if("dDhHsSwW".includes(n))return Y_e(e);if(e.startsWith(Bn`\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 J_e(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 ho(kd(o),i)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return ho(X_e(e),e);if(IP.has(n))return ho(IP.get(n),e);if(/\d/.test(n))return B_e(t,e);if(e==="\\")throw new Error(Bn`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return ho(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function M_e(e){return{type:"Alternator",raw:e}}function TP(e,t){return{type:"Assertion",kind:e,raw:t}}function fB(e){return{type:"Backreference",raw:e}}function ho(e,t){return{type:"Character",value:e,raw:t}}function j_e(e){return{type:"CharacterClassClose",raw:e}}function D_e(e){return{type:"CharacterClassHyphen",raw:e}}function F_e(e){return{type:"CharacterClassIntersector",raw:e}}function CP(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function hc(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function mB(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:xd(n.flags),raw:t}}function B_e(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function z_e(e){return{type:"GroupClose",raw:e}}function Fu(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function U_e(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function H_e(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function q_e(e){return{type:"Subroutine",raw:e}}const V_e=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),IP=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function G_e(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 ho(kd(t.toUpperCase())-64,e)}function K_e(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=NP(n),o=NP(r),i={};if(a&&(i.enable=a),o&&(i.disable=o),e.endsWith(")"))return t.replaceCurrentModX(s),mB("flags",e,{flags:i});if(e.endsWith(":"))return t.pushModX(s),t.numOpenGroups++,Fu("group",e,{...(a||o)&&{flags:i}});throw new Error(`Unexpected flag modifier "${e}"`)}function W_e(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=V_e.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 U_e(u,r??null,s?.split(",")??null,e)}function AP(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 H_e(t,n,r,e)}function Y_e(e){const t=e[1].toLowerCase();return hc({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function J_e(e){const{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return hc("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function NP(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 Q_e(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 X_e(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 Z_e(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[fB(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(Bn`Octal encoded byte above 177 unsupported "${n}"`)}else u=kd(c);a.push(ho(u,(i===0?"\\":"")+c))}return a}function eve(e){const t=[],n=new RegExp(dC,"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(AP(s.slice(0,-1)));continue}}}t.push(AP(s))}return t}function pB(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 tve(e){return nve.has(e.type)}const nve=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function gB(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=P_e(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),s=(h,f)=>{const p=r.tokens[a.nextIndex];switch(a.parent=h,a.nextIndex++,p.type){case"Alternator":return qc();case"Assertion":return rve(p);case"Backreference":return sve(p,a);case"Character":return V1(p.value,{useLastValid:!!f.isCheckingRangeEnd});case"CharacterClassHyphen":return ave(p,a,f);case"CharacterClassOpen":return ove(p,a,f);case"CharacterSet":return ive(p,a);case"Directive":return fve(p.kind,{flags:p.flags});case"GroupOpen":return cve(p,a,f);case"NamedCallout":return pve(p.kind,p.tag,p.arguments);case"Quantifier":return uve(p,a);case"Subroutine":return lve(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=bve(mve(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(Bn`Subroutine uses a duplicate group name "\g<${h}>"`);l.get(h)[0].isSubroutined=!0}else throw new Error(Bn`Subroutine uses a group name that's not defined "\g<${h}>"`);return o}function rve({kind:e}){return lw(xd({"^":"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===Bn`\B`||e===Bn`\Y`})}function sve({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,dw(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 dw(r)}return s(+r)}function ave(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(),hve(o,c);throw new Error("Invalid character class range")}return V1(kd("-"))}function ove({negate:e},t,n){const{tokens:r,walk:s}=t,a=r[t.nextIndex],o=[rb()];let i=OP(a);for(;i.type!=="CharacterClassClose";){if(i.type==="CharacterClassIntersector")o.push(rb()),t.nextIndex++;else{const u=o.at(-1);u.body.push(s(u,n))}i=OP(r[t.nextIndex],a)}const c=rb({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 ive({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:s,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e==="property"){const i=G1(n);if(lC.has(i)&&!o?.has(i))e="posix",n=i;else return Bu(n,{negate:t,normalizeUnknownPropertyNames:s,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e==="posix"?gve(n,{negate:t}):hw(e,{negate:t})}function cve(e,t,n){const{tokens:r,capturingGroups:s,namedGroupsByName:a,skipLookbehindValidation:o,walk:i}=t,c=yve(e),u=c.type==="AbsenceFunction",l=PP(c),d=l&&c.negate;if(c.type==="CapturingGroup"&&(s.push(c),c.name&&R_e(a,c.name,[]).push(c)),u&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let h=LP(r[t.nextIndex]);for(;h.type!=="GroupClose";){if(h.type==="Alternator")c.body.push(qc()),t.nextIndex++;else{const f=c.body.at(-1),p=i(f,{...n,isInAbsenceFunction:n.isInAbsenceFunction||u,isInLookbehind:n.isInLookbehind||l,isInNegLookbehind:n.isInNegLookbehind||d});if(f.body.push(p),(l||n.isInLookbehind)&&!o){const x="Lookbehind includes a pattern not allowed by Oniguruma";if(d||n.isInNegLookbehind){if(RP(p)||p.type==="CapturingGroup")throw new Error(x)}else if(RP(p)||PP(p)&&p.negate)throw new Error(x)}}h=LP(r[t.nextIndex])}return t.nextIndex++,c}function uve({kind:e,min:t,max:n},r){const s=r.parent,a=s.body.at(-1);if(!a||!tve(a))throw new Error("Quantifier requires a repeatable token");const o=yB(e,t,n,a);return s.body.pop(),o}function lve({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=kB(s);return r.push(o),o}function dve(e,t){return{type:"AbsenceFunction",kind:e,body:zm(t?.body)}}function qc(e){return{type:"Alternative",body:xB(e?.body)}}function lw(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function dw(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function bB(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!kve(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:zm(t?.body)}}function V1(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 rb(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:xB(e?.body)}}function hve(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function hw(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 fve(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:xd(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function mve(e){return{type:"Flags",...e}}function Hs(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:zm(e?.body)}}function nc(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:zm(e?.body)}}function pve(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function gve(e,t){const n=!!t?.negate;if(!lC.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function yB(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 bve(e,t){return{type:"Regex",body:zm(t?.body),flags:e}}function kB(e){return{type:"Subroutine",ref:e}}function Bu(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let r=n.unicodePropertyMap?.get(G1(e));if(!r){if(n.normalizeUnknownPropertyNames)r=xve(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(Bn`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function yve({flags:e,kind:t,name:n,negate:r,number:s}){switch(t){case"absence_repeater":return dve("repeater");case"atomic":return Hs({atomic:!0});case"capturing":return bB(s,{name:n});case"group":return Hs({flags:e});case"lookahead":case"lookbehind":return nc({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function zm(e){if(e===void 0)e=[qc()];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 xB(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 RP(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function PP(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function kve(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function xve(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 G1(e){return e.replace(/[- _]+/g,"").toLowerCase()}function OP(e,t){return xd(e,`${t?.type==="Character"&&t.value===93?"Empty":"Unclosed"} character class`)}function LP(e){return xd(e,"Unclosed group")}function Vh(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(){fg(c).splice(Math.max(0,Iu(i)+u),1),u--,l=!0},removeAllNextSiblings(){return fg(c).splice(Iu(i)+1)},removeAllPrevSiblings(){const b=Iu(i)+u;return u-=b,fg(c).splice(0,Math.max(0,b))},replaceWith(b,y={}){const _=!!y.traverse;c?c[Math.max(0,Iu(i)+u)]=b:xd(o,"Can't replace root node")[i]=b,_&&s(b,o,i,c),l=!0},replaceWithMultiple(b,y={}){const _=!!y.traverse;if(fg(c).splice(Math.max(0,Iu(i)+u),1,...b),u+=b.length-1,_){let S=0;for(let w=0;w<b.length;w++)S+=s(b[w],o,Iu(i)+w+S,c)}l=!0},skip(){l=!0}},{type:h}=a,f=t["*"],p=t[h],x=typeof f=="function"?f:f?.enter,g=typeof p=="function"?p:p?.enter;if(x?.(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),f?.exit?.(d,n),u}return s(e),e}function fg(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function Iu(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const _ve=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function vve(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function wve(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}const vs=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function hC(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===vs.DEFAULT==!o)){n instanceof Function?i+=n(c,{context:o?vs.CHAR_CLASS:vs.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 _B(e,t,n,r){hC(e,t,n,r)}function Sve(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===vs.DEFAULT==!a))return o;i==="["?a++:i==="]"&&a&&a--,s.lastIndex==o.index&&s.lastIndex++}return null}function mg(e,t,n){return!!Sve(e,t,0,n)}function Eve(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 $P=new RegExp(String.raw`(?<noncapturingStart>${_ve})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function Tve(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,f=0,p=!1,x;for($P.lastIndex=Number.isNaN(l)?0:l+a.length;x=$P.exec(e);){const{0:g,index:b,groups:{capturingStart:y,noncapturingStart:_}}=x;if(g==="[")h++;else if(h)g==="]"&&h--;else if(g===s&&!p)l=b,p=!0;else if(p&&_)f++;else if(y)p?f++:(c++,o.push(c+u));else if(g===")"&&p){if(!f){u++;const S=c+u;if(e=`${e.slice(0,l)}${a}${e.slice(l+s.length,b)}))<$$${S}>)${e.slice(b+1)}`,d=!0,i.push(S),vve(n,S),r.size){const w=new Map;r.forEach((v,C)=>{w.set(C>=S?C+1:C,v.map(I=>I>=S?I+1:I))}),r=w}break}f--}}}while(d);return n.push(...i),e=hC(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:h,groups:{backrefNum:f,wrappedBackrefNum:p}})=>{if(f){const x=+f;if(x>o.length-1)throw new Error(`Backref "${h}" greater than number of captures`);return`\\${o[x]}`}return`\\${p}`},vs.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}const vB=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Ex=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>${vB})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
92
|
+
| \\?.
|
|
93
|
+
`.replace(/\s+/g,""),"gsu");function Cve(e){if(!new RegExp(`${vB}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,s="",a=0,o;for(Ex.lastIndex=0;o=Ex.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=wve(e,c+u.length,l,"");else{if(s===")"||s==="]"){const f=s===")"?n:r;if(f===null)throw new Error(`Invalid unmatched "${s}"`);e=`${e.slice(0,f)}(?>${e.slice(f,c)}${u})${e.slice(c+i.length)}`}else e=`${e.slice(0,c-s.length)}(?>${s}${u})${e.slice(c+i.length)}`;h+=4}Ex.lastIndex+=h}else i[0]==="("?t.push(c):i===")"&&(n=t.length?t.pop():null);s=i}return{pattern:e}}const xs=String.raw,Ive=xs`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,fw=xs`\(\?R=(?<rDepth>[^\)]+)\)|${Ive}`,K1=xs`\(\?<(?![=!])(?<captureName>[^>]+)>`,wB=xs`${K1}|(?<unnamed>\()(?!\?)`,qi=new RegExp(xs`${K1}|${fw}|\(\?|\\?.`,"gsu"),Tx="Cannot use multiple overlapping recursions";function Ave(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let s=t?.captureTransfers??new Map;if(!new RegExp(fw,"su").test(e))return{pattern:e,captureTransfers:s,hiddenCaptures:n};if(r==="plugin"&&mg(e,xs`\(\?\(DEFINE\)`,vs.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const a=[],o=mg(e,xs`\\[1-9]`,vs.DEFAULT),i=new Map,c=[];let u=!1,l=0,d=0,h;for(qi.lastIndex=0;h=qi.exec(e);){const{0:f,groups:{captureName:p,rDepth:x,gRNameOrNum:g,gRDepth:b}}=h;if(f==="[")l++;else if(l)f==="]"&&l--;else if(x){if(MP(x),u)throw new Error(Tx);if(o)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const y=e.slice(0,h.index),_=e.slice(qi.lastIndex);if(mg(_,fw,vs.DEFAULT))throw new Error(Tx);const S=+x-1;e=jP(y,_,S,!1,n,a,d),s=FP(s,y,S,a.length,0,d);break}else if(g){MP(b);let y=!1;for(const V of c)if(V.name===g||V.num===+g){if(y=!0,V.hasRecursedWithin)throw new Error(Tx);break}if(!y)throw new Error(xs`Recursive \g cannot be used outside the referenced group "${r==="external"?g:xs`\g<${g}&R=${b}>`}"`);const _=i.get(g),S=Eve(e,_);if(o&&mg(S,xs`${K1}|\((?!\?)`,vs.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const w=e.slice(_,h.index),v=S.slice(w.length+f.length),C=a.length,I=+b-1,R=jP(w,v,I,!0,n,a,d);s=FP(s,w,I,a.length-C,C,d);const N=e.slice(0,_),z=e.slice(_+S.length);e=`${N}${R}${z}`,qi.lastIndex+=R.length-f.length-w.length-v.length,c.forEach(V=>V.hasRecursedWithin=!0),u=!0}else if(p)d++,i.set(String(d),qi.lastIndex),i.set(p,qi.lastIndex),c.push({num:d,name:p});else if(f[0]==="("){const y=f==="(";y&&(d++,i.set(String(d),qi.lastIndex)),c.push(y?{num:d}:{})}else f===")"&&c.pop()}return n.push(...a),{pattern:e,captureTransfers:s,hiddenCaptures:n}}function MP(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 jP(e,t,n,r,s,a,o){const i=new Set;r&&_B(e+t,K1,({groups:{captureName:u}})=>{i.add(u)},vs.DEFAULT);const c=[n,r?i:null,s,a,o];return`${e}${DP(`(?:${e}`,"forward",...c)}(?:)${DP(`${t})`,"backward",...c)}${t}`}function DP(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+=hC(e,xs`${wB}|\\k<(?<backref>[^>]+)>`,({0:h,groups:{captureName:f,unnamed:p,backref:x}})=>{if(x&&r&&!r.has(x))return h;const g=`_$${d}`;if(p||f){const b=o+a.length+1;return a.push(b),Nve(s,b),p?h:`(?<${f}${g}>`}return xs`\k<${x}${g}>`},vs.DEFAULT)}return u}function Nve(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function FP(e,t,n,r,s,a){if(e.size&&r){let o=0;_B(t,wB,()=>o++,vs.DEFAULT);const i=a-o+s,c=new Map;return e.forEach((u,l)=>{const d=(r-o*n)/n,h=o*n,f=l>i+o?l+r:l,p=[];for(const x of u)if(x<=i)p.push(x);else if(x>i+o+d)p.push(x+r);else if(x<=i+o)for(let g=0;g<=n;g++)p.push(x+o*g);else for(let g=0;g<=n;g++)p.push(x+h+d*g);c.set(f,p)}),c}return e}var En=String.fromCodePoint,Ge=String.raw,go={flagGroups:(()=>{try{new RegExp("(?i:)")}catch{return!1}return!0})(),unicodeSets:(()=>{try{new RegExp("[[]]","v")}catch{return!1}return!0})()};go.bugFlagVLiteralHyphenIsRange=go.unicodeSets?(()=>{try{new RegExp(Ge`[\d\-a]`,"v")}catch{return!0}return!1})():!1;go.bugNestedClassIgnoresNegation=go.unicodeSets&&new RegExp("[[^a]]","v").test("a");function j0(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function Uf(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function mw(e,t){return BP[e]>=BP[t]}function Rve(e,t){if(e==null)throw new Error(t??"Value expected");return e}var BP={ES2025:2025,ES2024:2024,ES2018:2018},Pve={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function SB(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!Pve[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=go.flagGroups?"ES2025":go.unicodeSets?"ES2024":"ES2018"),t}var Ove="[ -\r ]",Lve=new Set([En(304),En(305)]),Qa=Ge`[\p{L}\p{M}\p{N}\p{Pc}]`;function EB(e){if(Lve.has(e))return[e];const t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),s=jve.get(n),a=$ve.get(n),o=Mve.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 fC=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=>[G1(e),e])),$ve=new Map([["s",En(383)],[En(383),"s"]]),Mve=new Map([[En(223),En(7838)],[En(107),En(8490)],[En(229),En(8491)],[En(969),En(8486)]]),jve=new Map([Fo(453),Fo(456),Fo(459),Fo(498),...Cx(8072,8079),...Cx(8088,8095),...Cx(8104,8111),Fo(8124),Fo(8140),Fo(8188)]),Dve=new Map([["alnum",Ge`[\p{Alpha}\p{Nd}]`],["alpha",Ge`\p{Alpha}`],["ascii",Ge`\p{ASCII}`],["blank",Ge`[\p{Zs}\t]`],["cntrl",Ge`\p{Cc}`],["digit",Ge`\p{Nd}`],["graph",Ge`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",Ge`\p{Lower}`],["print",Ge`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",Ge`[\p{P}\p{S}]`],["space",Ge`\p{space}`],["upper",Ge`\p{Upper}`],["word",Ge`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",Ge`\p{AHex}`]]);function Fve(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Fo(e){const t=En(e);return[t.toLowerCase(),t]}function Cx(e,t){return Fve(e,t).map(n=>Fo(n))}var TB=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function Bve(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};CB(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:mw(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};Vh(e,zve,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};Vh(e,Uve,a);const o={groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer};return Vh(e,Hve,o),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var zve={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:s}=e;if(s==="repeater"){const a=Hs();a.body[0].body.push(nc({negate:!0,body:r}),Bu("Any"));const o=Hs();o.body[0].body.push(yB("greedy",0,1/0,a)),n(sn(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];Uf(r,o,[]).push(...s)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const n=AB(t.get(e));if(n){const r=Hs({flags:n});r.body[0].body=e.body,e.body=[sn(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:f}=i;if(c==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${u?"Y":"y"}"`);if(c==="line_end")o(sn(nc({body:[qc({body:[lw("string_end")]}),qc({body:[V1(10)]})]}),t));else if(c==="line_start")o(sn(Xa(Ge`(?<=\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&&Yve(p))o(sn(nc({negate:!0}),t));else{if(d)throw new Error(Ge`Uses "\G" in a way that requires a subclass`);o(Bo(lw("string_start"),t)),i.strategy="clip_search"}}else if(!(c==="string_end"||c==="string_start"))if(c==="string_end_newline")o(sn(Xa(Ge`(?=\n?\z)`),t));else if(c==="word_boundary"){if(!f&&!l){const p=`(?:(?<=${Qa})(?!${Qa})|(?<!${Qa})(?=${Qa}))`,x=`(?:(?<=${Qa})(?=${Qa})|(?<!${Qa})(?!${Qa}))`;o(sn(Xa(u?x:p),t))}}else throw new Error(`Unexpected assertion kind "${c}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Ax(n)&&(n=Ix(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!Ax(r)&&(r=Ix(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=rb({body:[e]});n(sn(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(Bo(hw("digit",{negate:u}),t));return}if(o&&(c==="space"||l==="space")){n(sn(Nx(Xa(Ove),u),t));return}if(i&&(c==="word"||l==="word")){n(Bo(hw("word",{negate:u}),t));return}if(c==="any")n(Bo(Bu("Any"),t));else if(c==="digit")n(Bo(Bu("Nd",{negate:u}),t));else if(c!=="dot")if(c==="text_segment"){if(r==="strict")throw new Error(Ge`Use of "\X" requires non-strict accuracy`);const d="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",h=Ge`\p{RI}{2}|${d}(?:\u200D${d})*`;n(sn(Xa(Ge`(?>\r\n|${s?Ge`\p{RGI_Emoji}`:h}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c==="hex")n(Bo(Bu("AHex",{negate:u}),t));else if(c==="newline")n(sn(Xa(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-${En(d.codePointAt(0)-1)}${En(d.codePointAt(2)+1)}-`),n(sn(Xa(`[${d}]`),t))}else n(sn(Nx(Xa(Dve.get(l)),u),t));else if(c==="property")fC.has(G1(l))||(e.key="sc");else if(c==="space")n(Bo(Bu("space",{negate:u}),t));else if(c==="word")n(sn(Nx(Xa(Qa),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=Hs({flags:c});u.body[0].body=o(),s(sn(u,t),{traverse:!0})}else if(i==="keep"){const u=n.body[0],d=n.body.length===1&&pB(u,{type:"Group"})&&u.body[0].body.length===1?u.body[0]:n;if(t.parent!==d||d.body.length>1)throw new Error(Ge`Uses "\K" in a way that's unsupported`);const h=nc({behind:!0});h.body[0].body=a(),s(sn(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(sn(nc({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=Hs();t.body[0].body.push(e.body),e.body=sn(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=RB(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(Ge`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Ax(n)&&(n=Ix(n,t),e.ref=n)}},Uve={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=Bo(zP(e.number),t);c.set(d,i.get(e.number)),n(d);return}i.set(e.number,e),o.set(e.number,[]),e.name&&Uf(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=Uf(a,e.name,new Map);let h=!1;if(u)h=!0;else for(const f of d.values())if(!f.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=j0(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?zP(0):IB(o,r.groupOriginByCopy,null);let u=c;if(!i){const l=AB(Gve(o,h=>h.type==="Group"&&!!h.flags)),d=l?j0(r.globalFlags,l):r.globalFlags;qve(d,r.currentFlags)||(u=Hs({flags:Kve(d)}),u.body[0].body.push(c))}n(sn(u,t),{traverse:!i})}},Hve={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=>Vve(o,e));if(!a.length)n(sn(nc({negate:!0}),t));else if(a.length>1){const o=Hs({atomic:!0,body:a.reverse().map(i=>qc({body:[dw(i.number)]}))});n(sn(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=bB();e.body.at(-1).body.push(s)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function CB(e){Vh(e,{"*"({node:t,parent:n}){t.parent=n}})}function qve(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function Vve(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const r=NB(n.parent);for(const s of r){if(s===n)break;if(s===e||PB(s,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function IB(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]=IB(o,t,s,n):(a==="type"&&o==="CapturingGroup"&&t.set(s,t.get(e)??e),s[a]=o);return s}function zP(e){const t=kB(e);return t.isRecursive=!0,t}function Gve(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Ix(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 AB(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 Kve({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 NB(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function RB(e){const t=e.find(n=>n.kind==="search_start"||Jve(n,{negate:!1})||!Wve(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=RB(r.body);if(!s)return null;Array.isArray(s)?n.push(...s):n.push(s)}return n}return null}function PB(e,t){const n=NB(e)??[];for(const r of n)if(r===t||PB(r,t))return!0;return!1}function Wve({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function Yve(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function Jve(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&pB(e.body[0],{type:"Assertion",kind:"search_start"})}function Ax(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Xa(e,t){const r=gB(e,{...t,unicodePropertyMap:fC}).body;return r.length>1||r[0].body.length>1?Hs({body:r}):r[0].body[0]}function Nx(e,t){return e.negate=t,e}function Bo(e,t){return e.parent=t,e}function sn(e,t){return CB(e),e.parent=t,e}function Qve(e,t){const n=SB(t),r=mw(n.target,"ES2024"),s=mw(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 f=[e.flags.ignoreCase];Vh(e,Xve,{getCurrentModI:()=>f.at(-1),popModI(){f.pop()},pushModI(p){f.push(p)},setHasCasedChar(){f.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(f){return l.lastNode=u,u=f,Rve(Zve[f.type],`Unexpected node type "${f.type}"`)(f,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((f,p)=>{f.hidden&&h._hiddenCaptures.push(p),f.transferTo&&Uf(h._captureTransfers,f.transferTo,[]).push(p)}),h}var Xve={"*":{enter({node:e},t){if(HP(e)){const n=t.getCurrentModI();t.pushModI(e.flags?j0({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){HP(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){mC(En(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),OB(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&TB.has(e.value)&&t.setHasCasedChar()}},Zve={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?Ge`\B`:Ge`\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=En(e),r=Au(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&mC(n)){const s=EB(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");go.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(qP)&&(o=[V1(45),...o.filter(u=>!qP(u))]);const i=()=>`[${s?"^":""}${o.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||go.bugNestedClassIgnoresNegation)&&!s){const l=o.filter(d=>d.type==="CharacterClass"&&d.kind==="union"&&d.negate);if(l.length){const d=Hs(),h=d.body[0];return d.parent=a,h.parent=d,o=o.filter(f=>!l.includes(f)),e.body=o,o.length?(e.parent=h,h.body.push(e)):d.body.pop(),l.forEach(f=>{const p=qc({body:[f]});f.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"&&!(go.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=Au(n,s),o=Au(r,s),i=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const c=OB(e);swe(c).forEach(l=>{i.add(Array.isArray(l)?`${Au(l[0],s)}-${Au(l[1],s)}`:Au(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?".":"[^]":Ge`[^\n]`;if(e==="digit")return t?Ge`\D`:Ge`\d`;if(e==="property"){if(s.useAppliedIgnoreCase&&s.currentFlags.ignoreCase&&TB.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Ge`\P`:Ge`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?Ge`\W`:Ge`\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=j0(o,n));const i=t.map(a).join("|"),c=!s.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!s.useFlagMods||!n)?i:`(?${awe(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)+owe(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})`:Ge`\g<${t}&R=${r}>`}},ewe=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),twe=new Set(["-","\\","]","^","["]),nwe=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),UP=new Map([[9,Ge`\t`],[10,Ge`\n`],[11,Ge`\v`],[12,Ge`\f`],[13,Ge`\r`],[8232,Ge`\u2028`],[8233,Ge`\u2029`],[65279,Ge`\uFEFF`]]),rwe=new RegExp("^\\p{Cased}$","u");function mC(e){return rwe.test(e)}function OB(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=En(o);if(!mC(i))continue;const c=EB(i).filter(u=>{const l=u.codePointAt(0);return l<r||l>s});if(c.length&&(a.push(...c),n))break}return a}function Au(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(UP.has(e))return UP.get(e);if(e<32||e>126&&e<160||e>262143||t&&iwe(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const s=n?r?nwe:twe:ewe,a=En(e);return(s.has(a)?"\\":"")+a}function swe(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 awe(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 owe({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 HP({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function iwe(e){return e>47&&e<58}function qP({type:e,value:t}){return e==="Character"&&t===45}var cwe=class pw 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 pw&&(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=lwe(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 pw(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&&(uwe(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=dwe(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 uwe(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 lwe(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)Uf(n,a,{}).transferTo=r;return n}function dwe(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 hwe(e,t){const n=fwe(e,t);return n.options?new cwe(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function fwe(e,t){const n=SB(t),r=gB(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:fC}),s=Bve(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),a=Qve(s,n),o=Ave(a.pattern,{captureTransfers:a._captureTransfers,hiddenCaptures:a._hiddenCaptures,mode:"external"}),i=Cve(o.pattern),c=Tve(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,x)=>p-x),d=Array.from(c.captureTransfers),h=s._strategy,f=u.pattern.length>=n.lazyCompileLength;(l.length||d.length||h||f)&&(u.options={...l.length&&{hiddenCaptures:l},...d.length&&{transfers:d},...h&&{strategy:h},...f&&{lazyCompile:f}})}return u}function mwe(e,t){return hwe(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function pwe(e={}){const t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||=n=>mwe(n,{target:t.target}),{createScanner(n){return new N_e(n,t)},createString(n){return{content:n}}}}const LB=["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"],gw={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"},$B={json:()=>ft(()=>import("./json-Cp-IABpG.js"),[]),xml:()=>ft(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([0,1])),yaml:()=>ft(()=>import("./yaml-Buea-lGh.js"),[]),shellscript:()=>ft(()=>import("./shellscript-Yzrsuije.js"),[]),typescript:()=>ft(()=>import("./typescript-BPQ3VLAy.js"),[]),javascript:()=>ft(()=>import("./javascript-wDzz0qaB.js"),[]),python:()=>ft(()=>import("./python-B6aJPvgy.js"),[]),html:()=>ft(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([2,3,4])),css:()=>ft(()=>import("./css-DPfMkruS.js"),[]),markdown:()=>ft(()=>import("./markdown-Cvjx9yec.js"),[]),sql:()=>ft(()=>import("./sql-BLtJtn59.js"),[]),graphql:()=>ft(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([5,3,6,7,8])),go:()=>ft(()=>import("./go-CxLEBnE3.js"),[]),rust:()=>ft(()=>import("./rust-B1yitclQ.js"),[]),java:()=>ft(()=>import("./java-CylS5w8V.js"),[]),ruby:()=>ft(()=>import("./ruby-xesJ3fNi.js"),__vite__mapDeps([9,2,3,4,0,1,10,5,6,7,8,11,12,13,14])),php:()=>ft(()=>import("./php-Dhbhpdrm.js"),__vite__mapDeps([15,2,3,4,0,1,10,16])),swift:()=>ft(()=>import("./swift-D82vCrfD.js"),[]),kotlin:()=>ft(()=>import("./kotlin-BdnUsdx6.js"),[]),c:()=>ft(()=>import("./c-BIGW1oBm.js"),[]),cpp:()=>ft(()=>import("./cpp-BRuaLJcg.js"),__vite__mapDeps([11,12,10])),csharp:()=>ft(()=>import("./csharp-COcwbKMJ.js"),[]),tsx:()=>ft(()=>import("./tsx-COt5Ahok.js"),[]),jsx:()=>ft(()=>import("./jsx-g9-lgVsj.js"),[]),toml:()=>ft(()=>import("./toml-vGWfd6FD.js"),[]),dockerfile:()=>ft(()=>import("./dockerfile-BcOcwvcX.js"),[]),diff:()=>ft(()=>import("./diff-D97Zzqfu.js"),[]),http:()=>ft(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([17,13,16,0,1,5,3,6,7,8])),jsonc:()=>ft(()=>import("./jsonc-Des-eS-w.js"),[]),log:()=>ft(()=>import("./log-2UxHyX5q.js"),[]),proto:()=>ft(()=>import("./proto-C7zT0LnQ.js"),[])},gwe=new Set([...LB,...Object.keys(gw)]);function pC(e){const t=e.trim().toLowerCase();return t in $B?t:t in gw?gw[t]:null}function bwe(e){return gwe.has(e.trim().toLowerCase())}const ywe=pwe({forgiving:!0});let Rx=null,pg=null;async function gC(){return Rx||pg||(pg=A_e({themes:[ft(()=>import("./vitesse-dark-D0r3Knsf.js"),[])],langs:Object.values($B).map(e=>e()),engine:ywe}).then(e=>(Rx=e,e)),pg)}gC();async function kwe(e,t){const n=await gC(),r=pC(t.lang)??"json";return n.codeToHtml(e,{lang:r,theme:"vitesse-dark"})}const VP="vitesse-dark",gg=new Map,Vi=new Map;function xwe(){return{name:"shiki",type:"code-highlighter",getSupportedLanguages:()=>[...LB],getThemes:()=>[VP,VP],supportsLanguage:e=>bwe(e),highlight(e,t){const r=pC(e.language)??"json",s=`${r}:${e.code.length}:${e.code.slice(0,128)}`,a=gg.get(s);return a||(t&&(Vi.has(s)||Vi.set(s,new Set),Vi.get(s).add(t)),gC().then(o=>{if(gg.has(s)){const c=gg.get(s);Vi.get(s)?.forEach(u=>u(c)),Vi.delete(s);return}const i=o.codeToTokens(e.code,{lang:r,themes:{light:"vitesse-dark",dark:"vitesse-dark"}});gg.set(s,i),Vi.get(s)?.forEach(c=>c(i)),Vi.delete(s)}),null)}}}const GP=new Map;function _we(e,t){return`${t}::${e.length}::${e.slice(0,64)}`}function vwe(e,t){if(t)return pC(t)??"json";const n=e.trimStart();return n.startsWith("{")||n.startsWith("[")?"json":n.startsWith("<")?"xml":n.startsWith("---")?"yaml":"json"}function MB(e){const{code:t,lang:n,className:r}=e,[s,a]=O.useState(null),[o,i]=O.useState(!1),c=O.useRef(!0),u=vwe(t,n),l=_we(t,u);O.useEffect(()=>(c.current=!0,()=>{c.current=!1}),[]),O.useEffect(()=>{const h=GP.get(l);if(h){a(h);return}let f=!1;return kwe(t,{lang:u}).then(p=>{f||(GP.set(l,p),c.current&&a(p))}),()=>{f=!0}},[t,l,u]);const d=O.useCallback(()=>{navigator.clipboard.writeText(t).then(()=>{i(!0),setTimeout(()=>i(!1),1500)})},[t]);return m.jsxs("div",{className:je("group relative overflow-auto",r),children:[m.jsx("button",{type:"button",onClick:d,className:"absolute right-2 top-2 z-10 rounded-md border border-border bg-card/90 p-1.5 text-muted-foreground/40 opacity-0 backdrop-blur-sm transition-all hover:text-foreground group-hover:opacity-100",title:"Copy to clipboard",children:o?m.jsx(hi,{className:"size-3"}):m.jsx(ZT,{className:"size-3"})}),s?m.jsx("div",{className:"shiki-container text-[12px] leading-relaxed [&_pre]:!bg-transparent [&_pre]:p-3 [&_code]:font-mono",dangerouslySetInnerHTML:{__html:s}}):m.jsx("pre",{className:"p-3 font-mono text-[12px] leading-relaxed text-foreground/60",children:t})]})}function jB(e){const[t,n]=O.useState(null);O.useEffect(()=>{n(window.location.origin)},[]);const r=O.useMemo(()=>t?`npx add-mcp "${t}/mcp" --transport http --name "executor"`:'npx add-mcp "<this-server>/mcp" --transport http --name "executor"',[t]);return m.jsxs("section",{className:e.className??"rounded-2xl border border-border bg-card/80 p-5",children:[m.jsxs("div",{className:"mb-3 space-y-1",children:[m.jsx("h2",{className:"text-sm font-semibold text-foreground",children:e.title??"Install local MCP"}),m.jsx("p",{className:"text-[13px] text-muted-foreground",children:e.description??"Add this local executor server to an MCP client with one command. The URL uses the same origin as this web app."})]}),m.jsx(MB,{code:r,lang:"bash",className:"rounded-xl border border-border bg-background/70"})]})}const KP=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,WP=D1,DB=(e,t)=>n=>{var r;if(t?.variants==null)return WP(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=KP(l)||KP(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,...f}=l;return Object.entries(f).every(p=>{let[x,g]=p;return Array.isArray(g)?g.includes({...a,...i}[x]):{...a,...i}[x]===g})?[...u,d,h]:u},[]);return WP(e,o,c,n?.class,n?.className)},wwe=DB("inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-medium tracking-wide uppercase",{variants:{variant:{default:"border-transparent bg-primary/15 text-primary",secondary:"border-transparent bg-secondary text-secondary-foreground",outline:"border-border text-muted-foreground",muted:"border-transparent 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)]",destructive:"border-destructive/20 bg-destructive/10 text-destructive"}},defaultVariants:{variant:"default"}});function Cs({className:e,variant:t,...n}){return m.jsx("span",{className:je(wwe({variant:t}),e),...n})}function FB({method:e}){const t={GET:"get",POST:"post",PUT:"put",PATCH:"put",DELETE:"delete"}[e.toUpperCase()]??"outline";return m.jsx(Cs,{variant:t,children:e})}const Swe=DB("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 outline-none focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-offset-1 focus-visible:ring-offset-background cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground",destructive:"bg-destructive text-white hover:bg-destructive/90"},size:{default:"h-9 px-4 py-2",sm:"h-7 rounded-md px-2.5 text-xs",lg:"h-10 rounded-md px-6",icon:"h-8 w-8"}},defaultVariants:{variant:"default",size:"default"}});function en({className:e,variant:t,size:n,...r}){return m.jsx("button",{className:je(Swe({variant:t,size:n}),e),...r})}function Ewe(){const e=j1();return m.jsx("div",{className:"flex-1 overflow-y-auto",children:m.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-10 lg:px-10 lg:py-14",children:[m.jsxs("div",{className:"flex items-end justify-between mb-8",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"font-display text-3xl tracking-tight text-foreground lg:text-4xl",children:"Sources"}),m.jsx("p",{className:"mt-1.5 text-[14px] text-muted-foreground",children:"Connected tool providers in this workspace."})]}),m.jsx(nr,{to:"/sources/add",children:m.jsxs(en,{size:"sm",children:[m.jsx(_o,{className:"size-3.5"}),"Add source"]})})]}),m.jsx(jB,{className:"mb-8"}),m.jsx(cu,{loadable:e,loading:"Loading sources...",children:t=>t.length===0?m.jsxs("div",{className:"flex flex-col items-center justify-center rounded-2xl border border-dashed border-border py-20",children:[m.jsx("div",{className:"flex size-12 items-center justify-center rounded-2xl bg-muted text-muted-foreground mb-4",children:m.jsx(l1e,{className:"size-5"})}),m.jsx("p",{className:"text-[14px] font-medium text-foreground/70 mb-1",children:"No sources yet"}),m.jsx("p",{className:"text-[13px] text-muted-foreground/60 mb-5",children:"Add a source to get started."}),m.jsx(nr,{to:"/sources/add",children:m.jsxs(en,{size:"sm",children:[m.jsx(_o,{className:"size-3.5"}),"Add source"]})})]}):m.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(n=>m.jsx(Twe,{source:n},n.id))})})]})})}function Twe({source:e}){return m.jsxs(nr,{to:"/sources/$sourceId",params:{sourceId:e.id},search:{tab:"model"},className:"group flex flex-col rounded-xl border border-border bg-card p-4 transition-all hover:border-primary/30 hover:shadow-[0_2px_12px_-4px_rgba(0,0,0,0.12)]",children:[m.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[m.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary/8 text-primary",children:m.jsx(Mf,{endpoint:e.endpoint,kind:e.kind,className:"size-4.5"})}),m.jsx(Cs,{variant:e.status==="connected"?"default":e.status==="error"?"destructive":"muted",className:"shrink-0",children:e.status})]}),m.jsx("h3",{className:"text-[14px] font-semibold text-foreground group-hover:text-primary transition-colors mb-0.5",children:e.name}),m.jsx("div",{className:"flex items-center gap-2 mt-auto pt-2",children:m.jsx(Cs,{variant:"outline",className:"text-[9px]",children:e.kind})})]})}function BB(){return m.jsx("div",{className:"flex h-full min-h-48 items-center justify-center px-6",children:m.jsxs("div",{className:"flex max-w-sm flex-col items-center text-center",children:[m.jsx(y8,{className:"mb-4 text-muted-foreground/20"}),m.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"Source not found"}),m.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"This source no longer exists in the current workspace."}),m.jsxs("div",{className:"mt-5 flex items-center gap-2",children:[m.jsx(nr,{to:"/",className:je("inline-flex h-7 items-center justify-center rounded-md border border-input bg-transparent px-2.5 text-xs font-medium transition-all","hover:bg-accent hover:text-accent-foreground"),children:"Back to dashboard"}),m.jsx(nr,{to:"/sources/add",className:je("inline-flex h-7 items-center justify-center rounded-md bg-primary px-2.5 text-xs font-medium text-primary-foreground transition-all","hover:bg-primary/90"),children:"Add source"})]})]})})}const Vc=(e="")=>({transport:e,queryParamsText:"",headersText:""}),Um=e=>({transport:"stdio",command:e?.command??"",argsText:e?.argsText??"",envText:e?.envText??"",cwd:e?.cwd??""}),Hm=e=>e==="stdio"?"auto":e??"",zB=(e,t)=>t==="stdio"?e.transport==="stdio"?e:Um():e.transport==="stdio"?Vc(t):{...e,transport:t},Cwe=hr(Qe({key:E,value:E})),Iwe=hr(ge(E)),Awe=(e,t)=>new Error(`${e} is invalid: ${cl.formatErrorSync(t)}`),UB=e=>{const t=e.text.trim();if(t.length===0)return null;const n=Ace(e.schema)(t);if(Dn(n))throw Awe(e.label,n.left);return n.right},gs=(e,t)=>{const n=UB({label:e,text:t,schema:Cwe});return n&&Object.keys(n).length>0?n:null},HB=(e,t)=>{const n=UB({label:e,text:t,schema:Iwe});if(!n)return null;const r=n.map(s=>s.trim()).filter(s=>s.length>0);return r.length>0?r:null},Nwe=e=>e.kind==="mcp"&&e.connectionType==="command"&&e.transport==="stdio",Rwe=(e,t)=>`https://www.googleapis.com/discovery/v1/apis/${encodeURIComponent(e)}/${encodeURIComponent(t)}/rest`,wn=e=>{const t=e.discoveryUrl??Rwe(e.service,e.version);return{id:e.id,name:e.name,summary:e.summary,kind:"google_discovery",endpoint:t,groupId:"google_workspace",groupLabel:"Google Workspace",batchable:!0,service:e.service,version:e.version,discoveryUrl:t}},bw=[{id:"deepwiki-mcp",name:"DeepWiki MCP",summary:"Repository docs and knowledge graphs via MCP.",kind:"mcp",endpoint:"https://mcp.deepwiki.com/mcp"},{id:"axiom-mcp",name:"Axiom MCP",summary:"Query, stream, and analyze logs, traces, and event data.",kind:"mcp",endpoint:"https://mcp.axiom.co/mcp"},{id:"neon-mcp",name:"Neon MCP",summary:"Manage Postgres databases, branches, and queries via MCP.",kind:"mcp",endpoint:"https://mcp.neon.tech/mcp"},{id:"chrome-devtools-mcp",name:"Chrome DevTools MCP",summary:"Debug a live Chrome browser session over a local MCP stdio transport.",kind:"mcp",namespace:"chrome.devtools",connectionType:"command",transport:"stdio",command:"npx",args:["-y","chrome-devtools-mcp@latest"]},{id:"neon-api",name:"Neon API",summary:"Projects, branches, endpoints, databases, and API keys.",kind:"openapi",endpoint:"https://console.neon.tech/api/v2",specUrl:"https://neon.com/api_spec/release/v2.json"},{id:"github-rest",name:"GitHub REST API",summary:"Repos, issues, pull requests, actions, and org settings.",kind:"openapi",endpoint:"https://api.github.com",specUrl:"https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.yaml",groupId:"github",groupLabel:"GitHub",batchable:!1},{id:"github-graphql",name:"GitHub GraphQL",summary:"Issues, pull requests, discussions, and repository objects via GraphQL.",kind:"graphql",endpoint:"https://api.github.com/graphql",groupId:"github",groupLabel:"GitHub",batchable:!1},{id:"gitlab-graphql",name:"GitLab GraphQL",summary:"Projects, merge requests, issues, CI pipelines, and users.",kind:"graphql",endpoint:"https://gitlab.com/api/graphql"},{id:"openai-api",name:"OpenAI API",summary:"Models, files, responses, and fine-tuning.",kind:"openapi",endpoint:"https://api.openai.com/v1",specUrl:"https://app.stainless.com/api/spec/documented/openai/openapi.documented.yml"},{id:"vercel-api",name:"Vercel API",summary:"Deployments, projects, domains, and environments.",kind:"openapi",endpoint:"https://api.vercel.com",specUrl:"https://openapi.vercel.sh"},{id:"stripe-api",name:"Stripe API",summary:"Payments, billing, subscriptions, and invoices.",kind:"openapi",endpoint:"https://api.stripe.com",specUrl:"https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json"},{id:"linear-graphql",name:"Linear GraphQL",summary:"Issues, teams, cycles, and projects.",kind:"graphql",endpoint:"https://api.linear.app/graphql"},{id:"monday-graphql",name:"Monday GraphQL",summary:"Boards, items, updates, users, and workspace metadata.",kind:"graphql",endpoint:"https://api.monday.com/v2"},{id:"anilist-graphql",name:"AniList GraphQL",summary:"Anime, manga, characters, media lists, and recommendations.",kind:"graphql",endpoint:"https://graphql.anilist.co"},wn({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"}),wn({id:"google-drive",name:"Google Drive",summary:"Files, folders, permissions, comments, and shared drives.",service:"drive",version:"v3"}),wn({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"}),wn({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"}),wn({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"}),wn({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"}),wn({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"}),wn({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"}),wn({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"}),wn({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"}),wn({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"}),wn({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"}),wn({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"}),wn({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"}),wn({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"}),wn({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"}),wn({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"}),wn({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"}),wn({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"})],Pwe=2*6e4,qB="executor:oauth-result:",Owe=e=>e.status==="error"&&e.error.message.toLowerCase().includes("source not found"),Lwe=["mcp","openapi","graphql","google_discovery","internal"],$we=["auto","streamable-http","sse","stdio"],Mwe=["none","bearer","oauth2","provider_grant_ref","mcp_oauth"],Hf=e=>{const t=e.trim();return t.length>0?t:null},jwe=e=>{try{const t=S8(e);if(!t)return"";const n=t.indexOf(".");return n>0?t.slice(0,n):t}catch{return""}},Dwe=e=>`google.${e.trim().toLowerCase().replace(/[^a-z0-9]+/g,".").replace(/^\.+|\.+$/g,"")}`,YP=e=>{if(typeof window>"u")return null;const t=window.localStorage.getItem(`${qB}${e}`);if(!t)return null;try{return JSON.parse(t)}catch{return null}},JP=e=>{typeof window>"u"||window.localStorage.removeItem(`${qB}${e}`)},Fwe=async e=>{if(typeof window>"u")throw new Error("OAuth popup is only available in a browser context");JP(e.sessionId);const t=window.open(e.authorizationUrl,"executor-source-oauth","popup=yes,width=520,height=720");if(!t)throw new Error("Popup blocked. Allow popups and try again.");return t.focus(),await new Promise((n,r)=>{let s=!1,a=0,o=0;const i=()=>{window.removeEventListener("message",l),a&&window.clearInterval(a),o&&window.clearTimeout(o),t.closed||t.close(),JP(e.sessionId)},c=d=>{s||(s=!0,i(),r(new Error(d)))},u=d=>{if(!d.ok){c(d.error||"OAuth failed");return}s||(s=!0,i(),n(d.auth))},l=d=>{if(d.origin!==window.location.origin)return;const h=d.data;!h||h.type!=="executor:oauth-result"||h.ok&&h.sessionId!==e.sessionId||!h.ok&&h.sessionId!==null&&h.sessionId!==e.sessionId||u(h)};window.addEventListener("message",l),o=window.setTimeout(()=>{c("OAuth popup timed out before completion. Please try again.")},Pwe),a=window.setInterval(()=>{const d=YP(e.sessionId);if(d){u(d);return}t.closed&&(window.clearInterval(a),a=0,window.setTimeout(()=>{const h=YP(e.sessionId);if(h){u(h);return}c("OAuth popup was closed before completion.")},1500))},300)})},bh=e=>e===null?"":JSON.stringify(e,null,2),VB=e=>!e||e.length===0?"":JSON.stringify(e,null,2),bg=(e,t)=>{const n=e.binding[t];if(n==null||typeof n!="object"||Array.isArray(n))return null;const r=Object.entries(n);return r.every(([,s])=>typeof s=="string")?Object.fromEntries(r):null},Bwe=(e,t)=>{const n=e.binding[t];return Array.isArray(n)&&n.every(r=>typeof r=="string")?[...n]:null},Wd=(e,t)=>typeof e.binding[t]=="string"?String(e.binding[t]):"",Px=e=>{const t=e.binding.transport;return typeof t=="string"&&(t==="auto"||t==="streamable-http"||t==="sse"||t==="stdio")?t:""},zwe=e=>`stdio://local/${(e.name?.trim()||e.endpoint?.trim()||e.command?.trim()||"mcp").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"mcp"}`,QP=e=>({name:e?.name??"",kind:e?.kind??"openapi",endpoint:e?.endpoint??"",namespace:e?e.namespace??("service"in e?Dwe(e.service):jwe(e.endpoint??"")):"",enabled:!0,specUrl:e&&"specUrl"in e?e.specUrl:"",service:e&&"service"in e?e.service:"",version:e&&"version"in e?e.version:"",defaultHeadersText:"",authKind:e?.kind==="google_discovery"?"oauth2":"none",authHeaderName:"Authorization",authPrefix:"Bearer ",bearerProviderId:"",bearerHandle:"",oauthAccessProviderId:"",oauthAccessHandle:"",oauthRefreshProviderId:"",oauthRefreshHandle:"",managedAuth:null,...e?.kind==="mcp"&&e.connectionType==="command"?Um({command:e.command??"",argsText:VB(e.args),envText:bh(e.env??null),cwd:e.cwd??""}):Vc(e?.kind==="mcp"?Hm(e.transport):"")}),Uwe=e=>({name:e.name,kind:e.kind,endpoint:e.endpoint,namespace:e.namespace??"",enabled:e.enabled,specUrl:Wd(e,"specUrl"),service:Wd(e,"service"),version:Wd(e,"version"),defaultHeadersText:bh(bg(e,"defaultHeaders")),authKind:e.auth.kind,authHeaderName:e.auth.kind==="none"||e.auth.kind==="mcp_oauth"?"Authorization":e.auth.headerName,authPrefix:e.auth.kind==="none"||e.auth.kind==="mcp_oauth"?"Bearer ":e.auth.prefix,bearerProviderId:e.auth.kind==="bearer"?e.auth.token.providerId:"",bearerHandle:e.auth.kind==="bearer"?e.auth.token.handle:"",oauthAccessProviderId:e.auth.kind==="oauth2"?e.auth.accessToken.providerId:"",oauthAccessHandle:e.auth.kind==="oauth2"?e.auth.accessToken.handle:"",oauthRefreshProviderId:e.auth.kind==="oauth2"&&e.auth.refreshToken!==null?e.auth.refreshToken.providerId:"",oauthRefreshHandle:e.auth.kind==="oauth2"&&e.auth.refreshToken!==null?e.auth.refreshToken.handle:"",managedAuth:e.auth.kind==="provider_grant_ref"||e.auth.kind==="mcp_oauth"?e.auth:null,...e.kind==="mcp"&&Px(e)==="stdio"?Um({command:Wd(e,"command"),argsText:VB(Bwe(e,"args")),envText:bh(bg(e,"env")),cwd:Wd(e,"cwd")}):Vc(e.kind==="mcp"?Hm(Px(e)||"auto"):""),...e.kind==="mcp"&&Px(e)!=="stdio"?{queryParamsText:bh(bg(e,"queryParams")),headersText:bh(bg(e,"headers"))}:{}}),Hwe=e=>{if(e.authKind==="none")return{kind:"none"};if((e.authKind==="provider_grant_ref"||e.authKind==="mcp_oauth")&&e.managedAuth!==null)return e.managedAuth;const t=e.authHeaderName.trim()||"Authorization",n=e.authPrefix;if(e.authKind==="bearer"){const i=e.bearerProviderId.trim(),c=e.bearerHandle.trim();if(!i||!c)throw new Error("Bearer auth requires a token. Select or create a secret.");return{kind:"bearer",headerName:t,prefix:n,token:{providerId:i,handle:c}}}const r=e.oauthAccessProviderId.trim(),s=e.oauthAccessHandle.trim();if(!r||!s)throw new Error("OAuth2 auth requires an access token. Select or create a secret.");const a=Hf(e.oauthRefreshProviderId),o=Hf(e.oauthRefreshHandle);if(a===null!=(o===null))throw new Error("OAuth2 refresh token provider ID and handle must be set together.");return{kind:"oauth2",headerName:t,prefix:n,accessToken:{providerId:r,handle:s},refreshToken:a===null||o===null?null:{providerId:a,handle:o}}},qwe=e=>{if(!(e.kind!=="mcp"&&e.kind!=="openapi"&&e.kind!=="graphql"))return e.enabled?"connected":"draft"},GB=e=>{const t=e.name.trim(),n=e.kind==="mcp"&&e.transport==="stdio",r=e.kind==="mcp"&&e.transport==="stdio"?zwe({name:e.name,endpoint:e.endpoint,command:e.command}):e.endpoint.trim();if(!t)throw new Error("Source name is required.");if(!r)throw new Error("Source endpoint is required.");if(n&&!e.command.trim())throw new Error("MCP stdio transport requires a command.");const s={name:t,kind:e.kind,endpoint:r,status:qwe(e),enabled:e.enabled,namespace:Hf(e.namespace),auth:n?{kind:"none"}:Hwe(e)};if(e.kind==="mcp")return e.transport==="stdio"?{...s,binding:{transport:"stdio",queryParams:null,headers:null,command:e.command.trim(),args:HB("Args",e.argsText),env:gs("Environment",e.envText),cwd:Hf(e.cwd)}}:{...s,binding:{transport:e.transport===""?"auto":e.transport,queryParams:gs("Query params",e.queryParamsText),headers:gs("Request headers",e.headersText),command:null,args:null,env:null,cwd:null}};if(e.kind==="openapi"){const a=e.specUrl.trim();if(!a)throw new Error("OpenAPI sources require a spec URL.");return{...s,binding:{specUrl:a,defaultHeaders:gs("Default headers",e.defaultHeadersText)}}}if(e.kind==="graphql")return{...s,binding:{defaultHeaders:gs("Default headers",e.defaultHeadersText)}};if(e.kind==="google_discovery"){const a=e.service.trim(),o=e.version.trim();if(!a)throw new Error("Google Discovery sources require a service.");if(!o)throw new Error("Google Discovery sources require a version.");return{...s,binding:{service:a,version:o,discoveryUrl:r,defaultHeaders:gs("Default headers",e.defaultHeadersText)}}}return{...s,binding:{}}},Vwe=e=>({...GB(e)}),Gwe=e=>{if(e.kind!=="mcp")throw new Error("OAuth sign-in is only available for MCP sources.");if(e.transport==="stdio")throw new Error("OAuth sign-in is not available for MCP stdio sources.");const t=e.endpoint.trim();if(!t)throw new Error("Source endpoint is required before starting OAuth.");return{provider:"mcp",name:Hf(e.name),endpoint:t,transport:e.transport===""?"auto":e.transport,queryParams:gs("Query params",e.queryParamsText),headers:gs("Request headers",e.headersText)}};function Kwe(){return m.jsx(KB,{mode:"create"},"create")}function Wwe(e){const t=j1(),n=e8(e.sourceId);return t.status==="ready"&&!t.data.some(s=>s.id===e.sourceId)||Owe(n)?m.jsx(BB,{}):m.jsx(cu,{loadable:n,loading:"Loading source...",children:s=>m.jsx(KB,{mode:"edit",source:s},`${s.id}:${s.updatedAt}`)})}function KB(e){const t=Ul(),n=mye(),r=gye(),s=pye(),a=bye(),o=_ye(),i=VT(),c=GT(),u=ZF(),[l,d]=O.useState(()=>e.source?Uwe(e.source):QP()),[h,f]=O.useState(null),[p,x]=O.useState(null),[g,b]=O.useState(!1),[y,_]=O.useState(null),S=n.status==="pending"||s.status==="pending",w=a.status==="pending",v=o.status==="pending",C=r.status==="pending"||g,I=l.authKind==="oauth2"&&l.oauthAccessHandle.trim().length>0?`${l.oauthAccessProviderId}:${l.oauthAccessHandle}:${l.oauthRefreshProviderId}:${l.oauthRefreshHandle}`:null,R=I!==null&&y===I,N=(T,q)=>{d(X=>({...X,[T]:q}))},z=T=>{d(q=>({...q,...zB(q,T)}))},V=(T,q)=>{d(X=>X.transport==="stdio"?X:{...X,[T]:q})},ne=(T,q)=>{d(X=>X.transport==="stdio"?{...X,[T]:q}:X)},J=T=>{x(T.id),d(q=>({...QP(T),name:q.name.trim().length>0?q.name:T.name,enabled:q.enabled})),f({tone:"info",text:`${T.name} loaded. Add auth if needed, then save.`})},te=async()=>{f(null);try{if(e.mode==="create"){const q=await n.mutateAsync(GB(l));t({to:"/sources/$sourceId",params:{sourceId:q.id},search:{tab:"model"}});return}if(!e.source)throw new Error("Cannot update a source before it has loaded.");const T=await s.mutateAsync({sourceId:e.source.id,payload:Vwe(l)});t({to:"/sources/$sourceId",params:{sourceId:T.id},search:{tab:"model"}})}catch(T){f({tone:"error",text:T instanceof Error?T.message:"Failed saving source."})}},se=async()=>{f(null);try{const T=await r.mutateAsync(Gwe(l));f({tone:"info",text:"Finish OAuth in the popup. Saving will create the source and connect its tools."}),b(!0);const q=await Fwe({authorizationUrl:T.authorizationUrl,sessionId:T.sessionId});b(!1),u(),_(null),d(X=>({...X,authKind:"oauth2",authHeaderName:q.headerName,authPrefix:q.prefix,oauthAccessProviderId:q.accessToken.providerId,oauthAccessHandle:q.accessToken.handle,oauthRefreshProviderId:q.refreshToken?.providerId??"",oauthRefreshHandle:q.refreshToken?.handle??"",managedAuth:null})),f({tone:"success",text:"OAuth credentials are ready. Save the source to connect and index tools."})}catch(T){b(!1),f({tone:"error",text:T instanceof Error?T.message:"Failed starting OAuth."})}},oe=async()=>{if(!(!e.source||w||!window.confirm(`Remove "${e.source.name}" and its indexed tools?`))){f(null);try{if(!(await a.mutateAsync(e.source.id)).removed)throw new Error("Source was not removed.");t({to:"/"})}catch(q){f({tone:"error",text:q instanceof Error?q.message:"Failed removing source."})}}},me=async()=>{if(!(!e.source||v||l.managedAuth?.kind!=="provider_grant_ref"||!window.confirm(`Revoke the shared Google auth for "${e.source.name}"? This disconnects every source using the same shared grant.`))){f(null);try{if(!(await o.mutateAsync(l.managedAuth.grantId)).removed)throw new Error("Shared provider grant was not removed.");f({tone:"success",text:"Shared provider grant revoked. Linked sources now require authentication again."})}catch(q){f({tone:"error",text:q instanceof Error?q.message:"Failed revoking shared provider grant."})}}},Xe=e.mode==="edit"&&e.source?{to:"/sources/$sourceId",params:{sourceId:e.source.id},search:{tab:"model"}}:{to:"/"};return m.jsx("div",{className:"flex-1 overflow-y-auto",children:m.jsxs("div",{className:"mx-auto max-w-3xl px-6 py-8 lg:px-10 lg:py-12",children:[m.jsxs(nr,{...Xe,className:"inline-flex items-center gap-1.5 text-[12px] font-medium text-muted-foreground transition-colors hover:text-foreground mb-6",children:[m.jsx(k8,{className:"size-3.5"}),e.mode==="edit"?"Back to source":"Back"]}),m.jsxs("div",{className:"flex items-center justify-between gap-4 mb-6",children:[m.jsx("h1",{className:"font-display text-2xl tracking-tight text-foreground lg:text-3xl",children:e.mode==="edit"?"Edit source":"New source"}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(Cs,{variant:"outline",children:l.kind}),m.jsx(Cs,{variant:l.enabled?"default":"muted",children:l.enabled?"enabled":"disabled"})]})]}),h&&m.jsx(Jwe,{state:h,className:"mb-6"}),e.mode==="create"&&m.jsx($o,{title:"Templates",className:"mb-6",children:m.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:bw.map(T=>m.jsxs("button",{type:"button",onClick:()=>J(T),className:je("rounded-xl border px-4 py-3 text-left transition-colors",p===T.id?"border-primary/40 bg-primary/8":"border-border bg-card/70 hover:bg-accent/50"),children:[m.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[m.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[m.jsx("div",{className:"flex size-4 shrink-0 items-center justify-center text-muted-foreground",children:m.jsx(Mf,{endpoint:T.endpoint,kind:T.kind,className:"size-4"})}),m.jsx("span",{className:"truncate text-[13px] font-medium text-foreground",children:T.name})]}),m.jsx(Cs,{variant:"outline",className:"text-[9px]",children:T.kind})]}),m.jsx("span",{className:"text-[11px] text-muted-foreground line-clamp-1",children:T.summary})]},T.id))})}),m.jsxs("div",{className:"space-y-6",children:[m.jsx($o,{title:"Basics",children:m.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[m.jsx(Ut,{label:"Name",children:m.jsx(ha,{value:l.name,onChange:T=>N("name",T),placeholder:"GitHub REST"})}),m.jsx(Ut,{label:"Kind",children:m.jsx(Ox,{value:l.kind,onChange:T=>N("kind",T),options:Lwe.map(T=>({value:T,label:T}))})}),!(l.kind==="mcp"&&l.transport==="stdio")&&m.jsx(Ut,{label:"Endpoint",className:"sm:col-span-2",children:m.jsx(ha,{value:l.endpoint,onChange:T=>N("endpoint",T),placeholder:l.kind==="openapi"?"https://api.github.com":l.kind==="graphql"?"https://api.linear.app/graphql":l.kind==="google_discovery"?"https://www.googleapis.com/discovery/v1/apis/sheets/v4/rest":"https://mcp.deepwiki.com/mcp",mono:!0})}),m.jsx(Ut,{label:"Namespace",children:m.jsx(ha,{value:l.namespace,onChange:T=>N("namespace",T),placeholder:"github"})}),m.jsx(Ut,{label:"Status",children:m.jsx(Ywe,{checked:l.enabled,onChange:T=>N("enabled",T)})})]})}),l.kind==="mcp"&&m.jsx($o,{title:"Transport",children:m.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[m.jsx(Ut,{label:"Transport mode",children:m.jsx(Ox,{value:l.transport||"auto",onChange:T=>z(T),options:$we.map(T=>({value:T,label:T}))})}),l.transport==="stdio"?m.jsxs("div",{className:"sm:col-span-2 grid gap-4 sm:grid-cols-2",children:[m.jsx(Ut,{label:"Command",children:m.jsx(ha,{value:l.command,onChange:T=>ne("command",T),placeholder:"npx",mono:!0})}),m.jsx(Ut,{label:"Working directory (optional)",children:m.jsx(ha,{value:l.cwd,onChange:T=>ne("cwd",T),placeholder:"/path/to/project",mono:!0})}),m.jsx(Ut,{label:"Args (JSON)",className:"sm:col-span-2",children:m.jsx(Gi,{value:l.argsText,onChange:T=>ne("argsText",T),placeholder:`[
|
|
187
|
+
"-y",
|
|
188
|
+
"chrome-devtools-mcp@latest"
|
|
189
|
+
]`})}),m.jsx(Ut,{label:"Environment (JSON)",className:"sm:col-span-2",children:m.jsx(Gi,{value:l.envText,onChange:T=>ne("envText",T),placeholder:`{
|
|
190
|
+
"CHROME_PATH": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
|
|
191
|
+
}`})})]}):m.jsxs("div",{className:"sm:col-span-2 grid gap-4 sm:grid-cols-2",children:[m.jsx(Ut,{label:"Query params (JSON)",children:m.jsx(Gi,{value:l.queryParamsText,onChange:T=>V("queryParamsText",T),placeholder:`{
|
|
192
|
+
"workspace": "demo"
|
|
193
|
+
}`})}),m.jsx(Ut,{label:"Headers (JSON)",children:m.jsx(Gi,{value:l.headersText,onChange:T=>V("headersText",T),placeholder:`{
|
|
194
|
+
"x-api-key": "..."
|
|
195
|
+
}`})})]})]})}),l.kind==="openapi"&&m.jsx($o,{title:"OpenAPI",children:m.jsxs("div",{className:"grid gap-4",children:[m.jsx(Ut,{label:"Spec URL",children:m.jsx(ha,{value:l.specUrl,onChange:T=>N("specUrl",T),placeholder:"https://raw.githubusercontent.com/.../openapi.yaml",mono:!0})}),m.jsx(Ut,{label:"Default headers (JSON)",children:m.jsx(Gi,{value:l.defaultHeadersText,onChange:T=>N("defaultHeadersText",T),placeholder:`{
|
|
196
|
+
"x-api-version": "2026-03-01"
|
|
197
|
+
}`})})]})}),l.kind==="graphql"&&m.jsx($o,{title:"GraphQL",children:m.jsx("div",{className:"grid gap-4",children:m.jsx(Ut,{label:"Default headers (JSON)",children:m.jsx(Gi,{value:l.defaultHeadersText,onChange:T=>N("defaultHeadersText",T),placeholder:`{
|
|
198
|
+
"x-api-version": "2026-03-01"
|
|
199
|
+
}`})})})}),l.kind==="google_discovery"&&m.jsx($o,{title:"Google Discovery",children:m.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[m.jsx(Ut,{label:"Service",children:m.jsx(ha,{value:l.service,onChange:T=>N("service",T),placeholder:"sheets"})}),m.jsx(Ut,{label:"Version",children:m.jsx(ha,{value:l.version,onChange:T=>N("version",T),placeholder:"v4"})}),m.jsx(Ut,{label:"Default headers (JSON)",className:"sm:col-span-2",children:m.jsx(Gi,{value:l.defaultHeadersText,onChange:T=>N("defaultHeadersText",T),placeholder:`{
|
|
200
|
+
"x-goog-user-project": "my-project"
|
|
201
|
+
}`})})]})}),m.jsx($o,{title:"Authentication",children:m.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[l.kind==="mcp"&&l.transport!=="stdio"&&m.jsxs("div",{className:"sm:col-span-2 rounded-xl border border-border bg-gradient-to-b from-card/90 to-card/50 overflow-hidden",children:[m.jsxs("div",{className:"flex items-start gap-3 px-4 py-3.5",children:[m.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/8 text-primary mt-0.5",children:m.jsxs("svg",{className:"size-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),m.jsx("path",{d:"M7 11V7a5 5 0 0110 0v4"})]})}),m.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[m.jsxs("div",{className:"space-y-0.5",children:[m.jsx("p",{className:"text-[12px] font-medium text-foreground",children:"MCP OAuth"}),m.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Opens the server's built-in OAuth flow to authenticate this source."})]}),m.jsxs(en,{type:"button",variant:"outline",size:"sm",onClick:se,disabled:S||w||C,children:[C?m.jsx(wr,{className:"size-3"}):null,l.authKind==="oauth2"&&l.oauthAccessHandle.trim().length>0?"Reconnect":"Sign in with OAuth"]})]})]}),l.authKind==="oauth2"&&l.oauthAccessHandle.trim().length>0&&m.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-border/50 px-4 py-2.5",children:[m.jsx("p",{className:"text-[11px] text-muted-foreground/70",children:"Token refs attached to this draft"}),m.jsx("button",{type:"button",className:"text-[11px] font-medium text-muted-foreground/60 transition-colors hover:text-foreground",onClick:()=>_(T=>T===I?null:I),children:R?"Hide refs":"Show refs"})]})]}),l.kind==="mcp"&&l.transport==="stdio"?m.jsx("div",{className:"sm:col-span-2 rounded-xl border border-border bg-muted/40 px-4 py-3 text-[12px] text-muted-foreground",children:"Local MCP stdio sources do not use executor-managed HTTP or OAuth credentials."}):m.jsx(Ut,{label:"Auth mode",children:m.jsx(Ox,{value:l.authKind,onChange:T=>N("authKind",T),disabled:l.managedAuth!==null,options:Mwe.map(T=>({value:T,label:T}))})}),l.managedAuth!==null&&!(l.kind==="mcp"&&l.transport==="stdio")&&m.jsxs("div",{className:"sm:col-span-2 rounded-xl border border-border bg-gradient-to-b from-muted/40 to-transparent overflow-hidden",children:[m.jsxs("div",{className:"flex items-start gap-3 px-4 py-3.5",children:[m.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/8 text-primary mt-0.5",children:l.managedAuth.kind==="provider_grant_ref"?m.jsxs("svg",{className:"size-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71"}),m.jsx("path",{d:"M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71"})]}):m.jsxs("svg",{className:"size-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),m.jsx("path",{d:"M7 11V7a5 5 0 0110 0v4"})]})}),m.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[m.jsx("p",{className:"text-[12px] font-medium text-foreground",children:l.managedAuth.kind==="provider_grant_ref"?"Shared provider grant":"Managed MCP OAuth"}),m.jsx("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:l.managedAuth.kind==="provider_grant_ref"?"This source uses a shared Google auth grant. Reconnect from Add Source to change the linked account or scopes.":"Authenticated through a persisted MCP OAuth session. Reconnect the source to refresh or replace the binding."})]})]}),l.managedAuth.kind==="provider_grant_ref"&&e.mode==="edit"&&m.jsx("div",{className:"flex items-center justify-end border-t border-border/50 px-4 py-2.5",children:m.jsxs(en,{type:"button",variant:"ghost",size:"sm",className:"text-destructive/70 hover:text-destructive hover:bg-destructive/8",onClick:me,disabled:v,children:[m.jsx(Qv,{className:"size-3"}),v?"Revoking…":"Revoke shared auth"]})})]}),l.authKind!=="none"&&l.managedAuth===null&&!(l.kind==="mcp"&&l.transport==="stdio")&&m.jsxs(m.Fragment,{children:[m.jsx(Ut,{label:"Header name",children:m.jsx(ha,{value:l.authHeaderName,onChange:T=>N("authHeaderName",T),placeholder:"Authorization"})}),m.jsx(Ut,{label:"Prefix",children:m.jsx(ha,{value:l.authPrefix,onChange:T=>N("authPrefix",T),placeholder:"Bearer "})})]}),l.authKind==="bearer"&&l.managedAuth===null&&!(l.kind==="mcp"&&l.transport==="stdio")&&m.jsx(Ut,{label:"Token",className:"sm:col-span-2",children:m.jsx($x,{instanceConfig:i,secrets:c,providerId:l.bearerProviderId,handle:l.bearerHandle,onSelect:(T,q)=>{N("bearerProviderId",T),N("bearerHandle",q)}})}),l.authKind==="oauth2"&&l.managedAuth===null&&!(l.kind==="mcp"&&l.transport==="stdio")&&(l.kind!=="mcp"||l.oauthAccessHandle.trim().length===0||R)&&m.jsxs(m.Fragment,{children:[m.jsx(Ut,{label:"Access token",className:"sm:col-span-2",children:m.jsx($x,{instanceConfig:i,secrets:c,providerId:l.oauthAccessProviderId,handle:l.oauthAccessHandle,onSelect:(T,q)=>{N("oauthAccessProviderId",T),N("oauthAccessHandle",q)}})}),m.jsx(Ut,{label:"Refresh token (optional)",className:"sm:col-span-2",children:m.jsx($x,{instanceConfig:i,secrets:c,providerId:l.oauthRefreshProviderId,handle:l.oauthRefreshHandle,onSelect:(T,q)=>{N("oauthRefreshProviderId",T),N("oauthRefreshHandle",q)},allowEmpty:!0})})]})]})}),e.mode==="edit"&&e.source&&m.jsx($o,{title:"Danger zone",children:m.jsxs(en,{variant:"outline",className:"border-destructive/30 text-destructive hover:bg-destructive/10 hover:text-destructive",onClick:oe,disabled:w||v,children:[m.jsx(Qv,{className:"size-3.5"}),w?"Removing…":"Remove source"]})}),m.jsxs("div",{className:"flex items-center justify-end gap-3 border-t border-border pt-5",children:[m.jsx(nr,{...Xe,className:"inline-flex",children:m.jsx(en,{variant:"ghost",type:"button",children:"Cancel"})}),m.jsxs(en,{onClick:te,disabled:S||v,children:[e.mode==="edit"?m.jsx(eC,{className:"size-3.5"}):m.jsx(_o,{className:"size-3.5"}),S?e.mode==="edit"?"Saving…":"Creating…":e.mode==="edit"?"Save":"Create source"]})]})]})]})})}function $o(e){return m.jsxs("section",{className:je("rounded-xl border border-border bg-card/80",e.className),children:[m.jsx("div",{className:"border-b border-border px-5 py-3",children:m.jsx("h2",{className:"text-sm font-semibold text-foreground",children:e.title})}),m.jsx("div",{className:"p-5",children:e.children})]})}function Ut(e){return m.jsxs("label",{className:je("block space-y-1.5",e.className),children:[m.jsx("span",{className:"text-[12px] font-medium text-foreground",children:e.label}),e.children]})}function ha(e){return m.jsx("input",{value:e.value,onChange:t=>e.onChange(t.target.value),placeholder:e.placeholder,className:je("h-9 w-full rounded-lg border border-input bg-background px-3 text-[13px] text-foreground outline-none transition-colors placeholder:text-muted-foreground/35 focus:border-ring focus:ring-1 focus:ring-ring/25",e.mono&&"font-mono text-[12px]")})}function Ox(e){return m.jsx("select",{value:e.value,disabled:e.disabled,onChange:t=>e.onChange(t.target.value),className:"h-9 w-full rounded-lg border border-input bg-background px-3 text-[13px] text-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring/25",children:e.options.map(t=>m.jsx("option",{value:t.value,children:t.label},t.value))})}function Gi(e){return m.jsx("textarea",{value:e.value,onChange:t=>e.onChange(t.target.value),placeholder:e.placeholder,spellCheck:!1,className:"min-h-28 w-full rounded-lg border border-input bg-background px-3 py-2.5 font-mono text-[12px] leading-relaxed text-foreground outline-none transition-colors placeholder:text-muted-foreground/35 focus:border-ring focus:ring-1 focus:ring-ring/25"})}function Ywe(e){return m.jsxs("button",{type:"button",onClick:()=>e.onChange(!e.checked),className:je("flex h-9 w-full items-center justify-between rounded-lg border px-3 text-[13px] transition-colors",e.checked?"border-primary/40 bg-primary/8 text-foreground":"border-input bg-background text-muted-foreground hover:text-foreground"),children:[m.jsx("span",{children:e.checked?"Enabled":"Disabled"}),m.jsx("span",{className:je("size-2 rounded-full",e.checked?"bg-primary":"bg-muted-foreground/30")})]})}function Jwe(e){return m.jsx("div",{className:je("rounded-lg border px-4 py-3 text-[13px]",e.state.tone==="success"&&"border-primary/30 bg-primary/8 text-foreground",e.state.tone==="info"&&"border-border bg-card text-muted-foreground",e.state.tone==="error"&&"border-destructive/30 bg-destructive/8 text-destructive",e.className),children:e.state.text})}const Lx="__create_new__";function $x(e){const{instanceConfig:t,secrets:n,providerId:r,handle:s,onSelect:a,allowEmpty:o}=e,i=WT(),[c,u]=O.useState(!1),[l,d]=O.useState(""),[h,f]=O.useState(""),[p,x]=O.useState(""),[g,b]=O.useState(null),y=t.status==="ready"?t.data.secretProviders.filter(R=>R.canStore):[];O.useEffect(()=>{p.length>0||t.status==="ready"&&x(t.data.defaultSecretStoreProvider)},[t,p]);const _=s||"",S=R=>{if(R===Lx){u(!0),d(""),f(""),x(t.status==="ready"?t.data.defaultSecretStoreProvider:""),b(null);return}if(R===""){a("","");return}const N=n.status==="ready"?n.data.find(z=>z.id===R):null;a(N?.providerId??"local",R)},w=async()=>{b(null);const R=l.trim();if(!R){b("Name is required.");return}if(!h){b("Value is required.");return}try{const N=await i.mutateAsync({name:R,value:h,...p?{providerId:p}:{}});a(N.providerId,N.id),u(!1)}catch(N){b(N instanceof Error?N.message:"Failed creating secret.")}};if(n.status!=="ready")return m.jsx("select",{disabled:!0,className:"h-9 w-full rounded-lg border border-input bg-background px-3 text-[13px] text-muted-foreground outline-none opacity-60",children:m.jsx("option",{children:"Loading…"})});const v=n.data,C=v.find(R=>R.id===s),I=s&&!C&&r!=="local";return m.jsxs("div",{className:"space-y-2",children:[m.jsxs("select",{value:c?Lx:_,onChange:R=>S(R.target.value),className:"h-9 w-full rounded-lg border border-input bg-background px-3 text-[13px] text-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring/25",children:[o&&m.jsx("option",{value:"",children:"None"}),!o&&!_&&m.jsx("option",{value:"",children:"Select a secret…"}),v.map(R=>m.jsxs("option",{value:R.id,children:[R.name||R.id," (",R.providerId,")"]},R.id)),I&&m.jsxs("option",{value:s,children:[r,":",s]}),m.jsx("option",{value:Lx,children:"+ Create new secret"})]}),c&&m.jsxs("div",{className:"rounded-lg border border-primary/20 bg-card/80 p-3 space-y-3",children:[g&&m.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/8 px-3 py-2 text-[12px] text-destructive",children:g}),m.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[m.jsxs("label",{className:"block space-y-1",children:[m.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Name"}),m.jsx("input",{value:l,onChange:R=>d(R.target.value),placeholder:"GitHub PAT",className:"h-8 w-full rounded-lg border border-input bg-background px-3 text-[12px] text-foreground outline-none transition-colors placeholder:text-muted-foreground/35 focus:border-ring focus:ring-1 focus:ring-ring/25",autoFocus:!0})]}),m.jsxs("label",{className:"block space-y-1",children:[m.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Value"}),m.jsx("input",{type:"password",value:h,onChange:R=>f(R.target.value),placeholder:"ghp_...",className:"h-8 w-full rounded-lg border border-input bg-background px-3 font-mono text-[11px] text-foreground outline-none transition-colors placeholder:text-muted-foreground/35 focus:border-ring focus:ring-1 focus:ring-ring/25"})]}),m.jsxs("label",{className:"block space-y-1",children:[m.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Store in"}),m.jsx("select",{value:p,onChange:R=>x(R.target.value),className:"h-8 w-full rounded-lg border border-input bg-background px-3 text-[12px] text-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring/25",children:y.map(R=>m.jsx("option",{value:R.id,children:R.name},R.id))})]})]}),m.jsxs("div",{className:"flex items-center justify-end gap-2",children:[m.jsx("button",{type:"button",onClick:()=>u(!1),className:"rounded-md px-2.5 py-1 text-[11px] font-medium text-muted-foreground transition-colors hover:text-foreground",children:"Cancel"}),m.jsxs(en,{size:"sm",onClick:w,disabled:i.status==="pending",children:[i.status==="pending"&&m.jsx(wr,{className:"size-3"}),"Store & use"]})]})]})]})}function Ki(e){return m.jsxs("section",{className:je("overflow-hidden rounded-lg border border-border bg-card/60",e.compact&&"min-h-48"),children:[m.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?m.jsx(MB,{code:e.body,lang:e.lang,className:"max-h-[32rem]"}):m.jsx("div",{className:"flex items-center justify-center p-6 text-[13px] text-muted-foreground/40",children:e.empty})]})}function Qwe(e){return m.jsx("div",{className:"flex h-full min-h-48 items-center justify-center px-6",children:m.jsxs("div",{className:"flex max-w-md flex-col items-center text-center",children:[m.jsx("div",{className:"mb-4 flex size-12 items-center justify-center rounded-2xl bg-muted text-muted-foreground",children:m.jsx(XT,{className:"size-5"})}),m.jsx("h2",{className:"text-sm font-semibold text-foreground",children:e.title}),m.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[m.jsx("span",{className:"text-sm text-muted-foreground",children:e.source.name}),m.jsx(Cs,{variant:"outline",children:e.source.kind})]}),m.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:e.description}),e.feedback&&m.jsx("p",{className:je("mt-4 text-sm font-medium",e.feedback.tone==="success"?"text-primary":"text-destructive"),children:e.feedback.text}),m.jsx("div",{className:"mt-5 flex items-center gap-2",children:m.jsxs(en,{size:"sm",onClick:e.onRefresh,disabled:e.refreshDisabled,title:e.refreshTitle,children:[e.refreshPending?m.jsx(wr,{className:"size-3"}):null,e.refreshLabel??"Refresh source"]})})]})})}const W1=(function(e){if(e==null)return tSe;if(typeof e=="function")return Y1(e);if(typeof e=="object")return Array.isArray(e)?Xwe(e):Zwe(e);if(typeof e=="string")return eSe(e);throw new Error("Expected function, string, or object as test")});function Xwe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=W1(e[n]);return Y1(r);function r(...s){let a=-1;for(;++a<t.length;)if(t[a].apply(this,s))return!0;return!1}}function Zwe(e){const t=e;return Y1(n);function n(r){const s=r;let a;for(a in e)if(s[a]!==t[a])return!1;return!0}}function eSe(e){return Y1(t);function t(n){return n&&n.type===e}}function Y1(e){return t;function t(n,r,s){return!!(nSe(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function tSe(){return!0}function nSe(e){return e!==null&&typeof e=="object"&&"type"in e}const WB=[],yh=!0,yw=!1,Wu="skip";function bC(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const a=W1(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 f=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(c.type+(f?"<"+f+">":""))+")"})}return h;function h(){let f=WB,p,x,g;if((!t||a(c,u,l[l.length-1]||void 0))&&(f=rSe(n(c,l)),f[0]===yw))return f;if("children"in c&&c.children){const b=c;if(b.children&&f[0]!==Wu)for(x=(r?b.children.length:-1)+o,g=l.concat(b);x>-1&&x<b.children.length;){const y=b.children[x];if(p=i(y,x,g)(),p[0]===yw)return p;x=typeof p[1]=="number"?p[1]:x+o}}return f}}}function rSe(e){return Array.isArray(e)?e:typeof e=="number"?[yh,e]:e==null?WB:[e]}function Pa(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),bC(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 Fl={indicator:"indicator",textOnly:"text-only",remove:"remove"};function sSe({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=Fl.indicator,imageBlockPolicy:c=Fl.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=lSe(e,t,n,r,s,a,o,i,c);YB(d),Pa(d,h)}}function XP(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 aSe(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}const oSe=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),iSe=new Set(["javascript:","data:","file:","vbscript:"]);function ZP(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=XP(e,n);if(!o||iSe.has(o.protocol)||!(oSe.has(o.protocol)||a.includes(o.protocol)||a.includes("*")))return null;if(o.protocol==="mailto:"||!o.protocol.match(/^https?:$/))return o.href;const c=aSe(e);return o&&t.some(u=>{const l=XP(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 YB(e){if("children"in e&&Array.isArray(e.children)){e.children=e.children.filter(t=>t!=null);for(const t of e.children)YB(t)}}const Mx=Symbol("node-seen");function cSe(e,t,n){return t===Fl.remove?{type:"remove"}:t===Fl.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 uSe(e,t,n){if(t===Fl.remove)return{type:"remove"};if(t===Fl.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 lSe=(e,t,n,r,s,a,o,i,c)=>{const u=(l,d,h)=>{if(l.type!=="element"||l[Mx])return yh;if(l.tagName==="a"){const f=ZP(l.properties.href,t,e,!1,!1,s);if(f===null){if(l[Mx]=!0,Pa(l,u),h&&typeof d=="number"){const p=cSe(l,i,o);if(p.type==="remove")return h.children.splice(d,1),[Wu,d];h.children[d]=p.element}return Wu}else return l.properties.href=f,l.properties.target="_blank",l.properties.rel="noopener noreferrer",yh}if(l.tagName==="img"){const f=ZP(l.properties.src,n,e,r,!0,s);if(f===null){if(l[Mx]=!0,Pa(l,u),h&&typeof d=="number"){const p=uSe(l,c,a);if(p.type==="remove")return h.children.splice(d,1),[Wu,d];h.children[d]=p.element}return Wu}else return l.properties.src=f,yh}return yh};return u},JB=-1,J1=0,Gh=1,D0=2,yC=3,kC=4,xC=5,_C=6,QB=7,XB=8,eO=typeof self=="object"?self:globalThis,dSe=(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 J1:case JB:return n(o,s);case Gh:{const i=n([],s);for(const c of o)i.push(r(c));return i}case D0:{const i=n({},s);for(const[c,u]of o)i[r(c)]=r(u);return i}case yC:return n(new Date(o),s);case kC:{const{source:i,flags:c}=o;return n(new RegExp(i,c),s)}case xC:{const i=n(new Map,s);for(const[c,u]of o)i.set(r(c),r(u));return i}case _C:{const i=n(new Set,s);for(const c of o)i.add(r(c));return i}case QB:{const{name:i,message:c}=o;return n(new eO[i](c),s)}case XB: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 eO[a](o),s)};return r},tO=e=>dSe(new Map,e)(0),Nu="",{toString:hSe}={},{keys:fSe}=Object,Yd=e=>{const t=typeof e;if(t!=="object"||!e)return[J1,t];const n=hSe.call(e).slice(8,-1);switch(n){case"Array":return[Gh,Nu];case"Object":return[D0,Nu];case"Date":return[yC,Nu];case"RegExp":return[kC,Nu];case"Map":return[xC,Nu];case"Set":return[_C,Nu];case"DataView":return[Gh,n]}return n.includes("Array")?[Gh,n]:n.includes("Error")?[QB,n]:[D0,n]},yg=([e,t])=>e===J1&&(t==="function"||t==="symbol"),mSe=(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]=Yd(o);switch(i){case J1:{let l=o;switch(c){case"bigint":i=XB,l=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);l=null;break;case"undefined":return s([JB],o)}return s([i,l],o)}case Gh:{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 D0:{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 fSe(o))(e||!yg(Yd(o[h])))&&l.push([a(h),a(o[h])]);return d}case yC:return s([i,o.toISOString()],o);case kC:{const{source:l,flags:d}=o;return s([i,{source:l,flags:d}],o)}case xC:{const l=[],d=s([i,l],o);for(const[h,f]of o)(e||!(yg(Yd(h))||yg(Yd(f))))&&l.push([a(h),a(f)]);return d}case _C:{const l=[],d=s([i,l],o);for(const h of o)(e||!yg(Yd(h)))&&l.push(a(h));return d}}const{message:u}=o;return s([i,{name:c,message:u}],o)};return a},nO=(e,{json:t,lossy:n}={})=>{const r=[];return mSe(!(t||n),!!t,new Map,r)(e),r},Gc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?tO(nO(e,t)):structuredClone(e):(e,t)=>tO(nO(e,t));const rO=/[#.]/g;function pSe(e,t){const n=e||"",r={};let s=0,a,o;for(;s<n.length;){rO.lastIndex=s;const i=rO.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 ZB(e,t,n){const r=n?kSe(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=pSe(a,t);const u=c.tagName.toLowerCase(),l=r?r.get(u):void 0;if(c.tagName=l||u,gSe(o))i.unshift(o);else for(const[d,h]of Object.entries(o))bSe(e,c.properties,d,h)}for(const u of i)kw(c.children,u);return c.type==="element"&&c.tagName==="template"&&(c.content={type:"root",children:c.children},c.children=[]),c}return s}function gSe(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 bSe(e,t,n,r){const s=Bm(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=kP(r):s.commaSeparated?a=yP(r):s.commaOrSpaceSeparated?a=kP(yP(r).join(" ")):a=sO(s,s.property,r):Array.isArray(r)?a=[...r]:a=s.property==="style"?ySe(r):String(r);if(Array.isArray(a)){const o=[];for(const i of a)o.push(sO(s,s.property,i));a=o}s.property==="className"&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[s.property]=a}}function kw(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)kw(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?kw(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function sO(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||zf(n)===zf(t)))return!0}return n}function ySe(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function kSe(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const xSe=["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"],_Se=ZB(yd,"div"),vSe=ZB(Ba,"g",xSe);function wSe(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=aO(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=aO(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 aO(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
202
|
+
`,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/"},e9={}.hasOwnProperty,SSe=Object.prototype;function ESe(e,t){const n=t||{};return vC({file:n.file||void 0,location:!1,schema:n.space==="svg"?Ba:yd,verbose:n.verbose||!1},e)}function vC(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},sb(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:t9(e,t.childNodes),data:{quirksMode:s}},e.file&&e.location){const a=String(e.file),o=wSe(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"},sb(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},sb(e,r,n),n}default:return n=TSe(e,t),n}}function t9(e,t){let n=-1;const r=[];for(;++n<t.length;){const s=vC(e,t[n]);r.push(s)}return r}function TSe(e,t){const n=e.schema;e.schema=t.namespaceURI===fc.svg?Ba:yd;let r=-1;const s={};for(;++r<t.attrs.length;){const i=t.attrs[r],c=(i.prefix?i.prefix+":":"")+i.name;e9.call(SSe,c)||(s[c]=i.value)}const o=(e.schema.space==="svg"?vSe:_Se)(t.tagName,s,t9(e,t.childNodes));if(sb(e,t,o),o.tagName==="template"){const i=t,c=i.sourceCodeLocation,u=c&&c.startTag&&Yu(c.startTag),l=c&&c.endTag&&Yu(c.endTag),d=vC(e,i.content);u&&l&&e.file&&(d.position={start:u.end,end:l.start}),o.content=d}return e.schema=n,o}function sb(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=CSe(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function CSe(e,t,n){const r=Yu(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)e9.call(n.attrs,o)&&(a[Bm(e.schema,o).property]=Yu(n.attrs[o]));n.startTag;const i=Yu(n.startTag),c=n.endTag?Yu(n.endTag):void 0,u={opening:i};c&&(u.closing=c),u.properties=a,t.data={position:u}}}return r}function Yu(e){const t=oO({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=oO({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function oO(e){return e.line&&e.column?e:void 0}const ISe={},ASe={}.hasOwnProperty,n9=aC("type",{handlers:{root:RSe,element:MSe,text:LSe,comment:$Se,doctype:OSe}});function NSe(e,t){const r=(t||ISe).space;return n9(e,r==="svg"?Ba:yd)}function RSe(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=wC(e.children,n,t),_d(e,n),n}function PSe(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=wC(e.children,n,t),_d(e,n),n}function OSe(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return _d(e,t),t}function LSe(e){const t={nodeName:"#text",value:e.value,parentNode:null};return _d(e,t),t}function $Se(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return _d(e,t),t}function MSe(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=Ba);const s=[];let a;if(e.properties){for(a in e.properties)if(a!=="children"&&ASe.call(e.properties,a)){const c=jSe(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=wC(e.children,i,r),_d(e,i),e.tagName==="template"&&e.content&&(i.content=PSe(e.content,r)),i}function jSe(e,t,n){const r=Bm(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?oC(n):iC(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 wC(e,t,n){let r=-1;const s=[];if(e)for(;++r<e.length;){const a=n9(e[r],n);a.parentNode=t,s.push(a)}return s}function _d(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 DSe=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]),Ht="�";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 Rr={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function r9(e){return e>=55296&&e<=57343}function FSe(e){return e>=56320&&e<=57343}function BSe(e,t){return(e-55296)*1024+9216+t}function s9(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function a9(e){return e>=64976&&e<=65007||DSe.has(e)}var re;(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"})(re||(re={}));const zSe=65536;class USe{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=zSe,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(FSe(n))return this.pos++,this._addGap(),BSe(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,$.EOF;return this._err(re.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,r9(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){s9(t)?this._err(re.controlCharacterInInputStream):a9(t)&&this._err(re.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var at;(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"})(at||(at={}));function o9(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 HSe=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))),qSe=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 VSe(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=qSe.get(e))!==null&&t!==void 0?t:e}var zn;(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"})(zn||(zn={}));const GSe=32;var Xo;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Xo||(Xo={}));function xw(e){return e>=zn.ZERO&&e<=zn.NINE}function KSe(e){return e>=zn.UPPER_A&&e<=zn.UPPER_F||e>=zn.LOWER_A&&e<=zn.LOWER_F}function WSe(e){return e>=zn.UPPER_A&&e<=zn.UPPER_Z||e>=zn.LOWER_A&&e<=zn.LOWER_Z||xw(e)}function YSe(e){return e===zn.EQUALS||WSe(e)}var $n;(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"})($n||($n={}));var ao;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ao||(ao={}));class JSe{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=$n.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ao.Strict}startEntity(t){this.decodeMode=t,this.state=$n.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case $n.EntityStart:return t.charCodeAt(n)===zn.NUM?(this.state=$n.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=$n.NamedEntity,this.stateNamedEntity(t,n));case $n.NumericStart:return this.stateNumericStart(t,n);case $n.NumericDecimal:return this.stateNumericDecimal(t,n);case $n.NumericHex:return this.stateNumericHex(t,n);case $n.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|GSe)===zn.LOWER_X?(this.state=$n.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=$n.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(xw(s)||KSe(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(xw(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===zn.SEMI)this.consumed+=1;else if(this.decodeMode===ao.Strict)return 0;return this.emitCodePoint(VSe(this.result),this.consumed),this.errors&&(t!==zn.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&Xo.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const o=t.charCodeAt(n);if(this.treeIndex=QSe(r,s,this.treeIndex+Math.max(1,a),o),this.treeIndex<0)return this.result===0||this.decodeMode===ao.Attribute&&(a===0||YSe(o))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],a=(s&Xo.VALUE_LENGTH)>>14,a!==0){if(o===zn.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==ao.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]&Xo.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]&~Xo.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case $n.NamedEntity:return this.result!==0&&(this.decodeMode!==ao.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case $n.NumericDecimal:return this.emitNumericEntity(0,2);case $n.NumericHex:return this.emitNumericEntity(0,3);case $n.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case $n.EntityStart:return 0}}}function QSe(e,t,n,r){const s=(t&Xo.BRANCH_LENGTH)>>7,a=t&Xo.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 le;(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/"})(le||(le={}));var Sc;(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"})(Sc||(Sc={}));var bs;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(bs||(bs={}));var Q;(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"})(Q||(Q={}));var k;(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"})(k||(k={}));const XSe=new Map([[Q.A,k.A],[Q.ADDRESS,k.ADDRESS],[Q.ANNOTATION_XML,k.ANNOTATION_XML],[Q.APPLET,k.APPLET],[Q.AREA,k.AREA],[Q.ARTICLE,k.ARTICLE],[Q.ASIDE,k.ASIDE],[Q.B,k.B],[Q.BASE,k.BASE],[Q.BASEFONT,k.BASEFONT],[Q.BGSOUND,k.BGSOUND],[Q.BIG,k.BIG],[Q.BLOCKQUOTE,k.BLOCKQUOTE],[Q.BODY,k.BODY],[Q.BR,k.BR],[Q.BUTTON,k.BUTTON],[Q.CAPTION,k.CAPTION],[Q.CENTER,k.CENTER],[Q.CODE,k.CODE],[Q.COL,k.COL],[Q.COLGROUP,k.COLGROUP],[Q.DD,k.DD],[Q.DESC,k.DESC],[Q.DETAILS,k.DETAILS],[Q.DIALOG,k.DIALOG],[Q.DIR,k.DIR],[Q.DIV,k.DIV],[Q.DL,k.DL],[Q.DT,k.DT],[Q.EM,k.EM],[Q.EMBED,k.EMBED],[Q.FIELDSET,k.FIELDSET],[Q.FIGCAPTION,k.FIGCAPTION],[Q.FIGURE,k.FIGURE],[Q.FONT,k.FONT],[Q.FOOTER,k.FOOTER],[Q.FOREIGN_OBJECT,k.FOREIGN_OBJECT],[Q.FORM,k.FORM],[Q.FRAME,k.FRAME],[Q.FRAMESET,k.FRAMESET],[Q.H1,k.H1],[Q.H2,k.H2],[Q.H3,k.H3],[Q.H4,k.H4],[Q.H5,k.H5],[Q.H6,k.H6],[Q.HEAD,k.HEAD],[Q.HEADER,k.HEADER],[Q.HGROUP,k.HGROUP],[Q.HR,k.HR],[Q.HTML,k.HTML],[Q.I,k.I],[Q.IMG,k.IMG],[Q.IMAGE,k.IMAGE],[Q.INPUT,k.INPUT],[Q.IFRAME,k.IFRAME],[Q.KEYGEN,k.KEYGEN],[Q.LABEL,k.LABEL],[Q.LI,k.LI],[Q.LINK,k.LINK],[Q.LISTING,k.LISTING],[Q.MAIN,k.MAIN],[Q.MALIGNMARK,k.MALIGNMARK],[Q.MARQUEE,k.MARQUEE],[Q.MATH,k.MATH],[Q.MENU,k.MENU],[Q.META,k.META],[Q.MGLYPH,k.MGLYPH],[Q.MI,k.MI],[Q.MO,k.MO],[Q.MN,k.MN],[Q.MS,k.MS],[Q.MTEXT,k.MTEXT],[Q.NAV,k.NAV],[Q.NOBR,k.NOBR],[Q.NOFRAMES,k.NOFRAMES],[Q.NOEMBED,k.NOEMBED],[Q.NOSCRIPT,k.NOSCRIPT],[Q.OBJECT,k.OBJECT],[Q.OL,k.OL],[Q.OPTGROUP,k.OPTGROUP],[Q.OPTION,k.OPTION],[Q.P,k.P],[Q.PARAM,k.PARAM],[Q.PLAINTEXT,k.PLAINTEXT],[Q.PRE,k.PRE],[Q.RB,k.RB],[Q.RP,k.RP],[Q.RT,k.RT],[Q.RTC,k.RTC],[Q.RUBY,k.RUBY],[Q.S,k.S],[Q.SCRIPT,k.SCRIPT],[Q.SEARCH,k.SEARCH],[Q.SECTION,k.SECTION],[Q.SELECT,k.SELECT],[Q.SOURCE,k.SOURCE],[Q.SMALL,k.SMALL],[Q.SPAN,k.SPAN],[Q.STRIKE,k.STRIKE],[Q.STRONG,k.STRONG],[Q.STYLE,k.STYLE],[Q.SUB,k.SUB],[Q.SUMMARY,k.SUMMARY],[Q.SUP,k.SUP],[Q.TABLE,k.TABLE],[Q.TBODY,k.TBODY],[Q.TEMPLATE,k.TEMPLATE],[Q.TEXTAREA,k.TEXTAREA],[Q.TFOOT,k.TFOOT],[Q.TD,k.TD],[Q.TH,k.TH],[Q.THEAD,k.THEAD],[Q.TITLE,k.TITLE],[Q.TR,k.TR],[Q.TRACK,k.TRACK],[Q.TT,k.TT],[Q.U,k.U],[Q.UL,k.UL],[Q.SVG,k.SVG],[Q.VAR,k.VAR],[Q.WBR,k.WBR],[Q.XMP,k.XMP]]);function vd(e){var t;return(t=XSe.get(e))!==null&&t!==void 0?t:k.UNKNOWN}const he=k,ZSe={[le.HTML]:new Set([he.ADDRESS,he.APPLET,he.AREA,he.ARTICLE,he.ASIDE,he.BASE,he.BASEFONT,he.BGSOUND,he.BLOCKQUOTE,he.BODY,he.BR,he.BUTTON,he.CAPTION,he.CENTER,he.COL,he.COLGROUP,he.DD,he.DETAILS,he.DIR,he.DIV,he.DL,he.DT,he.EMBED,he.FIELDSET,he.FIGCAPTION,he.FIGURE,he.FOOTER,he.FORM,he.FRAME,he.FRAMESET,he.H1,he.H2,he.H3,he.H4,he.H5,he.H6,he.HEAD,he.HEADER,he.HGROUP,he.HR,he.HTML,he.IFRAME,he.IMG,he.INPUT,he.LI,he.LINK,he.LISTING,he.MAIN,he.MARQUEE,he.MENU,he.META,he.NAV,he.NOEMBED,he.NOFRAMES,he.NOSCRIPT,he.OBJECT,he.OL,he.P,he.PARAM,he.PLAINTEXT,he.PRE,he.SCRIPT,he.SECTION,he.SELECT,he.SOURCE,he.STYLE,he.SUMMARY,he.TABLE,he.TBODY,he.TD,he.TEMPLATE,he.TEXTAREA,he.TFOOT,he.TH,he.THEAD,he.TITLE,he.TR,he.TRACK,he.UL,he.WBR,he.XMP]),[le.MATHML]:new Set([he.MI,he.MO,he.MN,he.MS,he.MTEXT,he.ANNOTATION_XML]),[le.SVG]:new Set([he.TITLE,he.FOREIGN_OBJECT,he.DESC]),[le.XLINK]:new Set,[le.XML]:new Set,[le.XMLNS]:new Set},_w=new Set([he.H1,he.H2,he.H3,he.H4,he.H5,he.H6]);Q.STYLE,Q.SCRIPT,Q.XMP,Q.IFRAME,Q.NOEMBED,Q.NOFRAMES,Q.PLAINTEXT;var j;(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"})(j||(j={}));const cn={DATA:j.DATA,RCDATA:j.RCDATA,RAWTEXT:j.RAWTEXT,SCRIPT_DATA:j.SCRIPT_DATA,PLAINTEXT:j.PLAINTEXT,CDATA_SECTION:j.CDATA_SECTION};function eEe(e){return e>=$.DIGIT_0&&e<=$.DIGIT_9}function kh(e){return e>=$.LATIN_CAPITAL_A&&e<=$.LATIN_CAPITAL_Z}function tEe(e){return e>=$.LATIN_SMALL_A&&e<=$.LATIN_SMALL_Z}function zo(e){return tEe(e)||kh(e)}function iO(e){return zo(e)||eEe(e)}function kg(e){return e+32}function i9(e){return e===$.SPACE||e===$.LINE_FEED||e===$.TABULATION||e===$.FORM_FEED}function cO(e){return i9(e)||e===$.SOLIDUS||e===$.GREATER_THAN_SIGN}function nEe(e){return e===$.NULL?re.nullCharacterReference:e>1114111?re.characterReferenceOutsideUnicodeRange:r9(e)?re.surrogateCharacterReference:a9(e)?re.noncharacterCharacterReference:s9(e)||e===$.CARRIAGE_RETURN?re.controlCharacterReference:null}class rEe{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=j.DATA,this.returnState=j.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new USe(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new JSe(HSe,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(re.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(re.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=nEe(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:at.START_TAG,tagName:"",tagID:k.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:at.END_TAG,tagName:"",tagID:k.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:at.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:at.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(o9(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(re.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=vd(t.tagName),t.type===at.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(re.endTagWithAttributes),t.selfClosing&&this._err(re.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 at.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case at.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case at.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:at.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=i9(t)?at.WHITESPACE_CHARACTER:t===$.NULL?at.NULL_CHARACTER:at.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(at.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=j.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ao.Attribute:ao.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===j.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===j.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===j.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case j.DATA:{this._stateData(t);break}case j.RCDATA:{this._stateRcdata(t);break}case j.RAWTEXT:{this._stateRawtext(t);break}case j.SCRIPT_DATA:{this._stateScriptData(t);break}case j.PLAINTEXT:{this._statePlaintext(t);break}case j.TAG_OPEN:{this._stateTagOpen(t);break}case j.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case j.TAG_NAME:{this._stateTagName(t);break}case j.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case j.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case j.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case j.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case j.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case j.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case j.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case j.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case j.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case j.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case j.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case j.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case j.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case j.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case j.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case j.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case j.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case j.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case j.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case j.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case j.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case j.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case j.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case j.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case j.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case j.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case j.BOGUS_COMMENT:{this._stateBogusComment(t);break}case j.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case j.COMMENT_START:{this._stateCommentStart(t);break}case j.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case j.COMMENT:{this._stateComment(t);break}case j.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case j.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case j.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case j.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case j.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case j.COMMENT_END:{this._stateCommentEnd(t);break}case j.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case j.DOCTYPE:{this._stateDoctype(t);break}case j.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case j.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case j.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case j.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case j.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case j.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case j.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case j.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case j.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case j.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case j.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case j.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case j.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case j.CDATA_SECTION:{this._stateCdataSection(t);break}case j.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case j.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case j.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case j.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case $.LESS_THAN_SIGN:{this.state=j.TAG_OPEN;break}case $.AMPERSAND:{this._startCharacterReference();break}case $.NULL:{this._err(re.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=j.RCDATA_LESS_THAN_SIGN;break}case $.NULL:{this._err(re.unexpectedNullCharacter),this._emitChars(Ht);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case $.LESS_THAN_SIGN:{this.state=j.RAWTEXT_LESS_THAN_SIGN;break}case $.NULL:{this._err(re.unexpectedNullCharacter),this._emitChars(Ht);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case $.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_LESS_THAN_SIGN;break}case $.NULL:{this._err(re.unexpectedNullCharacter),this._emitChars(Ht);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case $.NULL:{this._err(re.unexpectedNullCharacter),this._emitChars(Ht);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(zo(t))this._createStartTagToken(),this.state=j.TAG_NAME,this._stateTagName(t);else switch(t){case $.EXCLAMATION_MARK:{this.state=j.MARKUP_DECLARATION_OPEN;break}case $.SOLIDUS:{this.state=j.END_TAG_OPEN;break}case $.QUESTION_MARK:{this._err(re.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=j.BOGUS_COMMENT,this._stateBogusComment(t);break}case $.EOF:{this._err(re.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(re.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=j.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(zo(t))this._createEndTagToken(),this.state=j.TAG_NAME,this._stateTagName(t);else switch(t){case $.GREATER_THAN_SIGN:{this._err(re.missingEndTagName),this.state=j.DATA;break}case $.EOF:{this._err(re.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(re.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=j.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=j.BEFORE_ATTRIBUTE_NAME;break}case $.SOLIDUS:{this.state=j.SELF_CLOSING_START_TAG;break}case $.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentTagToken();break}case $.NULL:{this._err(re.unexpectedNullCharacter),n.tagName+=Ht;break}case $.EOF:{this._err(re.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(kh(t)?kg(t):t)}}_stateRcdataLessThanSign(t){t===$.SOLIDUS?this.state=j.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=j.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){zo(t)?(this.state=j.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=j.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=j.BEFORE_ATTRIBUTE_NAME,!1;case $.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=j.SELF_CLOSING_START_TAG,!1;case $.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=j.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=j.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===$.SOLIDUS?this.state=j.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=j.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){zo(t)?(this.state=j.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=j.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=j.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case $.SOLIDUS:{this.state=j.SCRIPT_DATA_END_TAG_OPEN;break}case $.EXCLAMATION_MARK:{this.state=j.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=j.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){zo(t)?(this.state=j.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=j.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=j.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===$.HYPHEN_MINUS?(this.state=j.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=j.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===$.HYPHEN_MINUS?(this.state=j.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=j.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case $.HYPHEN_MINUS:{this.state=j.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case $.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case $.NULL:{this._err(re.unexpectedNullCharacter),this._emitChars(Ht);break}case $.EOF:{this._err(re.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case $.HYPHEN_MINUS:{this.state=j.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case $.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case $.NULL:{this._err(re.unexpectedNullCharacter),this.state=j.SCRIPT_DATA_ESCAPED,this._emitChars(Ht);break}case $.EOF:{this._err(re.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=j.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case $.HYPHEN_MINUS:{this._emitChars("-");break}case $.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case $.GREATER_THAN_SIGN:{this.state=j.SCRIPT_DATA,this._emitChars(">");break}case $.NULL:{this._err(re.unexpectedNullCharacter),this.state=j.SCRIPT_DATA_ESCAPED,this._emitChars(Ht);break}case $.EOF:{this._err(re.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=j.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===$.SOLIDUS?this.state=j.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:zo(t)?(this._emitChars("<"),this.state=j.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=j.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){zo(t)?(this.state=j.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=j.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=j.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Rr.SCRIPT,!1)&&cO(this.preprocessor.peek(Rr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Rr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=j.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case $.HYPHEN_MINUS:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case $.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case $.NULL:{this._err(re.unexpectedNullCharacter),this._emitChars(Ht);break}case $.EOF:{this._err(re.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case $.HYPHEN_MINUS:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case $.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case $.NULL:{this._err(re.unexpectedNullCharacter),this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ht);break}case $.EOF:{this._err(re.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case $.HYPHEN_MINUS:{this._emitChars("-");break}case $.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case $.GREATER_THAN_SIGN:{this.state=j.SCRIPT_DATA,this._emitChars(">");break}case $.NULL:{this._err(re.unexpectedNullCharacter),this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ht);break}case $.EOF:{this._err(re.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===$.SOLIDUS?(this.state=j.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Rr.SCRIPT,!1)&&cO(this.preprocessor.peek(Rr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Rr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=j.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=j.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=j.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case $.EQUALS_SIGN:{this._err(re.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=j.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=j.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=j.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case $.EQUALS_SIGN:{this._leaveAttrName(),this.state=j.BEFORE_ATTRIBUTE_VALUE;break}case $.QUOTATION_MARK:case $.APOSTROPHE:case $.LESS_THAN_SIGN:{this._err(re.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case $.NULL:{this._err(re.unexpectedNullCharacter),this.currentAttr.name+=Ht;break}default:this.currentAttr.name+=String.fromCodePoint(kh(t)?kg(t):t)}}_stateAfterAttributeName(t){switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.SOLIDUS:{this.state=j.SELF_CLOSING_START_TAG;break}case $.EQUALS_SIGN:{this.state=j.BEFORE_ATTRIBUTE_VALUE;break}case $.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentTagToken();break}case $.EOF:{this._err(re.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=j.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=j.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case $.APOSTROPHE:{this.state=j.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case $.GREATER_THAN_SIGN:{this._err(re.missingAttributeValue),this.state=j.DATA,this.emitCurrentTagToken();break}default:this.state=j.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case $.QUOTATION_MARK:{this.state=j.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case $.AMPERSAND:{this._startCharacterReference();break}case $.NULL:{this._err(re.unexpectedNullCharacter),this.currentAttr.value+=Ht;break}case $.EOF:{this._err(re.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case $.APOSTROPHE:{this.state=j.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case $.AMPERSAND:{this._startCharacterReference();break}case $.NULL:{this._err(re.unexpectedNullCharacter),this.currentAttr.value+=Ht;break}case $.EOF:{this._err(re.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=j.BEFORE_ATTRIBUTE_NAME;break}case $.AMPERSAND:{this._startCharacterReference();break}case $.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=j.DATA,this.emitCurrentTagToken();break}case $.NULL:{this._err(re.unexpectedNullCharacter),this.currentAttr.value+=Ht;break}case $.QUOTATION_MARK:case $.APOSTROPHE:case $.LESS_THAN_SIGN:case $.EQUALS_SIGN:case $.GRAVE_ACCENT:{this._err(re.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case $.EOF:{this._err(re.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=j.BEFORE_ATTRIBUTE_NAME;break}case $.SOLIDUS:{this._leaveAttrValue(),this.state=j.SELF_CLOSING_START_TAG;break}case $.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=j.DATA,this.emitCurrentTagToken();break}case $.EOF:{this._err(re.eofInTag),this._emitEOFToken();break}default:this._err(re.missingWhitespaceBetweenAttributes),this.state=j.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case $.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=j.DATA,this.emitCurrentTagToken();break}case $.EOF:{this._err(re.eofInTag),this._emitEOFToken();break}default:this._err(re.unexpectedSolidusInTag),this.state=j.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case $.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentComment(n);break}case $.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case $.NULL:{this._err(re.unexpectedNullCharacter),n.data+=Ht;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Rr.DASH_DASH,!0)?(this._createCommentToken(Rr.DASH_DASH.length+1),this.state=j.COMMENT_START):this._consumeSequenceIfMatch(Rr.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Rr.DOCTYPE.length+1),this.state=j.DOCTYPE):this._consumeSequenceIfMatch(Rr.CDATA_START,!0)?this.inForeignNode?this.state=j.CDATA_SECTION:(this._err(re.cdataInHtmlContent),this._createCommentToken(Rr.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=j.BOGUS_COMMENT):this._ensureHibernation()||(this._err(re.incorrectlyOpenedComment),this._createCommentToken(2),this.state=j.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case $.HYPHEN_MINUS:{this.state=j.COMMENT_START_DASH;break}case $.GREATER_THAN_SIGN:{this._err(re.abruptClosingOfEmptyComment),this.state=j.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=j.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case $.HYPHEN_MINUS:{this.state=j.COMMENT_END;break}case $.GREATER_THAN_SIGN:{this._err(re.abruptClosingOfEmptyComment),this.state=j.DATA,this.emitCurrentComment(n);break}case $.EOF:{this._err(re.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=j.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case $.HYPHEN_MINUS:{this.state=j.COMMENT_END_DASH;break}case $.LESS_THAN_SIGN:{n.data+="<",this.state=j.COMMENT_LESS_THAN_SIGN;break}case $.NULL:{this._err(re.unexpectedNullCharacter),n.data+=Ht;break}case $.EOF:{this._err(re.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=j.COMMENT_LESS_THAN_SIGN_BANG;break}case $.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=j.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===$.HYPHEN_MINUS?this.state=j.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=j.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===$.HYPHEN_MINUS?this.state=j.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=j.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==$.GREATER_THAN_SIGN&&t!==$.EOF&&this._err(re.nestedComment),this.state=j.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case $.HYPHEN_MINUS:{this.state=j.COMMENT_END;break}case $.EOF:{this._err(re.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=j.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case $.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentComment(n);break}case $.EXCLAMATION_MARK:{this.state=j.COMMENT_END_BANG;break}case $.HYPHEN_MINUS:{n.data+="-";break}case $.EOF:{this._err(re.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=j.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case $.HYPHEN_MINUS:{n.data+="--!",this.state=j.COMMENT_END_DASH;break}case $.GREATER_THAN_SIGN:{this._err(re.incorrectlyClosedComment),this.state=j.DATA,this.emitCurrentComment(n);break}case $.EOF:{this._err(re.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=j.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this.state=j.BEFORE_DOCTYPE_NAME;break}case $.GREATER_THAN_SIGN:{this.state=j.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case $.EOF:{this._err(re.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(re.missingWhitespaceBeforeDoctypeName),this.state=j.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(kh(t))this._createDoctypeToken(String.fromCharCode(kg(t))),this.state=j.DOCTYPE_NAME;else switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.NULL:{this._err(re.unexpectedNullCharacter),this._createDoctypeToken(Ht),this.state=j.DOCTYPE_NAME;break}case $.GREATER_THAN_SIGN:{this._err(re.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=j.DATA;break}case $.EOF:{this._err(re.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=j.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this.state=j.AFTER_DOCTYPE_NAME;break}case $.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentDoctype(n);break}case $.NULL:{this._err(re.unexpectedNullCharacter),n.name+=Ht;break}case $.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(kh(t)?kg(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=j.DATA,this.emitCurrentDoctype(n);break}case $.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Rr.PUBLIC,!1)?this.state=j.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Rr.SYSTEM,!1)?this.state=j.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(re.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=j.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=j.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case $.QUOTATION_MARK:{this._err(re.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=j.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case $.APOSTROPHE:{this._err(re.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=j.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case $.GREATER_THAN_SIGN:{this._err(re.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=j.DATA,this.emitCurrentDoctype(n);break}case $.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(re.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=j.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=j.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case $.APOSTROPHE:{n.publicId="",this.state=j.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case $.GREATER_THAN_SIGN:{this._err(re.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=j.DATA,this.emitCurrentDoctype(n);break}case $.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(re.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case $.QUOTATION_MARK:{this.state=j.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case $.NULL:{this._err(re.unexpectedNullCharacter),n.publicId+=Ht;break}case $.GREATER_THAN_SIGN:{this._err(re.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=j.DATA;break}case $.EOF:{this._err(re.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=j.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case $.NULL:{this._err(re.unexpectedNullCharacter),n.publicId+=Ht;break}case $.GREATER_THAN_SIGN:{this._err(re.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=j.DATA;break}case $.EOF:{this._err(re.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=j.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case $.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentDoctype(n);break}case $.QUOTATION_MARK:{this._err(re.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case $.APOSTROPHE:{this._err(re.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case $.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(re.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=j.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=j.DATA;break}case $.QUOTATION_MARK:{n.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case $.APOSTROPHE:{n.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case $.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(re.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=j.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=j.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case $.QUOTATION_MARK:{this._err(re.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case $.APOSTROPHE:{this._err(re.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case $.GREATER_THAN_SIGN:{this._err(re.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=j.DATA,this.emitCurrentDoctype(n);break}case $.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(re.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=j.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=j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case $.APOSTROPHE:{n.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case $.GREATER_THAN_SIGN:{this._err(re.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=j.DATA,this.emitCurrentDoctype(n);break}case $.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(re.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case $.QUOTATION_MARK:{this.state=j.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case $.NULL:{this._err(re.unexpectedNullCharacter),n.systemId+=Ht;break}case $.GREATER_THAN_SIGN:{this._err(re.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=j.DATA;break}case $.EOF:{this._err(re.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=j.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case $.NULL:{this._err(re.unexpectedNullCharacter),n.systemId+=Ht;break}case $.GREATER_THAN_SIGN:{this._err(re.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=j.DATA;break}case $.EOF:{this._err(re.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=j.DATA;break}case $.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(re.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case $.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=j.DATA;break}case $.NULL:{this._err(re.unexpectedNullCharacter);break}case $.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case $.RIGHT_SQUARE_BRACKET:{this.state=j.CDATA_SECTION_BRACKET;break}case $.EOF:{this._err(re.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===$.RIGHT_SQUARE_BRACKET?this.state=j.CDATA_SECTION_END:(this._emitChars("]"),this.state=j.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case $.GREATER_THAN_SIGN:{this.state=j.DATA;break}case $.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=j.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()&&iO(this.preprocessor.peek(1))?j.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){iO(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===$.SEMICOLON&&this._err(re.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const c9=new Set([k.DD,k.DT,k.LI,k.OPTGROUP,k.OPTION,k.P,k.RB,k.RP,k.RT,k.RTC]),uO=new Set([...c9,k.CAPTION,k.COLGROUP,k.TBODY,k.TD,k.TFOOT,k.TH,k.THEAD,k.TR]),F0=new Set([k.APPLET,k.CAPTION,k.HTML,k.MARQUEE,k.OBJECT,k.TABLE,k.TD,k.TEMPLATE,k.TH]),sEe=new Set([...F0,k.OL,k.UL]),aEe=new Set([...F0,k.BUTTON]),lO=new Set([k.ANNOTATION_XML,k.MI,k.MN,k.MO,k.MS,k.MTEXT]),dO=new Set([k.DESC,k.FOREIGN_OBJECT,k.TITLE]),oEe=new Set([k.TR,k.TEMPLATE,k.HTML]),iEe=new Set([k.TBODY,k.TFOOT,k.THEAD,k.TEMPLATE,k.HTML]),cEe=new Set([k.TABLE,k.TEMPLATE,k.HTML]),uEe=new Set([k.TD,k.TH]);class lEe{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=k.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===k.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===le.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])!==le.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(_w,le.HTML)}popUntilTableCellPopped(){this.popUntilPopped(uEe,le.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(cEe,le.HTML)}clearBackToTableBodyContext(){this.clearBackTo(iEe,le.HTML)}clearBackToTableRowContext(){this.clearBackTo(oEe,le.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]===k.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]===k.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 le.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case le.SVG:{if(dO.has(s))return!1;break}case le.MATHML:{if(lO.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,F0)}hasInListItemScope(t){return this.hasInDynamicScope(t,sEe)}hasInButtonScope(t){return this.hasInDynamicScope(t,aEe)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case le.HTML:{if(_w.has(n))return!0;if(F0.has(n))return!1;break}case le.SVG:{if(dO.has(n))return!1;break}case le.MATHML:{if(lO.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===le.HTML)switch(this.tagIDs[n]){case t:return!0;case k.TABLE:case k.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===le.HTML)switch(this.tagIDs[t]){case k.TBODY:case k.THEAD:case k.TFOOT:return!0;case k.TABLE:case k.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===le.HTML)switch(this.tagIDs[n]){case t:return!0;case k.OPTION:case k.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&c9.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&uO.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&uO.has(this.currentTagId);)this.pop()}}const jx=3;var xa;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(xa||(xa={}));const hO={type:xa.Marker};class dEe{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===xa.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<jx)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<jx)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>=jx&&this.entries.splice(i.idx,1))}}insertMarker(){this.entries.unshift(hO)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:xa.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:xa.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(hO);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===xa.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===xa.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===xa.Element&&n.element===t)}}const Uo={createDocument(){return{nodeName:"#document",mode:bs.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};Uo.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(Uo.isTextNode(n)){n.value+=t;return}}Uo.appendChild(e,Uo.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Uo.isTextNode(r)?r.value+=t:Uo.insertBefore(e,Uo.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}}},u9="html",hEe="about:legacy-compat",fEe="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",l9=["+//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//"],mEe=[...l9,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],pEe=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),d9=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],gEe=[...d9,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function fO(e,t){return t.some(n=>e.startsWith(n))}function bEe(e){return e.name===u9&&e.publicId===null&&(e.systemId===null||e.systemId===hEe)}function yEe(e){if(e.name!==u9)return bs.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===fEe)return bs.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),pEe.has(n))return bs.QUIRKS;let r=t===null?mEe:l9;if(fO(n,r))return bs.QUIRKS;if(r=t===null?d9:gEe,fO(n,r))return bs.LIMITED_QUIRKS}return bs.NO_QUIRKS}const mO={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},kEe="definitionurl",xEe="definitionURL",_Ee=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])),vEe=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:le.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:le.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:le.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:le.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:le.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:le.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:le.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:le.XML}],["xml:space",{prefix:"xml",name:"space",namespace:le.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:le.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:le.XMLNS}]]),wEe=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])),SEe=new Set([k.B,k.BIG,k.BLOCKQUOTE,k.BODY,k.BR,k.CENTER,k.CODE,k.DD,k.DIV,k.DL,k.DT,k.EM,k.EMBED,k.H1,k.H2,k.H3,k.H4,k.H5,k.H6,k.HEAD,k.HR,k.I,k.IMG,k.LI,k.LISTING,k.MENU,k.META,k.NOBR,k.OL,k.P,k.PRE,k.RUBY,k.S,k.SMALL,k.SPAN,k.STRONG,k.STRIKE,k.SUB,k.SUP,k.TABLE,k.TT,k.U,k.UL,k.VAR]);function EEe(e){const t=e.tagID;return t===k.FONT&&e.attrs.some(({name:r})=>r===Sc.COLOR||r===Sc.SIZE||r===Sc.FACE)||SEe.has(t)}function h9(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===kEe){e.attrs[t].name=xEe;break}}function f9(e){for(let t=0;t<e.attrs.length;t++){const n=_Ee.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function SC(e){for(let t=0;t<e.attrs.length;t++){const n=vEe.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 TEe(e){const t=wEe.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=vd(e.tagName))}function CEe(e,t){return t===le.MATHML&&(e===k.MI||e===k.MO||e===k.MN||e===k.MS||e===k.MTEXT)}function IEe(e,t,n){if(t===le.MATHML&&e===k.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Sc.ENCODING){const s=n[r].value.toLowerCase();return s===mO.TEXT_HTML||s===mO.APPLICATION_XML}}return t===le.SVG&&(e===k.FOREIGN_OBJECT||e===k.DESC||e===k.TITLE)}function AEe(e,t,n,r){return(!r||r===le.HTML)&&IEe(e,t,n)||(!r||r===le.MATHML)&&CEe(e,t)}const NEe="hidden",REe=8,PEe=3;var U;(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"})(U||(U={}));const OEe={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},m9=new Set([k.TABLE,k.TBODY,k.TFOOT,k.THEAD,k.TR]),pO={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Uo,onParseError:null};class gO{constructor(t,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=U.INITIAL,this.originalInsertionMode=U.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={...pO,...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 rEe(this.options,this),this.activeFormattingElements=new dEe(this.treeAdapter),this.fragmentContextID=r?vd(this.treeAdapter.getTagName(r)):k.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new lEe(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={...pO,...n};t??(t=r.treeAdapter.createElement(Q.TEMPLATE,le.HTML,[]));const s=r.treeAdapter.createElement("documentmock",le.HTML,[]),a=new this(r,s,t);return a.fragmentContextID===k.TEMPLATE&&a.tmplInsertionModeStack.unshift(U.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:OEe,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)===le.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,le.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=U.TEXT}switchToPlaintextParsing(){this.insertionMode=U.TEXT,this.originalInsertionMode=U.IN_BODY,this.tokenizer.state=cn.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)===Q.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==le.HTML))switch(this.fragmentContextID){case k.TITLE:case k.TEXTAREA:{this.tokenizer.state=cn.RCDATA;break}case k.STYLE:case k.XMP:case k.IFRAME:case k.NOEMBED:case k.NOFRAMES:case k.NOSCRIPT:{this.tokenizer.state=cn.RAWTEXT;break}case k.SCRIPT:{this.tokenizer.state=cn.SCRIPT_DATA;break}case k.PLAINTEXT:{this.tokenizer.state=cn.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,le.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,le.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(Q.HTML,le.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,k.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===at.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===k.SVG&&this.treeAdapter.getTagName(n)===Q.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===le.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===k.MGLYPH||t.tagID===k.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,le.HTML)}_processToken(t){switch(t.type){case at.CHARACTER:{this.onCharacter(t);break}case at.NULL_CHARACTER:{this.onNullCharacter(t);break}case at.COMMENT:{this.onComment(t);break}case at.DOCTYPE:{this.onDoctype(t);break}case at.START_TAG:{this._processStartTag(t);break}case at.END_TAG:{this.onEndTag(t);break}case at.EOF:{this.onEof(t);break}case at.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return AEe(t,s,a,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===xa.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=U.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(k.P),this.openElements.popUntilTagNamePopped(k.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case k.TR:{this.insertionMode=U.IN_ROW;return}case k.TBODY:case k.THEAD:case k.TFOOT:{this.insertionMode=U.IN_TABLE_BODY;return}case k.CAPTION:{this.insertionMode=U.IN_CAPTION;return}case k.COLGROUP:{this.insertionMode=U.IN_COLUMN_GROUP;return}case k.TABLE:{this.insertionMode=U.IN_TABLE;return}case k.BODY:{this.insertionMode=U.IN_BODY;return}case k.FRAMESET:{this.insertionMode=U.IN_FRAMESET;return}case k.SELECT:{this._resetInsertionModeForSelect(t);return}case k.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case k.HTML:{this.insertionMode=this.headElement?U.AFTER_HEAD:U.BEFORE_HEAD;return}case k.TD:case k.TH:{if(t>0){this.insertionMode=U.IN_CELL;return}break}case k.HEAD:{if(t>0){this.insertionMode=U.IN_HEAD;return}break}}this.insertionMode=U.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===k.TEMPLATE)break;if(r===k.TABLE){this.insertionMode=U.IN_SELECT_IN_TABLE;return}}this.insertionMode=U.IN_SELECT}_isElementCausesFosterParenting(t){return m9.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 k.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===le.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case k.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 ZSe[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){uCe(this,t);return}switch(this.insertionMode){case U.INITIAL:{Jd(this,t);break}case U.BEFORE_HTML:{Kh(this,t);break}case U.BEFORE_HEAD:{Wh(this,t);break}case U.IN_HEAD:{Yh(this,t);break}case U.IN_HEAD_NO_SCRIPT:{Jh(this,t);break}case U.AFTER_HEAD:{Qh(this,t);break}case U.IN_BODY:case U.IN_CAPTION:case U.IN_CELL:case U.IN_TEMPLATE:{g9(this,t);break}case U.TEXT:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case U.IN_TABLE:case U.IN_TABLE_BODY:case U.IN_ROW:{Dx(this,t);break}case U.IN_TABLE_TEXT:{v9(this,t);break}case U.IN_COLUMN_GROUP:{B0(this,t);break}case U.AFTER_BODY:{z0(this,t);break}case U.AFTER_AFTER_BODY:{ab(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){cCe(this,t);return}switch(this.insertionMode){case U.INITIAL:{Jd(this,t);break}case U.BEFORE_HTML:{Kh(this,t);break}case U.BEFORE_HEAD:{Wh(this,t);break}case U.IN_HEAD:{Yh(this,t);break}case U.IN_HEAD_NO_SCRIPT:{Jh(this,t);break}case U.AFTER_HEAD:{Qh(this,t);break}case U.TEXT:{this._insertCharacters(t);break}case U.IN_TABLE:case U.IN_TABLE_BODY:case U.IN_ROW:{Dx(this,t);break}case U.IN_COLUMN_GROUP:{B0(this,t);break}case U.AFTER_BODY:{z0(this,t);break}case U.AFTER_AFTER_BODY:{ab(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){vw(this,t);return}switch(this.insertionMode){case U.INITIAL:case U.BEFORE_HTML:case U.BEFORE_HEAD:case U.IN_HEAD:case U.IN_HEAD_NO_SCRIPT:case U.AFTER_HEAD:case U.IN_BODY:case U.IN_TABLE:case U.IN_CAPTION:case U.IN_COLUMN_GROUP:case U.IN_TABLE_BODY:case U.IN_ROW:case U.IN_CELL:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:case U.IN_TEMPLATE:case U.IN_FRAMESET:case U.AFTER_FRAMESET:{vw(this,t);break}case U.IN_TABLE_TEXT:{Qd(this,t);break}case U.AFTER_BODY:{BEe(this,t);break}case U.AFTER_AFTER_BODY:case U.AFTER_AFTER_FRAMESET:{zEe(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case U.INITIAL:{UEe(this,t);break}case U.BEFORE_HEAD:case U.IN_HEAD:case U.IN_HEAD_NO_SCRIPT:case U.AFTER_HEAD:{this._err(t,re.misplacedDoctype);break}case U.IN_TABLE_TEXT:{Qd(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,re.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?lCe(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case U.INITIAL:{Jd(this,t);break}case U.BEFORE_HTML:{HEe(this,t);break}case U.BEFORE_HEAD:{VEe(this,t);break}case U.IN_HEAD:{ua(this,t);break}case U.IN_HEAD_NO_SCRIPT:{WEe(this,t);break}case U.AFTER_HEAD:{JEe(this,t);break}case U.IN_BODY:{fr(this,t);break}case U.IN_TABLE:{Bl(this,t);break}case U.IN_TABLE_TEXT:{Qd(this,t);break}case U.IN_CAPTION:{GTe(this,t);break}case U.IN_COLUMN_GROUP:{CC(this,t);break}case U.IN_TABLE_BODY:{Z1(this,t);break}case U.IN_ROW:{ek(this,t);break}case U.IN_CELL:{YTe(this,t);break}case U.IN_SELECT:{E9(this,t);break}case U.IN_SELECT_IN_TABLE:{QTe(this,t);break}case U.IN_TEMPLATE:{ZTe(this,t);break}case U.AFTER_BODY:{tCe(this,t);break}case U.IN_FRAMESET:{nCe(this,t);break}case U.AFTER_FRAMESET:{sCe(this,t);break}case U.AFTER_AFTER_BODY:{oCe(this,t);break}case U.AFTER_AFTER_FRAMESET:{iCe(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?dCe(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case U.INITIAL:{Jd(this,t);break}case U.BEFORE_HTML:{qEe(this,t);break}case U.BEFORE_HEAD:{GEe(this,t);break}case U.IN_HEAD:{KEe(this,t);break}case U.IN_HEAD_NO_SCRIPT:{YEe(this,t);break}case U.AFTER_HEAD:{QEe(this,t);break}case U.IN_BODY:{X1(this,t);break}case U.TEXT:{MTe(this,t);break}case U.IN_TABLE:{qf(this,t);break}case U.IN_TABLE_TEXT:{Qd(this,t);break}case U.IN_CAPTION:{KTe(this,t);break}case U.IN_COLUMN_GROUP:{WTe(this,t);break}case U.IN_TABLE_BODY:{ww(this,t);break}case U.IN_ROW:{S9(this,t);break}case U.IN_CELL:{JTe(this,t);break}case U.IN_SELECT:{T9(this,t);break}case U.IN_SELECT_IN_TABLE:{XTe(this,t);break}case U.IN_TEMPLATE:{eCe(this,t);break}case U.AFTER_BODY:{I9(this,t);break}case U.IN_FRAMESET:{rCe(this,t);break}case U.AFTER_FRAMESET:{aCe(this,t);break}case U.AFTER_AFTER_BODY:{ab(this,t);break}}}onEof(t){switch(this.insertionMode){case U.INITIAL:{Jd(this,t);break}case U.BEFORE_HTML:{Kh(this,t);break}case U.BEFORE_HEAD:{Wh(this,t);break}case U.IN_HEAD:{Yh(this,t);break}case U.IN_HEAD_NO_SCRIPT:{Jh(this,t);break}case U.AFTER_HEAD:{Qh(this,t);break}case U.IN_BODY:case U.IN_TABLE:case U.IN_CAPTION:case U.IN_COLUMN_GROUP:case U.IN_TABLE_BODY:case U.IN_ROW:case U.IN_CELL:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:{x9(this,t);break}case U.TEXT:{jTe(this,t);break}case U.IN_TABLE_TEXT:{Qd(this,t);break}case U.IN_TEMPLATE:{C9(this,t);break}case U.AFTER_BODY:case U.IN_FRAMESET:case U.AFTER_FRAMESET:case U.AFTER_AFTER_BODY:case U.AFTER_AFTER_FRAMESET:{TC(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 U.IN_HEAD:case U.IN_HEAD_NO_SCRIPT:case U.AFTER_HEAD:case U.TEXT:case U.IN_COLUMN_GROUP:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:case U.IN_FRAMESET:case U.AFTER_FRAMESET:{this._insertCharacters(t);break}case U.IN_BODY:case U.IN_CAPTION:case U.IN_CELL:case U.IN_TEMPLATE:case U.AFTER_BODY:case U.AFTER_AFTER_BODY:case U.AFTER_AFTER_FRAMESET:{p9(this,t);break}case U.IN_TABLE:case U.IN_TABLE_BODY:case U.IN_ROW:{Dx(this,t);break}case U.IN_TABLE_TEXT:{_9(this,t);break}}}}function LEe(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):k9(e,t),n}function $Ee(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 MEe(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>=PEe;!i||c?(c&&e.activeFormattingElements.removeEntry(i),e.openElements.remove(o)):(o=jEe(e,i),r===t&&(e.activeFormattingElements.bookmark=i),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function jEe(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 DEe(e,t,n){const r=e.treeAdapter.getTagName(t),s=vd(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const a=e.treeAdapter.getNamespaceURI(t);s===k.TEMPLATE&&a===le.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function FEe(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 EC(e,t){for(let n=0;n<REe;n++){const r=LEe(e,t);if(!r)break;const s=$Ee(e,r);if(!s)break;e.activeFormattingElements.bookmark=r;const a=MEe(e,s,r.element),o=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(a),o&&DEe(e,o,a),FEe(e,s,r)}}function vw(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function BEe(e,t){e._appendCommentNode(t,e.openElements.items[0])}function zEe(e,t){e._appendCommentNode(t,e.document)}function TC(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 UEe(e,t){e._setDocumentType(t);const n=t.forceQuirks?bs.QUIRKS:yEe(t);bEe(t)||e._err(t,re.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=U.BEFORE_HTML}function Jd(e,t){e._err(t,re.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,bs.QUIRKS),e.insertionMode=U.BEFORE_HTML,e._processToken(t)}function HEe(e,t){t.tagID===k.HTML?(e._insertElement(t,le.HTML),e.insertionMode=U.BEFORE_HEAD):Kh(e,t)}function qEe(e,t){const n=t.tagID;(n===k.HTML||n===k.HEAD||n===k.BODY||n===k.BR)&&Kh(e,t)}function Kh(e,t){e._insertFakeRootElement(),e.insertionMode=U.BEFORE_HEAD,e._processToken(t)}function VEe(e,t){switch(t.tagID){case k.HTML:{fr(e,t);break}case k.HEAD:{e._insertElement(t,le.HTML),e.headElement=e.openElements.current,e.insertionMode=U.IN_HEAD;break}default:Wh(e,t)}}function GEe(e,t){const n=t.tagID;n===k.HEAD||n===k.BODY||n===k.HTML||n===k.BR?Wh(e,t):e._err(t,re.endTagWithoutMatchingOpenElement)}function Wh(e,t){e._insertFakeElement(Q.HEAD,k.HEAD),e.headElement=e.openElements.current,e.insertionMode=U.IN_HEAD,e._processToken(t)}function ua(e,t){switch(t.tagID){case k.HTML:{fr(e,t);break}case k.BASE:case k.BASEFONT:case k.BGSOUND:case k.LINK:case k.META:{e._appendElement(t,le.HTML),t.ackSelfClosing=!0;break}case k.TITLE:{e._switchToTextParsing(t,cn.RCDATA);break}case k.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,cn.RAWTEXT):(e._insertElement(t,le.HTML),e.insertionMode=U.IN_HEAD_NO_SCRIPT);break}case k.NOFRAMES:case k.STYLE:{e._switchToTextParsing(t,cn.RAWTEXT);break}case k.SCRIPT:{e._switchToTextParsing(t,cn.SCRIPT_DATA);break}case k.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=U.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(U.IN_TEMPLATE);break}case k.HEAD:{e._err(t,re.misplacedStartTagForHeadElement);break}default:Yh(e,t)}}function KEe(e,t){switch(t.tagID){case k.HEAD:{e.openElements.pop(),e.insertionMode=U.AFTER_HEAD;break}case k.BODY:case k.BR:case k.HTML:{Yh(e,t);break}case k.TEMPLATE:{lu(e,t);break}default:e._err(t,re.endTagWithoutMatchingOpenElement)}}function lu(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==k.TEMPLATE&&e._err(t,re.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(k.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,re.endTagWithoutMatchingOpenElement)}function Yh(e,t){e.openElements.pop(),e.insertionMode=U.AFTER_HEAD,e._processToken(t)}function WEe(e,t){switch(t.tagID){case k.HTML:{fr(e,t);break}case k.BASEFONT:case k.BGSOUND:case k.HEAD:case k.LINK:case k.META:case k.NOFRAMES:case k.STYLE:{ua(e,t);break}case k.NOSCRIPT:{e._err(t,re.nestedNoscriptInHead);break}default:Jh(e,t)}}function YEe(e,t){switch(t.tagID){case k.NOSCRIPT:{e.openElements.pop(),e.insertionMode=U.IN_HEAD;break}case k.BR:{Jh(e,t);break}default:e._err(t,re.endTagWithoutMatchingOpenElement)}}function Jh(e,t){const n=t.type===at.EOF?re.openElementsLeftAfterEof:re.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=U.IN_HEAD,e._processToken(t)}function JEe(e,t){switch(t.tagID){case k.HTML:{fr(e,t);break}case k.BODY:{e._insertElement(t,le.HTML),e.framesetOk=!1,e.insertionMode=U.IN_BODY;break}case k.FRAMESET:{e._insertElement(t,le.HTML),e.insertionMode=U.IN_FRAMESET;break}case k.BASE:case k.BASEFONT:case k.BGSOUND:case k.LINK:case k.META:case k.NOFRAMES:case k.SCRIPT:case k.STYLE:case k.TEMPLATE:case k.TITLE:{e._err(t,re.abandonedHeadElementChild),e.openElements.push(e.headElement,k.HEAD),ua(e,t),e.openElements.remove(e.headElement);break}case k.HEAD:{e._err(t,re.misplacedStartTagForHeadElement);break}default:Qh(e,t)}}function QEe(e,t){switch(t.tagID){case k.BODY:case k.HTML:case k.BR:{Qh(e,t);break}case k.TEMPLATE:{lu(e,t);break}default:e._err(t,re.endTagWithoutMatchingOpenElement)}}function Qh(e,t){e._insertFakeElement(Q.BODY,k.BODY),e.insertionMode=U.IN_BODY,Q1(e,t)}function Q1(e,t){switch(t.type){case at.CHARACTER:{g9(e,t);break}case at.WHITESPACE_CHARACTER:{p9(e,t);break}case at.COMMENT:{vw(e,t);break}case at.START_TAG:{fr(e,t);break}case at.END_TAG:{X1(e,t);break}case at.EOF:{x9(e,t);break}}}function p9(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function g9(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function XEe(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function ZEe(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function eTe(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,le.HTML),e.insertionMode=U.IN_FRAMESET)}function tTe(e,t){e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._insertElement(t,le.HTML)}function nTe(e,t){e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&_w.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,le.HTML)}function rTe(e,t){e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._insertElement(t,le.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function sTe(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._insertElement(t,le.HTML),n||(e.formElement=e.openElements.current))}function aTe(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===k.LI&&s===k.LI||(n===k.DD||n===k.DT)&&(s===k.DD||s===k.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==k.ADDRESS&&s!==k.DIV&&s!==k.P&&e._isSpecialElement(e.openElements.items[r],s))break}e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._insertElement(t,le.HTML)}function oTe(e,t){e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._insertElement(t,le.HTML),e.tokenizer.state=cn.PLAINTEXT}function iTe(e,t){e.openElements.hasInScope(k.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(k.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,le.HTML),e.framesetOk=!1}function cTe(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Q.A);n&&(EC(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,le.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function uTe(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,le.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function lTe(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(k.NOBR)&&(EC(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,le.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function dTe(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,le.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function hTe(e,t){e.treeAdapter.getDocumentMode(e.document)!==bs.QUIRKS&&e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._insertElement(t,le.HTML),e.framesetOk=!1,e.insertionMode=U.IN_TABLE}function b9(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,le.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function y9(e){const t=o9(e,Sc.TYPE);return t!=null&&t.toLowerCase()===NEe}function fTe(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,le.HTML),y9(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function mTe(e,t){e._appendElement(t,le.HTML),t.ackSelfClosing=!0}function pTe(e,t){e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._appendElement(t,le.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function gTe(e,t){t.tagName=Q.IMG,t.tagID=k.IMG,b9(e,t)}function bTe(e,t){e._insertElement(t,le.HTML),e.skipNextNewLine=!0,e.tokenizer.state=cn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=U.TEXT}function yTe(e,t){e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,cn.RAWTEXT)}function kTe(e,t){e.framesetOk=!1,e._switchToTextParsing(t,cn.RAWTEXT)}function bO(e,t){e._switchToTextParsing(t,cn.RAWTEXT)}function xTe(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,le.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===U.IN_TABLE||e.insertionMode===U.IN_CAPTION||e.insertionMode===U.IN_TABLE_BODY||e.insertionMode===U.IN_ROW||e.insertionMode===U.IN_CELL?U.IN_SELECT_IN_TABLE:U.IN_SELECT}function _Te(e,t){e.openElements.currentTagId===k.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,le.HTML)}function vTe(e,t){e.openElements.hasInScope(k.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,le.HTML)}function wTe(e,t){e.openElements.hasInScope(k.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(k.RTC),e._insertElement(t,le.HTML)}function STe(e,t){e._reconstructActiveFormattingElements(),h9(t),SC(t),t.selfClosing?e._appendElement(t,le.MATHML):e._insertElement(t,le.MATHML),t.ackSelfClosing=!0}function ETe(e,t){e._reconstructActiveFormattingElements(),f9(t),SC(t),t.selfClosing?e._appendElement(t,le.SVG):e._insertElement(t,le.SVG),t.ackSelfClosing=!0}function yO(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,le.HTML)}function fr(e,t){switch(t.tagID){case k.I:case k.S:case k.B:case k.U:case k.EM:case k.TT:case k.BIG:case k.CODE:case k.FONT:case k.SMALL:case k.STRIKE:case k.STRONG:{uTe(e,t);break}case k.A:{cTe(e,t);break}case k.H1:case k.H2:case k.H3:case k.H4:case k.H5:case k.H6:{nTe(e,t);break}case k.P:case k.DL:case k.OL:case k.UL:case k.DIV:case k.DIR:case k.NAV:case k.MAIN:case k.MENU:case k.ASIDE:case k.CENTER:case k.FIGURE:case k.FOOTER:case k.HEADER:case k.HGROUP:case k.DIALOG:case k.DETAILS:case k.ADDRESS:case k.ARTICLE:case k.SEARCH:case k.SECTION:case k.SUMMARY:case k.FIELDSET:case k.BLOCKQUOTE:case k.FIGCAPTION:{tTe(e,t);break}case k.LI:case k.DD:case k.DT:{aTe(e,t);break}case k.BR:case k.IMG:case k.WBR:case k.AREA:case k.EMBED:case k.KEYGEN:{b9(e,t);break}case k.HR:{pTe(e,t);break}case k.RB:case k.RTC:{vTe(e,t);break}case k.RT:case k.RP:{wTe(e,t);break}case k.PRE:case k.LISTING:{rTe(e,t);break}case k.XMP:{yTe(e,t);break}case k.SVG:{ETe(e,t);break}case k.HTML:{XEe(e,t);break}case k.BASE:case k.LINK:case k.META:case k.STYLE:case k.TITLE:case k.SCRIPT:case k.BGSOUND:case k.BASEFONT:case k.TEMPLATE:{ua(e,t);break}case k.BODY:{ZEe(e,t);break}case k.FORM:{sTe(e,t);break}case k.NOBR:{lTe(e,t);break}case k.MATH:{STe(e,t);break}case k.TABLE:{hTe(e,t);break}case k.INPUT:{fTe(e,t);break}case k.PARAM:case k.TRACK:case k.SOURCE:{mTe(e,t);break}case k.IMAGE:{gTe(e,t);break}case k.BUTTON:{iTe(e,t);break}case k.APPLET:case k.OBJECT:case k.MARQUEE:{dTe(e,t);break}case k.IFRAME:{kTe(e,t);break}case k.SELECT:{xTe(e,t);break}case k.OPTION:case k.OPTGROUP:{_Te(e,t);break}case k.NOEMBED:case k.NOFRAMES:{bO(e,t);break}case k.FRAMESET:{eTe(e,t);break}case k.TEXTAREA:{bTe(e,t);break}case k.NOSCRIPT:{e.options.scriptingEnabled?bO(e,t):yO(e,t);break}case k.PLAINTEXT:{oTe(e,t);break}case k.COL:case k.TH:case k.TD:case k.TR:case k.HEAD:case k.FRAME:case k.TBODY:case k.TFOOT:case k.THEAD:case k.CAPTION:case k.COLGROUP:break;default:yO(e,t)}}function TTe(e,t){if(e.openElements.hasInScope(k.BODY)&&(e.insertionMode=U.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function CTe(e,t){e.openElements.hasInScope(k.BODY)&&(e.insertionMode=U.AFTER_BODY,I9(e,t))}function ITe(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function ATe(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(k.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(k.FORM):n&&e.openElements.remove(n))}function NTe(e){e.openElements.hasInButtonScope(k.P)||e._insertFakeElement(Q.P,k.P),e._closePElement()}function RTe(e){e.openElements.hasInListItemScope(k.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(k.LI),e.openElements.popUntilTagNamePopped(k.LI))}function PTe(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function OTe(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function LTe(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function $Te(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Q.BR,k.BR),e.openElements.pop(),e.framesetOk=!1}function k9(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!==k.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 X1(e,t){switch(t.tagID){case k.A:case k.B:case k.I:case k.S:case k.U:case k.EM:case k.TT:case k.BIG:case k.CODE:case k.FONT:case k.NOBR:case k.SMALL:case k.STRIKE:case k.STRONG:{EC(e,t);break}case k.P:{NTe(e);break}case k.DL:case k.UL:case k.OL:case k.DIR:case k.DIV:case k.NAV:case k.PRE:case k.MAIN:case k.MENU:case k.ASIDE:case k.BUTTON:case k.CENTER:case k.FIGURE:case k.FOOTER:case k.HEADER:case k.HGROUP:case k.DIALOG:case k.ADDRESS:case k.ARTICLE:case k.DETAILS:case k.SEARCH:case k.SECTION:case k.SUMMARY:case k.LISTING:case k.FIELDSET:case k.BLOCKQUOTE:case k.FIGCAPTION:{ITe(e,t);break}case k.LI:{RTe(e);break}case k.DD:case k.DT:{PTe(e,t);break}case k.H1:case k.H2:case k.H3:case k.H4:case k.H5:case k.H6:{OTe(e);break}case k.BR:{$Te(e);break}case k.BODY:{TTe(e,t);break}case k.HTML:{CTe(e,t);break}case k.FORM:{ATe(e);break}case k.APPLET:case k.OBJECT:case k.MARQUEE:{LTe(e,t);break}case k.TEMPLATE:{lu(e,t);break}default:k9(e,t)}}function x9(e,t){e.tmplInsertionModeStack.length>0?C9(e,t):TC(e,t)}function MTe(e,t){var n;t.tagID===k.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function jTe(e,t){e._err(t,re.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Dx(e,t){if(e.openElements.currentTagId!==void 0&&m9.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=U.IN_TABLE_TEXT,t.type){case at.CHARACTER:{v9(e,t);break}case at.WHITESPACE_CHARACTER:{_9(e,t);break}}else qm(e,t)}function DTe(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,le.HTML),e.insertionMode=U.IN_CAPTION}function FTe(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,le.HTML),e.insertionMode=U.IN_COLUMN_GROUP}function BTe(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Q.COLGROUP,k.COLGROUP),e.insertionMode=U.IN_COLUMN_GROUP,CC(e,t)}function zTe(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,le.HTML),e.insertionMode=U.IN_TABLE_BODY}function UTe(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Q.TBODY,k.TBODY),e.insertionMode=U.IN_TABLE_BODY,Z1(e,t)}function HTe(e,t){e.openElements.hasInTableScope(k.TABLE)&&(e.openElements.popUntilTagNamePopped(k.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function qTe(e,t){y9(t)?e._appendElement(t,le.HTML):qm(e,t),t.ackSelfClosing=!0}function VTe(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,le.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Bl(e,t){switch(t.tagID){case k.TD:case k.TH:case k.TR:{UTe(e,t);break}case k.STYLE:case k.SCRIPT:case k.TEMPLATE:{ua(e,t);break}case k.COL:{BTe(e,t);break}case k.FORM:{VTe(e,t);break}case k.TABLE:{HTe(e,t);break}case k.TBODY:case k.TFOOT:case k.THEAD:{zTe(e,t);break}case k.INPUT:{qTe(e,t);break}case k.CAPTION:{DTe(e,t);break}case k.COLGROUP:{FTe(e,t);break}default:qm(e,t)}}function qf(e,t){switch(t.tagID){case k.TABLE:{e.openElements.hasInTableScope(k.TABLE)&&(e.openElements.popUntilTagNamePopped(k.TABLE),e._resetInsertionMode());break}case k.TEMPLATE:{lu(e,t);break}case k.BODY:case k.CAPTION:case k.COL:case k.COLGROUP:case k.HTML:case k.TBODY:case k.TD:case k.TFOOT:case k.TH:case k.THEAD:case k.TR:break;default:qm(e,t)}}function qm(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Q1(e,t),e.fosterParentingEnabled=n}function _9(e,t){e.pendingCharacterTokens.push(t)}function v9(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Qd(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)qm(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const w9=new Set([k.CAPTION,k.COL,k.COLGROUP,k.TBODY,k.TD,k.TFOOT,k.TH,k.THEAD,k.TR]);function GTe(e,t){const n=t.tagID;w9.has(n)?e.openElements.hasInTableScope(k.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(k.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=U.IN_TABLE,Bl(e,t)):fr(e,t)}function KTe(e,t){const n=t.tagID;switch(n){case k.CAPTION:case k.TABLE:{e.openElements.hasInTableScope(k.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(k.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=U.IN_TABLE,n===k.TABLE&&qf(e,t));break}case k.BODY:case k.COL:case k.COLGROUP:case k.HTML:case k.TBODY:case k.TD:case k.TFOOT:case k.TH:case k.THEAD:case k.TR:break;default:X1(e,t)}}function CC(e,t){switch(t.tagID){case k.HTML:{fr(e,t);break}case k.COL:{e._appendElement(t,le.HTML),t.ackSelfClosing=!0;break}case k.TEMPLATE:{ua(e,t);break}default:B0(e,t)}}function WTe(e,t){switch(t.tagID){case k.COLGROUP:{e.openElements.currentTagId===k.COLGROUP&&(e.openElements.pop(),e.insertionMode=U.IN_TABLE);break}case k.TEMPLATE:{lu(e,t);break}case k.COL:break;default:B0(e,t)}}function B0(e,t){e.openElements.currentTagId===k.COLGROUP&&(e.openElements.pop(),e.insertionMode=U.IN_TABLE,e._processToken(t))}function Z1(e,t){switch(t.tagID){case k.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,le.HTML),e.insertionMode=U.IN_ROW;break}case k.TH:case k.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(Q.TR,k.TR),e.insertionMode=U.IN_ROW,ek(e,t);break}case k.CAPTION:case k.COL:case k.COLGROUP:case k.TBODY:case k.TFOOT:case k.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE,Bl(e,t));break}default:Bl(e,t)}}function ww(e,t){const n=t.tagID;switch(t.tagID){case k.TBODY:case k.TFOOT:case k.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE);break}case k.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE,qf(e,t));break}case k.BODY:case k.CAPTION:case k.COL:case k.COLGROUP:case k.HTML:case k.TD:case k.TH:case k.TR:break;default:qf(e,t)}}function ek(e,t){switch(t.tagID){case k.TH:case k.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,le.HTML),e.insertionMode=U.IN_CELL,e.activeFormattingElements.insertMarker();break}case k.CAPTION:case k.COL:case k.COLGROUP:case k.TBODY:case k.TFOOT:case k.THEAD:case k.TR:{e.openElements.hasInTableScope(k.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY,Z1(e,t));break}default:Bl(e,t)}}function S9(e,t){switch(t.tagID){case k.TR:{e.openElements.hasInTableScope(k.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY);break}case k.TABLE:{e.openElements.hasInTableScope(k.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY,ww(e,t));break}case k.TBODY:case k.TFOOT:case k.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(k.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY,ww(e,t));break}case k.BODY:case k.CAPTION:case k.COL:case k.COLGROUP:case k.HTML:case k.TD:case k.TH:break;default:qf(e,t)}}function YTe(e,t){const n=t.tagID;w9.has(n)?(e.openElements.hasInTableScope(k.TD)||e.openElements.hasInTableScope(k.TH))&&(e._closeTableCell(),ek(e,t)):fr(e,t)}function JTe(e,t){const n=t.tagID;switch(n){case k.TD:case k.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=U.IN_ROW);break}case k.TABLE:case k.TBODY:case k.TFOOT:case k.THEAD:case k.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),S9(e,t));break}case k.BODY:case k.CAPTION:case k.COL:case k.COLGROUP:case k.HTML:break;default:X1(e,t)}}function E9(e,t){switch(t.tagID){case k.HTML:{fr(e,t);break}case k.OPTION:{e.openElements.currentTagId===k.OPTION&&e.openElements.pop(),e._insertElement(t,le.HTML);break}case k.OPTGROUP:{e.openElements.currentTagId===k.OPTION&&e.openElements.pop(),e.openElements.currentTagId===k.OPTGROUP&&e.openElements.pop(),e._insertElement(t,le.HTML);break}case k.HR:{e.openElements.currentTagId===k.OPTION&&e.openElements.pop(),e.openElements.currentTagId===k.OPTGROUP&&e.openElements.pop(),e._appendElement(t,le.HTML),t.ackSelfClosing=!0;break}case k.INPUT:case k.KEYGEN:case k.TEXTAREA:case k.SELECT:{e.openElements.hasInSelectScope(k.SELECT)&&(e.openElements.popUntilTagNamePopped(k.SELECT),e._resetInsertionMode(),t.tagID!==k.SELECT&&e._processStartTag(t));break}case k.SCRIPT:case k.TEMPLATE:{ua(e,t);break}}}function T9(e,t){switch(t.tagID){case k.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===k.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===k.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===k.OPTGROUP&&e.openElements.pop();break}case k.OPTION:{e.openElements.currentTagId===k.OPTION&&e.openElements.pop();break}case k.SELECT:{e.openElements.hasInSelectScope(k.SELECT)&&(e.openElements.popUntilTagNamePopped(k.SELECT),e._resetInsertionMode());break}case k.TEMPLATE:{lu(e,t);break}}}function QTe(e,t){const n=t.tagID;n===k.CAPTION||n===k.TABLE||n===k.TBODY||n===k.TFOOT||n===k.THEAD||n===k.TR||n===k.TD||n===k.TH?(e.openElements.popUntilTagNamePopped(k.SELECT),e._resetInsertionMode(),e._processStartTag(t)):E9(e,t)}function XTe(e,t){const n=t.tagID;n===k.CAPTION||n===k.TABLE||n===k.TBODY||n===k.TFOOT||n===k.THEAD||n===k.TR||n===k.TD||n===k.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(k.SELECT),e._resetInsertionMode(),e.onEndTag(t)):T9(e,t)}function ZTe(e,t){switch(t.tagID){case k.BASE:case k.BASEFONT:case k.BGSOUND:case k.LINK:case k.META:case k.NOFRAMES:case k.SCRIPT:case k.STYLE:case k.TEMPLATE:case k.TITLE:{ua(e,t);break}case k.CAPTION:case k.COLGROUP:case k.TBODY:case k.TFOOT:case k.THEAD:{e.tmplInsertionModeStack[0]=U.IN_TABLE,e.insertionMode=U.IN_TABLE,Bl(e,t);break}case k.COL:{e.tmplInsertionModeStack[0]=U.IN_COLUMN_GROUP,e.insertionMode=U.IN_COLUMN_GROUP,CC(e,t);break}case k.TR:{e.tmplInsertionModeStack[0]=U.IN_TABLE_BODY,e.insertionMode=U.IN_TABLE_BODY,Z1(e,t);break}case k.TD:case k.TH:{e.tmplInsertionModeStack[0]=U.IN_ROW,e.insertionMode=U.IN_ROW,ek(e,t);break}default:e.tmplInsertionModeStack[0]=U.IN_BODY,e.insertionMode=U.IN_BODY,fr(e,t)}}function eCe(e,t){t.tagID===k.TEMPLATE&&lu(e,t)}function C9(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(k.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):TC(e,t)}function tCe(e,t){t.tagID===k.HTML?fr(e,t):z0(e,t)}function I9(e,t){var n;if(t.tagID===k.HTML){if(e.fragmentContext||(e.insertionMode=U.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===k.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 z0(e,t)}function z0(e,t){e.insertionMode=U.IN_BODY,Q1(e,t)}function nCe(e,t){switch(t.tagID){case k.HTML:{fr(e,t);break}case k.FRAMESET:{e._insertElement(t,le.HTML);break}case k.FRAME:{e._appendElement(t,le.HTML),t.ackSelfClosing=!0;break}case k.NOFRAMES:{ua(e,t);break}}}function rCe(e,t){t.tagID===k.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==k.FRAMESET&&(e.insertionMode=U.AFTER_FRAMESET))}function sCe(e,t){switch(t.tagID){case k.HTML:{fr(e,t);break}case k.NOFRAMES:{ua(e,t);break}}}function aCe(e,t){t.tagID===k.HTML&&(e.insertionMode=U.AFTER_AFTER_FRAMESET)}function oCe(e,t){t.tagID===k.HTML?fr(e,t):ab(e,t)}function ab(e,t){e.insertionMode=U.IN_BODY,Q1(e,t)}function iCe(e,t){switch(t.tagID){case k.HTML:{fr(e,t);break}case k.NOFRAMES:{ua(e,t);break}}}function cCe(e,t){t.chars=Ht,e._insertCharacters(t)}function uCe(e,t){e._insertCharacters(t),e.framesetOk=!1}function A9(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==le.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function lCe(e,t){if(EEe(t))A9(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===le.MATHML?h9(t):r===le.SVG&&(TEe(t),f9(t)),SC(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function dCe(e,t){if(t.tagID===k.P||t.tagID===k.BR){A9(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)===le.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}Q.AREA,Q.BASE,Q.BASEFONT,Q.BGSOUND,Q.BR,Q.COL,Q.EMBED,Q.FRAME,Q.HR,Q.IMG,Q.INPUT,Q.KEYGEN,Q.LINK,Q.META,Q.PARAM,Q.SOURCE,Q.TRACK,Q.WBR;const tk=N9("end"),za=N9("start");function N9(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 R9(e){const t=za(e),n=tk(e);if(t&&n)return{start:t,end:n}}const hCe=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,fCe=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),kO={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function P9(e,t){const n=wCe(e),r=aC("type",{handlers:{root:mCe,element:pCe,text:gCe,comment:L9,doctype:bCe,raw:kCe},unknown:xCe}),s={parser:n?new gO(kO):gO.getFragmentParser(void 0,kO),handle(i){r(i,s)},stitches:!1,options:t||{}};r(e,s),wd(s,za());const a=n?s.parser.document:s.parser.getFragment(),o=ESe(a,{file:s.options.file});return s.stitches&&Pa(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 O9(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function mCe(e,t){O9(e.children,t)}function pCe(e,t){_Ce(e,t),O9(e.children,t),vCe(e,t)}function gCe(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:at.CHARACTER,chars:e.value,location:Vm(e)};wd(t,za(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function bCe(e,t){const n={type:at.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Vm(e)};wd(t,za(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function yCe(e,t){t.stitches=!0;const n=SCe(e);if("children"in e&&"children"in n){const r=P9({type:"root",children:e.children},t.options);n.children=r.children}L9({type:"comment",value:{stitch:n}},t)}function L9(e,t){const n=e.value,r={type:at.COMMENT,data:n,location:Vm(e)};wd(t,za(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function kCe(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,$9(t,za(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(hCe,"<$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 xCe(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))yCe(n,t);else{let r="";throw fCe.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 wd(e,t){$9(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=cn.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 $9(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 _Ce(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===cn.PLAINTEXT)return;wd(t,za(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=NSe({...e,children:[]},{space:s===fc.svg?"svg":"html"}),o={type:at.START_TAG,tagName:n,tagID:vd(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:Vm(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function vCe(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&W8.includes(n)||t.parser.tokenizer.state===cn.PLAINTEXT)return;wd(t,tk(e));const r={type:at.END_TAG,tagName:n,tagID:vd(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Vm(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===cn.RCDATA||t.parser.tokenizer.state===cn.RAWTEXT||t.parser.tokenizer.state===cn.SCRIPT_DATA)&&(t.parser.tokenizer.state=cn.DATA)}function wCe(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Vm(e){const t=za(e)||{line:void 0,column:void 0,offset:void 0},n=tk(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 SCe(e){return"children"in e?Gc({...e,children:[]}):Gc(e)}function Sw(e){return function(t,n){return P9(t,{...e,file:n})}}const Wi=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],rc={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Wi,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Wi],h2:[["className","sr-only"]],img:[...Wi,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Wi,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Wi],table:[...Wi],ul:[...Wi,["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"]},Vo={}.hasOwnProperty;function ECe(e,t){let n={type:"root",children:[]};const r={schema:t?{...rc,...t}:rc,stack:[]},s=M9(r,e);return s&&(Array.isArray(s)?s.length===1?n=s[0]:n.children=s:n=s),n}function M9(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return TCe(e,n);case"doctype":return CCe(e,n);case"element":return ICe(e,n);case"root":return ACe(e,n);case"text":return NCe(e,n)}}}function TCe(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 Gm(a,t),a}}function CCe(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return Gm(n,t),n}}function ICe(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=j9(e,t.children),s=RCe(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&&Vo.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 Gm(o,t),o}function ACe(e,t){const r={type:"root",children:j9(e,t.children)};return Gm(r,t),r}function NCe(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return Gm(r,t),r}function j9(e,t){const n=[];if(Array.isArray(t)){const r=t;let s=-1;for(;++s<r.length;){const a=M9(e,r[s]);a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}function RCe(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,s=e.schema.required,a=r&&Vo.call(r,n)?r[n]:void 0,o=r&&Vo.call(r,"*")?r["*"]:void 0,i=t&&typeof t=="object"?t:{},c={};let u;for(u in i)if(Vo.call(i,u)){const l=i[u];let d=xO(e,_O(a,u),u,l);d==null&&(d=xO(e,_O(o,u),u,l)),d!=null&&(c[u]=d)}if(s&&Vo.call(s,n)){const l=s[n];for(u in l)Vo.call(l,u)&&!Vo.call(c,u)&&(c[u]=l[u])}return c}function xO(e,t,n,r){return t?Array.isArray(r)?PCe(e,t,n,r):D9(e,t,n,r):void 0}function PCe(e,t,n,r){let s=-1;const a=[];for(;++s<r.length;){const o=D9(e,t,n,r[s]);(typeof o=="number"||typeof o=="string")&&a.push(o)}return a}function D9(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&OCe(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 OCe(e,t,n){const r=e.schema.protocols&&Vo.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 Gm(e,t){const n=R9(t);t.data&&(e.data=Gc(t.data)),n&&(e.position=n)}function _O(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 F9(e){return function(t){return ECe(t,e)}}const Sr=Mi(/[A-Za-z]/),lr=Mi(/[\dA-Za-z]/),LCe=Mi(/[#-'*+\--9=?A-Z^-~]/);function U0(e){return e!==null&&(e<32||e===127)}const Ew=Mi(/\d/),$Ce=Mi(/[\dA-Fa-f]/),MCe=Mi(/[!-/:-@[-`{-~]/);function De(e){return e!==null&&e<-2}function jt(e){return e!==null&&(e<0||e===32)}function ct(e){return e===-2||e===-1||e===32}const nk=Mi(new RegExp("\\p{P}|\\p{S}","u")),Kc=Mi(/\s/);function Mi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function jCe(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function DCe(e,t,n){const s=W1((n||{}).ignore||[]),a=FCe(t);let o=-1;for(;++o<a.length;)bC(e,"text",i);function i(u,l){let d=-1,h;for(;++d<l.length;){const f=l[d],p=h?h.children:void 0;if(s(f,p?p.indexOf(f):void 0,h))return;h=f}if(h)return c(u,l)}function c(u,l){const d=l[l.length-1],h=a[o][0],f=a[o][1];let p=0;const g=d.children.indexOf(u);let b=!1,y=[];h.lastIndex=0;let _=h.exec(u.value);for(;_;){const S=_.index,w={index:_.index,input:_.input,stack:[...l,u]};let v=f(..._,w);if(typeof v=="string"&&(v=v.length>0?{type:"text",value:v}:void 0),v===!1?h.lastIndex=S+1:(p!==S&&y.push({type:"text",value:u.value.slice(p,S)}),Array.isArray(v)?y.push(...v):v&&y.push(v),p=S+_[0].length,b=!0),!h.global)break;_=h.exec(u.value)}return b?(p<u.value.length&&y.push({type:"text",value:u.value.slice(p)}),d.children.splice(g,1,...y)):y=[u],g+y.length}}function FCe(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([BCe(s[0]),zCe(s[1])])}return t}function BCe(e){return typeof e=="string"?new RegExp(jCe(e),"g"):e}function zCe(e){return typeof e=="function"?e:function(){return e}}const Fx="phrasing",Bx=["autolink","link","image","label"];function UCe(){return{transforms:[YCe],enter:{literalAutolink:qCe,literalAutolinkEmail:zx,literalAutolinkHttp:zx,literalAutolinkWww:zx},exit:{literalAutolink:WCe,literalAutolinkEmail:KCe,literalAutolinkHttp:VCe,literalAutolinkWww:GCe}}}function HCe(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Fx,notInConstruct:Bx},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Fx,notInConstruct:Bx},{character:":",before:"[ps]",after:"\\/",inConstruct:Fx,notInConstruct:Bx}]}}function qCe(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function zx(e){this.config.enter.autolinkProtocol.call(this,e)}function VCe(e){this.config.exit.autolinkProtocol.call(this,e)}function GCe(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 KCe(e){this.config.exit.autolinkEmail.call(this,e)}function WCe(e){this.exit(e)}function YCe(e){DCe(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,JCe],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),QCe]],{ignore:["link","linkReference"]})}function JCe(e,t,n,r,s){let a="";if(!B9(s)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!XCe(n)))return!1;const o=ZCe(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 QCe(e,t,n,r){return!B9(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function XCe(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 ZCe(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=P0(e,"(");let a=P0(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 B9(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Kc(n)||nk(n))&&(!t||n!==47)}function Ys(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}z9.peek=c2e;function e2e(){this.buffer()}function t2e(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function n2e(){this.buffer()}function r2e(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function s2e(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ys(this.sliceSerialize(e)).toLowerCase(),n.label=t}function a2e(e){this.exit(e)}function o2e(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ys(this.sliceSerialize(e)).toLowerCase(),n.label=t}function i2e(e){this.exit(e)}function c2e(){return"["}function z9(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 u2e(){return{enter:{gfmFootnoteCallString:e2e,gfmFootnoteCall:t2e,gfmFootnoteDefinitionLabelString:n2e,gfmFootnoteDefinition:r2e},exit:{gfmFootnoteCallString:s2e,gfmFootnoteCall:a2e,gfmFootnoteDefinitionLabelString:o2e,gfmFootnoteDefinition:i2e}}}function l2e(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:z9},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?`
|
|
203
|
+
`:" ")+a.indentLines(a.containerFlow(r,i.current()),t?U9:d2e))),u(),c}}function d2e(e,t,n){return t===0?e:U9(e,t,n)}function U9(e,t,n){return(n?"":" ")+e}const h2e=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];H9.peek=b2e;function f2e(){return{canContainEols:["delete"],enter:{strikethrough:p2e},exit:{strikethrough:g2e}}}function m2e(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:h2e}],handlers:{delete:H9}}}function p2e(e){this.enter({type:"delete",children:[]},e)}function g2e(e){this.exit(e)}function H9(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 b2e(){return"~"}function y2e(e){return e.length}function k2e(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||y2e,a=[],o=[],i=[],c=[];let u=0,l=-1;for(;++l<e.length;){const x=[],g=[];let b=-1;for(e[l].length>u&&(u=e[l].length);++b<e[l].length;){const y=x2e(e[l][b]);if(n.alignDelimiters!==!1){const _=s(y);g[b]=_,(c[b]===void 0||_>c[b])&&(c[b]=_)}x.push(y)}o[l]=x,i[l]=g}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<u;)a[d]=vO(r[d]);else{const x=vO(r);for(;++d<u;)a[d]=x}d=-1;const h=[],f=[];for(;++d<u;){const x=a[d];let g="",b="";x===99?(g=":",b=":"):x===108?g=":":x===114&&(b=":");let y=n.alignDelimiters===!1?1:Math.max(1,c[d]-g.length-b.length);const _=g+"-".repeat(y)+b;n.alignDelimiters!==!1&&(y=g.length+y+b.length,y>c[d]&&(c[d]=y),f[d]=y),h[d]=_}o.splice(1,0,h),i.splice(1,0,f),l=-1;const p=[];for(;++l<o.length;){const x=o[l],g=i[l];d=-1;const b=[];for(;++d<u;){const y=x[d]||"";let _="",S="";if(n.alignDelimiters!==!1){const w=c[d]-(g[d]||0),v=a[d];v===114?_=" ".repeat(w):v===99?w%2?(_=" ".repeat(w/2+.5),S=" ".repeat(w/2-.5)):(_=" ".repeat(w/2),S=_):S=" ".repeat(w)}n.delimiterStart!==!1&&!d&&b.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&y==="")&&(n.delimiterStart!==!1||d)&&b.push(" "),n.alignDelimiters!==!1&&b.push(_),b.push(y),n.alignDelimiters!==!1&&b.push(S),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(`
|
|
204
|
+
`)}function x2e(e){return e==null?"":String(e)}function vO(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 _2e(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()),v2e);return s(),o}function v2e(e,t,n){return">"+(n?"":" ")+e}function w2e(e,t){return wO(e,t.inConstruct,!0)&&!wO(e,t.notInConstruct,!1)}function wO(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 SO(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
205
|
+
`&&w2e(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
206
|
+
`}function S2e(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 E2e(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 T2e(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 C2e(e,t,n,r){const s=T2e(n),a=e.value||"",o=s==="`"?"GraveAccent":"Tilde";if(E2e(e,n)){const d=n.enter("codeIndented"),h=n.indentLines(a,I2e);return d(),h}const i=n.createTracker(r),c=s.repeat(Math.max(S2e(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:`
|
|
207
|
+
`,encode:["`"],...i.current()})),d()}return l+=i.move(`
|
|
208
|
+
`),a&&(l+=i.move(a+`
|
|
209
|
+
`)),l+=i.move(c),u(),l}function I2e(e,t,n){return(n?"":" ")+e}function IC(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 A2e(e,t,n,r){const s=IC(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?" ":`
|
|
210
|
+
`,...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 N2e(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 Vf(e){return"&#x"+e.toString(16).toUpperCase()+";"}function zl(e){if(e===null||jt(e)||Kc(e))return 1;if(nk(e))return 2}function H0(e,t,n){const r=zl(e),s=zl(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}}q9.peek=R2e;function q9(e,t,n,r){const s=N2e(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=H0(r.before.charCodeAt(r.before.length-1),u,s);l.inside&&(c=Vf(u)+c.slice(1));const d=c.charCodeAt(c.length-1),h=H0(r.after.charCodeAt(0),d,s);h.inside&&(c=c.slice(0,-1)+Vf(d));const f=o.move(s);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:l.outside},i+c+f}function R2e(e,t,n){return n.options.emphasis||"*"}const P2e={};function AC(e,t){const n=P2e,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return V9(e,r,s)}function V9(e,t,n){if(O2e(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 EO(e.children,t,n)}return Array.isArray(e)?EO(e,t,n):""}function EO(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=V9(e[s],t,n);return r.join("")}function O2e(e){return!!(e&&typeof e=="object")}function L2e(e,t){let n=!1;return Pa(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,yw}),!!((!e.depth||e.depth<3)&&AC(e)&&(t.options.setext||n))}function $2e(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(L2e(e,n)){const l=n.enter("headingSetext"),d=n.enter("phrasing"),h=n.containerPhrasing(e,{...a.current(),before:`
|
|
211
|
+
`,after:`
|
|
212
|
+
`});return d(),l(),h+`
|
|
213
|
+
`+(s===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
214
|
+
`))+1))}const o="#".repeat(s),i=n.enter("headingAtx"),c=n.enter("phrasing");a.move(o+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
|
|
215
|
+
`,...a.current()});return/^[\t ]/.test(u)&&(u=Vf(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),c(),i(),u}G9.peek=M2e;function G9(e){return e.value||""}function M2e(){return"<"}K9.peek=j2e;function K9(e,t,n,r){const s=IC(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 j2e(){return"!"}W9.peek=D2e;function W9(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 D2e(){return"!"}Y9.peek=F2e;function Y9(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 F2e(){return"`"}function J9(e,t){const n=AC(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))}Q9.peek=B2e;function Q9(e,t,n,r){const s=IC(n),a=s==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let i,c;if(J9(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 B2e(e,t,n){return J9(e,n)?"<":"["}X9.peek=z2e;function X9(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 z2e(){return"["}function NC(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 U2e(e){const t=NC(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 H2e(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 Z9(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 q2e(e,t,n,r){const s=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?H2e(n):NC(n);const i=e.ordered?o==="."?")":".":U2e(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),Z9(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 V2e(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 G2e(e,t,n,r){const s=V2e(n);let a=n.bulletCurrent||NC(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,f){return h?(f?"":" ".repeat(o))+d:(f?a:a+" ".repeat(o-a.length))+d}}function K2e(e,t,n,r){const s=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),s(),o}const W2e=W1(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Y2e(e,t,n,r){return(e.children.some(function(o){return W2e(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function J2e(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ez.peek=Q2e;function ez(e,t,n,r){const s=J2e(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=H0(r.before.charCodeAt(r.before.length-1),u,s);l.inside&&(c=Vf(u)+c.slice(1));const d=c.charCodeAt(c.length-1),h=H0(r.after.charCodeAt(0),d,s);h.inside&&(c=c.slice(0,-1)+Vf(d));const f=o.move(s+s);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:l.outside},i+c+f}function Q2e(e,t,n){return n.options.strong||"*"}function X2e(e,t,n,r){return n.safe(e.value,r)}function Z2e(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 eIe(e,t,n){const r=(Z9(n)+(n.options.ruleSpaces?" ":"")).repeat(Z2e(n));return n.options.ruleSpaces?r.slice(0,-1):r}const tz={blockquote:_2e,break:SO,code:C2e,definition:A2e,emphasis:q9,hardBreak:SO,heading:$2e,html:G9,image:K9,imageReference:W9,inlineCode:Y9,link:Q9,linkReference:X9,list:q2e,listItem:G2e,paragraph:K2e,root:Y2e,strong:ez,text:X2e,thematicBreak:eIe},TO=document.createElement("i");function RC(e){const t="&"+e+";";TO.innerHTML=t;const n=TO.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function nz(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 tIe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function nIe(e){return e.replace(tIe,rIe)}function rIe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),a=s===120||s===88;return nz(n.slice(a?2:1),a?16:10)}return RC(n)||e}function sIe(){return{enter:{table:aIe,tableData:CO,tableHeader:CO,tableRow:iIe},exit:{codeText:cIe,table:oIe,tableData:Ux,tableHeader:Ux,tableRow:Ux}}}function aIe(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 oIe(e){this.exit(e),this.data.inTable=void 0}function iIe(e){this.enter({type:"tableRow",children:[]},e)}function Ux(e){this.exit(e)}function CO(e){this.enter({type:"tableCell",children:[]},e)}function cIe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,uIe));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function uIe(e,t){return t==="|"?t:e}function lIe(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
216
|
+
`,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(f,p,x,g){return u(l(f,x,g),f.align)}function i(f,p,x,g){const b=d(f,x,g),y=u([b]);return y.slice(0,y.indexOf(`
|
|
217
|
+
`))}function c(f,p,x,g){const b=x.enter("tableCell"),y=x.enter("phrasing"),_=x.containerPhrasing(f,{...g,before:a,after:a});return y(),b(),_}function u(f,p){return k2e(f,{align:p,alignDelimiters:r,padding:n,stringLength:s})}function l(f,p,x){const g=f.children;let b=-1;const y=[],_=p.enter("table");for(;++b<g.length;)y[b]=d(g[b],p,x);return _(),y}function d(f,p,x){const g=f.children;let b=-1;const y=[],_=p.enter("tableRow");for(;++b<g.length;)y[b]=c(g[b],f,p,x);return _(),y}function h(f,p,x){let g=tz.inlineCode(f,p,x);return x.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function dIe(){return{exit:{taskListCheckValueChecked:IO,taskListCheckValueUnchecked:IO,paragraph:fIe}}}function hIe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:mIe}}}function IO(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function fIe(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 mIe(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=tz.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 pIe(){return[UCe(),u2e(),f2e(),sIe(),dIe()]}function gIe(e){return{extensions:[HCe(),l2e(e),m2e(),lIe(e),hIe()]}}function ns(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 ys(e,t){return e.length>0?(ns(e,e.length,0,t),e):t}const AO={}.hasOwnProperty;function rz(e){const t={};let n=-1;for(;++n<e.length;)bIe(t,e[n]);return t}function bIe(e,t){let n;for(n in t){const s=(AO.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){AO.call(s,o)||(s[o]=[]);const i=a[o];yIe(s[o],Array.isArray(i)?i:i?[i]:[])}}}function yIe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ns(e,0,0,r)}const kIe={tokenize:EIe,partial:!0},sz={tokenize:TIe,partial:!0},az={tokenize:CIe,partial:!0},oz={tokenize:IIe,partial:!0},xIe={tokenize:AIe,partial:!0},iz={name:"wwwAutolink",tokenize:wIe,previous:uz},cz={name:"protocolAutolink",tokenize:SIe,previous:lz},No={name:"emailAutolink",tokenize:vIe,previous:dz},Ua={};function _Ie(){return{text:Ua}}let Yi=48;for(;Yi<123;)Ua[Yi]=No,Yi++,Yi===58?Yi=65:Yi===91&&(Yi=97);Ua[43]=No;Ua[45]=No;Ua[46]=No;Ua[95]=No;Ua[72]=[No,cz];Ua[104]=[No,cz];Ua[87]=[No,iz];Ua[119]=[No,iz];function vIe(e,t,n){const r=this;let s,a;return o;function o(d){return!Tw(d)||!dz.call(r,r.previous)||PC(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),i(d))}function i(d){return Tw(d)?(e.consume(d),i):d===64?(e.consume(d),c):n(d)}function c(d){return d===46?e.check(xIe,l,u)(d):d===45||d===95||lr(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&&Sr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function wIe(e,t,n){const r=this;return s;function s(o){return o!==87&&o!==119||!uz.call(r,r.previous)||PC(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(kIe,e.attempt(sz,e.attempt(az,a),n),n)(o))}function a(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function SIe(e,t,n){const r=this;let s="",a=!1;return o;function o(d){return(d===72||d===104)&&lz.call(r,r.previous)&&!PC(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(d),e.consume(d),i):n(d)}function i(d){if(Sr(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||U0(d)||jt(d)||Kc(d)||nk(d)?n(d):e.attempt(sz,e.attempt(az,l),n)(d)}function l(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function EIe(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 TIe(e,t,n){let r,s,a;return o;function o(u){return u===46||u===95?e.check(oz,c,i)(u):u===null||jt(u)||Kc(u)||u!==45&&nk(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 CIe(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(oz,t,a)(o):o===null||jt(o)||Kc(o)?t(o):(e.consume(o),s)}function a(o){return o===41&&r++,e.consume(o),s}}function IIe(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||jt(i)||Kc(i)?t(i):n(i)}function s(i){return i===null||i===40||i===91||jt(i)||Kc(i)?t(i):r(i)}function a(i){return Sr(i)?o(i):n(i)}function o(i){return i===59?(e.consume(i),r):Sr(i)?(e.consume(i),o):n(i)}}function AIe(e,t,n){return r;function r(a){return e.consume(a),s}function s(a){return lr(a)?n(a):t(a)}}function uz(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||jt(e)}function lz(e){return!Sr(e)}function dz(e){return!(e===47||Tw(e))}function Tw(e){return e===43||e===45||e===46||e===95||lr(e)}function PC(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 Sd(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&lr(e.charCodeAt(n+1))&&lr(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 rk(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 Cw={name:"attention",resolveAll:NIe,tokenize:RIe};function NIe(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};NO(d,-c),NO(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=ys(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=ys(u,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",a,t]]),u=ys(u,rk(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=ys(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=ys(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):l=0,ns(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 RIe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=zl(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=zl(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 NO(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const PIe={name:"autolink",tokenize:OIe};function OIe(e,t,n){let r=0;return s;function s(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(f){return Sr(f)?(e.consume(f),o):f===64?n(f):u(f)}function o(f){return f===43||f===45||f===46||lr(f)?(r=1,i(f)):u(f)}function i(f){return f===58?(e.consume(f),r=0,c):(f===43||f===45||f===46||lr(f))&&r++<32?(e.consume(f),i):(r=0,u(f))}function c(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||U0(f)?n(f):(e.consume(f),c)}function u(f){return f===64?(e.consume(f),l):LCe(f)?(e.consume(f),u):n(f)}function l(f){return lr(f)?d(f):n(f)}function d(f){return f===46?(e.consume(f),r=0,l):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):h(f)}function h(f){if((f===45||lr(f))&&r++<63){const p=f===45?h:d;return e.consume(f),p}return n(f)}}function pt(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(c){return ct(c)?(e.enter(n),i(c)):t(c)}function i(c){return ct(c)&&a++<s?(e.consume(c),i):(e.exit(n),t(c))}}const Km={partial:!0,tokenize:LIe};function LIe(e,t,n){return r;function r(a){return ct(a)?pt(e,s,"linePrefix")(a):s(a)}function s(a){return a===null||De(a)?t(a):n(a)}}const hz={continuation:{tokenize:MIe},exit:jIe,name:"blockQuote",tokenize:$Ie};function $Ie(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 ct(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function MIe(e,t,n){const r=this;return s;function s(o){return ct(o)?pt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(hz,t,n)(o)}}function jIe(e){e.exit("blockQuote")}const fz={name:"characterEscape",tokenize:DIe};function DIe(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 MCe(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const mz={name:"characterReference",tokenize:FIe};function FIe(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=lr,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=$Ce,l):(e.enter("characterReferenceValue"),a=7,o=Ew,l(d))}function l(d){if(d===59&&s){const h=e.exit("characterReferenceValue");return o===lr&&!RC(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 RO={partial:!0,tokenize:zIe},PO={concrete:!0,name:"codeFenced",tokenize:BIe};function BIe(e,t,n){const r=this,s={partial:!0,tokenize:w};let a=0,o=0,i;return c;function c(v){return u(v)}function u(v){const C=r.events[r.events.length-1];return a=C&&C[1].type==="linePrefix"?C[2].sliceSerialize(C[1],!0).length:0,i=v,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(v)}function l(v){return v===i?(o++,e.consume(v),l):o<3?n(v):(e.exit("codeFencedFenceSequence"),ct(v)?pt(e,d,"whitespace")(v):d(v))}function d(v){return v===null||De(v)?(e.exit("codeFencedFence"),r.interrupt?t(v):e.check(RO,x,S)(v)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===null||De(v)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(v)):ct(v)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),pt(e,f,"whitespace")(v)):v===96&&v===i?n(v):(e.consume(v),h)}function f(v){return v===null||De(v)?d(v):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===null||De(v)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(v)):v===96&&v===i?n(v):(e.consume(v),p)}function x(v){return e.attempt(s,S,g)(v)}function g(v){return e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),b}function b(v){return a>0&&ct(v)?pt(e,y,"linePrefix",a+1)(v):y(v)}function y(v){return v===null||De(v)?e.check(RO,x,S)(v):(e.enter("codeFlowValue"),_(v))}function _(v){return v===null||De(v)?(e.exit("codeFlowValue"),y(v)):(e.consume(v),_)}function S(v){return e.exit("codeFenced"),t(v)}function w(v,C,I){let R=0;return N;function N(te){return v.enter("lineEnding"),v.consume(te),v.exit("lineEnding"),z}function z(te){return v.enter("codeFencedFence"),ct(te)?pt(v,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(te):V(te)}function V(te){return te===i?(v.enter("codeFencedFenceSequence"),ne(te)):I(te)}function ne(te){return te===i?(R++,v.consume(te),ne):R>=o?(v.exit("codeFencedFenceSequence"),ct(te)?pt(v,J,"whitespace")(te):J(te)):I(te)}function J(te){return te===null||De(te)?(v.exit("codeFencedFence"),C(te)):I(te)}}}function zIe(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 Hx={name:"codeIndented",tokenize:HIe},UIe={partial:!0,tokenize:qIe};function HIe(e,t,n){const r=this;return s;function s(u){return e.enter("codeIndented"),pt(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):De(u)?e.attempt(UIe,o,c)(u):(e.enter("codeFlowValue"),i(u))}function i(u){return u===null||De(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),i)}function c(u){return e.exit("codeIndented"),t(u)}}function qIe(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):De(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):pt(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):De(o)?s(o):n(o)}}const VIe={name:"codeText",previous:KIe,resolve:GIe,tokenize:WIe};function GIe(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 KIe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function WIe(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)):De(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||De(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 YIe{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&&Xd(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),Xd(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Xd(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);Xd(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Xd(this.left,n.reverse())}}}function Xd(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 pz(e){const t={};let n=-1,r,s,a,o,i,c,u;const l=new YIe(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,JIe(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 ns(e,0,Number.POSITIVE_INFINITY,l.slice(0)),!u}function JIe(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,f=n,p=0,x=0;const g=[x];for(;f;){for(;e.get(++s)[1]!==f;);a.push(s),f._tokenizer||(l=r.sliceStream(f),f.next||l.push(null),d&&o.defineSkip(f.start),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(l),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=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&&(x=h+1,g.push(x),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(o.events=[],f?(f._tokenizer=void 0,f.previous=void 0):g.pop(),h=g.length;h--;){const b=i.slice(g[h],g[h+1]),y=a.pop();c.push([y,y+b.length-1]),e.splice(y,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 QIe={resolve:ZIe,tokenize:eAe},XIe={partial:!0,tokenize:tAe};function ZIe(e){return pz(e),e}function eAe(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):De(i)?e.check(XIe,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 tAe(e,t,n){const r=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),pt(e,a,"linePrefix")}function a(o){if(o===null||De(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 gz(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||U0(b)?n(b):(e.enter(r),e.enter(o),e.enter(i),e.enter("chunkString",{contentType:"string"}),x(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"}),f(b))}function f(b){return b===62?(e.exit("chunkString"),e.exit(i),h(b)):b===null||b===60||De(b)?n(b):(e.consume(b),b===92?p:f)}function p(b){return b===60||b===62||b===92?(e.consume(b),f):f(b)}function x(b){return!l&&(b===null||b===41||jt(b))?(e.exit("chunkString"),e.exit(i),e.exit(o),e.exit(r),t(b)):l<u&&b===40?(e.consume(b),l++,x):b===41?(e.consume(b),l--,x):b===null||b===32||b===40||U0(b)?n(b):(e.consume(b),b===92?g:x)}function g(b){return b===40||b===41||b===92?(e.consume(b),x):x(b)}}function bz(e,t,n,r,s,a){const o=this;let i=0,c;return u;function u(f){return e.enter(r),e.enter(s),e.consume(f),e.exit(s),e.enter(a),l}function l(f){return i>999||f===null||f===91||f===93&&!c||f===94&&!i&&"_hiddenFootnoteSupport"in o.parser.constructs?n(f):f===93?(e.exit(a),e.enter(s),e.consume(f),e.exit(s),e.exit(r),t):De(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||De(f)||i++>999?(e.exit("chunkString"),l(f)):(e.consume(f),c||(c=!ct(f)),f===92?h:d)}function h(f){return f===91||f===92||f===93?(e.consume(f),i++,d):d(f)}}function yz(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):De(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),pt(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),l(h))}function l(h){return h===o||h===null||De(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 Xh(e,t){let n;return r;function r(s){return De(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):ct(s)?pt(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const nAe={name:"definition",tokenize:sAe},rAe={partial:!0,tokenize:aAe};function sAe(e,t,n){const r=this;let s;return a;function a(f){return e.enter("definition"),o(f)}function o(f){return bz.call(r,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function i(f){return s=Ys(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),c):n(f)}function c(f){return jt(f)?Xh(e,u)(f):u(f)}function u(f){return gz(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function l(f){return e.attempt(rAe,d,d)(f)}function d(f){return ct(f)?pt(e,h,"whitespace")(f):h(f)}function h(f){return f===null||De(f)?(e.exit("definition"),r.parser.defined.push(s),t(f)):n(f)}}function aAe(e,t,n){return r;function r(i){return jt(i)?Xh(e,s)(i):n(i)}function s(i){return yz(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(i)}function a(i){return ct(i)?pt(e,o,"whitespace")(i):o(i)}function o(i){return i===null||De(i)?t(i):n(i)}}const oAe={name:"hardBreakEscape",tokenize:iAe};function iAe(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return De(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const cAe={name:"headingAtx",resolve:uAe,tokenize:lAe};function uAe(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"},ns(e,r,n-r+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function lAe(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||jt(l)?(e.exit("atxHeadingSequence"),i(l)):n(l)}function i(l){return l===35?(e.enter("atxHeadingSequence"),c(l)):l===null||De(l)?(e.exit("atxHeading"),t(l)):ct(l)?pt(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||jt(l)?(e.exit("atxHeadingText"),i(l)):(e.consume(l),u)}}const dAe=["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"],OO=["pre","script","style","textarea"],hAe={concrete:!0,name:"htmlFlow",resolveTo:pAe,tokenize:gAe},fAe={partial:!0,tokenize:yAe},mAe={partial:!0,tokenize:bAe};function pAe(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 gAe(e,t,n){const r=this;let s,a,o,i,c;return u;function u(A){return l(A)}function l(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),d}function d(A){return A===33?(e.consume(A),h):A===47?(e.consume(A),a=!0,x):A===63?(e.consume(A),s=3,r.interrupt?t:T):Sr(A)?(e.consume(A),o=String.fromCharCode(A),g):n(A)}function h(A){return A===45?(e.consume(A),s=2,f):A===91?(e.consume(A),s=5,i=0,p):Sr(A)?(e.consume(A),s=4,r.interrupt?t:T):n(A)}function f(A){return A===45?(e.consume(A),r.interrupt?t:T):n(A)}function p(A){const P="CDATA[";return A===P.charCodeAt(i++)?(e.consume(A),i===P.length?r.interrupt?t:V:p):n(A)}function x(A){return Sr(A)?(e.consume(A),o=String.fromCharCode(A),g):n(A)}function g(A){if(A===null||A===47||A===62||jt(A)){const P=A===47,D=o.toLowerCase();return!P&&!a&&OO.includes(D)?(s=1,r.interrupt?t(A):V(A)):dAe.includes(o.toLowerCase())?(s=6,P?(e.consume(A),b):r.interrupt?t(A):V(A)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):a?y(A):_(A))}return A===45||lr(A)?(e.consume(A),o+=String.fromCharCode(A),g):n(A)}function b(A){return A===62?(e.consume(A),r.interrupt?t:V):n(A)}function y(A){return ct(A)?(e.consume(A),y):N(A)}function _(A){return A===47?(e.consume(A),N):A===58||A===95||Sr(A)?(e.consume(A),S):ct(A)?(e.consume(A),_):N(A)}function S(A){return A===45||A===46||A===58||A===95||lr(A)?(e.consume(A),S):w(A)}function w(A){return A===61?(e.consume(A),v):ct(A)?(e.consume(A),w):_(A)}function v(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),c=A,C):ct(A)?(e.consume(A),v):I(A)}function C(A){return A===c?(e.consume(A),c=null,R):A===null||De(A)?n(A):(e.consume(A),C)}function I(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||jt(A)?w(A):(e.consume(A),I)}function R(A){return A===47||A===62||ct(A)?_(A):n(A)}function N(A){return A===62?(e.consume(A),z):n(A)}function z(A){return A===null||De(A)?V(A):ct(A)?(e.consume(A),z):n(A)}function V(A){return A===45&&s===2?(e.consume(A),se):A===60&&s===1?(e.consume(A),oe):A===62&&s===4?(e.consume(A),q):A===63&&s===3?(e.consume(A),T):A===93&&s===5?(e.consume(A),Xe):De(A)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(fAe,X,ne)(A)):A===null||De(A)?(e.exit("htmlFlowData"),ne(A)):(e.consume(A),V)}function ne(A){return e.check(mAe,J,X)(A)}function J(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),te}function te(A){return A===null||De(A)?ne(A):(e.enter("htmlFlowData"),V(A))}function se(A){return A===45?(e.consume(A),T):V(A)}function oe(A){return A===47?(e.consume(A),o="",me):V(A)}function me(A){if(A===62){const P=o.toLowerCase();return OO.includes(P)?(e.consume(A),q):V(A)}return Sr(A)&&o.length<8?(e.consume(A),o+=String.fromCharCode(A),me):V(A)}function Xe(A){return A===93?(e.consume(A),T):V(A)}function T(A){return A===62?(e.consume(A),q):A===45&&s===2?(e.consume(A),T):V(A)}function q(A){return A===null||De(A)?(e.exit("htmlFlowData"),X(A)):(e.consume(A),q)}function X(A){return e.exit("htmlFlow"),t(A)}}function bAe(e,t,n){const r=this;return s;function s(o){return De(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 yAe(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Km,t,n)}}const kAe={name:"htmlText",tokenize:xAe};function xAe(e,t,n){const r=this;let s,a,o;return i;function i(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),c}function c(T){return T===33?(e.consume(T),u):T===47?(e.consume(T),w):T===63?(e.consume(T),_):Sr(T)?(e.consume(T),I):n(T)}function u(T){return T===45?(e.consume(T),l):T===91?(e.consume(T),a=0,p):Sr(T)?(e.consume(T),y):n(T)}function l(T){return T===45?(e.consume(T),f):n(T)}function d(T){return T===null?n(T):T===45?(e.consume(T),h):De(T)?(o=d,oe(T)):(e.consume(T),d)}function h(T){return T===45?(e.consume(T),f):d(T)}function f(T){return T===62?se(T):T===45?h(T):d(T)}function p(T){const q="CDATA[";return T===q.charCodeAt(a++)?(e.consume(T),a===q.length?x:p):n(T)}function x(T){return T===null?n(T):T===93?(e.consume(T),g):De(T)?(o=x,oe(T)):(e.consume(T),x)}function g(T){return T===93?(e.consume(T),b):x(T)}function b(T){return T===62?se(T):T===93?(e.consume(T),b):x(T)}function y(T){return T===null||T===62?se(T):De(T)?(o=y,oe(T)):(e.consume(T),y)}function _(T){return T===null?n(T):T===63?(e.consume(T),S):De(T)?(o=_,oe(T)):(e.consume(T),_)}function S(T){return T===62?se(T):_(T)}function w(T){return Sr(T)?(e.consume(T),v):n(T)}function v(T){return T===45||lr(T)?(e.consume(T),v):C(T)}function C(T){return De(T)?(o=C,oe(T)):ct(T)?(e.consume(T),C):se(T)}function I(T){return T===45||lr(T)?(e.consume(T),I):T===47||T===62||jt(T)?R(T):n(T)}function R(T){return T===47?(e.consume(T),se):T===58||T===95||Sr(T)?(e.consume(T),N):De(T)?(o=R,oe(T)):ct(T)?(e.consume(T),R):se(T)}function N(T){return T===45||T===46||T===58||T===95||lr(T)?(e.consume(T),N):z(T)}function z(T){return T===61?(e.consume(T),V):De(T)?(o=z,oe(T)):ct(T)?(e.consume(T),z):R(T)}function V(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),s=T,ne):De(T)?(o=V,oe(T)):ct(T)?(e.consume(T),V):(e.consume(T),J)}function ne(T){return T===s?(e.consume(T),s=void 0,te):T===null?n(T):De(T)?(o=ne,oe(T)):(e.consume(T),ne)}function J(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||jt(T)?R(T):(e.consume(T),J)}function te(T){return T===47||T===62||jt(T)?R(T):n(T)}function se(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function oe(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),me}function me(T){return ct(T)?pt(e,Xe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):Xe(T)}function Xe(T){return e.enter("htmlTextData"),o(T)}}const OC={name:"labelEnd",resolveAll:SAe,resolveTo:EAe,tokenize:TAe},_Ae={tokenize:CAe},vAe={tokenize:IAe},wAe={tokenize:AAe};function SAe(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&&ns(e,0,e.length,n),e}function EAe(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=ys(i,e.slice(a+1,a+r+3)),i=ys(i,[["enter",l,t]]),i=ys(i,rk(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),i=ys(i,[["exit",l,t],e[o-2],e[o-1],["exit",u,t]]),i=ys(i,e.slice(o+1)),i=ys(i,[["exit",c,t]]),ns(e,a,e.length,i),e}function TAe(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(Ys(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(_Ae,l,o?l:d)(h):h===91?e.attempt(vAe,l,o?u:d)(h):o?l(h):d(h)}function u(h){return e.attempt(wAe,l,d)(h)}function l(h){return t(h)}function d(h){return a._balanced=!0,n(h)}}function CAe(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 jt(d)?Xh(e,a)(d):a(d)}function a(d){return d===41?l(d):gz(e,o,i,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return jt(d)?Xh(e,c)(d):l(d)}function i(d){return n(d)}function c(d){return d===34||d===39||d===40?yz(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):l(d)}function u(d){return jt(d)?Xh(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 IAe(e,t,n){const r=this;return s;function s(i){return bz.call(r,e,a,o,"reference","referenceMarker","referenceString")(i)}function a(i){return r.parser.defined.includes(Ys(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(i):n(i)}function o(i){return n(i)}}function AAe(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 NAe={name:"labelStartImage",resolveAll:OC.resolveAll,tokenize:RAe};function RAe(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 PAe={name:"labelStartLink",resolveAll:OC.resolveAll,tokenize:OAe};function OAe(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 qx={name:"lineEnding",tokenize:LAe};function LAe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),pt(e,t,"linePrefix")}}const ob={name:"thematicBreak",tokenize:$Ae};function $Ae(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||De(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===s?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),ct(u)?pt(e,i,"whitespace")(u):i(u))}}const Pr={continuation:{tokenize:FAe},exit:zAe,name:"list",tokenize:DAe},MAe={partial:!0,tokenize:UAe},jAe={partial:!0,tokenize:BAe};function DAe(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(f){const p=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Ew(f)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(ob,n,u)(f):u(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(f)}return n(f)}function c(f){return Ew(f)&&++o<10?(e.consume(f),c):(!r.interrupt||o<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):n(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Km,r.interrupt?n:l,e.attempt(MAe,h,d))}function l(f){return r.containerState.initialBlankLine=!0,a++,h(f)}function d(f){return ct(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function FAe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Km,s,a);function s(i){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,pt(e,t,"listItemIndent",r.containerState.size+1)(i)}function a(i){return r.containerState.furtherBlankLines||!ct(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(jAe,t,o)(i))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,pt(e,e.attempt(Pr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}function BAe(e,t,n){const r=this;return pt(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 zAe(e){e.exit(this.containerState.type)}function UAe(e,t,n){const r=this;return pt(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!ct(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const LO={name:"setextUnderline",resolveTo:HAe,tokenize:qAe};function HAe(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 qAe(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"),ct(u)?pt(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||De(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const VAe={tokenize:ZAe,partial:!0};function GAe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:JAe,continuation:{tokenize:QAe},exit:XAe}},text:{91:{name:"gfmFootnoteCall",tokenize:YAe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:KAe,resolveTo:WAe}}}}function KAe(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=Ys(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 WAe(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 YAe(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||jt(d))return n(d);if(d===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return s.includes(Ys(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return jt(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 JAe(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||jt(p))return n(p);if(p===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return a=Ys(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return jt(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),pt(e,f,"gfmFootnoteDefinitionWhitespace")):n(p)}function f(p){return t(p)}}function QAe(e,t,n){return e.check(Km,t,e.attempt(VAe,t,n))}function XAe(e){e.exit("gfmFootnoteDefinition")}function ZAe(e,t,n){const r=this;return pt(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 eNe(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]],f=i.parser.constructs.insideSpan.null;f&&ns(h,h.length,0,rk(f,o.slice(u+1,c),i)),ns(h,h.length,0,[["exit",d,i],["enter",o[c][1],i],["exit",o[c][1],i],["exit",l,i]]),ns(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"),f(p))}function f(p){const x=zl(u);if(p===126)return d>1?c(p):(o.consume(p),d++,f);if(d<2&&!n)return c(p);const g=o.exit("strikethroughSequenceTemporary"),b=zl(p);return g._open=!b||b===2&&!!x,g._close=!x||x===2&&!!b,i(p)}}}class tNe{constructor(){this.map=[]}add(t,n,r){nNe(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 nNe(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 rNe(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 sNe(){return{flow:{null:{name:"table",tokenize:aNe,resolveAll:oNe}}}}function aNe(e,t,n){const r=this;let s=0,a=0,o;return i;function i(N){let z=r.events.length-1;for(;z>-1;){const J=r.events[z][1].type;if(J==="lineEnding"||J==="linePrefix")z--;else break}const V=z>-1?r.events[z][1].type:null,ne=V==="tableHead"||V==="tableRow"?v:c;return ne===v&&r.parser.lazy[r.now().line]?n(N):ne(N)}function c(N){return e.enter("tableHead"),e.enter("tableRow"),u(N)}function u(N){return N===124||(o=!0,a+=1),l(N)}function l(N){return N===null?n(N):De(N)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),f):n(N):ct(N)?pt(e,l,"whitespace")(N):(a+=1,o&&(o=!1,s+=1),N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),o=!0,l):(e.enter("data"),d(N)))}function d(N){return N===null||N===124||jt(N)?(e.exit("data"),l(N)):(e.consume(N),N===92?h:d)}function h(N){return N===92||N===124?(e.consume(N),d):d(N)}function f(N){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(N):(e.enter("tableDelimiterRow"),o=!1,ct(N)?pt(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):p(N))}function p(N){return N===45||N===58?g(N):N===124?(o=!0,e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),x):w(N)}function x(N){return ct(N)?pt(e,g,"whitespace")(N):g(N)}function g(N){return N===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),b):N===45?(a+=1,b(N)):N===null||De(N)?S(N):w(N)}function b(N){return N===45?(e.enter("tableDelimiterFiller"),y(N)):w(N)}function y(N){return N===45?(e.consume(N),y):N===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),_):(e.exit("tableDelimiterFiller"),_(N))}function _(N){return ct(N)?pt(e,S,"whitespace")(N):S(N)}function S(N){return N===124?p(N):N===null||De(N)?!o||s!==a?w(N):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(N)):w(N)}function w(N){return n(N)}function v(N){return e.enter("tableRow"),C(N)}function C(N){return N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),C):N===null||De(N)?(e.exit("tableRow"),t(N)):ct(N)?pt(e,C,"whitespace")(N):(e.enter("data"),I(N))}function I(N){return N===null||N===124||jt(N)?(e.exit("data"),C(N)):(e.consume(N),N===92?R:I)}function R(N){return N===92||N===124?(e.consume(N),I):I(N)}}function oNe(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 tNe;for(;++n<e.length;){const f=e[n],p=f[1];f[0]==="enter"?p.type==="tableHead"?(i=!1,c!==0&&($O(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=xg(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=xg(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=xg(h,t,a,s,n,d)):o[1]!==0&&(d=xg(h,t,o,s,n,d)),s=0):s&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&$O(h,t,c,u,l),h.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=rNe(t.events,n))}return e}function xg(e,t,n,r,s,a){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",i="tableContent";n[0]!==0&&(a.end=Object.assign({},zu(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const c=zu(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=zu(t.events,n[2]),l=zu(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]],f=t.events[n[3]];if(h[1].end=Object.assign({},f[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,x=n[3]-n[2]-1;e.add(p,x,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return s!==void 0&&(a.end=Object.assign({},zu(t.events,s)),e.add(s,0,[["exit",a,t]]),a=void 0),a}function $O(e,t,n,r,s){const a=[],o=zu(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 zu(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const iNe={name:"tasklistCheck",tokenize:uNe};function cNe(){return{text:{91:iNe}}}function uNe(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 jt(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 De(c)?t(c):ct(c)?e.check({tokenize:lNe},t,n)(c):n(c)}}function lNe(e,t,n){return pt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function dNe(e){return rz([_Ie(),GAe(),eNe(e),sNe(),cNe()])}const hNe={};function fNe(e){const t=this,n=e||hNe,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(dNe(n)),a.push(pIe()),o.push(gIe(n))}var mNe=Object.defineProperty,pNe=Object.defineProperties,gNe=Object.getOwnPropertyDescriptors,MO=Object.getOwnPropertySymbols,bNe=Object.prototype.hasOwnProperty,yNe=Object.prototype.propertyIsEnumerable,jO=(e,t,n)=>t in e?mNe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kz=(e,t)=>{for(var n in t||(t={}))bNe.call(t,n)&&jO(e,n,t[n]);if(MO)for(var n of MO(t))yNe.call(t,n)&&jO(e,n,t[n]);return e},xz=(e,t)=>pNe(e,gNe(t)),Fr=(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},kNe=(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},xNe=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]==="`"&&!kNe(e,n)&&(t+=1)}return t},Si=(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},_Ne=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,vNe=e=>!e||typeof e!="string"||!e.includes(">")?e:e.replace(_Ne,(t,n,r,s)=>Fr(e,s)?t:`${n}\\>${r}`),wNe=/(\*\*)([^*]*\*?)$/,SNe=/(__)([^_]*?)$/,ENe=/(\*\*\*)([^*]*?)$/,TNe=/(\*)([^*]*?)$/,CNe=/(_)([^_]*?)$/,INe=/(`)([^`]*?)$/,ANe=/(~~)([^~]*?)$/,du=/^[\s_~*`]*$/,_z=/^[\s]*[-*+][\s]+$/,NNe=/[\p{L}\p{N}_]/u,RNe=/^```[^`\n]*```?$/,PNe=/^\*{4,}$/,ONe=/(__)([^_]+)_$/,LNe=/(~~)([^~]+)~$/,DO=/~~/g,Ei=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:NNe.test(e)},$Ne=(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},vz=(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},sk=(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},MNe=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===")")return!0;if(e[n]===`
|
|
218
|
+
`)return!1}return!1},wz=(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]==="]"?MNe(e,t):!1;if(e[n]===`
|
|
219
|
+
`)return!1}return!1},jNe=(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]===`
|
|
220
|
+
`)return!1}return!1},LC=(e,t,n)=>{let r=0;for(let c=t-1;c>=0;c-=1)if(e[c]===`
|
|
221
|
+
`){r=c+1;break}let s=e.length;for(let c=t;c<e.length;c+=1)if(e[c]===`
|
|
222
|
+
`){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},DNe=(e,t,n,r)=>n==="\\"||e.includes("$")&&sk(e,t)?!0:n!=="*"&&r==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(n==="*"||n&&r&&Ei(n)&&Ei(r)||(!n||n===" "||n===" "||n===`
|
|
223
|
+
`)&&(!r||r===" "||r===" "||r===`
|
|
224
|
+
`)),Sz=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]:"";DNe(e,s,a,o)||(t+=1)}return t},FNe=(e,t,n,r)=>!!(n==="\\"||e.includes("$")&&sk(e,t)||wz(e,t)||jNe(e,t)||n==="_"||r==="_"||n&&r&&Ei(n)&&Ei(r)),BNe=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]:"";FNe(e,s,a,o)||(t+=1)}return t},zNe=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},$C=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},FO=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},UNe=(e,t,n)=>{if(!t||du.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
225
|
+
`),s=r===-1?0:r+1,a=e.substring(s,n);return _z.test(a)&&t.includes(`
|
|
226
|
+
`)?!0:LC(e,n,"*")},HNe=e=>{let t=e.match(wNe);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return Fr(e,r)||Si(e,r)||UNe(e,n,r)?e:$C(e)%2===1?n.endsWith("*")?`${e}*`:`${e}**`:e},qNe=(e,t,n)=>{if(!t||du.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
227
|
+
`),s=r===-1?0:r+1,a=e.substring(s,n);return _z.test(a)&&t.includes(`
|
|
228
|
+
`)?!0:LC(e,n,"_")},VNe=e=>{let t=e.match(SNe);if(!t){let s=e.match(ONe);if(s){let a=e.lastIndexOf(s[1]);if(!(Fr(e,a)||Si(e,a))&&FO(e)%2===1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return Fr(e,r)||Si(e,r)||qNe(e,n,r)?e:FO(e)%2===1?`${e}__`:e},GNe=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]!=="\\"&&!sk(e,n)){let r=n>0?e[n-1]:"",s=n<e.length-1?e[n+1]:"";if((!r||r===" "||r===" "||r===`
|
|
229
|
+
`)&&(!s||s===" "||s===" "||s===`
|
|
230
|
+
`)||r&&s&&Ei(r)&&Ei(s))continue;return n}}return-1},KNe=e=>{if(!e.match(TNe))return e;let t=GNe(e);if(t===-1||Fr(e,t)||Si(e,t))return e;let n=e.substring(t+1);return!n||du.test(n)?e:Sz(e)%2===1?`${e}*`:e},Ez=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]!=="\\"&&!sk(e,n)&&!wz(e,n)){let r=n>0?e[n-1]:"",s=n<e.length-1?e[n+1]:"";if(r&&s&&Ei(r)&&Ei(s))continue;return n}}return-1},WNe=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
231
|
+
`;)t-=1;if(t<e.length){let n=e.slice(0,t),r=e.slice(t);return`${n}_${r}`}return`${e}_`},YNe=e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if($C(t)%2!==1)return null;let n=t.indexOf("**"),r=Ez(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},JNe=e=>{if(!e.match(CNe))return e;let t=Ez(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||du.test(n)||Fr(e,t)||Si(e,t))return e;if(BNe(e)%2===1){let r=YNe(e);return r!==null?r:WNe(e)}return e},QNe=e=>{let t=$C(e),n=Sz(e);return t%2===0&&n%2===0},XNe=(e,t,n)=>!t||du.test(t)||Fr(e,n)||Si(e,n)?!0:LC(e,n,"*"),ZNe=e=>{if(PNe.test(e))return e;let t=e.match(ENe);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return XNe(e,n,r)?e:zNe(e)%2===1?QNe(e)?e:`${e}***`:e},eRe=/<[a-zA-Z/][^>]*$/,tRe=e=>{let t=e.match(eRe);return!t||t.index===void 0||Fr(e,t.index)?e:e.substring(0,t.index).trimEnd()},nRe=e=>!e.match(RNe)||e.includes(`
|
|
232
|
+
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,rRe=e=>(e.match(/```/g)||[]).length%2===1,sRe=e=>{let t=nRe(e);if(t!==null)return t;let n=e.match(INe);if(n&&!rRe(e)){let r=n[2];if(!r||du.test(r))return e;if(xNe(e)%2===1)return`${e}\``}return e},aRe=(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)==="```",oRe=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!aRe(e,r)&&(n=!n),!n&&e[r]==="$"&&e[r+1]==="$"&&(t+=1,r+=1);return t},iRe=e=>{let t=e.indexOf("$$");return t!==-1&&e.indexOf(`
|
|
233
|
+
`,t)!==-1&&!e.endsWith(`
|
|
234
|
+
`)?`${e}
|
|
235
|
+
$$`:`${e}$$`},cRe=e=>oRe(e)%2===0?e:iRe(e),uRe=(e,t,n)=>{if(e.substring(t+2).includes(")"))return null;let r=$Ne(e,t);if(r===-1||Fr(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)`},BO=(e,t)=>{for(let n=0;n<t;n++)if(e[n]==="["&&!Fr(e,n)){if(n>0&&e[n-1]==="!")continue;let r=vz(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},lRe=(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=BO(e,t);return e.substring(0,o)+e.substring(o+1)}return`${e}](streamdown:incomplete-link)`}if(vz(e,t)===-1){let a=e.substring(0,s);if(r)return a;if(n==="text-only"){let o=BO(e,t);return e.substring(0,o)+e.substring(o+1)}return`${e}](streamdown:incomplete-link)`}return null},Tz=(e,t="protocol")=>{let n=e.lastIndexOf("](");if(n!==-1&&!Fr(e,n)){let r=uRe(e,n,t);if(r!==null)return r}for(let r=e.length-1;r>=0;r-=1)if(e[r]==="["&&!Fr(e,r)){let s=lRe(e,r,t);if(s!==null)return s}return e},dRe=/^-{1,2}$/,hRe=/^[\s]*-{1,2}[\s]+$/,fRe=/^={1,2}$/,mRe=/^[\s]*={1,2}[\s]+$/,pRe=e=>{if(!e||typeof e!="string")return e;let t=e.lastIndexOf(`
|
|
236
|
+
`);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),s=n.trim();if(dRe.test(s)&&!n.match(hRe)){let a=r.split(`
|
|
237
|
+
`).at(-1);if(a&&a.trim().length>0)return`${e}`}if(fRe.test(s)&&!n.match(mRe)){let a=r.split(`
|
|
238
|
+
`).at(-1);if(a&&a.trim().length>0)return`${e}`}return e},gRe=e=>{var t,n;let r=e.match(ANe);if(r){let s=r[2];if(!s||du.test(s))return e;let a=e.lastIndexOf(r[1]);if(Fr(e,a)||Si(e,a))return e;if(((t=e.match(DO))==null?void 0:t.length)%2===1)return`${e}~~`}else{let s=e.match(LNe);if(s){let a=e.lastIndexOf(s[0].slice(0,2));if(Fr(e,a)||Si(e,a))return e;if(((n=e.match(DO))==null?void 0:n.length)%2===1)return`${e}~`}}return e},Vx=e=>e!==!1,Kr={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},bRe=[{handler:{name:"comparisonOperators",handle:vNe,priority:Kr.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:tRe,priority:Kr.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:pRe,priority:Kr.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:Tz,priority:Kr.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:ZNe,priority:Kr.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:HNe,priority:Kr.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:VNe,priority:Kr.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:KNe,priority:Kr.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:JNe,priority:Kr.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:sRe,priority:Kr.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:gRe,priority:Kr.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:cRe,priority:Kr.KATEX},optionKey:"katex"}],yRe=e=>{var t;let n=(t=e?.linkMode)!=null?t:"protocol";return bRe.filter(({handler:r,optionKey:s})=>r.name==="links"?Vx(e?.links)||Vx(e?.images):Vx(e?.[s])).map(({handler:r,earlyReturn:s})=>r.name==="links"?{handler:xz(kz({},r),{handle:a=>Tz(a,n)}),earlyReturn:n==="protocol"?s:void 0}:{handler:r,earlyReturn:s})},kRe=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,s=yRe(t),a=((n=t?.handlers)!=null?n:[]).map(i=>{var c;return{handler:xz(kz({},i),{priority:(c=i.priority)!=null?c:Kr.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},xRe=kRe;const _Re=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vRe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wRe={};function zO(e,t){return(wRe.jsx?vRe:_Re).test(e)}var Ru={},Gx,UO;function SRe(){if(UO)return Gx;UO=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=`
|
|
239
|
+
`,u="/",l="*",d="",h="comment",f="declaration";function p(g,b){if(typeof g!="string")throw new TypeError("First argument must be a string");if(!g)return[];b=b||{};var y=1,_=1;function S(J){var te=J.match(t);te&&(y+=te.length);var se=J.lastIndexOf(c);_=~se?J.length-se:_+J.length}function w(){var J={line:y,column:_};return function(te){return te.position=new v(J),R(),te}}function v(J){this.start=J,this.end={line:y,column:_},this.source=b.source}v.prototype.content=g;function C(J){var te=new Error(b.source+":"+y+":"+_+": "+J);if(te.reason=J,te.filename=b.source,te.line=y,te.column=_,te.source=g,!b.silent)throw te}function I(J){var te=J.exec(g);if(te){var se=te[0];return S(se),g=g.slice(se.length),te}}function R(){I(n)}function N(J){var te;for(J=J||[];te=z();)te!==!1&&J.push(te);return J}function z(){var J=w();if(!(u!=g.charAt(0)||l!=g.charAt(1))){for(var te=2;d!=g.charAt(te)&&(l!=g.charAt(te)||u!=g.charAt(te+1));)++te;if(te+=2,d===g.charAt(te-1))return C("End of comment missing");var se=g.slice(2,te-2);return _+=2,S(se),g=g.slice(te),_+=2,J({type:h,comment:se})}}function V(){var J=w(),te=I(r);if(te){if(z(),!I(s))return C("property missing ':'");var se=I(a),oe=J({type:f,property:x(te[0].replace(e,d)),value:se?x(se[0].replace(e,d)):d});return I(o),oe}}function ne(){var J=[];N(J);for(var te;te=V();)te!==!1&&(J.push(te),N(J));return J}return R(),ne()}function x(g){return g?g.replace(i,d):d}return Gx=p,Gx}var HO;function ERe(){if(HO)return Ru;HO=1;var e=Ru&&Ru.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ru,"__esModule",{value:!0}),Ru.default=n;const t=e(SRe());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 Ru}var Zd={},qO;function TRe(){if(qO)return Zd;qO=1,Object.defineProperty(Zd,"__esModule",{value:!0}),Zd.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 Zd.camelCase=c,Zd}var eh,VO;function CRe(){if(VO)return eh;VO=1;var e=eh&&eh.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(ERe()),n=TRe();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,eh=r,eh}var IRe=CRe();const ARe=W0(IRe);function Zh(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?GO(e.position):"start"in e||"end"in e?GO(e):"line"in e||"column"in e?Iw(e):""}function Iw(e){return KO(e&&e.line)+":"+KO(e&&e.column)}function GO(e){return Iw(e&&e.start)+"-"+Iw(e&&e.end)}function KO(e){return e&&typeof e=="number"?e:1}class mr 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=Zh(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}}mr.prototype.file="";mr.prototype.name="";mr.prototype.reason="";mr.prototype.message="";mr.prototype.stack="";mr.prototype.column=void 0;mr.prototype.line=void 0;mr.prototype.ancestors=void 0;mr.prototype.cause=void 0;mr.prototype.fatal=void 0;mr.prototype.place=void 0;mr.prototype.ruleId=void 0;mr.prototype.source=void 0;const MC={}.hasOwnProperty,NRe=new Map,RRe=/[A-Z]/g,PRe=new Set(["table","tbody","thead","tfoot","tr"]),ORe=new Set(["td","th"]),Cz="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function LRe(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=URe(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=zRe(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"?Ba:yd,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Iz(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function Iz(e,t,n){if(t.type==="element")return $Re(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return MRe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return DRe(e,t,n);if(t.type==="mdxjsEsm")return jRe(e,t);if(t.type==="root")return FRe(e,t,n);if(t.type==="text")return BRe(e,t)}function $Re(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Ba,e.schema=s),e.ancestors.push(t);const a=Nz(e,t.tagName,!1),o=HRe(e,t);let i=DC(e,t);return PRe.has(t.tagName)&&(i=i.filter(function(c){return typeof c=="string"?!q1(c):!0})),Az(e,o,a,t),jC(o,i),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function MRe(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)}Gf(e,t.position)}function jRe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Gf(e,t.position)}function DRe(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Ba,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:Nz(e,t.name,!0),o=qRe(e,t),i=DC(e,t);return Az(e,o,a,t),jC(o,i),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function FRe(e,t,n){const r={};return jC(r,DC(e,t)),e.create(t,e.Fragment,r,n)}function BRe(e,t){return t.value}function Az(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function jC(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function zRe(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 URe(e,t){return n;function n(r,s,a,o){const i=Array.isArray(a.children),c=za(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 HRe(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&MC.call(t.properties,s)){const a=VRe(e,s,t.properties[s]);if(a){const[o,i]=a;e.tableCellAlignToStyle&&o==="align"&&typeof i=="string"&&ORe.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 qRe(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 Gf(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 Gf(e,t.position);else a=r.value===null?!0:r.value;n[s]=a}return n}function DC(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:NRe;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=Iz(e,a,o);i!==void 0&&n.push(i)}return n}function VRe(e,t,n){const r=Bm(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?oC(n):iC(n)),r.property==="style"){let s=typeof n=="object"?n:GRe(e,String(n));return e.stylePropertyNameCase==="css"&&(s=KRe(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?Xke[r.property]||r.property:r.attribute,n]}}function GRe(e,t){try{return ARe(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new mr("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=Cz+"#cannot-parse-style-attribute",s}}function Nz(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=zO(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=zO(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return MC.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);Gf(e)}function Gf(e,t){const n=new mr("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=Cz+"#cannot-handle-mdx-estrees-without-createevaluater",n}function KRe(e){const t={};let n;for(n in e)MC.call(e,n)&&(t[WRe(n)]=e[n]);return t}function WRe(e){let t=e.replace(RRe,YRe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function YRe(e){return"-"+e.toLowerCase()}const Kx={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"]},JRe={tokenize:QRe};function QRe(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"),pt(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 De(i)?(e.consume(i),e.exit("chunkText"),a):(e.consume(i),o)}}const XRe={tokenize:ZRe},WO={tokenize:ePe};function ZRe(e){const t=this,n=[];let r=0,s,a,o;return i;function i(_){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,c,u)(_)}return u(_)}function c(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&y();const S=t.events.length;let w=S,v;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){v=t.events[w][1].end;break}b(r);let C=S;for(;C<t.events.length;)t.events[C][1].end={...v},C++;return ns(t.events,w+1,0,t.events.slice(S)),t.events.length=C,u(_)}return i(_)}function u(_){if(r===n.length){if(!s)return h(_);if(s.currentConstruct&&s.currentConstruct.concrete)return p(_);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(WO,l,d)(_)}function l(_){return s&&y(),b(r),h(_)}function d(_){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,p(_)}function h(_){return t.containerState={},e.attempt(WO,f,p)(_)}function f(_){return r++,n.push([t.currentConstruct,t.containerState]),h(_)}function p(_){if(_===null){s&&y(),b(0),e.consume(_);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:a}),x(_)}function x(_){if(_===null){g(e.exit("chunkFlow"),!0),b(0),e.consume(_);return}return De(_)?(e.consume(_),g(e.exit("chunkFlow")),r=0,t.interrupt=void 0,i):(e.consume(_),x)}function g(_,S){const w=t.sliceStream(_);if(S&&w.push(null),_.previous=a,a&&(a.next=_),a=_,s.defineSkip(_.start),s.write(w),t.parser.lazy[_.start.line]){let v=s.events.length;for(;v--;)if(s.events[v][1].start.offset<o&&(!s.events[v][1].end||s.events[v][1].end.offset>o))return;const C=t.events.length;let I=C,R,N;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(R){N=t.events[I][1].end;break}R=!0}for(b(r),v=C;v<t.events.length;)t.events[v][1].end={...N},v++;ns(t.events,I+1,0,t.events.slice(C)),t.events.length=v}}function b(_){let S=n.length;for(;S-- >_;){const w=n[S];t.containerState=w[1],w[0].exit.call(t,e)}n.length=_}function y(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function ePe(e,t,n){return pt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const tPe={tokenize:nPe};function nPe(e){const t=this,n=e.attempt(Km,r,e.attempt(this.parser.constructs.flowInitial,s,pt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(QIe,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 rPe={resolveAll:Pz()},sPe=Rz("string"),aPe=Rz("text");function Rz(e){return{resolveAll:Pz(e==="text"?oPe: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 f=d[h];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function Pz(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 oPe(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 iPe={42:Pr,43:Pr,45:Pr,48:Pr,49:Pr,50:Pr,51:Pr,52:Pr,53:Pr,54:Pr,55:Pr,56:Pr,57:Pr,62:hz},cPe={91:nAe},uPe={[-2]:Hx,[-1]:Hx,32:Hx},lPe={35:cAe,42:ob,45:[LO,ob],60:hAe,61:LO,95:ob,96:PO,126:PO},dPe={38:mz,92:fz},hPe={[-5]:qx,[-4]:qx,[-3]:qx,33:NAe,38:mz,42:Cw,60:[PIe,kAe],91:PAe,92:[oAe,fz],93:OC,95:Cw,96:VIe},fPe={null:[Cw,rPe]},mPe={null:[42,95]},pPe={null:[]},gPe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:mPe,contentInitial:cPe,disable:pPe,document:iPe,flow:lPe,flowInitial:uPe,insideSpan:fPe,string:dPe,text:hPe},Symbol.toStringTag,{value:"Module"}));function bPe(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:C(w),check:C(v),consume:y,enter:_,exit:S,interrupt:C(v,{interrupt:!0})},u={code:null,containerState:{},defineSkip:x,events:[],now:p,parser:e,previous:null,sliceSerialize:h,sliceStream:f,write:d};let l=t.tokenize.call(u,c);return t.resolveAll&&a.push(t),u;function d(z){return o=ys(o,z),g(),o[o.length-1]!==null?[]:(I(t,0),u.events=rk(a,u.events,u),u.events)}function h(z,V){return kPe(f(z),V)}function f(z){return yPe(o,z)}function p(){const{_bufferIndex:z,_index:V,line:ne,column:J,offset:te}=r;return{_bufferIndex:z,_index:V,line:ne,column:J,offset:te}}function x(z){s[z.line]=z.column,N()}function g(){let z;for(;r._index<o.length;){const V=o[r._index];if(typeof V=="string")for(z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<V.length;)b(V.charCodeAt(r._bufferIndex));else b(V)}}function b(z){l=l(z)}function y(z){De(z)?(r.line++,r.column=1,r.offset+=z===-3?2:1,N()):z!==-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=z}function _(z,V){const ne=V||{};return ne.type=z,ne.start=p(),u.events.push(["enter",ne,u]),i.push(ne),ne}function S(z){const V=i.pop();return V.end=p(),u.events.push(["exit",V,u]),V}function w(z,V){I(z,V.from)}function v(z,V){V.restore()}function C(z,V){return ne;function ne(J,te,se){let oe,me,Xe,T;return Array.isArray(J)?X(J):"tokenize"in J?X([J]):q(J);function q(Y){return ke;function ke(ye){const we=ye!==null&&Y[ye],Oe=ye!==null&&Y.null,G=[...Array.isArray(we)?we:we?[we]:[],...Array.isArray(Oe)?Oe:Oe?[Oe]:[]];return X(G)(ye)}}function X(Y){return oe=Y,me=0,Y.length===0?se:A(Y[me])}function A(Y){return ke;function ke(ye){return T=R(),Xe=Y,Y.partial||(u.currentConstruct=Y),Y.name&&u.parser.constructs.disable.null.includes(Y.name)?D():Y.tokenize.call(V?Object.assign(Object.create(u),V):u,c,P,D)(ye)}}function P(Y){return z(Xe,T),te}function D(Y){return T.restore(),++me<oe.length?A(oe[me]):se}}}function I(z,V){z.resolveAll&&!a.includes(z)&&a.push(z),z.resolve&&ns(u.events,V,u.events.length-V,z.resolve(u.events.slice(V),u)),z.resolveTo&&(u.events=z.resolveTo(u.events,u))}function R(){const z=p(),V=u.previous,ne=u.currentConstruct,J=u.events.length,te=Array.from(i);return{from:J,restore:se};function se(){r=z,u.previous=V,u.currentConstruct=ne,u.events.length=J,i=te,N()}}function N(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function yPe(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 kPe(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=`
|
|
240
|
+
`;break}case-3:{o=`\r
|
|
241
|
+
`;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 xPe(e){const r={constructs:rz([gPe,...(e||{}).extensions||[]]),content:s(JRe),defined:[],document:s(XRe),flow:s(tPe),lazy:{},string:s(sPe),text:s(aPe)};return r;function s(a){return o;function o(i){return bPe(r,a,i)}}}function _Pe(e){for(;!pz(e););return e}const YO=/[\0\t\n\r]/g;function vPe(){let e=1,t="",n=!0,r;return s;function s(a,o,i){const c=[];let u,l,d,h,f;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(YO.lastIndex=d,u=YO.exec(a),h=u&&u.index!==void 0?u.index:a.length,f=a.charCodeAt(h),!u){t=a.slice(d);break}if(f===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),f){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 Oz={}.hasOwnProperty;function wPe(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),SPe(n)(_Pe(xPe(n).document().write(vPe()(e,t,!0))))}function SPe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Se),autolinkProtocol:R,autolinkEmail:R,atxHeading:a(_e),blockQuote:a(Oe),characterEscape:R,characterReference:R,codeFenced:a(G),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(G,o),codeText:a(W,o),codeTextData:R,data:R,codeFlowValue:R,definition:a(ae),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ce),hardBreakEscape:a(Re),hardBreakTrailing:a(Re),htmlFlow:a(H,o),htmlFlowData:R,htmlText:a(H,o),htmlTextData:R,image:a(ie),label:o,link:a(Se),listItem:a(Je),listItemValue:h,listOrdered:a($e,d),listUnordered:a($e),paragraph:a(Gn),reference:A,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(_e),strong:a(hn),thematicBreak:a(Ur)},exit:{atxHeading:c(),atxHeadingSequence:w,autolink:c(),autolinkEmail:we,autolinkProtocol:ye,blockQuote:c(),characterEscapeValue:N,characterReferenceMarkerHexadecimal:D,characterReferenceMarkerNumeric:D,characterReferenceValue:Y,characterReference:ke,codeFenced:c(g),codeFencedFence:x,codeFencedFenceInfo:f,codeFencedFenceMeta:p,codeFlowValue:N,codeIndented:c(b),codeText:c(te),codeTextData:N,data:N,definition:c(),definitionDestinationString:S,definitionLabelString:y,definitionTitleString:_,emphasis:c(),hardBreakEscape:c(V),hardBreakTrailing:c(V),htmlFlow:c(ne),htmlFlowData:N,htmlText:c(J),htmlTextData:N,image:c(oe),label:Xe,labelText:me,lineEnding:z,link:c(se),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:P,resourceDestinationString:T,resourceTitleString:q,resource:X,setextHeading:c(I),setextHeadingLineSequence:C,setextHeadingText:v,strong:c(),thematicBreak:c()}};Lz(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(Z){let ue={type:"root",children:[]};const Ae={stack:[ue],tokenStack:[],config:t,enter:i,exit:u,buffer:o,resume:l,data:n},Ce=[];let xt=-1;for(;++xt<Z.length;)if(Z[xt][1].type==="listOrdered"||Z[xt][1].type==="listUnordered")if(Z[xt][0]==="enter")Ce.push(xt);else{const Pe=Ce.pop();xt=s(Z,Pe,xt)}for(xt=-1;++xt<Z.length;){const Pe=t[Z[xt][0]];Oz.call(Pe,Z[xt][1].type)&&Pe[Z[xt][1].type].call(Object.assign({sliceSerialize:Z[xt][2].sliceSerialize},Ae),Z[xt][1])}if(Ae.tokenStack.length>0){const Pe=Ae.tokenStack[Ae.tokenStack.length-1];(Pe[1]||JO).call(Ae,void 0,Pe[0])}for(ue.position={start:Mo(Z.length>0?Z[0][1].start:{line:1,column:1,offset:0}),end:Mo(Z.length>0?Z[Z.length-2][1].end:{line:1,column:1,offset:0})},xt=-1;++xt<t.transforms.length;)ue=t.transforms[xt](ue)||ue;return ue}function s(Z,ue,Ae){let Ce=ue-1,xt=-1,Pe=!1,da,Nr,mu,Ed;for(;++Ce<=Ae;){const Hr=Z[Ce];switch(Hr[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Hr[0]==="enter"?xt++:xt--,Ed=void 0;break}case"lineEndingBlank":{Hr[0]==="enter"&&(da&&!Ed&&!xt&&!mu&&(mu=Ce),Ed=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ed=void 0}if(!xt&&Hr[0]==="enter"&&Hr[1].type==="listItemPrefix"||xt===-1&&Hr[0]==="exit"&&(Hr[1].type==="listUnordered"||Hr[1].type==="listOrdered")){if(da){let pu=Ce;for(Nr=void 0;pu--;){const Ha=Z[pu];if(Ha[1].type==="lineEnding"||Ha[1].type==="lineEndingBlank"){if(Ha[0]==="exit")continue;Nr&&(Z[Nr][1].type="lineEndingBlank",Pe=!0),Ha[1].type="lineEnding",Nr=pu}else if(!(Ha[1].type==="linePrefix"||Ha[1].type==="blockQuotePrefix"||Ha[1].type==="blockQuotePrefixWhitespace"||Ha[1].type==="blockQuoteMarker"||Ha[1].type==="listItemIndent"))break}mu&&(!Nr||mu<Nr)&&(da._spread=!0),da.end=Object.assign({},Nr?Z[Nr][1].start:Hr[1].end),Z.splice(Nr||Ce,0,["exit",da,Hr[2]]),Ce++,Ae++}if(Hr[1].type==="listItemPrefix"){const pu={type:"listItem",_spread:!1,start:Object.assign({},Hr[1].start),end:void 0};da=pu,Z.splice(Ce,0,["enter",pu,Hr[2]]),Ce++,Ae++,mu=void 0,Ed=!0}}}return Z[ue][1]._spread=Pe,Ae}function a(Z,ue){return Ae;function Ae(Ce){i.call(this,Z(Ce),Ce),ue&&ue.call(this,Ce)}}function o(){this.stack.push({type:"fragment",children:[]})}function i(Z,ue,Ae){this.stack[this.stack.length-1].children.push(Z),this.stack.push(Z),this.tokenStack.push([ue,Ae||void 0]),Z.position={start:Mo(ue.start),end:void 0}}function c(Z){return ue;function ue(Ae){Z&&Z.call(this,Ae),u.call(this,Ae)}}function u(Z,ue){const Ae=this.stack.pop(),Ce=this.tokenStack.pop();if(Ce)Ce[0].type!==Z.type&&(ue?ue.call(this,Z,Ce[0]):(Ce[1]||JO).call(this,Z,Ce[0]));else throw new Error("Cannot close `"+Z.type+"` ("+Zh({start:Z.start,end:Z.end})+"): it’s not open");Ae.position.end=Mo(Z.end)}function l(){return AC(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(Z){if(this.data.expectingFirstListItemValue){const ue=this.stack[this.stack.length-2];ue.start=Number.parseInt(this.sliceSerialize(Z),10),this.data.expectingFirstListItemValue=void 0}}function f(){const Z=this.resume(),ue=this.stack[this.stack.length-1];ue.lang=Z}function p(){const Z=this.resume(),ue=this.stack[this.stack.length-1];ue.meta=Z}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const Z=this.resume(),ue=this.stack[this.stack.length-1];ue.value=Z.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const Z=this.resume(),ue=this.stack[this.stack.length-1];ue.value=Z.replace(/(\r?\n|\r)$/g,"")}function y(Z){const ue=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=ue,Ae.identifier=Ys(this.sliceSerialize(Z)).toLowerCase()}function _(){const Z=this.resume(),ue=this.stack[this.stack.length-1];ue.title=Z}function S(){const Z=this.resume(),ue=this.stack[this.stack.length-1];ue.url=Z}function w(Z){const ue=this.stack[this.stack.length-1];if(!ue.depth){const Ae=this.sliceSerialize(Z).length;ue.depth=Ae}}function v(){this.data.setextHeadingSlurpLineEnding=!0}function C(Z){const ue=this.stack[this.stack.length-1];ue.depth=this.sliceSerialize(Z).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function R(Z){const Ae=this.stack[this.stack.length-1].children;let Ce=Ae[Ae.length-1];(!Ce||Ce.type!=="text")&&(Ce=Os(),Ce.position={start:Mo(Z.start),end:void 0},Ae.push(Ce)),this.stack.push(Ce)}function N(Z){const ue=this.stack.pop();ue.value+=this.sliceSerialize(Z),ue.position.end=Mo(Z.end)}function z(Z){const ue=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ae=ue.children[ue.children.length-1];Ae.position.end=Mo(Z.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ue.type)&&(R.call(this,Z),N.call(this,Z))}function V(){this.data.atHardBreak=!0}function ne(){const Z=this.resume(),ue=this.stack[this.stack.length-1];ue.value=Z}function J(){const Z=this.resume(),ue=this.stack[this.stack.length-1];ue.value=Z}function te(){const Z=this.resume(),ue=this.stack[this.stack.length-1];ue.value=Z}function se(){const Z=this.stack[this.stack.length-1];if(this.data.inReference){const ue=this.data.referenceType||"shortcut";Z.type+="Reference",Z.referenceType=ue,delete Z.url,delete Z.title}else delete Z.identifier,delete Z.label;this.data.referenceType=void 0}function oe(){const Z=this.stack[this.stack.length-1];if(this.data.inReference){const ue=this.data.referenceType||"shortcut";Z.type+="Reference",Z.referenceType=ue,delete Z.url,delete Z.title}else delete Z.identifier,delete Z.label;this.data.referenceType=void 0}function me(Z){const ue=this.sliceSerialize(Z),Ae=this.stack[this.stack.length-2];Ae.label=nIe(ue),Ae.identifier=Ys(ue).toLowerCase()}function Xe(){const Z=this.stack[this.stack.length-1],ue=this.resume(),Ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ae.type==="link"){const Ce=Z.children;Ae.children=Ce}else Ae.alt=ue}function T(){const Z=this.resume(),ue=this.stack[this.stack.length-1];ue.url=Z}function q(){const Z=this.resume(),ue=this.stack[this.stack.length-1];ue.title=Z}function X(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function P(Z){const ue=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=ue,Ae.identifier=Ys(this.sliceSerialize(Z)).toLowerCase(),this.data.referenceType="full"}function D(Z){this.data.characterReferenceType=Z.type}function Y(Z){const ue=this.sliceSerialize(Z),Ae=this.data.characterReferenceType;let Ce;Ae?(Ce=nz(ue,Ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ce=RC(ue);const xt=this.stack[this.stack.length-1];xt.value+=Ce}function ke(Z){const ue=this.stack.pop();ue.position.end=Mo(Z.end)}function ye(Z){N.call(this,Z);const ue=this.stack[this.stack.length-1];ue.url=this.sliceSerialize(Z)}function we(Z){N.call(this,Z);const ue=this.stack[this.stack.length-1];ue.url="mailto:"+this.sliceSerialize(Z)}function Oe(){return{type:"blockquote",children:[]}}function G(){return{type:"code",lang:null,meta:null,value:""}}function W(){return{type:"inlineCode",value:""}}function ae(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ce(){return{type:"emphasis",children:[]}}function _e(){return{type:"heading",depth:0,children:[]}}function Re(){return{type:"break"}}function H(){return{type:"html",value:""}}function ie(){return{type:"image",title:null,url:"",alt:null}}function Se(){return{type:"link",title:null,url:"",children:[]}}function $e(Z){return{type:"list",ordered:Z.type==="listOrdered",start:null,spread:Z._spread,children:[]}}function Je(Z){return{type:"listItem",spread:Z._spread,checked:null,children:[]}}function Gn(){return{type:"paragraph",children:[]}}function hn(){return{type:"strong",children:[]}}function Os(){return{type:"text",value:""}}function Ur(){return{type:"thematicBreak"}}}function Mo(e){return{line:e.line,column:e.column,offset:e.offset}}function Lz(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Lz(e,r):EPe(e,r)}}function EPe(e,t){let n;for(n in t)if(Oz.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 JO(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Zh({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Zh({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Zh({start:t.start,end:t.end})+") is still open")}function TPe(e){const t=this;t.parser=n;function n(r){return wPe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function CPe(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 IPe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
242
|
+
`}]}function APe(e,t){const n=t.value?t.value+`
|
|
243
|
+
`:"",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 NPe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function RPe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function PPe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Sd(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 OPe(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 LPe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function $z(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 $Pe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return $z(e,t);const s={src:Sd(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 MPe(e,t){const n={src:Sd(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 jPe(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 DPe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return $z(e,t);const s={href:Sd(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 FPe(e,t){const n={href:Sd(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 BPe(e,t,n){const r=e.all(t),s=n?zPe(n):Mz(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:`
|
|
244
|
+
`}),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:`
|
|
245
|
+
`});const u={type:"element",tagName:"li",properties:a,children:o};return e.patch(t,u),e.applyData(t,u)}function zPe(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=Mz(n[r])}return t}function Mz(e){const t=e.spread;return t??e.children.length>1}function UPe(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 HPe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qPe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function VPe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function GPe(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=za(t.children[1]),c=tk(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 KPe(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={},f=o?o[c]:void 0;f&&(h.align=f);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 WPe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const QO=9,XO=32;function YPe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const a=[];for(;r;)a.push(ZO(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return a.push(ZO(t.slice(s),s>0,!1)),a.join("")}function ZO(e,t,n){let r=0,s=e.length;if(t){let a=e.codePointAt(r);for(;a===QO||a===XO;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(s-1);for(;a===QO||a===XO;)s--,a=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function JPe(e,t){const n={type:"text",value:YPe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function QPe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const XPe={blockquote:CPe,break:IPe,code:APe,delete:NPe,emphasis:RPe,footnoteReference:PPe,heading:OPe,html:LPe,imageReference:$Pe,image:MPe,inlineCode:jPe,linkReference:DPe,link:FPe,listItem:BPe,list:UPe,paragraph:HPe,root:qPe,strong:VPe,table:GPe,tableCell:WPe,tableRow:KPe,text:JPe,thematicBreak:QPe,toml:_g,yaml:_g,definition:_g,footnoteDefinition:_g};function _g(){}function ZPe(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 eOe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function tOe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||ZPe,r=e.options.footnoteBackLabel||eOe,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=Sd(d.toLowerCase());let f=0;const p=[],x=e.footnoteCounts.get(d);for(;x!==void 0&&++f<=x;){p.length>0&&p.push({type:"text",value:" "});let y=typeof n=="string"?n:n(c,f);typeof y=="string"&&(y={type:"text",value:y}),p.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,f),className:["data-footnote-backref"]},children:Array.isArray(y)?y:[y]})}const g=l[l.length-1];if(g&&g.type==="element"&&g.tagName==="p"){const y=g.children[g.children.length-1];y&&y.type==="text"?y.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:{...Gc(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
246
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(i,!0)},{type:"text",value:`
|
|
247
|
+
`}]}}const Aw={}.hasOwnProperty,nOe={};function rOe(e,t){const n=t||nOe,r=new Map,s=new Map,a=new Map,o={...XPe,...n.handlers},i={all:u,applyData:aOe,definitionById:r,footnoteById:s,footnoteCounts:a,footnoteOrder:[],handlers:o,one:c,options:n,patch:sOe,wrap:iOe};return Pa(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,f=i.handlers[h];if(Aw.call(i.handlers,h)&&f)return f(i,l,d);if(i.options.passThrough&&i.options.passThrough.includes(h)){if("children"in l){const{children:x,...g}=l,b=Gc(g);return b.children=i.all(l),b}return Gc(l)}return(i.options.unknownHandler||oOe)(i,l,d)}function u(l){const d=[];if("children"in l){const h=l.children;let f=-1;for(;++f<h.length;){const p=i.one(h[f],l);if(p){if(f&&h[f-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=e3(p.value)),!Array.isArray(p)&&p.type==="element")){const x=p.children[0];x&&x.type==="text"&&(x.value=e3(x.value))}Array.isArray(p)?d.push(...p):d.push(p)}}}return d}}function sOe(e,t){e.position&&(t.position=R9(e))}function aOe(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,Gc(a)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function oOe(e,t){const n=t.data||{},r="value"in t&&!(Aw.call(n,"hProperties")||Aw.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 iOe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
248
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
249
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
250
|
+
`}),n}function e3(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function t3(e,t){const n=rOe(e,t),r=n.one(e,void 0),s=tOe(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:`
|
|
251
|
+
`},s),a}function cOe(e,t){return e&&"run"in e?async function(n,r){const s=t3(n,{file:r,...t});await e.run(s,r)}:function(n,r){return t3(n,{file:r,...e||t})}}function n3(e){if(e)throw e}var Wx,r3;function uOe(){if(r3)return Wx;r3=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 Wx=function c(){var u,l,d,h,f,p,x=arguments[0],g=1,b=arguments.length,y=!1;for(typeof x=="boolean"&&(y=x,x=arguments[1]||{},g=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});g<b;++g)if(u=arguments[g],u!=null)for(l in u)d=i(x,l),h=i(u,l),x!==h&&(y&&h&&(a(h)||(f=s(h)))?(f?(f=!1,p=d&&s(d)?d:[]):p=d&&a(d)?d:{},o(x,{name:l,newValue:c(y,p,h)})):typeof h<"u"&&o(x,{name:l,newValue:h}));return x},Wx}var lOe=uOe();const Yx=W0(lOe);function Nw(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 dOe(){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?hOe(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 hOe(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 ba={basename:fOe,dirname:mOe,extname:pOe,join:gOe,sep:"/"};function fOe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Wm(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 mOe(e){if(Wm(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 pOe(e){Wm(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 gOe(...e){let t=-1,n;for(;++t<e.length;)Wm(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":bOe(n)}function bOe(e){Wm(e);const t=e.codePointAt(0)===47;let n=yOe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function yOe(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 Wm(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const kOe={cwd:xOe};function xOe(){return"/"}function Rw(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function _Oe(e){if(typeof e=="string")e=new URL(e);else if(!Rw(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 vOe(e)}function vOe(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 Jx=["history","path","basename","stem","extname","dirname"];class wOe{constructor(t){let n;t?Rw(t)?n={path:t}:typeof t=="string"||SOe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":kOe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Jx.length;){const a=Jx[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)Jx.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?ba.basename(this.path):void 0}set basename(t){Xx(t,"basename"),Qx(t,"basename"),this.path=ba.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ba.dirname(this.path):void 0}set dirname(t){s3(this.basename,"dirname"),this.path=ba.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ba.extname(this.path):void 0}set extname(t){if(Qx(t,"extname"),s3(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=ba.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Rw(t)&&(t=_Oe(t)),Xx(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ba.basename(this.path,this.extname):void 0}set stem(t){Xx(t,"stem"),Qx(t,"stem"),this.path=ba.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 mr(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 Qx(e,t){if(e&&e.includes(ba.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ba.sep+"`")}function Xx(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function s3(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function SOe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const EOe=(function(e){const r=this.constructor.prototype,s=r[e],a=function(){return s.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),TOe={}.hasOwnProperty;class FC extends EOe{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=dOe()}copy(){const t=new FC;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Yx(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(t_("data",this.frozen),this.namespace[t]=n,this):TOe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(t_("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=vg(t),r=this.parser||this.Parser;return Zx("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Zx("process",this.parser||this.Parser),e_("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(a,o){const i=vg(t),c=r.parse(i);r.run(c,i,function(l,d,h){if(l||!d||!h)return u(l);const f=d,p=r.stringify(f,h);AOe(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(),Zx("processSync",this.parser||this.Parser),e_("processSync",this.compiler||this.Compiler),this.process(t,s),o3("processSync","process",n),r;function s(a,o){n=!0,n3(a),r=o}}run(t,n,r){a3(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=vg(n);s.run(t,c,u);function u(l,d,h){const f=d||t;l?i(l):o?o(f):r(void 0,f,h)}}}runSync(t,n){let r=!1,s;return this.run(t,n,a),o3("runSync","run",r),s;function a(o,i){n3(o),s=i,r=!0}}stringify(t,n){this.freeze();const r=vg(n),s=this.compiler||this.Compiler;return e_("stringify",s),a3(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(t_("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=Yx(!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[f,...p]=l;const x=r[h][1];Nw(x)&&Nw(f)&&(f=Yx(!0,x,f)),r[h]=[u,f,...p]}}}}const COe=new FC().freeze();function Zx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function e_(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function t_(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 a3(e){if(!Nw(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function o3(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function vg(e){return IOe(e)?e:new wOe(e)}function IOe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function AOe(e){return typeof e=="string"||NOe(e)}function NOe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function BC(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var hu=BC();function jz(e){hu=e}var sc={exec:()=>null};function bt(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(Tr.caret,"$1"),n=n.replace(s,o),r},getRegex:()=>new RegExp(n,t)};return r}var ROe=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Tr={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)}}>`)},POe=/^(?:[ \t]*(?:\n|$))+/,OOe=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,LOe=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ym=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,$Oe=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,zC=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Dz=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Fz=bt(Dz).replace(/bull/g,zC).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(),MOe=bt(Dz).replace(/bull/g,zC).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(),UC=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,jOe=/^[^\n]+/,HC=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,DOe=bt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",HC).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),FOe=bt(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,zC).getRegex(),ak="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",qC=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,BOe=bt("^ {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",qC).replace("tag",ak).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Bz=bt(UC).replace("hr",Ym).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",ak).getRegex(),zOe=bt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Bz).getRegex(),VC={blockquote:zOe,code:OOe,def:DOe,fences:LOe,heading:$Oe,hr:Ym,html:BOe,lheading:Fz,list:FOe,newline:POe,paragraph:Bz,table:sc,text:jOe},i3=bt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ym).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",ak).getRegex(),UOe={...VC,lheading:MOe,table:i3,paragraph:bt(UC).replace("hr",Ym).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",i3).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",ak).getRegex()},HOe={...VC,html:bt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",qC).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:sc,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:bt(UC).replace("hr",Ym).replace("heading",` *#{1,6} *[^
|
|
252
|
+
]`).replace("lheading",Fz).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},qOe=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,VOe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,zz=/^( {2,}|\\)\n(?!\s*$)/,GOe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ok=/[\p{P}\p{S}]/u,GC=/[\s\p{P}\p{S}]/u,Uz=/[^\s\p{P}\p{S}]/u,KOe=bt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,GC).getRegex(),Hz=/(?!~)[\p{P}\p{S}]/u,WOe=/(?!~)[\s\p{P}\p{S}]/u,YOe=/(?:[^\s\p{P}\p{S}]|~)/u,qz=/(?![*_])[\p{P}\p{S}]/u,JOe=/(?![*_])[\s\p{P}\p{S}]/u,QOe=/(?:[^\s\p{P}\p{S}]|[*_])/u,XOe=bt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ROe?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Vz=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ZOe=bt(Vz,"u").replace(/punct/g,ok).getRegex(),e3e=bt(Vz,"u").replace(/punct/g,Hz).getRegex(),Gz="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",t3e=bt(Gz,"gu").replace(/notPunctSpace/g,Uz).replace(/punctSpace/g,GC).replace(/punct/g,ok).getRegex(),n3e=bt(Gz,"gu").replace(/notPunctSpace/g,YOe).replace(/punctSpace/g,WOe).replace(/punct/g,Hz).getRegex(),r3e=bt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Uz).replace(/punctSpace/g,GC).replace(/punct/g,ok).getRegex(),s3e=bt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,qz).getRegex(),a3e="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",o3e=bt(a3e,"gu").replace(/notPunctSpace/g,QOe).replace(/punctSpace/g,JOe).replace(/punct/g,qz).getRegex(),i3e=bt(/\\(punct)/,"gu").replace(/punct/g,ok).getRegex(),c3e=bt(/^<(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(),u3e=bt(qC).replace("(?:-->|$)","-->").getRegex(),l3e=bt("^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",u3e).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),q0=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,d3e=bt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",q0).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Kz=bt(/^!?\[(label)\]\[(ref)\]/).replace("label",q0).replace("ref",HC).getRegex(),Wz=bt(/^!?\[(ref)\](?:\[\])?/).replace("ref",HC).getRegex(),h3e=bt("reflink|nolink(?!\\()","g").replace("reflink",Kz).replace("nolink",Wz).getRegex(),c3=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,KC={_backpedal:sc,anyPunctuation:i3e,autolink:c3e,blockSkip:XOe,br:zz,code:VOe,del:sc,delLDelim:sc,delRDelim:sc,emStrongLDelim:ZOe,emStrongRDelimAst:t3e,emStrongRDelimUnd:r3e,escape:qOe,link:d3e,nolink:Wz,punctuation:KOe,reflink:Kz,reflinkSearch:h3e,tag:l3e,text:GOe,url:sc},f3e={...KC,link:bt(/^!?\[(label)\]\((.*?)\)/).replace("label",q0).getRegex(),reflink:bt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",q0).getRegex()},Pw={...KC,emStrongRDelimAst:n3e,emStrongLDelim:e3e,delLDelim:s3e,delRDelim:o3e,url:bt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",c3).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:bt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",c3).getRegex()},m3e={...Pw,br:bt(zz).replace("{2,}","*").getRegex(),text:bt(Pw.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},wg={normal:VC,gfm:UOe,pedantic:HOe},th={normal:KC,gfm:Pw,breaks:m3e,pedantic:f3e},p3e={"&":"&","<":"<",">":">",'"':""","'":"'"},u3=e=>p3e[e];function ga(e,t){if(t){if(Tr.escapeTest.test(e))return e.replace(Tr.escapeReplace,u3)}else if(Tr.escapeTestNoEncode.test(e))return e.replace(Tr.escapeReplaceNoEncode,u3);return e}function l3(e){try{e=encodeURI(e).replace(Tr.percentDecode,"%")}catch{return null}return e}function d3(e,t){let n=e.replace(Tr.findPipe,(a,o,i)=>{let c=!1,u=o;for(;--u>=0&&i[u]==="\\";)c=!c;return c?"|":" |"}),r=n.split(Tr.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(Tr.slashPipe,"|");return r}function nh(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 g3e(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 b3e(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 h3(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 y3e(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let s=r[1];return t.split(`
|
|
253
|
+
`).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(`
|
|
254
|
+
`)}var V0=class{options;rules;lexer;constructor(e){this.options=e||hu}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:nh(n,`
|
|
255
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=y3e(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=nh(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:nh(t[0],`
|
|
256
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=nh(t[0],`
|
|
257
|
+
`).split(`
|
|
258
|
+
`),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(`
|
|
259
|
+
`),l=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
260
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
261
|
+
${u}`:u,s=s?`${s}
|
|
262
|
+
${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 f=h,p=f.raw+`
|
|
263
|
+
`+n.join(`
|
|
264
|
+
`),x=this.blockquote(p);a[a.length-1]=x,r=r.substring(0,r.length-f.raw.length)+x.raw,s=s.substring(0,s.length-f.text.length)+x.text;break}else if(h?.type==="list"){let f=h,p=f.raw+`
|
|
265
|
+
`+n.join(`
|
|
266
|
+
`),x=this.list(p);a[a.length-1]=x,r=r.substring(0,r.length-h.raw.length)+x.raw,s=s.substring(0,s.length-f.raw.length)+x.raw,n=p.substring(a.at(-1).raw.length).split(`
|
|
267
|
+
`);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=b3e(t[2].split(`
|
|
268
|
+
`,1)[0],t[1].length),h=e.split(`
|
|
269
|
+
`,1)[0],f=!d.trim(),p=0;if(this.options.pedantic?(p=2,l=d.trimStart()):f?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),f&&this.rules.other.blankLine.test(h)&&(u+=h+`
|
|
270
|
+
`,e=e.substring(h.length+1),c=!0),!c){let x=this.rules.other.nextBulletRegex(p),g=this.rules.other.hrRegex(p),b=this.rules.other.fencesBeginRegex(p),y=this.rules.other.headingBeginRegex(p),_=this.rules.other.htmlBeginRegex(p),S=this.rules.other.blockquoteBeginRegex(p);for(;e;){let w=e.split(`
|
|
271
|
+
`,1)[0],v;if(h=w,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),v=h):v=h.replace(this.rules.other.tabCharGlobal," "),b.test(h)||y.test(h)||_.test(h)||S.test(h)||x.test(h)||g.test(h))break;if(v.search(this.rules.other.nonSpaceChar)>=p||!h.trim())l+=`
|
|
272
|
+
`+v.slice(p);else{if(f||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||b.test(d)||y.test(d)||g.test(d))break;l+=`
|
|
273
|
+
`+h}f=!h.trim(),u+=w+`
|
|
274
|
+
`,e=e.substring(w.length+1),d=v.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=d3(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
275
|
+
`):[],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(d3(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)===`
|
|
276
|
+
`?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=nh(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=g3e(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)),h3(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 h3(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 f=d.slice(1,-1);return{type:"em",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}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}}}},ks=class Ow{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||hu,this.options.tokenizer=this.options.tokenizer||new V0,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:Tr,block:wg.normal,inline:th.normal};this.options.pedantic?(n.block=wg.pedantic,n.inline=th.pedantic):this.options.gfm&&(n.block=wg.gfm,this.options.breaks?n.inline=th.breaks:n.inline=th.gfm),this.tokenizer.rules=n}static get rules(){return{block:wg,inline:th}}static lex(t,n){return new Ow(n).lex(t)}static lexInline(t,n){return new Ow(n).inlineTokens(t)}lex(t){t=t.replace(Tr.carriageReturn,`
|
|
277
|
+
`),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(Tr.tabCharGlobal," ").replace(Tr.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+=`
|
|
278
|
+
`: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(`
|
|
279
|
+
`)?"":`
|
|
280
|
+
`)+s.raw,o.text+=`
|
|
281
|
+
`+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(`
|
|
282
|
+
`)?"":`
|
|
283
|
+
`)+s.raw,o.text+=`
|
|
284
|
+
`+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(`
|
|
285
|
+
`)?"":`
|
|
286
|
+
`)+s.raw,o.text+=`
|
|
287
|
+
`+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(`
|
|
288
|
+
`)?"":`
|
|
289
|
+
`)+s.raw,o.text+=`
|
|
290
|
+
`+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(f=>{h=f.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}},G0=class{options;parser;constructor(t){this.options=t||hu}space(t){return""}code({text:t,lang:n,escaped:r}){let s=(n||"").match(Tr.notSpaceStart)?.[0],a=t.replace(Tr.endingNewline,"")+`
|
|
291
|
+
`;return s?'<pre><code class="language-'+ga(s)+'">'+(r?a:ga(a,!0))+`</code></pre>
|
|
292
|
+
`:"<pre><code>"+(r?a:ga(a,!0))+`</code></pre>
|
|
293
|
+
`}blockquote({tokens:t}){return`<blockquote>
|
|
294
|
+
${this.parser.parse(t)}</blockquote>
|
|
295
|
+
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:n}){return`<h${n}>${this.parser.parseInline(t)}</h${n}>
|
|
296
|
+
`}hr(t){return`<hr>
|
|
297
|
+
`}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+`>
|
|
298
|
+
`+s+"</"+a+`>
|
|
299
|
+
`}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
|
|
300
|
+
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
301
|
+
`}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>
|
|
302
|
+
<thead>
|
|
303
|
+
`+n+`</thead>
|
|
304
|
+
`+s+`</table>
|
|
305
|
+
`}tablerow({text:t}){return`<tr>
|
|
306
|
+
${t}</tr>
|
|
307
|
+
`}tablecell(t){let n=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+n+`</${r}>
|
|
308
|
+
`}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>${ga(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=l3(t);if(a===null)return s;t=a;let o='<a href="'+t+'"';return n&&(o+=' title="'+ga(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=l3(t);if(a===null)return ga(r);t=a;let o=`<img src="${t}" alt="${ga(r)}"`;return n&&(o+=` title="${ga(n)}"`),o+=">",o}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:ga(t.text)}},WC=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}},Fs=class Lw{options;renderer;textRenderer;constructor(t){this.options=t||hu,this.options.renderer=this.options.renderer||new G0,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new WC}static parse(t,n){return new Lw(n).parse(t)}static parseInline(t,n){return new Lw(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}},xh=class{options;block;constructor(e){this.options=e||hu}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?ks.lex:ks.lexInline}provideParser(){return this.block?Fs.parse:Fs.parseInline}},k3e=class{defaults=BC();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Fs;Renderer=G0;TextRenderer=WC;Lexer=ks;Tokenizer=V0;Hooks=xh;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 G0(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 V0(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 xh;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];xh.passThroughHooks.has(o)?a[i]=l=>{if(this.defaults.async&&xh.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 ks.lex(t,n??this.defaults)}parser(t,n){return Fs.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?ks.lex:ks.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?Fs.parse:Fs.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?ks.lex:ks.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?Fs.parse:Fs.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+=`
|
|
309
|
+
Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+ga(r.message+"",!0)+"</pre>";return n?Promise.resolve(s):s}if(n)return Promise.reject(r);throw r}}},Wc=new k3e;function Ot(e,t){return Wc.parse(e,t)}Ot.options=Ot.setOptions=function(e){return Wc.setOptions(e),Ot.defaults=Wc.defaults,jz(Ot.defaults),Ot};Ot.getDefaults=BC;Ot.defaults=hu;Ot.use=function(...e){return Wc.use(...e),Ot.defaults=Wc.defaults,jz(Ot.defaults),Ot};Ot.walkTokens=function(e,t){return Wc.walkTokens(e,t)};Ot.parseInline=Wc.parseInline;Ot.Parser=Fs;Ot.parser=Fs.parse;Ot.Renderer=G0;Ot.TextRenderer=WC;Ot.Lexer=ks;Ot.lexer=ks.lex;Ot.Tokenizer=V0;Ot.Hooks=xh;Ot.parse=Ot;Ot.options;Ot.setOptions;Ot.use;Ot.walkTokens;Ot.parseInline;Fs.parse;ks.lex;var x3e=300,_3e="300px",v3e=500;function w3e(e={}){let{immediate:t=!1,debounceDelay:n=x3e,rootMargin:r=_3e,idleTimeout:s=v3e}=e,[a,o]=O.useState(!1),i=O.useRef(null),c=O.useRef(null),u=O.useRef(null),l=O.useMemo(()=>f=>{let p=Date.now();return window.setTimeout(()=>{f({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-p))})},1)},[]),d=O.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(f,p)=>window.requestIdleCallback(f,p):l,[l]),h=O.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?f=>window.cancelIdleCallback(f):f=>{clearTimeout(f)},[]);return O.useEffect(()=>{if(t){o(!0);return}let f=i.current;if(!f)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)},x=_=>{u.current=d(S=>{S.timeRemaining()>0||S.didTimeout?(o(!0),_.disconnect()):u.current=d(()=>{o(!0),_.disconnect()},{timeout:s/2})},{timeout:s})},g=_=>{p(),c.current=window.setTimeout(()=>{var S,w;let v=_.takeRecords();(v.length===0||(w=(S=v.at(-1))==null?void 0:S.isIntersecting)!=null&&w)&&x(_)},n)},b=(_,S)=>{_.isIntersecting?g(S):p()},y=new IntersectionObserver(_=>{for(let S of _)b(S,y)},{rootMargin:r,threshold:0});return y.observe(f),()=>{c.current&&clearTimeout(c.current),u.current&&h(u.current),y.disconnect()}},[t,n,r,s,h,d]),{shouldRender:a,containerRef:i}}var Yz=/\s/,S3e=/^\s+$/,E3e=new Set(["code","pre","svg","math","annotation"]),T3e=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",C3e=e=>e.some(t=>T3e(t)&&E3e.has(t.tagName)),I3e=e=>{let t=[],n="",r=!1;for(let s of e){let a=Yz.test(s);a!==r&&n&&(t.push(n),n=""),n+=s,r=a}return n&&t.push(n),t},A3e=e=>{let t=[],n="";for(let r of e)Yz.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},N3e=(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}]}),R3e=(e,t,n,r,s)=>{let a=t.at(-1);if(!(a&&"children"in a))return;if(C3e(t))return Wu;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"?A3e(c):I3e(c),l=r.prevContentLength,d=u.map(h=>{let f=s.count;if(s.count+=h.length,S3e.test(h))return{type:"text",value:h};let p=l>0&&f<l;return N3e(h,n.animation,n.duration,n.easing,p)});return o.children.splice(i,1,...d),i+d.length},P3e=0;function $w(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=P3e++,c=()=>u=>{let l={count:0};bC(u,"text",(d,h)=>R3e(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}}}$w();var Jz=O.createContext(!1),O3e=()=>O.useContext(Jz),YC=(...e)=>QT(D1(e)),L3e=(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(" ")},$3e=e=>e?(...t)=>L3e(e,QT(D1(t))):YC,dl=(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)},Mw=O.createContext(YC),it=()=>O.useContext(Mw),M3e=YC("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"),j3e=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},D3e=O.memo(({children:e,result:t,language:n,className:r,startLine:s,...a})=>{let o=it(),i=O.useMemo(()=>o(M3e),[o]),c=O.useMemo(()=>{let u={};return t.bg&&(u["--sdm-bg"]=t.bg),t.fg&&(u["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(u,j3e(t.rootStyle)),u},[t.bg,t.fg,t.rootStyle]);return m.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:m.jsx("pre",{className:o(r,"bg-[var(--sdm-bg,inherit]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]"),style:c,children:m.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)=>m.jsx("span",{className:i,children:u.length===0||u.length===1&&u[0].content===""?`
|
|
310
|
+
`:u.map((d,h)=>{let f={},p=!!d.bgColor;if(d.color&&(f["--sdm-c"]=d.color),d.bgColor&&(f["--sdm-tbg"]=d.bgColor),d.htmlStyle)for(let[x,g]of Object.entries(d.htmlStyle))x==="color"?f["--sdm-c"]=g:x==="background-color"?(f["--sdm-tbg"]=g,p=!0):f[x]=g;return m.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:f,...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),F3e=({className:e,language:t,style:n,isIncomplete:r,...s})=>{let a=it();return m.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})},Qz=O.createContext({code:""}),Xz=()=>O.useContext(Qz),B3e=({language:e})=>{let t=it();return m.jsx("div",{className:t("flex h-8 items-center text-muted-foreground text-xs"),"data-language":e,"data-streamdown":"code-block-header",children:m.jsx("span",{className:t("ml-1 font-mono lowercase"),children:e})})},z3e=/\n+$/,U3e=O.lazy(()=>ft(()=>import("./highlighted-body-TPN3WLV5-DYg1rqdL.js"),__vite__mapDeps([18,19])).then(e=>({default:e.HighlightedCodeBlockBody}))),H3e=({code:e,language:t,className:n,children:r,isIncomplete:s=!1,startLine:a,...o})=>{let i=it(),c=O.useMemo(()=>e.replace(z3e,""),[e]),u=O.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:c.split(`
|
|
311
|
+
`).map(l=>[{content:l,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[c]);return m.jsx(Qz.Provider,{value:{code:e},children:m.jsxs(F3e,{isIncomplete:s,language:t,children:[m.jsx(B3e,{language:t}),r?m.jsx("div",{className:i("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:m.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,m.jsx(O.Suspense,{fallback:m.jsx(D3e,{className:n,language:t,result:u,startLine:a,...o}),children:m.jsx(U3e,{className:n,code:c,language:t,raw:u,startLine:a,...o})})]})})},q3e=e=>m.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.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"})}),V3e=e=>m.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.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"})}),G3e=e=>m.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.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"})}),K3e=e=>m.jsxs("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[m.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),W3e=e=>m.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.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"})}),Y3e=e=>m.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.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"})}),J3e=e=>m.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.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"})}),Q3e=e=>m.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.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"})}),X3e=e=>m.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.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"})}),Z3e=e=>m.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.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"})}),_h={CheckIcon:q3e,CopyIcon:V3e,DownloadIcon:G3e,ExternalLinkIcon:Q3e,Loader2Icon:K3e,Maximize2Icon:W3e,RotateCcwIcon:Y3e,XIcon:J3e,ZoomInIcon:X3e,ZoomOutIcon:Z3e},Zz=O.createContext(_h),eLe=(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])},f3=({icons:e,children:t})=>{let n=O.useRef(e),r=O.useRef(e?{..._h,...e}:_h);eLe(n.current,e)||(n.current=e,r.current=e?{..._h,...e}:_h);let s=r.current;return m.jsx(Zz.Provider,{value:s,children:t})},la=()=>O.useContext(Zz),eU={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"},jw=O.createContext(eU),Ro=()=>O.useContext(jw),m3=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:s,code:a,...o})=>{let i=it(),[c,u]=O.useState(!1),l=O.useRef(0),{code:d}=Xz(),{isAnimating:h}=O.useContext(rs),f=Ro(),p=a??d,x=async()=>{var y;if(typeof window>"u"||!((y=navigator?.clipboard)!=null&&y.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(_){t?.(_)}};O.useEffect(()=>()=>{window.clearTimeout(l.current)},[]);let g=la(),b=c?g.CheckIcon:g.CopyIcon;return m.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:x,title:f.copyCode,type:"button",...o,children:r??m.jsx(b,{size:14})})},p3={"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"},tLe=({onDownload:e,onError:t,language:n,children:r,className:s,code:a,...o})=>{let i=it(),{code:c}=Xz(),{isAnimating:u}=O.useContext(rs),l=Ro(),d=la(),h=a??c,f=`file.${n&&n in p3?p3[n]:"txt"}`,p="text/plain",x=()=>{try{dl(f,h,p),e?.()}catch(g){t?.(g)}};return m.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:x,title:l.downloadFile,type:"button",...o,children:r??m.jsx(d.DownloadIcon,{size:14})})},g3=()=>{let{Loader2Icon:e}=la(),t=it();return m.jsxs("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[m.jsx("div",{className:t("h-[46px] w-full bg-muted/80")}),m.jsx("div",{className:t("flex w-full items-center justify-center p-4"),children:m.jsx(e,{className:t("size-4 animate-spin")})})]})},nLe=/\.[^/.]+$/,rLe=({node:e,className:t,src:n,alt:r,onLoad:s,onError:a,...o})=>{let{DownloadIcon:i}=la(),c=it(),u=O.useRef(null),[l,d]=O.useState(!1),[h,f]=O.useState(!1),p=Ro(),x=o.width!=null||o.height!=null,g=(l||x)&&!h,b=h&&!x;O.useEffect(()=>{let w=u.current;if(w!=null&&w.complete){let v=w.naturalWidth>0;d(v),f(!v)}},[]);let y=O.useCallback(w=>{d(!0),f(!1),s?.(w)},[s]),_=O.useCallback(w=>{d(!1),f(!0),a?.(w)},[a]),S=async()=>{if(n)try{let w=await(await fetch(n)).blob(),v=new URL(n,window.location.origin).pathname.split("/").pop()||"",C=v.split(".").pop(),I=v.includes(".")&&C!==void 0&&C.length<=4,R="";if(I)R=v;else{let N=w.type,z="png";N.includes("jpeg")||N.includes("jpg")?z="jpg":N.includes("png")?z="png":N.includes("svg")?z="svg":N.includes("gif")?z="gif":N.includes("webp")&&(z="webp"),R=`${(r||v||"image").replace(nLe,"")}.${z}`}dl(R,w,w.type)}catch{window.open(n,"_blank")}};return n?m.jsxs("div",{className:c("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[m.jsx("img",{alt:r,className:c("max-w-full rounded-lg",b&&"hidden",t),"data-streamdown":"image",onError:_,onLoad:y,ref:u,src:n,...o}),b&&m.jsx("span",{className:c("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:p.imageNotAvailable}),m.jsx("div",{className:c("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block")}),g&&m.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:S,title:p.downloadImage,type:"button",children:m.jsx(i,{size:14})})]}):null},ef=0,JC=()=>{ef+=1,ef===1&&(document.body.style.overflow="hidden")},QC=()=>{ef=Math.max(0,ef-1),ef===0&&(document.body.style.overflow="")},sLe=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:s,CopyIcon:a,ExternalLinkIcon:o,XIcon:i}=la(),c=it(),[u,l]=O.useState(!1),d=Ro(),h=O.useCallback(async()=>{try{await navigator.clipboard.writeText(e),l(!0),setTimeout(()=>l(!1),2e3)}catch{}},[e]),f=O.useCallback(()=>{r(),n()},[r,n]);return O.useEffect(()=>{if(t){JC();let p=x=>{x.key==="Escape"&&n()};return document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p),QC()}}},[t,n]),t?m.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:m.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:[m.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:m.jsx(i,{size:16})}),m.jsxs("div",{className:c("flex flex-col gap-2"),children:[m.jsxs("div",{className:c("flex items-center gap-2 font-semibold text-lg"),children:[m.jsx(o,{size:20}),m.jsx("span",{children:d.openExternalLink})]}),m.jsx("p",{className:c("text-muted-foreground text-sm"),children:d.externalLinkWarning})]}),m.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}),m.jsxs("div",{className:c("flex gap-2"),children:[m.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?m.jsxs(m.Fragment,{children:[m.jsx(s,{size:14}),m.jsx("span",{children:d.copied})]}):m.jsxs(m.Fragment,{children:[m.jsx(a,{size:14}),m.jsx("span",{children:d.copyLink})]})}),m.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:f,type:"button",children:[m.jsx(o,{size:14}),m.jsx("span",{children:d.openLink})]})]})]})}):null},Dw=O.createContext(null),XC=()=>O.useContext(Dw),$Me=()=>{var e;let t=XC();return(e=t?.code)!=null?e:null},ZC=()=>{var e;let t=XC();return(e=t?.mermaid)!=null?e:null},aLe=e=>{var t;let n=XC();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},oLe=(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})},iLe=({chart:e,children:t,className:n,onDownload:r,config:s,onError:a})=>{let o=it(),[i,c]=O.useState(!1),u=O.useRef(null),{isAnimating:l}=O.useContext(rs),d=la(),h=ZC(),f=Ro(),p=async x=>{try{if(x==="mmd"){dl("diagram.mmd",e,"text/plain"),c(!1),r?.(x);return}if(!h){a?.(new Error("Mermaid plugin not available"));return}let g=h.getMermaid(s),b=e.split("").reduce((S,w)=>(S<<5)-S+w.charCodeAt(0)|0,0),y=`mermaid-${Math.abs(b)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:_}=await g.render(y,e);if(!_){a?.(new Error("SVG not found. Please wait for the diagram to render."));return}if(x==="svg"){dl("diagram.svg",_,"image/svg+xml"),c(!1),r?.(x);return}if(x==="png"){let S=await oLe(_);dl("diagram.png",S,"image/png"),r?.(x),c(!1);return}}catch(g){a?.(g)}};return O.useEffect(()=>{let x=g=>{let b=g.composedPath();u.current&&!b.includes(u.current)&&c(!1)};return document.addEventListener("mousedown",x),()=>{document.removeEventListener("mousedown",x)}},[]),m.jsxs("div",{className:o("relative"),ref:u,children:[m.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:f.downloadDiagram,type:"button",children:t??m.jsx(d.DownloadIcon,{size:14})}),i?m.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:[m.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("svg"),title:f.downloadDiagramAsSvg,type:"button",children:f.mermaidFormatSvg}),m.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("png"),title:f.downloadDiagramAsPng,type:"button",children:f.mermaidFormatPng}),m.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("mmd"),title:f.downloadDiagramAsMmd,type:"button",children:f.mermaidFormatMmd})]}):null]})},cLe=({chart:e,config:t,onFullscreen:n,onExit:r,className:s,...a})=>{let{Maximize2Icon:o,XIcon:i}=la(),c=it(),[u,l]=O.useState(!1),{isAnimating:d,controls:h}=O.useContext(rs),f=Ro(),p=(()=>{if(typeof h=="boolean")return h;let g=h.mermaid;return g===!1?!1:g===!0||g===void 0?!0:g.panZoom!==!1})(),x=()=>{l(!u)};return O.useEffect(()=>{if(u){JC();let g=b=>{b.key==="Escape"&&l(!1)};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g),QC()}}},[u]),O.useEffect(()=>{u?n?.():r&&r()},[u,n,r]),m.jsxs(m.Fragment,{children:[m.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:x,title:f.viewFullscreen,type:"button",...a,children:m.jsx(o,{size:14})}),u?tS.createPortal(m.jsxs("div",{className:c("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),onClick:x,onKeyDown:g=>{g.key==="Escape"&&x()},role:"button",tabIndex:0,children:[m.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:x,title:f.exitFullscreen,type:"button",children:m.jsx(i,{size:20})}),m.jsx("div",{className:c("flex size-full items-center justify-center p-4"),onClick:g=>g.stopPropagation(),onKeyDown:g=>g.stopPropagation(),role:"presentation",children:m.jsx(OU,{chart:e,className:c("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:p})})]}),document.body):null]})},tU=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}},nU=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===`
|
|
312
|
+
`)&&(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(`
|
|
313
|
+
`)},uLe=e=>{let{headers:t,rows:n}=e,r=i=>{let c=!1;for(let l of i)if(l===" "||l===`
|
|
314
|
+
`||l==="\r"){c=!0;break}if(!c)return i;let u=[];for(let l of i)l===" "?u.push("\\t"):l===`
|
|
315
|
+
`?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(`
|
|
316
|
+
`)},n_=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("")},Fw=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=>n_(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?n_(i[u]):"";r[s]=`| ${c.join(" | ")} |`,s+=1}else{let c=i.map(u=>n_(u));r[s]=`| ${c.join(" | ")} |`,s+=1}return r.join(`
|
|
317
|
+
`)},rU=({children:e,className:t,onCopy:n,onError:r,timeout:s=2e3})=>{let a=it(),[o,i]=O.useState(!1),[c,u]=O.useState(!1),l=O.useRef(null),d=O.useRef(0),{isAnimating:h}=O.useContext(rs),f=Ro(),p=async b=>{var y,_;if(typeof window>"u"||!((y=navigator?.clipboard)!=null&&y.write)){r?.(new Error("Clipboard API not available"));return}try{let S=(_=l.current)==null?void 0:_.closest('[data-streamdown="table-wrapper"]'),w=S?.querySelector("table");if(!w){r?.(new Error("Table not found"));return}let v=tU(w),C=({csv:nU,tsv:uLe,md:Fw}[b]||Fw)(v),I=new ClipboardItem({"text/plain":new Blob([C],{type:"text/plain"}),"text/html":new Blob([w.outerHTML],{type:"text/html"})});await navigator.clipboard.write([I]),u(!0),i(!1),n?.(b),d.current=window.setTimeout(()=>u(!1),s)}catch(S){r?.(S)}};O.useEffect(()=>{let b=y=>{let _=y.composedPath();l.current&&!_.includes(l.current)&&i(!1)};return document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b),window.clearTimeout(d.current)}},[]);let x=la(),g=c?x.CheckIcon:x.CopyIcon;return m.jsxs("div",{className:a("relative"),ref:l,children:[m.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:f.copyTable,type:"button",children:e??m.jsx(g,{height:14,width:14})}),o?m.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:[m.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("md"),title:f.copyTableAsMarkdown,type:"button",children:f.tableFormatMarkdown}),m.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("csv"),title:f.copyTableAsCsv,type:"button",children:f.tableFormatCsv}),m.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("tsv"),title:f.copyTableAsTsv,type:"button",children:f.tableFormatTsv})]}):null]})},sU=({children:e,className:t,onDownload:n,onError:r})=>{let s=it(),[a,o]=O.useState(!1),i=O.useRef(null),{isAnimating:c}=O.useContext(rs),u=Ro(),l=la(),d=h=>{var f;try{let p=(f=i.current)==null?void 0:f.closest('[data-streamdown="table-wrapper"]'),x=p?.querySelector("table");if(!x){r?.(new Error("Table not found"));return}let g=tU(x),b=h==="csv"?nU(g):Fw(g);dl(`table.${h==="csv"?"csv":"md"}`,b,h==="csv"?"text/csv":"text/markdown"),o(!1),n?.(h)}catch(p){r?.(p)}};return O.useEffect(()=>{let h=f=>{let p=f.composedPath();i.current&&!p.includes(i.current)&&o(!1)};return document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}},[]),m.jsxs("div",{className:s("relative"),ref:i,children:[m.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??m.jsx(l.DownloadIcon,{size:14})}),a?m.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:[m.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}),m.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]})},lLe=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:s,XIcon:a}=la(),o=it(),[i,c]=O.useState(!1),{isAnimating:u}=O.useContext(rs),l=Ro(),d=()=>{c(!0)},h=()=>{c(!1)};return O.useEffect(()=>{if(i){JC();let f=p=>{p.key==="Escape"&&c(!1)};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f),QC()}}},[i]),m.jsxs(m.Fragment,{children:[m.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:m.jsx(s,{size:14})}),i?tS.createPortal(m.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:f=>{f.key==="Escape"&&h()},role:"dialog",children:m.jsxs("div",{className:o("flex h-full flex-col"),onClick:f=>f.stopPropagation(),onKeyDown:f=>f.stopPropagation(),role:"presentation",children:[m.jsxs("div",{className:o("flex items-center justify-end gap-1 p-4"),children:[n?m.jsx(rU,{}):null,r?m.jsx(sU,{}):null,m.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:m.jsx(a,{size:20})})]}),m.jsx("div",{className:o("flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10"),children:m.jsx("table",{className:o("w-full border-collapse border border-border"),"data-streamdown":"table",children:e})})]})}),document.body):null]})},dLe=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:s=!0,showFullscreen:a=!0,...o})=>{let i=it(),c=n&&r,u=n&&s,l=n&&a,d=c||u||l;return m.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?m.jsxs("div",{className:i("flex items-center justify-end gap-1"),children:[c?m.jsx(rU,{}):null,u?m.jsx(sU,{}):null,l?m.jsx(lLe,{showCopy:c,showDownload:u,children:e}):null]}):null,m.jsx("div",{className:i("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"),children:m.jsx("table",{className:i("w-full divide-y divide-border",t),"data-streamdown":"table",...o,children:e})})]})},hLe=/startLine=(\d+)/,fLe=O.lazy(()=>ft(()=>Promise.resolve().then(()=>G$e),void 0).then(e=>({default:e.Mermaid}))),mLe=/language-([^\s]+)/;function ik(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 tn(e,t){return e.className===t.className&&ik(e.node,t.node)}var Bw=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,r_=(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},b3=(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},Sg=(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},e2=O.memo(({children:e,className:t,node:n,...r})=>{let s=it();return m.jsx("ol",{className:s("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e})},(e,t)=>tn(e,t));e2.displayName="MarkdownOl";var aU=O.memo(({children:e,className:t,node:n,...r})=>{let s=it();return m.jsx("li",{className:s("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e})},(e,t)=>e.className===t.className&&ik(e.node,t.node));aU.displayName="MarkdownLi";var oU=O.memo(({children:e,className:t,node:n,...r})=>{let s=it();return m.jsx("ul",{className:s("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e})},(e,t)=>tn(e,t));oU.displayName="MarkdownUl";var iU=O.memo(({className:e,node:t,...n})=>{let r=it();return m.jsx("hr",{className:r("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n})},(e,t)=>tn(e,t));iU.displayName="MarkdownHr";var cU=O.memo(({children:e,className:t,node:n,...r})=>{let s=it();return m.jsx("span",{className:s("font-semibold",t),"data-streamdown":"strong",...r,children:e})},(e,t)=>tn(e,t));cU.displayName="MarkdownStrong";var pLe=({children:e,className:t,href:n,node:r,...s})=>{let a=it(),{linkSafety:o}=O.useContext(rs),[i,c]=O.useState(!1),u=n==="streamdown:incomplete-link",l=O.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=O.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),h=O.useCallback(()=>{c(!1)},[]),f={url:n??"",isOpen:i,onClose:h,onConfirm:d};return o!=null&&o.enabled&&n?m.jsxs(m.Fragment,{children:[m.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(f):m.jsx(sLe,{...f})]}):m.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})},uU=O.memo(pLe,(e,t)=>tn(e,t)&&e.href===t.href);uU.displayName="MarkdownA";var lU=O.memo(({children:e,className:t,node:n,...r})=>{let s=it();return m.jsx("h1",{className:s("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e})},(e,t)=>tn(e,t));lU.displayName="MarkdownH1";var dU=O.memo(({children:e,className:t,node:n,...r})=>{let s=it();return m.jsx("h2",{className:s("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e})},(e,t)=>tn(e,t));dU.displayName="MarkdownH2";var hU=O.memo(({children:e,className:t,node:n,...r})=>{let s=it();return m.jsx("h3",{className:s("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e})},(e,t)=>tn(e,t));hU.displayName="MarkdownH3";var fU=O.memo(({children:e,className:t,node:n,...r})=>{let s=it();return m.jsx("h4",{className:s("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e})},(e,t)=>tn(e,t));fU.displayName="MarkdownH4";var mU=O.memo(({children:e,className:t,node:n,...r})=>{let s=it();return m.jsx("h5",{className:s("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e})},(e,t)=>tn(e,t));mU.displayName="MarkdownH5";var pU=O.memo(({children:e,className:t,node:n,...r})=>{let s=it();return m.jsx("h6",{className:s("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e})},(e,t)=>tn(e,t));pU.displayName="MarkdownH6";var gU=O.memo(({children:e,className:t,node:n,...r})=>{let{controls:s}=O.useContext(rs),a=Bw(s,"table"),o=r_(s,"copy"),i=r_(s,"download"),c=r_(s,"fullscreen");return m.jsx(dLe,{className:t,showControls:a,showCopy:o,showDownload:i,showFullscreen:c,...r,children:e})},(e,t)=>tn(e,t));gU.displayName="MarkdownTable";var bU=O.memo(({children:e,className:t,node:n,...r})=>{let s=it();return m.jsx("thead",{className:s("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e})},(e,t)=>tn(e,t));bU.displayName="MarkdownThead";var yU=O.memo(({children:e,className:t,node:n,...r})=>{let s=it();return m.jsx("tbody",{className:s("divide-y divide-border",t),"data-streamdown":"table-body",...r,children:e})},(e,t)=>tn(e,t));yU.displayName="MarkdownTbody";var kU=O.memo(({children:e,className:t,node:n,...r})=>{let s=it();return m.jsx("tr",{className:s("border-border",t),"data-streamdown":"table-row",...r,children:e})},(e,t)=>tn(e,t));kU.displayName="MarkdownTr";var xU=O.memo(({children:e,className:t,node:n,...r})=>{let s=it();return m.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)=>tn(e,t));xU.displayName="MarkdownTh";var _U=O.memo(({children:e,className:t,node:n,...r})=>{let s=it();return m.jsx("td",{className:s("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e})},(e,t)=>tn(e,t));_U.displayName="MarkdownTd";var vU=O.memo(({children:e,className:t,node:n,...r})=>{let s=it();return m.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)=>tn(e,t));vU.displayName="MarkdownBlockquote";var wU=O.memo(({children:e,className:t,node:n,...r})=>{let s=it();return m.jsx("sup",{className:s("text-sm",t),"data-streamdown":"superscript",...r,children:e})},(e,t)=>tn(e,t));wU.displayName="MarkdownSup";var SU=O.memo(({children:e,className:t,node:n,...r})=>{let s=it();return m.jsx("sub",{className:s("text-sm",t),"data-streamdown":"subscript",...r,children:e})},(e,t)=>tn(e,t));SU.displayName="MarkdownSub";var EU=O.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let s=o=>{var i,c;if(!O.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(O.isValidElement(h))if(((i=h.props)==null?void 0:i["data-footnote-backref"])!==void 0)d=!0;else{let f=Array.isArray(h.props.children)?h.props.children:[h.props.children];for(let p of f){if(typeof p=="string"&&p.trim()!==""){l=!0;break}if(O.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(!O.isValidElement(o))return o;if(o.type===e2){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)?m.jsx("section",{className:t,...r,children:a}):null}return m.jsx("section",{className:t,...r,children:e})},(e,t)=>tn(e,t));EU.displayName="MarkdownSection";var gLe=({node:e,className:t,children:n,...r})=>{var s,a;let o=it(),i=!("data-block"in r),{mermaid:c,controls:u}=O.useContext(rs),l=ZC(),d=O3e(),h=t?.match(mLe),f=(s=h?.at(1))!=null?s:"",p=aLe(f);if(i)return m.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 x=(a=e?.properties)==null?void 0:a.metastring,g=x?.match(hLe),b=g?Number.parseInt(g[1],10):void 0,y=b!==void 0&&b>=1?b:void 0,_="";if(O.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?_=n.props.children:typeof n=="string"&&(_=n),p){let C=p.component;return m.jsx(O.Suspense,{fallback:m.jsx(g3,{}),children:m.jsx(C,{code:_,isIncomplete:d,language:f})})}if(f==="mermaid"&&l){let C=Bw(u,"mermaid"),I=Sg(u,"download"),R=Sg(u,"copy"),N=Sg(u,"fullscreen"),z=Sg(u,"panZoom"),V=C&&(I||R||N);return m.jsx(O.Suspense,{fallback:m.jsx(g3,{}),children:m.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:[m.jsx("div",{className:o("flex h-8 items-center text-muted-foreground text-xs"),children:m.jsx("span",{className:o("ml-1 font-mono lowercase"),children:"mermaid"})}),V?m.jsx("div",{className:o("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:m.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:[I?m.jsx(iLe,{chart:_,config:c?.config}):null,R?m.jsx(m3,{code:_}):null,N?m.jsx(cLe,{chart:_,config:c?.config}):null]})}):null,m.jsx("div",{className:o("rounded-md border border-border bg-background"),children:m.jsx(fLe,{chart:_,config:c?.config,showControls:z})})]})})}let S=Bw(u,"code"),w=b3(u,"download"),v=b3(u,"copy");return m.jsx(H3e,{className:t,code:_,isIncomplete:d,language:f,startLine:y,children:S?m.jsxs(m.Fragment,{children:[w?m.jsx(tLe,{code:_,language:f}):null,v?m.jsx(m3,{}):null]}):null})},TU=O.memo(gLe,(e,t)=>e.className===t.className&&ik(e.node,t.node));TU.displayName="MarkdownCode";var CU=O.memo(rLe,(e,t)=>e.className===t.className&&ik(e.node,t.node));CU.displayName="MarkdownImg";var IU=O.memo(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(s=>s!=null&&s!=="");if(r.length===1&&O.isValidElement(r[0])){let s=r[0].props.node,a=s?.tagName;if(a==="img")return m.jsx(m.Fragment,{children:e});if(a==="code"&&"data-block"in r[0].props)return m.jsx(m.Fragment,{children:e})}return m.jsx("p",{...n,children:e})},(e,t)=>tn(e,t));IU.displayName="MarkdownParagraph";var bLe={ol:e2,li:aU,ul:oU,hr:iU,strong:cU,a:uU,h1:lU,h2:dU,h3:hU,h4:fU,h5:mU,h6:pU,table:gU,thead:bU,tbody:yU,tr:kU,th:xU,td:_U,blockquote:vU,code:TU,img:CU,pre:({children:e})=>O.isValidElement(e)?O.cloneElement(e,{"data-block":"true"}):e,sup:wU,sub:SU,p:IU,section:EU},yLe=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,kLe=new RegExp("\\p{L}","u");function y3(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(yLe.test(n))return"rtl";if(kLe.test(n))return"ltr"}return"ltr"}var xLe=/^[ \t]{0,3}(`{3,}|~{3,})/,_Le=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,k3=e=>{let t=e.split(`
|
|
318
|
+
`),n=null,r=0;for(let s of t){let a=xLe.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},vLe=e=>{let t=e.split(`
|
|
319
|
+
`);for(let n of t){let r=n.trim();if(r.length>0&&r.includes("|")&&_Le.test(r))return!0}return!1},wLe=()=>e=>{Pa(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},x3=[],_3={allowDangerousHtml:!0},Eg=new WeakMap,SLe=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 f=l[h];if(h>0&&(d+=","),Array.isArray(f)){let[p,x]=f;if(typeof p=="function"){let g=Eg.get(p);g||(g=p.name,Eg.set(p,g)),d+=g}else d+=String(p);d+=":",d+=JSON.stringify(x)}else if(typeof f=="function"){let p=Eg.get(f);p||(p=f.name,Eg.set(f,p)),d+=p}else d+=String(f)}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()}},v3=new SLe,AU=e=>{let t=ELe(e),n=e.children||"",r=t.runSync(t.parse(n),n);return PLe(r,e)},ELe=e=>{let t=v3.get(e);if(t)return t;let n=CLe(e);return v3.set(e,n),n},TLe=e=>e.some(t=>Array.isArray(t)?t[0]===Sw:t===Sw),CLe=e=>{let t=e.rehypePlugins||x3,n=e.remarkPlugins||x3,r=TLe(t)?n:[...n,wLe],s=e.remarkRehypeOptions?{..._3,...e.remarkRehypeOptions}:_3;return COe().use(TPe).use(r).use(cOe,s).use(t)},ILe=e=>e,ALe=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},NLe=(e,t)=>{var n;for(let r in Kx)if(Object.hasOwn(Kx,r)&&Object.hasOwn(e.properties,r)){let s=e.properties[r],a=Kx[r];(a===null||a.includes(e.tagName))&&(e.properties[r]=(n=t(String(s||""),r,e))!=null?n:void 0)}},RLe=(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},PLe=(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||ILe;Pa(e,(u,l,d)=>{if(u.type==="raw"&&d&&typeof l=="number")return ALe(d,l,a,u.value),l;if(u.type==="element"&&(NLe(u,c),RLe(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 LRe(e,{Fragment:m.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0})},OLe=/\[\^[\w-]{1,200}\](?!:)/,LLe=/\[\^[\w-]{1,200}\]:/,$Le=/<(\w+)[\s>]/,MLe=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),w3=new Map,S3=new Map,jLe=e=>{let t=e.toLowerCase(),n=w3.get(t);if(n)return n;let r=new RegExp(`<${t}(?=[\\s>/])[^>]*>`,"gi");return w3.set(t,r),r},DLe=e=>{let t=e.toLowerCase(),n=S3.get(t);if(n)return n;let r=new RegExp(`</${t}(?=[\\s>])[^>]*>`,"gi");return S3.set(t,r),r},E3=(e,t)=>{if(MLe.has(t.toLowerCase()))return 0;let n=e.match(jLe(t));if(!n)return 0;let r=0;for(let s of n)s.trimEnd().endsWith("/>")||(r+=1);return r},T3=(e,t)=>{let n=e.match(DLe(t));return n?n.length:0},FLe=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},BLe=e=>{let t=OLe.test(e),n=LLe.test(e);if(t||n)return[e];let r=ks.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=E3(c,l),h=T3(c,l);for(let f=0;f<d;f+=1)a.push(l);for(let f=0;f<h;f+=1)a.length>0&&a.at(-1)===l&&a.pop();continue}if(i.type==="html"&&i.block){let l=c.match($Le);if(l){let d=l[1],h=E3(c,d),f=T3(c,d);h>f&&a.push(d)}}if(u>0&&!o){let l=s[u-1];if(FLe(l)%2===1){s[u-1]=l+c;continue}}s.push(c),i.type!=="space"&&(o=i.type==="code")}return s},zLe=(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,`
|
|
320
|
+
<!---->
|
|
321
|
+
`);return o+u+c})}return n},ULe=/([\\`*_~[\]|])/g,HLe=e=>e.replace(ULe,"\\$1"),qLe=(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+HLe(i)+c)}return n},NU=e=>e.type==="text"?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(NU).join(""):"",VLe=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(r=>r.toLowerCase()));Pa(t,"element",r=>{if(n.has(r.tagName.toLowerCase())){let s=NU(r);r.children=s?[{type:"text",value:s}]:[]}})},GLe=()=>e=>{Pa(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})})},KLe=/^[ \t]*<[\w!/?-]/,WLe=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,YLe=e=>typeof e!="string"||e.length===0||!KLe.test(e)?e:e.replace(WLe,"$1"),C3,I3,A3,N3,ib={...rc,protocols:{...rc.protocols,href:[...(I3=(C3=rc.protocols)==null?void 0:C3.href)!=null?I3:[],"tel"]},attributes:{...rc.attributes,code:[...(N3=(A3=rc.attributes)==null?void 0:A3.code)!=null?N3:[],"metastring"]}},zw={raw:Sw,sanitize:[F9,ib],harden:[sSe,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},JLe={gfm:[fNe,{}],codeMeta:GLe},R3=Object.values(zw),QLe=Object.values(JLe),XLe={block:" ▋",circle:" ●"},ZLe={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},rs=O.createContext(ZLe),RU=O.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?YLe(e):e,u=m.jsx(AU,{...i,children:c});return m.jsx(Jz.Provider,{value:s,children:a?m.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)});RU.displayName="Block";var e$e=["github-light","github-dark"],PU=O.memo(({children:e,mode:t="streaming",dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:s=!1,components:a,rehypePlugins:o=R3,remarkPlugins:i=QLe,className:c,shikiTheme:u=e$e,mermaid:l,controls:d=!0,isAnimating:h=!1,animated:f,BlockComponent:p=RU,parseMarkdownIntoBlocksFn:x=BLe,caret:g,plugins:b,remend:y,linkSafety:_={enabled:!0},allowedTags:S,literalTagContent:w,translations:v,icons:C,prefix:I,onAnimationStart:R,onAnimationEnd:N,...z})=>{let V=O.useId(),[ne,J]=O.useTransition(),te=O.useMemo(()=>$3e(I),[I]),se=O.useRef(null),oe=O.useRef(R),me=O.useRef(N);oe.current=R,me.current=N,O.useEffect(()=>{var H,ie,Se;if(t==="static")return;let $e=se.current;if(se.current=h,$e===null){h&&((H=oe.current)==null||H.call(oe));return}h&&!$e?(ie=oe.current)==null||ie.call(oe):!h&&$e&&((Se=me.current)==null||Se.call(me))},[h,t]);let Xe=O.useMemo(()=>S?Object.keys(S):[],[S]),T=O.useMemo(()=>{if(typeof e!="string")return"";let H=t==="streaming"&&r?xRe(e,y):e;return w&&w.length>0&&(H=qLe(H,w)),Xe.length>0&&(H=zLe(H,Xe)),H},[e,t,r,y,Xe,w]),q=O.useMemo(()=>x(T),[T,x]),[X,A]=O.useState(q);O.useEffect(()=>{t==="streaming"&&!ye?J(()=>{A(q)}):A(q)},[q,t]);let P=t==="streaming"?X:q,D=O.useMemo(()=>n==="auto"?P.map(y3):void 0,[P,n]),Y=O.useMemo(()=>P.map((H,ie)=>`${V}-${ie}`),[P.length,V]),ke=O.useMemo(()=>f===!0?"true":f?JSON.stringify(f):"",[f]),ye=O.useMemo(()=>ke?ke==="true"?$w():$w(f):null,[ke]),we=O.useMemo(()=>{var H,ie;return{shikiTheme:(ie=(H=b?.code)==null?void 0:H.getThemes())!=null?ie:u,controls:d,isAnimating:h,mode:t,mermaid:l,linkSafety:_}},[u,d,h,t,l,_,b?.code]),Oe=O.useMemo(()=>v?JSON.stringify(v):"",[v]),G=O.useMemo(()=>({...eU,...v}),[Oe]),W=O.useMemo(()=>{let{inlineCode:H,...ie}=a??{},Se={...bLe,...ie};if(H){let $e=Se.code;Se.code=Je=>"data-block"in Je?$e?O.createElement($e,Je):null:O.createElement(H,Je)}return Se},[a]),ae=O.useMemo(()=>{let H=[];return b!=null&&b.cjk&&(H=[...H,...b.cjk.remarkPluginsBefore]),H=[...H,...i],b!=null&&b.cjk&&(H=[...H,...b.cjk.remarkPluginsAfter]),b!=null&&b.math&&(H=[...H,b.math.remarkPlugin]),H},[i,b?.math,b?.cjk]),ce=O.useMemo(()=>{var H;let ie=o;if(S&&Object.keys(S).length>0&&o===R3){let Se={...ib,tagNames:[...(H=ib.tagNames)!=null?H:[],...Object.keys(S)],attributes:{...ib.attributes,...S}};ie=[zw.raw,[F9,Se],zw.harden]}return w&&w.length>0&&(ie=[...ie,[VLe,w]]),b!=null&&b.math&&(ie=[...ie,b.math.rehypePlugin]),ye&&h&&(ie=[...ie,ye.rehypePlugin]),ie},[o,b?.math,ye,h,S,w]),_e=O.useMemo(()=>{if(!h||P.length===0)return!1;let H=P.at(-1);return k3(H)||vLe(H)},[h,P]),Re=O.useMemo(()=>g&&h&&!_e?{"--streamdown-caret":`"${XLe[g]}"`}:void 0,[g,h,_e]);return t==="static"?m.jsx(jw.Provider,{value:G,children:m.jsx(Dw.Provider,{value:b??null,children:m.jsx(rs.Provider,{value:we,children:m.jsx(f3,{icons:C,children:m.jsx(Mw.Provider,{value:te,children:m.jsx("div",{className:te("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",c),dir:n==="auto"?y3(T):n,children:m.jsx(AU,{components:W,rehypePlugins:ce,remarkPlugins:ae,...z,children:T})})})})})})}):m.jsx(jw.Provider,{value:G,children:m.jsx(Dw.Provider,{value:b??null,children:m.jsx(rs.Provider,{value:we,children:m.jsx(f3,{icons:C,children:m.jsx(Mw.Provider,{value:te,children:m.jsxs("div",{className:te("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",g&&!_e?"*:last:after:inline *:last:after:align-baseline *:last:after:content-[var(--streamdown-caret)]":null,c),style:Re,children:[P.length===0&&g&&h&&m.jsx("span",{}),P.map((H,ie)=>{var Se;let $e=ie===P.length-1,Je=h&&$e&&k3(H);return m.jsx(p,{animatePlugin:ye,components:W,content:H,dir:(Se=D?.[ie])!=null?Se:n!=="auto"?n:void 0,index:ie,isIncomplete:Je,rehypePlugins:ce,remarkPlugins:ae,shouldNormalizeHtmlIndentation:s,shouldParseIncompleteMarkdown:r,...z},Y[ie])})]})})})})})})},(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);PU.displayName="Streamdown";var t$e=({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}=la(),d=it(),h=O.useRef(null),f=O.useRef(null),[p,x]=O.useState(o),[g,b]=O.useState({x:0,y:0}),[y,_]=O.useState(!1),[S,w]=O.useState({x:0,y:0}),[v,C]=O.useState({x:0,y:0}),I=O.useCallback(se=>{x(oe=>Math.max(n,Math.min(r,oe+se)))},[n,r]),R=O.useCallback(()=>{I(s)},[I,s]),N=O.useCallback(()=>{I(-s)},[I,s]),z=O.useCallback(()=>{x(o),b({x:0,y:0})},[o]),V=O.useCallback(se=>{se.preventDefault();let oe=se.deltaY>0?-s:s;I(oe)},[I,s]),ne=O.useCallback(se=>{if(se.button!==0||se.isPrimary===!1)return;_(!0),w({x:se.clientX,y:se.clientY}),C(g);let oe=se.currentTarget;oe instanceof HTMLElement&&oe.setPointerCapture(se.pointerId)},[g]),J=O.useCallback(se=>{if(!y)return;se.preventDefault();let oe=se.clientX-S.x,me=se.clientY-S.y;b({x:v.x+oe,y:v.y+me})},[y,S,v]),te=O.useCallback(se=>{_(!1);let oe=se.currentTarget;oe instanceof HTMLElement&&oe.releasePointerCapture(se.pointerId)},[]);return O.useEffect(()=>{let se=h.current;if(se)return se.addEventListener("wheel",V,{passive:!1}),()=>{se.removeEventListener("wheel",V)}},[V]),O.useEffect(()=>{let se=f.current;if(se&&y)return document.body.style.userSelect="none",se.addEventListener("pointermove",J,{passive:!1}),se.addEventListener("pointerup",te),se.addEventListener("pointercancel",te),()=>{document.body.style.userSelect="",se.removeEventListener("pointermove",J),se.removeEventListener("pointerup",te),se.removeEventListener("pointercancel",te)}},[y,J,te]),m.jsxs("div",{className:d("relative flex flex-col",i?"h-full w-full":"min-h-28 w-full",t),ref:h,style:{cursor:y?"grabbing":"grab"},children:[a?m.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:[m.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:R,title:"Zoom in",type:"button",children:m.jsx(u,{size:16})}),m.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:N,title:"Zoom out",type:"button",children:m.jsx(l,{size:16})}),m.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:z,title:"Reset zoom and pan",type:"button",children:m.jsx(c,{size:16})})]}):null,m.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:ne,ref:f,role:"application",style:{transform:`translate(${g.x}px, ${g.y}px) scale(${p})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},OU=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:s=!0})=>{let a=it(),[o,i]=O.useState(null),[c,u]=O.useState(!1),[l,d]=O.useState(""),[h,f]=O.useState(""),[p,x]=O.useState(0),{mermaid:g}=O.useContext(rs),b=ZC(),y=g?.errorComponent,{shouldRender:_,containerRef:S}=w3e({immediate:r});if(O.useEffect(()=>{if(_){if(!b){i("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{i(null),u(!0);let v=b.getMermaid(n),C=e.split("").reduce((N,z)=>(N<<5)-N+z.charCodeAt(0)|0,0),I=`mermaid-${Math.abs(C)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:R}=await v.render(I,e);d(R),f(R)}catch(v){if(!(h||l)){let C=v instanceof Error?v.message:"Failed to render Mermaid chart";i(C)}}finally{u(!1)}})()}},[e,n,p,_,b]),!(_||l||h))return m.jsx("div",{className:a("my-4 min-h-[200px]",t),ref:S});if(c&&!l&&!h)return m.jsx("div",{className:a("my-4 flex justify-center p-4",t),ref:S,children:m.jsxs("div",{className:a("flex items-center space-x-2 text-muted-foreground"),children:[m.jsx("div",{className:a("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),m.jsx("span",{className:a("text-sm"),children:"Loading diagram..."})]})});if(o&&!l&&!h){let v=()=>x(C=>C+1);return y?m.jsx("div",{ref:S,children:m.jsx(y,{chart:e,error:o,retry:v})}):m.jsxs("div",{className:a("rounded-md bg-red-50 p-4",t),ref:S,children:[m.jsxs("p",{className:a("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",o]}),m.jsxs("details",{className:a("mt-2"),children:[m.jsx("summary",{className:a("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),m.jsx("pre",{className:a("mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs"),children:e})]})]})}let w=l||h;return m.jsx("div",{className:a("size-full",t),"data-streamdown":"mermaid",ref:S,children:m.jsx(t$e,{className:a(r?"size-full overflow-hidden":"overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:s,zoomStep:.1,children:m.jsx("div",{"aria-label":"Mermaid chart",className:a("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:w},role:"img"})})})};const n$e=xwe(),P3=["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 r$e(e){return m.jsx("div",{className:e.className?`${P3} ${e.className}`:P3,children:m.jsx(PU,{plugins:{code:n$e},controls:{code:!0},linkSafety:{enabled:!1},children:e.children})})}const s$e=[{id:"model",label:"Tools"},{id:"discover",label:"Search"}],O3=e=>e.status==="error"&&e.error.message.toLowerCase().includes("source not found"),a$e=e=>e.status==="error"&&e.error.message.toLowerCase().includes("catalog artifact missing for source"),o$e=(e,t)=>e.status==="ready"&&!e.data.some(n=>n.id===t),i$e=e=>o$e(e.sources,e.sourceId)||O3(e.source)||O3(e.inspection)?{kind:"source_not_found"}:e.source.status==="ready"&&a$e(e.inspection)?{kind:"tools_missing",source:e.source.data}:{kind:"ready"},Pu=(e,t)=>typeof e.binding[t]=="string"&&e.binding[t].trim().length>0?String(e.binding[t]):null,s_=(e,t)=>{const n=e.binding[t];if(n==null||typeof n!="object"||Array.isArray(n))return null;const r=Object.entries(n);return r.every(([,s])=>typeof s=="string")?Object.fromEntries(r):null},L3=(e,t)=>{const n=e.binding[t];return Array.isArray(n)&&n.every(r=>typeof r=="string")?[...n]:void 0},$3=e=>{const t=e.binding.transport;return t==="auto"||t==="streamable-http"||t==="sse"||t==="stdio"?t:void 0},Ou=e=>{switch(e.kind){case"none":return{kind:"none"};case"bearer":return{kind:"bearer",headerName:e.headerName,prefix:e.prefix,tokenRef:e.token};case"oauth2":return{kind:"oauth2",headerName:e.headerName,prefix:e.prefix,accessTokenRef:e.accessToken,refreshTokenRef:e.refreshToken};default:return}},Tg=e=>{switch(e.kind){case"mcp":return{kind:"mcp",endpoint:e.endpoint,name:e.name,namespace:e.namespace,...$3(e)?{transport:$3(e)}:{},queryParams:s_(e,"queryParams"),headers:s_(e,"headers"),command:Pu(e,"command"),args:L3(e,"args"),env:s_(e,"env"),cwd:Pu(e,"cwd")};case"openapi":{const t=Pu(e,"specUrl");return t?{kind:"openapi",endpoint:e.endpoint,specUrl:t,name:e.name,namespace:e.namespace,importAuthPolicy:e.importAuthPolicy,importAuth:Ou(e.importAuth),auth:Ou(e.auth)}:null}case"graphql":return{kind:"graphql",endpoint:e.endpoint,name:e.name,namespace:e.namespace,importAuthPolicy:e.importAuthPolicy,importAuth:Ou(e.importAuth),auth:Ou(e.auth)};case"google_discovery":{const t=Pu(e,"service"),n=Pu(e,"version");return!t||!n?null:{kind:"google_discovery",service:t,version:n,discoveryUrl:Pu(e,"discoveryUrl"),scopes:L3(e,"scopes"),oauthClient:null,name:e.name,namespace:e.namespace,importAuthPolicy:e.importAuthPolicy,importAuth:Ou(e.importAuth),auth:Ou(e.auth)}}default:return null}};function c$e(e){const{sourceId:t,search:n,navigate:r}=e,s=j1(),a=e8(t),o=t8(),i=dye(t),[c,u]=O.useState(null),l=i$e({sources:s,source:a,inspection:i,sourceId:t}),d=n.tool??(i.status==="ready"?i.data.tools[0]?.path:void 0),h=hye(t,n.tab==="model"?d??null:null),f=fye({sourceId:t,query:n.query??"",limit:12}),p=O.useCallback(async x=>{const g=Tg(x);if(!g){u({tone:"error",text:"Refresh is unavailable until this source has complete connection details."});return}u(null);try{await o.mutateAsync(g),u({tone:"success",text:`Refreshed ${x.name}.`})}catch(b){u({tone:"error",text:b instanceof Error?b.message:"Failed to refresh source."})}},[o]);if(O.useEffect(()=>{if(n.tab!=="model"||n.tool||i.status!=="ready")return;const x=i.data.tools[0]?.path;x&&r({search:g=>({...g,tool:x}),replace:!0})},[i,r,n.tab,n.tool]),l.kind==="source_not_found")return m.jsx(BB,{});if(l.kind==="tools_missing"){const x=Tg(l.source);return m.jsx(Qwe,{source:l.source,title:"Tools need to be rebuilt",description:"This source exists in your workspace, but its generated tool catalog is missing. Refresh to reconnect and rebuild the tools.",refreshLabel:"Refresh source",refreshTitle:x===null?"Refresh is unavailable for this source configuration":"Reconnect and rebuild this source",refreshDisabled:o.status==="pending"||x===null,refreshPending:o.status==="pending",feedback:c,onRefresh:()=>{p(l.source)}})}return m.jsx(cu,{loadable:i,loading:"Loading source...",children:x=>{const g=x.tools.find(b=>b.path===d)??x.tools[0]??null;return m.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[m.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border bg-background/95 backdrop-blur-sm px-4 h-12",children:[m.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[m.jsx("h2",{className:"truncate text-sm font-semibold text-foreground",children:x.source.name}),m.jsx(Cs,{variant:"outline",children:x.source.kind}),m.jsxs("span",{className:"hidden text-[11px] tabular-nums text-muted-foreground/50 sm:block",children:[x.toolCount," ",x.toolCount===1?"tool":"tools"]})]}),m.jsxs("div",{className:"flex items-center gap-2",children:[c&&m.jsxs("span",{className:je("hidden max-w-72 truncate text-[11px] font-medium sm:inline-flex sm:items-center sm:gap-1.5",c.tone==="success"?"text-primary":"text-destructive"),title:c.text,children:[c.tone==="success"&&m.jsx(hi,{className:"size-3 shrink-0"}),c.text]}),m.jsx("div",{className:"flex items-center gap-0.5 rounded-lg bg-muted/50 p-0.5",children:s$e.map(b=>m.jsx("button",{type:"button",onClick:()=>{r({search:y=>({...y,tab:b.id})})},className:je("rounded-md px-3 py-1 text-[12px] font-medium transition-colors",b.id===n.tab?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:b.label},b.id))}),m.jsxs(en,{variant:"outline",size:"sm",onClick:()=>{p(x.source)},disabled:o.status==="pending"||Tg(x.source)===null,title:Tg(x.source)===null?"Refresh is unavailable for this source configuration":"Reconnect and resync this source",children:[o.status==="pending"?m.jsx(wr,{className:"size-3"}):null,"Refresh"]}),m.jsxs(nr,{to:"/sources/$sourceId/edit",params:{sourceId:t},className:"inline-flex items-center gap-1.5 rounded-md border border-border bg-card px-2.5 py-1 text-[12px] font-medium text-muted-foreground transition-colors hover:text-foreground hover:bg-accent/50",children:[m.jsx(eC,{className:"size-3"}),"Edit"]})]})]}),m.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[n.tab==="model"&&m.jsx(u$e,{bundle:x,detail:h,selectedToolPath:g?.path??null,onSelectTool:b=>{r({search:y=>({...y,tool:b,tab:"model"})})},sourceId:t}),n.tab==="discover"&&m.jsx(f$e,{bundle:x,discovery:f,initialQuery:n.query??"",onSubmitQuery:b=>{r({search:y=>({...y,query:b,tab:"discover"})})},onOpenTool:b=>{r({search:y=>({...y,tab:"model",tool:b})})}})]})]})}})}function u$e(e){const[t,n]=O.useState(""),r=O.useRef(null),s=t.trim().toLowerCase().split(/\s+/).filter(Boolean),a=e.bundle.tools.filter(o=>{if(s.length===0)return!0;const i=[o.path,o.method??"",o.inputTypePreview??"",o.outputTypePreview??""].join(" ").toLowerCase();return s.every(c=>i.includes(c))});return O.useEffect(()=>{const o=i=>{i.key==="/"&&document.activeElement?.tagName!=="INPUT"&&(i.preventDefault(),r.current?.focus()),i.key==="Escape"&&(r.current?.blur(),t.length>0&&n(""))};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[t]),m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex w-72 shrink-0 flex-col border-r border-border bg-card/30 lg:w-80 xl:w-[22rem]",children:[m.jsx("div",{className:"shrink-0 border-b border-border px-3 py-2",children:m.jsxs("div",{className:"relative",children:[m.jsx(b8,{className:"absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground/40"}),m.jsx("input",{ref:r,value:t,onChange:o=>n(o.target.value),placeholder:`Filter ${e.bundle.toolCount} tools…`,className:"h-8 w-full rounded-md border border-input bg-background pl-8 pr-8 text-[13px] outline-none transition-colors placeholder:text-muted-foreground/40 focus:border-ring focus:ring-1 focus:ring-ring/30"}),t.length>0?m.jsx("button",{type:"button",onClick:()=>n(""),className:"absolute right-2 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground/40 hover:text-foreground",children:m.jsx(f1e,{})}):m.jsx("kbd",{className:"absolute right-2.5 top-1/2 -translate-y-1/2 rounded border border-border bg-muted px-1 py-px text-[10px] text-muted-foreground/50",children:"/"})]})}),m.jsx("div",{className:"flex-1 overflow-y-auto",children:a.length===0?m.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"}):m.jsx("div",{className:"p-1.5",children:m.jsx(d$e,{tools:a,selectedToolPath:e.selectedToolPath,onSelectTool:e.onSelectTool,search:t,isFiltered:s.length>0})})})]}),m.jsx("div",{className:"flex flex-1 flex-col min-w-0 overflow-hidden",children:m.jsx(cu,{loadable:e.detail,loading:"Loading tool...",children:o=>o?m.jsx(h$e,{detail:o}):m.jsx(Xv,{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})})})]})}function l$e(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)s.children.has(a)||s.children.set(a,{segment:a,children:new Map}),s=s.children.get(a);s.tool=n}return t}function d$e(e){const n=[...O.useMemo(()=>l$e(e.tools),[e.tools]).children.values()].sort((r,s)=>r.segment.localeCompare(s.segment));return m.jsx("div",{className:"flex flex-col gap-px",children:n.map(r=>m.jsx(LU,{node:r,depth:0,selectedToolPath:e.selectedToolPath,onSelectTool:e.onSelectTool,search:e.search,defaultOpen:e.isFiltered},r.segment))})}function LU(e){const{node:t,depth:n,selectedToolPath:r,onSelectTool:s,search:a,defaultOpen:o}=e,i=t.children.size>0,c=!!t.tool&&!i,u=O.useMemo(()=>{if(!r)return!1;function x(g){if(g.tool?.path===r)return!0;for(const b of g.children.values())if(x(b))return!0;return!1}return x(t)},[t,r]),[l,d]=O.useState(o||u);if(O.useEffect(()=>{(o||u)&&d(!0)},[o,u]),c)return m.jsx(M3,{tool:t.tool,active:t.tool.path===r,onSelect:()=>s(t.tool.path),search:a,depth:n});const h=8+n*16,f=[...t.children.values()].sort((x,g)=>x.segment.localeCompare(g.segment)),p=$U(t);return m.jsxs("div",{children:[t.tool?m.jsxs("div",{className:"flex items-center",children:[m.jsx("button",{type:"button",onClick:()=>d(x=>!x),className:"shrink-0 rounded p-0.5 text-muted-foreground/30 hover:text-muted-foreground",style:{marginLeft:h},children:m.jsx(GR,{className:je("size-2.5 transition-transform duration-150",l&&"rotate-90")})}),m.jsx(M3,{tool:t.tool,active:t.tool.path===r,onSelect:()=>s(t.tool.path),search:a,depth:-1,className:"flex-1 pl-1"})]}):m.jsxs("button",{type:"button",onClick:()=>d(x=>!x),className:je("group flex w-full items-center gap-1.5 rounded-md py-1 pr-2.5 text-[12px] transition-colors hover:bg-accent/40",l?"text-foreground/80":"text-muted-foreground/60"),style:{paddingLeft:h},children:[m.jsx(GR,{className:je("size-2.5 shrink-0 text-muted-foreground/30 transition-transform duration-150",l&&"rotate-90")}),m.jsx(d1e,{className:je("size-3 shrink-0",l?"text-primary/60":"text-muted-foreground/30")}),m.jsx("span",{className:"flex-1 truncate text-left font-mono",children:MU(t.segment,a)}),m.jsx("span",{className:"shrink-0 tabular-nums text-[10px] text-muted-foreground/25",children:p})]}),l&&i&&m.jsxs("div",{className:"relative flex flex-col gap-px",children:[m.jsx("span",{className:"absolute top-0 bottom-1 w-px bg-border/40",style:{left:h+5},"aria-hidden":!0}),f.map(x=>m.jsx(LU,{node:x,depth:n+1,selectedToolPath:r,onSelectTool:s,search:a,defaultOpen:o},x.segment))]})]})}function $U(e){let t=e.tool?1:0;for(const n of e.children.values())t+=$U(n);return t}function M3(e){const t=O.useRef(null),n=e.depth>=0?8+e.depth*16+8:void 0;O.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 m.jsxs("button",{ref:t,type:"button",onClick:e.onSelect,className:je("group flex w-full items-center gap-2 rounded-md py-1.5 pr-2.5 text-left transition-colors",e.active?"bg-primary/10 text-foreground border-l-2 border-l-primary":"hover:bg-accent/50 text-foreground/70 hover:text-foreground",e.className),style:n!=null?{paddingLeft:n}:void 0,children:[m.jsx(XT,{className:"size-3 shrink-0 text-muted-foreground/40"}),m.jsx("span",{className:"flex-1 truncate font-mono text-[12px]",children:MU(r,e.search)}),e.tool.method&&m.jsx(FB,{method:e.tool.method})]})}function h$e(e){const{detail:t}=e,[n,r]=O.useState(null),s=O.useCallback((a,o)=>{navigator.clipboard.writeText(a).then(()=>{r(o),setTimeout(()=>r(null),1500)})},[]);return m.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[m.jsx("div",{className:"shrink-0 border-b border-border bg-background/95 backdrop-blur-sm",children:m.jsxs("div",{className:"flex items-start gap-3 px-5 py-3.5",children:[m.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:m.jsx(XT,{className:"size-4"})}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("h3",{className:"truncate text-sm font-semibold text-foreground",children:t.summary.path}),m.jsx(m$e,{text:t.summary.path,field:"path",copiedField:n,onCopy:s})]}),m.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[t.summary.method&&m.jsx(FB,{method:t.summary.method}),t.summary.pathTemplate&&m.jsx("span",{className:"font-mono text-[11px] text-muted-foreground/60",children:t.summary.pathTemplate})]}),m.jsxs("div",{className:"mt-2 rounded-md border border-border bg-card/70 px-2.5 py-2",children:[m.jsx("div",{className:"mb-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/60",children:"TypeScript Signature"}),m.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap font-mono text-[12px] text-foreground",children:t.contract.callDeclaration})]})]})]})}),m.jsx("div",{className:"flex-1 overflow-y-auto",children:m.jsxs("div",{className:"px-5 py-4 space-y-4",children:[m.jsxs("section",{className:"overflow-hidden rounded-lg border border-border bg-card/60",children:[m.jsx("div",{className:"border-b border-border px-3 py-2 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/70",children:"Contract"}),m.jsxs("div",{className:"grid grid-cols-1 gap-3 p-3 xl:grid-cols-2",children:[m.jsx(Ki,{title:"Input Type",body:t.contract.input.typeDeclaration,lang:"typescript",empty:"No input type."}),m.jsx(Ki,{title:"Output Type",body:t.contract.output.typeDeclaration,lang:"typescript",empty:"No output type."})]})]}),m.jsxs("section",{className:"overflow-hidden rounded-lg border border-border bg-card/60",children:[m.jsx("div",{className:"border-b border-border px-3 py-2 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/70",children:"Schemas"}),m.jsxs("div",{className:"grid grid-cols-1 gap-3 p-3 xl:grid-cols-2",children:[m.jsx(Ki,{title:"Input Schema",body:t.contract.input.schemaJson,lang:"json",empty:"No input schema.",compact:!0}),m.jsx(Ki,{title:"Output Schema",body:t.contract.output.schemaJson,lang:"json",empty:"No output schema.",compact:!0}),t.contract.input.exampleJson&&m.jsx(Ki,{title:"Example Request",body:t.contract.input.exampleJson,lang:"json",empty:"",compact:!0}),t.contract.output.exampleJson&&m.jsx(Ki,{title:"Example Response",body:t.contract.output.exampleJson,lang:"json",empty:"",compact:!0})]})]}),t.sections.map((a,o)=>a.kind==="facts"?m.jsxs("section",{className:"overflow-hidden rounded-lg border border-border bg-card/60",children:[m.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}),m.jsx("div",{className:"grid grid-cols-1 gap-3 p-3 md:grid-cols-2",children:a.items.map(i=>m.jsxs("div",{className:"min-w-0",children:[m.jsx("div",{className:"text-[11px] uppercase tracking-wider text-muted-foreground/60",children:i.label}),m.jsx("div",{className:je("mt-1 text-sm text-foreground",i.mono&&"font-mono text-[12px]"),children:i.value})]},`${a.title}:${i.label}`))})]},`${a.kind}:${a.title}:${String(o)}`):a.kind==="markdown"?m.jsxs("section",{className:"overflow-hidden rounded-lg border border-border bg-card/60",children:[m.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}),m.jsx("div",{className:"p-4",children:m.jsx(r$e,{children:a.body})})]},`${a.kind}:${a.title}:${String(o)}`):m.jsx(Ki,{title:a.title,body:a.body,lang:a.language==="text"?void 0:a.language,empty:"",compact:!0},`${a.kind}:${a.title}:${String(o)}`))]})})]})}function f$e(e){const[t,n]=O.useState(e.initialQuery);return O.useEffect(()=>{n(e.initialQuery)},[e.initialQuery]),m.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[m.jsx("div",{className:"shrink-0 border-b border-border px-4 py-3",children:m.jsxs("form",{className:"flex items-center gap-2 max-w-2xl",onSubmit:r=>{r.preventDefault(),e.onSubmitQuery(t.trim())},children:[m.jsxs("div",{className:"relative flex-1",children:[m.jsx(b8,{className:"absolute left-3 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground/40"}),m.jsx("input",{value:t,onChange:r=>n(r.target.value),placeholder:"Search tools\\u2026",className:"h-9 w-full rounded-md border border-input bg-background pl-9 pr-3 text-sm outline-none transition-colors placeholder:text-muted-foreground/40 focus:border-ring focus:ring-1 focus:ring-ring/30"})]}),m.jsx(en,{type:"submit",size:"sm",children:"Search"})]})}),m.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:m.jsx(cu,{loadable:e.discovery,loading:"Searching\\u2026",children:r=>r.query.length===0?m.jsx(Xv,{title:"Search your tools",description:"Type a query to find matching tools across this source."}):r.results.length===0?m.jsx(Xv,{title:"No results",description:"Try different search terms."}):m.jsx("div",{className:"max-w-3xl space-y-2",children:r.results.map((s,a)=>m.jsxs("button",{type:"button",onClick:()=>e.onOpenTool(s.path),className:"group w-full rounded-lg border border-border bg-card/60 p-3.5 text-left transition-all hover:border-primary/30 hover:shadow-sm",children:[m.jsxs("div",{className:"flex items-center justify-between gap-3 mb-1.5",children:[m.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[m.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center rounded-md bg-muted text-[10px] font-mono tabular-nums text-muted-foreground/60",children:a+1}),m.jsx("h4",{className:"truncate font-mono text-[13px] font-medium text-foreground group-hover:text-primary transition-colors",children:s.path})]}),m.jsx("span",{className:"shrink-0 font-mono text-xs tabular-nums text-muted-foreground/50",children:s.score.toFixed(2)})]}),s.description&&m.jsx("p",{className:"text-[12px] text-muted-foreground leading-relaxed line-clamp-2",children:s.description}),(s.inputTypePreview||s.outputTypePreview)&&m.jsxs("div",{className:"mt-2 grid grid-cols-1 gap-2 md:grid-cols-2",children:[s.inputTypePreview&&m.jsxs("div",{className:"rounded-md border border-border/70 bg-background/70 px-2.5 py-2",children:[m.jsx("div",{className:"mb-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/55",children:"Input"}),m.jsx("div",{className:"font-mono text-[11px] text-foreground/85 line-clamp-3",children:s.inputTypePreview})]}),s.outputTypePreview&&m.jsxs("div",{className:"rounded-md border border-border/70 bg-background/70 px-2.5 py-2",children:[m.jsx("div",{className:"mb-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/55",children:"Output"}),m.jsx("div",{className:"font-mono text-[11px] text-foreground/85 line-clamp-3",children:s.outputTypePreview})]})]})]},s.path))})})})]})}function m$e(e){return m.jsx("button",{type:"button",onClick:()=>e.onCopy(e.text,e.field),className:"shrink-0 rounded p-1 text-muted-foreground/30 transition-colors hover:text-muted-foreground",title:`Copy ${e.field}`,children:e.copiedField===e.field?m.jsx(hi,{}):m.jsx(ZT,{})})}function MU(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),hl:!1}),o.push({text:e.slice(c,u),hl:!0}),i=u;return i<e.length&&o.push({text:e.slice(i),hl:!1}),m.jsx(m.Fragment,{children:o.map((c,u)=>c.hl?m.jsx("mark",{className:"rounded-sm bg-primary/20 text-foreground px-px",children:c.text},u):m.jsx("span",{children:c.text},u))})}const p$e=e=>e.status==="ready"?e.data.secretProviders.filter(t=>t.canStore):[],j3=(e,t)=>e.status==="ready"?e.data.secretProviders.find(n=>n.id===t)?.name??t:t;function g$e(){const e=VT(),t=GT(),[n,r]=O.useState(!1),[s,a]=O.useState(null),o=p$e(e),i=e.status==="ready"?j3(e,e.data.defaultSecretStoreProvider):null;return m.jsx("div",{className:"flex-1 overflow-y-auto",children:m.jsxs("div",{className:"mx-auto max-w-3xl px-6 py-10 lg:px-10 lg:py-14",children:[m.jsxs("div",{className:"flex items-end justify-between mb-8",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"font-display text-3xl tracking-tight text-foreground lg:text-4xl",children:"Secrets"}),m.jsxs("p",{className:"mt-1.5 text-[14px] text-muted-foreground",children:["Tokens and credentials stored by executor.",i?` New secrets default to ${i}.`:""]})]}),m.jsxs(en,{size:"sm",onClick:()=>{r(!0),a(null)},children:[m.jsx(_o,{className:"size-3.5"}),"Add secret"]})]}),n&&m.jsx(y$e,{onClose:()=>r(!1),className:"mb-6",providerOptions:o,defaultProviderId:e.status==="ready"?e.data.defaultSecretStoreProvider:null}),m.jsx(cu,{loadable:t,loading:"Loading secrets...",children:c=>c.length===0&&!n?m.jsx(b$e,{onAdd:()=>r(!0)}):m.jsxs("div",{className:"rounded-xl border border-border bg-card/80 divide-y divide-border overflow-hidden",children:[c.map(u=>m.jsx(k$e,{secret:u,providerLabel:j3(e,u.providerId),isEditing:s===u.id,onEdit:()=>a(s===u.id?null:u.id),onCancelEdit:()=>a(null)},u.id)),c.length===0&&m.jsx("div",{className:"px-5 py-8 text-center text-[13px] text-muted-foreground/60",children:"No secrets yet. Add one above."})]})})]})})}function b$e(e){return m.jsxs("div",{className:"flex flex-col items-center justify-center rounded-2xl border border-dashed border-border py-20",children:[m.jsx("div",{className:"flex size-12 items-center justify-center rounded-2xl bg-muted text-muted-foreground mb-4",children:m.jsx(jU,{className:"size-5"})}),m.jsx("p",{className:"text-[14px] font-medium text-foreground/70 mb-1",children:"No secrets stored"}),m.jsx("p",{className:"text-[13px] text-muted-foreground/60 mb-5",children:"Secrets let you securely provide tokens for source authentication without putting them in workspace config."}),m.jsxs(en,{size:"sm",onClick:e.onAdd,children:[m.jsx(_o,{className:"size-3.5"}),"Add secret"]})]})}function y$e(e){const t=WT(),[n,r]=O.useState(""),[s,a]=O.useState(""),[o,i]=O.useState(e.defaultProviderId??""),[c,u]=O.useState(null);O.useEffect(()=>{o.length>0||e.defaultProviderId&&i(e.defaultProviderId)},[e.defaultProviderId,o]);const l=async()=>{u(null);const d=n.trim();if(!d){u("Name is required.");return}if(!s){u("Value is required.");return}try{await t.mutateAsync({name:d,value:s,...o?{providerId:o}:{}}),e.onClose()}catch(h){u(h instanceof Error?h.message:"Failed creating secret.")}};return m.jsxs("div",{className:je("rounded-xl border border-primary/20 bg-card/80",e.className),children:[m.jsxs("div",{className:"border-b border-border px-5 py-3 flex items-center justify-between",children:[m.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"New secret"}),m.jsx("button",{type:"button",onClick:e.onClose,className:"text-[12px] text-muted-foreground hover:text-foreground transition-colors",children:"Cancel"})]}),m.jsxs("div",{className:"p-5 space-y-4",children:[c&&m.jsx("div",{className:"rounded-lg border border-destructive/30 bg-destructive/8 px-4 py-2.5 text-[13px] text-destructive",children:c}),m.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[m.jsx(tf,{label:"Name",children:m.jsx("input",{value:n,onChange:d=>r(d.target.value),placeholder:"GitHub PAT",className:"h-9 w-full rounded-lg border border-input bg-background px-3 text-[13px] text-foreground outline-none transition-colors placeholder:text-muted-foreground/35 focus:border-ring focus:ring-1 focus:ring-ring/25",autoFocus:!0})}),m.jsx(tf,{label:"Value",children:m.jsx("input",{type:"password",value:s,onChange:d=>a(d.target.value),placeholder:"ghp_...",className:"h-9 w-full rounded-lg border border-input bg-background px-3 font-mono text-[12px] text-foreground outline-none transition-colors placeholder:text-muted-foreground/35 focus:border-ring focus:ring-1 focus:ring-ring/25"})}),m.jsx(tf,{label:"Store in",children:m.jsx("select",{value:o,onChange:d=>i(d.target.value),className:"h-9 w-full rounded-lg border border-input bg-background px-3 text-[13px] text-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring/25",children:e.providerOptions.map(d=>m.jsx("option",{value:d.id,children:d.name},d.id))})})]}),m.jsx("div",{className:"flex justify-end",children:m.jsxs(en,{size:"sm",onClick:l,disabled:t.status==="pending",children:[t.status==="pending"?m.jsx(wr,{className:"size-3.5"}):m.jsx(_o,{className:"size-3.5"}),"Store secret"]})})]})]})}function k$e(e){const{secret:t,providerLabel:n,isEditing:r}=e,s=uye(),[a,o]=O.useState(!1),i=async()=>{if(window.confirm(`Delete "${t.name||t.id}"? This cannot be undone. Sources using this secret will lose access.`)){o(!0);try{await s.mutateAsync(t.id)}catch{}finally{o(!1)}}},c=new Date(t.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"});return m.jsxs("div",{className:"px-5 py-3.5",children:[m.jsxs("div",{className:"flex items-center justify-between gap-4",children:[m.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[m.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/8 text-primary",children:m.jsx(jU,{className:"size-3.5"})}),m.jsxs("div",{className:"min-w-0",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-[13px] font-medium text-foreground truncate",children:t.name||"Unnamed secret"}),m.jsx(Cs,{variant:"outline",className:"text-[9px] shrink-0",children:t.purpose.replace(/_/g," ")}),m.jsx(Cs,{variant:"outline",className:"text-[9px] shrink-0",children:n})]}),m.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[m.jsx("span",{className:"text-[11px] font-mono text-muted-foreground/50 truncate",children:t.id}),m.jsx("span",{className:"text-[11px] text-muted-foreground/40",children:c})]}),t.linkedSources.length>0&&m.jsxs("div",{className:"flex items-center gap-1.5 mt-1 flex-wrap",children:[m.jsx("span",{className:"text-[10px] text-muted-foreground/50",children:"Used by"}),t.linkedSources.map(u=>m.jsx(nr,{to:"/sources/$sourceId",params:{sourceId:u.sourceId},search:{tab:"model"},className:"inline-flex items-center gap-1 rounded-md bg-accent/60 px-1.5 py-0.5 text-[10px] font-medium text-foreground/70 transition-colors hover:bg-accent hover:text-foreground",children:u.sourceName},u.sourceId))]})]})]}),m.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[m.jsxs("button",{type:"button",onClick:e.onEdit,className:je("inline-flex items-center gap-1 rounded-md px-2 py-1.5 text-[11px] font-medium transition-colors",r?"bg-primary/10 text-primary":"text-muted-foreground hover:text-foreground hover:bg-accent/50"),children:[m.jsx(eC,{className:"size-3"}),"Edit"]}),m.jsxs("button",{type:"button",onClick:i,disabled:a,className:"inline-flex items-center gap-1 rounded-md px-2 py-1.5 text-[11px] font-medium text-muted-foreground transition-colors hover:text-destructive hover:bg-destructive/8 disabled:opacity-50",children:[a?m.jsx(wr,{className:"size-3"}):m.jsx(Qv,{className:"size-3"}),"Delete"]})]})]}),r&&m.jsx(x$e,{secret:t,onClose:e.onCancelEdit})]})}function x$e(e){const t=cye(),[n,r]=O.useState(e.secret.name??""),[s,a]=O.useState(""),[o,i]=O.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 m.jsxs("div",{className:"mt-3 pt-3 border-t border-border/50",children:[o&&m.jsx("div",{className:"rounded-lg border border-destructive/30 bg-destructive/8 px-4 py-2.5 text-[13px] text-destructive mb-3",children:o}),m.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[m.jsx(tf,{label:"Name",children:m.jsx("input",{value:n,onChange:u=>r(u.target.value),placeholder:"Secret name",className:"h-8 w-full rounded-lg border border-input bg-background px-3 text-[12px] text-foreground outline-none transition-colors placeholder:text-muted-foreground/35 focus:border-ring focus:ring-1 focus:ring-ring/25",autoFocus:!0})}),m.jsx(tf,{label:"New value (leave empty to keep current)",children:m.jsx("input",{type:"password",value:s,onChange:u=>a(u.target.value),placeholder:"Leave empty to keep existing",className:"h-8 w-full rounded-lg border border-input bg-background px-3 font-mono text-[11px] text-foreground outline-none transition-colors placeholder:text-muted-foreground/35 focus:border-ring focus:ring-1 focus:ring-ring/25"})})]}),m.jsxs("div",{className:"flex items-center justify-end gap-2 mt-3",children:[m.jsx("button",{type:"button",onClick:e.onClose,className:"rounded-md px-3 py-1.5 text-[12px] font-medium text-muted-foreground transition-colors hover:text-foreground",children:"Cancel"}),m.jsxs(en,{size:"sm",onClick:c,disabled:t.status==="pending",children:[t.status==="pending"&&m.jsx(wr,{className:"size-3"}),"Save"]})]})]})}function tf(e){return m.jsxs("label",{className:"block space-y-1",children:[m.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:e.label}),e.children]})}function jU(e){return m.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:je("size-4",e.className),children:[m.jsx("path",{d:"M10 6a4 4 0 10-4.9 3.9L2 13v1.5h2V13h1.5v-1.5H7l.6-.6A4 4 0 0010 6z",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"}),m.jsx("circle",{cx:"10.5",cy:"5.5",r:"1",fill:"currentColor"})]})}const _$e=["mcp","openapi","graphql","google_discovery"],v$e=["auto","streamable-http","sse","stdio"],w$e=["none","bearer","oauth2"],S$e=["none","bearer","basic","headers"],E$e=2*6e4,DU="executor:oauth-result:",jn=e=>{const t=e.trim();return t.length>0?t:null},K0=e=>{try{const t=S8(e);if(!t)return"";const n=t.indexOf(".");return n>0?t.slice(0,n):t}catch{return""}},FU=e=>`google.${e.trim().toLowerCase().replace(/[^a-z0-9]+/g,".").replace(/^\.+|\.+$/g,"")}`,T$e=e=>{try{const t=new URL(e),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"),s=r?jn(r):null,a=t.pathname==="/$discovery/rest"&&t.hostname.endsWith(".googleapis.com")&&t.hostname!=="www.googleapis.com";return s&&a?{service:t.hostname.split(".")[0]??"",version:s,discoveryUrl:t.toString()}:null}catch{return null}},BU=e=>!e||Object.keys(e).length===0?"":JSON.stringify(e,null,2),zU=e=>!e||e.length===0?"":JSON.stringify(e,null,2),C$e=e=>`stdio://local/${(e.name?.trim()||e.endpoint?.trim()||e.command?.trim()||"mcp").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"mcp"}`,vh=e=>{if(!e||e.detectedKind==="unknown")return{kind:"openapi",endpoint:e?.endpoint??"",specUrl:e?.specUrl??"",service:"",version:"",discoveryUrl:"",name:e?.name??"",namespace:e?.namespace||K0(e?.endpoint??""),authKind:"none",authHeaderName:"Authorization",authPrefix:"Bearer ",bearerToken:"",bearerProviderId:"",bearerHandle:"",workspaceOauthClientId:"",oauthClientId:"",oauthClientSecret:"",...Vc()};const t=e.detectedKind,n=e.authInference;let r="none",s="Authorization",a="Bearer ";n.supported&&(n.suggestedKind==="bearer"||n.suggestedKind==="apiKey"?(r="bearer",s=n.headerName??"Authorization",a=n.prefix??"Bearer "):n.suggestedKind==="oauth2"?(r="oauth2",s=n.headerName??"Authorization",a=n.prefix??"Bearer "):n.suggestedKind==="basic"&&(r="bearer",s="Authorization",a="Basic "));const o=t==="google_discovery"?T$e(e.specUrl??e.endpoint):null;return{kind:t,endpoint:e.endpoint,specUrl:e.specUrl??"",service:o?.service??"",version:o?.version??"",discoveryUrl:o?.discoveryUrl??"",name:e.name??"",namespace:e.namespace||K0(e.endpoint),authKind:r,authHeaderName:s,authPrefix:a,bearerToken:"",bearerProviderId:"",bearerHandle:"",workspaceOauthClientId:"",oauthClientId:"",oauthClientSecret:"",...Vc(t==="mcp"?Hm(e.transport):"")}},D3=e=>({...vh(),kind:e.kind,endpoint:e.endpoint??"",specUrl:"specUrl"in e?e.specUrl:"",service:"service"in e?e.service:"",version:"version"in e?e.version:"",discoveryUrl:"discoveryUrl"in e?e.discoveryUrl:"",name:e.name,namespace:e.namespace??("service"in e?FU(e.service):K0(e.endpoint??"")),authKind:e.kind==="google_discovery"?"oauth2":"none",workspaceOauthClientId:"",...e.kind==="mcp"&&e.connectionType==="command"?Um({command:e.command??"",argsText:zU(e.args),envText:BU(e.env),cwd:e.cwd??""}):Vc(e.kind==="mcp"?Hm(e.transport):"")}),I$e=(e,t)=>t==="google_discovery"&&e==="none"?"oauth2":e,A$e=e=>{if(e.kind==="none")return{kind:"none"};if(e.kind==="bearer"){if(!e.token.trim())throw new Error("Token is required for bearer probe auth.");return{kind:"bearer",headerName:jn(e.headerName),prefix:jn(e.prefix),token:e.token.trim()}}if(e.kind==="basic"){if(!e.username.trim())throw new Error("Username is required for basic probe auth.");return{kind:"basic",username:e.username.trim(),password:e.password}}const t=gs("Probe headers",e.headersText);if(!t)throw new Error("At least one header is required for headers probe auth.");return{kind:"headers",headers:t}},N$e=e=>{if(e.kind==="mcp"){if(e.transport==="stdio"){const s=C$e({name:e.name,endpoint:e.endpoint,command:e.command});if(!e.command.trim())throw new Error("Command is required for stdio MCP sources.");return{kind:"mcp",endpoint:s,name:jn(e.name),namespace:jn(e.namespace),transport:"stdio",queryParams:null,headers:null,command:e.command.trim(),args:HB("Args",e.argsText),env:gs("Environment",e.envText),cwd:jn(e.cwd)}}const r=e.endpoint.trim();if(!r)throw new Error("Endpoint is required.");return{kind:"mcp",endpoint:r,name:jn(e.name),namespace:jn(e.namespace),transport:e.transport===""?"auto":e.transport,queryParams:gs("Query params",e.queryParamsText),headers:gs("Request headers",e.headersText),command:null,args:null,env:null,cwd:null}}const t=R$e(e);if(e.kind==="openapi"){const r=e.endpoint.trim();if(!r)throw new Error("Endpoint is required.");const s=e.specUrl.trim();if(!s)throw new Error("OpenAPI sources require a spec URL.");return{kind:"openapi",endpoint:r,specUrl:s,name:jn(e.name),namespace:jn(e.namespace),auth:t}}if(e.kind==="google_discovery"){const r=e.service.trim(),s=e.version.trim();if(!r)throw new Error("Google Discovery sources require a service name.");if(!s)throw new Error("Google Discovery sources require a version.");if(e.authKind==="oauth2"&&e.workspaceOauthClientId.trim().length===0&&e.oauthClientId.trim().length===0)throw new Error("Google OAuth requires a workspace OAuth client or a new client ID.");return{kind:"google_discovery",service:r,version:s,discoveryUrl:jn(e.discoveryUrl),name:jn(e.name),namespace:jn(e.namespace),scopeOauthClientId:e.authKind==="oauth2"&&e.workspaceOauthClientId.trim().length>0?e.workspaceOauthClientId.trim():void 0,oauthClient:e.authKind==="oauth2"&&e.workspaceOauthClientId.trim().length===0?{clientId:e.oauthClientId.trim(),clientSecret:jn(e.oauthClientSecret)}:null,auth:t}}const n=e.endpoint.trim();if(!n)throw new Error("Endpoint is required.");return{kind:"graphql",endpoint:n,name:jn(e.name),namespace:jn(e.namespace),auth:t}},R$e=e=>{if(e.authKind==="none")return{kind:"none"};if(e.authKind==="bearer"){const t=jn(e.authHeaderName),n=e.authPrefix.length===0?null:e.authPrefix;if(e.bearerProviderId.trim()&&e.bearerHandle.trim())return{kind:"bearer",headerName:t,prefix:n,tokenRef:{providerId:e.bearerProviderId.trim(),handle:e.bearerHandle.trim()}};if(e.bearerToken.trim())return{kind:"bearer",headerName:t,prefix:n,token:e.bearerToken.trim()};throw new Error("Bearer auth requires a token. Select or create a secret, or enter a token directly.")}},F3=e=>{if(typeof window>"u")return null;const t=window.localStorage.getItem(`${DU}${e}`);if(!t)return null;try{return JSON.parse(t)}catch{return null}},B3=e=>{typeof window>"u"||window.localStorage.removeItem(`${DU}${e}`)},P$e=async e=>{if(typeof window>"u")throw new Error("OAuth popup is only available in a browser context");B3(e.sessionId);const t=window.open(e.authorizationUrl,"executor-source-oauth","popup=yes,width=520,height=720");if(!t)throw new Error("Popup blocked. Allow popups and try again.");return t.focus(),await new Promise((n,r)=>{let s=!1,a=0,o=0;const i=()=>{window.removeEventListener("message",l),a&&window.clearInterval(a),o&&window.clearTimeout(o),t.closed||t.close(),B3(e.sessionId)},c=d=>{s||(s=!0,i(),r(new Error(d)))},u=d=>{if(!d.ok){c(d.error||"OAuth failed");return}s||(s=!0,i(),n())},l=d=>{if(d.origin!==window.location.origin)return;const h=d.data;if(h){if(h.type==="executor:oauth-result"){if(h.ok&&h.sessionId!==e.sessionId||!h.ok&&h.sessionId!==null&&h.sessionId!==e.sessionId)return}else if(h.type!=="executor:source-oauth-result")return;u(h)}};window.addEventListener("message",l),o=window.setTimeout(()=>{c("OAuth popup timed out before completion. Please try again.")},E$e),a=window.setInterval(()=>{const d=F3(e.sessionId);if(d){u(d);return}t.closed&&(window.clearInterval(a),a=0,window.setTimeout(()=>{const h=F3(e.sessionId);if(h){u(h);return}c("OAuth popup was closed before completion.")},1500))},300)})};function O$e(){const e=Ul(),t=yye(),n=t8(),r=kye(),s=xye(),a=lye("google_workspace"),o=VT(),i=iye(),c=GT(),u=ZF(),[l,d]=O.useState(""),[h,f]=O.useState(!1),[p,x]=O.useState({kind:"none",token:"",headerName:"Authorization",prefix:"Bearer ",username:"",password:"",headersText:""}),[g,b]=O.useState("idle"),[y,_]=O.useState(vh()),[S,w]=O.useState(null),[v,C]=O.useState(null),[I,R]=O.useState(null),[N,z]=O.useState(!1),[V,ne]=O.useState(!1),[J,te]=O.useState([]),[se,oe]=O.useState(null),me=(H,ie)=>{_(Se=>({...Se,[H]:ie}))},Xe=H=>{_(ie=>({...ie,...zB(ie,H)}))},T=(H,ie)=>{_(Se=>Se.transport==="stdio"?Se:{...Se,[H]:ie})},q=(H,ie)=>{_(Se=>Se.transport==="stdio"?{...Se,[H]:ie}:Se)},X=H=>{_(ie=>({...ie,kind:H,authKind:I$e(ie.authKind,H),workspaceOauthClientId:H==="google_discovery"?ie.workspaceOauthClientId:""}))},A=(H,ie)=>{x(Se=>({...Se,[H]:ie}))},P=bw.filter(H=>H.groupId==="google_workspace"&&H.batchable),D=async()=>{oe(null);const H=l.trim();if(!H){oe({tone:"error",text:"Please enter a URL to discover."});return}b("discovering");try{const ie={url:H,...h&&p.kind!=="none"?{probeAuth:A$e(p)}:{}},Se=await t.mutateAsync(ie);_(vh(Se)),b("editing"),Se.detectedKind==="unknown"?oe({tone:"info",text:"Could not auto-detect the source type. Please configure manually."}):Se.warnings.length>0&&oe({tone:"info",text:Se.warnings.join(" ")})}catch(ie){b("idle"),oe({tone:"error",text:ie instanceof Error?ie.message:"Discovery failed."})}},Y=()=>{_(vh()),b("editing"),oe(null)},ke=async H=>{if(H.batchable){te(Se=>Se.includes(H.id)?Se.filter($e=>$e!==H.id):[...Se,H.id]),oe(null);return}if(Nwe(H)){d(""),_(D3(H)),b("editing"),oe({tone:"info",text:`${H.name} loaded. Review the local command, then connect.`});return}const ie="specUrl"in H?H.specUrl:H.endpoint??"";d(H.endpoint??""),oe(null),b("discovering");try{const Se=await t.mutateAsync({url:ie});let $e={...vh(Se),name:H.name,endpoint:H.endpoint??"",namespace:H.namespace??K0(H.endpoint??"")};H.kind==="mcp"&&($e={...$e,...H.connectionType==="command"?Um({command:H.command??"",argsText:zU(H.args),envText:BU(H.env),cwd:H.cwd??""}):Vc(Hm(H.transport))}),"specUrl"in H&&($e={...$e,specUrl:H.specUrl}),_($e),b("editing"),Se.warnings.length>0&&oe({tone:"info",text:Se.warnings.join(" ")})}catch(Se){_(D3(H)),b("editing"),oe({tone:"error",text:`Discovery failed for ${H.name}: ${Se instanceof Error?Se.message:"unknown error"}. Configure manually.`})}},ye=async()=>{oe(null);try{const H=N$e(y);b("connecting");const ie=await n.mutateAsync(H);w(ie),ie.kind==="connected"?(R(null),b("connected"),oe({tone:"success",text:`"${ie.source.name}" connected successfully.`}),setTimeout(()=>{e({to:"/sources/$sourceId",params:{sourceId:ie.source.id},search:{tab:"model"}})},1200)):ie.kind==="credential_required"?(R(null),b("credential_required"),oe({tone:"info",text:"This source requires credentials. Configure auth below, then connect again."}),y.authKind==="none"&&me("authKind","bearer")):ie.kind==="oauth_required"&&(R(null),b("oauth_required"),C({source:ie.source,sessionId:ie.sessionId,authorizationUrl:ie.authorizationUrl}),oe({tone:"info",text:"This source requires OAuth authentication. Click the button below to sign in."}))}catch(H){b("editing"),oe({tone:"error",text:H instanceof Error?H.message:"Connection failed."})}},we=async()=>{if(!(!v&&!I)){oe(null),z(!0);try{await P$e({authorizationUrl:v?.authorizationUrl??I.authorizationUrl,sessionId:v?.sessionId??I.sessionId}),u(),i(),b("connected"),oe({tone:"success",text:v?`"${v.source.name}" connected via OAuth.`:`Connected ${I?.sourceIds.length??0} Google source${(I?.sourceIds.length??0)===1?"":"s"} via OAuth.`}),setTimeout(()=>{if(v){e({to:"/sources/$sourceId",params:{sourceId:v.source.id},search:{tab:"model"}});return}e({to:"/"})},1200)}catch(H){oe({tone:"error",text:H instanceof Error?H.message:"OAuth flow failed."})}finally{z(!1)}}},Oe=async()=>{const H=y.workspaceOauthClientId.trim();if(H.length>0)return H;const ie=y.oauthClientId.trim();if(ie.length===0)throw new Error("Choose an existing Google workspace OAuth client or enter a new client ID.");const Se=await s.mutateAsync({providerKey:"google_workspace",label:"Google Workspace",oauthClient:{clientId:ie,clientSecret:jn(y.oauthClientSecret)}});return me("workspaceOauthClientId",Se.id),Se.id},G=async()=>{if(J.length!==0){oe(null);try{const H=await Oe(),ie=P.filter(Je=>J.includes(Je.id)),Se={scopeOauthClientId:H,sources:ie.map(Je=>({service:Je.service,version:Je.version,discoveryUrl:Je.discoveryUrl,name:Je.name,namespace:FU(Je.service)}))};ne(!0),b("connecting");const $e=await r.mutateAsync(Se);if($e.providerOauthSession){R({sessionId:$e.providerOauthSession.sessionId,authorizationUrl:$e.providerOauthSession.authorizationUrl,sourceIds:$e.providerOauthSession.sourceIds}),C(null),ne(!1),b("oauth_required"),oe(null);return}te([]),R(null),ne(!1),b("connected"),oe({tone:"success",text:`Connected ${$e.results.length} Google source${$e.results.length===1?"":"s"}.`}),setTimeout(()=>{e({to:"/"})},1200)}catch(H){ne(!1),b("idle"),oe({tone:"error",text:H instanceof Error?H.message:"Batch connection failed."})}}},W=async()=>{await ye()},ae=()=>{b("editing"),oe(null),w(null),C(null)},ce=g==="discovering",_e=g==="connecting",Re=ce||_e||N||r.status==="pending"||s.status==="pending";return m.jsx("div",{className:"flex-1 overflow-y-auto",children:m.jsxs("div",{className:"mx-auto max-w-3xl px-6 py-8 lg:px-10 lg:py-12",children:[m.jsxs(nr,{to:"/",className:"inline-flex items-center gap-1.5 text-[12px] font-medium text-muted-foreground transition-colors hover:text-foreground mb-6",children:[m.jsx(k8,{className:"size-3.5"}),"Back"]}),m.jsxs("div",{className:"flex items-center justify-between gap-4 mb-6",children:[m.jsx("h1",{className:"font-display text-2xl tracking-tight text-foreground lg:text-3xl",children:"Add source"}),g==="editing"&&m.jsx(Cs,{variant:"outline",children:y.kind})]}),g!=="idle"&&g!=="discovering"&&m.jsx("div",{className:"mb-6 flex items-center gap-1.5","aria-label":"Progress",children:["discover","configure","connect"].map((H,ie)=>{const $e={editing:1,connecting:2,credential_required:1,oauth_required:2,connected:2}[g]??0,Je=ie<$e,Gn=ie===$e;return m.jsxs("div",{className:"flex items-center gap-1.5",children:[ie>0&&m.jsx("div",{className:je("h-px w-6 transition-colors",Je||Gn?"bg-primary/40":"bg-border")}),m.jsxs("div",{className:je("flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[10px] font-medium uppercase tracking-[0.06em] transition-colors",Je?"text-primary":Gn?"text-foreground bg-muted/50":"text-muted-foreground/40"),children:[Je?m.jsx(hi,{className:"size-2.5"}):m.jsx("span",{className:"flex size-3.5 items-center justify-center rounded-full border text-[9px] tabular-nums border-current",children:ie+1}),H]})]},H)})}),se&&m.jsx(L$e,{state:se,className:"mb-6"}),(g==="idle"||g==="discovering")&&m.jsx(jB,{className:"mb-6 rounded-xl border border-border bg-card/80 p-5",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."}),(g==="idle"||g==="discovering")&&m.jsx("div",{className:"space-y-6",children:m.jsx(Cg,{title:"Discover",children:m.jsxs("div",{className:"space-y-4",children:[m.jsx("p",{className:"text-[13px] text-muted-foreground",children:"Enter a URL and we'll auto-detect the source type, endpoint, auth requirements, and more."}),m.jsx(yt,{label:"URL",children:m.jsxs("div",{className:"space-y-0",children:[m.jsxs("div",{className:"flex gap-2",children:[m.jsx("input",{value:l,onChange:H=>d(H.target.value),placeholder:"https://api.example.com or https://mcp.example.com/mcp",onKeyDown:H=>{H.key==="Enter"&&!ce&&D()},className:"h-9 flex-1 rounded-lg border border-input bg-background px-3 font-mono text-[12px] text-foreground outline-none transition-colors placeholder:text-muted-foreground/35 focus:border-ring focus:ring-1 focus:ring-ring/25"}),m.jsxs(en,{onClick:D,disabled:Re,children:[ce?m.jsx(wr,{className:"size-3.5"}):m.jsx(h1e,{className:"size-3.5"}),ce?"Discovering…":"Discover"]})]}),ce&&m.jsx("div",{className:"mt-1.5 h-0.5 w-full overflow-hidden rounded-full bg-muted",children:m.jsx("div",{className:"h-full w-1/4 rounded-full bg-primary/60",style:{animation:"indeterminate-progress 1.2s ease-in-out infinite"}})})]})}),m.jsx("div",{children:m.jsx("button",{type:"button",onClick:()=>f(!h),className:"text-[12px] font-medium text-muted-foreground transition-colors hover:text-foreground",children:h?"Hide probe auth":"Need auth to discover?"})}),h&&m.jsxs("div",{className:"rounded-lg border border-border bg-card/70 p-4 space-y-3",children:[m.jsx(yt,{label:"Auth type",children:m.jsx(rh,{value:p.kind,onChange:H=>A("kind",H),options:S$e.map(H=>({value:H,label:H}))})}),p.kind==="bearer"&&m.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[m.jsx(yt,{label:"Header name",children:m.jsx(fn,{value:p.headerName,onChange:H=>A("headerName",H),placeholder:"Authorization"})}),m.jsx(yt,{label:"Prefix",children:m.jsx(fn,{value:p.prefix,onChange:H=>A("prefix",H),placeholder:"Bearer "})}),m.jsx(yt,{label:"Token",className:"sm:col-span-2",children:m.jsx(fn,{value:p.token,onChange:H=>A("token",H),placeholder:"sk-...",mono:!0})})]}),p.kind==="basic"&&m.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[m.jsx(yt,{label:"Username",children:m.jsx(fn,{value:p.username,onChange:H=>A("username",H),placeholder:"user"})}),m.jsx(yt,{label:"Password",children:m.jsx(fn,{value:p.password,onChange:H=>A("password",H),placeholder:"pass"})})]}),p.kind==="headers"&&m.jsx(yt,{label:"Headers (JSON)",children:m.jsx(sh,{value:p.headersText,onChange:H=>A("headersText",H),placeholder:`{
|
|
322
|
+
"x-api-key": "..."
|
|
323
|
+
}`})})]}),m.jsx("div",{className:"flex items-center justify-end border-t border-border pt-4",children:m.jsx("button",{type:"button",onClick:Y,disabled:Re,className:"text-[12px] font-medium text-muted-foreground transition-colors hover:text-foreground",children:"Skip discovery and configure manually"})}),m.jsxs("div",{className:"space-y-5 border-t border-border pt-5",children:[m.jsxs("div",{children:[m.jsx("p",{className:"text-[13px] font-medium text-foreground",children:"Start from a template"}),m.jsx("p",{className:"mt-0.5 text-[12px] text-muted-foreground",children:"Pick a known source to skip discovery, or select multiple Google APIs for batch connect."})]}),(()=>{const H=bw.filter(ie=>ie.groupId!=="google_workspace");return H.length>0&&m.jsxs("div",{className:"space-y-2.5",children:[m.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-[0.1em] text-muted-foreground/50",children:"Popular"}),m.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:H.map(ie=>m.jsxs("button",{type:"button",onClick:()=>ke(ie),disabled:Re,className:"group rounded-xl border border-border bg-card/70 px-4 py-3 text-left transition-all hover:bg-accent/50 hover:border-primary/20 hover:shadow-sm disabled:opacity-60",children:[m.jsxs("div",{className:"mb-1.5 flex items-center gap-2.5",children:[m.jsx("div",{className:"flex size-5 shrink-0 items-center justify-center rounded-md bg-muted/50",children:m.jsx(Mf,{endpoint:ie.endpoint,kind:ie.kind,className:"size-3.5"})}),m.jsx("span",{className:"flex-1 truncate text-[13px] font-medium text-foreground group-hover:text-primary transition-colors",children:ie.name}),m.jsx(Cs,{variant:"outline",className:"text-[9px] opacity-60 group-hover:opacity-100 transition-opacity",children:ie.kind})]}),m.jsx("span",{className:"line-clamp-1 text-[11px] text-muted-foreground/70",children:ie.summary})]},ie.id))})]})})(),m.jsxs("div",{className:"space-y-3",children:[m.jsxs("div",{className:"flex items-center justify-between gap-3",children:[m.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-[0.1em] text-muted-foreground/50",children:"Google Workspace"}),P.length>0&&m.jsxs("div",{className:"flex items-center gap-2",children:[J.length>0&&m.jsx("button",{type:"button",onClick:()=>te([]),disabled:Re,className:"text-[11px] font-medium text-muted-foreground/60 transition-colors hover:text-foreground",children:"Clear"}),m.jsx("button",{type:"button",onClick:()=>te(J.length===P.length?[]:P.map(H=>H.id)),disabled:Re,className:"text-[11px] font-medium text-muted-foreground/60 transition-colors hover:text-foreground",children:J.length===P.length?"Deselect all":"Select all"})]})]}),m.jsx("div",{className:"grid gap-1.5 sm:grid-cols-2 lg:grid-cols-3",children:P.map(H=>{const ie=J.includes(H.id);return m.jsxs("button",{type:"button",onClick:()=>ke(H),disabled:Re,className:je("group flex items-center gap-3 rounded-lg border px-3.5 py-2.5 text-left transition-all disabled:opacity-60",ie?"border-primary/40 bg-primary/6 shadow-sm":"border-border bg-card/50 hover:bg-accent/40 hover:border-border"),children:[m.jsx("div",{className:je("flex size-4 shrink-0 items-center justify-center rounded transition-colors",ie?"text-primary":"text-muted-foreground/30 group-hover:text-muted-foreground/50"),children:ie?m.jsx(hi,{className:"size-3.5"}):m.jsx(Mf,{endpoint:H.endpoint,kind:H.kind,className:"size-3.5"})}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("span",{className:je("block truncate text-[12px] font-medium transition-colors",ie?"text-foreground":"text-foreground/80"),children:H.name}),m.jsx("span",{className:"block truncate text-[10px] text-muted-foreground/60",children:H.summary})]})]},H.id)})}),J.length>0&&m.jsxs("div",{className:"rounded-xl border border-primary/20 bg-gradient-to-b from-primary/4 to-transparent overflow-hidden",children:[m.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-primary/10 px-5 py-3",children:[m.jsxs("div",{className:"flex items-center gap-2.5",children:[m.jsx("div",{className:"flex size-6 items-center justify-center rounded-md bg-primary/10 text-primary",children:m.jsx("span",{className:"text-[11px] font-bold tabular-nums",children:J.length})}),m.jsxs("p",{className:"text-[13px] font-medium text-foreground",children:["Connect Google API",J.length===1?"":"s"]})]}),m.jsx("p",{className:"hidden text-[11px] text-muted-foreground/60 sm:block",children:"One consent screen for all"})]}),m.jsxs("div",{className:"px-5 py-4 space-y-4",children:[m.jsx(yt,{label:"Workspace OAuth client",children:m.jsxs("select",{value:y.workspaceOauthClientId,onChange:H=>me("workspaceOauthClientId",H.target.value),className:"h-9 w-full rounded-lg border border-input bg-background px-3 text-[13px] text-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring/25",children:[m.jsx("option",{value:"",children:"Enter new client credentials"}),a.status==="ready"&&a.data.map(H=>m.jsx("option",{value:H.id,children:H.label??H.clientId},H.id))]})}),y.workspaceOauthClientId.trim().length===0&&m.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[m.jsx(yt,{label:"Client ID",className:"sm:col-span-2",children:m.jsx(fn,{type:"password",value:y.oauthClientId,onChange:H=>me("oauthClientId",H),placeholder:"1234567890-abcdef.apps.googleusercontent.com"})}),m.jsx(yt,{label:"Client secret",className:"sm:col-span-2",children:m.jsx(fn,{type:"password",value:y.oauthClientSecret,onChange:H=>me("oauthClientSecret",H),placeholder:"GOCSPX-..."})})]}),m.jsx("div",{className:"flex items-center justify-end pt-1",children:m.jsxs(en,{type:"button",onClick:G,disabled:Re,children:[Re?m.jsx(wr,{className:"size-3.5"}):m.jsx(_o,{className:"size-3.5"}),"Connect ",J.length," source",J.length===1?"":"s"]})})]})]})]})]})]})})}),V&&g==="connecting"&&m.jsx("div",{className:"flex flex-col items-center justify-center py-20",children:m.jsxs("div",{className:"space-y-5 text-center",children:[m.jsx("div",{className:"mx-auto flex size-14 items-center justify-center rounded-2xl border border-primary/15 bg-primary/6",children:m.jsx(wr,{className:"size-6 text-primary"})}),m.jsxs("div",{className:"space-y-1.5",children:[m.jsxs("h2",{className:"font-display text-xl tracking-tight text-foreground",children:["Connecting ",J.length," source",J.length===1?"":"s"]}),m.jsx("p",{className:"text-[13px] text-muted-foreground/70",children:"Setting up Google Workspace APIs\\u2026"})]})]})}),(g==="editing"||g==="connecting"&&!V||g==="credential_required")&&m.jsxs("div",{className:"space-y-6",children:[m.jsx(Cg,{title:"Configuration",children:m.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[m.jsx(yt,{label:"Name",children:m.jsx(fn,{value:y.name,onChange:H=>me("name",H),placeholder:"My API"})}),m.jsx(yt,{label:"Kind",children:m.jsx(rh,{value:y.kind,onChange:H=>X(H),options:_$e.map(H=>({value:H,label:H}))})}),y.kind!=="google_discovery"&&!(y.kind==="mcp"&&y.transport==="stdio")&&m.jsx(yt,{label:"Endpoint",className:"sm:col-span-2",children:m.jsx(fn,{value:y.endpoint,onChange:H=>me("endpoint",H),placeholder:"https://api.example.com",mono:!0})}),m.jsx(yt,{label:"Namespace",children:m.jsx(fn,{value:y.namespace,onChange:H=>me("namespace",H),placeholder:"example"})}),y.kind==="openapi"&&m.jsx(yt,{label:"Spec URL",className:"sm:col-span-2",children:m.jsx(fn,{value:y.specUrl,onChange:H=>me("specUrl",H),placeholder:"https://example.com/openapi.yaml",mono:!0})}),y.kind==="google_discovery"&&m.jsxs(m.Fragment,{children:[m.jsx(yt,{label:"Service",children:m.jsx(fn,{value:y.service,onChange:H=>me("service",H),placeholder:"sheets"})}),m.jsx(yt,{label:"Version",children:m.jsx(fn,{value:y.version,onChange:H=>me("version",H),placeholder:"v4"})}),m.jsx(yt,{label:"Discovery URL (optional)",className:"sm:col-span-2",children:m.jsx(fn,{value:y.discoveryUrl,onChange:H=>me("discoveryUrl",H),placeholder:"https://www.googleapis.com/discovery/v1/apis/sheets/v4/rest",mono:!0})}),m.jsx("div",{className:"sm:col-span-2 rounded-lg border border-border bg-card/60 px-3 py-2 text-[12px] text-muted-foreground",children:"Common Google API versions: Gmail `v1`, Sheets `v4`, Drive `v3`, Calendar `v3`, Docs `v1`."})]})]})}),y.kind==="mcp"&&m.jsx(Cg,{title:"Transport",children:m.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[m.jsx(yt,{label:"Transport mode",children:m.jsx(rh,{value:y.transport||"auto",onChange:H=>Xe(H),options:v$e.map(H=>({value:H,label:H}))})}),y.transport==="stdio"?m.jsxs("div",{className:"sm:col-span-2 grid gap-4 sm:grid-cols-2",children:[m.jsx(yt,{label:"Command",children:m.jsx(fn,{value:y.command,onChange:H=>q("command",H),placeholder:"npx",mono:!0})}),m.jsx(yt,{label:"Working directory (optional)",children:m.jsx(fn,{value:y.cwd,onChange:H=>q("cwd",H),placeholder:"/path/to/project",mono:!0})}),m.jsx(yt,{label:"Args (JSON)",className:"sm:col-span-2",children:m.jsx(sh,{value:y.argsText,onChange:H=>q("argsText",H),placeholder:`[
|
|
324
|
+
"-y",
|
|
325
|
+
"chrome-devtools-mcp@latest"
|
|
326
|
+
]`})}),m.jsx(yt,{label:"Environment (JSON)",className:"sm:col-span-2",children:m.jsx(sh,{value:y.envText,onChange:H=>q("envText",H),placeholder:`{
|
|
327
|
+
"CHROME_PATH": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
|
|
328
|
+
}`})})]}):m.jsxs("div",{className:"sm:col-span-2 grid gap-4 sm:grid-cols-2",children:[m.jsx(yt,{label:"Query params (JSON)",children:m.jsx(sh,{value:y.queryParamsText,onChange:H=>T("queryParamsText",H),placeholder:`{
|
|
329
|
+
"workspace": "demo"
|
|
330
|
+
}`})}),m.jsx(yt,{label:"Headers (JSON)",children:m.jsx(sh,{value:y.headersText,onChange:H=>T("headersText",H),placeholder:`{
|
|
331
|
+
"x-api-key": "..."
|
|
332
|
+
}`})})]})]})}),g==="credential_required"&&m.jsxs("div",{className:"flex items-start gap-3 rounded-xl border border-amber-300/40 bg-amber-50/50 px-4 py-3.5 dark:border-amber-500/20 dark:bg-amber-950/20",children:[m.jsx("div",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-amber-100/80 dark:bg-amber-900/40",children:m.jsxs("svg",{className:"size-3.5 text-amber-600 dark:text-amber-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M12 9v4"}),m.jsx("path",{d:"M12 17h.01"}),m.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})]})}),m.jsxs("div",{className:"space-y-0.5",children:[m.jsx("p",{className:"text-[12px] font-medium text-amber-900 dark:text-amber-200",children:"Credentials required"}),m.jsx("p",{className:"text-[11px] leading-relaxed text-amber-800/70 dark:text-amber-300/60",children:"The server responded that this source requires authentication. Add a token or secret below, then try connecting again."})]})]}),y.kind!=="mcp"&&m.jsx(Cg,{title:"Authentication",children:m.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[m.jsx(yt,{label:"Auth mode",children:m.jsx(rh,{value:y.authKind,onChange:H=>me("authKind",H),options:w$e.map(H=>({value:H,label:H}))})}),y.kind==="google_discovery"&&m.jsx("div",{className:"sm:col-span-2 rounded-lg border border-border bg-card/60 px-3 py-2 text-[12px] text-muted-foreground",children:y.authKind==="oauth2"?"OAuth starts after you click Connect. Choose an existing workspace OAuth client or enter a new client once, then reuse it across Google sources.":"Choosing auth mode 'none' skips the Google OAuth popup. Use 'oauth2' if you want executor to start the sign-in flow for you."}),y.kind==="google_discovery"&&y.authKind==="oauth2"&&m.jsxs(m.Fragment,{children:[m.jsx(yt,{label:"Workspace OAuth client",className:"sm:col-span-2",children:m.jsx(rh,{value:y.workspaceOauthClientId,onChange:H=>me("workspaceOauthClientId",H),options:[{value:"",label:"Enter new client"},...a.status==="ready"?a.data.map(H=>({value:H.id,label:H.label??H.clientId})):[]]})}),y.workspaceOauthClientId.trim().length===0&&m.jsxs(m.Fragment,{children:[m.jsx(yt,{label:"New client ID",className:"sm:col-span-2",children:m.jsx(fn,{type:"password",value:y.oauthClientId,onChange:H=>me("oauthClientId",H),placeholder:"1234567890-abcdef.apps.googleusercontent.com"})}),m.jsx(yt,{label:"New client secret",className:"sm:col-span-2",children:m.jsx(fn,{type:"password",value:y.oauthClientSecret,onChange:H=>me("oauthClientSecret",H),placeholder:"GOCSPX-..."})})]})]}),y.authKind!=="none"&&m.jsxs(m.Fragment,{children:[m.jsx(yt,{label:"Header name",children:m.jsx(fn,{value:y.authHeaderName,onChange:H=>me("authHeaderName",H),placeholder:"Authorization"})}),m.jsx(yt,{label:"Prefix",children:m.jsx(fn,{value:y.authPrefix,onChange:H=>me("authPrefix",H),placeholder:"Bearer "})})]}),y.authKind==="bearer"&&m.jsx(yt,{label:"Token",className:"sm:col-span-2",children:m.jsx($$e,{instanceConfig:o,secrets:c,handle:y.bearerHandle,inlineToken:y.bearerToken,onSelectSecret:(H,ie)=>{me("bearerProviderId",H),me("bearerHandle",ie),me("bearerToken","")},onChangeToken:H=>{me("bearerToken",H),me("bearerProviderId",""),me("bearerHandle","")}})})]})}),m.jsxs("div",{className:"flex items-center justify-end gap-3 border-t border-border pt-5",children:[g==="credential_required"&&m.jsx(en,{variant:"ghost",type:"button",onClick:ae,children:"Back to edit"}),m.jsx(nr,{to:"/",className:"inline-flex",children:m.jsx(en,{variant:"ghost",type:"button",children:"Cancel"})}),m.jsxs(en,{onClick:g==="credential_required"?W:ye,disabled:Re,children:[_e?m.jsx(wr,{className:"size-3.5"}):m.jsx(_o,{className:"size-3.5"}),_e?"Connecting…":"Connect"]})]})]}),g==="oauth_required"&&(v||I)&&m.jsx("div",{className:"flex flex-col items-center justify-center py-16",children:m.jsxs("div",{className:"w-full max-w-sm space-y-6 text-center",children:[m.jsx("div",{className:"mx-auto flex size-16 items-center justify-center rounded-2xl border border-primary/20 bg-gradient-to-b from-primary/10 to-primary/4",children:N?m.jsx(wr,{className:"size-6 text-primary"}):m.jsxs("svg",{className:"size-6 text-primary",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),m.jsx("path",{d:"M7 11V7a5 5 0 0110 0v4"})]})}),m.jsxs("div",{className:"space-y-2",children:[m.jsx("h2",{className:"font-display text-xl tracking-tight text-foreground",children:N?"Waiting for sign-in…":"Sign in to continue"}),m.jsx("p",{className:"text-[13px] leading-relaxed text-muted-foreground",children:v?m.jsxs(m.Fragment,{children:[m.jsx("strong",{className:"text-foreground",children:v.source.name})," ","requires OAuth authentication. A popup will open for you to authorize access."]}):m.jsxs(m.Fragment,{children:[I.sourceIds.length," Google source",I.sourceIds.length===1?"":"s"," need",I.sourceIds.length===1?"s":""," OAuth. One consent screen covers all selected APIs."]})})]}),m.jsxs("div",{className:"flex flex-col items-center gap-3",children:[m.jsxs(en,{onClick:we,disabled:N,className:"w-full max-w-xs",children:[N?m.jsx(wr,{className:"size-3.5"}):null,N?"Authenticating…":"Open sign-in"]}),!N&&m.jsx("button",{type:"button",onClick:ae,className:"text-[12px] font-medium text-muted-foreground/60 transition-colors hover:text-foreground",children:"Back to configuration"})]})]})}),g==="connected"&&m.jsx("div",{className:"flex flex-col items-center justify-center py-20",children:m.jsxs("div",{className:"space-y-5 text-center",children:[m.jsx("div",{className:"mx-auto flex size-14 items-center justify-center rounded-full bg-primary/10 ring-4 ring-primary/5",children:m.jsx(hi,{className:"size-6 text-primary"})}),m.jsxs("div",{className:"space-y-1.5",children:[m.jsxs("h2",{className:"font-display text-xl tracking-tight text-foreground",children:[S?S.source.name:I?`${I.sourceIds.length} source${I.sourceIds.length===1?"":"s"}`:"Source"," ","connected"]}),m.jsx("p",{className:"text-[13px] text-muted-foreground/70",children:"Redirecting\\u2026"})]})]})})]})})}function Cg(e){return m.jsxs("section",{className:je("rounded-xl border border-border bg-card/80",e.className),children:[m.jsx("div",{className:"border-b border-border px-5 py-3",children:m.jsx("h2",{className:"text-sm font-semibold text-foreground",children:e.title})}),m.jsx("div",{className:"p-5",children:e.children})]})}function yt(e){return m.jsxs("label",{className:je("block space-y-1.5",e.className),children:[m.jsx("span",{className:"text-[12px] font-medium text-foreground",children:e.label}),e.children]})}function fn(e){return m.jsx("input",{type:e.type||"text",value:e.value,onChange:t=>e.onChange(t.target.value),placeholder:e.placeholder,className:je("h-9 w-full rounded-lg border border-input bg-background px-3 text-[13px] text-foreground outline-none transition-colors placeholder:text-muted-foreground/35 focus:border-ring focus:ring-1 focus:ring-ring/25",e.mono&&"font-mono text-[12px]")})}function rh(e){return m.jsx("select",{value:e.value,onChange:t=>e.onChange(t.target.value),className:"h-9 w-full rounded-lg border border-input bg-background px-3 text-[13px] text-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring/25",children:e.options.map(t=>m.jsx("option",{value:t.value,children:t.label},t.value))})}function sh(e){return m.jsx("textarea",{value:e.value,onChange:t=>e.onChange(t.target.value),placeholder:e.placeholder,spellCheck:!1,className:"min-h-28 w-full rounded-lg border border-input bg-background px-3 py-2.5 font-mono text-[12px] leading-relaxed text-foreground outline-none transition-colors placeholder:text-muted-foreground/35 focus:border-ring focus:ring-1 focus:ring-ring/25"})}function L$e(e){return m.jsxs("div",{className:je("flex items-start gap-2.5 rounded-lg border px-4 py-3 text-[13px]",e.state.tone==="success"&&"border-primary/30 bg-primary/8 text-foreground",e.state.tone==="info"&&"border-border bg-card text-muted-foreground",e.state.tone==="error"&&"border-destructive/30 bg-destructive/8 text-destructive",e.className),children:[m.jsxs("span",{className:"mt-0.5 shrink-0",children:[e.state.tone==="success"&&m.jsx(hi,{className:"size-3.5 text-primary"}),e.state.tone==="error"&&m.jsxs("svg",{className:"size-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("circle",{cx:"12",cy:"12",r:"10"}),m.jsx("path",{d:"M15 9l-6 6"}),m.jsx("path",{d:"M9 9l6 6"})]}),e.state.tone==="info"&&m.jsxs("svg",{className:"size-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("circle",{cx:"12",cy:"12",r:"10"}),m.jsx("path",{d:"M12 16v-4"}),m.jsx("path",{d:"M12 8h.01"})]})]}),m.jsx("span",{children:e.state.text})]})}const a_="__create_new__",o_="__inline_token__";function $$e(e){const{instanceConfig:t,secrets:n,handle:r,inlineToken:s,onSelectSecret:a,onChangeToken:o}=e,i=WT(),[c,u]=O.useState(!1),[l,d]=O.useState(!1),[h,f]=O.useState(""),[p,x]=O.useState(""),[g,b]=O.useState(""),[y,_]=O.useState(null),S=t.status==="ready"?t.data.secretProviders.filter(R=>R.canStore):[];O.useEffect(()=>{g.length>0||t.status==="ready"&&b(t.data.defaultSecretStoreProvider)},[t,g]);const w=c?a_:l?o_:r||"",v=R=>{if(R===a_){u(!0),d(!1),f(""),x(""),b(t.status==="ready"?t.data.defaultSecretStoreProvider:""),_(null);return}if(R===o_){d(!0),u(!1),a("","");return}if(R===""){d(!1),u(!1),a("","");return}d(!1),u(!1);const N=n.status==="ready"?n.data.find(z=>z.id===R):null;a(N?.providerId??"local",R)},C=async()=>{_(null);const R=h.trim();if(!R){_("Name is required.");return}if(!p){_("Value is required.");return}try{const N=await i.mutateAsync({name:R,value:p,...g?{providerId:g}:{}});a(N.providerId,N.id),u(!1)}catch(N){_(N instanceof Error?N.message:"Failed creating secret.")}};if(n.status!=="ready")return m.jsx("select",{disabled:!0,className:"h-9 w-full rounded-lg border border-input bg-background px-3 text-[13px] text-muted-foreground outline-none opacity-60",children:m.jsx("option",{children:"Loading..."})});const I=n.data;return m.jsxs("div",{className:"space-y-2",children:[m.jsxs("select",{value:w,onChange:R=>v(R.target.value),className:"h-9 w-full rounded-lg border border-input bg-background px-3 text-[13px] text-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring/25",children:[m.jsx("option",{value:"",children:"Select a secret..."}),I.map(R=>m.jsxs("option",{value:R.id,children:[R.name||R.id," (",R.providerId,")"]},R.id)),m.jsx("option",{value:o_,children:"Paste token directly"}),m.jsx("option",{value:a_,children:"+ Create new secret"})]}),l&&m.jsx("input",{type:"password",value:s,onChange:R=>o(R.target.value),placeholder:"sk-... or ghp_...",className:"h-9 w-full rounded-lg border border-input bg-background px-3 font-mono text-[12px] text-foreground outline-none transition-colors placeholder:text-muted-foreground/35 focus:border-ring focus:ring-1 focus:ring-ring/25",autoFocus:!0}),c&&m.jsxs("div",{className:"rounded-lg border border-primary/20 bg-card/80 p-3 space-y-3",children:[y&&m.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/8 px-3 py-2 text-[12px] text-destructive",children:y}),m.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[m.jsxs("label",{className:"block space-y-1",children:[m.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Name"}),m.jsx("input",{value:h,onChange:R=>f(R.target.value),placeholder:"API Key",className:"h-8 w-full rounded-lg border border-input bg-background px-3 text-[12px] text-foreground outline-none transition-colors placeholder:text-muted-foreground/35 focus:border-ring focus:ring-1 focus:ring-ring/25",autoFocus:!0})]}),m.jsxs("label",{className:"block space-y-1",children:[m.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Value"}),m.jsx("input",{type:"password",value:p,onChange:R=>x(R.target.value),placeholder:"sk-...",className:"h-8 w-full rounded-lg border border-input bg-background px-3 font-mono text-[11px] text-foreground outline-none transition-colors placeholder:text-muted-foreground/35 focus:border-ring focus:ring-1 focus:ring-ring/25"})]}),m.jsxs("label",{className:"block space-y-1",children:[m.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Store in"}),m.jsx("select",{value:g,onChange:R=>b(R.target.value),className:"h-8 w-full rounded-lg border border-input bg-background px-3 text-[12px] text-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring/25",children:S.map(R=>m.jsx("option",{value:R.id,children:R.name},R.id))})]})]}),m.jsxs("div",{className:"flex items-center justify-end gap-2",children:[m.jsx("button",{type:"button",onClick:()=>u(!1),className:"rounded-md px-2.5 py-1 text-[11px] font-medium text-muted-foreground transition-colors hover:text-foreground",children:"Cancel"}),m.jsxs(en,{size:"sm",onClick:C,disabled:i.status==="pending",children:[i.status==="pending"&&m.jsx(wr,{className:"size-3"}),"Store & use"]})]})]})]})}const M$e=["model","discover"],fu=PH({component:V1e}),j$e=Yc({getParentRoute:()=>fu,path:"/",component:Ewe}),D$e=Yc({getParentRoute:()=>fu,path:"/sources/new",component:Kwe}),F$e=Yc({getParentRoute:()=>fu,path:"/sources/add",component:O$e}),cb=Yc({getParentRoute:()=>fu,path:"/sources/$sourceId",validateSearch:e=>({tab:typeof e.tab=="string"&&M$e.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}),component:z$e}),UU=Yc({getParentRoute:()=>fu,path:"/sources/$sourceId/edit",component:U$e}),B$e=Yc({getParentRoute:()=>fu,path:"/secrets",component:g$e});function z$e(){const{sourceId:e}=cb.useParams(),t=cb.useSearch(),n=Ul({from:cb.fullPath});return m.jsx(c$e,{sourceId:e,search:t,navigate:n})}function U$e(){const{sourceId:e}=UU.useParams();return m.jsx(Wwe,{sourceId:e})}const H$e=fu.addChildren([j$e,D$e,F$e,cb,UU,B$e]),q$e=zH({routeTree:H$e,defaultPreload:"intent"});function V$e(){return m.jsx(O.StrictMode,{children:m.jsx(oye,{children:m.jsx(qH,{router:q$e})})})}const MMe=Object.freeze(Object.defineProperty({__proto__:null,App:V$e},Symbol.toStringTag,{value:"Module"})),G$e=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:OU},Symbol.toStringTag,{value:"Module"}));export{D3e as B,$Me as M,rs as R,MMe as m,O as r};
|