Fix rtl text rendering (#21382)

* Fix Arabic RTL text rendering in web UI

- Add dir='auto' attributes to markdown containers and blocks
- Implement post-processing to add dir='auto' to all text elements
- Replace directional CSS properties with logical properties for proper RTL list alignment
- Ensure bidirectional text support for mixed Arabic/English content

* Clean up commented duplicate function

Remove the commented-out duplicate transformMdastNode function
that was left over from refactoring.

* Fix Arabic RTL text rendering in web UI

- Add dir='auto' attributes to markdown containers and blocks
- Implement post-processing to add dir='auto' to all text elements
- Replace directional CSS properties with logical properties for proper RTL list alignment
- Minor code formatting improvements

This ensures bidirectional text support for mixed Arabic/English content in the llama.cpp web UI.

* Implement rehype plugin for comprehensive RTL text support

- Add rehypeRtlSupport plugin that applies dir='auto' to all elements with children
- Replace DOMParser-based approach with efficient HAST tree processing
- Remove hardcoded element lists for better maintainability
- Ensure proper bidirectional text rendering for mixed RTL/LTR content

* Fix RTL text rendering with rehype plugin and cleanup

* fix: prettier formatting
This commit is contained in:
Kabir08 authored and GitHub committed 2026-04-07 11:37:20 +02:00
1 parent 0988accf82
commit d1f82e382d
6 files changed
+84 -62

No files matched your search

+1 -1
View File
@@ -1 +1 @@
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-orange-50:oklch(98% .016 73.684);--color-orange-100:oklch(95.4% .038 75.164);--color-orange-200:oklch(90.1% .076 70.697);--color-orange-400:oklch(75% .183 55.934);--color-orange-600:oklch(64.6% .222 41.116);--color-orange-800:oklch(47% .157 37.304);--color-orange-900:oklch(40.8% .123 38.172);--color-orange-950:oklch(26.6% .079 36.259);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-green-50:oklch(98.2% .018 155.826);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-950:oklch(26.6% .065 152.934);--color-cyan-50:oklch(98.4% .019 200.873);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-600:oklch(60.9% .126 221.723);--color-cyan-950:oklch(30.2% .056 229.695);--color-blue-50:oklch(97% .014 254.604);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-950:oklch(28.2% .091 267.935);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-200:oklch(90.2% .063 306.703);--color-purple-300:oklch(82.7% .119 306.383);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-purple-600:oklch(55.8% .288 302.321);--color-purple-700:oklch(49.6% .265 301.924);--color-purple-800:oklch(43.8% .218 303.724);--color-purple-900:oklch(38.1% .176 304.987);--color-purple-950:oklch(29.1% .149 302.717);--color-pink-50:oklch(97.1% .014 343.198);--color-pink-400:oklch(71.8% .202 349.761);--color-pink-600:oklch(59.2% .249 .584);--color-pink-950:oklch(28.4% .109 3.907);--color-gray-500:oklch(55.1% .027 264.364);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(Line truncated
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-orange-50:oklch(98% .016 73.684);--color-orange-100:oklch(95.4% .038 75.164);--color-orange-200:oklch(90.1% .076 70.697);--color-orange-400:oklch(75% .183 55.934);--color-orange-600:oklch(64.6% .222 41.116);--color-orange-800:oklch(47% .157 37.304);--color-orange-900:oklch(40.8% .123 38.172);--color-orange-950:oklch(26.6% .079 36.259);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-green-50:oklch(98.2% .018 155.826);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-950:oklch(26.6% .065 152.934);--color-cyan-50:oklch(98.4% .019 200.873);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-600:oklch(60.9% .126 221.723);--color-cyan-950:oklch(30.2% .056 229.695);--color-blue-50:oklch(97% .014 254.604);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-950:oklch(28.2% .091 267.935);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-200:oklch(90.2% .063 306.703);--color-purple-300:oklch(82.7% .119 306.383);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-purple-600:oklch(55.8% .288 302.321);--color-purple-700:oklch(49.6% .265 301.924);--color-purple-800:oklch(43.8% .218 303.724);--color-purple-900:oklch(38.1% .176 304.987);--color-purple-950:oklch(29.1% .149 302.717);--color-pink-50:oklch(97.1% .014 343.198);--color-pink-400:oklch(71.8% .202 349.761);--color-pink-600:oklch(59.2% .249 .584);--color-pink-950:oklch(28.4% .109 3.907);--color-gray-500:oklch(55.1% .027 264.364);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(Line truncated
+47 -47
View File
@@ -1,10 +1,10 @@
var W6=r=>{throw TypeError(r)};var rS=(r,e,t)=>e.has(r)||W6("Cannot "+t);var ma=(r,e,t)=>(rS(r,e,"read from private field"),t?t.call(r):e.get(r)),ml=(r,e,t)=>e.has(r)?W6("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),gs=(r,e,t,n)=>(rS(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),gl=(r,e,t)=>(rS(r,e,"access private method"),t);var j6=(r,e,t,n)=>({set _(a){gs(r,e,a,t)},get _(){return ma(r,e,n)}});var zm=Array.isArray,yY=Array.prototype.indexOf,yf=Array.prototype.includes,Qb=Array.from,zA=Object.defineProperty,Tu=Object.getOwnPropertyDescriptor,UL=Object.getOwnPropertyDescriptors,$L=Object.prototype,SY=Array.prototype,Zb=Object.getPrototypeOf,K6=Object.isExtensible;function Ph(r){return typeof r=="function"}const $e=()=>{};function EY(r){return r()}function EC(r){for(var e=0;e<r.length;e++)r[e]()}function GL(){var r,e,t=new Promise((n,a)=>{r=n,e=a});return{promise:t,resolve:r,reject:e}}function wY(r,e,t=!1){return r===void 0?t?e():e:r}function qA(r,e){if(Array.isArray(r))return r;if(!(Symbol.iterator in r))return Array.from(r);const t=[];for(const n of r)if(t.push(n),t.length===e)break;return t}const si=2,hm=4,qm=8,HA=1<<24,ql=16,Wc=32,Hu=64,VA=128,Ao=512,qi=1024,Vi=2048,jc=4096,ro=8192,Cc=16384,Hm=32768,Fl=65536,wC=1<<17,YA=1<<18,rh=1<<19,zL=1<<20,Ec=1<<25,Wd=32768,TC=1<<21,WA=1<<22,Cu=1<<23,kl=Symbol("$state"),jA=Symbol("legacy props"),TY=Symbol(""),jh=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},CY=1,Jb=3,Kc=8;function qL(r){throw new Error("https://svelte.dev/e/experimental_async_required")}function Vf(r){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function AY(){throw new Error("https://svelte.dev/e/missing_context")}function xY(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function RY(r){throw new Error("https://svelte.dev/e/effect_in_teardown")}function OY(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function NY(r){throw new Error("https://svelte.dev/e/effect_orphan")}function IY(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function kY(){throw new Error("https://svelte.dev/e/fork_discarded")}function MY(){throw new Error("https://svelte.dev/e/fork_timing")}function DY(){throw new Error("https://svelte.dev/e/get_abort_signal_outside_reaction")}function PY(){throw new Error("https://svelte.dev/e/hydration_failed")}function HL(r){throw new Error("https://svelte.dev/e/lifecycle_legacy_only")}function LY(r){throw new Error("https://svelte.dev/e/props_invalid_value")}function FY(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function BY(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function UY(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function $Y(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const GY=1,zY=2,VL=4,qY=8,HY=16,VY=1,YY=2,WY=4,jY=8,KY=16,XY=1,QY=2,ZY=4,JY=1,eW=2,YL="[",ev="[!",KA="]",jd={},pi=Symbol(),tW="http://www.w3.org/1999/xhtml",rW="http://www.w3.org/2000/svg",WL="@attach";function nW(r){console.warn("https://svelte.dev/e/hydratable_missing_but_expected")}function Vm(r){console.warn("https://svelte.dev/e/hydration_mismatch")}function aW(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function iW(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let Or=!1;function ss(r){Or=r}let en;function $a(r){if(r===null)throw Vm(),jd;return en=r}function No(){return $a(oo(en))}function H(r){if(Or){if(oo(en)!==null)throw Vm(),jd;en=r}}function et(r=1){if(Or){for(var e=r,t=en;e--;)t=oo(t);en=t}}function M_(r=!0){for(var e=0,t=en;;){if(t.nodeType===Kc){var n=t.data;if(n===KA){if(e===0)return t;e-=1}else(n===YL||n===ev)&&(e+=1)}var a=oo(t);r&&t.remove(),t=a}}function jL(r){if(!r||r.nodeType!==Kc)throw Vm(),jd;return r.data}function KL(r){return r===this.v}function XA(r,e){return r!=r?e==e:r!==e||r!==null&&typeof r=="object"||typeof r=="function"}function XL(r){return!XA(r,this.v)}let Yf=!1;function sW(){Yf=!0}const oW=[];function rf(r,e=!1,t=!1){return m_(r,new Map,"",oW,null,t)}function m_(r,e,t,n,a=null,i=!1){if(typeof r=="object"&&r!==null){var s=e.get(r);if(s!==void 0)return s;if(r instanceof Map)return new Map(r);if(r instanceof Set)return new Set(r);if(zm(r)){var o=Array(r.length);e.set(r,o),a!==null&&e.set(a,o);for(var l=0;l<r.length;l+=1){var c=r[l];l in r&&(o[l]=m_(c,e,t,n,null,i))}return o}if(Zb(r)===$L){o={},e.set(r,o),a!==null&&e.set(a,o);for(var u in r)o[u]=m_(r[u],e,t,n,null,i);return o}if(r instanceof Date)return structuredClone(r);if(typeof r.toJSON=="function"&&!i)return m_(r.toJSON(),e,t,n,r)}if(r instanceof EventTarget)return r;try{return structuredClone(r)}catch{return r}}let $n=null;function Sf(r){$n=r}function lW(){const r={};return[()=>(tv(r)||AY(),Bl(r)),e=>Vu(r,e)]}function Bl(r){return rv().get(r)}function Vu(r,e){return rv().set(r,e)Line truncated
`).some(o=>o.startsWith("https://svelte.dev/e/")))throw s;return s!==jd&&console.warn("Failed to hydrate: ",s),e.recover===!1&&PY(),OC(),t5(t),ss(!1),ov(r,e)}finally{ss(n),$a(a)}}const wh=new Map;function FF(r,{target:e,anchor:t,props:n={},events:a,context:i,intro:s=!0}){OC();var o=new Set,l=d=>{for(var h=0;h<d.length;h++){var p=d[h];if(!o.has(p)){o.add(p);var m=FW(p);e.addEventListener(p,Up,{passive:m});var g=wh.get(p);g===void 0?(document.addEventListener(p,Up,{passive:m}),wh.set(p,1)):wh.set(p,g+1)}}};l(Qb(PF)),IC.add(l);var c=void 0,u=CW(()=>{var d=t??e.appendChild(Hi());return mW(d,{pending:()=>{}},h=>{if(i){Ee({});var p=$n;p.c=i}if(a&&(n.$$events=a),Or&&Is(h,null),L_=s,c=r(h,n)||{},L_=!0,Or&&(Pn.nodes.end=en,en===null||en.nodeType!==Kc||en.data!==KA))throw Vm(),jd;i&&we()}),()=>{for(var h of o){e.removeEventListener(h,Up);var p=wh.get(h);--p===0?(document.removeEventListener(h,Up),wh.delete(h)):wh.set(h,p)}IC.delete(l),d!==t&&d.parentNode?.removeChild(d)}});return kC.set(c,u),c}let kC=new WeakMap;function s5(r,e){const t=kC.get(r);return t?(kC.delete(r),t(e)):Promise.resolve()}class Qm{anchor;#e=new Map;#t=new Map;#r=new Map;#n=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=()=>{var e=Hn;if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)n5(n),this.#n.delete(t);else{var a=this.#r.get(t);a&&(this.#t.set(t,a.effect),this.#r.delete(t),a.fragment.lastChild.remove(),this.anchor.before(a.fragment),n=a.effect)}for(const[i,s]of this.#e){if(this.#e.delete(i),i===e)break;const o=this.#r.get(s);o&&(_i(o.effect),this.#r.delete(s))}for(const[i,s]of this.#t){if(i===t||this.#n.has(i))continue;const o=()=>{if(Array.from(this.#e.values()).includes(i)){var c=document.createDocumentFragment();AF(s,c),c.append(Hi()),this.#r.set(i,{effect:s,fragment:c})}else _i(s);this.#n.delete(i),this.#t.delete(i)};this.#i||!n?(this.#n.add(i),Vd(s,o,!1)):o()}}};#s=e=>{this.#e.delete(e);const t=Array.from(this.#e.values());for(const[n,a]of this.#r)t.includes(n)||(_i(a.effect),this.#r.delete(n))};ensure(e,t){var n=Hn,a=fF();if(t&&!this.#t.has(e)&&!this.#r.has(e))if(a){var i=document.createDocumentFragment(),s=Hi();i.append(s),this.#r.set(e,{effect:As(()=>t(s)),fragment:i})}else this.#t.set(e,As(()=>t(this.anchor)));if(this.#e.set(n,e),a){for(const[o,l]of this.#t)o===e?n.skipped_effects.delete(l):n.skipped_effects.add(l);for(const[o,l]of this.#r)o===e?n.skipped_effects.delete(l.effect):n.skipped_effects.add(l.effect);n.oncommit(this.#a),n.ondiscard(this.#s)}else Or&&(this.anchor=en),this.#a()}}function le(r,e,t=!1){Or&&No();var n=new Qm(r),a=t?Fl:0;function i(s,o){if(Or){const c=jL(r)===ev;if(s===c){var l=M_();$a(l),n.anchor=l,ss(!1),n.ensure(s,o),ss(!0);return}}n.ensure(s,o)}Wu(()=>{var s=!1;e((o,l=!0)=>{s=!0,i(l,o)}),s||i(!1,null)},a)}function GW(r,e,t){Or&&No();var n=new Qm(r),a=!Wf();Wu(()=>{var i=e();a&&i!==null&&typeof i=="object"&&(i={}),n.ensure(i,t)})}function xu(r,e){return e}function zW(r,e,t){for(var n=[],a=e.length,i,s=e.length,o=0;o<a;o++){let d=e[o];Vd(d,()=>{if(i){if(i.pending.delete(d),i.done.add(d),i.pending.size===0){var h=r.outrogroups;MC(Qb(i.done)),h.delete(i),h.size===0&&(r.outrogroups=null)}}else s-=1},!1)}if(s===0){var l=n.length===0&&t!==null;if(l){var c=t,u=c.parentNode;t5(u),u.append(c),r.items.clear()}MC(e,!l)}else i={pending:new Set(e),done:new Set},(r.outrogroups??=new Set).add(i)}function MC(r,e=!0){for(var t=0;t<r.length;t++)_i(r[t],e)}var rR;function Ir(r,e,t,n,a,i=null){var s=r,o=new Map,l=(e&VL)!==0;if(l){var c=r;s=Or?$a(Ni(c)):c.appendChild(Hi())}Or&&No();var u=null,d=av(()=>{var _=t();return zm(_)?_:_==null?[]:Qb(_)}),h,p=!0;function m(){b.fallback=u,qW(b,h,s,e,n),u!==null&&(h.length===0?(u.f&Ec)===0?n5(u):(u.f^=Ec,$p(u,null,s)):Vd(u,()=>{u=null}))}var g=Wu(()=>{h=f(d);var _=h.length;let v=!1;if(Or){var y=jL(s)===ev;y!==(_===0)&&(s=M_(),$a(s),ss(!1),v=!0)}for(var E=new Set,S=Hn,w=fF(),C=0;C<_;C+=1){Or&&en.nodeType===Kc&&en.data===KA&&(s=en,v=!0,ss(!1));var x=h[C],N=n(x,C),I=p?null:o.get(N);I?(I.v&&wf(I.v,x),I.i&&wf(I.i,C),w&&S.skipped_effects.delete(I.e)):(I=HW(o,p?s:rR??=Hi(),x,N,C,a,e,t),p||(I.e.f|=Ec),o.set(N,I)),E.add(N)}if(_===0&&i&&!u&&(p?u=As(()=>i(s)):(u=As(()=>i(rR??=Hi())),u.f|=Ec)),Or&&_>0&&$a(M_()),!p)if(w){for(const[D,V]of o)E.has(D)||S.skipped_effects.add(V.e);S.oncommit(m),S.ondiscard(()=>{})}else m();v&&ss(!0),f(d)}),b={effect:g,items:o,outrogroups:null,fallback:u};p=!1,Or&&(s=en)}function qW(r,e,t,n,a){var i=(n&qY)!==0,s=e.length,o=r.items,l=r.effect.first,c,u=null,d,h=[],p=[],m,g,b,_;if(i)for(_=0;_<s;_+=1)m=e[_],g=a(m,_),b=o.get(g).e,(b.f&Ec)===0&&(b.nodes?.a?.measure(),(d??=new Set).add(b));for(_=0;_<s;_+=1){if(m=e[_],g=a(m,_),b=o.get(g).e,r.outrogroups!==null)for(const I of r.outrogroups)I.pending.delete(b),I.done.delete(b);if((b.f&Ec)!==0)if(b.f^=Ec,b===l)$p(b,null,t);else{var v=u?u.next:l;b===r.effect.last&&(r.effect.last=b.prev),b.prev&&(b.prev.next=b.next),b.next&&(b.next.prev=b.prev),su(r,u,b),su(r,b,v),$p(b,v,t),u=b,h=[],p=[],l=u.next;continue}if((b.f Line truncated
\r\f \v\uFEFF`];function QW(r,e,t){var n=r==null?"":""+r;if(e&&(n=n?n+" "+e:e),t){for(var a in t)if(t[a])n=n?n+" "+a:a;else if(n.length)for(var i=a.length,s=0;(s=n.indexOf(a,s))>=0;){var o=s+i;(s===0||aR.includes(n[s-1]))&&(o===n.length||aR.includes(n[o]))?n=(s===0?"":n.substring(0,s))+n.substring(o+1):s=o}}return n===""?null:n}function iR(r,e=!1){var t=e?" !important;":";",n="";for(var a in r){var i=r[a];i!=null&&i!==""&&(n+=" "+a+": "+i+t)}return n}function nS(r){return r[0]!=="-"||r[1]!=="-"?r.toLowerCase():r}function ZW(r,e){if(e){var t="",n,a;if(Array.isArray(e)?(n=e[0],a=e[1]):n=e,r){r=String(r).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var i=!1,s=0,o=!1,l=[];n&&l.push(...Object.keys(n).map(nS)),a&&l.push(...Object.keys(a).map(nS));var c=0,u=-1;const g=r.length;for(var d=0;d<g;d++){var h=r[d];if(o?h==="/"&&r[d-1]==="*"&&(o=!1):i?i===h&&(i=!1):h==="/"&&r[d+1]==="*"?o=!0:h==='"'||h==="'"?i=h:h==="("?s++:h===")"&&s--,!o&&i===!1&&s===0){if(h===":"&&u===-1)u=d;else if(h===";"||d===g-1){if(u!==-1){var p=nS(r.substring(c,u).trim());if(!l.includes(p)){h!==";"&&d++;var m=r.substring(c,d).trim();t+=" "+m+";"}}c=d+1,u=-1}}}}return n&&(t+=iR(n)),a&&(t+=iR(a,!0)),t=t.trim(),t===""?null:t}return r==null?null:String(r)}function yt(r,e,t,n,a,i){var s=r.__className;if(Or||s!==t||s===void 0){var o=QW(t,n,i);(!Or||o!==r.getAttribute("class"))&&(o==null?r.removeAttribute("class"):e?r.className=o:r.setAttribute("class",o)),r.__className=t}else if(i&&a!==i)for(var l in i){var c=!!i[l];(a==null||c!==!!a[l])&&r.classList.toggle(l,c)}return i}function aS(r,e={},t,n){for(var a in t){var i=t[a];e[a]!==i&&(t[a]==null?r.style.removeProperty(a):r.style.setProperty(a,i,n))}}function ds(r,e,t,n){var a=r.__style;if(Or||a!==e){var i=ZW(e,n);(!Or||i!==r.getAttribute("style"))&&(i==null?r.removeAttribute("style"):r.style.cssText=i),r.__style=e}else n&&(Array.isArray(n)?(aS(r,t?.[0],n[0]),aS(r,t?.[1],n[1],"important")):aS(r,t,n));return n}function PC(r,e,t=!1){if(r.multiple){if(e==null)return;if(!zm(e))return aW();for(var n of r.options)n.selected=e.includes(sR(n));return}for(n of r.options){var a=sR(n);if(SW(a,e)){n.selected=!0;return}}(!t||e!==void 0)&&(r.selectedIndex=-1)}function JW(r){var e=new MutationObserver(()=>{PC(r,r.__value)});e.observe(r,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),ah(()=>{e.disconnect()})}function sR(r){return"__value"in r?r.__value:r.value}const _p=Symbol("class"),Lh=Symbol("style"),GF=Symbol("is custom element"),zF=Symbol("is html");function ej(r){if(Or){var e=!1,t=()=>{if(!e){if(e=!0,r.hasAttribute("value")){var n=r.value;er(r,"value",null),r.value=n}if(r.hasAttribute("checked")){var a=r.checked;er(r,"checked",null),r.checked=a}}};r.__on_r=t,xo(t),pF()}}function l5(r,e){var t=c5(r);t.value===(t.value=e??void 0)||r.value===e&&(e!==0||r.nodeName!=="PROGRESS")||(r.value=e??"")}function tj(r,e){e?r.hasAttribute("selected")||r.setAttribute("selected",""):r.removeAttribute("selected")}function er(r,e,t,n){var a=c5(r);Or&&(a[e]=r.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&r.nodeName==="LINK")||a[e]!==(a[e]=t)&&(e==="loading"&&(r[TY]=t),t==null?r.removeAttribute(e):typeof t!="string"&&qF(r).includes(e)?r[e]=t:r.setAttribute(e,t))}function rj(r,e,t,n,a=!1,i=!1){if(Or&&a&&r.tagName==="INPUT"){var s=r,o=s.type==="checkbox"?"defaultChecked":"defaultValue";o in t||ej(s)}var l=c5(r),c=l[GF],u=!l[zF];let d=Or&&c;d&&ss(!1);var h=e||{},p=r.tagName==="OPTION";for(var m in e)m in t||(t[m]=null);t.class?t.class=qr(t.class):(n||t[_p])&&(t.class=null),t[Lh]&&(t.style??=null);var g=qF(r);for(const w in t){let C=t[w];if(p&&w==="value"&&C==null){r.value=r.__value="",h[w]=C;continue}if(w==="class"){var b=r.namespaceURI==="http://www.w3.org/1999/xhtml";yt(r,b,C,n,e?.[_p],t[_p]),h[w]=C,h[_p]=t[_p];continue}if(w==="style"){ds(r,C,e?.[Lh],t[Lh]),h[w]=C,h[Lh]=t[Lh];continue}var _=h[w];if(!(C===_&&!(C===void 0&&r.hasAttribute(w)))){h[w]=C;var v=w[0]+w[1];if(v!=="$$")if(v==="on"){const x={},N="$$"+w;let I=w.slice(2);var y=MW(I);if(IW(I)&&(I=I.slice(0,-7),x.capture=!0),!y&&_){if(C!=null)continue;r.removeEventListener(I,h[N],x),h[N]=null}if(C!=null)if(y)r[`__${I}`]=C,Ln([I]);else{let D=function(V){h[w].call(this,V)};h[N]=i5(I,r,D,x)}else y&&(r[`__${I}`]=void 0)}else if(w==="style")er(r,w,C);else if(w==="autofocus")EW(r,!!C);else if(!c&&(w==="__value"||w==="value"&&C!=null))r.value=r.__value=C;else if(w==="selected"&&p)tj(r,C);else{var E=w;u||(E=PW(E));var S=E==="defaultValue"||E==="defaultChecked";if(C==null&&!c&&!S)if(l[w]=null,E==="value"||E==="checked"){let x=r;const N=e===void 0;if(E==="value"){let I=x.defaultValue;x.removeAttribute(E),x.defaultValue=I,x.value=x.__value=N?I:null}else{let I=x.defaultChecked;x.removeAttribute(E),x.defaultChecked=I,x.checked=N?I:!1}}else r.removeAttribute(w);else S||g.includes(E)&&(c||typeof C!="string")?(r[E]=C,E in l&&(l[E]=pi)):typeof C!="function"&&er(r,E,C)}}}return d&&ss(!0),h}function zt(r,e,t=[],n=[],a=[],i,s=!1,o=!1){ZA(a,t,n,l=>{var c=void 0,u={},d=r.nodeName= Line truncated
var W6=r=>{throw TypeError(r)};var rS=(r,e,t)=>e.has(r)||W6("Cannot "+t);var ma=(r,e,t)=>(rS(r,e,"read from private field"),t?t.call(r):e.get(r)),ml=(r,e,t)=>e.has(r)?W6("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),gs=(r,e,t,n)=>(rS(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),gl=(r,e,t)=>(rS(r,e,"access private method"),t);var j6=(r,e,t,n)=>({set _(a){gs(r,e,a,t)},get _(){return ma(r,e,n)}});var zm=Array.isArray,yY=Array.prototype.indexOf,yf=Array.prototype.includes,Qb=Array.from,zA=Object.defineProperty,Cu=Object.getOwnPropertyDescriptor,UL=Object.getOwnPropertyDescriptors,$L=Object.prototype,SY=Array.prototype,Zb=Object.getPrototypeOf,K6=Object.isExtensible;function Ph(r){return typeof r=="function"}const $e=()=>{};function EY(r){return r()}function EC(r){for(var e=0;e<r.length;e++)r[e]()}function GL(){var r,e,t=new Promise((n,a)=>{r=n,e=a});return{promise:t,resolve:r,reject:e}}function wY(r,e,t=!1){return r===void 0?t?e():e:r}function qA(r,e){if(Array.isArray(r))return r;if(!(Symbol.iterator in r))return Array.from(r);const t=[];for(const n of r)if(t.push(n),t.length===e)break;return t}const si=2,hm=4,qm=8,HA=1<<24,ql=16,Wc=32,Vu=64,VA=128,Ao=512,qi=1024,Vi=2048,jc=4096,ro=8192,Cc=16384,Hm=32768,Fl=65536,wC=1<<17,YA=1<<18,rh=1<<19,zL=1<<20,Ec=1<<25,Wd=32768,TC=1<<21,WA=1<<22,Au=1<<23,kl=Symbol("$state"),jA=Symbol("legacy props"),TY=Symbol(""),jh=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},CY=1,Jb=3,Kc=8;function qL(r){throw new Error("https://svelte.dev/e/experimental_async_required")}function Vf(r){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function AY(){throw new Error("https://svelte.dev/e/missing_context")}function xY(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function RY(r){throw new Error("https://svelte.dev/e/effect_in_teardown")}function OY(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function NY(r){throw new Error("https://svelte.dev/e/effect_orphan")}function IY(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function kY(){throw new Error("https://svelte.dev/e/fork_discarded")}function MY(){throw new Error("https://svelte.dev/e/fork_timing")}function DY(){throw new Error("https://svelte.dev/e/get_abort_signal_outside_reaction")}function PY(){throw new Error("https://svelte.dev/e/hydration_failed")}function HL(r){throw new Error("https://svelte.dev/e/lifecycle_legacy_only")}function LY(r){throw new Error("https://svelte.dev/e/props_invalid_value")}function FY(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function BY(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function UY(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function $Y(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const GY=1,zY=2,VL=4,qY=8,HY=16,VY=1,YY=2,WY=4,jY=8,KY=16,XY=1,QY=2,ZY=4,JY=1,eW=2,YL="[",ev="[!",KA="]",jd={},pi=Symbol(),tW="http://www.w3.org/1999/xhtml",rW="http://www.w3.org/2000/svg",WL="@attach";function nW(r){console.warn("https://svelte.dev/e/hydratable_missing_but_expected")}function Vm(r){console.warn("https://svelte.dev/e/hydration_mismatch")}function aW(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function iW(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let Or=!1;function ss(r){Or=r}let en;function $a(r){if(r===null)throw Vm(),jd;return en=r}function No(){return $a(oo(en))}function H(r){if(Or){if(oo(en)!==null)throw Vm(),jd;en=r}}function et(r=1){if(Or){for(var e=r,t=en;e--;)t=oo(t);en=t}}function M_(r=!0){for(var e=0,t=en;;){if(t.nodeType===Kc){var n=t.data;if(n===KA){if(e===0)return t;e-=1}else(n===YL||n===ev)&&(e+=1)}var a=oo(t);r&&t.remove(),t=a}}function jL(r){if(!r||r.nodeType!==Kc)throw Vm(),jd;return r.data}function KL(r){return r===this.v}function XA(r,e){return r!=r?e==e:r!==e||r!==null&&typeof r=="object"||typeof r=="function"}function XL(r){return!XA(r,this.v)}let Yf=!1;function sW(){Yf=!0}const oW=[];function rf(r,e=!1,t=!1){return m_(r,new Map,"",oW,null,t)}function m_(r,e,t,n,a=null,i=!1){if(typeof r=="object"&&r!==null){var s=e.get(r);if(s!==void 0)return s;if(r instanceof Map)return new Map(r);if(r instanceof Set)return new Set(r);if(zm(r)){var o=Array(r.length);e.set(r,o),a!==null&&e.set(a,o);for(var l=0;l<r.length;l+=1){var c=r[l];l in r&&(o[l]=m_(c,e,t,n,null,i))}return o}if(Zb(r)===$L){o={},e.set(r,o),a!==null&&e.set(a,o);for(var u in r)o[u]=m_(r[u],e,t,n,null,i);return o}if(r instanceof Date)return structuredClone(r);if(typeof r.toJSON=="function"&&!i)return m_(r.toJSON(),e,t,n,r)}if(r instanceof EventTarget)return r;try{return structuredClone(r)}catch{return r}}let $n=null;function Sf(r){$n=r}function lW(){const r={};return[()=>(tv(r)||AY(),Bl(r)),e=>Yu(r,e)]}function Bl(r){return rv().get(r)}function Yu(r,e){return rv().set(r,e)Line truncated
`).some(o=>o.startsWith("https://svelte.dev/e/")))throw s;return s!==jd&&console.warn("Failed to hydrate: ",s),e.recover===!1&&PY(),OC(),t5(t),ss(!1),ov(r,e)}finally{ss(n),$a(a)}}const wh=new Map;function FF(r,{target:e,anchor:t,props:n={},events:a,context:i,intro:s=!0}){OC();var o=new Set,l=d=>{for(var h=0;h<d.length;h++){var p=d[h];if(!o.has(p)){o.add(p);var m=FW(p);e.addEventListener(p,Up,{passive:m});var g=wh.get(p);g===void 0?(document.addEventListener(p,Up,{passive:m}),wh.set(p,1)):wh.set(p,g+1)}}};l(Qb(PF)),IC.add(l);var c=void 0,u=CW(()=>{var d=t??e.appendChild(Hi());return mW(d,{pending:()=>{}},h=>{if(i){Ee({});var p=$n;p.c=i}if(a&&(n.$$events=a),Or&&Is(h,null),L_=s,c=r(h,n)||{},L_=!0,Or&&(Pn.nodes.end=en,en===null||en.nodeType!==Kc||en.data!==KA))throw Vm(),jd;i&&we()}),()=>{for(var h of o){e.removeEventListener(h,Up);var p=wh.get(h);--p===0?(document.removeEventListener(h,Up),wh.delete(h)):wh.set(h,p)}IC.delete(l),d!==t&&d.parentNode?.removeChild(d)}});return kC.set(c,u),c}let kC=new WeakMap;function s5(r,e){const t=kC.get(r);return t?(kC.delete(r),t(e)):Promise.resolve()}class Qm{anchor;#e=new Map;#t=new Map;#r=new Map;#n=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=()=>{var e=Hn;if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)n5(n),this.#n.delete(t);else{var a=this.#r.get(t);a&&(this.#t.set(t,a.effect),this.#r.delete(t),a.fragment.lastChild.remove(),this.anchor.before(a.fragment),n=a.effect)}for(const[i,s]of this.#e){if(this.#e.delete(i),i===e)break;const o=this.#r.get(s);o&&(_i(o.effect),this.#r.delete(s))}for(const[i,s]of this.#t){if(i===t||this.#n.has(i))continue;const o=()=>{if(Array.from(this.#e.values()).includes(i)){var c=document.createDocumentFragment();AF(s,c),c.append(Hi()),this.#r.set(i,{effect:s,fragment:c})}else _i(s);this.#n.delete(i),this.#t.delete(i)};this.#i||!n?(this.#n.add(i),Vd(s,o,!1)):o()}}};#s=e=>{this.#e.delete(e);const t=Array.from(this.#e.values());for(const[n,a]of this.#r)t.includes(n)||(_i(a.effect),this.#r.delete(n))};ensure(e,t){var n=Hn,a=fF();if(t&&!this.#t.has(e)&&!this.#r.has(e))if(a){var i=document.createDocumentFragment(),s=Hi();i.append(s),this.#r.set(e,{effect:As(()=>t(s)),fragment:i})}else this.#t.set(e,As(()=>t(this.anchor)));if(this.#e.set(n,e),a){for(const[o,l]of this.#t)o===e?n.skipped_effects.delete(l):n.skipped_effects.add(l);for(const[o,l]of this.#r)o===e?n.skipped_effects.delete(l.effect):n.skipped_effects.add(l.effect);n.oncommit(this.#a),n.ondiscard(this.#s)}else Or&&(this.anchor=en),this.#a()}}function le(r,e,t=!1){Or&&No();var n=new Qm(r),a=t?Fl:0;function i(s,o){if(Or){const c=jL(r)===ev;if(s===c){var l=M_();$a(l),n.anchor=l,ss(!1),n.ensure(s,o),ss(!0);return}}n.ensure(s,o)}ju(()=>{var s=!1;e((o,l=!0)=>{s=!0,i(l,o)}),s||i(!1,null)},a)}function GW(r,e,t){Or&&No();var n=new Qm(r),a=!Wf();ju(()=>{var i=e();a&&i!==null&&typeof i=="object"&&(i={}),n.ensure(i,t)})}function Ru(r,e){return e}function zW(r,e,t){for(var n=[],a=e.length,i,s=e.length,o=0;o<a;o++){let d=e[o];Vd(d,()=>{if(i){if(i.pending.delete(d),i.done.add(d),i.pending.size===0){var h=r.outrogroups;MC(Qb(i.done)),h.delete(i),h.size===0&&(r.outrogroups=null)}}else s-=1},!1)}if(s===0){var l=n.length===0&&t!==null;if(l){var c=t,u=c.parentNode;t5(u),u.append(c),r.items.clear()}MC(e,!l)}else i={pending:new Set(e),done:new Set},(r.outrogroups??=new Set).add(i)}function MC(r,e=!0){for(var t=0;t<r.length;t++)_i(r[t],e)}var rR;function Ir(r,e,t,n,a,i=null){var s=r,o=new Map,l=(e&VL)!==0;if(l){var c=r;s=Or?$a(Ni(c)):c.appendChild(Hi())}Or&&No();var u=null,d=av(()=>{var _=t();return zm(_)?_:_==null?[]:Qb(_)}),h,p=!0;function m(){b.fallback=u,qW(b,h,s,e,n),u!==null&&(h.length===0?(u.f&Ec)===0?n5(u):(u.f^=Ec,$p(u,null,s)):Vd(u,()=>{u=null}))}var g=ju(()=>{h=f(d);var _=h.length;let v=!1;if(Or){var y=jL(s)===ev;y!==(_===0)&&(s=M_(),$a(s),ss(!1),v=!0)}for(var E=new Set,S=Hn,w=fF(),C=0;C<_;C+=1){Or&&en.nodeType===Kc&&en.data===KA&&(s=en,v=!0,ss(!1));var x=h[C],N=n(x,C),I=p?null:o.get(N);I?(I.v&&wf(I.v,x),I.i&&wf(I.i,C),w&&S.skipped_effects.delete(I.e)):(I=HW(o,p?s:rR??=Hi(),x,N,C,a,e,t),p||(I.e.f|=Ec),o.set(N,I)),E.add(N)}if(_===0&&i&&!u&&(p?u=As(()=>i(s)):(u=As(()=>i(rR??=Hi())),u.f|=Ec)),Or&&_>0&&$a(M_()),!p)if(w){for(const[D,V]of o)E.has(D)||S.skipped_effects.add(V.e);S.oncommit(m),S.ondiscard(()=>{})}else m();v&&ss(!0),f(d)}),b={effect:g,items:o,outrogroups:null,fallback:u};p=!1,Or&&(s=en)}function qW(r,e,t,n,a){var i=(n&qY)!==0,s=e.length,o=r.items,l=r.effect.first,c,u=null,d,h=[],p=[],m,g,b,_;if(i)for(_=0;_<s;_+=1)m=e[_],g=a(m,_),b=o.get(g).e,(b.f&Ec)===0&&(b.nodes?.a?.measure(),(d??=new Set).add(b));for(_=0;_<s;_+=1){if(m=e[_],g=a(m,_),b=o.get(g).e,r.outrogroups!==null)for(const I of r.outrogroups)I.pending.delete(b),I.done.delete(b);if((b.f&Ec)!==0)if(b.f^=Ec,b===l)$p(b,null,t);else{var v=u?u.next:l;b===r.effect.last&&(r.effect.last=b.prev),b.prev&&(b.prev.next=b.next),b.next&&(b.next.prev=b.prev),ou(r,u,b),ou(r,b,v),$p(b,v,t),u=b,h=[],p=[],l=u.next;continue}if((b.f Line truncated
\r\f \v\uFEFF`];function QW(r,e,t){var n=r==null?"":""+r;if(e&&(n=n?n+" "+e:e),t){for(var a in t)if(t[a])n=n?n+" "+a:a;else if(n.length)for(var i=a.length,s=0;(s=n.indexOf(a,s))>=0;){var o=s+i;(s===0||aR.includes(n[s-1]))&&(o===n.length||aR.includes(n[o]))?n=(s===0?"":n.substring(0,s))+n.substring(o+1):s=o}}return n===""?null:n}function iR(r,e=!1){var t=e?" !important;":";",n="";for(var a in r){var i=r[a];i!=null&&i!==""&&(n+=" "+a+": "+i+t)}return n}function nS(r){return r[0]!=="-"||r[1]!=="-"?r.toLowerCase():r}function ZW(r,e){if(e){var t="",n,a;if(Array.isArray(e)?(n=e[0],a=e[1]):n=e,r){r=String(r).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var i=!1,s=0,o=!1,l=[];n&&l.push(...Object.keys(n).map(nS)),a&&l.push(...Object.keys(a).map(nS));var c=0,u=-1;const g=r.length;for(var d=0;d<g;d++){var h=r[d];if(o?h==="/"&&r[d-1]==="*"&&(o=!1):i?i===h&&(i=!1):h==="/"&&r[d+1]==="*"?o=!0:h==='"'||h==="'"?i=h:h==="("?s++:h===")"&&s--,!o&&i===!1&&s===0){if(h===":"&&u===-1)u=d;else if(h===";"||d===g-1){if(u!==-1){var p=nS(r.substring(c,u).trim());if(!l.includes(p)){h!==";"&&d++;var m=r.substring(c,d).trim();t+=" "+m+";"}}c=d+1,u=-1}}}}return n&&(t+=iR(n)),a&&(t+=iR(a,!0)),t=t.trim(),t===""?null:t}return r==null?null:String(r)}function yt(r,e,t,n,a,i){var s=r.__className;if(Or||s!==t||s===void 0){var o=QW(t,n,i);(!Or||o!==r.getAttribute("class"))&&(o==null?r.removeAttribute("class"):e?r.className=o:r.setAttribute("class",o)),r.__className=t}else if(i&&a!==i)for(var l in i){var c=!!i[l];(a==null||c!==!!a[l])&&r.classList.toggle(l,c)}return i}function aS(r,e={},t,n){for(var a in t){var i=t[a];e[a]!==i&&(t[a]==null?r.style.removeProperty(a):r.style.setProperty(a,i,n))}}function ds(r,e,t,n){var a=r.__style;if(Or||a!==e){var i=ZW(e,n);(!Or||i!==r.getAttribute("style"))&&(i==null?r.removeAttribute("style"):r.style.cssText=i),r.__style=e}else n&&(Array.isArray(n)?(aS(r,t?.[0],n[0]),aS(r,t?.[1],n[1],"important")):aS(r,t,n));return n}function PC(r,e,t=!1){if(r.multiple){if(e==null)return;if(!zm(e))return aW();for(var n of r.options)n.selected=e.includes(sR(n));return}for(n of r.options){var a=sR(n);if(SW(a,e)){n.selected=!0;return}}(!t||e!==void 0)&&(r.selectedIndex=-1)}function JW(r){var e=new MutationObserver(()=>{PC(r,r.__value)});e.observe(r,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),ah(()=>{e.disconnect()})}function sR(r){return"__value"in r?r.__value:r.value}const _p=Symbol("class"),Lh=Symbol("style"),GF=Symbol("is custom element"),zF=Symbol("is html");function ej(r){if(Or){var e=!1,t=()=>{if(!e){if(e=!0,r.hasAttribute("value")){var n=r.value;er(r,"value",null),r.value=n}if(r.hasAttribute("checked")){var a=r.checked;er(r,"checked",null),r.checked=a}}};r.__on_r=t,xo(t),pF()}}function l5(r,e){var t=c5(r);t.value===(t.value=e??void 0)||r.value===e&&(e!==0||r.nodeName!=="PROGRESS")||(r.value=e??"")}function tj(r,e){e?r.hasAttribute("selected")||r.setAttribute("selected",""):r.removeAttribute("selected")}function er(r,e,t,n){var a=c5(r);Or&&(a[e]=r.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&r.nodeName==="LINK")||a[e]!==(a[e]=t)&&(e==="loading"&&(r[TY]=t),t==null?r.removeAttribute(e):typeof t!="string"&&qF(r).includes(e)?r[e]=t:r.setAttribute(e,t))}function rj(r,e,t,n,a=!1,i=!1){if(Or&&a&&r.tagName==="INPUT"){var s=r,o=s.type==="checkbox"?"defaultChecked":"defaultValue";o in t||ej(s)}var l=c5(r),c=l[GF],u=!l[zF];let d=Or&&c;d&&ss(!1);var h=e||{},p=r.tagName==="OPTION";for(var m in e)m in t||(t[m]=null);t.class?t.class=qr(t.class):(n||t[_p])&&(t.class=null),t[Lh]&&(t.style??=null);var g=qF(r);for(const w in t){let C=t[w];if(p&&w==="value"&&C==null){r.value=r.__value="",h[w]=C;continue}if(w==="class"){var b=r.namespaceURI==="http://www.w3.org/1999/xhtml";yt(r,b,C,n,e?.[_p],t[_p]),h[w]=C,h[_p]=t[_p];continue}if(w==="style"){ds(r,C,e?.[Lh],t[Lh]),h[w]=C,h[Lh]=t[Lh];continue}var _=h[w];if(!(C===_&&!(C===void 0&&r.hasAttribute(w)))){h[w]=C;var v=w[0]+w[1];if(v!=="$$")if(v==="on"){const x={},N="$$"+w;let I=w.slice(2);var y=MW(I);if(IW(I)&&(I=I.slice(0,-7),x.capture=!0),!y&&_){if(C!=null)continue;r.removeEventListener(I,h[N],x),h[N]=null}if(C!=null)if(y)r[`__${I}`]=C,Ln([I]);else{let D=function(V){h[w].call(this,V)};h[N]=i5(I,r,D,x)}else y&&(r[`__${I}`]=void 0)}else if(w==="style")er(r,w,C);else if(w==="autofocus")EW(r,!!C);else if(!c&&(w==="__value"||w==="value"&&C!=null))r.value=r.__value=C;else if(w==="selected"&&p)tj(r,C);else{var E=w;u||(E=PW(E));var S=E==="defaultValue"||E==="defaultChecked";if(C==null&&!c&&!S)if(l[w]=null,E==="value"||E==="checked"){let x=r;const N=e===void 0;if(E==="value"){let I=x.defaultValue;x.removeAttribute(E),x.defaultValue=I,x.value=x.__value=N?I:null}else{let I=x.defaultChecked;x.removeAttribute(E),x.defaultChecked=I,x.checked=N?I:!1}}else r.removeAttribute(w);else S||g.includes(E)&&(c||typeof C!="string")?(r[E]=C,E in l&&(l[E]=pi)):typeof C!="function"&&er(r,E,C)}}}return d&&ss(!0),h}function zt(r,e,t=[],n=[],a=[],i,s=!1,o=!1){ZA(a,t,n,l=>{var c=void 0,u={},d=r.nodeName= Line truncated
`,c="/",u="*",d="",h="comment",p="declaration";fS=function(g,b){if(typeof g!="string")throw new TypeError("First argument must be a string");if(!g)return[];b=b||{};var _=1,v=1;function y(q){var $=q.match(e);$&&(_+=$.length);var K=q.lastIndexOf(l);v=~K?q.length-K:v+q.length}function E(){var q={line:_,column:v};return function($){return $.position=new S(q),x(),$}}function S(q){this.start=q,this.end={line:_,column:v},this.source=b.source}S.prototype.content=g;function w(q){var $=new Error(b.source+":"+_+":"+v+": "+q);if($.reason=q,$.filename=b.source,$.line=_,$.column=v,$.source=g,!b.silent)throw $}function C(q){var $=q.exec(g);if($){var K=$[0];return y(K),g=g.slice(K.length),$}}function x(){C(t)}function N(q){var $;for(q=q||[];$=I();)$!==!1&&q.push($);return q}function I(){var q=E();if(!(c!=g.charAt(0)||u!=g.charAt(1))){for(var $=2;d!=g.charAt($)&&(u!=g.charAt($)||c!=g.charAt($+1));)++$;if($+=2,d===g.charAt($-1))return w("End of comment missing");var K=g.slice(2,$-2);return v+=2,y(K),g=g.slice($),v+=2,q({type:h,comment:K})}}function D(){var q=E(),$=C(n);if($){if(I(),!C(a))return w("property missing ':'");var K=C(i),z=q({type:p,property:m($[0].replace(r,d)),value:K?m(K[0].replace(r,d)):d});return C(s),z}}function V(){var q=[];N(q);for(var $;$=D();)$!==!1&&(q.push($),N(q));return q}return x(),V()};function m(g){return g?g.replace(o,d):d}return fS}var CR;function CX(){if(CR)return xh;CR=1;var r=xh&&xh.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(xh,"__esModule",{value:!0}),xh.default=t;var e=r(TX());function t(n,a){var i=null;if(!n||typeof n!="string")return i;var s=(0,e.default)(n),o=typeof a=="function";return s.forEach(function(l){if(l.type==="declaration"){var c=l.property,u=l.value;o?a(c,u,l):u&&(i=i||{},i[c]=u)}}),i}return xh}var AX=CX();const AR=sh(AX),xX=AR.default||AR,RX=/\d/,OX=["-","_","/","."];function NX(r=""){if(!RX.test(r))return r!==r.toLowerCase()}function IX(r){const e=[];let t="",n,a;for(const i of r){const s=OX.includes(i);if(s===!0){e.push(t),t="",n=void 0;continue}const o=NX(i);if(a===!1){if(n===!1&&o===!0){e.push(t),t=i,n=o;continue}if(n===!0&&o===!1&&t.length>1){const l=t.at(-1);e.push(t.slice(0,Math.max(0,t.length-1))),t=l+i,n=o;continue}}t+=i,n=o,a=s}return e.push(t),e}function NB(r){return r?IX(r).map(e=>MX(e)).join(""):""}function kX(r){return DX(NB(r||""))}function MX(r){return r?r[0].toUpperCase()+r.slice(1):""}function DX(r){return r?r[0].toLowerCase()+r.slice(1):""}function qp(r){if(!r)return{};const e={};function t(n,a){if(n.startsWith("-moz-")||n.startsWith("-webkit-")||n.startsWith("-ms-")||n.startsWith("-o-")){e[NB(n)]=a;return}if(n.startsWith("--")){e[n]=a;return}e[kX(n)]=a}return xX(r,t),e}function Ac(...r){return(...e)=>{for(const t of r)typeof t=="function"&&t(...e)}}function PX(r,e){const t=RegExp(r,"g");return n=>{if(typeof n!="string")throw new TypeError(`expected an argument of type string, but got ${typeof n}`);return n.match(t)?n.replace(t,e):n}}const LX=PX(/[A-Z]/,r=>`-${r.toLowerCase()}`);function FX(r){if(!r||typeof r!="object"||Array.isArray(r))throw new TypeError(`expected an argument of type object, but got ${typeof r}`);return Object.keys(r).map(e=>`${LX(e)}: ${r[e]};`).join(`
`)}function I5(r={}){return FX(r).replace(`
`," ")}const BX=["onabort","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onauxclick","onbeforeinput","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncompositionend","oncompositionstart","oncompositionupdate","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectionchange","onselectstart","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onvolumechange","onwaiting","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel"],UX=new Set(BX);function $X(r){return UX.has(r)}function vr(...r){const e={...r[0]};for(let t=1;t<r.length;t++){const n=r[t];if(n){for(const a of Object.keys(n)){const i=e[a],s=n[a],o=typeof i=="function",l=typeof s=="function";if(o&&$X(a)){const c=i,u=s;e[a]=OB(c,u)}else if(o&&l)e[a]=Ac(i,s);else if(a==="class"){const c=jC(i),u=jC(s);c&&u?e[a]=tm(i,s):c?e[a]=tm(i):u&&(e[a]=tm(s))}else if(a==="style"){const c=typeof i=="object",u=typeof s=="object",d=typeof i=="string",h=typeof s=="string";if(c&&u)e[a]={...i,...s};else if(c&&h){const p=qp(s);e[a]={...i,...p}}else if(d&&u){const p=qp(i);e[a]={...p,...s}}else if(d&&h){const p=qp(i),m=qp(s);e[a]={...p,...m}}else c?e[a]=i:u?e[a]=s:d?e[a]=i:h&&(e[a]=s)}else e[a]=s!==void 0?s:i}for(const a of Object.getOwnPropertySymbols(n)){const i=e[a],s=n[a];e[a]=s!==void 0?s:i}}}return typeof e.style=="object"&&(e.style=I5(e.style).replaceAll(`
`," ")),e.hidden===!1&&(e.hidden=void 0,delete e.hidden),e.disabled===!1&&(e.disabled=void 0,delete e.disabled),e}const GX={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"},zX=I5(GX),IB=typeof window<"u"?window:void 0;function qX(r){let e=r.activeElement;for(;e?.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}var HX=["forEach","isDisjointFrom","isSubsetOf","isSupersetOf"],VX=["difference","intersection","symmetricDifference","union"],xR=!1;class ls extends Set{#e=new Map;#t=_e(0);#r=_e(0);#n=Jo||-1;constructor(e){if(super(),e){for(var t of e)super.add(t);this.#r.v=super.size}xR||this.#a()}#i(e){return Jo===this.#n?_e(e):Mc(e)}#a(){xR=!0;var e=ls.prototype,t=Set.prototype;for(const n of HX)e[n]=function(...a){return f(this.#t),t[n].apply(this,a)};for(const n of VX)e[n]=function(...a){f(this.#t);var i=t[n].apply(this,a);return new ls(i)}}has(e){var t=super.has(e),n=this.#e,a=n.get(e);if(a===void 0){if(!t)return f(this.#t),!1;a=this.#i(!0),n.set(e,a)}return f(a),t}add(e){return super.has(e)||(super.add(e),M(this.#r,super.size),Qs(this.#t)),this}delete(e){var t=super.delete(e),n=this.#e,a=n.get(e);return a!==void 0&&(n.delete(e),M(a,!1)),t&&(M(this.#r,super.size),Qs(this.#t)),t}clear(){if(super.size!==0){super.clear();var e=this.#e;for(var t of e.values())M(t,!1);e.clear(),M(this.#r,0),Qs(this.#t)}}keys(){return this.values()}values(){return f(this.#t),super.values()}entries(){return f(this.#t),super.entries()}[Symbol.iterator](){return this.keys()}get size(){return f(this.#r)}}class Oi extends Map{#e=new Map;#t=_e(0);#r=_e(0);#n=Jo||-1;constructor(e){if(super(),e){for(var[t,n]of e)super.set(t,n);this.#r.v=super.size}}#i(e){return Jo===this.#n?_e(e):Mc(e)}has(e){var t=this.#e,n=t.get(e);if(n===void 0){var a=super.get(e);if(a!==void 0)n=this.#i(0),t.set(e,n);else return f(this.#t),!1}return f(n),!0}forEach(e,t){this.#a(),super.forEach(e,t)}get(e){var t=this.#e,n=t.get(e);if(n===void 0){var a=super.get(e);if(a!==void 0)n=this.#i(0),t.set(e,n);else{f(this.#t);return}}return f(n),super.get(e)}set(e,t){var n=this.#e,a=n.get(e),i=super.get(e),s=super.set(e,t),o=this.#t;if(a===void 0)a=this.#i(0),n.set(e,a),M(this.#r,super.size),Qs(o);else if(i!==t){Qs(a);var l=o.reactions===null?null:new Set(o.reactions),c=l===null||!a.reactions?.every(u=>l.has(u));c&&Qs(o)}return s}delete(e){var t=this.#e,n=t.get(e),a=super.delete(e);return n!==void 0&&(t.delete(e),M(this.#r,super.size),M(n,-1),Qs(this.#t)),a}clear(){if(super.size!==0){super.clear();var e=this.#e;M(this.#r,0);for(var t of e.values())M(t,-1);Qs(this.#t),e.clear()}}#a(){f(this.#t);var e=this.#e;if(this.#r.v!==e.size){for(var t of super.keys())if(!e.has(t)){var n=this.#i(0);e.set(t,n)}}for([,n]of this.#e)f(n)}keys(){return f(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return f(this.#r),super.size}}class YX{#e;#t;constructor(e,t){this.#e=e,this.#t=Yu(t)}get current(){return this.#t(),this.#e()}}const WX=/\(.+\)/,jX=new Set(["all","print","screen","and","or","not","only"]);class kB extends YX{constructor(e,t){let n=WX.test(e)||e.split(/[\s,]+/).some(i=>jX.has(i.trim()))?e:`(${e})`;const a=window.matchMedia(n);super(()=>a.matches,i=>jr(a,"change",i))}}let KX=class{#e;#t;constructor(e={}){const{window:t=IB,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=Yu(a=>{const i=jr(t,"focusin",a),s=jr(t,"focusout",a);return()=>{i(),s()}}))}get current(){return this.#t?.(),this.#e?qX(this.#e):null}};new KX;function MB(r){return typeof r=="function"}function XX(r,e){if(MB(r)){const n=r();return n===void 0?e:n}return r===void 0?e:r}let ka=class{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return tv(this.#t)}get(){const e=Bl(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const t=Bl(this.#t);return t===void 0?e:t}set(e){return Vu(this.#t,e)}};function _v(r,e){let t=_e(null);const n=F(()=>XX(e,250));function a(...i){if(f(t))f(t).timeout&&clearTimeout(f(t).timeout);else{let s,o;const l=new Promise((c,u)=>{s=c,o=u});M(t,{timeout:null,runner:null,promise:l,resolve:s,reject:o},!0)}return f(t).runner=async()=>{if(!f(t))return;const s=f(t);M(t,null);try{s.resolve(await r.apply(this,i))}catch(o){s.reject(o)}},f(t).timeout=setTimeout(f(t).runner,f(n)),f(t).promise}return a.cancel=async()=>{(!f(t)||f(t).timeout===null)&&(await new Promise(i=>setTimeout(i,0)),!f(t)||f(t).timeout===null)||(clearTimeout(f(t).timeout),f(t).reject("Cancelled"),M(t,null))},a.runScheduledNow=async()=>{(!f(t)||!f(t).timeout)&&(await new Promise(i=>setTimeout(i,0)),!f(t)||!f(t).timeout)||(clearTimeout(f(t).timeout),f(t).timeout=null,await f(t).runner?.())},Object.defineProperty(a,"pending",{enumerable:!0,get(){return!!f(t)?.timeout}}),a}function QX(r,e){switch(r){c Line truncated
`," ")),e.hidden===!1&&(e.hidden=void 0,delete e.hidden),e.disabled===!1&&(e.disabled=void 0,delete e.disabled),e}const GX={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"},zX=I5(GX),IB=typeof window<"u"?window:void 0;function qX(r){let e=r.activeElement;for(;e?.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}var HX=["forEach","isDisjointFrom","isSubsetOf","isSupersetOf"],VX=["difference","intersection","symmetricDifference","union"],xR=!1;class ls extends Set{#e=new Map;#t=_e(0);#r=_e(0);#n=Jo||-1;constructor(e){if(super(),e){for(var t of e)super.add(t);this.#r.v=super.size}xR||this.#a()}#i(e){return Jo===this.#n?_e(e):Mc(e)}#a(){xR=!0;var e=ls.prototype,t=Set.prototype;for(const n of HX)e[n]=function(...a){return f(this.#t),t[n].apply(this,a)};for(const n of VX)e[n]=function(...a){f(this.#t);var i=t[n].apply(this,a);return new ls(i)}}has(e){var t=super.has(e),n=this.#e,a=n.get(e);if(a===void 0){if(!t)return f(this.#t),!1;a=this.#i(!0),n.set(e,a)}return f(a),t}add(e){return super.has(e)||(super.add(e),M(this.#r,super.size),Qs(this.#t)),this}delete(e){var t=super.delete(e),n=this.#e,a=n.get(e);return a!==void 0&&(n.delete(e),M(a,!1)),t&&(M(this.#r,super.size),Qs(this.#t)),t}clear(){if(super.size!==0){super.clear();var e=this.#e;for(var t of e.values())M(t,!1);e.clear(),M(this.#r,0),Qs(this.#t)}}keys(){return this.values()}values(){return f(this.#t),super.values()}entries(){return f(this.#t),super.entries()}[Symbol.iterator](){return this.keys()}get size(){return f(this.#r)}}class Oi extends Map{#e=new Map;#t=_e(0);#r=_e(0);#n=Jo||-1;constructor(e){if(super(),e){for(var[t,n]of e)super.set(t,n);this.#r.v=super.size}}#i(e){return Jo===this.#n?_e(e):Mc(e)}has(e){var t=this.#e,n=t.get(e);if(n===void 0){var a=super.get(e);if(a!==void 0)n=this.#i(0),t.set(e,n);else return f(this.#t),!1}return f(n),!0}forEach(e,t){this.#a(),super.forEach(e,t)}get(e){var t=this.#e,n=t.get(e);if(n===void 0){var a=super.get(e);if(a!==void 0)n=this.#i(0),t.set(e,n);else{f(this.#t);return}}return f(n),super.get(e)}set(e,t){var n=this.#e,a=n.get(e),i=super.get(e),s=super.set(e,t),o=this.#t;if(a===void 0)a=this.#i(0),n.set(e,a),M(this.#r,super.size),Qs(o);else if(i!==t){Qs(a);var l=o.reactions===null?null:new Set(o.reactions),c=l===null||!a.reactions?.every(u=>l.has(u));c&&Qs(o)}return s}delete(e){var t=this.#e,n=t.get(e),a=super.delete(e);return n!==void 0&&(t.delete(e),M(this.#r,super.size),M(n,-1),Qs(this.#t)),a}clear(){if(super.size!==0){super.clear();var e=this.#e;M(this.#r,0);for(var t of e.values())M(t,-1);Qs(this.#t),e.clear()}}#a(){f(this.#t);var e=this.#e;if(this.#r.v!==e.size){for(var t of super.keys())if(!e.has(t)){var n=this.#i(0);e.set(t,n)}}for([,n]of this.#e)f(n)}keys(){return f(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return f(this.#r),super.size}}class YX{#e;#t;constructor(e,t){this.#e=e,this.#t=Wu(t)}get current(){return this.#t(),this.#e()}}const WX=/\(.+\)/,jX=new Set(["all","print","screen","and","or","not","only"]);class kB extends YX{constructor(e,t){let n=WX.test(e)||e.split(/[\s,]+/).some(i=>jX.has(i.trim()))?e:`(${e})`;const a=window.matchMedia(n);super(()=>a.matches,i=>jr(a,"change",i))}}let KX=class{#e;#t;constructor(e={}){const{window:t=IB,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=Wu(a=>{const i=jr(t,"focusin",a),s=jr(t,"focusout",a);return()=>{i(),s()}}))}get current(){return this.#t?.(),this.#e?qX(this.#e):null}};new KX;function MB(r){return typeof r=="function"}function XX(r,e){if(MB(r)){const n=r();return n===void 0?e:n}return r===void 0?e:r}let ka=class{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return tv(this.#t)}get(){const e=Bl(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const t=Bl(this.#t);return t===void 0?e:t}set(e){return Yu(this.#t,e)}};function _v(r,e){let t=_e(null);const n=F(()=>XX(e,250));function a(...i){if(f(t))f(t).timeout&&clearTimeout(f(t).timeout);else{let s,o;const l=new Promise((c,u)=>{s=c,o=u});M(t,{timeout:null,runner:null,promise:l,resolve:s,reject:o},!0)}return f(t).runner=async()=>{if(!f(t))return;const s=f(t);M(t,null);try{s.resolve(await r.apply(this,i))}catch(o){s.reject(o)}},f(t).timeout=setTimeout(f(t).runner,f(n)),f(t).promise}return a.cancel=async()=>{(!f(t)||f(t).timeout===null)&&(await new Promise(i=>setTimeout(i,0)),!f(t)||f(t).timeout===null)||(clearTimeout(f(t).timeout),f(t).reject("Cancelled"),M(t,null))},a.runScheduledNow=async()=>{(!f(t)||!f(t).timeout)&&(await new Promise(i=>setTimeout(i,0)),!f(t)||!f(t).timeout)||(clearTimeout(f(t).timeout),f(t).timeout=null,await f(t).runner?.())},Object.defineProperty(a,"pending",{enumerable:!0,get(){return!!f(t)?.timeout}}),a}function QX(r,e){switch(r){c Line truncated
`,ZR="\n\n```\nTurn limit reached\n```\n",JR=`
\`\`\`
@@ -25,16 +25,16 @@ Upstream LLM error:
rounded-t-lg!
`,hne="max-h-80",fne="https://www.google.com/s2/favicons",pne=32,aO=".",iO=2,y_=1e3,sO=60,oO=3600,mne=1,gne=10,lO="0s",VU=256,YU=8192,_ne=/[\x00-\x1F\x7F]/g,bne=/[\x00-\x08\x0A-\x0D\x0E-\x1F\x7F]/g,Yo={[Dn.IMAGE]:m4,[Dn.AUDIO]:b4,[Dn.TEXT]:wc,[Dn.PDF]:p4},vne={[qc.VISION]:f4,[qc.AUDIO]:b4},yne={[qc.VISION]:"Vision",[qc.AUDIO]:"Audio"},Sne=/(```[\s\S]*?```|`[^`\n]+`)/g,Ene=new RegExp("(```[\\S\\s]*?```|`.*?`)|(?<!\\\\)\\\\\\[([\\S\\s]*?[^\\\\])\\\\]|(?<!\\\\)\\\\\\((.*?)\\\\\\)","g"),wne=/\$\$([\s\S]*?\\\\[\s\S]*?)\$\$/,Tne=/\r?\n/,Cne=new Set(["paragraph","heading","emphasis","strong","delete","link","linkReference","tableCell"]),WU=" ",Ane=WU.repeat(4),cO="LlamaCppWebui.config",uO="LlamaCppWebui.userOverrides",dO="LlamaCppWebui.favoriteModels",ES="LlamaCppWebui.mcpDefaultEnabled",xne="img:not([data-error-bound])",Rne="errorBound",hO="errorHandled",wS="true",jU="1.0.0",One=ea.PNG,Nne=new Set([ea.PNG,ea.JPEG,ea.JPG,ea.SVG,ea.WEBP]),Ine="2025-06-18",Va={protocolVersion:Ine,capabilities:{tools:{listChanged:!0}},clientInfo:{name:"llama-webui-mcp",version:jU},requestTimeoutSeconds:300,connectionTimeoutMs:1e4},T4="LlamaCpp-WebUI-MCP-Server",kne=1e3,Mne=2,Dne=3e4,fO=15e3,pO=3,Pne=2,Lne="url",Fne={[Os.WEBSOCKET]:"WebSocket",[Os.STREAMABLE_HTTP]:"HTTP",[Os.SSE]:"SSE"},Bne={[Os.WEBSOCKET]:S4,[Os.STREAMABLE_HTTP]:mre,[Os.SSE]:Tre},Une="https://mcp.example.com/sse",$ne=1,KU=/\.(png|jpg|jpeg|gif|svg|webp)$/i,XU=/\.(js|ts|json|yaml|yml|xml|html|css|py|rs|go|java|cpp|c|h|rb|sh|toml)$/i,Gne=/\.(txt|md|log)$/i,zne=/^[a-z]+:\/\//,qne=/\.[^.]+$/,Hne=/[-_]/,Vne=/^data:([^;]+);base64,([A-Za-z0-9+/]+=*)$/,Yne="mcp-attachment",Wne="res",jne="img",QU="resource.txt",Kne="/",Xne=`
`,mO="unknown type",gO="Binary content",Qne={[ea.JPEG]:"jpg",[ea.JPG]:"jpg",[ea.PNG]:"png",[ea.GIF]:"gif",[ea.WEBP]:"webp"},Zne=8,Jne=20,eae=19,tae=/[^a-z0-9]/gi,rae="_",nae=/_+/g,ZU="T",aae="_",iae=":",sae="-",rc=-1,oae="/",_O="-",lae=":",bO=/^(I?Q\d+(_[A-Z0-9]+)*|F\d+|BF\d+|MXFP\d+(_[A-Z0-9]+)*)$/i,cae=/^UD$/i,uae=/^\d+(\.\d+)?[BbMmKkTt]$/,dae=/^[Aa]\d+(\.\d+)?[BbMmKkTt]$/,hae=new Set(["GGUF","GGML"]),vO=1e6,fae=2e3,yO={TOKENS_PER_SECOND:"t/s"},dc={apiKey:"",systemMessage:"",showSystemMessage:!0,theme:Pl.SYSTEM,showThoughtInProgress:!1,disableReasoningParsing:!1,excludeReasoningFromContext:!1,showRawOutputSwitch:!1,keepStatsVisible:!1,showMessageStats:!0,askForTitleConfirmation:!1,pasteLongTextToFileLen:2500,copyTextAttachmentsAsPlainText:!1,pdfAsImage:!1,disableAutoScroll:!1,renderUserContentAsMarkdown:!1,alwaysShowSidebarOnDesktop:!1,autoShowSidebarOnNewChat:!0,autoMicOnEmpty:!1,fullHeightCodeBlocks:!1,showRawModelNames:!1,mcpServers:"[]",mcpServerUsageStats:"{}",agenticMaxTurns:10,agenticMaxToolPreviewLines:25,showToolCallInProgress:!1,alwaysShowAgenticTurns:!1,samplers:"",backend_sampling:!1,temperature:void 0,dynatemp_range:void 0,dynatemp_exponent:void 0,top_k:void 0,top_p:void 0,min_p:void 0,xtc_probability:void 0,xtc_threshold:void 0,typ_p:void 0,repeat_last_n:void 0,repeat_penalty:void 0,presence_penalty:void 0,frequency_penalty:void 0,dry_multiplier:void 0,dry_base:void 0,dry_allowed_length:void 0,dry_penalty_last_n:void 0,max_tokens:void 0,custom:"",pyInterpreterEnabled:!1,enableContinueGeneration:!1},lu={apiKey:"Set the API Key if you are using <code>--api-key</code> option for the server.",systemMessage:"The starting message that defines how model should behave.",showSystemMessage:"Display the system message at the top of each conversation.",theme:"Choose the color theme for the interface. You can choose between System (follows your device settings), Light, or Dark.",pasteLongTextToFileLen:"On pasting long text, it will be converted to a file. You can control the file length by setting the value of this parameter. Value 0 means disable.",copyTextAttachmentsAsPlainText:"When copying a message with text attachments, combine them into a single plain text string instead of a special format that can be pasted back as attachments.",samplers:'The order at which samplers are applied, in simplified way. Default is "top_k;typ_p;top_p;min_p;temperature": top_k->typ_p->top_p->min_p->temperature',backend_sampling:"Enable backend-based samplers. When enabled, supported samplers run on the accelerator backend for faster sampling.",temperature:"Controls the randomness of the generated text by affecting the probability distribution of the output tokens. Higher = more random, lower = more focused.",dynatemp_range:"Addon for the temperature sampler. The added value to the range of dynamic temperature, which adjusts probabilities by entropy of tokens.",dynatemp_exponent:"Addon for the temperature sampler. Smoothes out the probability redistribution based on the most probable token.",top_k:"Keeps only k top tokens.",top_p:"Limits tokens to those that together have a cumulative probability of at least p",min_p:"Limits tokens based on the minimum probability for a token to be considered, relative to the probability of the most likely token.",xtc_probability:"XTC sampler cuts out top tokens; this parameter controls the chance of cutting tokens at all. 0 disables XTC.",xtc_threshold:"XTC sampler cuts out top tokens; this parameter controls the token probability that is required to cut that token.",typ_p:"Sorts and limits tokens based on the difference between log-probability and entropy.",repeat_last_n:"Last n tokens to consider for penalizing repetition",repeat_penalty:"Controls the repetition of token sequences in the generated text",presence_penalty:"Limits tokens based on whether they appear in the output or not.",frequency_penalty:"Limits tokens based on how often they appear in the output.",dry_multiplier:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets the DRY sampling multiplier.",dry_base:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets the DRY sampling base value.",dry_allowed_length:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets the allowed length for DRY sampling.",dry_penalty_last_n:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets DRY penalty for the last n tokens.",max_tokens:"The maximum number of token per output. Use -1 for infinite (no limit).",custom:"Custom JSON parameters to send to the API. Must be valid JSON format.",showThoughtInProgress:"Expand thought process by default when generating messages.",disableReasoningParsing:"Send reasoning_format=none to prevent server-side extraction of reasoning tokens into separate field",excludeReasoningFromContext:"Strip reasoning content from previous messages Line truncated
https://github.com/highlightjs/highlight.js/issues/2277`),Ea=Gt,Un=Cr),ln===void 0&&(ln=!0);const Yr={code:Un,language:Ea};ul("before:highlight",Yr);const go=Yr.result?Yr.result:In(Yr.language,Yr.code,ln);return go.code=Yr.code,ul("after:highlight",go),go}function In(Gt,Cr,ln,Un){const Ea=Object.create(null);function Yr(nr,yr){return nr.keywords[yr]}function go(){if(!ir.keywords){Ma.addText(qn);return}let nr=0;ir.keywordPatternRe.lastIndex=0;let yr=ir.keywordPatternRe.exec(qn),Ar="";for(;yr;){Ar+=qn.substring(nr,yr.index);const tn=di.case_insensitive?yr[0].toLowerCase():yr[0],la=Yr(ir,tn);if(la){const[hi,Sh]=la;if(Ma.addText(Ar),Ar="",Ea[tn]=(Ea[tn]||0)+1,Ea[tn]<=Ut&&(Da+=Sh),hi.startsWith("_"))Ar+=yr[0];else{const Go=di.classNameAliases[hi]||hi;Sn(yr[0],Go)}}else Ar+=yr[0];nr=ir.keywordPatternRe.lastIndex,yr=ir.keywordPatternRe.exec(qn)}Ar+=qn.substring(nr),Ma.addText(Ar)}function nu(){if(qn==="")return;let nr=null;if(typeof ir.subLanguage=="string"){if(!Qe[ir.subLanguage]){Ma.addText(qn);return}nr=In(ir.subLanguage,qn,!0,au[ir.subLanguage]),au[ir.subLanguage]=nr._top}else nr=Fn(qn,ir.subLanguage.length?ir.subLanguage:null);ir.relevance>0&&(Da+=nr.relevance),Ma.__addSublanguage(nr._emitter,nr.language)}function Si(){ir.subLanguage!=null?nu():go(),qn=""}function Sn(nr,yr){nr!==""&&(Ma.startScope(yr),Ma.addText(nr),Ma.endScope())}function Zl(nr,yr){let Ar=1;const tn=yr.length-1;for(;Ar<=tn;){if(!nr._emit[Ar]){Ar++;continue}const la=di.classNameAliases[nr[Ar]]||nr[Ar],hi=yr[Ar];la?Sn(hi,la):(qn=hi,go(),qn=""),Ar++}}function Jl(nr,yr){return nr.scope&&typeof nr.scope=="string"&&Ma.openNode(di.classNameAliases[nr.scope]||nr.scope),nr.beginScope&&(nr.beginScope._wrap?(Sn(qn,di.classNameAliases[nr.beginScope._wrap]||nr.beginScope._wrap),qn=""):nr.beginScope._multi&&(Zl(nr.beginScope,yr),qn="")),ir=Object.create(nr,{parent:{value:ir}}),ir}function dl(nr,yr,Ar){let tn=y(nr.endRe,Ar);if(tn){if(nr["on:end"]){const la=new e(nr);nr["on:end"](yr,la),la.isMatchIgnored&&(tn=!1)}if(tn){for(;nr.endsParent&&nr.parent;)nr=nr.parent;return nr}}if(nr.endsWithParent)return dl(nr.parent,yr,Ar)}function bh(nr){return ir.matcher.regexIndex===0?(qn+=nr[0],1):(ms=!0,0)}function vh(nr){const yr=nr[0],Ar=nr.rule,tn=new e(Ar),la=[Ar.__beforeBegin,Ar["on:begin"]];for(const hi of la)if(hi&&(hi(nr,tn),tn.isMatchIgnored))return bh(yr);return Ar.skip?qn+=yr:(Ar.excludeBegin&&(qn+=yr),Si(),!Ar.returnBegin&&!Ar.excludeBegin&&(qn=yr)),Jl(Ar,nr),Ar.returnBegin?0:yr.length}function ld(nr){const yr=nr[0],Ar=Cr.substring(nr.index),tn=dl(ir,nr,Ar);if(!tn)return ut;const la=ir;ir.endScope&&ir.endScope._wrap?(Si(),Sn(yr,ir.endScope._wrap)):ir.endScope&&ir.endScope._multi?(Si(),Zl(ir.endScope,nr)):la.skip?qn+=yr:(la.returnEnd||la.excludeEnd||(qn+=yr),Si(),la.excludeEnd&&(qn=yr));do ir.scope&&Ma.closeNode(),!ir.skip&&!ir.subLanguage&&(Da+=ir.relevance),ir=ir.parent;while(ir!==tn.parent);return tn.starts&&Jl(tn.starts,nr),la.returnEnd?0:yr.length}function hp(){const nr=[];for(let yr=ir;yr!==di;yr=yr.parent)yr.scope&&nr.unshift(yr.scope);nr.forEach(yr=>Ma.openNode(yr))}let hl={};function cd(nr,yr){const Ar=yr&&yr[0];if(qn+=nr,Ar==null)return Si(),0;if(hl.type==="begin"&&yr.type==="end"&&hl.index===yr.index&&Ar===""){if(qn+=Cr.slice(yr.index,yr.index+1),!Lt){const tn=new Error(`0 width match regex (${Gt})`);throw tn.languageName=Gt,tn.badRule=hl.rule,tn}return 1}if(hl=yr,yr.type==="begin")return vh(yr);if(yr.type==="illegal"&&!ln){const tn=new Error('Illegal lexeme "'+Ar+'" for mode "'+(ir.scope||"<unnamed>")+'"');throw tn.mode=ir,tn}else if(yr.type==="end"){const tn=ld(yr);if(tn!==ut)return tn}if(yr.type==="illegal"&&Ar==="")return qn+=`
`,1;if(fl>1e5&&fl>yr.index*3)throw new Error("potential infinite loop, way more iterations than matches");return qn+=Ar,Ar.length}const di=Yi(Gt);if(!di)throw st(Dt.replace("{}",Gt)),new Error('Unknown language: "'+Gt+'"');const yh=qt(di);let ud="",ir=Un||yh;const au={},Ma=new wt.__emitter(wt);hp();let qn="",Da=0,Ei=0,fl=0,ms=!1;try{if(di.__emitTokens)di.__emitTokens(Cr,Ma);else{for(ir.matcher.considerAll();;){fl++,ms?ms=!1:ir.matcher.considerAll(),ir.matcher.lastIndex=Ei;const nr=ir.matcher.exec(Cr);if(!nr)break;const yr=Cr.substring(Ei,nr.index),Ar=cd(yr,nr);Ei=nr.index+Ar}cd(Cr.substring(Ei))}return Ma.finalize(),ud=Ma.toHTML(),{language:Gt,value:ud,relevance:Da,illegal:!1,_emitter:Ma,_top:ir}}catch(nr){if(nr.message&&nr.message.includes("Illegal"))return{language:Gt,value:Ft(Cr),illegal:!0,relevance:0,_illegalBy:{message:nr.message,index:Ei,context:Cr.slice(Ei-100,Ei+100),mode:nr.mode,resultSoFar:ud},_emitter:Ma};if(Lt)return{language:Gt,value:Ft(Cr),illegal:!1,relevance:0,errorRaised:nr,_emitter:Ma,_top:ir};throw nr}}function Er(Gt){const Cr={value:Ft(Gt),illegal:!1,relevance:0,_top:bt,_emitter:new wt.__emitter(wt)};return Cr._emitter.addText(Gt),Cr}function Fn(Gt,Cr){Cr=Cr||wt.languages||Object.keys(Qe);const ln=Er(Gt),Un=Cr.filter(Yi).filter($o).map(Si=>In(Si,Gt,!1));Un.unshift(ln);const Ea=Un.sort((Si,Sn)=>{if(Si.relevance!==Sn.relevance)return Sn.relevance-Si.relevance;if(Si.language&&Sn.language){if(Yi(Si.language).supersetOf===Sn.language)return 1;if(Yi(Sn.language).supersetOf===Si.language)return-1}return 0}),[Yr,go]=Ea,nu=Yr;return nu.secondBest=go,nu}function po(Gt,Cr,ln){const Un=Cr&&ft[Cr]||ln;Gt.classList.add("hljs"),Gt.classList.add(`language-${Un}`)}function yi(Gt){let Cr=null;const ln=kt(Gt);if(vt(ln))return;if(ul("before:highlightElement",{el:Gt,language:ln}),Gt.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Gt);return}if(Gt.children.length>0&&(wt.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Gt)),wt.throwUnescapedHTML))throw new Rt("One of your code blocks includes unescaped HTML.",Gt.innerHTML);Cr=Gt;const Un=Cr.textContent,Ea=ln?dr(Un,{language:ln,ignoreIllegals:!0}):Fn(Un);Gt.innerHTML=Ea.value,Gt.dataset.highlighted="yes",po(Gt,ln,Ea.language),Gt.result={language:Ea.language,re:Ea.relevance,relevance:Ea.relevance},Ea.secondBest&&(Gt.secondBest={language:Ea.secondBest.language,relevance:Ea.secondBest.relevance}),ul("after:highlightElement",{el:Gt,result:Ea,text:Un})}function Bo(Gt){wt=tr(wt,Gt)}const Ls=()=>{ui(),Ae("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function fs(){ui(),Ae("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Uo=!1;function ui(){function Gt(){ui()}if(document.readyState==="loading"){Uo||window.addEventListener("DOMContentLoaded",Gt,!1),Uo=!0;return}document.querySelectorAll(wt.cssSelector).forEach(yi)}function od(Gt,Cr){let ln=null;try{ln=Cr(xe)}catch(Un){if(st("Language definition for '{}' could not be registered.".replace("{}",Gt)),Lt)st(Un);else throw Un;ln=bt}ln.name||(ln.name=Gt),Qe[Gt]=ln,ln.rawDefinition=Cr.bind(null,xe),ln.aliases&&oa(ln.aliases,{languageName:Gt})}function ps(Gt){delete Qe[Gt];for(const Cr of Object.keys(ft))ft[Cr]===Gt&&delete ft[Cr]}function ru(){return Object.keys(Qe)}function Yi(Gt){return Gt=(Gt||"").toLowerCase(),Qe[Gt]||Qe[ft[Gt]]}function oa(Gt,{languageName:Cr}){typeof Gt=="string"&&(Gt=[Gt]),Gt.forEach(ln=>{ft[ln.toLowerCase()]=Cr})}function $o(Gt){const Cr=Yi(Gt);return Cr&&!Cr.disableAutodetect}function mo(Gt){Gt["before:highlightBlock"]&&!Gt["before:highlightElement"]&&(Gt["before:highlightElement"]=Cr=>{Gt["before:highlightBlock"](Object.assign({block:Cr.el},Cr))}),Gt["after:highlightBlock"]&&!Gt["after:highlightElement"]&&(Gt["after:highlightElement"]=Cr=>{Gt["after:highlightBlock"](Object.assign({block:Cr.el},Cr))})}function dp(Gt){mo(Gt),Ct.push(Gt)}function Ql(Gt){const Cr=Ct.indexOf(Gt);Cr!==-1&&Ct.splice(Cr,1)}function ul(Gt,Cr){const ln=Gt;Ct.forEach(function(Un){Un[ln]&&Un[ln](Cr)})}function _h(Gt){return Ae("10.7.0","highlightBlock will be removed entirely in v12.0"),Ae("10.7.0","Please use highlightElement now."),yi(Gt)}Object.assign(xe,{highlight:dr,highlightAuto:Fn,highlightAll:ui,highlightElement:yi,highlightBlock:_h,configure:Bo,initHighlighting:Ls,initHighlightingOnLoad:fs,registerLanguage:od,unregisterLanguage:ps,listLanguages:ru,getLanguage:Yi,registerAliases:oa,autoDetection:$o,inherit:tr,addPlugin:dp,removePlugin:Ql}),xe.debugMode=function(){Lt=!1},xe.safeMode=function(){Lt=!0},xe.versionString=ct,xe.regex={concat:g,lookahead:h,either:_,optional:m,anyNumberOfTimes:p};for(const Gt in be)typeof be[Gt]=="object"&&r(be[Gt]);return Object.assign(xe,be),xe},It=Et({}) Line truncated
`,mO="unknown type",gO="Binary content",Qne={[ea.JPEG]:"jpg",[ea.JPG]:"jpg",[ea.PNG]:"png",[ea.GIF]:"gif",[ea.WEBP]:"webp"},Zne=8,Jne=20,eae=19,tae=/[^a-z0-9]/gi,rae="_",nae=/_+/g,ZU="T",aae="_",iae=":",sae="-",rc=-1,oae="/",_O="-",lae=":",bO=/^(I?Q\d+(_[A-Z0-9]+)*|F\d+|BF\d+|MXFP\d+(_[A-Z0-9]+)*)$/i,cae=/^UD$/i,uae=/^\d+(\.\d+)?[BbMmKkTt]$/,dae=/^[Aa]\d+(\.\d+)?[BbMmKkTt]$/,hae=new Set(["GGUF","GGML"]),vO=1e6,fae=2e3,yO={TOKENS_PER_SECOND:"t/s"},dc={apiKey:"",systemMessage:"",showSystemMessage:!0,theme:Pl.SYSTEM,showThoughtInProgress:!1,disableReasoningParsing:!1,excludeReasoningFromContext:!1,showRawOutputSwitch:!1,keepStatsVisible:!1,showMessageStats:!0,askForTitleConfirmation:!1,pasteLongTextToFileLen:2500,copyTextAttachmentsAsPlainText:!1,pdfAsImage:!1,disableAutoScroll:!1,renderUserContentAsMarkdown:!1,alwaysShowSidebarOnDesktop:!1,autoShowSidebarOnNewChat:!0,autoMicOnEmpty:!1,fullHeightCodeBlocks:!1,showRawModelNames:!1,mcpServers:"[]",mcpServerUsageStats:"{}",agenticMaxTurns:10,agenticMaxToolPreviewLines:25,showToolCallInProgress:!1,alwaysShowAgenticTurns:!1,samplers:"",backend_sampling:!1,temperature:void 0,dynatemp_range:void 0,dynatemp_exponent:void 0,top_k:void 0,top_p:void 0,min_p:void 0,xtc_probability:void 0,xtc_threshold:void 0,typ_p:void 0,repeat_last_n:void 0,repeat_penalty:void 0,presence_penalty:void 0,frequency_penalty:void 0,dry_multiplier:void 0,dry_base:void 0,dry_allowed_length:void 0,dry_penalty_last_n:void 0,max_tokens:void 0,custom:"",pyInterpreterEnabled:!1,enableContinueGeneration:!1},cu={apiKey:"Set the API Key if you are using <code>--api-key</code> option for the server.",systemMessage:"The starting message that defines how model should behave.",showSystemMessage:"Display the system message at the top of each conversation.",theme:"Choose the color theme for the interface. You can choose between System (follows your device settings), Light, or Dark.",pasteLongTextToFileLen:"On pasting long text, it will be converted to a file. You can control the file length by setting the value of this parameter. Value 0 means disable.",copyTextAttachmentsAsPlainText:"When copying a message with text attachments, combine them into a single plain text string instead of a special format that can be pasted back as attachments.",samplers:'The order at which samplers are applied, in simplified way. Default is "top_k;typ_p;top_p;min_p;temperature": top_k->typ_p->top_p->min_p->temperature',backend_sampling:"Enable backend-based samplers. When enabled, supported samplers run on the accelerator backend for faster sampling.",temperature:"Controls the randomness of the generated text by affecting the probability distribution of the output tokens. Higher = more random, lower = more focused.",dynatemp_range:"Addon for the temperature sampler. The added value to the range of dynamic temperature, which adjusts probabilities by entropy of tokens.",dynatemp_exponent:"Addon for the temperature sampler. Smoothes out the probability redistribution based on the most probable token.",top_k:"Keeps only k top tokens.",top_p:"Limits tokens to those that together have a cumulative probability of at least p",min_p:"Limits tokens based on the minimum probability for a token to be considered, relative to the probability of the most likely token.",xtc_probability:"XTC sampler cuts out top tokens; this parameter controls the chance of cutting tokens at all. 0 disables XTC.",xtc_threshold:"XTC sampler cuts out top tokens; this parameter controls the token probability that is required to cut that token.",typ_p:"Sorts and limits tokens based on the difference between log-probability and entropy.",repeat_last_n:"Last n tokens to consider for penalizing repetition",repeat_penalty:"Controls the repetition of token sequences in the generated text",presence_penalty:"Limits tokens based on whether they appear in the output or not.",frequency_penalty:"Limits tokens based on how often they appear in the output.",dry_multiplier:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets the DRY sampling multiplier.",dry_base:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets the DRY sampling base value.",dry_allowed_length:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets the allowed length for DRY sampling.",dry_penalty_last_n:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets DRY penalty for the last n tokens.",max_tokens:"The maximum number of token per output. Use -1 for infinite (no limit).",custom:"Custom JSON parameters to send to the API. Must be valid JSON format.",showThoughtInProgress:"Expand thought process by default when generating messages.",disableReasoningParsing:"Send reasoning_format=none to prevent server-side extraction of reasoning tokens into separate field",excludeReasoningFromContext:"Strip reasoning content from previous messages Line truncated
https://github.com/highlightjs/highlight.js/issues/2277`),Ea=Gt,Un=Cr),ln===void 0&&(ln=!0);const Yr={code:Un,language:Ea};ul("before:highlight",Yr);const go=Yr.result?Yr.result:In(Yr.language,Yr.code,ln);return go.code=Yr.code,ul("after:highlight",go),go}function In(Gt,Cr,ln,Un){const Ea=Object.create(null);function Yr(nr,yr){return nr.keywords[yr]}function go(){if(!ir.keywords){Ma.addText(qn);return}let nr=0;ir.keywordPatternRe.lastIndex=0;let yr=ir.keywordPatternRe.exec(qn),Ar="";for(;yr;){Ar+=qn.substring(nr,yr.index);const tn=di.case_insensitive?yr[0].toLowerCase():yr[0],la=Yr(ir,tn);if(la){const[hi,Sh]=la;if(Ma.addText(Ar),Ar="",Ea[tn]=(Ea[tn]||0)+1,Ea[tn]<=Ut&&(Da+=Sh),hi.startsWith("_"))Ar+=yr[0];else{const Go=di.classNameAliases[hi]||hi;Sn(yr[0],Go)}}else Ar+=yr[0];nr=ir.keywordPatternRe.lastIndex,yr=ir.keywordPatternRe.exec(qn)}Ar+=qn.substring(nr),Ma.addText(Ar)}function au(){if(qn==="")return;let nr=null;if(typeof ir.subLanguage=="string"){if(!Qe[ir.subLanguage]){Ma.addText(qn);return}nr=In(ir.subLanguage,qn,!0,iu[ir.subLanguage]),iu[ir.subLanguage]=nr._top}else nr=Fn(qn,ir.subLanguage.length?ir.subLanguage:null);ir.relevance>0&&(Da+=nr.relevance),Ma.__addSublanguage(nr._emitter,nr.language)}function Si(){ir.subLanguage!=null?au():go(),qn=""}function Sn(nr,yr){nr!==""&&(Ma.startScope(yr),Ma.addText(nr),Ma.endScope())}function Zl(nr,yr){let Ar=1;const tn=yr.length-1;for(;Ar<=tn;){if(!nr._emit[Ar]){Ar++;continue}const la=di.classNameAliases[nr[Ar]]||nr[Ar],hi=yr[Ar];la?Sn(hi,la):(qn=hi,go(),qn=""),Ar++}}function Jl(nr,yr){return nr.scope&&typeof nr.scope=="string"&&Ma.openNode(di.classNameAliases[nr.scope]||nr.scope),nr.beginScope&&(nr.beginScope._wrap?(Sn(qn,di.classNameAliases[nr.beginScope._wrap]||nr.beginScope._wrap),qn=""):nr.beginScope._multi&&(Zl(nr.beginScope,yr),qn="")),ir=Object.create(nr,{parent:{value:ir}}),ir}function dl(nr,yr,Ar){let tn=y(nr.endRe,Ar);if(tn){if(nr["on:end"]){const la=new e(nr);nr["on:end"](yr,la),la.isMatchIgnored&&(tn=!1)}if(tn){for(;nr.endsParent&&nr.parent;)nr=nr.parent;return nr}}if(nr.endsWithParent)return dl(nr.parent,yr,Ar)}function bh(nr){return ir.matcher.regexIndex===0?(qn+=nr[0],1):(ms=!0,0)}function vh(nr){const yr=nr[0],Ar=nr.rule,tn=new e(Ar),la=[Ar.__beforeBegin,Ar["on:begin"]];for(const hi of la)if(hi&&(hi(nr,tn),tn.isMatchIgnored))return bh(yr);return Ar.skip?qn+=yr:(Ar.excludeBegin&&(qn+=yr),Si(),!Ar.returnBegin&&!Ar.excludeBegin&&(qn=yr)),Jl(Ar,nr),Ar.returnBegin?0:yr.length}function ld(nr){const yr=nr[0],Ar=Cr.substring(nr.index),tn=dl(ir,nr,Ar);if(!tn)return ut;const la=ir;ir.endScope&&ir.endScope._wrap?(Si(),Sn(yr,ir.endScope._wrap)):ir.endScope&&ir.endScope._multi?(Si(),Zl(ir.endScope,nr)):la.skip?qn+=yr:(la.returnEnd||la.excludeEnd||(qn+=yr),Si(),la.excludeEnd&&(qn=yr));do ir.scope&&Ma.closeNode(),!ir.skip&&!ir.subLanguage&&(Da+=ir.relevance),ir=ir.parent;while(ir!==tn.parent);return tn.starts&&Jl(tn.starts,nr),la.returnEnd?0:yr.length}function hp(){const nr=[];for(let yr=ir;yr!==di;yr=yr.parent)yr.scope&&nr.unshift(yr.scope);nr.forEach(yr=>Ma.openNode(yr))}let hl={};function cd(nr,yr){const Ar=yr&&yr[0];if(qn+=nr,Ar==null)return Si(),0;if(hl.type==="begin"&&yr.type==="end"&&hl.index===yr.index&&Ar===""){if(qn+=Cr.slice(yr.index,yr.index+1),!Lt){const tn=new Error(`0 width match regex (${Gt})`);throw tn.languageName=Gt,tn.badRule=hl.rule,tn}return 1}if(hl=yr,yr.type==="begin")return vh(yr);if(yr.type==="illegal"&&!ln){const tn=new Error('Illegal lexeme "'+Ar+'" for mode "'+(ir.scope||"<unnamed>")+'"');throw tn.mode=ir,tn}else if(yr.type==="end"){const tn=ld(yr);if(tn!==ut)return tn}if(yr.type==="illegal"&&Ar==="")return qn+=`
`,1;if(fl>1e5&&fl>yr.index*3)throw new Error("potential infinite loop, way more iterations than matches");return qn+=Ar,Ar.length}const di=Yi(Gt);if(!di)throw st(Dt.replace("{}",Gt)),new Error('Unknown language: "'+Gt+'"');const yh=qt(di);let ud="",ir=Un||yh;const iu={},Ma=new wt.__emitter(wt);hp();let qn="",Da=0,Ei=0,fl=0,ms=!1;try{if(di.__emitTokens)di.__emitTokens(Cr,Ma);else{for(ir.matcher.considerAll();;){fl++,ms?ms=!1:ir.matcher.considerAll(),ir.matcher.lastIndex=Ei;const nr=ir.matcher.exec(Cr);if(!nr)break;const yr=Cr.substring(Ei,nr.index),Ar=cd(yr,nr);Ei=nr.index+Ar}cd(Cr.substring(Ei))}return Ma.finalize(),ud=Ma.toHTML(),{language:Gt,value:ud,relevance:Da,illegal:!1,_emitter:Ma,_top:ir}}catch(nr){if(nr.message&&nr.message.includes("Illegal"))return{language:Gt,value:Ft(Cr),illegal:!0,relevance:0,_illegalBy:{message:nr.message,index:Ei,context:Cr.slice(Ei-100,Ei+100),mode:nr.mode,resultSoFar:ud},_emitter:Ma};if(Lt)return{language:Gt,value:Ft(Cr),illegal:!1,relevance:0,errorRaised:nr,_emitter:Ma,_top:ir};throw nr}}function Er(Gt){const Cr={value:Ft(Gt),illegal:!1,relevance:0,_top:bt,_emitter:new wt.__emitter(wt)};return Cr._emitter.addText(Gt),Cr}function Fn(Gt,Cr){Cr=Cr||wt.languages||Object.keys(Qe);const ln=Er(Gt),Un=Cr.filter(Yi).filter($o).map(Si=>In(Si,Gt,!1));Un.unshift(ln);const Ea=Un.sort((Si,Sn)=>{if(Si.relevance!==Sn.relevance)return Sn.relevance-Si.relevance;if(Si.language&&Sn.language){if(Yi(Si.language).supersetOf===Sn.language)return 1;if(Yi(Sn.language).supersetOf===Si.language)return-1}return 0}),[Yr,go]=Ea,au=Yr;return au.secondBest=go,au}function po(Gt,Cr,ln){const Un=Cr&&ft[Cr]||ln;Gt.classList.add("hljs"),Gt.classList.add(`language-${Un}`)}function yi(Gt){let Cr=null;const ln=kt(Gt);if(vt(ln))return;if(ul("before:highlightElement",{el:Gt,language:ln}),Gt.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Gt);return}if(Gt.children.length>0&&(wt.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Gt)),wt.throwUnescapedHTML))throw new Rt("One of your code blocks includes unescaped HTML.",Gt.innerHTML);Cr=Gt;const Un=Cr.textContent,Ea=ln?dr(Un,{language:ln,ignoreIllegals:!0}):Fn(Un);Gt.innerHTML=Ea.value,Gt.dataset.highlighted="yes",po(Gt,ln,Ea.language),Gt.result={language:Ea.language,re:Ea.relevance,relevance:Ea.relevance},Ea.secondBest&&(Gt.secondBest={language:Ea.secondBest.language,relevance:Ea.secondBest.relevance}),ul("after:highlightElement",{el:Gt,result:Ea,text:Un})}function Bo(Gt){wt=tr(wt,Gt)}const Ls=()=>{ui(),Ae("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function fs(){ui(),Ae("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Uo=!1;function ui(){function Gt(){ui()}if(document.readyState==="loading"){Uo||window.addEventListener("DOMContentLoaded",Gt,!1),Uo=!0;return}document.querySelectorAll(wt.cssSelector).forEach(yi)}function od(Gt,Cr){let ln=null;try{ln=Cr(xe)}catch(Un){if(st("Language definition for '{}' could not be registered.".replace("{}",Gt)),Lt)st(Un);else throw Un;ln=bt}ln.name||(ln.name=Gt),Qe[Gt]=ln,ln.rawDefinition=Cr.bind(null,xe),ln.aliases&&oa(ln.aliases,{languageName:Gt})}function ps(Gt){delete Qe[Gt];for(const Cr of Object.keys(ft))ft[Cr]===Gt&&delete ft[Cr]}function nu(){return Object.keys(Qe)}function Yi(Gt){return Gt=(Gt||"").toLowerCase(),Qe[Gt]||Qe[ft[Gt]]}function oa(Gt,{languageName:Cr}){typeof Gt=="string"&&(Gt=[Gt]),Gt.forEach(ln=>{ft[ln.toLowerCase()]=Cr})}function $o(Gt){const Cr=Yi(Gt);return Cr&&!Cr.disableAutodetect}function mo(Gt){Gt["before:highlightBlock"]&&!Gt["before:highlightElement"]&&(Gt["before:highlightElement"]=Cr=>{Gt["before:highlightBlock"](Object.assign({block:Cr.el},Cr))}),Gt["after:highlightBlock"]&&!Gt["after:highlightElement"]&&(Gt["after:highlightElement"]=Cr=>{Gt["after:highlightBlock"](Object.assign({block:Cr.el},Cr))})}function dp(Gt){mo(Gt),Ct.push(Gt)}function Ql(Gt){const Cr=Ct.indexOf(Gt);Cr!==-1&&Ct.splice(Cr,1)}function ul(Gt,Cr){const ln=Gt;Ct.forEach(function(Un){Un[ln]&&Un[ln](Cr)})}function _h(Gt){return Ae("10.7.0","highlightBlock will be removed entirely in v12.0"),Ae("10.7.0","Please use highlightElement now."),yi(Gt)}Object.assign(xe,{highlight:dr,highlightAuto:Fn,highlightAll:ui,highlightElement:yi,highlightBlock:_h,configure:Bo,initHighlighting:Ls,initHighlightingOnLoad:fs,registerLanguage:od,unregisterLanguage:ps,listLanguages:nu,getLanguage:Yi,registerAliases:oa,autoDetection:$o,inherit:tr,addPlugin:dp,removePlugin:Ql}),xe.debugMode=function(){Lt=!1},xe.safeMode=function(){Lt=!0},xe.versionString=ct,xe.regex={concat:g,lookahead:h,either:_,optional:m,anyNumberOfTimes:p};for(const Gt in be)typeof be[Gt]=="object"&&r(be[Gt]);return Object.assign(xe,be),xe},It=Et({}) Line truncated
`},m]}}return u2=a,u2}var d2,cI;function yse(){if(cI)return d2;cI=1;function r(e){const t="[a-zA-Z_][\\w.]*",n="<\\?(lasso(script)?|=)",a="\\]|\\?>",i={$pattern:t+"|&[lg]t;",literal:"true false none minimal full all void and or not bw nbw ew new cn ncn lt lte gt gte eq neq rx nrx ft",built_in:"array date decimal duration integer map pair string tag xml null boolean bytes keyword list locale queue set stack staticarray local var variable global data self inherited currentcapture givenblock",keyword:"cache database_names database_schemanames database_tablenames define_tag define_type email_batch encode_set html_comment handle handle_error header if inline iterate ljax_target link link_currentaction link_currentgroup link_currentrecord link_detail link_firstgroup link_firstrecord link_lastgroup link_lastrecord link_nextgroup link_nextrecord link_prevgroup link_prevrecord log loop namespace_using output_none portal private protect records referer referrer repeating resultset rows search_args search_arguments select sort_args sort_arguments thread_atomic value_list while abort case else fail_if fail_ifnot fail if_empty if_false if_null if_true loop_abort loop_continue loop_count params params_up return return_value run_children soap_definetag soap_lastrequest soap_lastresponse tag_name ascending average by define descending do equals frozen group handle_failure import in into join let match max min on order parent protected provide public require returnhome skip split_thread sum take thread to trait type where with yield yieldhome"},s=e.COMMENT("<!--","-->",{relevance:0}),o={className:"meta",begin:"\\[noprocess\\]",starts:{end:"\\[/noprocess\\]",returnEnd:!0,contains:[s]}},l={className:"meta",begin:"\\[/noprocess|"+n},c={className:"symbol",begin:"'"+t+"'"},u=[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.inherit(e.C_NUMBER_MODE,{begin:e.C_NUMBER_RE+"|(-?infinity|NaN)\\b"}),e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"`",end:"`"},{variants:[{begin:"[#$]"+t},{begin:"#",end:"\\d+",illegal:"\\W"}]},{className:"type",begin:"::\\s*",end:t,illegal:"\\W"},{className:"params",variants:[{begin:"-(?!infinity)"+t,relevance:0},{begin:"(\\.\\.\\.)"}]},{begin:/(->|\.)\s*/,relevance:0,contains:[c]},{className:"class",beginKeywords:"define",returnEnd:!0,end:"\\(|=>",contains:[e.inherit(e.TITLE_MODE,{begin:t+"(=(?!>))?|[-+*/%](?!>)"})]}];return{name:"Lasso",aliases:["ls","lassoscript"],case_insensitive:!0,keywords:i,contains:[{className:"meta",begin:a,relevance:0,starts:{end:"\\[|"+n,returnEnd:!0,relevance:0,contains:[s]}},o,l,{className:"meta",begin:"\\[no_square_brackets",starts:{end:"\\[/no_square_brackets\\]",keywords:i,contains:[{className:"meta",begin:a,relevance:0,starts:{end:"\\[noprocess\\]|"+n,returnEnd:!0,contains:[s]}},o,l].concat(u)}},{className:"meta",begin:"\\[",relevance:0},{className:"meta",begin:"^#!",end:"lasso9$",relevance:10}].concat(u)}}return d2=r,d2}var h2,uI;function Sse(){if(uI)return h2;uI=1;function r(e){const n=e.regex.either(...["(?:NeedsTeXFormat|RequirePackage|GetIdInfo)","Provides(?:Expl)?(?:Package|Class|File)","(?:DeclareOption|ProcessOptions)","(?:documentclass|usepackage|input|include)","makeat(?:letter|other)","ExplSyntax(?:On|Off)","(?:new|renew|provide)?command","(?:re)newenvironment","(?:New|Renew|Provide|Declare)(?:Expandable)?DocumentCommand","(?:New|Renew|Provide|Declare)DocumentEnvironment","(?:(?:e|g|x)?def|let)","(?:begin|end)","(?:part|chapter|(?:sub){0,2}section|(?:sub)?paragraph)","caption","(?:label|(?:eq|page|name)?ref|(?:paren|foot|super)?cite)","(?:alpha|beta|[Gg]amma|[Dd]elta|(?:var)?epsilon|zeta|eta|[Tt]heta|vartheta)","(?:iota|(?:var)?kappa|[Ll]ambda|mu|nu|[Xx]i|[Pp]i|varpi|(?:var)rho)","(?:[Ss]igma|varsigma|tau|[Uu]psilon|[Pp]hi|varphi|chi|[Pp]si|[Oo]mega)","(?:frac|sum|prod|lim|infty|times|sqrt|leq|geq|left|right|middle|[bB]igg?)","(?:[lr]angle|q?quad|[lcvdi]?dots|d?dot|hat|tilde|bar)"].map(D=>D+"(?![a-zA-Z@:_])")),a=new RegExp(["(?:__)?[a-zA-Z]{2,}_[a-zA-Z](?:_?[a-zA-Z])+:[a-zA-Z]*","[lgc]__?[a-zA-Z](?:_?[a-zA-Z])*_[a-zA-Z]{2,}","[qs]__?[a-zA-Z](?:_?[a-zA-Z])+","use(?:_i)?:[a-zA-Z]*","(?:else|fi|or):","(?:if|cs|exp):w","(?:hbox|vbox):n","::[a-zA-Z]_unbraced","::[a-zA-Z:]"].map(D=>D+"(?![a-zA-Z:_])").join("|")),i=[{begin:/[a-zA-Z@]+/},{begin:/[^a-zA-Z@]?/}],s=[{begin:/\^{6}[0-9a-f]{6}/},{begin:/\^{5}[0-9a-f]{5}/},{begin:/\^{4}[0-9a-f]{4}/},{begin:/\^{3}[0-9a-f]{3}/},{begin:/\^{2}[0-9a-f]{2}/},{begin:/\^{2}[\u0000-\u007f]/}],o={className:"keyword",begin:/\\/,relevance:0,contains:[{endsParent:!0,begin:n},{endsParent:!0,begin:a},{endsParent:!0,variants:s},{endsParent:!0,relevance:0,variants:i}]},l={className:"params",relevance:0,begin:/#+\d?/},c={variants:s},u={className:"built_in",relevance:0,begin:/[$&^_]/},d={className:"meta",begin:/% ?!(T[eE]X|tex|BIB|bib)/,end:"$",relevance:10},h=e.COMMENT("%","$",{relevance:0}),p=[o,l,c,u,d,h],m={begin:/\{/,end:/\}/,relevance:0,contains:["self",...p]},g=e.inheri Line truncated
]`,g={scope:"string",variants:[d,u,h,p]},b={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},_=["false","null","true"],v=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],y=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],S={keyword:v,literal:(K=>{const z=[];return K.forEach(re=>{z.push(re),re.toLowerCase()===re?z.push(re.toUpperCase()):z.push(re.toLowerCase())}),z})(_),built_in:y},w=K=>K.map(z=>z.replace(/\|\d+$/,"")),C={variants:[{match:[/new/,t.concat(m,"+"),t.concat("(?!",w(y).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},x=t.concat(a,"\\b(?!\\()"),N={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),x],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),x],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},I={scope:"attr",match:t.concat(a,t.lookahead(":"),t.lookahead(/(?!::)/))},D={relevance:0,begin:/\(/,end:/\)/,keywords:S,contains:[I,o,N,e.C_BLOCK_COMMENT_MODE,g,b,C]},V={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",w(v).join("\\b|"),"|",w(y).join("\\b|"),"\\b)"),a,t.concat(m,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[D]};D.contains.push(V);const q=[I,N,e.C_BLOCK_COMMENT_MODE,g,b,C],$={begin:t.concat(/#\[\s*\\?/,t.either(i,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:_,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:_,keyword:["new","array"]},contains:["self",...q]},...q,{scope:"meta",variants:[{match:i},{match:s}]}]};return{case_insensitive:!1,keywords:S,contains:[$,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},o,V,N,{match:[/const/,/\s/,a],scope:{1:"keyword",3:"variable.constant"}},C,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:S,contains:["self",$,o,N,e.C_BLOCK_COMMENT_MODE,g,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywor Line truncated
]*;`,relevance:0},{begin:"[vp][0-9]+"}]}}return Tw=r,Tw}var Cw,w7;function Doe(){if(w7)return Cw;w7=1;function r(e){const t="[a-z][a-zA-Z0-9_]*",n={className:"string",begin:"\\$.{1}"},a={className:"symbol",begin:"#"+e.UNDERSCORE_IDENT_RE};return{name:"Smalltalk",aliases:["st"],keywords:["self","super","nil","true","false","thisContext"],contains:[e.COMMENT('"','"'),e.APOS_STRING_MODE,{className:"type",begin:"\\b[A-Z][A-Za-z0-9_]*",relevance:0},{begin:t+":",relevance:0},e.C_NUMBER_MODE,a,n,{begin:"\\|[ ]*"+t+"([ ]+"+t+")*[ ]*\\|",returnBegin:!0,end:/\|/,illegal:/\S/,contains:[{begin:"(\\|[ ]*)?"+t}]},{begin:"#\\(",end:"\\)",contains:[e.APOS_STRING_MODE,n,e.C_NUMBER_MODE,a]}]}}return Cw=r,Cw}var Aw,T7;function Poe(){if(T7)return Aw;T7=1;function r(e){return{name:"SML (Standard ML)",aliases:["ml"],keywords:{$pattern:"[a-z_]\\w*!?",keyword:"abstype and andalso as case datatype do else end eqtype exception fn fun functor handle if in include infix infixr let local nonfix of op open orelse raise rec sharing sig signature struct structure then type val with withtype where while",built_in:"array bool char exn int list option order real ref string substring vector unit word",literal:"true false NONE SOME LESS EQUAL GREATER nil"},illegal:/\/\/|>>/,contains:[{className:"literal",begin:/\[(\|\|)?\]|\(\)/,relevance:0},e.COMMENT("\\(\\*","\\*\\)",{contains:["self"]}),{className:"symbol",begin:"'[A-Za-z_](?!')[\\w']*"},{className:"type",begin:"`[A-Z][\\w']*"},{className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},{begin:"[a-z_]\\w*'[\\w']*"},e.inherit(e.APOS_STRING_MODE,{className:"string",relevance:0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"number",begin:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",relevance:0},{begin:/[-=]>/}]}}return Aw=r,Aw}var xw,C7;function Loe(){if(C7)return xw;C7=1;function r(e){const t={className:"variable",begin:/\b_+[a-zA-Z]\w*/},n={className:"title",begin:/[a-zA-Z][a-zA-Z_0-9]*_fnc_[a-zA-Z_0-9]+/},a={className:"string",variants:[{begin:'"',end:'"',contains:[{begin:'""',relevance:0}]},{begin:"'",end:"'",contains:[{begin:"''",relevance:0}]}]},i=["break","breakWith","breakOut","breakTo","case","catch","continue","continueWith","default","do","else","exit","exitWith","for","forEach","from","if","local","private","switch","step","then","throw","to","try","waitUntil","while","with"],s=["blufor","civilian","configNull","controlNull","displayNull","diaryRecordNull","east","endl","false","grpNull","independent","lineBreak","locationNull","nil","objNull","opfor","pi","resistance","scriptNull","sideAmbientLife","sideEmpty","sideEnemy","sideFriendly","sideLogic","sideUnknown","taskNull","teamMemberNull","true","west"],o=["abs","accTime","acos","action","actionIDs","actionKeys","actionKeysEx","actionKeysImages","actionKeysNames","actionKeysNamesArray","actionName","actionParams","activateAddons","activatedAddons","activateKey","activeTitleEffectParams","add3DENConnection","add3DENEventHandler","add3DENLayer","addAction","addBackpack","addBackpackCargo","addBackpackCargoGlobal","addBackpackGlobal","addBinocularItem","addCamShake","addCuratorAddons","addCuratorCameraArea","addCuratorEditableObjects","addCuratorEditingArea","addCuratorPoints","addEditorObject","addEventHandler","addForce","addForceGeneratorRTD","addGoggles","addGroupIcon","addHandgunItem","addHeadgear","addItem","addItemCargo","addItemCargoGlobal","addItemPool","addItemToBackpack","addItemToUniform","addItemToVest","addLiveStats","addMagazine","addMagazineAmmoCargo","addMagazineCargo","addMagazineCargoGlobal","addMagazineGlobal","addMagazinePool","addMagazines","addMagazineTurret","addMenu","addMenuItem","addMissionEventHandler","addMPEventHandler","addMusicEventHandler","addonFiles","addOwnedMine","addPlayerScores","addPrimaryWeaponItem","addPublicVariableEventHandler","addRating","addResources","addScore","addScoreSide","addSecondaryWeaponItem","addSwitchableUnit","addTeamMember","addToRemainsCollector","addTorque","addUniform","addUserActionEventHandler","addVehicle","addVest","addWaypoint","addWeapon","addWeaponCargo","addWeaponCargoGlobal","addWeaponGlobal","addWeaponItem","addWeaponPool","addWeaponTurret","addWeaponWithAttachmentsCargo","addWeaponWithAttachmentsCargoGlobal","admin","agent","agents","AGLToASL","aimedAtTarget","aimPos","airDensityCurveRTD","airDensityRTD","airplaneThrottle","airportSide","AISFinishHeal","alive","all3DENEntities","allActiveTitleEffects","allAddonsInfo","allAirports","allControls","allCurators","allCutLayers","allDead","allDeadMen","allDiaryRecords","allDiarySubjects","allDisplays","allEnv3DSoundSources","allGroups","allLODs","allMapMarkers","allMines","allMissionObjects","allObjects","allow3DMode","allowCrewInImmobile","allowCuratorLogicIgnoreAreas","allowDamage","allowDammage","allowedService","allowFileOperations","allowFleeing","allowGetIn","allowService","allowSprint","allPlayers","allSimpleObjects","allSiLine truncated
]*?"'`},{begin:`"[^\r
"]*"`}]},{className:"built_in",variants:[{begin:"\\b(abs|acos|asin|atan|atan2|atanh|ceil|cloglog|comb|cos|digamma|exp|floor|invcloglog|invlogit|ln|lnfact|lnfactorial|lngamma|log|log10|max|min|mod|reldif|round|sign|sin|sqrt|sum|tan|tanh|trigamma|trunc|betaden|Binomial|binorm|binormal|chi2|chi2tail|dgammapda|dgammapdada|dgammapdadx|dgammapdx|dgammapdxdx|F|Fden|Ftail|gammaden|gammap|ibeta|invbinomial|invchi2|invchi2tail|invF|invFtail|invgammap|invibeta|invnchi2|invnFtail|invnibeta|invnorm|invnormal|invttail|nbetaden|nchi2|nFden|nFtail|nibeta|norm|normal|normalden|normd|npnchi2|tden|ttail|uniform|abbrev|char|index|indexnot|length|lower|ltrim|match|plural|proper|real|regexm|regexr|regexs|reverse|rtrim|string|strlen|strlower|strltrim|strmatch|strofreal|strpos|strproper|strreverse|strrtrim|strtrim|strupper|subinstr|subinword|substr|trim|upper|word|wordcount|_caller|autocode|byteorder|chop|clip|cond|e|epsdouble|epsfloat|group|inlist|inrange|irecode|matrix|maxbyte|maxdouble|maxfloat|maxint|maxlong|mi|minbyte|mindouble|minfloat|minint|minlong|missing|r|recode|replay|return|s|scalar|d|date|day|dow|doy|halfyear|mdy|month|quarter|week|year|d|daily|dofd|dofh|dofm|dofq|dofw|dofy|h|halfyearly|hofd|m|mofd|monthly|q|qofd|quarterly|tin|twithin|w|weekly|wofd|y|yearly|yh|ym|yofd|yq|yw|cholesky|colnumb|colsof|corr|det|diag|diag0cnt|el|get|hadamard|I|inv|invsym|issym|issymmetric|J|matmissing|matuniform|mreldif|nullmat|rownumb|rowsof|sweep|syminv|trace|vec|vecdiag)(?=\\()"}]},e.COMMENT("^[ ]*\\*.*$",!1),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]}}return Nw=r,Nw}var Iw,O7;function $oe(){if(O7)return Iw;O7=1;function r(e){return{name:"STEP Part 21",aliases:["p21","step","stp"],case_insensitive:!0,keywords:{$pattern:"[A-Z_][A-Z0-9_.]*",keyword:["HEADER","ENDSEC","DATA"]},contains:[{className:"meta",begin:"ISO-10303-21;",relevance:10},{className:"meta",begin:"END-ISO-10303-21;",relevance:10},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.COMMENT("/\\*\\*!","\\*/"),e.C_NUMBER_MODE,e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"'",end:"'"},{className:"symbol",variants:[{begin:"#",end:"\\d+",illegal:"\\W"}]}]}}return Iw=r,Iw}var kw,N7;function Goe(){if(N7)return kw;N7=1;const r=c=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:c.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[c.APOS_STRING_MODE,c.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:c.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],t=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],n=[...e,...t],a=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),i=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target Line truncated
(multipart)?`,end:`\\]
`},{className:"string",begin:"\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}.\\d+Z"},{className:"string",begin:"(\\+|-)\\d+"},{className:"keyword",relevance:10,variants:[{begin:"^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?"},{begin:"^progress(:?)(\\s+)?(pop|push)?"},{begin:"^tags:"},{begin:"^time:"}]}]}}return Mw=r,Mw}var Dw,k7;function qoe(){if(k7)return Dw;k7=1;function r(x){return x?typeof x=="string"?x:x.source:null}function e(x){return t("(?=",x,")")}function t(...x){return x.map(I=>r(I)).join("")}function n(x){const N=x[x.length-1];return typeof N=="object"&&N.constructor===Object?(x.splice(x.length-1,1),N):{}}function a(...x){return"("+(n(x).capture?"":"?:")+x.map(D=>r(D)).join("|")+")"}const i=x=>t(/\b/,x,/\w$/.test(x)?/\b/:/\B/),s=["Protocol","Type"].map(i),o=["init","self"].map(i),l=["Any","Self"],c=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],u=["false","nil","true"],d=["assignment","associativity","higherThan","left","lowerThan","none","right"],h=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],p=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],m=a(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),g=a(m,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),b=t(m,g,"*"),_=a(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),v=a(_,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),y=t(_,v,"*"),E=t(/[A-Z]/,v,"*"),S=["attached","autoclosure",t(/convention\(/,a("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",t(/objc\(/,y,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],w=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function C(x){const N={match:/\s+/,relevance:0},I=x.COMMENT("/\\*","\\*/",{contains:["self"]}),D=[x.C_LINE_COMMENT_MODE,I],V={match:[/\./,a(...s,...o)],className:{2:"keyword"}},q={match:t(/\./,a(...c)),relevance:0},$=c.filter(ut=>typeof ut=="string").concat(["_|0"]),K=c.filter(ut=>typeof ut!="string").concat(l).map(i),z={variants:[{className:"keyword",match:a(...K,...o)}]},re={$pattern:a(/\b\w+/,/#\w+/),keyword:$.concat(h),literal:u},W=[V,q,z],ie={match:t(/\./,a(...p)),relevance:0},k={className:"built_in",match:t(/\b/,a(...p),/(?=\()/)},B=[ie,k],te={match:/->/,relevance:0},O={className:"operator",relevance:0,variants Line truncated
`},{className:"string",begin:"\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}.\\d+Z"},{className:"string",begin:"(\\+|-)\\d+"},{className:"keyword",relevance:10,variants:[{begin:"^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?"},{begin:"^progress(:?)(\\s+)?(pop|push)?"},{begin:"^tags:"},{begin:"^time:"}]}]}}return Mw=r,Mw}var Dw,k7;function qoe(){if(k7)return Dw;k7=1;function r(x){return x?typeof x=="string"?x:x.source:null}function e(x){return t("(?=",x,")")}function t(...x){return x.map(I=>r(I)).join("")}function n(x){const N=x[x.length-1];return typeof N=="object"&&N.constructor===Object?(x.splice(x.length-1,1),N):{}}function a(...x){return"("+(n(x).capture?"":"?:")+x.map(D=>r(D)).join("|")+")"}const i=x=>t(/\b/,x,/\w$/.test(x)?/\b/:/\B/),s=["Protocol","Type"].map(i),o=["init","self"].map(i),l=["Any","Self"],c=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],u=["false","nil","true"],d=["assignment","associativity","higherThan","left","lowerThan","none","right"],h=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],p=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],m=a(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),g=a(m,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),b=t(m,g,"*"),_=a(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),v=a(_,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),y=t(_,v,"*"),E=t(/[A-Z]/,v,"*"),S=["attached","autoclosure",t(/convention\(/,a("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",t(/objc\(/,y,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],w=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function C(x){const N={match:/\s+/,relevance:0},I=x.COMMENT("/\\*","\\*/",{contains:["self"]}),D=[x.C_LINE_COMMENT_MODE,I],V={match:[/\./,a(...s,...o)],className:{2:"keyword"}},q={match:t(/\./,a(...c)),relevance:0},$=c.filter(ut=>typeof ut=="string").concat(["_|0"]),K=c.filter(ut=>typeof ut!="string").concat(l).map(i),z={variants:[{className:"keyword",match:a(...K,...o)}]},re={$pattern:a(/\b\w+/,/#\w+/),keyword:$.concat(h),literal:u},W=[V,q,z],ie={match:t(/\./,a(...p)),relevance:0},k={className:"built_in",match:t(/\b/,a(...p),/(?=\()/)},B=[ie,k],te={match:/->/,relevance:0},O={className:"operator",relevance:0,variants Line truncated
`)}const a=n.map(i=>{if(i.type===Kr.MCP_PROMPT){const s=i;return{type:Kr.MCP_PROMPT,name:s.name,serverName:s.serverName,promptName:s.promptName,content:s.content,arguments:s.arguments}}return{type:Kr.TEXT,name:i.name,content:i.content}});return`${JSON.stringify(r)}
${JSON.stringify(a,null,2)}`}function pce(r){const e={message:r,textAttachments:[],mcpPromptAttachments:[]};if(!r.startsWith('"'))return e;try{let t=-1,n=!1;for(let u=1;u<r.length;u++){const d=r[u];if(n){n=!1;continue}if(d==="\\"){n=!0;continue}if(d==='"'){t=u;break}}if(t===-1)return e;const a=r.substring(0,t+1),i=r.substring(t+1).trim(),s=JSON.parse(a);if(!i||!i.startsWith("["))return{message:s,textAttachments:[],mcpPromptAttachments:[]};const o=JSON.parse(i),l=[],c=[];for(const u of o)mce(u)?c.push({type:Kr.MCP_PROMPT,name:u.name,serverName:u.serverName,promptName:u.promptName,content:u.content,arguments:u.arguments}):gce(u)&&l.push({type:Kr.TEXT,name:u.name,content:u.content});return{message:s,textAttachments:l,mcpPromptAttachments:c}}catch{return e}}function mce(r){if(typeof r!="object"||r===null)return!1;const e=r;return(e.type===Kr.MCP_PROMPT||e.type==="MCP_PROMPT")&&typeof e.name=="string"&&typeof e.serverName=="string"&&typeof e.promptName=="string"&&typeof e.content=="string"}function gce(r){if(typeof r!="object"||r===null)return!1;const e=r;return(e.type===Kr.TEXT||e.type==="TEXT")&&typeof e.name=="string"&&typeof e.content=="string"}function u0(r){if(!r)return"FILE";if(r.includes("/")){const e=r.split("/").pop();if(e)return e.includes(".")?e.split(".").pop()?.toUpperCase()||"FILE":e.toUpperCase()}if(r.includes(".")){const e=r.split(".").pop();if(e)return e.toUpperCase()}return r.toUpperCase()}function m3(r,e=150){return r.length>e?r.slice(0,e)+"...":r}function tl(r){switch(r){case ea.JPEG:case ea.PNG:case ea.GIF:case ea.WEBP:case ea.SVG:return Dn.IMAGE;case Wa.MP3_MPEG:case Wa.MP3:case Wa.MP4:case Wa.WAV:case Wa.WEBM:case Wa.WEBM_OPUS:return Dn.AUDIO;case xm.PDF:return Dn.PDF;case Pt.PLAIN:case Pt.MARKDOWN:case Pt.ASCIIDOC:case Pt.JAVASCRIPT:case Pt.JAVASCRIPT_APP:case Pt.TYPESCRIPT:case Pt.JSX:case Pt.TSX:case Pt.CSS:case Pt.HTML:case Pt.JSON:case Pt.XML_TEXT:case Pt.XML_APP:case Pt.YAML_TEXT:case Pt.YAML_APP:case Pt.CSV:case Pt.PYTHON:case Pt.JAVA:case Pt.CPP_SRC:case Pt.C_SRC:case Pt.C_HDR:case Pt.PHP:case Pt.RUBY:case Pt.GO:case Pt.RUST:case Pt.SHELL:case Pt.BAT:case Pt.SQL:case Pt.R:case Pt.SCALA:case Pt.KOTLIN:case Pt.SWIFT:case Pt.DART:case Pt.VUE:case Pt.SVELTE:case Pt.LATEX:case Pt.BIBTEX:case Pt.CUDA:case Pt.CPP_HDR:case Pt.CSHARP:case Pt.HASKELL:case Pt.PROPERTIES:case Pt.TEX:case Pt.TEX_APP:return Dn.TEXT;default:return null}}function x4(r){switch(r.toLowerCase().substring(r.lastIndexOf("."))){case Ks.JPG:case Ks.JPEG:case Ks.PNG:case Ks.GIF:case Ks.WEBP:case Ks.SVG:return Dn.IMAGE;case Am.MP3:case Am.WAV:return Dn.AUDIO;case E4.PDF:return Dn.PDF;case Wt.TXT:case Wt.MD:case Wt.ADOC:case Wt.JS:case Wt.TS:case Wt.JSX:case Wt.TSX:case Wt.CSS:case Wt.HTML:case Wt.HTM:case Wt.JSON:case Wt.XML:case Wt.YAML:case Wt.YML:case Wt.CSV:case Wt.LOG:case Wt.PY:case Wt.JAVA:case Wt.CPP:case Wt.C:case Wt.H:case Wt.PHP:case Wt.RB:case Wt.GO:case Wt.RS:case Wt.SH:case Wt.BAT:case Wt.SQL:case Wt.R:case Wt.SCALA:case Wt.KT:case Wt.SWIFT:case Wt.DART:case Wt.VUE:case Wt.SVELTE:case Wt.TEX:case Wt.BIB:case Wt.COMP:case Wt.CU:case Wt.CUH:case Wt.HPP:case Wt.HS:case Wt.PROPERTIES:return Dn.TEXT;default:return null}}function _ce(r,e){if(e){const n=tl(e);if(n===Dn.IMAGE||n===Dn.AUDIO||n===Dn.PDF)return!0}const t=x4(r);return t===Dn.IMAGE||t===Dn.AUDIO||t===Dn.PDF,!0}function ub(r){if(typeof r!="number")return"Unknown";if(r===0)return"0 Bytes";const e=1024,t=["Bytes","KB","MB","GB"],n=Math.floor(Math.log(r)/Math.log(e));return parseFloat((r/Math.pow(e,n)).toFixed(2))+" "+t[n]}function bce(r){return typeof r!="number"?"Unknown":r>=1e9?`${(r/1e9).toFixed(2)}B`:r>=1e6?`${(r/1e6).toFixed(2)}M`:r>=1e3?`${(r/1e3).toFixed(2)}K`:r.toString()}function d0(r){return typeof r!="number"?"Unknown":r.toLocaleString()}function i8(r){try{const e=JSON.parse(r);return JSON.stringify(e,null,2)}catch{return r}}function vce(r){return r.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function h0(r){if(r<0)return"0s";const e=r/y_;if(e<mne)return`${e.toFixed(1)}s`;if(e<gne)return`${e.toFixed(1)}s`;const t=Math.floor(e/oO),n=Math.floor(e%oO/sO),a=Math.floor(e%sO),i=[];return t>0&&i.push(`${t}h`),n>0&&i.push(`${n}min`),(a>0||i.length===0)&&i.push(`${a}s`),i.join(" ")}function Tp(r,e,t,n){const a=n?`${e} (${n})`:e;return`
@@ -51,12 +51,12 @@ ${t}`}function R4(r){return r.isComposing||r.keyCode===229}function yce(r,e){ret
`)?"":`
`;l="$$"+d+u+h+"$$"}return l}),r=Sce(r),r=r.replace(new RegExp("(?<!\\\\)\\\\\\((.+?)\\\\\\)","g"),"$$$1$").replace(new RegExp("(?<!\\\\)\\\\\\[([\\s\\S]*?)\\\\\\]","g"),(s,o)=>`$$${o}$$`),r=r.replace(/<<CODE_BLOCK_(\d+)>>/g,(s,o)=>a[parseInt(o)]),e.size>0&&(r=r.split(`
`).map((l,c)=>{const u=e.get(c);return u?u+l:l}).join(`
`)),r}function Ece(r,e){const t=[],n=[],a={},{hasVision:i,hasAudio:s}=e;for(const o of r){const l=tl(o.type);let c=!0,u="";switch(l){case Dn.IMAGE:i||(c=!1,u="Images require a vision-capable model");break;case Dn.AUDIO:s||(c=!1,u="Audio files require an audio-capable model");break;case Dn.TEXT:case Dn.PDF:break}c?t.push(o):(n.push(o),a[o.name]=u)}return{supportedFiles:t,unsupportedFiles:n,modalityReasons:a}}function wce(r){const e=r.trim();if(!e)return"";const t=e.split(/[\\/]/);if(t.length===2){const[i,s]=t,o=i?.trim(),l=s?.trim();if(o&&l)return`${o}/${l}`}const a=t.pop()?.trim();return a&&a.length>0?a:e}function _u(r){return typeof r=="number"?Math.round(r*vO)/vO:r}function p$(r){switch(r.toLowerCase().substring(r.lastIndexOf("."))){case".js":case".mjs":case".cjs":return"javascript";case".ts":case".mts":case".cts":return"typescript";case".jsx":return"javascript";case".tsx":return"typescript";case".html":case".htm":return"html";case".css":return"css";case".scss":return"scss";case".less":return"less";case".vue":return"html";case".svelte":return"html";case".json":return"json";case".xml":return"xml";case".yaml":case".yml":return"yaml";case".toml":return"ini";case".csv":return"plaintext";case".py":return"python";case".java":return"java";case".kt":case".kts":return"kotlin";case".scala":return"scala";case".cpp":case".cc":case".cxx":case".c++":return"cpp";case".c":return"c";case".h":case".hpp":return"cpp";case".cs":return"csharp";case".go":return"go";case".rs":return"rust";case".rb":return"ruby";case".php":return"php";case".swift":return"swift";case".dart":return"dart";case".r":return"r";case".lua":return"lua";case".pl":case".pm":return"perl";case".sh":case".bash":case".zsh":return"bash";case".bat":case".cmd":return"dos";case".ps1":return"powershell";case".sql":return"sql";case".md":case".markdown":return"markdown";case".tex":case".latex":return"latex";case".adoc":case".asciidoc":return"asciidoc";case".ini":case".cfg":case".conf":return"ini";case".dockerfile":return"dockerfile";case".nginx":return"nginx";case".graphql":case".gql":return"graphql";case".proto":return"protobuf";case".diff":case".patch":return"diff";case".log":return"plaintext";case".txt":return"plaintext";default:return"plaintext"}}async function Tce(r){return new Promise((e,t)=>{const n=new FileReader;n.onload=a=>{a.target?.result!==null&&a.target?.result!==void 0?e(a.target.result):t(new Error("Failed to read file"))},n.onerror=()=>t(new Error("File reading error")),n.readAsText(r)})}function Cce(r,e={}){if(!r)return!0;const t={...Fre,...e},n=r.substring(0,t.prefixLength);let a=0,i=0;for(let s=0;s<n.length;s++){const o=n.charCodeAt(s);if(o===0){a++;continue}o<32&&o!==9&&o!==10&&o!==13&&(o<8||o>13&&o<27)&&i++,o===65533&&i++}return!(a>t.maxAbsoluteNullBytes||i/n.length>t.suspiciousCharThresholdRatio)}function m$(r,e){let t=null;return(...n)=>{t&&clearTimeout(t),t=setTimeout(()=>{r(...n),t=null},e)}}function Ace(r){return r.replace(_ne,"").slice(0,VU)}function xce(r){return r.replace(bne,"").slice(0,YU)}function Rce(r){return`<div class="image-error-content">
`)),r}function Ece(r,e){const t=[],n=[],a={},{hasVision:i,hasAudio:s}=e;for(const o of r){const l=tl(o.type);let c=!0,u="";switch(l){case Dn.IMAGE:i||(c=!1,u="Images require a vision-capable model");break;case Dn.AUDIO:s||(c=!1,u="Audio files require an audio-capable model");break;case Dn.TEXT:case Dn.PDF:break}c?t.push(o):(n.push(o),a[o.name]=u)}return{supportedFiles:t,unsupportedFiles:n,modalityReasons:a}}function wce(r){const e=r.trim();if(!e)return"";const t=e.split(/[\\/]/);if(t.length===2){const[i,s]=t,o=i?.trim(),l=s?.trim();if(o&&l)return`${o}/${l}`}const a=t.pop()?.trim();return a&&a.length>0?a:e}function bu(r){return typeof r=="number"?Math.round(r*vO)/vO:r}function p$(r){switch(r.toLowerCase().substring(r.lastIndexOf("."))){case".js":case".mjs":case".cjs":return"javascript";case".ts":case".mts":case".cts":return"typescript";case".jsx":return"javascript";case".tsx":return"typescript";case".html":case".htm":return"html";case".css":return"css";case".scss":return"scss";case".less":return"less";case".vue":return"html";case".svelte":return"html";case".json":return"json";case".xml":return"xml";case".yaml":case".yml":return"yaml";case".toml":return"ini";case".csv":return"plaintext";case".py":return"python";case".java":return"java";case".kt":case".kts":return"kotlin";case".scala":return"scala";case".cpp":case".cc":case".cxx":case".c++":return"cpp";case".c":return"c";case".h":case".hpp":return"cpp";case".cs":return"csharp";case".go":return"go";case".rs":return"rust";case".rb":return"ruby";case".php":return"php";case".swift":return"swift";case".dart":return"dart";case".r":return"r";case".lua":return"lua";case".pl":case".pm":return"perl";case".sh":case".bash":case".zsh":return"bash";case".bat":case".cmd":return"dos";case".ps1":return"powershell";case".sql":return"sql";case".md":case".markdown":return"markdown";case".tex":case".latex":return"latex";case".adoc":case".asciidoc":return"asciidoc";case".ini":case".cfg":case".conf":return"ini";case".dockerfile":return"dockerfile";case".nginx":return"nginx";case".graphql":case".gql":return"graphql";case".proto":return"protobuf";case".diff":case".patch":return"diff";case".log":return"plaintext";case".txt":return"plaintext";default:return"plaintext"}}async function Tce(r){return new Promise((e,t)=>{const n=new FileReader;n.onload=a=>{a.target?.result!==null&&a.target?.result!==void 0?e(a.target.result):t(new Error("Failed to read file"))},n.onerror=()=>t(new Error("File reading error")),n.readAsText(r)})}function Cce(r,e={}){if(!r)return!0;const t={...Fre,...e},n=r.substring(0,t.prefixLength);let a=0,i=0;for(let s=0;s<n.length;s++){const o=n.charCodeAt(s);if(o===0){a++;continue}o<32&&o!==9&&o!==10&&o!==13&&(o<8||o>13&&o<27)&&i++,o===65533&&i++}return!(a>t.maxAbsoluteNullBytes||i/n.length>t.suspiciousCharThresholdRatio)}function m$(r,e){let t=null;return(...n)=>{t&&clearTimeout(t),t=setTimeout(()=>{r(...n),t=null},e)}}function Ace(r){return r.replace(_ne,"").slice(0,VU)}function xce(r){return r.replace(bne,"").slice(0,YU)}function Rce(r){return`<div class="image-error-content">
<span>Image cannot be displayed</span>
<a href="${r}" target="_blank" rel="noopener noreferrer">(open link)</a>
</div>`}function o8(r){const e=r.trim().toLowerCase();return e.startsWith(lo.WEBSOCKET)||e.startsWith(lo.WEBSOCKET_SECURE)?Os.WEBSOCKET:Os.STREAMABLE_HTTP}function l8(r){if(!r)return[];let e;if(typeof r=="string"){const t=r.trim();if(!t)return[];try{e=JSON.parse(t)}catch(n){return console.warn("[MCP] Failed to parse mcpServers JSON, ignoring value:",n),[]}}else e=r;return Array.isArray(e)?e.map((t,n)=>{const a=typeof t?.url=="string"?t.url.trim():"",i=typeof t?.headers=="string"?t.headers.trim():void 0;return{id:typeof t?.id=="string"&&t.id?.trim()?t.id.trim():`${T4}-${n+1}`,enabled:!!t?.enabled,url:a,name:t?.name,requestTimeoutSeconds:Va.requestTimeoutSeconds,headers:i||void 0,useProxy:!!t?.useProxy}}):[]}function Oce(r){switch(r){case Du.ERROR:return kU;case Du.WARN:return zc;default:return g4}}function Nce(r){switch(r){case Du.ERROR:return"text-destructive";case Du.WARN:return"text-yellow-600 dark:text-yellow-500";default:return"text-muted-foreground"}}function Ice(r){return r?.startsWith(kf.IMAGE)??!1}function db(r){try{return r.replace(zne,"").split(Kne).filter(t=>t.length>0)}catch{return[r]}}function kce(r){return r.replace(qne,"").split(Hne).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function g3(r){try{const e=db(r.uri);return e[e.length-1]||r.name||r.uri}catch{return r.name||r.uri}}function Mce(r,e){const t=r?.toLowerCase()||"",n=e?.toLowerCase()||"";return t.includes(Xs.JSON)||t.includes(Xs.JAVASCRIPT)||t.includes(Xs.TYPESCRIPT)||XU.test(n)}function Dce(r,e){const t=r?.toLowerCase()||"",n=e?.toLowerCase()||"";return t.startsWith(kf.IMAGE)||KU.test(n)}function g$(r,e){const t=r?.toLowerCase()||"",n=e?.toLowerCase()||"";return t.startsWith(kf.IMAGE)||KU.test(n)?m4:t.includes(Xs.JSON)||t.includes(Xs.JAVASCRIPT)||t.includes(Xs.TYPESCRIPT)||XU.test(n)?MU:t.includes(kf.TEXT)||Gne.test(n)?wc:n.includes(d3.DATABASE_KEYWORD)||n.includes(d3.DATABASE_SCHEME)?h4:p4}function Cp(r){return r?r.filter(e=>"text"in e).map(e=>e.text).join(Xne):""}function Pce(r){return r?r.filter(e=>"blob"in e):[]}function _$(r,e=Pt.PLAIN,t=QU){const n=new Blob([r],{type:e}),a=URL.createObjectURL(n),i=document.createElement("a");i.href=a,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(a)}function f0(r){const e=r.indexOf(TS);if(e===-1)return r;const t=r.substring(0,e),n=r.substring(e+TS.length).replace(Sae,"");return`${t}${TS}${n}`}function b$(r){const e=[],t=new Set;let n;for(lb.lastIndex=0;(n=lb.exec(r))!==null;){const a=n[1]||"",i=n[2];for(const s of i.split(",")){const o=s.replace(e$,"").replace(t$,"").trim();o&&!t.has(o)&&(t.add(o),e.push({name:o,operator:a}))}}return e}function Lce(r,e){return lb.lastIndex=0,r.replace(lb,(t,n,a)=>{const i=a.split(",").map(o=>o.replace(e$,"").replace(t$,"").trim()),s=i.map(o=>e[o]??"").filter(o=>o!=="");if(s.length===0)return"";switch(n){case cu.RESERVED:return s.join(bo.COMMA);case cu.FRAGMENT:return cu.FRAGMENT+s.join(bo.COMMA);case cu.PATH_SEGMENT:return bo.SLASH+s.join(bo.SLASH);case cu.LABEL:return bo.PERIOD+s.join(bo.PERIOD);case cu.PATH_PARAM:return i.filter((o,l)=>s[l]).map((o,l)=>`${bo.SEMICOLON}${o}=${s[l]}`).join("");case cu.FORM_QUERY:return bo.QUERY_PREFIX+i.filter((o,l)=>s[l]).map((o,l)=>`${encodeURIComponent(o)}=${encodeURIComponent(s[l])}`).join(bo.COMMA);case cu.FORM_CONTINUATION:return bo.QUERY_CONTINUATION+i.filter((o,l)=>s[l]).map((o,l)=>`${encodeURIComponent(o)}=${encodeURIComponent(s[l])}`).join(bo.COMMA);default:return s.map(o=>encodeURIComponent(o)).join(bo.COMMA)}})}function Fce(r,e){return b$(r).every(n=>(e[n.name]??"").trim()!=="")}function hb(r,e){return`data:${r};base64,${e}`}function Bce(r){if(!r?.trim())return[];try{const e=JSON.parse(r);if(typeof e=="object"&&e!==null&&!Array.isArray(e))return Object.entries(e).map(([t,n])=>({key:t,value:String(n)}))}catch{return[]}return[]}function Uce(r){const e=r.filter(n=>n.key.trim());if(e.length===0)return"";const t={};for(const n of e)t[n.key.trim()]=n.value;return JSON.stringify(t)}function $ce(r,e=!0){try{const t=new URL(r),n=t.hostname.split(aO),a=n.length>=iO?n.slice(-iO).join(aO):t.hostname,i=`${fne}?domain=${a}&sz=${pne}`;return e?d$(i):i}catch{return null}}function aT(r,e=[],t=[]){const n=[];r.reasoningContent&&n.push({type:ni.REASONING,content:r.reasoningContent}),r.content?.trim()&&n.push({type:ni.TEXT,content:r.content});const a=v$(r.toolCalls);for(const i of a){const s=e.find(o=>o.toolCallId===i.id);n.push({type:s?ni.TOOL_CALL:ni.TOOL_CALL_PENDING,content:s?.content||"",toolName:i.function?.name,toolArgs:i.function?.arguments,toolResult:s?.content,toolResultExtras:s?.extra})}for(const i of t)i.id&&a.find(s=>s.id===i.id)||n.push({type:ni.TOOL_CALL_STREAMING,content:"",toolName:i.function?.name,toolArgs:i.function?.arguments});return n}function Gce(r,e=[],t=[]){if(!e.some(o=>o.role===Jt.ASSISTANT))return aT(r,e,t);const a=[],i=c8(e,0);a.push(...aT(r,i));let s=i.length;for(;s<e.length;){const o=e[s];if(o.role===Jt.ASSISTANT){const l=c8(e,s+1),c=s+1+l.Line truncated
</div>`}function o8(r){const e=r.trim().toLowerCase();return e.startsWith(lo.WEBSOCKET)||e.startsWith(lo.WEBSOCKET_SECURE)?Os.WEBSOCKET:Os.STREAMABLE_HTTP}function l8(r){if(!r)return[];let e;if(typeof r=="string"){const t=r.trim();if(!t)return[];try{e=JSON.parse(t)}catch(n){return console.warn("[MCP] Failed to parse mcpServers JSON, ignoring value:",n),[]}}else e=r;return Array.isArray(e)?e.map((t,n)=>{const a=typeof t?.url=="string"?t.url.trim():"",i=typeof t?.headers=="string"?t.headers.trim():void 0;return{id:typeof t?.id=="string"&&t.id?.trim()?t.id.trim():`${T4}-${n+1}`,enabled:!!t?.enabled,url:a,name:t?.name,requestTimeoutSeconds:Va.requestTimeoutSeconds,headers:i||void 0,useProxy:!!t?.useProxy}}):[]}function Oce(r){switch(r){case Pu.ERROR:return kU;case Pu.WARN:return zc;default:return g4}}function Nce(r){switch(r){case Pu.ERROR:return"text-destructive";case Pu.WARN:return"text-yellow-600 dark:text-yellow-500";default:return"text-muted-foreground"}}function Ice(r){return r?.startsWith(kf.IMAGE)??!1}function db(r){try{return r.replace(zne,"").split(Kne).filter(t=>t.length>0)}catch{return[r]}}function kce(r){return r.replace(qne,"").split(Hne).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function g3(r){try{const e=db(r.uri);return e[e.length-1]||r.name||r.uri}catch{return r.name||r.uri}}function Mce(r,e){const t=r?.toLowerCase()||"",n=e?.toLowerCase()||"";return t.includes(Xs.JSON)||t.includes(Xs.JAVASCRIPT)||t.includes(Xs.TYPESCRIPT)||XU.test(n)}function Dce(r,e){const t=r?.toLowerCase()||"",n=e?.toLowerCase()||"";return t.startsWith(kf.IMAGE)||KU.test(n)}function g$(r,e){const t=r?.toLowerCase()||"",n=e?.toLowerCase()||"";return t.startsWith(kf.IMAGE)||KU.test(n)?m4:t.includes(Xs.JSON)||t.includes(Xs.JAVASCRIPT)||t.includes(Xs.TYPESCRIPT)||XU.test(n)?MU:t.includes(kf.TEXT)||Gne.test(n)?wc:n.includes(d3.DATABASE_KEYWORD)||n.includes(d3.DATABASE_SCHEME)?h4:p4}function Cp(r){return r?r.filter(e=>"text"in e).map(e=>e.text).join(Xne):""}function Pce(r){return r?r.filter(e=>"blob"in e):[]}function _$(r,e=Pt.PLAIN,t=QU){const n=new Blob([r],{type:e}),a=URL.createObjectURL(n),i=document.createElement("a");i.href=a,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(a)}function f0(r){const e=r.indexOf(TS);if(e===-1)return r;const t=r.substring(0,e),n=r.substring(e+TS.length).replace(Sae,"");return`${t}${TS}${n}`}function b$(r){const e=[],t=new Set;let n;for(lb.lastIndex=0;(n=lb.exec(r))!==null;){const a=n[1]||"",i=n[2];for(const s of i.split(",")){const o=s.replace(e$,"").replace(t$,"").trim();o&&!t.has(o)&&(t.add(o),e.push({name:o,operator:a}))}}return e}function Lce(r,e){return lb.lastIndex=0,r.replace(lb,(t,n,a)=>{const i=a.split(",").map(o=>o.replace(e$,"").replace(t$,"").trim()),s=i.map(o=>e[o]??"").filter(o=>o!=="");if(s.length===0)return"";switch(n){case uu.RESERVED:return s.join(bo.COMMA);case uu.FRAGMENT:return uu.FRAGMENT+s.join(bo.COMMA);case uu.PATH_SEGMENT:return bo.SLASH+s.join(bo.SLASH);case uu.LABEL:return bo.PERIOD+s.join(bo.PERIOD);case uu.PATH_PARAM:return i.filter((o,l)=>s[l]).map((o,l)=>`${bo.SEMICOLON}${o}=${s[l]}`).join("");case uu.FORM_QUERY:return bo.QUERY_PREFIX+i.filter((o,l)=>s[l]).map((o,l)=>`${encodeURIComponent(o)}=${encodeURIComponent(s[l])}`).join(bo.COMMA);case uu.FORM_CONTINUATION:return bo.QUERY_CONTINUATION+i.filter((o,l)=>s[l]).map((o,l)=>`${encodeURIComponent(o)}=${encodeURIComponent(s[l])}`).join(bo.COMMA);default:return s.map(o=>encodeURIComponent(o)).join(bo.COMMA)}})}function Fce(r,e){return b$(r).every(n=>(e[n.name]??"").trim()!=="")}function hb(r,e){return`data:${r};base64,${e}`}function Bce(r){if(!r?.trim())return[];try{const e=JSON.parse(r);if(typeof e=="object"&&e!==null&&!Array.isArray(e))return Object.entries(e).map(([t,n])=>({key:t,value:String(n)}))}catch{return[]}return[]}function Uce(r){const e=r.filter(n=>n.key.trim());if(e.length===0)return"";const t={};for(const n of e)t[n.key.trim()]=n.value;return JSON.stringify(t)}function $ce(r,e=!0){try{const t=new URL(r),n=t.hostname.split(aO),a=n.length>=iO?n.slice(-iO).join(aO):t.hostname,i=`${fne}?domain=${a}&sz=${pne}`;return e?d$(i):i}catch{return null}}function aT(r,e=[],t=[]){const n=[];r.reasoningContent&&n.push({type:ni.REASONING,content:r.reasoningContent}),r.content?.trim()&&n.push({type:ni.TEXT,content:r.content});const a=v$(r.toolCalls);for(const i of a){const s=e.find(o=>o.toolCallId===i.id);n.push({type:s?ni.TOOL_CALL:ni.TOOL_CALL_PENDING,content:s?.content||"",toolName:i.function?.name,toolArgs:i.function?.arguments,toolResult:s?.content,toolResultExtras:s?.extra})}for(const i of t)i.id&&a.find(s=>s.id===i.id)||n.push({type:ni.TOOL_CALL_STREAMING,content:"",toolName:i.function?.name,toolArgs:i.function?.arguments});return n}function Gce(r,e=[],t=[]){if(!e.some(o=>o.role===Jt.ASSISTANT))return aT(r,e,t);const a=[],i=c8(e,0);a.push(...aT(r,i));let s=i.length;for(;s<e.length;){const o=e[s];if(o.role===Jt.ASSISTANT){const l=c8(e,s+1),c=s+1+l.Line truncated
`)}function U(A,P,J,ce){this.failures=P,this.failedKeys=ce,this.successCount=J,this.message=R(A,P)}function Q(A,P){this.name="BulkError",this.failures=Object.keys(P).map(function(J){return P[J]}),this.failuresByPos=P,this.message=R(A,this.failures)}g(O).from(Error).extend({toString:function(){return this.name+": "+this.message}}),g(U).from(O),g(Q).from(O);var ne=_o.reduce(function(A,P){return A[P]=P+"Error",A},{}),ue=O,he=_o.reduce(function(A,P){var J=P+"Error";function ce(de,ve){this.name=J,de?typeof de=="string"?(this.message="".concat(de).concat(ve?`
`+ve:""),this.inner=ve||null):typeof de=="object"&&(this.message="".concat(de.name," ").concat(de.message),this.inner=de):(this.message=te[P]||J,this.inner=null)}return g(ce).from(ue),A[P]=ce,A},{});he.Syntax=SyntaxError,he.Type=TypeError,he.Range=RangeError;var be=dt.reduce(function(A,P){return A[P+"Error"]=he[P],A},{}),Z=_o.reduce(function(A,P){return["Syntax","Type","Range"].indexOf(P)===-1&&(A[P+"Error"]=he[P]),A},{});function ae(){}function fe(A){return A}function pe(A,P){return A==null||A===fe?P:function(J){return P(A(J))}}function ye(A,P){return function(){A.apply(this,arguments),P.apply(this,arguments)}}function Te(A,P){return A===ae?P:function(){var J=A.apply(this,arguments);J!==void 0&&(arguments[0]=J);var ce=this.onsuccess,de=this.onerror;this.onsuccess=null,this.onerror=null;var ve=P.apply(this,arguments);return ce&&(this.onsuccess=this.onsuccess?ye(ce,this.onsuccess):ce),de&&(this.onerror=this.onerror?ye(de,this.onerror):de),ve!==void 0?ve:J}}function Oe(A,P){return A===ae?P:function(){A.apply(this,arguments);var J=this.onsuccess,ce=this.onerror;this.onsuccess=this.onerror=null,P.apply(this,arguments),J&&(this.onsuccess=this.onsuccess?ye(J,this.onsuccess):J),ce&&(this.onerror=this.onerror?ye(ce,this.onerror):ce)}}function Ne(A,P){return A===ae?P:function(J){var ce=A.apply(this,arguments);l(J,ce);var de=this.onsuccess,ve=this.onerror;return this.onsuccess=null,this.onerror=null,J=P.apply(this,arguments),de&&(this.onsuccess=this.onsuccess?ye(de,this.onsuccess):de),ve&&(this.onerror=this.onerror?ye(ve,this.onerror):ve),ce===void 0?J===void 0?void 0:J:l(ce,J)}}function Ue(A,P){return A===ae?P:function(){return P.apply(this,arguments)!==!1&&A.apply(this,arguments)}}function Fe(A,P){return A===ae?P:function(){var J=A.apply(this,arguments);if(J&&typeof J.then=="function"){for(var ce=this,de=arguments.length,ve=new Array(de);de--;)ve[de]=arguments[de];return J.then(function(){return P.apply(ce,ve)})}return P.apply(this,arguments)}}Z.ModifyError=U,Z.DexieError=O,Z.BulkError=Q;var Ke=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function He(A){Ke=A}var it={},st=100,Ae=typeof Promise>"u"?[]:function(){var A=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[A,c(A),A];var P=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[P,c(P),A]}(),dt=Ae[0],_o=Ae[1],Ae=Ae[2],_o=_o&&_o.then,Le=dt&&dt.constructor,ht=!!Ae,ze=function(A,P){Rt.push([A,P]),At&&(queueMicrotask(Ct),At=!1)},mt=!0,At=!0,xt=[],qt=[],ar=fe,fr={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:ae,pgp:!1,env:{},finalize:ae},ct=fr,Rt=[],Ft=0,tr=[];function ut(A){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var P=this._PSD=ct;if(typeof A!="function"){if(A!==it)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&It(this,this._value))}this._state=null,this._value=null,++P.ref,function J(ce,de){try{de(function(ve){if(ce._state===null){if(ve===ce)throw new TypeError("A promise cannot be resolved with itself.");var Re=ce._lib&&Lt();ve&&typeof ve.then=="function"?J(ce,function(De,Ve){ve instanceof ut?ve._then(De,Ve):ve.then(De,Ve)}):(ce._state=!0,ce._value=ve,xe(ce)),Re&&Dt()}},It.bind(null,ce))}catch(ve){It(ce,ve)}}(this,A)}var Ut={get:function(){var A=ct,P=Fn;function J(ce,de){var ve=this,Re=!A.global&&(A!==ct||P!==Fn),De=Re&&!Ls(),Ve=new ut(function(Xe,tt){Qe(ve,new Et(ru(ce,A,Re,De),ru(de,A,Re,De),Xe,tt,A))});return this._consoleTask&&(Ve._consoleTask=this._consoleTask),Ve}return J.prototype=it,J},set:function(A){m(this,"then",A&&A.prototype===it?Ut:{get:function(){return A},set:Ut.set})}};function Et(A,P,J,ce,de){this.onFulfilled=typeof A=="function"?A:null,this.onRejected=typeof P=="function"?P:null,this.resolve=J,this.reject=ce,this.psd=de}function It(A,P){var J,ce;qt.push(P),A._state===null&&(J=A._lib&&Lt(),P=ar(P),A._state=!1,A._value=P,ce=A,xt.some(function(de){return de._value===ce._value})||xt.push(ce),xe(A),J&&Dt())}function xe(A){var P=A._listeners;A._listeners=[];for(var J=0,ce=P.length;J<ce;++J)Qe(A,P[J]);var de=A._PSD;--de.ref||de.finalize(),Ft===0&&(++Ft,ze(function(){--Ft==0&&bt()},[]))}function Qe(A,P){if(A._state!==null){var J=A._state?P.onFulfilled:P.onRejected;if(J===null)return(A._state?P.resolve:P.reject)(A._value);++P.psd.ref,++Ft,ze(ft,[J,A,P])}else A._listeners.push(P)}function ft(A,P,J){try{var ce,de=P._value;!P._state&&qt.length&&(qt=[]),ce=Ke&&P._consoleTask?P._consoleTask.run(function(){return A(de)}):A(de),P._state||qt.indexOf(de)!==-1||function(ve){for(var Re=xt.length;Re;)if(xt[--Re]._value===ve._value)return xt.splice(Re,1)}(P),J.resolve(ce)}catch(ve){J.reject(ve)}finally{--Ft==0&&bt(),--J.psd.ref||J.psd.finalize()}}function Ct(){ps(fr,function(){Lt()&&Dt()})}function Lt(){var A=mt;return At=mt=!1,A}function Dt(){var A,P,J;do for(;0<Rt.length;)for(A=Rt,Rt=[],J=A.length,P=0;P<J;++P){var ce=A[P];ce[0].apply(null,ce[1])}whil Line truncated
`+ve:""),this.inner=ve||null):typeof de=="object"&&(this.message="".concat(de.name," ").concat(de.message),this.inner=de):(this.message=te[P]||J,this.inner=null)}return g(ce).from(ue),A[P]=ce,A},{});he.Syntax=SyntaxError,he.Type=TypeError,he.Range=RangeError;var be=dt.reduce(function(A,P){return A[P+"Error"]=he[P],A},{}),Z=_o.reduce(function(A,P){return["Syntax","Type","Range"].indexOf(P)===-1&&(A[P+"Error"]=he[P]),A},{});function ae(){}function fe(A){return A}function pe(A,P){return A==null||A===fe?P:function(J){return P(A(J))}}function ye(A,P){return function(){A.apply(this,arguments),P.apply(this,arguments)}}function Te(A,P){return A===ae?P:function(){var J=A.apply(this,arguments);J!==void 0&&(arguments[0]=J);var ce=this.onsuccess,de=this.onerror;this.onsuccess=null,this.onerror=null;var ve=P.apply(this,arguments);return ce&&(this.onsuccess=this.onsuccess?ye(ce,this.onsuccess):ce),de&&(this.onerror=this.onerror?ye(de,this.onerror):de),ve!==void 0?ve:J}}function Oe(A,P){return A===ae?P:function(){A.apply(this,arguments);var J=this.onsuccess,ce=this.onerror;this.onsuccess=this.onerror=null,P.apply(this,arguments),J&&(this.onsuccess=this.onsuccess?ye(J,this.onsuccess):J),ce&&(this.onerror=this.onerror?ye(ce,this.onerror):ce)}}function Ne(A,P){return A===ae?P:function(J){var ce=A.apply(this,arguments);l(J,ce);var de=this.onsuccess,ve=this.onerror;return this.onsuccess=null,this.onerror=null,J=P.apply(this,arguments),de&&(this.onsuccess=this.onsuccess?ye(de,this.onsuccess):de),ve&&(this.onerror=this.onerror?ye(ve,this.onerror):ve),ce===void 0?J===void 0?void 0:J:l(ce,J)}}function Ue(A,P){return A===ae?P:function(){return P.apply(this,arguments)!==!1&&A.apply(this,arguments)}}function Fe(A,P){return A===ae?P:function(){var J=A.apply(this,arguments);if(J&&typeof J.then=="function"){for(var ce=this,de=arguments.length,ve=new Array(de);de--;)ve[de]=arguments[de];return J.then(function(){return P.apply(ce,ve)})}return P.apply(this,arguments)}}Z.ModifyError=U,Z.DexieError=O,Z.BulkError=Q;var Ke=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function He(A){Ke=A}var it={},st=100,Ae=typeof Promise>"u"?[]:function(){var A=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[A,c(A),A];var P=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[P,c(P),A]}(),dt=Ae[0],_o=Ae[1],Ae=Ae[2],_o=_o&&_o.then,Le=dt&&dt.constructor,ht=!!Ae,ze=function(A,P){Rt.push([A,P]),At&&(queueMicrotask(Ct),At=!1)},mt=!0,At=!0,xt=[],qt=[],ar=fe,fr={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:ae,pgp:!1,env:{},finalize:ae},ct=fr,Rt=[],Ft=0,tr=[];function ut(A){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var P=this._PSD=ct;if(typeof A!="function"){if(A!==it)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&It(this,this._value))}this._state=null,this._value=null,++P.ref,function J(ce,de){try{de(function(ve){if(ce._state===null){if(ve===ce)throw new TypeError("A promise cannot be resolved with itself.");var Re=ce._lib&&Lt();ve&&typeof ve.then=="function"?J(ce,function(De,Ve){ve instanceof ut?ve._then(De,Ve):ve.then(De,Ve)}):(ce._state=!0,ce._value=ve,xe(ce)),Re&&Dt()}},It.bind(null,ce))}catch(ve){It(ce,ve)}}(this,A)}var Ut={get:function(){var A=ct,P=Fn;function J(ce,de){var ve=this,Re=!A.global&&(A!==ct||P!==Fn),De=Re&&!Ls(),Ve=new ut(function(Xe,tt){Qe(ve,new Et(nu(ce,A,Re,De),nu(de,A,Re,De),Xe,tt,A))});return this._consoleTask&&(Ve._consoleTask=this._consoleTask),Ve}return J.prototype=it,J},set:function(A){m(this,"then",A&&A.prototype===it?Ut:{get:function(){return A},set:Ut.set})}};function Et(A,P,J,ce,de){this.onFulfilled=typeof A=="function"?A:null,this.onRejected=typeof P=="function"?P:null,this.resolve=J,this.reject=ce,this.psd=de}function It(A,P){var J,ce;qt.push(P),A._state===null&&(J=A._lib&&Lt(),P=ar(P),A._state=!1,A._value=P,ce=A,xt.some(function(de){return de._value===ce._value})||xt.push(ce),xe(A),J&&Dt())}function xe(A){var P=A._listeners;A._listeners=[];for(var J=0,ce=P.length;J<ce;++J)Qe(A,P[J]);var de=A._PSD;--de.ref||de.finalize(),Ft===0&&(++Ft,ze(function(){--Ft==0&&bt()},[]))}function Qe(A,P){if(A._state!==null){var J=A._state?P.onFulfilled:P.onRejected;if(J===null)return(A._state?P.resolve:P.reject)(A._value);++P.psd.ref,++Ft,ze(ft,[J,A,P])}else A._listeners.push(P)}function ft(A,P,J){try{var ce,de=P._value;!P._state&&qt.length&&(qt=[]),ce=Ke&&P._consoleTask?P._consoleTask.run(function(){return A(de)}):A(de),P._state||qt.indexOf(de)!==-1||function(ve){for(var Re=xt.length;Re;)if(xt[--Re]._value===ve._value)return xt.splice(Re,1)}(P),J.resolve(ce)}catch(ve){J.reject(ve)}finally{--Ft==0&&bt(),--J.psd.ref||J.psd.finalize()}}function Ct(){ps(fr,function(){Lt()&&Dt()})}function Lt(){var A=mt;return At=mt=!1,A}function Dt(){var A,P,J;do for(;0<Rt.length;)for(A=Rt,Rt=[],J=A.length,P=0;P<J;++P){var ce=A[P];ce[0].apply(null,ce[1])}whil Line truncated
`).filter(s=>s),a=Math.min(...n.map(s=>s.length-s.trimStart().length)),i=n.map(s=>s.slice(a)).map(s=>" ".repeat(this.indent*2)+s);for(const s of i)this.content.push(s)}compile(){const e=Function,t=this?.args,a=[...(this?.content??[""]).map(i=>` ${i}`)];return new e(...t,a.join(`
`))}}const wde={major:4,minor:2,patch:1},fa=St("$ZodType",(r,e)=>{var t;r??(r={}),r._zod.def=e,r._zod.bag=r._zod.bag||{},r._zod.version=wde;const n=[...r._zod.def.checks??[]];r._zod.traits.has("$ZodCheck")&&n.unshift(r);for(const a of n)for(const i of a._zod.onattach)i(r);if(n.length===0)(t=r._zod).deferred??(t.deferred=[]),r._zod.deferred?.push(()=>{r._zod.run=r._zod.parse});else{const a=(s,o,l)=>{let c=Kh(s),u;for(const d of o){if(d._zod.def.when){if(!d._zod.def.when(s))continue}else if(c)continue;const h=s.issues.length,p=d._zod.check(s);if(p instanceof Promise&&l?.async===!1)throw new hf;if(u||p instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await p,s.issues.length!==h&&(c||(c=Kh(s,h)))});else{if(s.issues.length===h)continue;c||(c=Kh(s,h))}}return u?u.then(()=>s):s},i=(s,o,l)=>{if(Kh(s))return s.aborted=!0,s;const c=a(o,n,l);if(c instanceof Promise){if(l.async===!1)throw new hf;return c.then(u=>r._zod.parse(u,l))}return r._zod.parse(c,l)};r._zod.run=(s,o)=>{if(o.skipChecks)return r._zod.parse(s,o);if(o.direction==="backward"){const c=r._zod.parse({value:s.value,issues:[]},{...o,skipChecks:!0});return c instanceof Promise?c.then(u=>i(u,s,o)):i(c,s,o)}const l=r._zod.parse(s,o);if(l instanceof Promise){if(o.async===!1)throw new hf;return l.then(c=>a(c,n,o))}return a(l,n,o)}}r["~standard"]={validate:a=>{try{const i=I$(r,a);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Rue(r,a).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),D4=St("$ZodString",(r,e)=>{fa.init(r,e),r._zod.pattern=[...r?._zod.bag?.patterns??[]].pop()??nde(r._zod.bag),r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=String(t.value)}catch{}return typeof t.value=="string"||t.issues.push({expected:"string",code:"invalid_type",input:t.value,inst:r}),t}}),va=St("$ZodStringFormat",(r,e)=>{Vv.init(r,e),D4.init(r,e)}),Tde=St("$ZodGUID",(r,e)=>{e.pattern??(e.pattern=Hue),va.init(r,e)}),Cde=St("$ZodUUID",(r,e)=>{if(e.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=_8(n))}else e.pattern??(e.pattern=_8());va.init(r,e)}),Ade=St("$ZodEmail",(r,e)=>{e.pattern??(e.pattern=Vue),va.init(r,e)}),xde=St("$ZodURL",(r,e)=>{va.init(r,e),r._zod.check=t=>{try{const n=t.value.trim(),a=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(a.hostname)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:t.value,inst:r,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:t.value,inst:r,continue:!e.abort})),e.normalize?t.value=a.href:t.value=n;return}catch{t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:r,continue:!e.abort})}}}),Rde=St("$ZodEmoji",(r,e)=>{e.pattern??(e.pattern=Wue()),va.init(r,e)}),Ode=St("$ZodNanoID",(r,e)=>{e.pattern??(e.pattern=zue),va.init(r,e)}),Nde=St("$ZodCUID",(r,e)=>{e.pattern??(e.pattern=Fue),va.init(r,e)}),Ide=St("$ZodCUID2",(r,e)=>{e.pattern??(e.pattern=Bue),va.init(r,e)}),kde=St("$ZodULID",(r,e)=>{e.pattern??(e.pattern=Uue),va.init(r,e)}),Mde=St("$ZodXID",(r,e)=>{e.pattern??(e.pattern=$ue),va.init(r,e)}),Dde=St("$ZodKSUID",(r,e)=>{e.pattern??(e.pattern=Gue),va.init(r,e)}),Pde=St("$ZodISODateTime",(r,e)=>{e.pattern??(e.pattern=rde(e)),va.init(r,e)}),Lde=St("$ZodISODate",(r,e)=>{e.pattern??(e.pattern=ede),va.init(r,e)}),Fde=St("$ZodISOTime",(r,e)=>{e.pattern??(e.pattern=tde(e)),va.init(r,e)}),Bde=St("$ZodISODuration",(r,e)=>{e.pattern??(e.pattern=que),va.init(r,e)}),Ude=St("$ZodIPv4",(r,e)=>{e.pattern??(e.pattern=jue),va.init(r,e),r._zod.bag.format="ipv4"}),$de=St("$ZodIPv6",(r,e)=>{e.pattern??(e.pattern=Kue),va.init(r,e),r._zod.bag.format="ipv6",r._zod.check=t=>{try{new URL(`http://[${t.value}]`)}catch{t.issues.push({code:"invalid_format",format:"ipv6",input:t.value,inst:r,continue:!e.abort})}}}),Gde=St("$ZodCIDRv4",(r,e)=>{e.pattern??(e.pattern=Xue),va.init(r,e)}),zde=St("$ZodCIDRv6",(r,e)=>{e.pattern??(e.pattern=Que),va.init(r,e),r._zod.check=t=>{const n=t.value.split("/");try{if(n.length!==2)throw new Error;const[a,i]=n;if(!i)throw new Error;const s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${a}]`)}catch{t.issues.push({code:"invalid_format",format:"cidrv6",input:t.value,inst:r,continue:!e.abort})}}});function B$(r){if(r==="")return!0;if(r.length%4!==0)return!1;try{return atob(r),!0}catch{return!1}}const qde=St("$ZodBase64",(r,e)=>{e.pattern??(e.pattern=Zue),va.init(r,e),r._zod.bag.contentEncoding="base64",r._zod.check=t=>{B$(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:r,continue:!e.abort})}});function Hde(r){if(!k$.test(r))return!1;const e=r.replace(/[-_]/g,n=>n==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"= Line truncated
if (${E}.issues.length) {
@@ -75,45 +75,45 @@ ${t}`}function R4(r){return r.isComposing||r.keyCode===229}function yce(r,e){ret
newResult[${S}] = ${E}.value;
}
`)}p.write("payload.value = newResult;"),p.write("return payload;");const v=p.compile();return(y,E)=>v(h,y,E)};let i;const s=Nm,o=!T$.jitless,c=o&&mue.value,u=e.catchall;let d;r._zod.parse=(h,p)=>{d??(d=n.value);const m=h.value;return s(m)?o&&c&&p?.async===!1&&p.jitless!==!0?(i||(i=a(e.shape)),h=i(h,p),u?G$([],m,h,p,d,r):h):t(h,p):(h.issues.push({expected:"object",code:"invalid_type",input:m,inst:r}),h)}});function v8(r,e,t,n){for(const i of r)if(i.issues.length===0)return e.value=i.value,e;const a=r.filter(i=>!Kh(i));return a.length===1?(e.value=a[0].value,a[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:r.map(i=>i.issues.map(s=>Lu(s,n,Pu())))}),e)}const z$=St("$ZodUnion",(r,e)=>{fa.init(r,e),ta(r._zod,"optin",()=>e.options.some(a=>a._zod.optin==="optional")?"optional":void 0),ta(r._zod,"optout",()=>e.options.some(a=>a._zod.optout==="optional")?"optional":void 0),ta(r._zod,"values",()=>{if(e.options.every(a=>a._zod.values))return new Set(e.options.flatMap(a=>Array.from(a._zod.values)))}),ta(r._zod,"pattern",()=>{if(e.options.every(a=>a._zod.pattern)){const a=e.options.map(i=>i._zod.pattern);return new RegExp(`^(${a.map(i=>N4(i.source)).join("|")})$`)}});const t=e.options.length===1,n=e.options[0]._zod.run;r._zod.parse=(a,i)=>{if(t)return n(a,i);let s=!1;const o=[];for(const l of e.options){const c=l._zod.run({value:a.value,issues:[]},i);if(c instanceof Promise)o.push(c),s=!0;else{if(c.issues.length===0)return c;o.push(c)}}return s?Promise.all(o).then(l=>v8(l,a,r,i)):v8(o,a,r,i)}}),ahe=St("$ZodDiscriminatedUnion",(r,e)=>{e.inclusive=!1,z$.init(r,e);const t=r._zod.parse;ta(r._zod,"propValues",()=>{const a={};for(const i of e.options){const s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(const[o,l]of Object.entries(s)){a[o]||(a[o]=new Set);for(const c of l)a[o].add(c)}}return a});const n=zv(()=>{const a=e.options,i=new Map;for(const s of a){const o=s._zod.propValues?.[e.discriminator];if(!o||o.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(const l of o){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,s)}}return i});r._zod.parse=(a,i)=>{const s=a.value;if(!Nm(s))return a.issues.push({code:"invalid_type",expected:"object",input:s,inst:r}),a;const o=n.value.get(s?.[e.discriminator]);return o?o._zod.run(a,i):e.unionFallback?t(a,i):(a.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:s,path:[e.discriminator],inst:r}),a)}}),ihe=St("$ZodIntersection",(r,e)=>{fa.init(r,e),r._zod.parse=(t,n)=>{const a=t.value,i=e.left._zod.run({value:a,issues:[]},n),s=e.right._zod.run({value:a,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([l,c])=>y8(t,l,c)):y8(t,i,s)}});function y3(r,e){if(r===e)return{valid:!0,data:r};if(r instanceof Date&&e instanceof Date&&+r==+e)return{valid:!0,data:r};if(Pf(r)&&Pf(e)){const t=Object.keys(e),n=Object.keys(r).filter(i=>t.indexOf(i)!==-1),a={...r,...e};for(const i of n){const s=y3(r[i],e[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};a[i]=s.data}return{valid:!0,data:a}}if(Array.isArray(r)&&Array.isArray(e)){if(r.length!==e.length)return{valid:!1,mergeErrorPath:[]};const t=[];for(let n=0;n<r.length;n++){const a=r[n],i=e[n],s=y3(a,i);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};t.push(s.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function y8(r,e,t){if(e.issues.length&&r.issues.push(...e.issues),t.issues.length&&r.issues.push(...t.issues),Kh(r))return r;const n=y3(e.value,t.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return r.value=n.data,r}const she=St("$ZodRecord",(r,e)=>{fa.init(r,e),r._zod.parse=(t,n)=>{const a=t.value;if(!Pf(a))return t.issues.push({expected:"record",code:"invalid_type",input:a,inst:r}),t;const i=[],s=e.keyType._zod.values;if(s){t.value={};const o=new Set;for(const c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){o.add(typeof c=="number"?c.toString():c);const u=e.valueType._zod.run({value:a[c],issues:[]},n);u instanceof Promise?i.push(u.then(d=>{d.issues.length&&t.issues.push(...Xh(c,d.issues)),t.value[c]=d.value})):(u.issues.length&&t.issues.push(...Xh(c,u.issues)),t.value[c]=u.value)}let l;for(const c in a)o.has(c)||(l=l??[],l.push(c));l&&l.length>0&&t.issues.push({code:"unrecognized_keys",input:a,inst:r,keys:l})}else{t.value={};for(const o of Reflect.ownKeys(a)){if(o==="__proto__")continue;const l=e.keyType._zod.run({value:o,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){e.mode==="loose"?t.value[o]=a[o]:t.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(u=>Lu(u,n,Pu())),input:o,path:[o],inst:r});continue}c Line truncated
`)}p.write("payload.value = newResult;"),p.write("return payload;");const v=p.compile();return(y,E)=>v(h,y,E)};let i;const s=Nm,o=!T$.jitless,c=o&&mue.value,u=e.catchall;let d;r._zod.parse=(h,p)=>{d??(d=n.value);const m=h.value;return s(m)?o&&c&&p?.async===!1&&p.jitless!==!0?(i||(i=a(e.shape)),h=i(h,p),u?G$([],m,h,p,d,r):h):t(h,p):(h.issues.push({expected:"object",code:"invalid_type",input:m,inst:r}),h)}});function v8(r,e,t,n){for(const i of r)if(i.issues.length===0)return e.value=i.value,e;const a=r.filter(i=>!Kh(i));return a.length===1?(e.value=a[0].value,a[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:r.map(i=>i.issues.map(s=>Fu(s,n,Lu())))}),e)}const z$=St("$ZodUnion",(r,e)=>{fa.init(r,e),ta(r._zod,"optin",()=>e.options.some(a=>a._zod.optin==="optional")?"optional":void 0),ta(r._zod,"optout",()=>e.options.some(a=>a._zod.optout==="optional")?"optional":void 0),ta(r._zod,"values",()=>{if(e.options.every(a=>a._zod.values))return new Set(e.options.flatMap(a=>Array.from(a._zod.values)))}),ta(r._zod,"pattern",()=>{if(e.options.every(a=>a._zod.pattern)){const a=e.options.map(i=>i._zod.pattern);return new RegExp(`^(${a.map(i=>N4(i.source)).join("|")})$`)}});const t=e.options.length===1,n=e.options[0]._zod.run;r._zod.parse=(a,i)=>{if(t)return n(a,i);let s=!1;const o=[];for(const l of e.options){const c=l._zod.run({value:a.value,issues:[]},i);if(c instanceof Promise)o.push(c),s=!0;else{if(c.issues.length===0)return c;o.push(c)}}return s?Promise.all(o).then(l=>v8(l,a,r,i)):v8(o,a,r,i)}}),ahe=St("$ZodDiscriminatedUnion",(r,e)=>{e.inclusive=!1,z$.init(r,e);const t=r._zod.parse;ta(r._zod,"propValues",()=>{const a={};for(const i of e.options){const s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(const[o,l]of Object.entries(s)){a[o]||(a[o]=new Set);for(const c of l)a[o].add(c)}}return a});const n=zv(()=>{const a=e.options,i=new Map;for(const s of a){const o=s._zod.propValues?.[e.discriminator];if(!o||o.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(const l of o){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,s)}}return i});r._zod.parse=(a,i)=>{const s=a.value;if(!Nm(s))return a.issues.push({code:"invalid_type",expected:"object",input:s,inst:r}),a;const o=n.value.get(s?.[e.discriminator]);return o?o._zod.run(a,i):e.unionFallback?t(a,i):(a.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:s,path:[e.discriminator],inst:r}),a)}}),ihe=St("$ZodIntersection",(r,e)=>{fa.init(r,e),r._zod.parse=(t,n)=>{const a=t.value,i=e.left._zod.run({value:a,issues:[]},n),s=e.right._zod.run({value:a,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([l,c])=>y8(t,l,c)):y8(t,i,s)}});function y3(r,e){if(r===e)return{valid:!0,data:r};if(r instanceof Date&&e instanceof Date&&+r==+e)return{valid:!0,data:r};if(Pf(r)&&Pf(e)){const t=Object.keys(e),n=Object.keys(r).filter(i=>t.indexOf(i)!==-1),a={...r,...e};for(const i of n){const s=y3(r[i],e[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};a[i]=s.data}return{valid:!0,data:a}}if(Array.isArray(r)&&Array.isArray(e)){if(r.length!==e.length)return{valid:!1,mergeErrorPath:[]};const t=[];for(let n=0;n<r.length;n++){const a=r[n],i=e[n],s=y3(a,i);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};t.push(s.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function y8(r,e,t){if(e.issues.length&&r.issues.push(...e.issues),t.issues.length&&r.issues.push(...t.issues),Kh(r))return r;const n=y3(e.value,t.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return r.value=n.data,r}const she=St("$ZodRecord",(r,e)=>{fa.init(r,e),r._zod.parse=(t,n)=>{const a=t.value;if(!Pf(a))return t.issues.push({expected:"record",code:"invalid_type",input:a,inst:r}),t;const i=[],s=e.keyType._zod.values;if(s){t.value={};const o=new Set;for(const c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){o.add(typeof c=="number"?c.toString():c);const u=e.valueType._zod.run({value:a[c],issues:[]},n);u instanceof Promise?i.push(u.then(d=>{d.issues.length&&t.issues.push(...Xh(c,d.issues)),t.value[c]=d.value})):(u.issues.length&&t.issues.push(...Xh(c,u.issues)),t.value[c]=u.value)}let l;for(const c in a)o.has(c)||(l=l??[],l.push(c));l&&l.length>0&&t.issues.push({code:"unrecognized_keys",input:a,inst:r,keys:l})}else{t.value={};for(const o of Reflect.ownKeys(a)){if(o==="__proto__")continue;const l=e.keyType._zod.run({value:o,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){e.mode==="loose"?t.value[o]=a[o]:t.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(u=>Fu(u,n,Lu())),input:o,path:[o],inst:r});continue}c Line truncated
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of r.seen.entries()){const s=i[1];if(e===i[0]){a(i);continue}if(r.external){const l=r.external.registry.get(i[0])?.id;if(e!==i[0]&&l){a(i);continue}}if(r.metadataRegistry.get(i[0])?.id){a(i);continue}if(s.cycle){a(i);continue}if(s.count>1&&r.reused==="ref"){a(i);continue}}}function j$(r,e){const t=r.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=s=>{const o=r.seen.get(s),l=o.def??o.schema,c={...l};if(o.ref===null)return;const u=o.ref;if(o.ref=null,u){n(u);const d=r.seen.get(u).schema;d.$ref&&(r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(d)):(Object.assign(l,d),Object.assign(l,c))}o.isParent||r.override({zodSchema:s,jsonSchema:l,path:o.path??[]})};for(const s of[...r.seen.entries()].reverse())n(s[0]);const a={};if(r.target==="draft-2020-12"?a.$schema="https://json-schema.org/draft/2020-12/schema":r.target==="draft-07"?a.$schema="http://json-schema.org/draft-07/schema#":r.target==="draft-04"?a.$schema="http://json-schema.org/draft-04/schema#":r.target,r.external?.uri){const s=r.external.registry.get(e)?.id;if(!s)throw new Error("Schema is missing an `id` property");a.$id=r.external.uri(s)}Object.assign(a,t.def??t.schema);const i=r.external?.defs??{};for(const s of r.seen.entries()){const o=s[1];o.def&&o.defId&&(i[o.defId]=o.def)}r.external||Object.keys(i).length>0&&(r.target==="draft-2020-12"?a.$defs=i:a.definitions=i);try{const s=JSON.parse(JSON.stringify(a));return Object.defineProperty(s,"~standard",{value:{...e["~standard"],jsonSchema:{input:gb(e,"input"),output:gb(e,"output")}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Qi(r,e){const t=e??{seen:new Set};if(t.seen.has(r))return!1;t.seen.add(r);const n=r._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Qi(n.element,t);if(n.type==="set")return Qi(n.valueType,t);if(n.type==="lazy")return Qi(n.getter(),t);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Qi(n.innerType,t);if(n.type==="intersection")return Qi(n.left,t)||Qi(n.right,t);if(n.type==="record"||n.type==="map")return Qi(n.keyType,t)||Qi(n.valueType,t);if(n.type==="pipe")return Qi(n.in,t)||Qi(n.out,t);if(n.type==="object"){for(const a in n.shape)if(Qi(n.shape[a],t))return!0;return!1}if(n.type==="union"){for(const a of n.options)if(Qi(a,t))return!0;return!1}if(n.type==="tuple"){for(const a of n.items)if(Qi(a,t))return!0;return!!(n.rest&&Qi(n.rest,t))}return!1}const gfe=(r,e={})=>t=>{const n=Y$({...t,processors:e});return oi(r,n),W$(n,r),j$(n,r)},gb=(r,e)=>t=>{const{libraryOptions:n,target:a}=t??{},i=Y$({...n??{},target:a,io:e,processors:{}});return oi(r,i),W$(i,r),j$(i,r)},_fe={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},bfe=(r,e,t,n)=>{const a=t;a.type="string";const{minimum:i,maximum:s,format:o,patterns:l,contentEncoding:c}=r._zod.bag;if(typeof i=="number"&&(a.minLength=i),typeof s=="number"&&(a.maxLength=s),o&&(a.format=_fe[o]??o,a.format===""&&delete a.format),c&&(a.contentEncoding=c),l&&l.size>0){const u=[...l];u.length===1?a.pattern=u[0].source:u.length>1&&(a.allOf=[...u.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},vfe=(r,e,t,n)=>{const a=t,{minimum:i,maximum:s,format:o,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=r._zod.bag;typeof o=="string"&&o.includes("int")?a.type="integer":a.type="number",typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(a.minimum=u,a.exclusiveMinimum=!0):a.exclusiveMinimum=u),typeof i=="number"&&(a.minimum=i,typeof u=="number"&&e.target!=="draft-04"&&(u>=i?delete a.minimum:delete a.exclusiveMinimum)),typeof c=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(a.maximum=c,a.exclusiveMaximum=!0):a.exclusiveMaximum=c),typeof s=="number"&&(a.maximum=s,typeof c=="number"&&e.target!=="draft-04"&&(c<=s?delete a.maximum:delete a.exclusiveMaximum)),typeof l=="number"&&(a.multipleOf=l)},yfe=(r,e,t,n)=>{t.type="boolean"},Sfe=(r,e,t,n)=>{e.target==="openapi-3.0"?(t.type="string",t.nullable=!0,t.enum=[null]):t.type="null"},Efe=(r,e,t,n)=>{t.not={}},wfe=(r,e,t,n)=>{},Tfe=(r,e,t,n)=>{},Cfe=(r,e,t,n)=>{const a=r._zod.def,i=C$(a.entries);i.every(s=>typeof s=="number")&&(t.type="number"),i.every(s=>typeof s=="string")&&(t.type="string"),t.enum=i},Afe=(r,e,t,n)=>{const a=r._zod.def,i=[];for(const s of a.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){const s=i[0];t.type=s===null?"null":typeof s,e.Line truncated
`:""},this._extScope=R,this._scope=new t.Scope({parent:R}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(R){return this._scope.name(R)}scopeName(R){return this._extScope.name(R)}scopeValue(R,U){const Q=this._extScope.value(R,U);return(this._values[Q.prefix]||(this._values[Q.prefix]=new Set)).add(Q),Q}getScopeValue(R,U){return this._extScope.getValue(R,U)}scopeRefs(R){return this._extScope.scopeRefs(R,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(R,U,Q,ne){const ue=this._scope.toName(U);return Q!==void 0&&ne&&(this._constants[ue.str]=Q),this._leafNode(new s(R,ue,Q)),ue}const(R,U,Q){return this._def(t.varKinds.const,R,U,Q)}let(R,U,Q){return this._def(t.varKinds.let,R,U,Q)}var(R,U,Q){return this._def(t.varKinds.var,R,U,Q)}assign(R,U,Q){return this._leafNode(new o(R,U,Q))}add(R,U){return this._leafNode(new l(R,r.operators.ADD,U))}code(R){return typeof R=="function"?R():R!==e.nil&&this._leafNode(new h(R)),this}object(...R){const U=["{"];for(const[Q,ne]of R)U.length>1&&U.push(","),U.push(Q),(Q!==ne||this.opts.es5)&&(U.push(":"),(0,e.addCodeArg)(U,ne));return U.push("}"),new e._Code(U)}if(R,U,Q){if(this._blockNode(new _(R)),U&&Q)this.code(U).else().code(Q).endIf();else if(U)this.code(U).endIf();else if(Q)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(R){return this._elseNode(new _(R))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(_,b)}_for(R,U){return this._blockNode(R),U&&this.code(U).endFor(),this}for(R,U){return this._for(new y(R),U)}forRange(R,U,Q,ne,ue=this.opts.es5?t.varKinds.var:t.varKinds.let){const he=this._scope.toName(R);return this._for(new E(ue,he,U,Q),()=>ne(he))}forOf(R,U,Q,ne=t.varKinds.const){const ue=this._scope.toName(R);if(this.opts.es5){const he=U instanceof e.Name?U:this.var("_arr",U);return this.forRange("_i",0,(0,e._)`${he}.length`,be=>{this.var(ue,(0,e._)`${he}[${be}]`),Q(ue)})}return this._for(new S("of",ne,ue,U),()=>Q(ue))}forIn(R,U,Q,ne=this.opts.es5?t.varKinds.var:t.varKinds.const){if(this.opts.ownProperties)return this.forOf(R,(0,e._)`Object.keys(${U})`,Q);const ue=this._scope.toName(R);return this._for(new S("in",ne,ue,U),()=>Q(ue))}endFor(){return this._endBlockNode(v)}label(R){return this._leafNode(new c(R))}break(R){return this._leafNode(new u(R))}return(R){const U=new C;if(this._blockNode(U),this.code(R),U.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(C)}try(R,U,Q){if(!U&&!Q)throw new Error('CodeGen: "try" without "catch" and "finally"');const ne=new x;if(this._blockNode(ne),this.code(R),U){const ue=this.name("e");this._currNode=ne.catch=new N(ue),U(ue)}return Q&&(this._currNode=ne.finally=new I,this.code(Q)),this._endBlockNode(N,I)}throw(R){return this._leafNode(new d(R))}block(R,U){return this._blockStarts.push(this._nodes.length),R&&this.code(R).endBlock(U),this}endBlock(R){const U=this._blockStarts.pop();if(U===void 0)throw new Error("CodeGen: not in self-balancing block");const Q=this._nodes.length-U;if(Q<0||R!==void 0&&Q!==R)throw new Error(`CodeGen: wrong number of nodes: ${Q} vs ${R} expected`);return this._nodes.length=U,this}func(R,U=e.nil,Q,ne){return this._blockNode(new w(R,U,Q)),ne&&this.code(ne).endFunc(),this}endFunc(){return this._endBlockNode(w)}optimize(R=1){for(;R-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(R){return this._currNode.nodes.push(R),this}_blockNode(R){this._currNode.nodes.push(R),this._nodes.push(R)}_endBlockNode(R,U){const Q=this._currNode;if(Q instanceof R||U&&Q instanceof U)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${U?`${R.kind}/${U.kind}`:R.kind}"`)}_elseNode(R){const U=this._currNode;if(!(U instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=U.else=R,this}get _root(){return this._nodes[0]}get _currNode(){const R=this._nodes;return R[R.length-1]}set _currNode(R){const U=this._nodes;U[U.length-1]=R}}r.CodeGen=D;function V(O,R){for(const U in R)O[U]=(O[U]||0)+(R[U]||0);return O}function q(O,R){return R instanceof e._CodeOrName?V(O,R.names):O}function $(O,R,U){if(O instanceof e.Name)return Q(O);if(!ne(O))return O;return new e._Code(O._items.reduce((ue,he)=>(he instanceof e.Name&&(he=Q(he)),he instanceof e._Code?ue.push(...he._items):ue.push(he),ue),[]));function Q(ue){const he=U[ue.str];return he===void 0||R[ue.str]!==1?ue:(delete R[ue.str],he)}function ne(ue){return ue instanceof e._Code&&ue._items.some(he=>he instanceof e.Name&&R[he.str]===1&&U[he.str]!==void 0)}}function K(O,R){for(const U in R)O[U]=(O[U]||0)-(R[U]||0)}function z(O){return typeof O=="boolean"||typeof O=="number"||O===null?!O:(0,e._)`!${te(O)}`}r.not=z;const re=B(r.operators.AND);function W(...O){return O.reduce(re)}r.and=W;const ie=B(r.operators.OR);function k(...O){return O.reduce(ie)}r.or=k;function B(O){return(R,U)=>R===e.nil?U:U===e.nil?R:(0,e._)`${te(R)} ${O} ${te(U)}`}function te(O){return Line truncated
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of r.seen.entries()){const s=i[1];if(e===i[0]){a(i);continue}if(r.external){const l=r.external.registry.get(i[0])?.id;if(e!==i[0]&&l){a(i);continue}}if(r.metadataRegistry.get(i[0])?.id){a(i);continue}if(s.cycle){a(i);continue}if(s.count>1&&r.reused==="ref"){a(i);continue}}}function j$(r,e){const t=r.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=s=>{const o=r.seen.get(s),l=o.def??o.schema,c={...l};if(o.ref===null)return;const u=o.ref;if(o.ref=null,u){n(u);const d=r.seen.get(u).schema;d.$ref&&(r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(d)):(Object.assign(l,d),Object.assign(l,c))}o.isParent||r.override({zodSchema:s,jsonSchema:l,path:o.path??[]})};for(const s of[...r.seen.entries()].reverse())n(s[0]);const a={};if(r.target==="draft-2020-12"?a.$schema="https://json-schema.org/draft/2020-12/schema":r.target==="draft-07"?a.$schema="http://json-schema.org/draft-07/schema#":r.target==="draft-04"?a.$schema="http://json-schema.org/draft-04/schema#":r.target,r.external?.uri){const s=r.external.registry.get(e)?.id;if(!s)throw new Error("Schema is missing an `id` property");a.$id=r.external.uri(s)}Object.assign(a,t.def??t.schema);const i=r.external?.defs??{};for(const s of r.seen.entries()){const o=s[1];o.def&&o.defId&&(i[o.defId]=o.def)}r.external||Object.keys(i).length>0&&(r.target==="draft-2020-12"?a.$defs=i:a.definitions=i);try{const s=JSON.parse(JSON.stringify(a));return Object.defineProperty(s,"~standard",{value:{...e["~standard"],jsonSchema:{input:gb(e,"input"),output:gb(e,"output")}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Qi(r,e){const t=e??{seen:new Set};if(t.seen.has(r))return!1;t.seen.add(r);const n=r._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Qi(n.element,t);if(n.type==="set")return Qi(n.valueType,t);if(n.type==="lazy")return Qi(n.getter(),t);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Qi(n.innerType,t);if(n.type==="intersection")return Qi(n.left,t)||Qi(n.right,t);if(n.type==="record"||n.type==="map")return Qi(n.keyType,t)||Qi(n.valueType,t);if(n.type==="pipe")return Qi(n.in,t)||Qi(n.out,t);if(n.type==="object"){for(const a in n.shape)if(Qi(n.shape[a],t))return!0;return!1}if(n.type==="union"){for(const a of n.options)if(Qi(a,t))return!0;return!1}if(n.type==="tuple"){for(const a of n.items)if(Qi(a,t))return!0;return!!(n.rest&&Qi(n.rest,t))}return!1}const gfe=(r,e={})=>t=>{const n=Y$({...t,processors:e});return oi(r,n),W$(n,r),j$(n,r)},gb=(r,e)=>t=>{const{libraryOptions:n,target:a}=t??{},i=Y$({...n??{},target:a,io:e,processors:{}});return oi(r,i),W$(i,r),j$(i,r)},_fe={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},bfe=(r,e,t,n)=>{const a=t;a.type="string";const{minimum:i,maximum:s,format:o,patterns:l,contentEncoding:c}=r._zod.bag;if(typeof i=="number"&&(a.minLength=i),typeof s=="number"&&(a.maxLength=s),o&&(a.format=_fe[o]??o,a.format===""&&delete a.format),c&&(a.contentEncoding=c),l&&l.size>0){const u=[...l];u.length===1?a.pattern=u[0].source:u.length>1&&(a.allOf=[...u.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},vfe=(r,e,t,n)=>{const a=t,{minimum:i,maximum:s,format:o,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=r._zod.bag;typeof o=="string"&&o.includes("int")?a.type="integer":a.type="number",typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(a.minimum=u,a.exclusiveMinimum=!0):a.exclusiveMinimum=u),typeof i=="number"&&(a.minimum=i,typeof u=="number"&&e.target!=="draft-04"&&(u>=i?delete a.minimum:delete a.exclusiveMinimum)),typeof c=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(a.maximum=c,a.exclusiveMaximum=!0):a.exclusiveMaximum=c),typeof s=="number"&&(a.maximum=s,typeof c=="number"&&e.target!=="draft-04"&&(c<=s?delete a.maximum:delete a.exclusiveMaximum)),typeof l=="number"&&(a.multipleOf=l)},yfe=(r,e,t,n)=>{t.type="boolean"},Sfe=(r,e,t,n)=>{e.target==="openapi-3.0"?(t.type="string",t.nullable=!0,t.enum=[null]):t.type="null"},Efe=(r,e,t,n)=>{t.not={}},wfe=(r,e,t,n)=>{},Tfe=(r,e,t,n)=>{},Cfe=(r,e,t,n)=>{const a=r._zod.def,i=C$(a.entries);i.every(s=>typeof s=="number")&&(t.type="number"),i.every(s=>typeof s=="string")&&(t.type="string"),t.enum=i},Afe=(r,e,t,n)=>{const a=r._zod.def,i=[];for(const s of a.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){const s=i[0];t.type=s===null?"null":typeof s,e.Line truncated
`:""},this._extScope=R,this._scope=new t.Scope({parent:R}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(R){return this._scope.name(R)}scopeName(R){return this._extScope.name(R)}scopeValue(R,U){const Q=this._extScope.value(R,U);return(this._values[Q.prefix]||(this._values[Q.prefix]=new Set)).add(Q),Q}getScopeValue(R,U){return this._extScope.getValue(R,U)}scopeRefs(R){return this._extScope.scopeRefs(R,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(R,U,Q,ne){const ue=this._scope.toName(U);return Q!==void 0&&ne&&(this._constants[ue.str]=Q),this._leafNode(new s(R,ue,Q)),ue}const(R,U,Q){return this._def(t.varKinds.const,R,U,Q)}let(R,U,Q){return this._def(t.varKinds.let,R,U,Q)}var(R,U,Q){return this._def(t.varKinds.var,R,U,Q)}assign(R,U,Q){return this._leafNode(new o(R,U,Q))}add(R,U){return this._leafNode(new l(R,r.operators.ADD,U))}code(R){return typeof R=="function"?R():R!==e.nil&&this._leafNode(new h(R)),this}object(...R){const U=["{"];for(const[Q,ne]of R)U.length>1&&U.push(","),U.push(Q),(Q!==ne||this.opts.es5)&&(U.push(":"),(0,e.addCodeArg)(U,ne));return U.push("}"),new e._Code(U)}if(R,U,Q){if(this._blockNode(new _(R)),U&&Q)this.code(U).else().code(Q).endIf();else if(U)this.code(U).endIf();else if(Q)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(R){return this._elseNode(new _(R))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(_,b)}_for(R,U){return this._blockNode(R),U&&this.code(U).endFor(),this}for(R,U){return this._for(new y(R),U)}forRange(R,U,Q,ne,ue=this.opts.es5?t.varKinds.var:t.varKinds.let){const he=this._scope.toName(R);return this._for(new E(ue,he,U,Q),()=>ne(he))}forOf(R,U,Q,ne=t.varKinds.const){const ue=this._scope.toName(R);if(this.opts.es5){const he=U instanceof e.Name?U:this.var("_arr",U);return this.forRange("_i",0,(0,e._)`${he}.length`,be=>{this.var(ue,(0,e._)`${he}[${be}]`),Q(ue)})}return this._for(new S("of",ne,ue,U),()=>Q(ue))}forIn(R,U,Q,ne=this.opts.es5?t.varKinds.var:t.varKinds.const){if(this.opts.ownProperties)return this.forOf(R,(0,e._)`Object.keys(${U})`,Q);const ue=this._scope.toName(R);return this._for(new S("in",ne,ue,U),()=>Q(ue))}endFor(){return this._endBlockNode(v)}label(R){return this._leafNode(new c(R))}break(R){return this._leafNode(new u(R))}return(R){const U=new C;if(this._blockNode(U),this.code(R),U.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(C)}try(R,U,Q){if(!U&&!Q)throw new Error('CodeGen: "try" without "catch" and "finally"');const ne=new x;if(this._blockNode(ne),this.code(R),U){const ue=this.name("e");this._currNode=ne.catch=new N(ue),U(ue)}return Q&&(this._currNode=ne.finally=new I,this.code(Q)),this._endBlockNode(N,I)}throw(R){return this._leafNode(new d(R))}block(R,U){return this._blockStarts.push(this._nodes.length),R&&this.code(R).endBlock(U),this}endBlock(R){const U=this._blockStarts.pop();if(U===void 0)throw new Error("CodeGen: not in self-balancing block");const Q=this._nodes.length-U;if(Q<0||R!==void 0&&Q!==R)throw new Error(`CodeGen: wrong number of nodes: ${Q} vs ${R} expected`);return this._nodes.length=U,this}func(R,U=e.nil,Q,ne){return this._blockNode(new w(R,U,Q)),ne&&this.code(ne).endFunc(),this}endFunc(){return this._endBlockNode(w)}optimize(R=1){for(;R-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(R){return this._currNode.nodes.push(R),this}_blockNode(R){this._currNode.nodes.push(R),this._nodes.push(R)}_endBlockNode(R,U){const Q=this._currNode;if(Q instanceof R||U&&Q instanceof U)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${U?`${R.kind}/${U.kind}`:R.kind}"`)}_elseNode(R){const U=this._currNode;if(!(U instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=U.else=R,this}get _root(){return this._nodes[0]}get _currNode(){const R=this._nodes;return R[R.length-1]}set _currNode(R){const U=this._nodes;U[U.length-1]=R}}r.CodeGen=D;function V(O,R){for(const U in R)O[U]=(O[U]||0)+(R[U]||0);return O}function q(O,R){return R instanceof e._CodeOrName?V(O,R.names):O}function $(O,R,U){if(O instanceof e.Name)return Q(O);if(!ne(O))return O;return new e._Code(O._items.reduce((ue,he)=>(he instanceof e.Name&&(he=Q(he)),he instanceof e._Code?ue.push(...he._items):ue.push(he),ue),[]));function Q(ue){const he=U[ue.str];return he===void 0||R[ue.str]!==1?ue:(delete R[ue.str],he)}function ne(ue){return ue instanceof e._Code&&ue._items.some(he=>he instanceof e.Name&&R[he.str]===1&&U[he.str]!==void 0)}}function K(O,R){for(const U in R)O[U]=(O[U]||0)-(R[U]||0)}function z(O){return typeof O=="boolean"||typeof O=="number"||O===null?!O:(0,e._)`!${te(O)}`}r.not=z;const re=B(r.operators.AND);function W(...O){return O.reduce(re)}r.and=W;const ie=B(r.operators.OR);function k(...O){return O.reduce(ie)}r.or=k;function B(O){return(R,U)=>R===e.nil?U:U===e.nil?R:(0,e._)`${te(R)} ${O} ${te(U)}`}function te(O){return Line truncated
|| (${x} == "string" && ${w} && ${w} == +${w})`).assign(N,(0,n._)`+${w}`);return;case"integer":S.elseIf((0,n._)`${x} === "boolean" || ${w} === null
|| (${x} === "string" && ${w} && ${w} == +${w} && !(${w} % 1))`).assign(N,(0,n._)`+${w}`);return;case"boolean":S.elseIf((0,n._)`${w} === "false" || ${w} === 0 || ${w} === null`).assign(N,!1).elseIf((0,n._)`${w} === "true" || ${w} === 1`).assign(N,!0);return;case"null":S.elseIf((0,n._)`${w} === "" || ${w} === 0 || ${w} === false`),S.assign(N,null);return;case"array":S.elseIf((0,n._)`${x} === "string" || ${x} === "number"
|| ${x} === "boolean" || ${w} === null`).assign(N,(0,n._)`[${w}]`)}}}function h({gen:v,parentData:y,parentDataProperty:E},S){v.if((0,n._)`${y} !== undefined`,()=>v.assign((0,n._)`${y}[${E}]`,S))}function p(v,y,E,S=i.Correct){const w=S===i.Correct?n.operators.EQ:n.operators.NEQ;let C;switch(v){case"null":return(0,n._)`${y} ${w} null`;case"array":C=(0,n._)`Array.isArray(${y})`;break;case"object":C=(0,n._)`${y} && typeof ${y} == "object" && !Array.isArray(${y})`;break;case"integer":C=x((0,n._)`!(${y} % 1) && !isNaN(${y})`);break;case"number":C=x();break;default:return(0,n._)`typeof ${y} ${w} ${v}`}return S===i.Correct?C:(0,n.not)(C);function x(N=n.nil){return(0,n.and)((0,n._)`typeof ${y} == "number"`,N,E?(0,n._)`isFinite(${y})`:n.nil)}}wi.checkDataType=p;function m(v,y,E,S){if(v.length===1)return p(v[0],y,E,S);let w;const C=(0,a.toHash)(v);if(C.array&&C.object){const x=(0,n._)`typeof ${y} != "object"`;w=C.null?x:(0,n._)`!${y} || ${x}`,delete C.null,delete C.array,delete C.object}else w=n.nil;C.number&&delete C.integer;for(const x in C)w=(0,n.and)(w,p(x,y,E,S));return w}wi.checkDataTypes=m;const g={message:({schema:v})=>`must be ${v}`,params:({schema:v,schemaValue:y})=>typeof v=="string"?(0,n._)`{type: ${v}}`:(0,n._)`{type: ${y}}`};function b(v){const y=_(v);(0,t.reportError)(y,g)}wi.reportTypeError=b;function _(v){const{gen:y,data:E,schema:S}=v,w=(0,a.schemaRefOrVal)(v,S,"type");return{gen:y,keyword:"type",data:E,schema:S.type,schemaCode:w,schemaValue:w,parentSchema:S,params:{},it:v}}return wi}var Ap={},j8;function Uge(){if(j8)return Ap;j8=1,Object.defineProperty(Ap,"__esModule",{value:!0}),Ap.assignDefaults=void 0;const r=xn(),e=Gn();function t(a,i){const{properties:s,items:o}=a.schema;if(i==="object"&&s)for(const l in s)n(a,l,s[l].default);else i==="array"&&Array.isArray(o)&&o.forEach((l,c)=>n(a,c,l.default))}Ap.assignDefaults=t;function n(a,i,s){const{gen:o,compositeRule:l,data:c,opts:u}=a;if(s===void 0)return;const d=(0,r._)`${c}${(0,r.getProperty)(i)}`;if(l){(0,e.checkStrictMode)(a,`default is ignored for: ${d}`);return}let h=(0,r._)`${d} === undefined`;u.useDefaults==="empty"&&(h=(0,r._)`${h} || ${d} === null || ${d} === ""`),o.if(h,(0,r._)`${d} = ${(0,r.stringify)(s)}`)}return Ap}var zo={},Wn={},K8;function ol(){if(K8)return Wn;K8=1,Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.validateUnion=Wn.validateArray=Wn.usePattern=Wn.callValidateCode=Wn.schemaProperties=Wn.allSchemaProperties=Wn.noPropertyInData=Wn.propertyInData=Wn.isOwnProperty=Wn.hasPropFunc=Wn.reportMissingProp=Wn.checkMissingProp=Wn.checkReportMissingProp=void 0;const r=xn(),e=Gn(),t=Xu(),n=Gn();function a(v,y){const{gen:E,data:S,it:w}=v;E.if(u(E,S,y,w.opts.ownProperties),()=>{v.setParams({missingProperty:(0,r._)`${y}`},!0),v.error()})}Wn.checkReportMissingProp=a;function i({gen:v,data:y,it:{opts:E}},S,w){return(0,r.or)(...S.map(C=>(0,r.and)(u(v,y,C,E.ownProperties),(0,r._)`${w} = ${C}`)))}Wn.checkMissingProp=i;function s(v,y){v.setParams({missingProperty:y},!0),v.error()}Wn.reportMissingProp=s;function o(v){return v.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,r._)`Object.prototype.hasOwnProperty`})}Wn.hasPropFunc=o;function l(v,y,E){return(0,r._)`${o(v)}.call(${y}, ${E})`}Wn.isOwnProperty=l;function c(v,y,E,S){const w=(0,r._)`${y}${(0,r.getProperty)(E)} !== undefined`;return S?(0,r._)`${w} && ${l(v,y,E)}`:w}Wn.propertyInData=c;function u(v,y,E,S){const w=(0,r._)`${y}${(0,r.getProperty)(E)} === undefined`;return S?(0,r.or)(w,(0,r.not)(l(v,y,E))):w}Wn.noPropertyInData=u;function d(v){return v?Object.keys(v).filter(y=>y!=="__proto__"):[]}Wn.allSchemaProperties=d;function h(v,y){return d(y).filter(E=>!(0,e.alwaysValidSchema)(v,y[E]))}Wn.schemaProperties=h;function p({schemaCode:v,data:y,it:{gen:E,topSchemaRef:S,schemaPath:w,errorPath:C},it:x},N,I,D){const V=D?(0,r._)`${v}, ${y}, ${S}${w}`:y,q=[[t.default.instancePath,(0,r.strConcat)(t.default.instancePath,C)],[t.default.parentData,x.parentData],[t.default.parentDataProperty,x.parentDataProperty],[t.default.rootData,t.default.rootData]];x.opts.dynamicRef&&q.push([t.default.dynamicAnchors,t.default.dynamicAnchors]);const $=(0,r._)`${V}, ${E.object(...q)}`;return I!==r.nil?(0,r._)`${N}.call(${I}, ${$})`:(0,r._)`${N}(${$})`}Wn.callValidateCode=p;const m=(0,r._)`new RegExp`;function g({gen:v,it:{opts:y}},E){const S=y.unicodeRegExp?"u":"",{regExp:w}=y.code,C=w(E,S);return v.scopeValue("pattern",{key:C.toString(),ref:C,code:(0,r._)`${w.code==="new RegExp"?m:(0,n.useFunc)(v,w)}(${E}, ${S})`})}Wn.usePattern=g;function b(v){const{gen:y,data:E,keyword:S,it:w}=v,C=y.name("valid");if(w.allErrors){const N=y.let("valid",!0);return x(()=>y.assign(N,!1)),N}return y.var(C,!0),x(()=>y.break()),C;function x(N){const I=y.const("len",(0,r._)`${E}.length`);y.forRange("i",0,I,D=>{v.subschema({keyword:S,dataProp:D,dataPropType:e.Type.Num},C),y.if((0,r.not)(C),N)})}}Wn.validateArray=b;function _(v){const{gen:y,schema:E,keyword:S,it:w}=v;if(!Array.isArray(E))throw new Error("ajv Line truncated
|| ${x} === "boolean" || ${w} === null`).assign(N,(0,n._)`[${w}]`)}}}function h({gen:v,parentData:y,parentDataProperty:E},S){v.if((0,n._)`${y} !== undefined`,()=>v.assign((0,n._)`${y}[${E}]`,S))}function p(v,y,E,S=i.Correct){const w=S===i.Correct?n.operators.EQ:n.operators.NEQ;let C;switch(v){case"null":return(0,n._)`${y} ${w} null`;case"array":C=(0,n._)`Array.isArray(${y})`;break;case"object":C=(0,n._)`${y} && typeof ${y} == "object" && !Array.isArray(${y})`;break;case"integer":C=x((0,n._)`!(${y} % 1) && !isNaN(${y})`);break;case"number":C=x();break;default:return(0,n._)`typeof ${y} ${w} ${v}`}return S===i.Correct?C:(0,n.not)(C);function x(N=n.nil){return(0,n.and)((0,n._)`typeof ${y} == "number"`,N,E?(0,n._)`isFinite(${y})`:n.nil)}}wi.checkDataType=p;function m(v,y,E,S){if(v.length===1)return p(v[0],y,E,S);let w;const C=(0,a.toHash)(v);if(C.array&&C.object){const x=(0,n._)`typeof ${y} != "object"`;w=C.null?x:(0,n._)`!${y} || ${x}`,delete C.null,delete C.array,delete C.object}else w=n.nil;C.number&&delete C.integer;for(const x in C)w=(0,n.and)(w,p(x,y,E,S));return w}wi.checkDataTypes=m;const g={message:({schema:v})=>`must be ${v}`,params:({schema:v,schemaValue:y})=>typeof v=="string"?(0,n._)`{type: ${v}}`:(0,n._)`{type: ${y}}`};function b(v){const y=_(v);(0,t.reportError)(y,g)}wi.reportTypeError=b;function _(v){const{gen:y,data:E,schema:S}=v,w=(0,a.schemaRefOrVal)(v,S,"type");return{gen:y,keyword:"type",data:E,schema:S.type,schemaCode:w,schemaValue:w,parentSchema:S,params:{},it:v}}return wi}var Ap={},j8;function Uge(){if(j8)return Ap;j8=1,Object.defineProperty(Ap,"__esModule",{value:!0}),Ap.assignDefaults=void 0;const r=xn(),e=Gn();function t(a,i){const{properties:s,items:o}=a.schema;if(i==="object"&&s)for(const l in s)n(a,l,s[l].default);else i==="array"&&Array.isArray(o)&&o.forEach((l,c)=>n(a,c,l.default))}Ap.assignDefaults=t;function n(a,i,s){const{gen:o,compositeRule:l,data:c,opts:u}=a;if(s===void 0)return;const d=(0,r._)`${c}${(0,r.getProperty)(i)}`;if(l){(0,e.checkStrictMode)(a,`default is ignored for: ${d}`);return}let h=(0,r._)`${d} === undefined`;u.useDefaults==="empty"&&(h=(0,r._)`${h} || ${d} === null || ${d} === ""`),o.if(h,(0,r._)`${d} = ${(0,r.stringify)(s)}`)}return Ap}var zo={},Wn={},K8;function ol(){if(K8)return Wn;K8=1,Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.validateUnion=Wn.validateArray=Wn.usePattern=Wn.callValidateCode=Wn.schemaProperties=Wn.allSchemaProperties=Wn.noPropertyInData=Wn.propertyInData=Wn.isOwnProperty=Wn.hasPropFunc=Wn.reportMissingProp=Wn.checkMissingProp=Wn.checkReportMissingProp=void 0;const r=xn(),e=Gn(),t=Qu(),n=Gn();function a(v,y){const{gen:E,data:S,it:w}=v;E.if(u(E,S,y,w.opts.ownProperties),()=>{v.setParams({missingProperty:(0,r._)`${y}`},!0),v.error()})}Wn.checkReportMissingProp=a;function i({gen:v,data:y,it:{opts:E}},S,w){return(0,r.or)(...S.map(C=>(0,r.and)(u(v,y,C,E.ownProperties),(0,r._)`${w} = ${C}`)))}Wn.checkMissingProp=i;function s(v,y){v.setParams({missingProperty:y},!0),v.error()}Wn.reportMissingProp=s;function o(v){return v.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,r._)`Object.prototype.hasOwnProperty`})}Wn.hasPropFunc=o;function l(v,y,E){return(0,r._)`${o(v)}.call(${y}, ${E})`}Wn.isOwnProperty=l;function c(v,y,E,S){const w=(0,r._)`${y}${(0,r.getProperty)(E)} !== undefined`;return S?(0,r._)`${w} && ${l(v,y,E)}`:w}Wn.propertyInData=c;function u(v,y,E,S){const w=(0,r._)`${y}${(0,r.getProperty)(E)} === undefined`;return S?(0,r.or)(w,(0,r.not)(l(v,y,E))):w}Wn.noPropertyInData=u;function d(v){return v?Object.keys(v).filter(y=>y!=="__proto__"):[]}Wn.allSchemaProperties=d;function h(v,y){return d(y).filter(E=>!(0,e.alwaysValidSchema)(v,y[E]))}Wn.schemaProperties=h;function p({schemaCode:v,data:y,it:{gen:E,topSchemaRef:S,schemaPath:w,errorPath:C},it:x},N,I,D){const V=D?(0,r._)`${v}, ${y}, ${S}${w}`:y,q=[[t.default.instancePath,(0,r.strConcat)(t.default.instancePath,C)],[t.default.parentData,x.parentData],[t.default.parentDataProperty,x.parentDataProperty],[t.default.rootData,t.default.rootData]];x.opts.dynamicRef&&q.push([t.default.dynamicAnchors,t.default.dynamicAnchors]);const $=(0,r._)`${V}, ${E.object(...q)}`;return I!==r.nil?(0,r._)`${N}.call(${I}, ${$})`:(0,r._)`${N}(${$})`}Wn.callValidateCode=p;const m=(0,r._)`new RegExp`;function g({gen:v,it:{opts:y}},E){const S=y.unicodeRegExp?"u":"",{regExp:w}=y.code,C=w(E,S);return v.scopeValue("pattern",{key:C.toString(),ref:C,code:(0,r._)`${w.code==="new RegExp"?m:(0,n.useFunc)(v,w)}(${E}, ${S})`})}Wn.usePattern=g;function b(v){const{gen:y,data:E,keyword:S,it:w}=v,C=y.name("valid");if(w.allErrors){const N=y.let("valid",!0);return x(()=>y.assign(N,!1)),N}return y.var(C,!0),x(()=>y.break()),C;function x(N){const I=y.const("len",(0,r._)`${E}.length`);y.forRange("i",0,I,D=>{v.subschema({keyword:S,dataProp:D,dataPropType:e.Type.Num},C),y.if((0,r.not)(C),N)})}}Wn.validateArray=b;function _(v){const{gen:y,schema:E,keyword:S,it:w}=v;if(!Array.isArray(E))throw new Error("ajv Line truncated
missingProperty: ${d},
depsCount: ${c},
deps: ${u}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:r.error,code(l){const[c,u]=i(l);s(l,c),o(l,u)}};function i({schema:l}){const c={},u={};for(const d in l){if(d==="__proto__")continue;const h=Array.isArray(l[d])?c:u;h[d]=l[d]}return[c,u]}function s(l,c=l.schema){const{gen:u,data:d,it:h}=l;if(Object.keys(c).length===0)return;const p=u.let("missing");for(const m in c){const g=c[m];if(g.length===0)continue;const b=(0,n.propertyInData)(u,d,m,h.opts.ownProperties);l.setParams({property:m,depsCount:g.length,deps:g.join(", ")}),h.allErrors?u.if(b,()=>{for(const _ of g)(0,n.checkReportMissingProp)(l,_)}):(u.if((0,e._)`${b} && (${(0,n.checkMissingProp)(l,g,p)})`),(0,n.reportMissingProp)(l,p),u.else())}}r.validatePropertyDeps=s;function o(l,c=l.schema){const{gen:u,data:d,keyword:h,it:p}=l,m=u.name("valid");for(const g in c)(0,t.alwaysValidSchema)(p,c[g])||(u.if((0,n.propertyInData)(u,d,g,p.opts.ownProperties),()=>{const b=l.subschema({keyword:h,schemaProp:g},m);l.mergeValidEvaluated(b,m)},()=>u.var(m,!0)),l.ok(m))}r.validateSchemaDeps=o,r.default=a}(gT)),gT}var z0={},kk;function b0e(){if(kk)return z0;kk=1,Object.defineProperty(z0,"__esModule",{value:!0});const r=xn(),e=Gn(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:a})=>(0,r._)`{propertyName: ${a.propertyName}}`},code(a){const{gen:i,schema:s,data:o,it:l}=a;if((0,e.alwaysValidSchema)(l,s))return;const c=i.name("valid");i.forIn("key",o,u=>{a.setParams({propertyName:u}),a.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},c),i.if((0,r.not)(c),()=>{a.error(!0),l.allErrors||i.break()})}),a.ok(c)}};return z0.default=n,z0}var q0={},Mk;function zG(){if(Mk)return q0;Mk=1,Object.defineProperty(q0,"__esModule",{value:!0});const r=ol(),e=xn(),t=Xu(),n=Gn(),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:s})=>(0,e._)`{additionalProperty: ${s.additionalProperty}}`},code(s){const{gen:o,schema:l,parentSchema:c,data:u,errsCount:d,it:h}=s;if(!d)throw new Error("ajv implementation error");const{allErrors:p,opts:m}=h;if(h.props=!0,m.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(h,l))return;const g=(0,r.allSchemaProperties)(c.properties),b=(0,r.allSchemaProperties)(c.patternProperties);_(),s.ok((0,e._)`${d} === ${t.default.errors}`);function _(){o.forIn("key",u,w=>{!g.length&&!b.length?E(w):o.if(v(w),()=>E(w))})}function v(w){let C;if(g.length>8){const x=(0,n.schemaRefOrVal)(h,c.properties,"properties");C=(0,r.isOwnProperty)(o,x,w)}else g.length?C=(0,e.or)(...g.map(x=>(0,e._)`${w} === ${x}`)):C=e.nil;return b.length&&(C=(0,e.or)(C,...b.map(x=>(0,e._)`${(0,r.usePattern)(s,x)}.test(${w})`))),(0,e.not)(C)}function y(w){o.code((0,e._)`delete ${u}[${w}]`)}function E(w){if(m.removeAdditional==="all"||m.removeAdditional&&l===!1){y(w);return}if(l===!1){s.setParams({additionalProperty:w}),s.error(),p||o.break();return}if(typeof l=="object"&&!(0,n.alwaysValidSchema)(h,l)){const C=o.name("valid");m.removeAdditional==="failing"?(S(w,C,!1),o.if((0,e.not)(C),()=>{s.reset(),y(w)})):(S(w,C),p||o.if((0,e.not)(C),()=>o.break()))}}function S(w,C,x){const N={keyword:"additionalProperties",dataProp:w,dataPropType:n.Type.Str};x===!1&&Object.assign(N,{compositeRule:!0,createErrors:!1,allErrors:!1}),s.subschema(N,C)}}};return q0.default=i,q0}var H0={},Dk;function v0e(){if(Dk)return H0;Dk=1,Object.defineProperty(H0,"__esModule",{value:!0});const r=ey(),e=ol(),t=Gn(),n=zG(),a={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:s,schema:o,parentSchema:l,data:c,it:u}=i;u.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&n.default.code(new r.KeywordCxt(u,n.default,"additionalProperties"));const d=(0,e.allSchemaProperties)(o);for(const b of d)u.definedProperties.add(b);u.opts.unevaluated&&d.length&&u.props!==!0&&(u.props=t.mergeEvaluated.props(s,(0,t.toHash)(d),u.props));const h=d.filter(b=>!(0,t.alwaysValidSchema)(u,o[b]));if(h.length===0)return;const p=s.name("valid");for(const b of h)m(b)?g(b):(s.if((0,e.propertyInData)(s,c,b,u.opts.ownProperties)),g(b),u.allErrors||s.else().var(p,!0),s.endIf()),i.it.definedProperties.add(b),i.ok(p);function m(b){return u.opts.useDefaults&&!u.compositeRule&&o[b].default!==void 0}function g(b){i.subschema({keyword:"properties",schemaProp:b,dataProp:b},p)}}};return H0.default=a,H0}var V0={},Pk;function y0e(){if(Pk)return V0;Pk=1,Object.defineProperty(V0,"__esModule",{value:!0});const r=ol(),e=xn(),t=Gn(),n=Gn(),a={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:s,schema:o,data:l,parentSchema:c,it:u}=i,{opts:d}=u,h=(0,r.allSchemaProperties)(o),p=h.filter(E=>(0,t.alwaysValidSchema)(u,o[E]));if(h.length===0||p.length===h.length&&(!u.opts.unevaluated||u.props===!0))return;const m=d.strictSchema&&!d.allowMatch Line truncated
`:""},this._extScope=R,this._scope=new t.Scope({parent:R}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(R){return this._scope.name(R)}scopeName(R){return this._extScope.name(R)}scopeValue(R,U){const Q=this._extScope.value(R,U);return(this._values[Q.prefix]||(this._values[Q.prefix]=new Set)).add(Q),Q}getScopeValue(R,U){return this._extScope.getValue(R,U)}scopeRefs(R){return this._extScope.scopeRefs(R,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(R,U,Q,ne){const ue=this._scope.toName(U);return Q!==void 0&&ne&&(this._constants[ue.str]=Q),this._leafNode(new s(R,ue,Q)),ue}const(R,U,Q){return this._def(t.varKinds.const,R,U,Q)}let(R,U,Q){return this._def(t.varKinds.let,R,U,Q)}var(R,U,Q){return this._def(t.varKinds.var,R,U,Q)}assign(R,U,Q){return this._leafNode(new o(R,U,Q))}add(R,U){return this._leafNode(new l(R,r.operators.ADD,U))}code(R){return typeof R=="function"?R():R!==e.nil&&this._leafNode(new h(R)),this}object(...R){const U=["{"];for(const[Q,ne]of R)U.length>1&&U.push(","),U.push(Q),(Q!==ne||this.opts.es5)&&(U.push(":"),(0,e.addCodeArg)(U,ne));return U.push("}"),new e._Code(U)}if(R,U,Q){if(this._blockNode(new _(R)),U&&Q)this.code(U).else().code(Q).endIf();else if(U)this.code(U).endIf();else if(Q)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(R){return this._elseNode(new _(R))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(_,b)}_for(R,U){return this._blockNode(R),U&&this.code(U).endFor(),this}for(R,U){return this._for(new y(R),U)}forRange(R,U,Q,ne,ue=this.opts.es5?t.varKinds.var:t.varKinds.let){const he=this._scope.toName(R);return this._for(new E(ue,he,U,Q),()=>ne(he))}forOf(R,U,Q,ne=t.varKinds.const){const ue=this._scope.toName(R);if(this.opts.es5){const he=U instanceof e.Name?U:this.var("_arr",U);return this.forRange("_i",0,(0,e._)`${he}.length`,be=>{this.var(ue,(0,e._)`${he}[${be}]`),Q(ue)})}return this._for(new S("of",ne,ue,U),()=>Q(ue))}forIn(R,U,Q,ne=this.opts.es5?t.varKinds.var:t.varKinds.const){if(this.opts.ownProperties)return this.forOf(R,(0,e._)`Object.keys(${U})`,Q);const ue=this._scope.toName(R);return this._for(new S("in",ne,ue,U),()=>Q(ue))}endFor(){return this._endBlockNode(v)}label(R){return this._leafNode(new c(R))}break(R){return this._leafNode(new u(R))}return(R){const U=new C;if(this._blockNode(U),this.code(R),U.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(C)}try(R,U,Q){if(!U&&!Q)throw new Error('CodeGen: "try" without "catch" and "finally"');const ne=new x;if(this._blockNode(ne),this.code(R),U){const ue=this.name("e");this._currNode=ne.catch=new N(ue),U(ue)}return Q&&(this._currNode=ne.finally=new I,this.code(Q)),this._endBlockNode(N,I)}throw(R){return this._leafNode(new d(R))}block(R,U){return this._blockStarts.push(this._nodes.length),R&&this.code(R).endBlock(U),this}endBlock(R){const U=this._blockStarts.pop();if(U===void 0)throw new Error("CodeGen: not in self-balancing block");const Q=this._nodes.length-U;if(Q<0||R!==void 0&&Q!==R)throw new Error(`CodeGen: wrong number of nodes: ${Q} vs ${R} expected`);return this._nodes.length=U,this}func(R,U=e.nil,Q,ne){return this._blockNode(new w(R,U,Q)),ne&&this.code(ne).endFunc(),this}endFunc(){return this._endBlockNode(w)}optimize(R=1){for(;R-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(R){return this._currNode.nodes.push(R),this}_blockNode(R){this._currNode.nodes.push(R),this._nodes.push(R)}_endBlockNode(R,U){const Q=this._currNode;if(Q instanceof R||U&&Q instanceof U)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${U?`${R.kind}/${U.kind}`:R.kind}"`)}_elseNode(R){const U=this._currNode;if(!(U instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=U.else=R,this}get _root(){return this._nodes[0]}get _currNode(){const R=this._nodes;return R[R.length-1]}set _currNode(R){const U=this._nodes;U[U.length-1]=R}}r.CodeGen=D;function V(O,R){for(const U in R)O[U]=(O[U]||0)+(R[U]||0);return O}function q(O,R){return R instanceof e._CodeOrName?V(O,R.names):O}function $(O,R,U){if(O instanceof e.Name)return Q(O);if(!ne(O))return O;return new e._Code(O._items.reduce((ue,he)=>(he instanceof e.Name&&(he=Q(he)),he instanceof e._Code?ue.push(...he._items):ue.push(he),ue),[]));function Q(ue){const he=U[ue.str];return he===void 0||R[ue.str]!==1?ue:(delete R[ue.str],he)}function ne(ue){return ue instanceof e._Code&&ue._items.some(he=>he instanceof e.Name&&R[he.str]===1&&U[he.str]!==void 0)}}function K(O,R){for(const U in R)O[U]=(O[U]||0)-(R[U]||0)}function z(O){return typeof O=="boolean"||typeof O=="number"||O===null?!O:(0,e._)`!${te(O)}`}r.not=z;const re=B(r.operators.AND);function W(...O){return O.reduce(re)}r.and=W;const ie=B(r.operators.OR);function k(...O){return O.reduce(ie)}r.or=k;function B(O){return(R,U)=>R===e.nil?U:U===e.nil?R:(0,e._)`${te(R)} ${O} ${te(U)}`}function te(O){return Line truncated
deps: ${u}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:r.error,code(l){const[c,u]=i(l);s(l,c),o(l,u)}};function i({schema:l}){const c={},u={};for(const d in l){if(d==="__proto__")continue;const h=Array.isArray(l[d])?c:u;h[d]=l[d]}return[c,u]}function s(l,c=l.schema){const{gen:u,data:d,it:h}=l;if(Object.keys(c).length===0)return;const p=u.let("missing");for(const m in c){const g=c[m];if(g.length===0)continue;const b=(0,n.propertyInData)(u,d,m,h.opts.ownProperties);l.setParams({property:m,depsCount:g.length,deps:g.join(", ")}),h.allErrors?u.if(b,()=>{for(const _ of g)(0,n.checkReportMissingProp)(l,_)}):(u.if((0,e._)`${b} && (${(0,n.checkMissingProp)(l,g,p)})`),(0,n.reportMissingProp)(l,p),u.else())}}r.validatePropertyDeps=s;function o(l,c=l.schema){const{gen:u,data:d,keyword:h,it:p}=l,m=u.name("valid");for(const g in c)(0,t.alwaysValidSchema)(p,c[g])||(u.if((0,n.propertyInData)(u,d,g,p.opts.ownProperties),()=>{const b=l.subschema({keyword:h,schemaProp:g},m);l.mergeValidEvaluated(b,m)},()=>u.var(m,!0)),l.ok(m))}r.validateSchemaDeps=o,r.default=a}(gT)),gT}var z0={},kk;function b0e(){if(kk)return z0;kk=1,Object.defineProperty(z0,"__esModule",{value:!0});const r=xn(),e=Gn(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:a})=>(0,r._)`{propertyName: ${a.propertyName}}`},code(a){const{gen:i,schema:s,data:o,it:l}=a;if((0,e.alwaysValidSchema)(l,s))return;const c=i.name("valid");i.forIn("key",o,u=>{a.setParams({propertyName:u}),a.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},c),i.if((0,r.not)(c),()=>{a.error(!0),l.allErrors||i.break()})}),a.ok(c)}};return z0.default=n,z0}var q0={},Mk;function zG(){if(Mk)return q0;Mk=1,Object.defineProperty(q0,"__esModule",{value:!0});const r=ol(),e=xn(),t=Qu(),n=Gn(),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:s})=>(0,e._)`{additionalProperty: ${s.additionalProperty}}`},code(s){const{gen:o,schema:l,parentSchema:c,data:u,errsCount:d,it:h}=s;if(!d)throw new Error("ajv implementation error");const{allErrors:p,opts:m}=h;if(h.props=!0,m.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(h,l))return;const g=(0,r.allSchemaProperties)(c.properties),b=(0,r.allSchemaProperties)(c.patternProperties);_(),s.ok((0,e._)`${d} === ${t.default.errors}`);function _(){o.forIn("key",u,w=>{!g.length&&!b.length?E(w):o.if(v(w),()=>E(w))})}function v(w){let C;if(g.length>8){const x=(0,n.schemaRefOrVal)(h,c.properties,"properties");C=(0,r.isOwnProperty)(o,x,w)}else g.length?C=(0,e.or)(...g.map(x=>(0,e._)`${w} === ${x}`)):C=e.nil;return b.length&&(C=(0,e.or)(C,...b.map(x=>(0,e._)`${(0,r.usePattern)(s,x)}.test(${w})`))),(0,e.not)(C)}function y(w){o.code((0,e._)`delete ${u}[${w}]`)}function E(w){if(m.removeAdditional==="all"||m.removeAdditional&&l===!1){y(w);return}if(l===!1){s.setParams({additionalProperty:w}),s.error(),p||o.break();return}if(typeof l=="object"&&!(0,n.alwaysValidSchema)(h,l)){const C=o.name("valid");m.removeAdditional==="failing"?(S(w,C,!1),o.if((0,e.not)(C),()=>{s.reset(),y(w)})):(S(w,C),p||o.if((0,e.not)(C),()=>o.break()))}}function S(w,C,x){const N={keyword:"additionalProperties",dataProp:w,dataPropType:n.Type.Str};x===!1&&Object.assign(N,{compositeRule:!0,createErrors:!1,allErrors:!1}),s.subschema(N,C)}}};return q0.default=i,q0}var H0={},Dk;function v0e(){if(Dk)return H0;Dk=1,Object.defineProperty(H0,"__esModule",{value:!0});const r=ey(),e=ol(),t=Gn(),n=zG(),a={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:s,schema:o,parentSchema:l,data:c,it:u}=i;u.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&n.default.code(new r.KeywordCxt(u,n.default,"additionalProperties"));const d=(0,e.allSchemaProperties)(o);for(const b of d)u.definedProperties.add(b);u.opts.unevaluated&&d.length&&u.props!==!0&&(u.props=t.mergeEvaluated.props(s,(0,t.toHash)(d),u.props));const h=d.filter(b=>!(0,t.alwaysValidSchema)(u,o[b]));if(h.length===0)return;const p=s.name("valid");for(const b of h)m(b)?g(b):(s.if((0,e.propertyInData)(s,c,b,u.opts.ownProperties)),g(b),u.allErrors||s.else().var(p,!0),s.endIf()),i.it.definedProperties.add(b),i.ok(p);function m(b){return u.opts.useDefaults&&!u.compositeRule&&o[b].default!==void 0}function g(b){i.subschema({keyword:"properties",schemaProp:b,dataProp:b},p)}}};return H0.default=a,H0}var V0={},Pk;function y0e(){if(Pk)return V0;Pk=1,Object.defineProperty(V0,"__esModule",{value:!0});const r=ol(),e=xn(),t=Gn(),n=Gn(),a={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:s,schema:o,data:l,parentSchema:c,it:u}=i,{opts:d}=u,h=(0,r.allSchemaProperties)(o),p=h.filter(E=>(0,t.alwaysValidSchema)(u,o[E]));if(h.length===0||p.length===h.length&&(!u.opts.unevaluated||u.props===!0))return;const m=d.strictSchema&&!d.allowMatch Line truncated
`:""},this._extScope=R,this._scope=new t.Scope({parent:R}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(R){return this._scope.name(R)}scopeName(R){return this._extScope.name(R)}scopeValue(R,U){const Q=this._extScope.value(R,U);return(this._values[Q.prefix]||(this._values[Q.prefix]=new Set)).add(Q),Q}getScopeValue(R,U){return this._extScope.getValue(R,U)}scopeRefs(R){return this._extScope.scopeRefs(R,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(R,U,Q,ne){const ue=this._scope.toName(U);return Q!==void 0&&ne&&(this._constants[ue.str]=Q),this._leafNode(new s(R,ue,Q)),ue}const(R,U,Q){return this._def(t.varKinds.const,R,U,Q)}let(R,U,Q){return this._def(t.varKinds.let,R,U,Q)}var(R,U,Q){return this._def(t.varKinds.var,R,U,Q)}assign(R,U,Q){return this._leafNode(new o(R,U,Q))}add(R,U){return this._leafNode(new l(R,r.operators.ADD,U))}code(R){return typeof R=="function"?R():R!==e.nil&&this._leafNode(new h(R)),this}object(...R){const U=["{"];for(const[Q,ne]of R)U.length>1&&U.push(","),U.push(Q),(Q!==ne||this.opts.es5)&&(U.push(":"),(0,e.addCodeArg)(U,ne));return U.push("}"),new e._Code(U)}if(R,U,Q){if(this._blockNode(new _(R)),U&&Q)this.code(U).else().code(Q).endIf();else if(U)this.code(U).endIf();else if(Q)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(R){return this._elseNode(new _(R))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(_,b)}_for(R,U){return this._blockNode(R),U&&this.code(U).endFor(),this}for(R,U){return this._for(new y(R),U)}forRange(R,U,Q,ne,ue=this.opts.es5?t.varKinds.var:t.varKinds.let){const he=this._scope.toName(R);return this._for(new E(ue,he,U,Q),()=>ne(he))}forOf(R,U,Q,ne=t.varKinds.const){const ue=this._scope.toName(R);if(this.opts.es5){const he=U instanceof e.Name?U:this.var("_arr",U);return this.forRange("_i",0,(0,e._)`${he}.length`,be=>{this.var(ue,(0,e._)`${he}[${be}]`),Q(ue)})}return this._for(new S("of",ne,ue,U),()=>Q(ue))}forIn(R,U,Q,ne=this.opts.es5?t.varKinds.var:t.varKinds.const){if(this.opts.ownProperties)return this.forOf(R,(0,e._)`Object.keys(${U})`,Q);const ue=this._scope.toName(R);return this._for(new S("in",ne,ue,U),()=>Q(ue))}endFor(){return this._endBlockNode(v)}label(R){return this._leafNode(new c(R))}break(R){return this._leafNode(new u(R))}return(R){const U=new C;if(this._blockNode(U),this.code(R),U.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(C)}try(R,U,Q){if(!U&&!Q)throw new Error('CodeGen: "try" without "catch" and "finally"');const ne=new x;if(this._blockNode(ne),this.code(R),U){const ue=this.name("e");this._currNode=ne.catch=new N(ue),U(ue)}return Q&&(this._currNode=ne.finally=new I,this.code(Q)),this._endBlockNode(N,I)}throw(R){return this._leafNode(new d(R))}block(R,U){return this._blockStarts.push(this._nodes.length),R&&this.code(R).endBlock(U),this}endBlock(R){const U=this._blockStarts.pop();if(U===void 0)throw new Error("CodeGen: not in self-balancing block");const Q=this._nodes.length-U;if(Q<0||R!==void 0&&Q!==R)throw new Error(`CodeGen: wrong number of nodes: ${Q} vs ${R} expected`);return this._nodes.length=U,this}func(R,U=e.nil,Q,ne){return this._blockNode(new w(R,U,Q)),ne&&this.code(ne).endFunc(),this}endFunc(){return this._endBlockNode(w)}optimize(R=1){for(;R-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(R){return this._currNode.nodes.push(R),this}_blockNode(R){this._currNode.nodes.push(R),this._nodes.push(R)}_endBlockNode(R,U){const Q=this._currNode;if(Q instanceof R||U&&Q instanceof U)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${U?`${R.kind}/${U.kind}`:R.kind}"`)}_elseNode(R){const U=this._currNode;if(!(U instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=U.else=R,this}get _root(){return this._nodes[0]}get _currNode(){const R=this._nodes;return R[R.length-1]}set _currNode(R){const U=this._nodes;U[U.length-1]=R}}r.CodeGen=D;function V(O,R){for(const U in R)O[U]=(O[U]||0)+(R[U]||0);return O}function q(O,R){return R instanceof e._CodeOrName?V(O,R.names):O}function $(O,R,U){if(O instanceof e.Name)return Q(O);if(!ne(O))return O;return new e._Code(O._items.reduce((ue,he)=>(he instanceof e.Name&&(he=Q(he)),he instanceof e._Code?ue.push(...he._items):ue.push(he),ue),[]));function Q(ue){const he=U[ue.str];return he===void 0||R[ue.str]!==1?ue:(delete R[ue.str],he)}function ne(ue){return ue instanceof e._Code&&ue._items.some(he=>he instanceof e.Name&&R[he.str]===1&&U[he.str]!==void 0)}}function K(O,R){for(const U in R)O[U]=(O[U]||0)-(R[U]||0)}function z(O){return typeof O=="boolean"||typeof O=="number"||O===null?!O:(0,e._)`!${te(O)}`}r.not=z;const re=B(r.operators.AND);function W(...O){return O.reduce(re)}r.and=W;const ie=B(r.operators.OR);function k(...O){return O.reduce(ie)}r.or=k;function B(O){return(R,U)=>R===e.nil?U:U===e.nil?R:(0,e._)`${te(R)} ${O} ${te(U)}`}function te(O){return Line truncated
|| (${x} == "string" && ${w} && ${w} == +${w})`).assign(N,(0,n._)`+${w}`);return;case"integer":S.elseIf((0,n._)`${x} === "boolean" || ${w} === null
|| (${x} === "string" && ${w} && ${w} == +${w} && !(${w} % 1))`).assign(N,(0,n._)`+${w}`);return;case"boolean":S.elseIf((0,n._)`${w} === "false" || ${w} === 0 || ${w} === null`).assign(N,!1).elseIf((0,n._)`${w} === "true" || ${w} === 1`).assign(N,!0);return;case"null":S.elseIf((0,n._)`${w} === "" || ${w} === 0 || ${w} === false`),S.assign(N,null);return;case"array":S.elseIf((0,n._)`${x} === "string" || ${x} === "number"
|| ${x} === "boolean" || ${w} === null`).assign(N,(0,n._)`[${w}]`)}}}function h({gen:v,parentData:y,parentDataProperty:E},S){v.if((0,n._)`${y} !== undefined`,()=>v.assign((0,n._)`${y}[${E}]`,S))}function p(v,y,E,S=i.Correct){const w=S===i.Correct?n.operators.EQ:n.operators.NEQ;let C;switch(v){case"null":return(0,n._)`${y} ${w} null`;case"array":C=(0,n._)`Array.isArray(${y})`;break;case"object":C=(0,n._)`${y} && typeof ${y} == "object" && !Array.isArray(${y})`;break;case"integer":C=x((0,n._)`!(${y} % 1) && !isNaN(${y})`);break;case"number":C=x();break;default:return(0,n._)`typeof ${y} ${w} ${v}`}return S===i.Correct?C:(0,n.not)(C);function x(N=n.nil){return(0,n.and)((0,n._)`typeof ${y} == "number"`,N,E?(0,n._)`isFinite(${y})`:n.nil)}}Ti.checkDataType=p;function m(v,y,E,S){if(v.length===1)return p(v[0],y,E,S);let w;const C=(0,a.toHash)(v);if(C.array&&C.object){const x=(0,n._)`typeof ${y} != "object"`;w=C.null?x:(0,n._)`!${y} || ${x}`,delete C.null,delete C.array,delete C.object}else w=n.nil;C.number&&delete C.integer;for(const x in C)w=(0,n.and)(w,p(x,y,E,S));return w}Ti.checkDataTypes=m;const g={message:({schema:v})=>`must be ${v}`,params:({schema:v,schemaValue:y})=>typeof v=="string"?(0,n._)`{type: ${v}}`:(0,n._)`{type: ${y}}`};function b(v){const y=_(v);(0,t.reportError)(y,g)}Ti.reportTypeError=b;function _(v){const{gen:y,data:E,schema:S}=v,w=(0,a.schemaRefOrVal)(v,S,"type");return{gen:y,keyword:"type",data:E,schema:S.type,schemaCode:w,schemaValue:w,parentSchema:S,params:{},it:v}}return Ti}var Op={},lM;function Y0e(){if(lM)return Op;lM=1,Object.defineProperty(Op,"__esModule",{value:!0}),Op.assignDefaults=void 0;const r=pn(),e=zn();function t(a,i){const{properties:s,items:o}=a.schema;if(i==="object"&&s)for(const l in s)n(a,l,s[l].default);else i==="array"&&Array.isArray(o)&&o.forEach((l,c)=>n(a,c,l.default))}Op.assignDefaults=t;function n(a,i,s){const{gen:o,compositeRule:l,data:c,opts:u}=a;if(s===void 0)return;const d=(0,r._)`${c}${(0,r.getProperty)(i)}`;if(l){(0,e.checkStrictMode)(a,`default is ignored for: ${d}`);return}let h=(0,r._)`${d} === undefined`;u.useDefaults==="empty"&&(h=(0,r._)`${h} || ${d} === null || ${d} === ""`),o.if(h,(0,r._)`${d} = ${(0,r.stringify)(s)}`)}return Op}var qo={},jn={},cM;function ll(){if(cM)return jn;cM=1,Object.defineProperty(jn,"__esModule",{value:!0}),jn.validateUnion=jn.validateArray=jn.usePattern=jn.callValidateCode=jn.schemaProperties=jn.allSchemaProperties=jn.noPropertyInData=jn.propertyInData=jn.isOwnProperty=jn.hasPropFunc=jn.reportMissingProp=jn.checkMissingProp=jn.checkReportMissingProp=void 0;const r=pn(),e=zn(),t=Qu(),n=zn();function a(v,y){const{gen:E,data:S,it:w}=v;E.if(u(E,S,y,w.opts.ownProperties),()=>{v.setParams({missingProperty:(0,r._)`${y}`},!0),v.error()})}jn.checkReportMissingProp=a;function i({gen:v,data:y,it:{opts:E}},S,w){return(0,r.or)(...S.map(C=>(0,r.and)(u(v,y,C,E.ownProperties),(0,r._)`${w} = ${C}`)))}jn.checkMissingProp=i;function s(v,y){v.setParams({missingProperty:y},!0),v.error()}jn.reportMissingProp=s;function o(v){return v.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,r._)`Object.prototype.hasOwnProperty`})}jn.hasPropFunc=o;function l(v,y,E){return(0,r._)`${o(v)}.call(${y}, ${E})`}jn.isOwnProperty=l;function c(v,y,E,S){const w=(0,r._)`${y}${(0,r.getProperty)(E)} !== undefined`;return S?(0,r._)`${w} && ${l(v,y,E)}`:w}jn.propertyInData=c;function u(v,y,E,S){const w=(0,r._)`${y}${(0,r.getProperty)(E)} === undefined`;return S?(0,r.or)(w,(0,r.not)(l(v,y,E))):w}jn.noPropertyInData=u;function d(v){return v?Object.keys(v).filter(y=>y!=="__proto__"):[]}jn.allSchemaProperties=d;function h(v,y){return d(y).filter(E=>!(0,e.alwaysValidSchema)(v,y[E]))}jn.schemaProperties=h;function p({schemaCode:v,data:y,it:{gen:E,topSchemaRef:S,schemaPath:w,errorPath:C},it:x},N,I,D){const V=D?(0,r._)`${v}, ${y}, ${S}${w}`:y,q=[[t.default.instancePath,(0,r.strConcat)(t.default.instancePath,C)],[t.default.parentData,x.parentData],[t.default.parentDataProperty,x.parentDataProperty],[t.default.rootData,t.default.rootData]];x.opts.dynamicRef&&q.push([t.default.dynamicAnchors,t.default.dynamicAnchors]);const $=(0,r._)`${V}, ${E.object(...q)}`;return I!==r.nil?(0,r._)`${N}.call(${I}, ${$})`:(0,r._)`${N}(${$})`}jn.callValidateCode=p;const m=(0,r._)`new RegExp`;function g({gen:v,it:{opts:y}},E){const S=y.unicodeRegExp?"u":"",{regExp:w}=y.code,C=w(E,S);return v.scopeValue("pattern",{key:C.toString(),ref:C,code:(0,r._)`${w.code==="new RegExp"?m:(0,n.useFunc)(v,w)}(${E}, ${S})`})}jn.usePattern=g;function b(v){const{gen:y,data:E,keyword:S,it:w}=v,C=y.name("valid");if(w.allErrors){const N=y.let("valid",!0);return x(()=>y.assign(N,!1)),N}return y.var(C,!0),x(()=>y.break()),C;function x(N){const I=y.const("len",(0,r._)`${E}.length`);y.forRange("i",0,I,D=>{v.subschema({keyword:S,dataProp:D,dataPropType:e.Type.Num},C),y.if((0,r.not)(C),N)})}}jn.validateArray=b;function _(v){const{gen:y,schema:E,keyword:S,it:w}=v;if(!Array.isArray(E))throw new Error("ajv Line truncated
|| ${x} === "boolean" || ${w} === null`).assign(N,(0,n._)`[${w}]`)}}}function h({gen:v,parentData:y,parentDataProperty:E},S){v.if((0,n._)`${y} !== undefined`,()=>v.assign((0,n._)`${y}[${E}]`,S))}function p(v,y,E,S=i.Correct){const w=S===i.Correct?n.operators.EQ:n.operators.NEQ;let C;switch(v){case"null":return(0,n._)`${y} ${w} null`;case"array":C=(0,n._)`Array.isArray(${y})`;break;case"object":C=(0,n._)`${y} && typeof ${y} == "object" && !Array.isArray(${y})`;break;case"integer":C=x((0,n._)`!(${y} % 1) && !isNaN(${y})`);break;case"number":C=x();break;default:return(0,n._)`typeof ${y} ${w} ${v}`}return S===i.Correct?C:(0,n.not)(C);function x(N=n.nil){return(0,n.and)((0,n._)`typeof ${y} == "number"`,N,E?(0,n._)`isFinite(${y})`:n.nil)}}Ti.checkDataType=p;function m(v,y,E,S){if(v.length===1)return p(v[0],y,E,S);let w;const C=(0,a.toHash)(v);if(C.array&&C.object){const x=(0,n._)`typeof ${y} != "object"`;w=C.null?x:(0,n._)`!${y} || ${x}`,delete C.null,delete C.array,delete C.object}else w=n.nil;C.number&&delete C.integer;for(const x in C)w=(0,n.and)(w,p(x,y,E,S));return w}Ti.checkDataTypes=m;const g={message:({schema:v})=>`must be ${v}`,params:({schema:v,schemaValue:y})=>typeof v=="string"?(0,n._)`{type: ${v}}`:(0,n._)`{type: ${y}}`};function b(v){const y=_(v);(0,t.reportError)(y,g)}Ti.reportTypeError=b;function _(v){const{gen:y,data:E,schema:S}=v,w=(0,a.schemaRefOrVal)(v,S,"type");return{gen:y,keyword:"type",data:E,schema:S.type,schemaCode:w,schemaValue:w,parentSchema:S,params:{},it:v}}return Ti}var Op={},lM;function Y0e(){if(lM)return Op;lM=1,Object.defineProperty(Op,"__esModule",{value:!0}),Op.assignDefaults=void 0;const r=pn(),e=zn();function t(a,i){const{properties:s,items:o}=a.schema;if(i==="object"&&s)for(const l in s)n(a,l,s[l].default);else i==="array"&&Array.isArray(o)&&o.forEach((l,c)=>n(a,c,l.default))}Op.assignDefaults=t;function n(a,i,s){const{gen:o,compositeRule:l,data:c,opts:u}=a;if(s===void 0)return;const d=(0,r._)`${c}${(0,r.getProperty)(i)}`;if(l){(0,e.checkStrictMode)(a,`default is ignored for: ${d}`);return}let h=(0,r._)`${d} === undefined`;u.useDefaults==="empty"&&(h=(0,r._)`${h} || ${d} === null || ${d} === ""`),o.if(h,(0,r._)`${d} = ${(0,r.stringify)(s)}`)}return Op}var qo={},jn={},cM;function ll(){if(cM)return jn;cM=1,Object.defineProperty(jn,"__esModule",{value:!0}),jn.validateUnion=jn.validateArray=jn.usePattern=jn.callValidateCode=jn.schemaProperties=jn.allSchemaProperties=jn.noPropertyInData=jn.propertyInData=jn.isOwnProperty=jn.hasPropFunc=jn.reportMissingProp=jn.checkMissingProp=jn.checkReportMissingProp=void 0;const r=pn(),e=zn(),t=Zu(),n=zn();function a(v,y){const{gen:E,data:S,it:w}=v;E.if(u(E,S,y,w.opts.ownProperties),()=>{v.setParams({missingProperty:(0,r._)`${y}`},!0),v.error()})}jn.checkReportMissingProp=a;function i({gen:v,data:y,it:{opts:E}},S,w){return(0,r.or)(...S.map(C=>(0,r.and)(u(v,y,C,E.ownProperties),(0,r._)`${w} = ${C}`)))}jn.checkMissingProp=i;function s(v,y){v.setParams({missingProperty:y},!0),v.error()}jn.reportMissingProp=s;function o(v){return v.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,r._)`Object.prototype.hasOwnProperty`})}jn.hasPropFunc=o;function l(v,y,E){return(0,r._)`${o(v)}.call(${y}, ${E})`}jn.isOwnProperty=l;function c(v,y,E,S){const w=(0,r._)`${y}${(0,r.getProperty)(E)} !== undefined`;return S?(0,r._)`${w} && ${l(v,y,E)}`:w}jn.propertyInData=c;function u(v,y,E,S){const w=(0,r._)`${y}${(0,r.getProperty)(E)} === undefined`;return S?(0,r.or)(w,(0,r.not)(l(v,y,E))):w}jn.noPropertyInData=u;function d(v){return v?Object.keys(v).filter(y=>y!=="__proto__"):[]}jn.allSchemaProperties=d;function h(v,y){return d(y).filter(E=>!(0,e.alwaysValidSchema)(v,y[E]))}jn.schemaProperties=h;function p({schemaCode:v,data:y,it:{gen:E,topSchemaRef:S,schemaPath:w,errorPath:C},it:x},N,I,D){const V=D?(0,r._)`${v}, ${y}, ${S}${w}`:y,q=[[t.default.instancePath,(0,r.strConcat)(t.default.instancePath,C)],[t.default.parentData,x.parentData],[t.default.parentDataProperty,x.parentDataProperty],[t.default.rootData,t.default.rootData]];x.opts.dynamicRef&&q.push([t.default.dynamicAnchors,t.default.dynamicAnchors]);const $=(0,r._)`${V}, ${E.object(...q)}`;return I!==r.nil?(0,r._)`${N}.call(${I}, ${$})`:(0,r._)`${N}(${$})`}jn.callValidateCode=p;const m=(0,r._)`new RegExp`;function g({gen:v,it:{opts:y}},E){const S=y.unicodeRegExp?"u":"",{regExp:w}=y.code,C=w(E,S);return v.scopeValue("pattern",{key:C.toString(),ref:C,code:(0,r._)`${w.code==="new RegExp"?m:(0,n.useFunc)(v,w)}(${E}, ${S})`})}jn.usePattern=g;function b(v){const{gen:y,data:E,keyword:S,it:w}=v,C=y.name("valid");if(w.allErrors){const N=y.let("valid",!0);return x(()=>y.assign(N,!1)),N}return y.var(C,!0),x(()=>y.break()),C;function x(N){const I=y.const("len",(0,r._)`${E}.length`);y.forRange("i",0,I,D=>{v.subschema({keyword:S,dataProp:D,dataPropType:e.Type.Num},C),y.if((0,r.not)(C),N)})}}jn.validateArray=b;function _(v){const{gen:y,schema:E,keyword:S,it:w}=v;if(!Array.isArray(E))throw new Error("ajv Line truncated
missingProperty: ${d},
depsCount: ${c},
deps: ${u}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:r.error,code(l){const[c,u]=i(l);s(l,c),o(l,u)}};function i({schema:l}){const c={},u={};for(const d in l){if(d==="__proto__")continue;const h=Array.isArray(l[d])?c:u;h[d]=l[d]}return[c,u]}function s(l,c=l.schema){const{gen:u,data:d,it:h}=l;if(Object.keys(c).length===0)return;const p=u.let("missing");for(const m in c){const g=c[m];if(g.length===0)continue;const b=(0,n.propertyInData)(u,d,m,h.opts.ownProperties);l.setParams({property:m,depsCount:g.length,deps:g.join(", ")}),h.allErrors?u.if(b,()=>{for(const _ of g)(0,n.checkReportMissingProp)(l,_)}):(u.if((0,e._)`${b} && (${(0,n.checkMissingProp)(l,g,p)})`),(0,n.reportMissingProp)(l,p),u.else())}}r.validatePropertyDeps=s;function o(l,c=l.schema){const{gen:u,data:d,keyword:h,it:p}=l,m=u.name("valid");for(const g in c)(0,t.alwaysValidSchema)(p,c[g])||(u.if((0,n.propertyInData)(u,d,g,p.opts.ownProperties),()=>{const b=l.subschema({keyword:h,schemaProp:g},m);l.mergeValidEvaluated(b,m)},()=>u.var(m,!0)),l.ok(m))}r.validateSchemaDeps=o,r.default=a}(CT)),CT}var x1={},zM;function T1e(){if(zM)return x1;zM=1,Object.defineProperty(x1,"__esModule",{value:!0});const r=pn(),e=zn(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:a})=>(0,r._)`{propertyName: ${a.propertyName}}`},code(a){const{gen:i,schema:s,data:o,it:l}=a;if((0,e.alwaysValidSchema)(l,s))return;const c=i.name("valid");i.forIn("key",o,u=>{a.setParams({propertyName:u}),a.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},c),i.if((0,r.not)(c),()=>{a.error(!0),l.allErrors||i.break()})}),a.ok(c)}};return x1.default=n,x1}var R1={},qM;function WG(){if(qM)return R1;qM=1,Object.defineProperty(R1,"__esModule",{value:!0});const r=ll(),e=pn(),t=Qu(),n=zn(),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:s})=>(0,e._)`{additionalProperty: ${s.additionalProperty}}`},code(s){const{gen:o,schema:l,parentSchema:c,data:u,errsCount:d,it:h}=s;if(!d)throw new Error("ajv implementation error");const{allErrors:p,opts:m}=h;if(h.props=!0,m.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(h,l))return;const g=(0,r.allSchemaProperties)(c.properties),b=(0,r.allSchemaProperties)(c.patternProperties);_(),s.ok((0,e._)`${d} === ${t.default.errors}`);function _(){o.forIn("key",u,w=>{!g.length&&!b.length?E(w):o.if(v(w),()=>E(w))})}function v(w){let C;if(g.length>8){const x=(0,n.schemaRefOrVal)(h,c.properties,"properties");C=(0,r.isOwnProperty)(o,x,w)}else g.length?C=(0,e.or)(...g.map(x=>(0,e._)`${w} === ${x}`)):C=e.nil;return b.length&&(C=(0,e.or)(C,...b.map(x=>(0,e._)`${(0,r.usePattern)(s,x)}.test(${w})`))),(0,e.not)(C)}function y(w){o.code((0,e._)`delete ${u}[${w}]`)}function E(w){if(m.removeAdditional==="all"||m.removeAdditional&&l===!1){y(w);return}if(l===!1){s.setParams({additionalProperty:w}),s.error(),p||o.break();return}if(typeof l=="object"&&!(0,n.alwaysValidSchema)(h,l)){const C=o.name("valid");m.removeAdditional==="failing"?(S(w,C,!1),o.if((0,e.not)(C),()=>{s.reset(),y(w)})):(S(w,C),p||o.if((0,e.not)(C),()=>o.break()))}}function S(w,C,x){const N={keyword:"additionalProperties",dataProp:w,dataPropType:n.Type.Str};x===!1&&Object.assign(N,{compositeRule:!0,createErrors:!1,allErrors:!1}),s.subschema(N,C)}}};return R1.default=i,R1}var O1={},HM;function C1e(){if(HM)return O1;HM=1,Object.defineProperty(O1,"__esModule",{value:!0});const r=ay(),e=ll(),t=zn(),n=WG(),a={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:s,schema:o,parentSchema:l,data:c,it:u}=i;u.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&n.default.code(new r.KeywordCxt(u,n.default,"additionalProperties"));const d=(0,e.allSchemaProperties)(o);for(const b of d)u.definedProperties.add(b);u.opts.unevaluated&&d.length&&u.props!==!0&&(u.props=t.mergeEvaluated.props(s,(0,t.toHash)(d),u.props));const h=d.filter(b=>!(0,t.alwaysValidSchema)(u,o[b]));if(h.length===0)return;const p=s.name("valid");for(const b of h)m(b)?g(b):(s.if((0,e.propertyInData)(s,c,b,u.opts.ownProperties)),g(b),u.allErrors||s.else().var(p,!0),s.endIf()),i.it.definedProperties.add(b),i.ok(p);function m(b){return u.opts.useDefaults&&!u.compositeRule&&o[b].default!==void 0}function g(b){i.subschema({keyword:"properties",schemaProp:b,dataProp:b},p)}}};return O1.default=a,O1}var N1={},VM;function A1e(){if(VM)return N1;VM=1,Object.defineProperty(N1,"__esModule",{value:!0});const r=ll(),e=pn(),t=zn(),n=zn(),a={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:s,schema:o,data:l,parentSchema:c,it:u}=i,{opts:d}=u,h=(0,r.allSchemaProperties)(o),p=h.filter(E=>(0,t.alwaysValidSchema)(u,o[E]));if(h.length===0||p.length===h.length&&(!u.opts.unevaluated||u.props===!0))return;const m=d.strictSchema&&!d.allowMatch Line truncated
deps: ${u}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:r.error,code(l){const[c,u]=i(l);s(l,c),o(l,u)}};function i({schema:l}){const c={},u={};for(const d in l){if(d==="__proto__")continue;const h=Array.isArray(l[d])?c:u;h[d]=l[d]}return[c,u]}function s(l,c=l.schema){const{gen:u,data:d,it:h}=l;if(Object.keys(c).length===0)return;const p=u.let("missing");for(const m in c){const g=c[m];if(g.length===0)continue;const b=(0,n.propertyInData)(u,d,m,h.opts.ownProperties);l.setParams({property:m,depsCount:g.length,deps:g.join(", ")}),h.allErrors?u.if(b,()=>{for(const _ of g)(0,n.checkReportMissingProp)(l,_)}):(u.if((0,e._)`${b} && (${(0,n.checkMissingProp)(l,g,p)})`),(0,n.reportMissingProp)(l,p),u.else())}}r.validatePropertyDeps=s;function o(l,c=l.schema){const{gen:u,data:d,keyword:h,it:p}=l,m=u.name("valid");for(const g in c)(0,t.alwaysValidSchema)(p,c[g])||(u.if((0,n.propertyInData)(u,d,g,p.opts.ownProperties),()=>{const b=l.subschema({keyword:h,schemaProp:g},m);l.mergeValidEvaluated(b,m)},()=>u.var(m,!0)),l.ok(m))}r.validateSchemaDeps=o,r.default=a}(CT)),CT}var x1={},zM;function T1e(){if(zM)return x1;zM=1,Object.defineProperty(x1,"__esModule",{value:!0});const r=pn(),e=zn(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:a})=>(0,r._)`{propertyName: ${a.propertyName}}`},code(a){const{gen:i,schema:s,data:o,it:l}=a;if((0,e.alwaysValidSchema)(l,s))return;const c=i.name("valid");i.forIn("key",o,u=>{a.setParams({propertyName:u}),a.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},c),i.if((0,r.not)(c),()=>{a.error(!0),l.allErrors||i.break()})}),a.ok(c)}};return x1.default=n,x1}var R1={},qM;function WG(){if(qM)return R1;qM=1,Object.defineProperty(R1,"__esModule",{value:!0});const r=ll(),e=pn(),t=Zu(),n=zn(),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:s})=>(0,e._)`{additionalProperty: ${s.additionalProperty}}`},code(s){const{gen:o,schema:l,parentSchema:c,data:u,errsCount:d,it:h}=s;if(!d)throw new Error("ajv implementation error");const{allErrors:p,opts:m}=h;if(h.props=!0,m.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(h,l))return;const g=(0,r.allSchemaProperties)(c.properties),b=(0,r.allSchemaProperties)(c.patternProperties);_(),s.ok((0,e._)`${d} === ${t.default.errors}`);function _(){o.forIn("key",u,w=>{!g.length&&!b.length?E(w):o.if(v(w),()=>E(w))})}function v(w){let C;if(g.length>8){const x=(0,n.schemaRefOrVal)(h,c.properties,"properties");C=(0,r.isOwnProperty)(o,x,w)}else g.length?C=(0,e.or)(...g.map(x=>(0,e._)`${w} === ${x}`)):C=e.nil;return b.length&&(C=(0,e.or)(C,...b.map(x=>(0,e._)`${(0,r.usePattern)(s,x)}.test(${w})`))),(0,e.not)(C)}function y(w){o.code((0,e._)`delete ${u}[${w}]`)}function E(w){if(m.removeAdditional==="all"||m.removeAdditional&&l===!1){y(w);return}if(l===!1){s.setParams({additionalProperty:w}),s.error(),p||o.break();return}if(typeof l=="object"&&!(0,n.alwaysValidSchema)(h,l)){const C=o.name("valid");m.removeAdditional==="failing"?(S(w,C,!1),o.if((0,e.not)(C),()=>{s.reset(),y(w)})):(S(w,C),p||o.if((0,e.not)(C),()=>o.break()))}}function S(w,C,x){const N={keyword:"additionalProperties",dataProp:w,dataPropType:n.Type.Str};x===!1&&Object.assign(N,{compositeRule:!0,createErrors:!1,allErrors:!1}),s.subschema(N,C)}}};return R1.default=i,R1}var O1={},HM;function C1e(){if(HM)return O1;HM=1,Object.defineProperty(O1,"__esModule",{value:!0});const r=ay(),e=ll(),t=zn(),n=WG(),a={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:s,schema:o,parentSchema:l,data:c,it:u}=i;u.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&n.default.code(new r.KeywordCxt(u,n.default,"additionalProperties"));const d=(0,e.allSchemaProperties)(o);for(const b of d)u.definedProperties.add(b);u.opts.unevaluated&&d.length&&u.props!==!0&&(u.props=t.mergeEvaluated.props(s,(0,t.toHash)(d),u.props));const h=d.filter(b=>!(0,t.alwaysValidSchema)(u,o[b]));if(h.length===0)return;const p=s.name("valid");for(const b of h)m(b)?g(b):(s.if((0,e.propertyInData)(s,c,b,u.opts.ownProperties)),g(b),u.allErrors||s.else().var(p,!0),s.endIf()),i.it.definedProperties.add(b),i.ok(p);function m(b){return u.opts.useDefaults&&!u.compositeRule&&o[b].default!==void 0}function g(b){i.subschema({keyword:"properties",schemaProp:b,dataProp:b},p)}}};return O1.default=a,O1}var N1={},VM;function A1e(){if(VM)return N1;VM=1,Object.defineProperty(N1,"__esModule",{value:!0});const r=ll(),e=pn(),t=zn(),n=zn(),a={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:s,schema:o,data:l,parentSchema:c,it:u}=i,{opts:d}=u,h=(0,r.allSchemaProperties)(o),p=h.filter(E=>(0,t.alwaysValidSchema)(u,o[E]));if(h.length===0||p.length===h.length&&(!u.opts.unevaluated||u.props===!0))return;const m=d.strictSchema&&!d.allowMatch Line truncated
`;break;case"id":o=b.includes("\0")?void 0:b;break;case"retry":/^\d+$/.test(b)?n(parseInt(b,10)):t(new uD(`Invalid \`retry\` value: "${b}"`,{type:"invalid-retry",value:b,line:_}));break;default:t(new uD(`Unknown field "${g.length>20?`${g.slice(0,20)}…`:g}"`,{type:"unknown-field",field:g,value:b,line:_}));break}}function p(){l.length>0&&e({id:o,event:c||void 0,data:l.endsWith(`
`)?l.slice(0,-1):l}),o=void 0,l="",c=""}function m(g={}){i&&g.consume&&d(i),s=!0,o=void 0,l="",c="",i=""}return{feed:u,reset:m}}function $_e(r){const e=[];let t="",n=0;for(;n<r.length;){const a=r.indexOf("\r",n),i=r.indexOf(`
`,n);let s=-1;if(a!==-1&&i!==-1?s=Math.min(a,i):a!==-1?a===r.length-1?s=-1:s=a:i!==-1&&(s=i),s===-1){t=r.slice(n);break}else{const o=r.slice(n,s);e.push(o),n=s+1,r[n-1]==="\r"&&r[n]===`
`&&n++}}return[e,t]}class G_e extends TransformStream{constructor({onError:e,onRetry:t,onComment:n}={}){let a;super({start(i){a=ZG({onEvent:s=>{i.enqueue(s)},onError(s){e==="terminate"?i.error(s):typeof e=="function"&&e(s)},onRetry:t,onComment:n})},transform(i){a.feed(i)}})}}const z_e={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class Nd extends Error{constructor(e,t){super(`Streamable HTTP error: ${t}`),this.code=e}}class q_e{constructor(e,t){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._fetchWithInit=jG(t?.fetch,t?.requestInit),this._sessionId=t?.sessionId,this._reconnectionOptions=t?.reconnectionOptions??z_e}async _authThenStart(){if(!this._authProvider)throw new jo("No auth provider");let e;try{e=await Bd(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(t){throw this.onerror?.(t),t}if(e!=="AUTHORIZED")throw new jo;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){const e={};if(this._authProvider){const n=await this._authProvider.tokens();n&&(e.Authorization=`Bearer ${n.access_token}`)}this._sessionId&&(e["mcp-session-id"]=this._sessionId),this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);const t=wb(this._requestInit?.headers);return new Headers({...e,...t})}async _startOrAuthSse(e){const{resumptionToken:t}=e;try{const n=await this._commonHeaders();n.set("Accept","text/event-stream"),t&&n.set("last-event-id",t);const a=await(this._fetch??fetch)(this._url,{method:"GET",headers:n,signal:this._abortController?.signal});if(!a.ok){if(await a.body?.cancel(),a.status===401&&this._authProvider)return await this._authThenStart();if(a.status===405)return;throw new Nd(a.status,`Failed to open SSE stream: ${a.statusText}`)}this._handleSseStream(a.body,e,!0)}catch(n){throw this.onerror?.(n),n}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;const t=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,a=this._reconnectionOptions.maxReconnectionDelay;return Math.min(t*Math.pow(n,e),a)}_scheduleReconnection(e,t=0){const n=this._reconnectionOptions.maxRetries;if(t>=n){this.onerror?.(new Error(`Maximum reconnection attempts (${n}) exceeded.`));return}const a=this._getNextReconnectionDelay(t);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(i=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${i instanceof Error?i.message:String(i)}`)),this._scheduleReconnection(e,t+1)})},a)}_handleSseStream(e,t,n){if(!e)return;const{onresumptiontoken:a,replayMessageId:i}=t;let s,o=!1,l=!1;(async()=>{try{const u=e.pipeThrough(new TextDecoderStream).pipeThrough(new G_e({onRetry:p=>{this._serverRetryMs=p}})).getReader();for(;;){const{value:p,done:m}=await u.read();if(m)break;if(p.id&&(s=p.id,o=!0,a?.(p.id)),!!p.data&&(!p.event||p.event==="message"))try{const g=im.parse(JSON.parse(p.data));Wp(g)&&(l=!0,i!==void 0&&(g.id=i)),this.onmessage?.(g)}catch(g){this.onerror?.(g)}}(n||o)&&!l&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:s,onresumptiontoken:a,replayMessageId:i},0)}catch(u){if(this.onerror?.(new Error(`SSE stream disconnected: ${u}`)),(n||o)&&!l&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:s,onresumptiontoken:a,replayMessageId:i},0)}catch(p){this.onerror?.(new Error(`Failed to reconnect: ${p instanceof Error?p.message:String(p)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new jo("No auth provider");if(await Bd(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new jo("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(e,t){try{const{resumptionToken:n,onresumptiontoken:a}=t||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:w3(e)?e.id:void 0}).catch(h=>this.onerror?.(h));return}const i=await this._commonHeaders();i.set("content-type","application/json"),i.set("accept","application/json, text/event-stream");const s={...this._requestInit,method:"POST",headers:i,body:JSON.stringify(e),signal:this._abortController?.signal},o=await(this._fetch??fetch)(this._url,s),l=o.headers.get("mcp-session-id");if(l&&(this._sessionId=l),!o.ok){const h=await o.t Line truncated
`&&n++}}return[e,t]}class G_e extends TransformStream{constructor({onError:e,onRetry:t,onComment:n}={}){let a;super({start(i){a=ZG({onEvent:s=>{i.enqueue(s)},onError(s){e==="terminate"?i.error(s):typeof e=="function"&&e(s)},onRetry:t,onComment:n})},transform(i){a.feed(i)}})}}const z_e={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class Nd extends Error{constructor(e,t){super(`Streamable HTTP error: ${t}`),this.code=e}}class q_e{constructor(e,t){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._fetchWithInit=jG(t?.fetch,t?.requestInit),this._sessionId=t?.sessionId,this._reconnectionOptions=t?.reconnectionOptions??z_e}async _authThenStart(){if(!this._authProvider)throw new jo("No auth provider");let e;try{e=await Bd(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(t){throw this.onerror?.(t),t}if(e!=="AUTHORIZED")throw new jo;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){const e={};if(this._authProvider){const n=await this._authProvider.tokens();n&&(e.Authorization=`Bearer ${n.access_token}`)}this._sessionId&&(e["mcp-session-id"]=this._sessionId),this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);const t=wb(this._requestInit?.headers);return new Headers({...e,...t})}async _startOrAuthSse(e){const{resumptionToken:t}=e;try{const n=await this._commonHeaders();n.set("Accept","text/event-stream"),t&&n.set("last-event-id",t);const a=await(this._fetch??fetch)(this._url,{method:"GET",headers:n,signal:this._abortController?.signal});if(!a.ok){if(await a.body?.cancel(),a.status===401&&this._authProvider)return await this._authThenStart();if(a.status===405)return;throw new Nd(a.status,`Failed to open SSE stream: ${a.statusText}`)}this._handleSseStream(a.body,e,!0)}catch(n){throw this.onerror?.(n),n}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;const t=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,a=this._reconnectionOptions.maxReconnectionDelay;return Math.min(t*Math.pow(n,e),a)}_scheduleReconnection(e,t=0){const n=this._reconnectionOptions.maxRetries;if(t>=n){this.onerror?.(new Error(`Maximum reconnection attempts (${n}) exceeded.`));return}const a=this._getNextReconnectionDelay(t);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(i=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${i instanceof Error?i.message:String(i)}`)),this._scheduleReconnection(e,t+1)})},a)}_handleSseStream(e,t,n){if(!e)return;const{onresumptiontoken:a,replayMessageId:i}=t;let s,o=!1,l=!1;(async()=>{try{const u=e.pipeThrough(new TextDecoderStream).pipeThrough(new G_e({onRetry:p=>{this._serverRetryMs=p}})).getReader();for(;;){const{value:p,done:m}=await u.read();if(m)break;if(p.id&&(s=p.id,o=!0,a?.(p.id)),!!p.data&&(!p.event||p.event==="message"))try{const g=im.parse(JSON.parse(p.data));Wp(g)&&(l=!0,i!==void 0&&(g.id=i)),this.onmessage?.(g)}catch(g){this.onerror?.(g)}}(n||o)&&!l&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:s,onresumptiontoken:a,replayMessageId:i},0)}catch(u){if(this.onerror?.(new Error(`SSE stream disconnected: ${u}`)),(n||o)&&!l&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:s,onresumptiontoken:a,replayMessageId:i},0)}catch(p){this.onerror?.(new Error(`Failed to reconnect: ${p instanceof Error?p.message:String(p)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new jo("No auth provider");if(await Bd(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new jo("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(e,t){try{const{resumptionToken:n,onresumptiontoken:a}=t||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:w3(e)?e.id:void 0}).catch(h=>this.onerror?.(h));return}const i=await this._commonHeaders();i.set("content-type","application/json"),i.set("accept","application/json, text/event-stream");const s={...this._requestInit,method:"POST",headers:i,body:JSON.stringify(e),signal:this._abortController?.signal},o=await(this._fetch??fetch)(this._url,s),l=o.headers.get("mcp-session-id");if(l&&(this._sessionId=l),!o.ok){const h=await o.t Line truncated
`):""}static formatSingleContent(e){if(e.type===v_.TEXT&&e.text)return e.text;if(e.type===v_.IMAGE&&e.data)return hb(e.mimeType??One,e.data);if(e.type===v_.RESOURCE&&e.resource){const t=e.resource;return t.text?t.text:t.blob?t.blob:JSON.stringify(t)}return e.data&&e.mimeType?hb(e.mimeType,e.data):JSON.stringify(e)}static async complete(e,t,n){try{return(await e.client.complete({ref:t,argument:n})).completion}catch(a){return console.error("[MCPService] Failed to get completions:",a),null}}static async listResources(e,t){try{const n=await e.client.listResources(t?{cursor:t}:void 0);return{resources:n.resources??[],nextCursor:n.nextCursor}}catch(n){if(this.isSessionExpiredError(n))throw n;return console.warn(`[MCPService][${e.serverName}] Failed to list resources:`,n),{resources:[]}}}static async listAllResources(e){const t=[];let n;do{const a=await this.listResources(e,n);t.push(...a.resources),n=a.nextCursor}while(n);return t}static async listResourceTemplates(e,t){try{const n=await e.client.listResourceTemplates(t?{cursor:t}:void 0);return{resourceTemplates:n.resourceTemplates??[],nextCursor:n.nextCursor}}catch(n){if(this.isSessionExpiredError(n))throw n;return console.warn(`[MCPService][${e.serverName}] Failed to list resource templates:`,n),{resourceTemplates:[]}}}static async listAllResourceTemplates(e){const t=[];let n;do{const a=await this.listResourceTemplates(e,n);t.push(...a.resourceTemplates),n=a.nextCursor}while(n);return t}static async readResource(e,t){try{const n=await e.client.readResource({uri:t});return{contents:n.contents??[],_meta:n._meta}}catch(n){throw console.error(`[MCPService][${e.serverName}] Failed to read resource:`,n),n}}static async subscribeResource(e,t){try{await e.client.subscribeResource({uri:t}),console.log(`[MCPService][${e.serverName}] Subscribed to resource: ${t}`)}catch(n){throw console.error(`[MCPService][${e.serverName}] Failed to subscribe to resource:`,n),n}}static async unsubscribeResource(e,t){try{await e.client.unsubscribeResource({uri:t}),console.log(`[MCPService][${e.serverName}] Unsubscribed from resource: ${t}`)}catch(n){throw console.error(`[MCPService][${e.serverName}] Failed to unsubscribe from resource:`,n),n}}static supportsResources(e){return e.serverCapabilities?.resources!==void 0}static supportsResourceSubscriptions(e){return!!e.serverCapabilities?.resources?.subscribe}}function X_e(){return`${Wne}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}class Q_e{#e=_e(Sr(new Oi));get _serverResources(){return f(this.#e)}set _serverResources(e){M(this.#e,e,!0)}#t=_e(Sr(new Oi));get _cachedResources(){return f(this.#t)}set _cachedResources(e){M(this.#t,e,!0)}#r=_e(Sr(new Oi));get _subscriptions(){return f(this.#r)}set _subscriptions(e){M(this.#r,e,!0)}#n=_e(Sr([]));get _attachments(){return f(this.#n)}set _attachments(e){M(this.#n,e,!0)}#i=_e(!1);get _isLoading(){return f(this.#i)}set _isLoading(e){M(this.#i,e,!0)}get serverResources(){return this._serverResources}get cachedResources(){return this._cachedResources}get subscriptions(){return this._subscriptions}get attachments(){return this._attachments}get isLoading(){return this._isLoading}get totalResourceCount(){let e=0;for(const t of this._serverResources.values())e+=t.resources.length;return e}get totalTemplateCount(){let e=0;for(const t of this._serverResources.values())e+=t.templates.length;return e}get attachmentCount(){return this._attachments.length}get hasAttachments(){return this._attachments.length>0}setServerResources(e,t,n){this._serverResources.set(e,{serverName:e,resources:t,templates:n,lastFetched:new Date,loading:!1,error:void 0}),console.log(`[MCPResources][${e}] Set ${t.length} resources, ${n.length} templates`)}setServerLoading(e,t){const n=this._serverResources.get(e);n?this._serverResources.set(e,{...n,loading:t}):this._serverResources.set(e,{serverName:e,resources:[],templates:[],loading:t,error:void 0})}setServerError(e,t){const n=this._serverResources.get(e);n?this._serverResources.set(e,{...n,loading:!1,error:t}):this._serverResources.set(e,{serverName:e,resources:[],templates:[],loading:!1,error:t})}getServerResources(e){return this._serverResources.get(e)}getAllResourceInfos(){const e=[];for(const[t,n]of this._serverResources)for(const a of n.resources)e.push({uri:a.uri,name:a.name,title:a.title,description:a.description,mimeType:a.mimeType,serverName:t,annotations:a.annotations,icons:a.icons});return e}getAllTemplateInfos(){const e=[];for(const[t,n]of this._serverResources)for(const a of n.templates)e.push({uriTemplate:a.uriTemplate,name:a.name,title:a.title,description:a.description,mimeType:a.mimeType,serverName:t,annotations:a.annotations,icons:a.icons});return e}clearServerResources(e){this._serverResources.delete(e);for(const[t,n]of this._cachedResources)n.resource.serverName===e&&this._cachedResources.delete(t);for(const[t,n]of this._subscriptions)n.serverName===e&&this._subscriptions.delete(t);console.log(`[MCPResources][${e}] Cleared all resources`)}cacheReso Line truncated
--- Resource: ${n} (from ${a}) ---
${i.text}`):"blob"in i&&i.blob&&e.push(`
--- Resource: ${n} (from ${a}) ---
[${gO}: ${i.mimeType||mO}]`)}return e.join("")}toMessageExtras(){const e=[];for(const t of this._attachments){if(t.error||!t.content||t.content.length===0)continue;const n=t.resource.title||t.resource.name,a=[];for(const i of t.content)"text"in i&&i.text?a.push(i.text):"blob"in i&&i.blob&&a.push(`[${gO}: ${i.mimeType||mO}]`);a.length>0&&e.push({type:Kr.MCP_RESOURCE,name:n,uri:t.resource.uri,serverName:t.resource.serverName,content:a.join(ob),mimeType:t.resource.mimeType})}return e}}const _n=new Q_e,ez=()=>_n.serverResources,Z_e=()=>_n.attachments,tz=()=>_n.hasAttachments,J_e=()=>_n.totalResourceCount,ebe=()=>_n.isLoading,rz=typeof window<"u"?window:void 0;function tbe(r){let e=r.activeElement;for(;e?.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}let rbe=class{#e;#t;constructor(e={}){const{window:t=rz,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=Yu(a=>{const i=jr(t,"focusin",a),s=jr(t,"focusout",a);return()=>{i(),s()}}))}get current(){return this.#t?.(),this.#e?tbe(this.#e):null}};new rbe;function nbe(r,e){switch(r){case"post":Nt(e);break;case"pre":Gi(e);break}}function nz(r,e,t,n={}){const{lazy:a=!1}=n;let i=!a,s=Array.isArray(r)?[]:void 0;nbe(e,()=>{const o=Array.isArray(r)?r.map(c=>c()):r();if(!i){i=!0,s=o;return}const l=Rn(()=>t(o,s));return s=o,l})}function ux(r,e,t){nz(r,"post",e,t)}function abe(r,e,t){nz(r,"pre",e,t)}ux.pre=abe;function ibe(r,e){switch(r){case"local":return e.localStorage;case"session":return e.sessionStorage}}class az{#e;#t;#r;#n;#i;#a=_e(0);constructor(e,t,n={}){const{storage:a="local",serializer:i={serialize:JSON.stringify,deserialize:JSON.parse},syncTabs:s=!0,window:o=rz}=n;if(this.#e=t,this.#t=e,this.#r=i,o===void 0)return;const l=ibe(a,o);this.#n=l;const c=l.getItem(e);c!==null?this.#e=this.#o(c):this.#l(t),s&&a==="local"&&(this.#i=Yu(()=>jr(o,"storage",this.#s)))}get current(){this.#i?.(),f(this.#a);const e=this.#o(this.#n?.getItem(this.#t))??this.#e,t=new WeakMap,n=a=>{if(a===null||a?.constructor.name==="Date"||typeof a!="object")return a;let i=t.get(a);return i||(i=new Proxy(a,{get:(s,o)=>(f(this.#a),n(Reflect.get(s,o))),set:(s,o,l)=>(M(this.#a,f(this.#a)+1),Reflect.set(s,o,l),this.#l(e),!0)}),t.set(a,i)),i};return n(e)}set current(e){this.#l(e),M(this.#a,f(this.#a)+1)}#s=e=>{e.key!==this.#t||e.newValue===null||(this.#e=this.#o(e.newValue),M(this.#a,f(this.#a)+1))};#o(e){try{return this.#r.deserialize(e)}catch(t){console.error(`Error when parsing "${e}" from persisted store "${this.#t}"`,t);return}}#l(e){try{e!=null&&this.#n?.setItem(this.#t,this.#r.serialize(e))}catch(t){console.error(`Error when writing value from persisted store "${this.#t}" to ${this.#n}`,t)}}}function pD(r){return r.filter(e=>e.length>0)}const iz={getItem:r=>null,setItem:(r,e)=>{}},yg=typeof document<"u";function sbe(r){return typeof r=="function"}function obe(r){return r!==null&&typeof r=="object"}const Mm=Symbol("box"),dx=Symbol("is-writable");function lbe(r){return obe(r)&&Mm in r}function cbe(r){return Qa.isBox(r)&&dx in r}function Qa(r){let e=_e(Sr(r));return{[Mm]:!0,[dx]:!0,get current(){return f(e)},set current(t){M(e,t,!0)}}}function ube(r,e){const t=F(r);return e?{[Mm]:!0,[dx]:!0,get current(){return f(t)},set current(n){e(n)}}:{[Mm]:!0,get current(){return r()}}}function dbe(r){return Qa.isBox(r)?r:sbe(r)?Qa.with(r):Qa(r)}function hbe(r){return Object.entries(r).reduce((e,[t,n])=>Qa.isBox(n)?(Qa.isWritableBox(n)?Object.defineProperty(e,t,{get(){return n.current},set(a){n.current=a}}):Object.defineProperty(e,t,{get(){return n.current}}),e):Object.assign(e,{[t]:n}),{})}function fbe(r){return Qa.isWritableBox(r)?{[Mm]:!0,get current(){return r.current}}:r}Qa.from=dbe;Qa.with=ube;Qa.flatten=hbe;Qa.readonly=fbe;Qa.isBox=lbe;Qa.isWritableBox=cbe;function pbe(r,e){const t=RegExp(r,"g");return n=>{if(typeof n!="string")throw new TypeError(`expected an argument of type string, but got ${typeof n}`);return n.match(t)?n.replace(t,e):n}}const mbe=pbe(/[A-Z]/,r=>`-${r.toLowerCase()}`);function gbe(r){if(!r||typeof r!="object"||Array.isArray(r))throw new TypeError(`expected an argument of type object, but got ${typeof r}`);return Object.keys(r).map(e=>`${mbe(e)}: ${r[e]};`).join(`
[${gO}: ${i.mimeType||mO}]`)}return e.join("")}toMessageExtras(){const e=[];for(const t of this._attachments){if(t.error||!t.content||t.content.length===0)continue;const n=t.resource.title||t.resource.name,a=[];for(const i of t.content)"text"in i&&i.text?a.push(i.text):"blob"in i&&i.blob&&a.push(`[${gO}: ${i.mimeType||mO}]`);a.length>0&&e.push({type:Kr.MCP_RESOURCE,name:n,uri:t.resource.uri,serverName:t.resource.serverName,content:a.join(ob),mimeType:t.resource.mimeType})}return e}}const _n=new Q_e,ez=()=>_n.serverResources,Z_e=()=>_n.attachments,tz=()=>_n.hasAttachments,J_e=()=>_n.totalResourceCount,ebe=()=>_n.isLoading,rz=typeof window<"u"?window:void 0;function tbe(r){let e=r.activeElement;for(;e?.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}let rbe=class{#e;#t;constructor(e={}){const{window:t=rz,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=Wu(a=>{const i=jr(t,"focusin",a),s=jr(t,"focusout",a);return()=>{i(),s()}}))}get current(){return this.#t?.(),this.#e?tbe(this.#e):null}};new rbe;function nbe(r,e){switch(r){case"post":Nt(e);break;case"pre":Gi(e);break}}function nz(r,e,t,n={}){const{lazy:a=!1}=n;let i=!a,s=Array.isArray(r)?[]:void 0;nbe(e,()=>{const o=Array.isArray(r)?r.map(c=>c()):r();if(!i){i=!0,s=o;return}const l=Rn(()=>t(o,s));return s=o,l})}function ux(r,e,t){nz(r,"post",e,t)}function abe(r,e,t){nz(r,"pre",e,t)}ux.pre=abe;function ibe(r,e){switch(r){case"local":return e.localStorage;case"session":return e.sessionStorage}}class az{#e;#t;#r;#n;#i;#a=_e(0);constructor(e,t,n={}){const{storage:a="local",serializer:i={serialize:JSON.stringify,deserialize:JSON.parse},syncTabs:s=!0,window:o=rz}=n;if(this.#e=t,this.#t=e,this.#r=i,o===void 0)return;const l=ibe(a,o);this.#n=l;const c=l.getItem(e);c!==null?this.#e=this.#o(c):this.#l(t),s&&a==="local"&&(this.#i=Wu(()=>jr(o,"storage",this.#s)))}get current(){this.#i?.(),f(this.#a);const e=this.#o(this.#n?.getItem(this.#t))??this.#e,t=new WeakMap,n=a=>{if(a===null||a?.constructor.name==="Date"||typeof a!="object")return a;let i=t.get(a);return i||(i=new Proxy(a,{get:(s,o)=>(f(this.#a),n(Reflect.get(s,o))),set:(s,o,l)=>(M(this.#a,f(this.#a)+1),Reflect.set(s,o,l),this.#l(e),!0)}),t.set(a,i)),i};return n(e)}set current(e){this.#l(e),M(this.#a,f(this.#a)+1)}#s=e=>{e.key!==this.#t||e.newValue===null||(this.#e=this.#o(e.newValue),M(this.#a,f(this.#a)+1))};#o(e){try{return this.#r.deserialize(e)}catch(t){console.error(`Error when parsing "${e}" from persisted store "${this.#t}"`,t);return}}#l(e){try{e!=null&&this.#n?.setItem(this.#t,this.#r.serialize(e))}catch(t){console.error(`Error when writing value from persisted store "${this.#t}" to ${this.#n}`,t)}}}function pD(r){return r.filter(e=>e.length>0)}const iz={getItem:r=>null,setItem:(r,e)=>{}},yg=typeof document<"u";function sbe(r){return typeof r=="function"}function obe(r){return r!==null&&typeof r=="object"}const Mm=Symbol("box"),dx=Symbol("is-writable");function lbe(r){return obe(r)&&Mm in r}function cbe(r){return Qa.isBox(r)&&dx in r}function Qa(r){let e=_e(Sr(r));return{[Mm]:!0,[dx]:!0,get current(){return f(e)},set current(t){M(e,t,!0)}}}function ube(r,e){const t=F(r);return e?{[Mm]:!0,[dx]:!0,get current(){return f(t)},set current(n){e(n)}}:{[Mm]:!0,get current(){return r()}}}function dbe(r){return Qa.isBox(r)?r:sbe(r)?Qa.with(r):Qa(r)}function hbe(r){return Object.entries(r).reduce((e,[t,n])=>Qa.isBox(n)?(Qa.isWritableBox(n)?Object.defineProperty(e,t,{get(){return n.current},set(a){n.current=a}}):Object.defineProperty(e,t,{get(){return n.current}}),e):Object.assign(e,{[t]:n}),{})}function fbe(r){return Qa.isWritableBox(r)?{[Mm]:!0,get current(){return r.current}}:r}Qa.from=dbe;Qa.with=ube;Qa.flatten=hbe;Qa.readonly=fbe;Qa.isBox=lbe;Qa.isWritableBox=cbe;function pbe(r,e){const t=RegExp(r,"g");return n=>{if(typeof n!="string")throw new TypeError(`expected an argument of type string, but got ${typeof n}`);return n.match(t)?n.replace(t,e):n}}const mbe=pbe(/[A-Z]/,r=>`-${r.toLowerCase()}`);function gbe(r){if(!r||typeof r!="object"||Array.isArray(r))throw new TypeError(`expected an argument of type object, but got ${typeof r}`);return Object.keys(r).map(e=>`${mbe(e)}: ${r[e]};`).join(`
`)}function _be(r={}){return gbe(r).replace(`
`," ")}const bbe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"};_be(bbe);const vbe=typeof window<"u"?window:void 0;function ybe(r){let e=r.activeElement;for(;e?.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}class Sbe{#e;#t;constructor(e={}){const{window:t=vbe,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=Yu(a=>{const i=jr(t,"focusin",a),s=jr(t,"focusout",a);return()=>{i(),s()}}))}get current(){return this.#t?.(),this.#e?ybe(this.#e):null}}new Sbe;const Ud=Qa("mode-watcher-mode"),$d=Qa("mode-watcher-theme"),Ebe=["dark","light","system"];function H3(r){return typeof r!="string"?!1:Ebe.includes(r)}class wbe{#e="system";#t=yg?localStorage:iz;#r=this.#t.getItem(Ud.current);#n=H3(this.#r)?this.#r:this.#e;#i=_e(Sr(this.#a()));#a(e=this.#n){return new az(Ud.current,e,{serializer:{serialize:t=>t,deserialize:t=>H3(t)?t:this.#e}})}constructor(){jm(()=>ux.pre(()=>Ud.current,(e,t)=>{const n=f(this.#i).current;M(this.#i,this.#a(n),!0),t&&localStorage.removeItem(t)}))}get current(){return f(this.#i).current}set current(e){f(this.#i).current=e}}class Tbe{#e=void 0;#t=!0;#r=_e(Sr(this.#e));#n=typeof window<"u"&&typeof window.matchMedia=="function"?new kB("prefers-color-scheme: light"):{current:!1};query(){yg&&M(this.#r,this.#n.current?"light":"dark",!0)}tracking(e){this.#t=e}constructor(){jm(()=>{Gi(()=>{this.#t&&this.query()})}),this.query=this.query.bind(this),this.tracking=this.tracking.bind(this)}get current(){return f(this.#r)}}const V3=new wbe,Y3=new Tbe;class Cbe{#e=yg?localStorage:iz;#t=this.#e.getItem($d.current);#r=this.#t===null||this.#t===void 0?"":this.#t;#n=_e(Sr(this.#i()));#i(e=this.#r){return new az($d.current,e,{serializer:{serialize:t=>typeof t!="string"?"":t,deserialize:t=>t}})}constructor(){jm(()=>ux.pre(()=>$d.current,(e,t)=>{const n=f(this.#n).current;M(this.#n,this.#i(n),!0),t&&localStorage.removeItem(t)}))}get current(){return f(this.#n).current}set current(e){f(this.#n).current=e}}const C_=new Cbe;let mD,gD,_D=!1,Ip=null;function Abe(){return Ip||(Ip=document.createElement("style"),Ip.appendChild(document.createTextNode(`* {
`," ")}const bbe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"};_be(bbe);const vbe=typeof window<"u"?window:void 0;function ybe(r){let e=r.activeElement;for(;e?.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}class Sbe{#e;#t;constructor(e={}){const{window:t=vbe,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=Wu(a=>{const i=jr(t,"focusin",a),s=jr(t,"focusout",a);return()=>{i(),s()}}))}get current(){return this.#t?.(),this.#e?ybe(this.#e):null}}new Sbe;const Ud=Qa("mode-watcher-mode"),$d=Qa("mode-watcher-theme"),Ebe=["dark","light","system"];function H3(r){return typeof r!="string"?!1:Ebe.includes(r)}class wbe{#e="system";#t=yg?localStorage:iz;#r=this.#t.getItem(Ud.current);#n=H3(this.#r)?this.#r:this.#e;#i=_e(Sr(this.#a()));#a(e=this.#n){return new az(Ud.current,e,{serializer:{serialize:t=>t,deserialize:t=>H3(t)?t:this.#e}})}constructor(){jm(()=>ux.pre(()=>Ud.current,(e,t)=>{const n=f(this.#i).current;M(this.#i,this.#a(n),!0),t&&localStorage.removeItem(t)}))}get current(){return f(this.#i).current}set current(e){f(this.#i).current=e}}class Tbe{#e=void 0;#t=!0;#r=_e(Sr(this.#e));#n=typeof window<"u"&&typeof window.matchMedia=="function"?new kB("prefers-color-scheme: light"):{current:!1};query(){yg&&M(this.#r,this.#n.current?"light":"dark",!0)}tracking(e){this.#t=e}constructor(){jm(()=>{Gi(()=>{this.#t&&this.query()})}),this.query=this.query.bind(this),this.tracking=this.tracking.bind(this)}get current(){return f(this.#r)}}const V3=new wbe,Y3=new Tbe;class Cbe{#e=yg?localStorage:iz;#t=this.#e.getItem($d.current);#r=this.#t===null||this.#t===void 0?"":this.#t;#n=_e(Sr(this.#i()));#i(e=this.#r){return new az($d.current,e,{serializer:{serialize:t=>typeof t!="string"?"":t,deserialize:t=>t}})}constructor(){jm(()=>ux.pre(()=>$d.current,(e,t)=>{const n=f(this.#n).current;M(this.#n,this.#i(n),!0),t&&localStorage.removeItem(t)}))}get current(){return f(this.#n).current}set current(e){f(this.#n).current=e}}const C_=new Cbe;let mD,gD,_D=!1,Ip=null;function Abe(){return Ip||(Ip=document.createElement("style"),Ip.appendChild(document.createTextNode(`* {
-webkit-transition: none !important;
-moz-transition: none !important;
-o-transition: none !important;
-ms-transition: none !important;
transition: none !important;
}`)),Ip)}function sz(r,e=!1){if(typeof document>"u")return;if(!_D){_D=!0,r();return}if(typeof window<"u"&&window.__vitest_worker__){r();return}clearTimeout(mD),clearTimeout(gD);const n=Abe(),a=()=>document.head.appendChild(n),i=()=>{n.parentNode&&document.head.removeChild(n)};function s(){r(),window.requestAnimationFrame(i)}if(typeof window.requestAnimationFrame<"u"){a(),e?s():window.requestAnimationFrame(()=>{s()});return}a(),mD=window.setTimeout(()=>{r(),gD=window.setTimeout(i,16)},16)}const Eu=Qa(void 0),Nb=Qa(!0),Ib=Qa(!1),W3=Qa([]),j3=Qa([]);function xbe(){const r=F(()=>{if(!yg)return;const e=V3.current==="system"?Y3.current:V3.current,t=pD(W3.current),n=pD(j3.current);function a(){const i=document.documentElement,s=document.querySelector('meta[name="theme-color"]');e==="light"?(t.length&&i.classList.remove(...t),n.length&&i.classList.add(...n),i.style.colorScheme="light",s&&Eu.current&&s.setAttribute("content",Eu.current.light)):(n.length&&i.classList.remove(...n),t.length&&i.classList.add(...t),i.style.colorScheme="dark",s&&Eu.current&&s.setAttribute("content",Eu.current.dark))}return Nb.current?sz(a,Ib.current):a(),e});return{get current(){return f(r)}}}function Rbe(){const r=F(()=>{if(C_.current,!yg)return;function e(){document.documentElement.setAttribute("data-theme",C_.current)}return Nb.current?sz(e,Rn(()=>Ib.current)):e(),C_.current});return{get current(){return f(r)}}}const sy=xbe(),Obe=Rbe();function K3(r){V3.current=r}function Nbe(r){C_.current=r}function Ibe({defaultMode:r="system",themeColors:e,darkClassNames:t=["dark"],lightClassNames:n=[],defaultTheme:a="",modeStorageKey:i="mode-watcher-mode",themeStorageKey:s="mode-watcher-theme"}){const o=document.documentElement,l=localStorage.getItem(i)??r,c=localStorage.getItem(s)??a,u=l==="light"||l==="system"&&window.matchMedia("(prefers-color-scheme: light)").matches;if(u?(t.length&&o.classList.remove(...t.filter(Boolean)),n.length&&o.classList.add(...n.filter(Boolean))):(n.length&&o.classList.remove(...n.filter(Boolean)),t.length&&o.classList.add(...t.filter(Boolean))),o.style.colorScheme=u?"light":"dark",e){const d=document.querySelector('meta[name="theme-color"]');d&&d.setAttribute("content",l==="light"?e.light:e.dark)}c&&(o.setAttribute("data-theme",c),localStorage.setItem(s,c)),localStorage.setItem(i,l)}var kbe=G('<meta name="theme-color"/>');function Mbe(r,e){Ee(e,!0);var t=se(),n=L(t);{var a=i=>{var s=kbe();Ce(()=>er(s,"content",e.themeColors.dark)),T(i,s)};le(n,i=>{e.themeColors&&i(a)})}T(r,t),we()}var Dbe=G('<meta name="theme-color"/>'),Pbe=G("<!> <!>",1);function Lbe(r,e){Ee(e,!0);let t=Y(e,"trueNonce",3,"");lv("1funsus",n=>{var a=Pbe(),i=L(a);{var s=l=>{var c=Dbe();Ce(()=>er(c,"content",e.themeColors.dark)),T(l,c)};le(i,l=>{e.themeColors&&l(s)})}var o=ee(i,2);nf(o,()=>`<script${t()?` nonce=${t()}`:""}>(`+Ibe.toString()+")("+JSON.stringify(e.initConfig)+");<\/script>"),T(n,a)}),we()}function Fbe(r,e){Ee(e,!0);let t=Y(e,"track",3,!0),n=Y(e,"defaultMode",3,"system"),a=Y(e,"disableTransitions",3,!0),i=Y(e,"darkClassNames",19,()=>["dark"]),s=Y(e,"lightClassNames",19,()=>[]),o=Y(e,"defaultTheme",3,""),l=Y(e,"nonce",3,""),c=Y(e,"themeStorageKey",3,"mode-watcher-theme"),u=Y(e,"modeStorageKey",3,"mode-watcher-mode"),d=Y(e,"disableHeadScriptInjection",3,!1),h=Y(e,"synchronousModeChanges",3,!1);Ud.current=u(),$d.current=c(),W3.current=i(),j3.current=s(),Nb.current=a(),Eu.current=e.themeColors,Ib.current=h(),Gi(()=>{Ib.current=h()}),Gi(()=>{Nb.current=a()}),Gi(()=>{Eu.current=e.themeColors}),Gi(()=>{W3.current=i()}),Gi(()=>{j3.current=s()}),Gi(()=>{Ud.current=u()}),Gi(()=>{$d.current=c()}),Gi(()=>{sy.current,Ud.current,$d.current,Obe.current}),bi(()=>{Y3.tracking(t()),Y3.query();const y=localStorage.getItem(Ud.current);K3(H3(y)?y:n());const E=localStorage.getItem($d.current);Nbe(E||o())});const p={defaultMode:n(),themeColors:e.themeColors,darkClassNames:i(),lightClassNames:s(),defaultTheme:o(),modeStorageKey:u(),themeStorageKey:c()},m=F(()=>typeof window>"u"?l():"");var g=se(),b=L(g);{var _=y=>{Mbe(y,{get themeColors(){return Eu.current}})},v=y=>{Lbe(y,{get trueNonce(){return f(m)},get initConfig(){return p},get themeColors(){return Eu.current}})};le(b,y=>{d()?y(_):y(v,!1)})}T(r,g),we()}class Bbe{#e=_e(!1);get _isInitializing(){return f(this.#e)}set _isInitializing(e){M(this.#e,e,!0)}#t=_e(null);get _error(){return f(this.#t)}set _error(e){M(this.#t,e,!0)}#r=_e(0);get _toolCount(){return f(this.#r)}set _toolCount(e){M(this.#r,e,!0)}#n=_e(Sr([]));get _connectedServers(){return f(this.#n)}set _connectedServers(e){M(this.#n,e,!0)}#i=_e(Sr({}));get _healthChecks(){return f(this.#i)}set _healthChecks(e){M(this.#i,e,!0)}#a=_e(!1);get _proxyAvailable(){return f(this.#a)}set _proxyAvailable(e){M(this.#a,e,!0)}connections=new Map;toolsIndex=new Map;serverConfigs=new Map;reconnectingServers=new Set;configSignature=null;initPromise=null;activeFlowCount=0;constructor(){this.probeProxy()}async probeProxy(){try{const e=await fetch(`${Ga}${zU}`,{method:"HEAD" Line truncated
`);return e.join("")}}function Xp(r,e){const t=e?URL.parse(r,e):URL.parse(r);return t?.protocol==="http:"||t?.protocol==="https:"}function ko(r){r.preventDefault()}function ja(r){r.preventDefault(),r.stopPropagation()}function fve(r){console.log("Deprecated API usage: "+r)}class rA{static#e;static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!="string")return null;this.#e||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const t=this.#e.exec(e);if(!t)return null;const n=parseInt(t[1],10);let a=parseInt(t[2],10);a=a>=1&&a<=12?a-1:0;let i=parseInt(t[3],10);i=i>=1&&i<=31?i:1;let s=parseInt(t[4],10);s=s>=0&&s<=23?s:0;let o=parseInt(t[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(t[6],10);l=l>=0&&l<=59?l:0;const c=t[7]||"Z";let u=parseInt(t[8],10);u=u>=0&&u<=23?u:0;let d=parseInt(t[9],10)||0;return d=d>=0&&d<=59?d:0,c==="-"?(s+=u,o+=d):c==="+"&&(s-=u,o-=d),new Date(Date.UTC(n,a,i,s,o,l))}}function pve(r,{scale:e=1,rotation:t=0}){const{width:n,height:a}=r.attributes.style,i=[0,0,parseInt(n),parseInt(a)];return new wg({viewBox:i,userUnit:1,scale:e,rotation:t})}function dy(r){if(r.startsWith("#")){const e=parseInt(r.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return r.startsWith("rgb(")?r.slice(4,-1).split(",").map(e=>parseInt(e)):r.startsWith("rgba(")?r.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(Jr(`Not a valid color format: "${r}"`),[0,0,0])}function mve(r){const e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(const t of r.keys()){e.style.color=t;const n=window.getComputedStyle(e).color;r.set(t,dy(n))}e.remove()}function wa(r){const{a:e,b:t,c:n,d:a,e:i,f:s}=r.getTransform();return[e,t,n,a,i,s]}function _l(r){const{a:e,b:t,c:n,d:a,e:i,f:s}=r.getTransform().invertSelf();return[e,t,n,a,i,s]}function Zd(r,e,t=!1,n=!0){if(e instanceof wg){const{pageWidth:a,pageHeight:i}=e.rawDims,{style:s}=r,o=Mi.isCSSRoundSupported,l=`var(--total-scale-factor) * ${a}px`,c=`var(--total-scale-factor) * ${i}px`,u=o?`round(down, ${l}, var(--scale-round-x))`:`calc(${l})`,d=o?`round(down, ${c}, var(--scale-round-y))`:`calc(${c})`;!t||e.rotation%180===0?(s.width=u,s.height=d):(s.width=d,s.height=u)}n&&r.setAttribute("data-main-rotation",e.rotation)}class zl{constructor(){const{pixelRatio:e}=zl;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(e,t,n,a,i=-1){let s=1/0,o=1/0,l=1/0;n=zl.capPixels(n,i),n>0&&(s=Math.sqrt(n/(e*t))),a!==-1&&(o=a/e,l=a/t);const c=Math.min(s,o,l);return this.sx>c||this.sy>c?(this.sx=c,this.sy=c,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,t){if(t>=0){const n=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+t/100));return e>0?Math.min(e,n):n}return e}}const nA=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class lm{#e=null;#t=null;#r;#n=null;#i=null;#a=null;#s=null;static#o=null;constructor(e){this.#r=e,lm.#o||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"})}render(){const e=this.#e=document.createElement("div");e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const t=this.#r._uiManager._signal;e.addEventListener("contextmenu",ko,{signal:t}),e.addEventListener("pointerdown",lm.#l,{signal:t});const n=this.#n=document.createElement("div");n.className="buttons",e.append(n);const a=this.#r.toolbarPosition;if(a){const{style:i}=e,s=this.#r._uiManager.direction==="ltr"?1-a[0]:a[0];i.insetInlineEnd=`${100*s}%`,i.top=`calc(${100*a[1]}% + var(--editor-toolbar-vert-offset))`}return e}get div(){return this.#e}static#l(e){e.stopPropagation()}#c(e){this.#r._focusEventsAllowed=!1,ja(e)}#d(e){this.#r._focusEventsAllowed=!0,ja(e)}#u(e){const t=this.#r._uiManager._signal;e.addEventListener("focusin",this.#c.bind(this),{capture:!0,signal:t}),e.addEventListener("focusout",this.#d.bind(this),{capture:!0,signal:t}),e.addEventListener("contextmenu",ko,{signal:t})}hide(){this.#e.classList.add("hidden"),this.#t?.hideDropdown()}show(){this.#e.classList.remove("hidden"),this.#i?.shown(),this.#a?.shown()}addDeleteButton(){const{editorType:e,_uiManager:t}=this.#r,n=document.createElement("button");n.className="delete",n.tabIndex=0,n.setAttribute("data-l10n-id",lm.#o[e]),this.#u(n),n.addEventListener("click",a=>{t.delete()},{signal:t._signal}),this.#n.append(n)}get#p(){const e=document.createElement("div");return e.className="divider",e}async addAltText(e){const t=await e.render();this.#u(t),this.#n.append(t,this.#p),this.#i=e}addComment(e){if(this.#a)return;const t=e.render();t&&(this.#u(t),this.#n.prepend(t,this.#p),this.#a=e,e.toolbar=this)}addColorPicker( Line truncated
}`)),Ip)}function sz(r,e=!1){if(typeof document>"u")return;if(!_D){_D=!0,r();return}if(typeof window<"u"&&window.__vitest_worker__){r();return}clearTimeout(mD),clearTimeout(gD);const n=Abe(),a=()=>document.head.appendChild(n),i=()=>{n.parentNode&&document.head.removeChild(n)};function s(){r(),window.requestAnimationFrame(i)}if(typeof window.requestAnimationFrame<"u"){a(),e?s():window.requestAnimationFrame(()=>{s()});return}a(),mD=window.setTimeout(()=>{r(),gD=window.setTimeout(i,16)},16)}const wu=Qa(void 0),Nb=Qa(!0),Ib=Qa(!1),W3=Qa([]),j3=Qa([]);function xbe(){const r=F(()=>{if(!yg)return;const e=V3.current==="system"?Y3.current:V3.current,t=pD(W3.current),n=pD(j3.current);function a(){const i=document.documentElement,s=document.querySelector('meta[name="theme-color"]');e==="light"?(t.length&&i.classList.remove(...t),n.length&&i.classList.add(...n),i.style.colorScheme="light",s&&wu.current&&s.setAttribute("content",wu.current.light)):(n.length&&i.classList.remove(...n),t.length&&i.classList.add(...t),i.style.colorScheme="dark",s&&wu.current&&s.setAttribute("content",wu.current.dark))}return Nb.current?sz(a,Ib.current):a(),e});return{get current(){return f(r)}}}function Rbe(){const r=F(()=>{if(C_.current,!yg)return;function e(){document.documentElement.setAttribute("data-theme",C_.current)}return Nb.current?sz(e,Rn(()=>Ib.current)):e(),C_.current});return{get current(){return f(r)}}}const sy=xbe(),Obe=Rbe();function K3(r){V3.current=r}function Nbe(r){C_.current=r}function Ibe({defaultMode:r="system",themeColors:e,darkClassNames:t=["dark"],lightClassNames:n=[],defaultTheme:a="",modeStorageKey:i="mode-watcher-mode",themeStorageKey:s="mode-watcher-theme"}){const o=document.documentElement,l=localStorage.getItem(i)??r,c=localStorage.getItem(s)??a,u=l==="light"||l==="system"&&window.matchMedia("(prefers-color-scheme: light)").matches;if(u?(t.length&&o.classList.remove(...t.filter(Boolean)),n.length&&o.classList.add(...n.filter(Boolean))):(n.length&&o.classList.remove(...n.filter(Boolean)),t.length&&o.classList.add(...t.filter(Boolean))),o.style.colorScheme=u?"light":"dark",e){const d=document.querySelector('meta[name="theme-color"]');d&&d.setAttribute("content",l==="light"?e.light:e.dark)}c&&(o.setAttribute("data-theme",c),localStorage.setItem(s,c)),localStorage.setItem(i,l)}var kbe=G('<meta name="theme-color"/>');function Mbe(r,e){Ee(e,!0);var t=se(),n=L(t);{var a=i=>{var s=kbe();Ce(()=>er(s,"content",e.themeColors.dark)),T(i,s)};le(n,i=>{e.themeColors&&i(a)})}T(r,t),we()}var Dbe=G('<meta name="theme-color"/>'),Pbe=G("<!> <!>",1);function Lbe(r,e){Ee(e,!0);let t=Y(e,"trueNonce",3,"");lv("1funsus",n=>{var a=Pbe(),i=L(a);{var s=l=>{var c=Dbe();Ce(()=>er(c,"content",e.themeColors.dark)),T(l,c)};le(i,l=>{e.themeColors&&l(s)})}var o=ee(i,2);nf(o,()=>`<script${t()?` nonce=${t()}`:""}>(`+Ibe.toString()+")("+JSON.stringify(e.initConfig)+");<\/script>"),T(n,a)}),we()}function Fbe(r,e){Ee(e,!0);let t=Y(e,"track",3,!0),n=Y(e,"defaultMode",3,"system"),a=Y(e,"disableTransitions",3,!0),i=Y(e,"darkClassNames",19,()=>["dark"]),s=Y(e,"lightClassNames",19,()=>[]),o=Y(e,"defaultTheme",3,""),l=Y(e,"nonce",3,""),c=Y(e,"themeStorageKey",3,"mode-watcher-theme"),u=Y(e,"modeStorageKey",3,"mode-watcher-mode"),d=Y(e,"disableHeadScriptInjection",3,!1),h=Y(e,"synchronousModeChanges",3,!1);Ud.current=u(),$d.current=c(),W3.current=i(),j3.current=s(),Nb.current=a(),wu.current=e.themeColors,Ib.current=h(),Gi(()=>{Ib.current=h()}),Gi(()=>{Nb.current=a()}),Gi(()=>{wu.current=e.themeColors}),Gi(()=>{W3.current=i()}),Gi(()=>{j3.current=s()}),Gi(()=>{Ud.current=u()}),Gi(()=>{$d.current=c()}),Gi(()=>{sy.current,Ud.current,$d.current,Obe.current}),bi(()=>{Y3.tracking(t()),Y3.query();const y=localStorage.getItem(Ud.current);K3(H3(y)?y:n());const E=localStorage.getItem($d.current);Nbe(E||o())});const p={defaultMode:n(),themeColors:e.themeColors,darkClassNames:i(),lightClassNames:s(),defaultTheme:o(),modeStorageKey:u(),themeStorageKey:c()},m=F(()=>typeof window>"u"?l():"");var g=se(),b=L(g);{var _=y=>{Mbe(y,{get themeColors(){return wu.current}})},v=y=>{Lbe(y,{get trueNonce(){return f(m)},get initConfig(){return p},get themeColors(){return wu.current}})};le(b,y=>{d()?y(_):y(v,!1)})}T(r,g),we()}class Bbe{#e=_e(!1);get _isInitializing(){return f(this.#e)}set _isInitializing(e){M(this.#e,e,!0)}#t=_e(null);get _error(){return f(this.#t)}set _error(e){M(this.#t,e,!0)}#r=_e(0);get _toolCount(){return f(this.#r)}set _toolCount(e){M(this.#r,e,!0)}#n=_e(Sr([]));get _connectedServers(){return f(this.#n)}set _connectedServers(e){M(this.#n,e,!0)}#i=_e(Sr({}));get _healthChecks(){return f(this.#i)}set _healthChecks(e){M(this.#i,e,!0)}#a=_e(!1);get _proxyAvailable(){return f(this.#a)}set _proxyAvailable(e){M(this.#a,e,!0)}connections=new Map;toolsIndex=new Map;serverConfigs=new Map;reconnectingServers=new Set;configSignature=null;initPromise=null;activeFlowCount=0;constructor(){this.probeProxy()}async probeProxy(){try{const e=await fetch(`${Ga}${zU}`,{method:"HEAD" Line truncated
`);return e.join("")}}function Xp(r,e){const t=e?URL.parse(r,e):URL.parse(r);return t?.protocol==="http:"||t?.protocol==="https:"}function ko(r){r.preventDefault()}function ja(r){r.preventDefault(),r.stopPropagation()}function fve(r){console.log("Deprecated API usage: "+r)}class rA{static#e;static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!="string")return null;this.#e||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const t=this.#e.exec(e);if(!t)return null;const n=parseInt(t[1],10);let a=parseInt(t[2],10);a=a>=1&&a<=12?a-1:0;let i=parseInt(t[3],10);i=i>=1&&i<=31?i:1;let s=parseInt(t[4],10);s=s>=0&&s<=23?s:0;let o=parseInt(t[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(t[6],10);l=l>=0&&l<=59?l:0;const c=t[7]||"Z";let u=parseInt(t[8],10);u=u>=0&&u<=23?u:0;let d=parseInt(t[9],10)||0;return d=d>=0&&d<=59?d:0,c==="-"?(s+=u,o+=d):c==="+"&&(s-=u,o-=d),new Date(Date.UTC(n,a,i,s,o,l))}}function pve(r,{scale:e=1,rotation:t=0}){const{width:n,height:a}=r.attributes.style,i=[0,0,parseInt(n),parseInt(a)];return new wg({viewBox:i,userUnit:1,scale:e,rotation:t})}function dy(r){if(r.startsWith("#")){const e=parseInt(r.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return r.startsWith("rgb(")?r.slice(4,-1).split(",").map(e=>parseInt(e)):r.startsWith("rgba(")?r.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(Jr(`Not a valid color format: "${r}"`),[0,0,0])}function mve(r){const e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(const t of r.keys()){e.style.color=t;const n=window.getComputedStyle(e).color;r.set(t,dy(n))}e.remove()}function wa(r){const{a:e,b:t,c:n,d:a,e:i,f:s}=r.getTransform();return[e,t,n,a,i,s]}function _l(r){const{a:e,b:t,c:n,d:a,e:i,f:s}=r.getTransform().invertSelf();return[e,t,n,a,i,s]}function Zd(r,e,t=!1,n=!0){if(e instanceof wg){const{pageWidth:a,pageHeight:i}=e.rawDims,{style:s}=r,o=Mi.isCSSRoundSupported,l=`var(--total-scale-factor) * ${a}px`,c=`var(--total-scale-factor) * ${i}px`,u=o?`round(down, ${l}, var(--scale-round-x))`:`calc(${l})`,d=o?`round(down, ${c}, var(--scale-round-y))`:`calc(${c})`;!t||e.rotation%180===0?(s.width=u,s.height=d):(s.width=d,s.height=u)}n&&r.setAttribute("data-main-rotation",e.rotation)}class zl{constructor(){const{pixelRatio:e}=zl;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(e,t,n,a,i=-1){let s=1/0,o=1/0,l=1/0;n=zl.capPixels(n,i),n>0&&(s=Math.sqrt(n/(e*t))),a!==-1&&(o=a/e,l=a/t);const c=Math.min(s,o,l);return this.sx>c||this.sy>c?(this.sx=c,this.sy=c,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,t){if(t>=0){const n=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+t/100));return e>0?Math.min(e,n):n}return e}}const nA=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class lm{#e=null;#t=null;#r;#n=null;#i=null;#a=null;#s=null;static#o=null;constructor(e){this.#r=e,lm.#o||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"})}render(){const e=this.#e=document.createElement("div");e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const t=this.#r._uiManager._signal;e.addEventListener("contextmenu",ko,{signal:t}),e.addEventListener("pointerdown",lm.#l,{signal:t});const n=this.#n=document.createElement("div");n.className="buttons",e.append(n);const a=this.#r.toolbarPosition;if(a){const{style:i}=e,s=this.#r._uiManager.direction==="ltr"?1-a[0]:a[0];i.insetInlineEnd=`${100*s}%`,i.top=`calc(${100*a[1]}% + var(--editor-toolbar-vert-offset))`}return e}get div(){return this.#e}static#l(e){e.stopPropagation()}#c(e){this.#r._focusEventsAllowed=!1,ja(e)}#d(e){this.#r._focusEventsAllowed=!0,ja(e)}#u(e){const t=this.#r._uiManager._signal;e.addEventListener("focusin",this.#c.bind(this),{capture:!0,signal:t}),e.addEventListener("focusout",this.#d.bind(this),{capture:!0,signal:t}),e.addEventListener("contextmenu",ko,{signal:t})}hide(){this.#e.classList.add("hidden"),this.#t?.hideDropdown()}show(){this.#e.classList.remove("hidden"),this.#i?.shown(),this.#a?.shown()}addDeleteButton(){const{editorType:e,_uiManager:t}=this.#r,n=document.createElement("button");n.className="delete",n.tabIndex=0,n.setAttribute("data-l10n-id",lm.#o[e]),this.#u(n),n.addEventListener("click",a=>{t.delete()},{signal:t._signal}),this.#n.append(n)}get#p(){const e=document.createElement("div");return e.className="divider",e}async addAltText(e){const t=await e.render();this.#u(t),this.#n.append(t,this.#p),this.#i=e}addComment(e){if(this.#a)return;const t=e.render();t&&(this.#u(t),this.#n.prepend(t,this.#p),this.#a=e,e.toolbar=this)}addColorPicker( Line truncated
`)||null;o&&this.data.comb&&(o=o.replaceAll(/\s+/g,""));const l={userValue:i,formattedValue:o,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=o??i,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type=this.data.password?"password":"text",n.setAttribute("value",o??i),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),Jd.add(n),n.setAttribute("data-element-id",t),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=0;const{datetimeFormat:c,datetimeType:u,timeStep:d}=this.data,h=!!u&&this.enableScripting;c&&(n.title=c),this._setRequired(n,this.data.required),s&&(n.maxLength=s),n.addEventListener("input",m=>{e.setValue(t,{value:m.target.value}),this.setPropertyOnSiblings(n,"value",m.target.value,"value"),l.formattedValue=null}),n.addEventListener("resetform",m=>{const g=this.data.defaultFieldValue??"";n.value=l.userValue=g,l.formattedValue=null});let p=m=>{const{formattedValue:g}=l;g!=null&&(m.target.value=g),m.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",g=>{if(l.focused)return;const{target:b}=g;if(h&&(b.type=u,d&&(b.step=d)),l.userValue){const _=l.userValue;if(h)if(u==="time"){const v=new Date(_),y=[v.getHours(),v.getMinutes(),v.getSeconds()];b.value=y.map(E=>E.toString().padStart(2,"0")).join(":")}else b.value=new Date(_-Eye).toISOString().split(u==="date"?"T":".",1)[0];else b.value=_}l.lastCommittedValue=b.value,l.commitKey=1,this.data.actions?.Focus||(l.focused=!0)}),n.addEventListener("updatefromsandbox",g=>{this.showElementAndHideCanvas(g.target);const b={value(_){l.userValue=_.detail.value??"",h||e.setValue(t,{value:l.userValue.toString()}),_.target.value=l.userValue},formattedValue(_){const{formattedValue:v}=_.detail;l.formattedValue=v,v!=null&&_.target!==document.activeElement&&(_.target.value=v);const y={formattedValue:v};h&&(y.value=v),e.setValue(t,y)},selRange(_){_.target.setSelectionRange(..._.detail.selRange)},charLimit:_=>{const{charLimit:v}=_.detail,{target:y}=_;if(v===0){y.removeAttribute("maxLength");return}y.setAttribute("maxLength",v);let E=l.userValue;!E||E.length<=v||(E=E.slice(0,v),y.value=l.userValue=E,e.setValue(t,{value:E}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:E,willCommit:!0,commitKey:1,selStart:y.selectionStart,selEnd:y.selectionEnd}}))}};this._dispatchEventFromSandbox(b,g)}),n.addEventListener("keydown",g=>{l.commitKey=1;let b=-1;if(g.key==="Escape"?b=0:g.key==="Enter"&&!this.data.multiLine?b=2:g.key==="Tab"&&(l.commitKey=3),b===-1)return;const{value:_}=g.target;l.lastCommittedValue!==_&&(l.lastCommittedValue=_,l.userValue=_,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:_,willCommit:!0,commitKey:b,selStart:g.target.selectionStart,selEnd:g.target.selectionEnd}}))});const m=p;p=null,n.addEventListener("blur",g=>{if(!l.focused||!g.relatedTarget)return;this.data.actions?.Blur||(l.focused=!1);const{target:b}=g;let{value:_}=b;if(h){if(_&&u==="time"){const v=_.split(":").map(y=>parseInt(y,10));_=new Date(2e3,0,1,v[0],v[1],v[2]||0).valueOf(),b.step=""}else _=new Date(_).valueOf();b.type="text"}l.userValue=_,l.lastCommittedValue!==_&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:_,willCommit:!0,commitKey:l.commitKey,selStart:g.target.selectionStart,selEnd:g.target.selectionEnd}}),m(g)}),this.data.actions?.Keystroke&&n.addEventListener("beforeinput",g=>{l.lastCommittedValue=null;const{data:b,target:_}=g,{value:v,selectionStart:y,selectionEnd:E}=_;let S=y,w=E;switch(g.inputType){case"deleteWordBackward":{const C=v.substring(0,y).match(/\w*[^\w]*$/);C&&(S-=C[0].length);break}case"deleteWordForward":{const C=v.substring(y).match(/^[^\w]*\w*/);C&&(w+=C[0].length);break}case"deleteContentBackward":y===E&&(S-=1);break;case"deleteContentForward":y===E&&(w+=1);break}g.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:v,change:b||"",willCommit:!1,selStart:S,selEnd:w}})}),this._setEventListeners(n,l,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],g=>g.target.value)}if(p&&n.addEventListener("blur",p),this.data.comb){const g=(this.data.rect[2]-this.data.rect[0])/s;n.classList.add("comb"),n.style.letterSpacing=`calc(${g}px * var(--total-scale-factor) - 1ch)`}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell",this.data.hasOwnCanvas&&(n.hidden=!0);return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class Cye extends uh{constructor(e){super(e,{isRenderable:!!e.data.has Line truncated
`))t.push({name:"span",value:i,attributes:a});return n}_formatContents({str:e,dir:t}){const n=document.createElement("p");n.classList.add("popupContent"),n.dir=t;const a=e.split(/(?:\r\n?|\n)/);for(let i=0,s=a.length;i<s;++i){const o=a[i];n.append(document.createTextNode(o)),i<s-1&&n.append(document.createElement("br"))}return n}#N(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key==="Enter"||e.key==="Escape"&&this.#u)&&this.#R()}updateEdited({rect:e,popup:t,deleted:n}){if(n||t?.deleted){this.remove();return}this.#S(),this.#_||={contentsObj:this.#s,richText:this.#g},e&&(this.#f=null),t&&(this.#g=this.#C(t.text),this.#o=rA.toDateObject(t.date),this.#s=null),this.#p?.remove(),this.#p=null}resetEdited(){this.#_&&({contentsObj:this.#s,richText:this.#g}=this.#_,this.#_=null,this.#p?.remove(),this.#p=null,this.#f=null)}remove(){this.#m?.abort(),this.#m=null,this.#p?.remove(),this.#p=null,this.#y=!1,this.#u=!1;for(const e of this.trigger)e.classList.remove("popupTriggerArea")}#O(){if(this.#f!==null)return;const{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:n,pageX:a,pageY:i}}}=this.#c;let s=!!this.#d,o=s?this.#d:this.#h;for(const m of this.#l)if(!o||Dr.intersect(m.data.rect,o)!==null){o=m.data.rect,s=!0;break}const l=Dr.normalizeRect([o[0],e[3]-o[1]+e[1],o[2],e[3]-o[3]+e[1]]),u=s?o[2]-o[0]+5:0,d=l[0]+u,h=l[1];this.#f=[100*(d-a)/t,100*(h-i)/n];const{style:p}=this.#a;p.left=`${this.#f[0]}%`,p.top=`${this.#f[1]}%`}#R(){this.#u=!this.#u,this.#u?(this.#x(),this.#a.addEventListener("click",this.#n),this.#a.addEventListener("keydown",this.#e)):(this.#k(),this.#a.removeEventListener("click",this.#n),this.#a.removeEventListener("keydown",this.#e))}#x(){this.#p||this.render(),this.isVisible?this.#u&&this.#a.classList.add("focused"):(this.#O(),this.#a.hidden=!1,this.#a.style.zIndex=parseInt(this.#a.style.zIndex)+1e3)}#k(){this.#a.classList.remove("focused"),!(this.#u||!this.isVisible)&&(this.#a.hidden=!0,this.#a.style.zIndex=parseInt(this.#a.style.zIndex)-1e3)}forceHide(){this.#y=this.isVisible,this.#y&&(this.#a.hidden=!0)}maybeShow(){this.#S(),this.#y&&(this.#p||this.#x(),this.#y=!1,this.#a.hidden=!1)}get isVisible(){return this.#a.hidden===!1}}class Mz extends za{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=Zr.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const e=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(const t of this.textContent){const n=document.createElement("span");n.textContent=t,e.append(n)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class Nye extends za{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const{data:e,width:t,height:n}=this,a=this.svgFactory.create(t,n,!0),i=this.#e=this.svgFactory.createElement("svg:line");return i.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),i.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),i.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),i.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),i.setAttribute("stroke-width",e.borderStyle.width||1),i.setAttribute("stroke","transparent"),i.setAttribute("fill","transparent"),a.append(i),this.container.append(a),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class Iye extends za{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const{data:e,width:t,height:n}=this,a=this.svgFactory.create(t,n,!0),i=e.borderStyle.width,s=this.#e=this.svgFactory.createElement("svg:rect");return s.setAttribute("x",i/2),s.setAttribute("y",i/2),s.setAttribute("width",t-i),s.setAttribute("height",n-i),s.setAttribute("stroke-width",i||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),a.append(s),this.container.append(a),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class kye extends za{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const{data:e,width:t,height:n}=this,a=this.svgFactory.create(t,n,!0),i=e.borderStyle.width,s=this.#e=this.svgFactory.createElement("svg:ellipse");return s.setAttribute("cx",t/2),s.setAttribute("cy",n/2),s.setAttribute("rx",t/2-i/2),s.setAttribute("ry",n/2-i/2),s.setAttribute("stroke-width",i||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),a.append(s),this.container.append(a),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return Line truncated
`))t.push({name:"span",value:i,attributes:a});return n}_formatContents({str:e,dir:t}){const n=document.createElement("p");n.classList.add("popupContent"),n.dir=t;const a=e.split(/(?:\r\n?|\n)/);for(let i=0,s=a.length;i<s;++i){const o=a[i];n.append(document.createTextNode(o)),i<s-1&&n.append(document.createElement("br"))}return n}#N(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key==="Enter"||e.key==="Escape"&&this.#u)&&this.#R()}updateEdited({rect:e,popup:t,deleted:n}){if(n||t?.deleted){this.remove();return}this.#S(),this.#_||={contentsObj:this.#s,richText:this.#g},e&&(this.#f=null),t&&(this.#g=this.#C(t.text),this.#o=rA.toDateObject(t.date),this.#s=null),this.#p?.remove(),this.#p=null}resetEdited(){this.#_&&({contentsObj:this.#s,richText:this.#g}=this.#_,this.#_=null,this.#p?.remove(),this.#p=null,this.#f=null)}remove(){this.#m?.abort(),this.#m=null,this.#p?.remove(),this.#p=null,this.#y=!1,this.#u=!1;for(const e of this.trigger)e.classList.remove("popupTriggerArea")}#O(){if(this.#f!==null)return;const{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:n,pageX:a,pageY:i}}}=this.#c;let s=!!this.#d,o=s?this.#d:this.#h;for(const m of this.#l)if(!o||Dr.intersect(m.data.rect,o)!==null){o=m.data.rect,s=!0;break}const l=Dr.normalizeRect([o[0],e[3]-o[1]+e[1],o[2],e[3]-o[3]+e[1]]),u=s?o[2]-o[0]+5:0,d=l[0]+u,h=l[1];this.#f=[100*(d-a)/t,100*(h-i)/n];const{style:p}=this.#a;p.left=`${this.#f[0]}%`,p.top=`${this.#f[1]}%`}#R(){this.#u=!this.#u,this.#u?(this.#x(),this.#a.addEventListener("click",this.#n),this.#a.addEventListener("keydown",this.#e)):(this.#k(),this.#a.removeEventListener("click",this.#n),this.#a.removeEventListener("keydown",this.#e))}#x(){this.#p||this.render(),this.isVisible?this.#u&&this.#a.classList.add("focused"):(this.#O(),this.#a.hidden=!1,this.#a.style.zIndex=parseInt(this.#a.style.zIndex)+1e3)}#k(){this.#a.classList.remove("focused"),!(this.#u||!this.isVisible)&&(this.#a.hidden=!0,this.#a.style.zIndex=parseInt(this.#a.style.zIndex)-1e3)}forceHide(){this.#y=this.isVisible,this.#y&&(this.#a.hidden=!0)}maybeShow(){this.#S(),this.#y&&(this.#p||this.#x(),this.#y=!1,this.#a.hidden=!1)}get isVisible(){return this.#a.hidden===!1}}class Mz extends za{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=Zr.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const e=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(const t of this.textContent){const n=document.createElement("span");n.textContent=t,e.append(n)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class Nye extends za{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const{data:e,width:t,height:n}=this,a=this.svgFactory.create(t,n,!0),i=this.#e=this.svgFactory.createElement("svg:line");return i.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),i.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),i.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),i.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),i.setAttribute("stroke-width",e.borderStyle.width||1),i.setAttribute("stroke","transparent"),i.setAttribute("fill","transparent"),a.append(i),this.container.append(a),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class Iye extends za{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const{data:e,width:t,height:n}=this,a=this.svgFactory.create(t,n,!0),i=e.borderStyle.width,s=this.#e=this.svgFactory.createElement("svg:rect");return s.setAttribute("x",i/2),s.setAttribute("y",i/2),s.setAttribute("width",t-i),s.setAttribute("height",n-i),s.setAttribute("stroke-width",i||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),a.append(s),this.container.append(a),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class kye extends za{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const{data:e,width:t,height:n}=this,a=this.svgFactory.create(t,n,!0),i=e.borderStyle.width,s=this.#e=this.svgFactory.createElement("svg:ellipse");return s.setAttribute("cx",t/2),s.setAttribute("cy",n/2),s.setAttribute("rx",t/2-i/2),s.setAttribute("ry",n/2-i/2),s.setAttribute("stroke-width",i||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),a.append(s),this.container.append(a),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return Line truncated
`)}#l(){const[e,t]=this.parentDimensions;let n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{const{currentLayer:a,div:i}=this,s=i.style.display,o=i.classList.contains("hidden");i.classList.remove("hidden"),i.style.display="hidden",a.div.append(this.div),n=i.getBoundingClientRect(),i.remove(),i.style.display=s,i.classList.toggle("hidden",o)}this.rotation%180===this.parentRotation%180?(this.width=n.width/e,this.height=n.height/t):(this.width=n.height/e,this.height=n.width/t),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const e=this.#t,t=this.#t=this.#o().trimEnd();if(e===t)return;const n=a=>{if(this.#t=a,!a){this.remove();return}this.#d(),this._uiManager.rebuild(this),this.#l()};this.addCommands({cmd:()=>{n(t)},undo:()=>{n(e)},mustExec:!1}),this.#l()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(e){e.target===this.div&&e.key==="Enter"&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){ri._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let e,t;(this._isCopy||this.annotationElementId)&&(e=this.x,t=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#r),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;if(n.fontSize=`calc(${this.#i}px * var(--total-scale-factor))`,n.color=this.#e,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){const[a,i]=this.parentDimensions;if(this.annotationElementId){const{position:s}=this._initialData;let[o,l]=this.getInitialTranslation();[o,l]=this.pageTranslationToScreen(o,l);const[c,u]=this.pageDimensions,[d,h]=this.pageTranslation;let p,m;switch(this.rotation){case 0:p=e+(s[0]-d)/c,m=t+this.height-(s[1]-h)/u;break;case 90:p=e+(s[0]-d)/c,m=t-(s[1]-h)/u,[o,l]=[l,-o];break;case 180:p=e-this.width+(s[0]-d)/c,m=t-(s[1]-h)/u,[o,l]=[-o,-l];break;case 270:p=e+(s[0]-d-this.height*u)/c,m=t+(s[1]-h-this.width*c)/u,[o,l]=[-l,o];break}this.setAt(p*a,m*i,o,l)}else this._moveAfterPaste(e,t);this.#d(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#c(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(Y1,"")}editorDivPaste(e){const t=e.clipboardData||window.clipboardData,{types:n}=t;if(n.length===1&&n[0]==="text/plain")return;e.preventDefault();const a=ri.#p(t.getData("text")||"").replaceAll(Y1,`
`);if(!a)return;const i=window.getSelection();if(!i.rangeCount)return;this.editorDiv.normalize(),i.deleteFromDocument();const s=i.getRangeAt(0);if(!a.includes(`
`)){s.insertNode(document.createTextNode(a)),this.editorDiv.normalize(),i.collapseToStart();return}const{startContainer:o,startOffset:l}=s,c=[],u=[];if(o.nodeType===Node.TEXT_NODE){const p=o.parentElement;if(u.push(o.nodeValue.slice(l).replaceAll(Y1,"")),p!==this.editorDiv){let m=c;for(const g of this.editorDiv.childNodes){if(g===p){m=u;continue}m.push(ri.#c(g))}}c.push(o.nodeValue.slice(0,l).replaceAll(Y1,""))}else if(o===this.editorDiv){let p=c,m=0;for(const g of this.editorDiv.childNodes)m++===l&&(p=u),p.push(ri.#c(g))}this.#t=`${c.join(`
@@ -121,48 +121,48 @@ ${i.text}`):"blob"in i&&i.blob&&e.push(`
`)}`,this.#d();const d=new Range;let h=Math.sumPrecise(c.map(p=>p.length));for(const{firstChild:p}of this.editorDiv.childNodes)if(p.nodeType===Node.TEXT_NODE){const m=p.nodeValue.length;if(h<=m){d.setStart(p,h),d.setEnd(p,h);break}h-=m}i.removeAllRanges(),i.addRange(d)}#d(){if(this.editorDiv.replaceChildren(),!!this.#t)for(const e of this.#t.split(`
`)){const t=document.createElement("div");t.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(t)}}#u(){return this.#t.replaceAll(" "," ")}static#p(e){return e.replaceAll(" "," ")}get contentDiv(){return this.editorDiv}static async deserialize(e,t,n){let a=null;if(e instanceof Mz){const{data:{defaultAppearanceData:{fontSize:s,fontColor:o},rect:l,rotation:c,id:u,popupRef:d,contentsObj:h},textContent:p,textPosition:m,parent:{page:{pageNumber:g}}}=e;if(!p||p.length===0)return null;a=e={annotationType:Zr.FREETEXT,color:Array.from(o),fontSize:s,value:p.join(`
`),position:m,pageIndex:g-1,rect:l.slice(0),rotation:c,annotationElementId:u,id:u,deleted:!1,popupRef:d,comment:h?.str||null}}const i=await super.deserialize(e,t,n);return i.#i=e.fontSize,i.#e=Dr.makeHexColor(...e.color),i.#t=ri.#p(e.value),i._initialData=a,e.comment&&i.setCommentData(e.comment),i}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const t=ri._internalPadding*this.parentScale,n=this.getRect(t,t),a=Fr._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#e),i={annotationType:Zr.FREETEXT,color:a,fontSize:this.#i,value:this.#u(),pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(i),e?(i.isCopy=!0,i):this.annotationElementId&&!this.#m(i)?null:(i.id=this.annotationElementId,i)}#m(e){const{value:t,fontSize:n,color:a,pageIndex:i}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||e.value!==t||e.fontSize!==n||e.color.some((s,o)=>s!==a[o])||e.pageIndex!==i}renderAnnotationElement(e){const t=super.renderAnnotationElement(e),{style:n}=t;n.fontSize=`calc(${this.#i}px * var(--total-scale-factor))`,n.color=this.#e,t.replaceChildren();for(const s of this.#t.split(`
`)){const o=document.createElement("div");o.append(s?document.createTextNode(s):document.createElement("br")),t.append(o)}const a=ri._internalPadding*this.parentScale,i={rect:this.getRect(a,a)};return i.popup=this.hasEditedComment?this.comment:{text:this.#t},e.updateEdited(i),t}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}}class br{static PRECISION=1e-4;toSVGPath(){Zn("Abstract method `toSVGPath` must be implemented.")}get box(){Zn("Abstract getter `box` must be implemented.")}serialize(e,t){Zn("Abstract method `serialize` must be implemented.")}static _rescale(e,t,n,a,i,s){s||=new Float32Array(e.length);for(let o=0,l=e.length;o<l;o+=2)s[o]=t+e[o]*a,s[o+1]=n+e[o+1]*i;return s}static _rescaleAndSwap(e,t,n,a,i,s){s||=new Float32Array(e.length);for(let o=0,l=e.length;o<l;o+=2)s[o]=t+e[o+1]*a,s[o+1]=n+e[o]*i;return s}static _translate(e,t,n,a){a||=new Float32Array(e.length);for(let i=0,s=e.length;i<s;i+=2)a[i]=t+e[i],a[i+1]=n+e[i+1];return a}static svgRound(e){return Math.round(e*1e4)}static _normalizePoint(e,t,n,a,i){switch(i){case 90:return[1-t/n,e/a];case 180:return[1-e/n,1-t/a];case 270:return[t/n,1-e/a];default:return[e/n,t/a]}}static _normalizePagePoint(e,t,n){switch(n){case 90:return[1-t,e];case 180:return[1-e,1-t];case 270:return[t,1-e];default:return[e,t]}}static createBezierPoints(e,t,n,a,i,s){return[(e+5*n)/6,(t+5*a)/6,(5*n+i)/6,(5*a+s)/6,(n+i)/2,(a+s)/2]}}class Gd{#e;#t=[];#r;#n;#i=[];#a=new Float32Array(18);#s;#o;#l;#c;#d;#u;#p=[];static#m=8;static#f=2;static#h=Gd.#m+Gd.#f;constructor({x:e,y:t},n,a,i,s,o=0){this.#e=n,this.#u=i*a,this.#n=s,this.#a.set([NaN,NaN,NaN,NaN,e,t],6),this.#r=o,this.#c=Gd.#m*a,this.#l=Gd.#h*a,this.#d=a,this.#p.push(e,t)}isEmpty(){return isNaN(this.#a[8])}#g(){const e=this.#a.subarray(4,6),t=this.#a.subarray(16,18),[n,a,i,s]=this.#e;return[(this.#s+(e[0]-t[0])/2-n)/i,(this.#o+(e[1]-t[1])/2-a)/s,(this.#s+(t[0]-e[0])/2-n)/i,(this.#o+(t[1]-e[1])/2-a)/s]}add({x:e,y:t}){this.#s=e,this.#o=t;const[n,a,i,s]=this.#e;let[o,l,c,u]=this.#a.subarray(8,12);const d=e-c,h=t-u,p=Math.hypot(d,h);if(p<this.#l)return!1;const m=p-this.#c,g=m/p,b=g*d,_=g*h;let v=o,y=l;o=c,l=u,c+=b,u+=_,this.#p?.push(e,t);const E=-_/m,S=b/m,w=E*this.#u,C=S*this.#u;return this.#a.set(this.#a.subarray(2,8),0),this.#a.set([c+w,u+C],4),this.#a.set(this.#a.subarray(14,18),12),this.#a.set([c-w,u-C],16),isNaN(this.#a[6])?(this.#i.length===0&&(this.#a.set([o+w,l+C],2),this.#i.push(NaN,NaN,NaN,NaN,(o+w-n)/i,(l+C-a)/s),this.#a.set([o-w,l-C],14),this.#t.push(NaN,NaN,NaN,NaN,(o-w-n)/i,(l-C-a)/s)),this.#a.set([v,y,o,l,c,u],6),!this.isEmpty()):(this.#a.set([v,y,o,l,c,u],6),Math.abs(Math.atan2(y-l,v-o)-Math.atan2(_,b))<Math.PI/2?([o,l,c,u]=this.#a.subarray(2,6),this.#i.push(NaN,NaN,NaN,NaN,((o+c)/2-n)/i,((l+u)/2-a)/s),[o,l,v,y]=this.#a.subarray(14,18),this.#t.push(NaN,NaN,NaN,NaN,((v+o)/2-n)/i,((y+l)/2-a)/s),!0):([v,y,o,l,c,u]=this.#a.subarray(0,6),this.#i.push(((v+5*o)/6-n)/i,((y+5*l)/6-a)/s,((5*o+c)/6-n)/i,((5*l+u)/6-a)/s,((o+c)/2-n)/i,((l+u)/2-a)/s),[c,u,o,l,v,y]=this.#a.subarray(12,18),this.#t.push(((v+5*o)/6-n)/i,((y+5*l)/6-a)/s,((5*o+c)/6-n)/i,((5*l+u)/6-a)/s,((o+c)/2-n)/i,((l+u)/2-a)/s),!0))}toSVGPath(){if(this.isEmpty())return"";const e=this.#i,t=this.#t;if(isNaN(this.#a[6])&&!this.isEmpty())return this.#v();const n=[];n.push(`M${e[4]} ${e[5]}`);for(let a=6;a<e.length;a+=6)isNaN(e[a])?n.push(`L${e[a+4]} ${e[a+5]}`):n.push(`C${e[a]} ${e[a+1]} ${e[a+2]} ${e[a+3]} ${e[a+4]} ${e[a+5]}`);this.#y(n);for(let a=t.length-6;a>=6;a-=6)isNaN(t[a])?n.push(`L${t[a+4]} ${t[a+5]}`):n.push(`C${t[a]} ${t[a+1]} ${t[a+2]} ${t[a+3]} ${t[a+4]} ${t[a+5]}`);return this.#_(n),n.join(" ")}#v(){const[e,t,n,a]=this.#e,[i,s,o,l]=this.#g();return`M${(this.#a[2]-e)/n} ${(this.#a[3]-t)/a} L${(this.#a[4]-e)/n} ${(this.#a[5]-t)/a} L${i} ${s} L${o} ${l} L${(this.#a[16]-e)/n} ${(this.#a[17]-t)/a} L${(this.#a[14]-e)/n} ${(this.#a[15]-t)/a} Z`}#_(e){const t=this.#t;e.push(`L${t[4]} ${t[5]} Z`)}#y(e){const[t,n,a,i]=this.#e,s=this.#a.subarray(4,6),o=this.#a.subarray(16,18),[l,c,u,d]=this.#g();e.push(`L${(s[0]-t)/a} ${(s[1]-n)/i} L${l} ${c} L${u} ${d} L${(o[0]-t)/a} ${(o[1]-n)/i}`)}newFreeDrawOutline(e,t,n,a,i,s){return new Fz(e,t,n,a,i,s)}getOutlines(){const e=this.#i,t=this.#t,n=this.#a,[a,i,s,o]=this.#e,l=new Float32Array((this.#p?.length??0)+2);for(let d=0,h=l.length-2;d<h;d+=2)l[d]=(this.#p[d]-a)/s,l[d+1]=(this.#p[d+1]-i)/o;if(l[l.length-2]=(this.#s-a)/s,l[l.length-1]=(this.#o-i)/o,isNaN(n[6])&&!this.isEmpty())return this.#S(l);const c=new Float32Array(this.#i.length+24+this.#t.length);let u=e.length;for(let d=0;d<u;d+=2){if(isNaN(e[d])){c[d]=c[d+1]=NaN;continue}c[d]=e[d],c[d+1]=e[d+1]}u=this.#w(c,u);for(let d=t.length-6;d>=6;d-=6)for(let h=0;h<6;h+=2){if(isNaN(t[d+h])){c[u]=c[u+1]=NaN,u+=2;continue}c[u]=t[d+h],c[u+1]=t[d+h+1],u+=2}return this.#b(c,u),this.newFreeDrawOutline(c,l,this.#e,this.#d,this.#r,this.#n)}#S(e){const t=this.#a,[n,a,i,s]=this.#e,[o,l,c,u]=this.#g(),d=new Float32Array(36);return d.set([NaN,NaN,NaN,NaN,(t[2] Line truncated
`)){const o=document.createElement("div");o.append(s?document.createTextNode(s):document.createElement("br")),t.append(o)}const a=ri._internalPadding*this.parentScale,i={rect:this.getRect(a,a)};return i.popup=this.hasEditedComment?this.comment:{text:this.#t},e.updateEdited(i),t}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}}class br{static PRECISION=1e-4;toSVGPath(){Zn("Abstract method `toSVGPath` must be implemented.")}get box(){Zn("Abstract getter `box` must be implemented.")}serialize(e,t){Zn("Abstract method `serialize` must be implemented.")}static _rescale(e,t,n,a,i,s){s||=new Float32Array(e.length);for(let o=0,l=e.length;o<l;o+=2)s[o]=t+e[o]*a,s[o+1]=n+e[o+1]*i;return s}static _rescaleAndSwap(e,t,n,a,i,s){s||=new Float32Array(e.length);for(let o=0,l=e.length;o<l;o+=2)s[o]=t+e[o+1]*a,s[o+1]=n+e[o]*i;return s}static _translate(e,t,n,a){a||=new Float32Array(e.length);for(let i=0,s=e.length;i<s;i+=2)a[i]=t+e[i],a[i+1]=n+e[i+1];return a}static svgRound(e){return Math.round(e*1e4)}static _normalizePoint(e,t,n,a,i){switch(i){case 90:return[1-t/n,e/a];case 180:return[1-e/n,1-t/a];case 270:return[t/n,1-e/a];default:return[e/n,t/a]}}static _normalizePagePoint(e,t,n){switch(n){case 90:return[1-t,e];case 180:return[1-e,1-t];case 270:return[t,1-e];default:return[e,t]}}static createBezierPoints(e,t,n,a,i,s){return[(e+5*n)/6,(t+5*a)/6,(5*n+i)/6,(5*a+s)/6,(n+i)/2,(a+s)/2]}}class Gd{#e;#t=[];#r;#n;#i=[];#a=new Float32Array(18);#s;#o;#l;#c;#d;#u;#p=[];static#m=8;static#f=2;static#h=Gd.#m+Gd.#f;constructor({x:e,y:t},n,a,i,s,o=0){this.#e=n,this.#u=i*a,this.#n=s,this.#a.set([NaN,NaN,NaN,NaN,e,t],6),this.#r=o,this.#c=Gd.#m*a,this.#l=Gd.#h*a,this.#d=a,this.#p.push(e,t)}isEmpty(){return isNaN(this.#a[8])}#g(){const e=this.#a.subarray(4,6),t=this.#a.subarray(16,18),[n,a,i,s]=this.#e;return[(this.#s+(e[0]-t[0])/2-n)/i,(this.#o+(e[1]-t[1])/2-a)/s,(this.#s+(t[0]-e[0])/2-n)/i,(this.#o+(t[1]-e[1])/2-a)/s]}add({x:e,y:t}){this.#s=e,this.#o=t;const[n,a,i,s]=this.#e;let[o,l,c,u]=this.#a.subarray(8,12);const d=e-c,h=t-u,p=Math.hypot(d,h);if(p<this.#l)return!1;const m=p-this.#c,g=m/p,b=g*d,_=g*h;let v=o,y=l;o=c,l=u,c+=b,u+=_,this.#p?.push(e,t);const E=-_/m,S=b/m,w=E*this.#u,C=S*this.#u;return this.#a.set(this.#a.subarray(2,8),0),this.#a.set([c+w,u+C],4),this.#a.set(this.#a.subarray(14,18),12),this.#a.set([c-w,u-C],16),isNaN(this.#a[6])?(this.#i.length===0&&(this.#a.set([o+w,l+C],2),this.#i.push(NaN,NaN,NaN,NaN,(o+w-n)/i,(l+C-a)/s),this.#a.set([o-w,l-C],14),this.#t.push(NaN,NaN,NaN,NaN,(o-w-n)/i,(l-C-a)/s)),this.#a.set([v,y,o,l,c,u],6),!this.isEmpty()):(this.#a.set([v,y,o,l,c,u],6),Math.abs(Math.atan2(y-l,v-o)-Math.atan2(_,b))<Math.PI/2?([o,l,c,u]=this.#a.subarray(2,6),this.#i.push(NaN,NaN,NaN,NaN,((o+c)/2-n)/i,((l+u)/2-a)/s),[o,l,v,y]=this.#a.subarray(14,18),this.#t.push(NaN,NaN,NaN,NaN,((v+o)/2-n)/i,((y+l)/2-a)/s),!0):([v,y,o,l,c,u]=this.#a.subarray(0,6),this.#i.push(((v+5*o)/6-n)/i,((y+5*l)/6-a)/s,((5*o+c)/6-n)/i,((5*l+u)/6-a)/s,((o+c)/2-n)/i,((l+u)/2-a)/s),[c,u,o,l,v,y]=this.#a.subarray(12,18),this.#t.push(((v+5*o)/6-n)/i,((y+5*l)/6-a)/s,((5*o+c)/6-n)/i,((5*l+u)/6-a)/s,((o+c)/2-n)/i,((l+u)/2-a)/s),!0))}toSVGPath(){if(this.isEmpty())return"";const e=this.#i,t=this.#t;if(isNaN(this.#a[6])&&!this.isEmpty())return this.#v();const n=[];n.push(`M${e[4]} ${e[5]}`);for(let a=6;a<e.length;a+=6)isNaN(e[a])?n.push(`L${e[a+4]} ${e[a+5]}`):n.push(`C${e[a]} ${e[a+1]} ${e[a+2]} ${e[a+3]} ${e[a+4]} ${e[a+5]}`);this.#y(n);for(let a=t.length-6;a>=6;a-=6)isNaN(t[a])?n.push(`L${t[a+4]} ${t[a+5]}`):n.push(`C${t[a]} ${t[a+1]} ${t[a+2]} ${t[a+3]} ${t[a+4]} ${t[a+5]}`);return this.#_(n),n.join(" ")}#v(){const[e,t,n,a]=this.#e,[i,s,o,l]=this.#g();return`M${(this.#a[2]-e)/n} ${(this.#a[3]-t)/a} L${(this.#a[4]-e)/n} ${(this.#a[5]-t)/a} L${i} ${s} L${o} ${l} L${(this.#a[16]-e)/n} ${(this.#a[17]-t)/a} L${(this.#a[14]-e)/n} ${(this.#a[15]-t)/a} Z`}#_(e){const t=this.#t;e.push(`L${t[4]} ${t[5]} Z`)}#y(e){const[t,n,a,i]=this.#e,s=this.#a.subarray(4,6),o=this.#a.subarray(16,18),[l,c,u,d]=this.#g();e.push(`L${(s[0]-t)/a} ${(s[1]-n)/i} L${l} ${c} L${u} ${d} L${(o[0]-t)/a} ${(o[1]-n)/i}`)}newFreeDrawOutline(e,t,n,a,i,s){return new Fz(e,t,n,a,i,s)}getOutlines(){const e=this.#i,t=this.#t,n=this.#a,[a,i,s,o]=this.#e,l=new Float32Array((this.#p?.length??0)+2);for(let d=0,h=l.length-2;d<h;d+=2)l[d]=(this.#p[d]-a)/s,l[d+1]=(this.#p[d+1]-i)/o;if(l[l.length-2]=(this.#s-a)/s,l[l.length-1]=(this.#o-i)/o,isNaN(n[6])&&!this.isEmpty())return this.#S(l);const c=new Float32Array(this.#i.length+24+this.#t.length);let u=e.length;for(let d=0;d<u;d+=2){if(isNaN(e[d])){c[d]=c[d+1]=NaN;continue}c[d]=e[d],c[d+1]=e[d+1]}u=this.#w(c,u);for(let d=t.length-6;d>=6;d-=6)for(let h=0;h<6;h+=2){if(isNaN(t[d+h])){c[u]=c[u+1]=NaN,u+=2;continue}c[u]=t[d+h],c[u+1]=t[d+h+1],u+=2}return this.#b(c,u),this.newFreeDrawOutline(c,l,this.#e,this.#d,this.#r,this.#n)}#S(e){const t=this.#a,[n,a,i,s]=this.#e,[o,l,c,u]=this.#g(),d=new Float32Array(36);return d.set([NaN,NaN,NaN,NaN,(t[2] Line truncated
`)}catch(e){throw console.error("Error converting PDF to text:",e),new Error(`Failed to convert PDF to text: ${e instanceof Error?e.message:"Unknown error"}`)}}async function $z(r,e=1.5){try{const t=await Uz(r),n=await Sx(t).promise,a=[];for(let i=1;i<=n.numPages;i++){const s=await n.getPage(i),o=s.getViewport({scale:e}),l=document.createElement("canvas"),c=l.getContext("2d");if(l.width=o.width,l.height=o.height,!c)throw new Error("Failed to get 2D context from canvas");const u=s.render({canvasContext:c,viewport:o,canvas:l});a.push(u.promise.then(()=>l.toDataURL(ea.PNG)))}return await Promise.all(a)}catch(t){throw console.error("Error converting PDF to images:",t),new Error(`Failed to convert PDF to images: ${t instanceof Error?t.message:"Unknown error"}`)}}function Gz(r,e="white"){return new Promise((t,n)=>{try{const a=new Image;a.onload=()=>{const i=document.createElement("canvas"),s=i.getContext("2d");if(!s){n(new Error("Failed to get 2D canvas context."));return}const o=a.naturalWidth||300,l=a.naturalHeight||300;i.width=o,i.height=l,e&&(s.fillStyle=e,s.fillRect(0,0,i.width,i.height)),s.drawImage(a,0,0,o,l),t(i.toDataURL(ea.PNG))},a.onerror=()=>{n(new Error("Failed to load SVG image. Ensure the SVG data is valid."))},a.src=r}catch(a){const s=`Error converting SVG to PNG: ${a instanceof Error?a.message:String(a)}`;console.error(s,a),n(new Error(s))}})}function zz(r){return r===ea.SVG}function qz(r,e="white"){return new Promise((t,n)=>{try{const a=new Image;a.onload=()=>{const i=document.createElement("canvas"),s=i.getContext("2d");if(!s){n(new Error("Failed to get 2D canvas context."));return}const o=a.naturalWidth||300,l=a.naturalHeight||300;i.width=o,i.height=l,e&&(s.fillStyle=e,s.fillRect(0,0,i.width,i.height)),s.drawImage(a,0,0,o,l),t(i.toDataURL(ea.PNG))},a.onerror=()=>{n(new Error("Failed to load WebP image. Ensure the WebP data is valid."))},a.src=r}catch(a){const s=`Error converting WebP to PNG: ${a instanceof Error?a.message:String(a)}`;console.error(s,a),n(new Error(s))}})}function Hz(r){return r===ea.WEBP}class rs{static async sendMessage(e,t={},n,a){const{stream:i,onChunk:s,onComplete:o,onError:l,onReasoningChunk:c,onToolCallChunk:u,onModel:d,onTimings:h,tools:p,temperature:m,max_tokens:g,dynatemp_range:b,dynatemp_exponent:_,top_k:v,top_p:y,min_p:E,xtc_probability:S,xtc_threshold:w,typ_p:C,repeat_last_n:x,repeat_penalty:N,presence_penalty:I,frequency_penalty:D,dry_multiplier:V,dry_base:q,dry_allowed_length:$,dry_penalty_last_n:K,samplers:z,backend_sampling:re,custom:W,timings_per_token:ie,disableReasoningParsing:k,excludeReasoningFromContext:B}=t,te=e.map(R=>{if("id"in R&&"convId"in R&&"timestamp"in R){const U=R;return rs.convertDbMessageToApiChatMessageData(U)}else return R}).filter(R=>R.role===Jt.SYSTEM?(typeof R.content=="string"?R.content:"").trim().length>0:!0);t.model&&!rr.modelSupportsVision(t.model)&&te.forEach(R=>{Array.isArray(R.content)&&(R.content=R.content.filter(U=>U.type===Zi.IMAGE_URL?(console.info(`[ChatService] Skipping image attachment in message history (model "${t.model}" does not support vision)`),!1):!0),R.content.length===1&&R.content[0].type===Zi.TEXT&&(R.content=R.content[0].text))});const O={messages:te.map(R=>{const U={role:R.role,content:R.content,tool_calls:R.tool_calls,tool_call_id:R.tool_call_id};return!B&&R.reasoning_content&&(U.reasoning_content=R.reasoning_content),U}),stream:i,return_progress:i?!0:void 0,tools:p&&p.length>0?p:void 0};if(t.model&&(O.model=t.model),O.reasoning_format=k?c3.NONE:c3.AUTO,m!==void 0&&(O.temperature=m),g!==void 0&&(O.max_tokens=g!==null&&g!==0?g:-1),b!==void 0&&(O.dynatemp_range=b),_!==void 0&&(O.dynatemp_exponent=_),v!==void 0&&(O.top_k=v),y!==void 0&&(O.top_p=y),E!==void 0&&(O.min_p=E),S!==void 0&&(O.xtc_probability=S),w!==void 0&&(O.xtc_threshold=w),C!==void 0&&(O.typ_p=C),x!==void 0&&(O.repeat_last_n=x),N!==void 0&&(O.repeat_penalty=N),I!==void 0&&(O.presence_penalty=I),D!==void 0&&(O.frequency_penalty=D),V!==void 0&&(O.dry_multiplier=V),q!==void 0&&(O.dry_base=q),$!==void 0&&(O.dry_allowed_length=$),K!==void 0&&(O.dry_penalty_last_n=K),z!==void 0&&(O.samplers=typeof z=="string"?z.split(";").filter(R=>R.trim()):z),re!==void 0&&(O.backend_sampling=re),ie!==void 0&&(O.timings_per_token=ie),W)try{const R=typeof W=="string"?JSON.parse(W):W;Object.assign(O,R)}catch(R){console.warn("Failed to parse custom parameters:",R)}try{const R=await fetch("./v1/chat/completions",{method:"POST",headers:A4(),body:JSON.stringify(O),signal:a});if(!R.ok){const U=await rs.parseErrorResponse(R);throw l&&l(U),U}if(i){await rs.handleStreamResponse(R,s,o,l,c,u,d,h,n,a);return}else return rs.handleNonStreamResponse(R,o,l,u,d)}catch(R){if(El(R)){console.log("Chat completion request was aborted");return}let U;throw R instanceof Error?R.name==="TypeError"&&R.message.includes("fetch")?(U=new Error("Unable to connect to server - please check if the server is running"),U.name="NetworkError"):R.message.includes("ECONNREFUSED")?(U=new Error("Connection refused - Line truncated
`);C=I.pop()||"";for(const D of I){if(u?.aborted)break;if(D.startsWith(lo.DATA)){const V=D.slice(6);if(V==="[DONE]"){_=!0;continue}try{const q=JSON.parse(V),$=q.choices[0]?.delta?.content,K=q.choices[0]?.delta?.reasoning_content,z=q.choices[0]?.delta?.tool_calls,re=q.timings,W=q.prompt_progress,ie=rs.extractModelName(q);ie&&!v&&(v=!0,o?.(ie)),W&&rs.notifyTimings(void 0,W,l),re&&(rs.notifyTimings(re,W,l),b=re),$&&(S(),p+=$,u?.aborted||t?.($)),K&&(S(),m+=K,u?.aborted||i?.(K)),w(z)}catch(q){console.error("Error parsing JSON chunk:",q)}}}if(u?.aborted)break}if(u?.aborted)return;if(_){S();const x=g.length>0?JSON.stringify(g):void 0;n?.(p,m||void 0,b,x)}}catch(C){const x=C instanceof Error?C:new Error("Stream error");throw a?.(x),x}finally{d.releaseLock()}}static async handleNonStreamResponse(e,t,n,a,i){try{const s=await e.text();if(!s.trim())throw new Error("No response received from server. Please try again.");const o=JSON.parse(s),l=rs.extractModelName(o);l&&i?.(l);const c=o.choices[0]?.message?.content||"",u=o.choices[0]?.message?.reasoning_content,d=o.choices[0]?.message?.tool_calls;let h;if(d&&d.length>0){const p=rs.mergeToolCallDeltas([],d);p.length>0&&(h=JSON.stringify(p),h&&a?.(h))}if(!c.trim()&&!h)throw new Error("No response received from server. Please try again.");return t?.(c,u,void 0,h),c}catch(s){const o=s instanceof Error?s:new Error("Parse error");throw n?.(o),o}}static mergeToolCallDeltas(e,t,n=0){const a=e.map(i=>({...i,function:i.function?{...i.function}:void 0}));for(const i of t){const s=typeof i.index=="number"&&i.index>=0?i.index+n:a.length;for(;a.length<=s;)a.push({function:void 0});const o=a[s];if(i.id&&(o.id=i.id),i.type&&(o.type=i.type),i.function){const l=o.function?{...o.function}:{};i.function.name&&(l.name=i.function.name),i.function.arguments&&(l.arguments=(l.arguments??"")+i.function.arguments),o.function=l}}return a}static convertDbMessageToApiChatMessageData(e){if(e.role===Jt.TOOL&&e.toolCallId)return{role:Jt.TOOL,content:e.content,tool_call_id:e.toolCallId};let t;if(e.toolCalls)try{t=JSON.parse(e.toolCalls)}catch{}if(!e.extra||e.extra.length===0){const h={role:e.role,content:e.content};return e.reasoningContent&&(h.reasoning_content=e.reasoningContent),t&&t.length>0&&(h.tool_calls=t),h}const n=[];e.content&&n.push({type:Zi.TEXT,text:e.content});const a=e.extra.filter(h=>h.type===Kr.IMAGE);for(const h of a)n.push({type:Zi.IMAGE_URL,image_url:{url:h.base64Url}});const i=e.extra.filter(h=>h.type===Kr.TEXT);for(const h of i)n.push({type:Zi.TEXT,text:Tp("File",h.name,h.content)});const s=e.extra.filter(h=>h.type===Kr.LEGACY_CONTEXT);for(const h of s)n.push({type:Zi.TEXT,text:Tp("File",h.name,h.content)});const o=e.extra.filter(h=>h.type===Kr.AUDIO);for(const h of o)n.push({type:Zi.INPUT_AUDIO,input_audio:{data:h.base64Data,format:h.mimeType.includes("wav")?"wav":"mp3"}});const l=e.extra.filter(h=>h.type===Kr.PDF);for(const h of l)if(h.processedAsImages&&h.images)for(let p=0;p<h.images.length;p++)n.push({type:Zi.IMAGE_URL,image_url:{url:h.images[p]}});else n.push({type:Zi.TEXT,text:Tp(Mre,h.name,h.content)});const c=e.extra.filter(h=>h.type===Kr.MCP_PROMPT);for(const h of c)n.push({type:Zi.TEXT,text:Tp(Dre,h.name,h.content,h.serverName)});const u=e.extra.filter(h=>h.type===Kr.MCP_RESOURCE);for(const h of u)n.push({type:Zi.TEXT,text:Tp(Pre,h.name,h.content,h.serverName)});const d={role:e.role,content:n};return e.reasoningContent&&(d.reasoning_content=e.reasoningContent),t&&t.length>0&&(d.tool_calls=t),d}static async parseErrorResponse(e){try{const t=await e.text(),n=JSON.parse(t),a=n.error?.message||"Unknown server error",i=new Error(a);return i.name=e.status===400?"ServerError":"HttpError",n.error&&"n_prompt_tokens"in n.error&&"n_ctx"in n.error&&(i.contextInfo={n_prompt_tokens:n.error.n_prompt_tokens,n_ctx:n.error.n_ctx}),i}catch{const t=new Error(`Server error (${e.status}): ${e.statusText}`);return t.name="HttpError",t}}static extractModelName(e){const t=c=>typeof c=="object"&&c!==null?c:void 0,n=c=>typeof c=="string"&&c.trim()?c.trim():void 0,a=t(e);if(!a)return;const i=n(a.model);if(i)return i;const s=Array.isArray(a.choices)?t(a.choices[0]):void 0;if(!s)return;const o=n(t(s.delta)?.model);if(o)return o;const l=n(t(s.message)?.model);if(l)return l}static notifyTimings(e,t,n){!n||!e&&!t||n(e,t)}}class Hh{static async list(){return p3(o0.LIST)}static async listRouter(){return p3(o0.LIST)}static async load(e,t){const n={model:e};return t&&t.length>0&&(n.extra_args=t),EO(o0.LOAD,n)}static async unload(e){return EO(o0.UNLOAD,{model:e})}static isModelLoaded(e){return e.status.value===mi.LOADED}static isModelLoading(e){return e.status.value===mi.LOADING}static parseModelId(e){const t={raw:e,orgName:null,modelName:null,params:null,activatedParams:null,quantization:null,tags:[]},n=e.indexOf(lae);let a;n!==rc?(t.quantization=e.slice(n+1)||null,a=e.slice(0,n)):a=e;const i=a.indexOf(oae);let s;i!==rc?(t.orgName=a.slice(0,i),s=a.slice(i+1)):s=a;const o=s.lastIndexOf(".");if(o!==rc&&!t.quan Line truncated
p-0 md:h-[64vh] md:max-h-[64vh] md:min-h-0 md:rounded-lg`,children:(b,_)=>{pr(c5e(b,{onSave:i,get initialSection(){return e.initialSection}}),v=>M(n,v,!0),()=>f(n))},$$slots:{default:!0}})}),T(u,h)},$$slots:{default:!0}})}),T(r,s),we()}function Zu(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>Kt("text-lg font-semibold",e.class));me(i,()=>z5,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-title",get class(){return f(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}T(r,a),we()}function fh(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>Kt(Sm(),e.class));me(i,()=>CQ,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-action",get class(){return f(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}T(r,a),we()}function Dx(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>Kt(Sm({variant:"outline"}),e.class));me(i,()=>xQ,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-cancel",get class(){return f(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}T(r,a),we()}var $Se=G("<div><!></div>");function Ju(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=$Se();zt(a,s=>({"data-slot":"alert-dialog-footer",class:s,...n}),[()=>Kt("mt-6 flex flex-row gap-2 sm:mt-0 sm:justify-end [&>*]:flex-1 sm:[&>*]:flex-none",e.class)]);var i=j(a);ke(i,()=>e.children??$e),H(a),pr(a,s=>t(s),()=>t()),T(r,a),we()}var GSe=G("<div><!></div>");function ed(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=GSe();zt(a,s=>({"data-slot":"alert-dialog-header",class:s,...n}),[()=>Kt("flex flex-col gap-2 text-center sm:text-left",e.class)]);var i=j(a);ke(i,()=>e.children??$e),H(a),pr(a,s=>t(s),()=>t()),T(r,a),we()}function jz(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>Kt("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e.class));me(i,()=>Av,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-overlay",get class(){return f(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}T(r,a),we()}var zSe=G("<!> <!>",1);function td(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class","portalProps"]);var a=se(),i=L(a);me(i,()=>Jc,(s,o)=>{o(s,ot(()=>e.portalProps,{children:(l,c)=>{var u=zSe(),d=L(u);jz(d,{});var h=ee(d,2);{let p=F(()=>Kt("fixed z-[999999] grid w-full gap-4 border bg-background p-6 shadow-lg duration-200","right-0 bottom-0 left-0 max-h-[100dvh] translate-x-0 translate-y-0 overflow-y-auto rounded-t-lg","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-bottom-full","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-bottom-full","sm:top-[50%] sm:right-auto sm:bottom-auto sm:left-[50%] sm:max-h-[100vh] sm:max-w-lg sm:translate-x-[-50%] sm:translate-y-[-50%] sm:rounded-lg","sm:data-[state=closed]:slide-out-to-bottom-0 sm:data-[state=closed]:zoom-out-95","sm:data-[state=open]:slide-in-from-bottom-0 sm:data-[state=open]:zoom-in-95",e.class));me(h,()=>MZ,(m,g)=>{g(m,ot({"data-slot":"alert-dialog-content",get class(){return f(p)}},()=>n,{get ref(){return t()},set ref(b){t(b)}}))})}T(l,u)},$$slots:{default:!0}}))}),T(r,a),we()}function rd(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>Kt("text-sm text-muted-foreground",e.class));me(i,()=>o9,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-description",get class(){return f(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}T(r,a),we()}const nd=EQ,qSe=Jc;var HSe=G("<!> ",1),VSe=G("<!> <!>",1),YSe=G("<!> <!>",1),WSe=G("<!> <!> <!>",1);function eh(r,e){Ee(e,!0);let t=Y(e,"confirmText",3,"Confirm"),n=Y(e,"cancelText",3,"Cancel"),a=Y(e,"variant",3,"default");function i(c){c.key===Tn.ENTER&&(c.preventDefault(),e.onConfirm()),e.onKeydown?.(c)}function s(c){c||e.onCancel()}var o=se(),l=L(o);me(l,()=>nd,(c,u)=>{u(c,{get open(){return e.open},onOpenChange:s,children:(d,h)=>{var p=se(),m=L(p);me(m,()=>td,(g,b)=>{b(g,{onkeydown:i,children:(_,v)=>{var y=WSe(),E=L(y);me(E,()=>ed,(x,N)=>{N(x,{children:(I,D)=>{var V=VSe(),q=L(V);me(q,()=>Zu,(K,z)=>{z(K,{class:"flex items-center gap-2",children:(re,W)=>{var ie=HSe(),k=L(ie);{var B=O=>{const R=F(()=>e.icon);var U=se(),Q=L(U);{let ne=F(()=>a()==="destructive"?"text-destructive":"");me(Q,()=>f(R),(ue,he)=>{he(ue,{get class(){return`h-5 w-5 ${f(ne)??""}`}})})}T(O,U)};le(k,O=>{e.icon&&O(B)})}var te=ee(k);Ce(()=>Ge(te,` ${e.title??""}`)),T(re,ie)},$$slots:{default:!0}})});var $=ee(q,2);me($,()=>rd,(K,z)=>{z(K,{children:(re,W)=>{et();var ie=Ot();Ce(()=>Ge(ie,e.des Line truncated
p-0 md:h-[64vh] md:max-h-[64vh] md:min-h-0 md:rounded-lg`,children:(b,_)=>{pr(c5e(b,{onSave:i,get initialSection(){return e.initialSection}}),v=>M(n,v,!0),()=>f(n))},$$slots:{default:!0}})}),T(u,h)},$$slots:{default:!0}})}),T(r,s),we()}function Ju(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>Kt("text-lg font-semibold",e.class));me(i,()=>z5,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-title",get class(){return f(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}T(r,a),we()}function fh(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>Kt(Sm(),e.class));me(i,()=>CQ,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-action",get class(){return f(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}T(r,a),we()}function Dx(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>Kt(Sm({variant:"outline"}),e.class));me(i,()=>xQ,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-cancel",get class(){return f(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}T(r,a),we()}var $Se=G("<div><!></div>");function ed(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=$Se();zt(a,s=>({"data-slot":"alert-dialog-footer",class:s,...n}),[()=>Kt("mt-6 flex flex-row gap-2 sm:mt-0 sm:justify-end [&>*]:flex-1 sm:[&>*]:flex-none",e.class)]);var i=j(a);ke(i,()=>e.children??$e),H(a),pr(a,s=>t(s),()=>t()),T(r,a),we()}var GSe=G("<div><!></div>");function td(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=GSe();zt(a,s=>({"data-slot":"alert-dialog-header",class:s,...n}),[()=>Kt("flex flex-col gap-2 text-center sm:text-left",e.class)]);var i=j(a);ke(i,()=>e.children??$e),H(a),pr(a,s=>t(s),()=>t()),T(r,a),we()}function jz(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>Kt("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e.class));me(i,()=>Av,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-overlay",get class(){return f(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}T(r,a),we()}var zSe=G("<!> <!>",1);function rd(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class","portalProps"]);var a=se(),i=L(a);me(i,()=>Jc,(s,o)=>{o(s,ot(()=>e.portalProps,{children:(l,c)=>{var u=zSe(),d=L(u);jz(d,{});var h=ee(d,2);{let p=F(()=>Kt("fixed z-[999999] grid w-full gap-4 border bg-background p-6 shadow-lg duration-200","right-0 bottom-0 left-0 max-h-[100dvh] translate-x-0 translate-y-0 overflow-y-auto rounded-t-lg","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-bottom-full","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-bottom-full","sm:top-[50%] sm:right-auto sm:bottom-auto sm:left-[50%] sm:max-h-[100vh] sm:max-w-lg sm:translate-x-[-50%] sm:translate-y-[-50%] sm:rounded-lg","sm:data-[state=closed]:slide-out-to-bottom-0 sm:data-[state=closed]:zoom-out-95","sm:data-[state=open]:slide-in-from-bottom-0 sm:data-[state=open]:zoom-in-95",e.class));me(h,()=>MZ,(m,g)=>{g(m,ot({"data-slot":"alert-dialog-content",get class(){return f(p)}},()=>n,{get ref(){return t()},set ref(b){t(b)}}))})}T(l,u)},$$slots:{default:!0}}))}),T(r,a),we()}function nd(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>Kt("text-sm text-muted-foreground",e.class));me(i,()=>o9,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-description",get class(){return f(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}T(r,a),we()}const ad=EQ,qSe=Jc;var HSe=G("<!> ",1),VSe=G("<!> <!>",1),YSe=G("<!> <!>",1),WSe=G("<!> <!> <!>",1);function eh(r,e){Ee(e,!0);let t=Y(e,"confirmText",3,"Confirm"),n=Y(e,"cancelText",3,"Cancel"),a=Y(e,"variant",3,"default");function i(c){c.key===Tn.ENTER&&(c.preventDefault(),e.onConfirm()),e.onKeydown?.(c)}function s(c){c||e.onCancel()}var o=se(),l=L(o);me(l,()=>ad,(c,u)=>{u(c,{get open(){return e.open},onOpenChange:s,children:(d,h)=>{var p=se(),m=L(p);me(m,()=>rd,(g,b)=>{b(g,{onkeydown:i,children:(_,v)=>{var y=WSe(),E=L(y);me(E,()=>td,(x,N)=>{N(x,{children:(I,D)=>{var V=VSe(),q=L(V);me(q,()=>Ju,(K,z)=>{z(K,{class:"flex items-center gap-2",children:(re,W)=>{var ie=HSe(),k=L(ie);{var B=O=>{const R=F(()=>e.icon);var U=se(),Q=L(U);{let ne=F(()=>a()==="destructive"?"text-destructive":"");me(Q,()=>f(R),(ue,he)=>{he(ue,{get class(){return`h-5 w-5 ${f(ne)??""}`}})})}T(O,U)};le(k,O=>{e.icon&&O(B)})}var te=ee(k);Ce(()=>Ge(te,` ${e.title??""}`)),T(re,ie)},$$slots:{default:!0}})});var $=ee(q,2);me($,()=>nd,(K,z)=>{z(K,{children:(re,W)=>{et();var ie=Ot();Ce(()=>Ge(ie,e.des Line truncated
as a JSON file.`);T(ne,ue)},Q=ne=>{var ue=Ot(`Choose which conversations you want to import. Selected conversations will be merged
with your existing conversations.`);T(ne,ue)};le(R,ne=>{e.mode==="export"?ne(U):ne(Q,!1)})}T(B,O)},$$slots:{default:!0}})}),T($,z)},$$slots:{default:!0}})});var D=ee(I,2);pr(QCe(D,{get conversations(){return e.conversations},get messageCountMap(){return t()},get mode(){return e.mode},get onCancel(){return e.onCancel},get onConfirm(){return e.onConfirm}}),V=>M(a,V,!0),()=>f(a)),T(C,N)},$$slots:{default:!0}})}),T(b,v)},$$slots:{default:!0}})}),T(u,h)},$$slots:{default:!0}})}),T(r,s),we()}var xEe=G('<div data-slot="table-container" class="relative w-full overflow-x-auto"><table><!></table></div>');function REe(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=xEe(),i=j(a);zt(i,o=>({"data-slot":"table",class:o,...n}),[()=>Kt("w-full caption-bottom text-sm",e.class)]);var s=j(i);ke(s,()=>e.children??$e),H(i),pr(i,o=>t(o),()=>t()),H(a),T(r,a),we()}var OEe=G("<tbody><!></tbody>");function NEe(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=OEe();zt(a,s=>({"data-slot":"table-body",class:s,...n}),[()=>Kt("[&_tr:last-child]:border-0",e.class)]);var i=j(a);ke(i,()=>e.children??$e),H(a),pr(a,s=>t(s),()=>t()),T(r,a),we()}var IEe=G("<td><!></td>");function aa(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=IEe();zt(a,s=>({"data-slot":"table-cell",class:s,...n}),[()=>Kt("bg-clip-padding p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pe-0",e.class)]);var i=j(a);ke(i,()=>e.children??$e),H(a),pr(a,s=>t(s),()=>t()),T(r,a),we()}var kEe=G("<th><!></th>");function zD(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=kEe();zt(a,s=>({"data-slot":"table-head",class:s,...n}),[()=>Kt("h-10 bg-clip-padding px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pe-0",e.class)]);var i=j(a);ke(i,()=>e.children??$e),H(a),pr(a,s=>t(s),()=>t()),T(r,a),we()}var MEe=G("<thead><!></thead>");function DEe(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=MEe();zt(a,s=>({"data-slot":"table-header",class:s,...n}),[()=>Kt("[&_tr]:border-b",e.class)]);var i=j(a);ke(i,()=>e.children??$e),H(a),pr(a,s=>t(s),()=>t()),T(r,a),we()}var PEe=G("<tr><!></tr>");function _s(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=PEe();zt(a,s=>({"data-slot":"table-row",class:s,...n}),[()=>Kt("border-b transition-colors data-[state=selected]:bg-muted hover:[&,&>svelte-css-wrapper]:[&>th,td]:bg-muted/50",e.class)]);var i=j(a);ke(i,()=>e.children??$e),H(a),pr(a,s=>t(s),()=>t()),T(r,a),we()}var LEe=G("<!> <!>",1),FEe=G('<div class="flex items-center justify-center py-8"><div class="text-sm text-muted-foreground">Loading model information...</div></div>'),BEe=G('<div class="inline-flex items-center gap-2"><span class="resizable-text-container min-w-0 flex-1 truncate"> </span> <!></div>'),UEe=G("<!> <!>",1),$Ee=G('<span class="resizable-text-container min-w-0 flex-1 truncate"> </span> <!>',1),GEe=G("<!> <!>",1),zEe=G("<!> <!>",1),qEe=G("<!> <!>",1),HEe=G("<!> <!>",1),VEe=G("<!> <!>",1),YEe=G("<!> <!>",1),WEe=G("<!> <!>",1),jEe=G("<!> <!>",1),KEe=G("<!> <!>",1),XEe=G("<!> <!>",1),QEe=G('<div class="flex flex-wrap gap-1"><!></div>'),ZEe=G("<!> <!>",1),JEe=G("<!> <!>",1),e2e=G('<div class="rounded-md bg-muted p-4"><pre class="font-mono text-xs whitespace-pre-wrap"> </pre></div>'),t2e=G("<!> <!>",1),r2e=G("<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>",1),n2e=G("<!> <!>",1),a2e=G('<div class="flex items-center justify-center py-8"><div class="text-sm text-muted-foreground">No model information available</div></div>'),i2e=G(`<style>@container (max-width: 56rem) {
.resizable-text-container {
max-width: calc(100vw - var(--threshold));
}
}</style> <!> <div class="space-y-6 py-4"><!></div>`,1);function Qz(r,e){Ee(e,!0);let t=Y(e,"open",15),n=Y(e,"modelId",3,null),a=F(()=>Xn.isRouterMode),i=_e(null),s=_e(!1),o=F(()=>f(a)&&n()?f(i):Xn.props),l=F(()=>f(a)&&n()?n():rr.singleModelName),c=F(to),u=F(Nx),d=F(()=>f(a)&&n()?f(c).find(g=>g.model===n())??null:f(c)[0]??null),h=F(()=>f(d)?.id?rr.getModelModalitiesArray(f(d).id):[]);Nt(()=>{t()&&f(c).length===0&&rr.fetch()}),Nt(()=>{t()&&f(a)&&n()&&(M(s,!0),rr.fetchModelProps(n()).then(g=>{M(i,g,!0)}).catch(()=>{M(i,null)}).finally(()=>{M(s,!1)})),t()||M(i,null)});var p=se(),m=L(p);me(m,()=>hh,(g,b)=>{b(g,{get onOpenChange(){return e.onOpenChange},get open(){return t()},set open(_){t(_)},children:(_,v)=>{var y=se(),E=L(y);me(E,()=>dh,(S,w)=>{w(S,{class:"@container z-9999 !max-h-[80dvh] !max-w-[60rem] max-w-full",children:(C,x)=>{var N=i2e(),I=ee(L(N),2);me(I,()=>ap,(K,z)=>{z(K,{children:(re,W)=>{var ie=LEe(),k=L(ie);me(k,()=>np,(te,O)=>{O(te,{children:(R,U)=>{et();var Q=Ot("Model Information");T(R,Q)},$$slots:{default:!0}})});var B=ee(k,2);me(B,()=>ip,(te,O)=>{O(te,{children:(R,U)=>{et();var Q=Ot("Current model details and capabilities");T(R,Q)},$$slots:{default:!0}})}),T(re,ie)},$$slots:{default:!0}})});var D=ee(I,2),V=j(D);{var q=K=>{var z=FEe();T(K,z)},$=K=>{var z=se(),re=L(z);{var W=k=>{const B=F(()=>f(d).meta);var te=se(),O=L(te);{var R=U=>{var Q=se(),ne=L(Q);me(ne,()=>REe,(ue,he)=>{he(ue,{children:(be,Z)=>{var ae=n2e(),fe=L(ae);me(fe,()=>DEe,(ye,Te)=>{Te(ye,{children:(Oe,Ne)=>{var Ue=se(),Fe=L(Ue);me(Fe,()=>_s,(Ke,He)=>{He(Ke,{children:(it,st)=>{var dt=UEe(),Ae=L(dt);me(Ae,()=>zD,(ht,ze)=>{ze(ht,{class:"w-[10rem]",children:(mt,At)=>{et();var xt=Ot("Model");T(mt,xt)},$$slots:{default:!0}})});var Le=ee(Ae,2);me(Le,()=>zD,(ht,ze)=>{ze(ht,{children:(mt,At)=>{var xt=BEe(),qt=j(xt);ds(qt,"",{},{"--threshold":"12rem"});var ar=j(qt,!0);H(qt);var fr=ee(qt,2);{let ct=F(()=>f(l)||""),Rt=F(()=>!!f(l));Df(fr,{get text(){return f(ct)},get canCopy(){return f(Rt)},ariaLabel:"Copy model name to clipboard"})}H(xt),Ce(()=>Ge(ar,f(l))),T(mt,xt)},$$slots:{default:!0}})}),T(it,dt)},$$slots:{default:!0}})}),T(Oe,Ue)},$$slots:{default:!0}})});var pe=ee(fe,2);me(pe,()=>NEe,(ye,Te)=>{Te(ye,{children:(Oe,Ne)=>{var Ue=r2e(),Fe=L(Ue);me(Fe,()=>_s,(Et,It)=>{It(Et,{children:(xe,Qe)=>{var ft=GEe(),Ct=L(ft);me(Ct,()=>aa,(Dt,bt)=>{bt(Dt,{class:"h-10 align-middle font-medium",children:(wt,vt)=>{et();var kt=Ot("File Path");T(wt,kt)},$$slots:{default:!0}})});var Lt=ee(Ct,2);me(Lt,()=>aa,(Dt,bt)=>{bt(Dt,{class:"inline-flex h-10 items-center gap-2 align-middle font-mono text-xs",children:(wt,vt)=>{var kt=$Ee(),dr=L(kt);ds(dr,"",{},{"--threshold":"14rem"});var In=j(dr,!0);H(dr);var Er=ee(dr,2);Df(Er,{get text(){return f(o).model_path},ariaLabel:"Copy model path to clipboard"}),Ce(()=>Ge(In,f(o).model_path)),T(wt,kt)},$$slots:{default:!0}})}),T(xe,ft)},$$slots:{default:!0}})});var Ke=ee(Fe,2);{var He=Et=>{var It=se(),xe=L(It);me(xe,()=>_s,(Qe,ft)=>{ft(Qe,{children:(Ct,Lt)=>{var Dt=zEe(),bt=L(Dt);me(bt,()=>aa,(vt,kt)=>{kt(vt,{class:"h-10 align-middle font-medium",children:(dr,In)=>{et();var Er=Ot("Context Size");T(dr,Er)},$$slots:{default:!0}})});var wt=ee(bt,2);me(wt,()=>aa,(vt,kt)=>{kt(vt,{children:(dr,In)=>{et();var Er=Ot();Ce(Fn=>Ge(Er,`${Fn??""} tokens`),[()=>d0(f(o).default_generation_settings.n_ctx)]),T(dr,Er)},$$slots:{default:!0}})}),T(Ct,Dt)},$$slots:{default:!0}})}),T(Et,It)},it=Et=>{var It=se(),xe=L(It);me(xe,()=>_s,(Qe,ft)=>{ft(Qe,{children:(Ct,Lt)=>{var Dt=qEe(),bt=L(Dt);me(bt,()=>aa,(vt,kt)=>{kt(vt,{class:"h-10 align-middle font-medium text-red-500",children:(dr,In)=>{et();var Er=Ot("Context Size");T(dr,Er)},$$slots:{default:!0}})});var wt=ee(bt,2);me(wt,()=>aa,(vt,kt)=>{kt(vt,{class:"text-red-500",children:(dr,In)=>{et();var Er=Ot("Not available");T(dr,Er)},$$slots:{default:!0}})}),T(Ct,Dt)},$$slots:{default:!0}})}),T(Et,It)};le(Ke,Et=>{f(o)?.default_generation_settings?.n_ctx?Et(He):Et(it,!1)})}var st=ee(Ke,2);{var dt=Et=>{var It=se(),xe=L(It);me(xe,()=>_s,(Qe,ft)=>{ft(Qe,{children:(Ct,Lt)=>{var Dt=HEe(),bt=L(Dt);me(bt,()=>aa,(vt,kt)=>{kt(vt,{class:"h-10 align-middle font-medium",children:(dr,In)=>{et();var Er=Ot("Training Context");T(dr,Er)},$$slots:{default:!0}})});var wt=ee(bt,2);me(wt,()=>aa,(vt,kt)=>{kt(vt,{children:(dr,In)=>{et();var Er=Ot();Ce(Fn=>Ge(Er,`${Fn??""} tokens`),[()=>d0(f(B).n_ctx_train)]),T(dr,Er)},$$slots:{default:!0}})}),T(Ct,Dt)},$$slots:{default:!0}})}),T(Et,It)};le(st,Et=>{f(B)?.n_ctx_train&&Et(dt)})}var Ae=ee(st,2);{var Le=Et=>{var It=se(),xe=L(It);me(xe,()=>_s,(Qe,ft)=>{ft(Qe,{children:(Ct,Lt)=>{var Dt=VEe(),bt=L(Dt);me(bt,()=>aa,(vt,kt)=>{kt(vt,{class:"h-10 align-middle font-medium",children:(dr,In)=>{et();var Er=Ot("Model Size");T(dr,Er)},$$slots:{default:!0}})});var wt=ee(bt,2);me(wt,()=>aa,(vt,kt)=>{kt(vt,{children:(dr,In)=>{et();var Er=Ot();Ce(Fn=>Ge(Er,Fn),[()=>ub(f(B).size)]),T(dr,Er)},$$slots:{default:!0}})}),T(Ct,Dt)},$$slots:{default:!0}})}),T(Et,It)};le(Ae,Et=>{f(B)?.size&&Et(Le)})}vaLine truncated
}</style> <!> <div class="space-y-6 py-4"><!></div>`,1);function Qz(r,e){Ee(e,!0);let t=Y(e,"open",15),n=Y(e,"modelId",3,null),a=F(()=>Xn.isRouterMode),i=_e(null),s=_e(!1),o=F(()=>f(a)&&n()?f(i):Xn.props),l=F(()=>f(a)&&n()?n():rr.singleModelName),c=F(to),u=F(Nx),d=F(()=>f(a)&&n()?f(c).find(g=>g.model===n())??null:f(c)[0]??null),h=F(()=>f(d)?.id?rr.getModelModalitiesArray(f(d).id):[]);Nt(()=>{t()&&f(c).length===0&&rr.fetch()}),Nt(()=>{t()&&f(a)&&n()&&(M(s,!0),rr.fetchModelProps(n()).then(g=>{M(i,g,!0)}).catch(()=>{M(i,null)}).finally(()=>{M(s,!1)})),t()||M(i,null)});var p=se(),m=L(p);me(m,()=>hh,(g,b)=>{b(g,{get onOpenChange(){return e.onOpenChange},get open(){return t()},set open(_){t(_)},children:(_,v)=>{var y=se(),E=L(y);me(E,()=>dh,(S,w)=>{w(S,{class:"@container z-9999 !max-h-[80dvh] !max-w-[60rem] max-w-full",children:(C,x)=>{var N=i2e(),I=ee(L(N),2);me(I,()=>ap,(K,z)=>{z(K,{children:(re,W)=>{var ie=LEe(),k=L(ie);me(k,()=>np,(te,O)=>{O(te,{children:(R,U)=>{et();var Q=Ot("Model Information");T(R,Q)},$$slots:{default:!0}})});var B=ee(k,2);me(B,()=>ip,(te,O)=>{O(te,{children:(R,U)=>{et();var Q=Ot("Current model details and capabilities");T(R,Q)},$$slots:{default:!0}})}),T(re,ie)},$$slots:{default:!0}})});var D=ee(I,2),V=j(D);{var q=K=>{var z=FEe();T(K,z)},$=K=>{var z=se(),re=L(z);{var W=k=>{const B=F(()=>f(d).meta);var te=se(),O=L(te);{var R=U=>{var Q=se(),ne=L(Q);me(ne,()=>REe,(ue,he)=>{he(ue,{children:(be,Z)=>{var ae=n2e(),fe=L(ae);me(fe,()=>DEe,(ye,Te)=>{Te(ye,{children:(Oe,Ne)=>{var Ue=se(),Fe=L(Ue);me(Fe,()=>_s,(Ke,He)=>{He(Ke,{children:(it,st)=>{var dt=UEe(),Ae=L(dt);me(Ae,()=>zD,(ht,ze)=>{ze(ht,{class:"w-[10rem]",children:(mt,At)=>{et();var xt=Ot("Model");T(mt,xt)},$$slots:{default:!0}})});var Le=ee(Ae,2);me(Le,()=>zD,(ht,ze)=>{ze(ht,{children:(mt,At)=>{var xt=BEe(),qt=j(xt);ds(qt,"",{},{"--threshold":"12rem"});var ar=j(qt,!0);H(qt);var fr=ee(qt,2);{let ct=F(()=>f(l)||""),Rt=F(()=>!!f(l));Df(fr,{get text(){return f(ct)},get canCopy(){return f(Rt)},ariaLabel:"Copy model name to clipboard"})}H(xt),Ce(()=>Ge(ar,f(l))),T(mt,xt)},$$slots:{default:!0}})}),T(it,dt)},$$slots:{default:!0}})}),T(Oe,Ue)},$$slots:{default:!0}})});var pe=ee(fe,2);me(pe,()=>NEe,(ye,Te)=>{Te(ye,{children:(Oe,Ne)=>{var Ue=r2e(),Fe=L(Ue);me(Fe,()=>_s,(Et,It)=>{It(Et,{children:(xe,Qe)=>{var ft=GEe(),Ct=L(ft);me(Ct,()=>aa,(Dt,bt)=>{bt(Dt,{class:"h-10 align-middle font-medium",children:(wt,vt)=>{et();var kt=Ot("File Path");T(wt,kt)},$$slots:{default:!0}})});var Lt=ee(Ct,2);me(Lt,()=>aa,(Dt,bt)=>{bt(Dt,{class:"inline-flex h-10 items-center gap-2 align-middle font-mono text-xs",children:(wt,vt)=>{var kt=$Ee(),dr=L(kt);ds(dr,"",{},{"--threshold":"14rem"});var In=j(dr,!0);H(dr);var Er=ee(dr,2);Df(Er,{get text(){return f(o).model_path},ariaLabel:"Copy model path to clipboard"}),Ce(()=>Ge(In,f(o).model_path)),T(wt,kt)},$$slots:{default:!0}})}),T(xe,ft)},$$slots:{default:!0}})});var Ke=ee(Fe,2);{var He=Et=>{var It=se(),xe=L(It);me(xe,()=>_s,(Qe,ft)=>{ft(Qe,{children:(Ct,Lt)=>{var Dt=zEe(),bt=L(Dt);me(bt,()=>aa,(vt,kt)=>{kt(vt,{class:"h-10 align-middle font-medium",children:(dr,In)=>{et();var Er=Ot("Context Size");T(dr,Er)},$$slots:{default:!0}})});var wt=ee(bt,2);me(wt,()=>aa,(vt,kt)=>{kt(vt,{children:(dr,In)=>{et();var Er=Ot();Ce(Fn=>Ge(Er,`${Fn??""} tokens`),[()=>d0(f(o).default_generation_settings.n_ctx)]),T(dr,Er)},$$slots:{default:!0}})}),T(Ct,Dt)},$$slots:{default:!0}})}),T(Et,It)},it=Et=>{var It=se(),xe=L(It);me(xe,()=>_s,(Qe,ft)=>{ft(Qe,{children:(Ct,Lt)=>{var Dt=qEe(),bt=L(Dt);me(bt,()=>aa,(vt,kt)=>{kt(vt,{class:"h-10 align-middle font-medium text-red-500",children:(dr,In)=>{et();var Er=Ot("Context Size");T(dr,Er)},$$slots:{default:!0}})});var wt=ee(bt,2);me(wt,()=>aa,(vt,kt)=>{kt(vt,{class:"text-red-500",children:(dr,In)=>{et();var Er=Ot("Not available");T(dr,Er)},$$slots:{default:!0}})}),T(Ct,Dt)},$$slots:{default:!0}})}),T(Et,It)};le(Ke,Et=>{f(o)?.default_generation_settings?.n_ctx?Et(He):Et(it,!1)})}var st=ee(Ke,2);{var dt=Et=>{var It=se(),xe=L(It);me(xe,()=>_s,(Qe,ft)=>{ft(Qe,{children:(Ct,Lt)=>{var Dt=HEe(),bt=L(Dt);me(bt,()=>aa,(vt,kt)=>{kt(vt,{class:"h-10 align-middle font-medium",children:(dr,In)=>{et();var Er=Ot("Training Context");T(dr,Er)},$$slots:{default:!0}})});var wt=ee(bt,2);me(wt,()=>aa,(vt,kt)=>{kt(vt,{children:(dr,In)=>{et();var Er=Ot();Ce(Fn=>Ge(Er,`${Fn??""} tokens`),[()=>d0(f(B).n_ctx_train)]),T(dr,Er)},$$slots:{default:!0}})}),T(Ct,Dt)},$$slots:{default:!0}})}),T(Et,It)};le(st,Et=>{f(B)?.n_ctx_train&&Et(dt)})}var Ae=ee(st,2);{var Le=Et=>{var It=se(),xe=L(It);me(xe,()=>_s,(Qe,ft)=>{ft(Qe,{children:(Ct,Lt)=>{var Dt=VEe(),bt=L(Dt);me(bt,()=>aa,(vt,kt)=>{kt(vt,{class:"h-10 align-middle font-medium",children:(dr,In)=>{et();var Er=Ot("Model Size");T(dr,Er)},$$slots:{default:!0}})});var wt=ee(bt,2);me(wt,()=>aa,(vt,kt)=>{kt(vt,{children:(dr,In)=>{et();var Er=Ot();Ce(Fn=>Ge(Er,Fn),[()=>ub(f(B).size)]),T(dr,Er)},$$slots:{default:!0}})}),T(Ct,Dt)},$$slots:{default:!0}})}),T(Et,It)};le(Ae,Et=>{f(B)?.size&&Et(Le)})}vaLine truncated
transform: ${c} translate(${(1-g)*d}${h}, ${(1-g)*p}${m});
opacity: ${l-u*b}`}}function fTe(r,{delay:e=0,duration:t=400,easing:n=qx,axis:a="y"}={}){const i=getComputedStyle(r),s=+i.opacity,o=a==="y"?"height":"width",l=parseFloat(i[o]),c=a==="y"?["top","bottom"]:["left","right"],u=c.map(_=>`${_[0].toUpperCase()}${_.slice(1)}`),d=parseFloat(i[`padding${u[0]}`]),h=parseFloat(i[`padding${u[1]}`]),p=parseFloat(i[`margin${u[0]}`]),m=parseFloat(i[`margin${u[1]}`]),g=parseFloat(i[`border${u[0]}Width`]),b=parseFloat(i[`border${u[1]}Width`]);return{delay:e,duration:t,easing:n,css:_=>`overflow: hidden;opacity: ${Math.min(_*20,1)*s};${o}: ${_*l}px;padding-${c[0]}: ${_*d}px;padding-${c[1]}: ${_*h}px;margin-${c[0]}: ${_*p}px;margin-${c[1]}: ${_*m}px;border-${c[0]}-width: ${_*g}px;border-${c[1]}-width: ${_*b}px;min-${o}: 0`}}function YD(r,{delay:e=0,duration:t=400,easing:n=qx,start:a=0,opacity:i=0}={}){const s=getComputedStyle(r),o=+s.opacity,l=s.transform==="none"?"":s.transform,c=1-a,u=o*(1-i);return{delay:e,duration:t,easing:n,css:(d,h)=>`
transform: ${l} scale(${1-c*h});
opacity: ${o-u*h}
`}}var pTe=G("<input/>"),mTe=G("<input/>");function cl(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Y(e,"value",15),a=Y(e,"files",15),i=Ye(e,["$$slots","$$events","$$legacy","ref","value","type","files","class"]);var s=se(),o=L(s);{var l=u=>{var d=pTe();zt(d,h=>({"data-slot":"input",class:h,type:"file",...i}),[()=>Kt("flex h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 pt-1.5 text-sm font-medium shadow-xs ring-offset-background transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e.class)],void 0,void 0,void 0,!0),pr(d,h=>t(h),()=>t()),nj(d,a),mm(d,n),T(u,d)},c=u=>{var d=mTe();zt(d,h=>({"data-slot":"input",class:h,style:"backdrop-filter: blur(0.5rem);",type:e.type,...i}),[()=>Kt("flex h-9 w-full min-w-0 rounded-md border border-input bg-background px-3 py-1 text-base shadow-xs ring-offset-background transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e.class)],void 0,void 0,void 0,!0),pr(d,h=>t(h),()=>t()),mm(d,n),T(u,d)};le(o,u=>{e.type==="file"?u(l):u(c,!1)})}T(r,s),we()}function Qo(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>Kt("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e.class));me(i,()=>ite,(o,l)=>{l(o,ot({"data-slot":"label",get class(){return f(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}T(r,a),we()}var gTe=G('<span class="text-destructive">*</span>'),_Te=G('<span class="text-xs text-muted-foreground/50">...</span>'),bTe=G("<span> <!></span> <!>",1),vTe=G('<button type="button"> </button>'),yTe=G('<div class="absolute top-full right-0 left-0 z-10 mt-1 max-h-32 overflow-y-auto rounded-lg border border-border/50 bg-background shadow-lg"></div>'),STe=G('<div class="relative grid gap-1"><!> <!> <!></div>');function ETe(r,e){Ee(e,!0);let t=Y(e,"value",3,""),n=Y(e,"suggestions",19,()=>[]),a=Y(e,"isLoadingSuggestions",3,!1),i=Y(e,"isAutocompleteActive",3,!1),s=Y(e,"autocompleteIndex",3,0);var o=STe(),l=j(o);Qo(l,{get for(){return`arg-${e.argument.name??""}`},class:"mb-1 text-muted-foreground",children:(h,p)=>{var m=bTe(),g=L(m),b=j(g),_=ee(b);{var v=S=>{var w=gTe();T(S,w)};le(_,S=>{e.argument.required&&S(v)})}H(g);var y=ee(g,2);{var E=S=>{var w=_Te();T(S,w)};le(y,S=>{a()&&S(E)})}Ce(()=>Ge(b,`${e.argument.name??""} `)),T(h,m)},$$slots:{default:!0}});var c=ee(l,2);{let h=F(()=>e.argument.description||e.argument.name);cl(c,{get id(){return`arg-${e.argument.name??""}`},type:"text",get value(){return t()},oninput:p=>e.onInput(p.currentTarget.value),get onkeydown(){return e.onKeydown},get onblur(){return e.onBlur},get onfocus(){return e.onFocus},get placeholder(){return f(h)},get required(){return e.argument.required},autocomplete:"off"})}var u=ee(c,2);{var d=h=>{var p=yTe();Ir(p,22,n,m=>m,(m,g,b)=>{var _=vTe();_.__mousedown=()=>e.onSelectSuggestion(g);var v=j(_,!0);H(_),Ce(()=>{yt(_,1,`w-full px-3 py-1.5 text-left text-sm hover:bg-accent ${f(b)===s()?"bg-accent":""}`),Ge(v,g)}),T(m,_)}),H(p),ai(3,p,()=>Ko,()=>({y:-5,duration:100})),T(h,p)};le(u,h=>{i()&&n().length>0&&h(d)})}H(o),T(r,o),we()}Ln(["mousedown"]);var wTe=G('<div class="flex items-start gap-2 rounded-lg border border-destructive/50 bg-destructive/10 px-3 py-2 text-sm text-destructive" role="alert"><span class="shrink-0">⚠</span> <span> </span></div>'),TTe=G('<form class="space-y-3 pt-4"><!> <!> <div class="mt-8 flex justify-end gap-2"><!> <!></div></form>');function CTe(r,e){Ee(e,!0);var t=TTe(),n=j(t);Ir(n,17,()=>e.prompt.arguments??[],c=>c.name,(c,u)=>{{let d=F(()=>e.promptArgs[f(u).name]??""),h=F(()=>e.suggestions[f(u).name]??[]),p=F(()=>e.loadingSuggestions[f(u).name]??!1),m=F(()=>e.activeAutocomplete===f(u).name),g=F(()=>e.activeAutocomplete===f(u).name?e.autocompleteIndex:0);ETe(c,{get argument(){return f(u)},get value(){return f(d)},get suggestions(){return f(h)},get isLoadingSuggestions(){return f(p)},get isAutocompleteActive(){return f(m)},get autocompleteIndex(){return f(g)},onInput:b=>e.onArgInput(f(u).name,b),onKeydown:b=>e.onArgKeydown(b,f(u).name),onBlur:()=>e.onArgBlur(f(u).name),onFocus:()=>e.onArgFocus(f(u).name),onSelectSuggestion:b=>e.onSelectSuggestion(f(u).name,b)})}});var a=ee Line truncated
`}}var pTe=G("<input/>"),mTe=G("<input/>");function cl(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Y(e,"value",15),a=Y(e,"files",15),i=Ye(e,["$$slots","$$events","$$legacy","ref","value","type","files","class"]);var s=se(),o=L(s);{var l=u=>{var d=pTe();zt(d,h=>({"data-slot":"input",class:h,type:"file",...i}),[()=>Kt("flex h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 pt-1.5 text-sm font-medium shadow-xs ring-offset-background transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e.class)],void 0,void 0,void 0,!0),pr(d,h=>t(h),()=>t()),nj(d,a),mm(d,n),T(u,d)},c=u=>{var d=mTe();zt(d,h=>({"data-slot":"input",class:h,style:"backdrop-filter: blur(0.5rem);",type:e.type,...i}),[()=>Kt("flex h-9 w-full min-w-0 rounded-md border border-input bg-background px-3 py-1 text-base shadow-xs ring-offset-background transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e.class)],void 0,void 0,void 0,!0),pr(d,h=>t(h),()=>t()),mm(d,n),T(u,d)};le(o,u=>{e.type==="file"?u(l):u(c,!1)})}T(r,s),we()}function Qo(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>Kt("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e.class));me(i,()=>ite,(o,l)=>{l(o,ot({"data-slot":"label",get class(){return f(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}T(r,a),we()}var gTe=G('<span class="text-destructive">*</span>'),_Te=G('<span class="text-xs text-muted-foreground/50">...</span>'),bTe=G("<span> <!></span> <!>",1),vTe=G('<button type="button"> </button>'),yTe=G('<div class="absolute top-full right-0 left-0 z-10 mt-1 max-h-32 overflow-y-auto rounded-lg border border-border/50 bg-background shadow-lg"></div>'),STe=G('<div class="relative grid gap-1"><!> <!> <!></div>');function ETe(r,e){Ee(e,!0);let t=Y(e,"value",3,""),n=Y(e,"suggestions",19,()=>[]),a=Y(e,"isLoadingSuggestions",3,!1),i=Y(e,"isAutocompleteActive",3,!1),s=Y(e,"autocompleteIndex",3,0);var o=STe(),l=j(o);Qo(l,{get for(){return`arg-${e.argument.name??""}`},class:"mb-1 text-muted-foreground",children:(h,p)=>{var m=bTe(),g=L(m),b=j(g),_=ee(b);{var v=S=>{var w=gTe();T(S,w)};le(_,S=>{e.argument.required&&S(v)})}H(g);var y=ee(g,2);{var E=S=>{var w=_Te();T(S,w)};le(y,S=>{a()&&S(E)})}Ce(()=>Ge(b,`${e.argument.name??""} `)),T(h,m)},$$slots:{default:!0}});var c=ee(l,2);{let h=F(()=>e.argument.description||e.argument.name);cl(c,{get id(){return`arg-${e.argument.name??""}`},type:"text",get value(){return t()},oninput:p=>e.onInput(p.currentTarget.value),get onkeydown(){return e.onKeydown},get onblur(){return e.onBlur},get onfocus(){return e.onFocus},get placeholder(){return f(h)},get required(){return e.argument.required},autocomplete:"off"})}var u=ee(c,2);{var d=h=>{var p=yTe();Ir(p,22,n,m=>m,(m,g,b)=>{var _=vTe();_.__mousedown=()=>e.onSelectSuggestion(g);var v=j(_,!0);H(_),Ce(()=>{yt(_,1,`w-full px-3 py-1.5 text-left text-sm hover:bg-accent ${f(b)===s()?"bg-accent":""}`),Ge(v,g)}),T(m,_)}),H(p),ai(3,p,()=>Ko,()=>({y:-5,duration:100})),T(h,p)};le(u,h=>{i()&&n().length>0&&h(d)})}H(o),T(r,o),we()}Ln(["mousedown"]);var wTe=G('<div class="flex items-start gap-2 rounded-lg border border-destructive/50 bg-destructive/10 px-3 py-2 text-sm text-destructive" role="alert"><span class="shrink-0">⚠</span> <span> </span></div>'),TTe=G('<form class="space-y-3 pt-4"><!> <!> <div class="mt-8 flex justify-end gap-2"><!> <!></div></form>');function CTe(r,e){Ee(e,!0);var t=TTe(),n=j(t);Ir(n,17,()=>e.prompt.arguments??[],c=>c.name,(c,u)=>{{let d=F(()=>e.promptArgs[f(u).name]??""),h=F(()=>e.suggestions[f(u).name]??[]),p=F(()=>e.loadingSuggestions[f(u).name]??!1),m=F(()=>e.activeAutocomplete===f(u).name),g=F(()=>e.activeAutocomplete===f(u).name?e.autocompleteIndex:0);ETe(c,{get argument(){return f(u)},get value(){return f(d)},get suggestions(){return f(h)},get isLoadingSuggestions(){return f(p)},get isAutocompleteActive(){return f(m)},get autocompleteIndex(){return f(g)},onInput:b=>e.onArgInput(f(u).name,b),onKeydown:b=>e.onArgKeydown(b,f(u).name),onBlur:()=>e.onArgBlur(f(u).name),onFocus:()=>e.onArgFocus(f(u).name),onSelectSuggestion:b=>e.onSelectSuggestion(f(u).name,b)})}});var a=ee Line truncated
`)&&M(o,!0);const y=new ResizeObserver(E=>{for(const S of E){const w=S.target;M(o,w.offsetHeight>24*1.5),M(u,w.scrollHeight,!0)}});return y.observe(f(l)),()=>{y.disconnect()}});function m(){M(c,!f(c))}var g=I3e(),b=j(g);{var _=y=>{var E=E3e(),S=j(E);Wm(S),S.__keydown=s,S.__input=N=>i.setContent(N.currentTarget.value),pr(S,N=>a(N),()=>a());var w=ee(S,2),C=j(w);kr(C,{class:"h-8 px-3",get onclick(){return i.cancel},size:"sm",variant:"outline",children:(N,I)=>{var D=y3e(),V=L(D);Yl(V,{class:"mr-1 h-3 w-3"}),et(),T(N,D)},$$slots:{default:!0}});var x=ee(C,2);{let N=F(()=>!i.editedContent.trim());kr(x,{class:"h-8 px-3",get onclick(){return i.save},get disabled(){return f(N)},size:"sm",children:(I,D)=>{var V=S3e(),q=L(V);Lv(q,{class:"mr-1 h-3 w-3"}),et(),T(I,V)},$$slots:{default:!0}})}H(w),H(E),Ce(()=>{l5(S,i.editedContent),yt(S,1,`min-h-[60px] w-full resize-none rounded-2xl px-3 py-2 text-sm ${w4??""}`)}),T(y,E)},v=y=>{var E=N3e(),S=L(E);{var w=N=>{var I=R3e(),D=j(I);D.__click=function(...q){(f(p)&&!f(c)?m:void 0)?.apply(this,q)};var V=j(D);{let q=F(()=>f(o)?"":void 0);Oc(V,{class:"overflow-y-auto rounded-[1.125rem] !border-2 !border-dashed !border-border/50 bg-muted px-3.75 py-1.5 data-[multiline]:py-2.5",get"data-multiline"(){return f(q)},style:"border: 2px dashed hsl(var(--border)); max-height: var(--max-message-height); overflow-wrap: anywhere; word-break: break-word;",children:($,K)=>{var z=x3e(),re=L(z),W=j(re);{var ie=U=>{var Q=w3e(),ne=j(Q);O6(ne,{class:"markdown-system-content -my-4",get content(){return e.message.content}}),H(Q),pr(Q,ue=>M(l,ue),()=>f(l)),Ce(()=>yt(Q,1,qr(f(c)?"cursor-text":""))),T(U,Q)},k=U=>{var Q=T3e(),ne=j(Q,!0);H(Q),pr(Q,ue=>M(l,ue),()=>f(l)),Ce(()=>{yt(Q,1,`text-md whitespace-pre-wrap ${f(c)?"cursor-text":""}`),Ge(ne,e.message.content)}),T(U,Q)};le(W,U=>{h.renderUserContentAsMarkdown?U(ie):U(k,!1)})}var B=ee(W,2);{var te=U=>{var Q=C3e(),ne=ee(L(Q),2),ue=j(ne);kr(ue,{class:"rounded-full px-4 py-1.5 text-xs shadow-md",size:"sm",variant:"outline",children:(he,be)=>{et();var Z=Ot("Show full system message");T(he,Z)},$$slots:{default:!0}}),H(ne),T(U,Q)};le(B,U=>{!f(c)&&f(p)&&U(te)})}H(re);var O=ee(re,2);{var R=U=>{var Q=A3e(),ne=j(Q);kr(ne,{class:"rounded-full px-4 py-1.5 text-xs",onclick:ue=>{ue.stopPropagation(),m()},size:"sm",variant:"outline",children:(ue,he)=>{et();var be=Ot("Collapse System Message");T(ue,be)},$$slots:{default:!0}}),H(Q),T(U,Q)};le(O,U=>{f(c)&&f(p)&&U(R)})}Ce(()=>{yt(re,1,`relative transition-all duration-300 ${f(c)?"cursor-text select-text":"select-none"}`),ds(re,!f(c)&&f(p)?`max-height: ${d}px;`:"max-height: none;")}),T($,z)},$$slots:{default:!0}})}H(D),H(I),Ce(()=>yt(D,1,`group/expand w-full text-left ${!f(c)&&f(p)?"cursor-pointer":"cursor-auto"}`)),T(N,I)};le(S,N=>{e.message.content.trim()&&N(w)})}var C=ee(S,2);{var x=N=>{var I=O3e(),D=j(I);vy(D,{actionsPosition:"right",get deletionInfo(){return e.deletionInfo},justify:"end",get onConfirmDelete(){return e.onConfirmDelete},get onCopy(){return e.onCopy},get onDelete(){return e.onDelete},get onEdit(){return e.onEdit},get onNavigateToSibling(){return e.onNavigateToSibling},get onShowDeleteDialogChange(){return e.onShowDeleteDialogChange},get siblingInfo(){return n()},get showDeleteDialog(){return e.showDeleteDialog},get role(){return Jt.USER}}),H(I),T(N,I)};le(C,N=>{e.message.timestamp&&N(x)})}T(y,E)};le(b,y=>{i.isEditing?y(_):y(v,!1)})}H(g),Ce(()=>yt(g,1,`group flex flex-col items-end gap-3 md:gap-2 ${t()??""}`)),T(r,g),we()}Ln(["keydown","input","click"]);var M3e=G('<div class="flex items-center gap-2"><!> <label for="save-only-switch" class="cursor-pointer text-xs text-muted-foreground">Update without re-sending</label></div>'),D3e=G("<div></div>"),P3e=G("<!> Cancel",1),L3e=G('<div class="relative w-full max-w-[80%]"><!></div> <div class="mt-2 flex w-full max-w-[80%] items-center justify-between"><!> <!></div> <!>',1);function cq(r,e){Ee(e,!0);const t=xg();let n=_e(void 0),a=_e(!1),i=_e(!1),s=F(()=>!!(t.editedContent!==t.originalContent||t.editedUploadedFiles.length>0||t.editedExtras.length!==t.originalExtras.length||t.editedExtras.some((I,D)=>I!==t.originalExtras[D]))),o=F(()=>t.editedExtras&&t.editedExtras.length>0||t.editedUploadedFiles&&t.editedUploadedFiles.length>0),l=F(()=>t.editedContent.trim().length>0||f(o));function c(N){N.key===Tn.ESCAPE&&(N.preventDefault(),u())}function u(){f(s)?M(i,!0):t.cancel()}function d(){f(l)&&(f(a)&&t.showSaveOnlyOption?t.saveOnly():t.save(),M(a,!1))}function h(N){const I=[...t.editedExtras];I.splice(N,1),t.setExtras(I)}function p(N){const I=t.editedUploadedFiles.filter(D=>D.id!==N);t.setUploadedFiles(I)}async function m(N){const I=await Wz(N);t.setUploadedFiles([...t.editedUploadedFiles,...I])}function g(N){t.setUploadedFiles(N)}Nt(()=>(fn.setEditModeActive(m),()=>{fn.clearEditMode()}));var b=L3e();hn("keydown",Tf,c);var _=L(b),v=j(_);pr(Zz(v,{get value(){return t.editedContent},get attachments(){return t.editedExtras},get uploadedFiles(){return t.editedUploadedFiles},pla Line truncated
`)){M(i,!0);return}const h=new ResizeObserver(p=>{for(const m of p){const g=m.target;M(i,g.offsetHeight>24*1.5)}});return h.observe(f(s)),()=>{h.disconnect()}});var l=z3e(),c=j(l);{var u=h=>{cq(h,{})},d=h=>{var p=G3e(),m=L(p);{var g=E=>{var S=F3e(),w=j(S);E$(w,{get attachments(){return e.message.extra},readonly:!0,imageHeight:"h-80"}),H(S),T(E,S)};le(m,E=>{e.message.extra&&e.message.extra.length>0&&E(g)})}var b=ee(m,2);{var _=E=>{{let S=F(()=>f(i)?"":void 0);Oc(E,{class:"max-w-[80%] overflow-y-auto rounded-[1.125rem] border-none bg-primary/5 px-3.75 py-1.5 text-foreground backdrop-blur-md data-[multiline]:py-2.5 dark:bg-primary/15",get"data-multiline"(){return f(S)},style:"max-height: var(--max-message-height); overflow-wrap: anywhere; word-break: break-word;",children:(w,C)=>{var x=se(),N=L(x);{var I=V=>{var q=B3e(),$=j(q);O6($,{class:"markdown-user-content -my-4",get content(){return e.message.content}}),H(q),pr(q,K=>M(s,K),()=>f(s)),T(V,q)},D=V=>{var q=U3e(),$=j(q,!0);H(q),pr(q,K=>M(s,K),()=>f(s)),Ce(()=>Ge($,e.message.content)),T(V,q)};le(N,V=>{o.renderUserContentAsMarkdown?V(I):V(D,!1)})}T(w,x)},$$slots:{default:!0}})}};le(b,E=>{e.message.content.trim()&&E(_)})}var v=ee(b,2);{var y=E=>{var S=$3e(),w=j(S);vy(w,{actionsPosition:"right",get deletionInfo(){return e.deletionInfo},justify:"end",get onConfirmDelete(){return e.onConfirmDelete},get onCopy(){return e.onCopy},get onDelete(){return e.onDelete},get onEdit(){return e.onEdit},get onForkConversation(){return e.onForkConversation},get onNavigateToSibling(){return e.onNavigateToSibling},get onShowDeleteDialogChange(){return e.onShowDeleteDialogChange},get siblingInfo(){return n()},get showDeleteDialog(){return e.showDeleteDialog},get role(){return Jt.USER}}),H(S),T(E,S)};le(v,E=>{e.message.timestamp&&E(y)})}T(h,p)};le(c,h=>{a.isEditing?h(u):h(d,!1)})}H(l),Ce(()=>yt(l,1,`group flex flex-col items-end gap-3 md:gap-2 ${t()??""}`)),T(r,l),we()}function uq(){let r=_e(!1),e=_e(null),t=_e(null);const n=F(()=>f(r)?L2e():f(e));Nt(()=>{f(n)&&f(r)&&M(e,f(n),!0)}),Nt(()=>{if(f(n)?.promptProgress){const{processed:m,total:g,time_ms:b,cache:_}=f(n).promptProgress,v=m-_,y=g-_;if(v>0&&b>0){const E=v/(b/1e3);M(t,{tokensProcessed:v,totalTokens:y,timeMs:b,tokensPerSecond:E},!0)}}});function a(m,g,b){const _=b/1e3;return m===0||_<.5?void 0:_*(g/m-1)}function i(){f(r)||M(r,!0)}function s(){if(!f(r))return;M(r,!1),An().keepStatsVisible||(M(e,null),M(t,null))}function o(){if(!f(n))return"Processing...";switch(f(n).status){case"initializing":return"Initializing...";case"preparing":return f(n).progressPercent!==void 0?`Processing (${f(n).progressPercent}%)`:"Preparing response...";case"generating":return"";default:return"Processing..."}}function l(){const m=f(n)||f(e);if(!m)return[];const g=[];if(m.promptProgress){const{processed:b,total:_,time_ms:v,cache:y}=m.promptProgress,E=b-y,S=_-y;if(E<S&&E>0){const w=Math.round(E/S*100),C=a(E,S,v);if(C!==void 0){const x=Math.ceil(C);g.push(`Processing ${w}% (ETA: ${x}s)`)}else g.push(`Processing ${w}%`)}}if(typeof m.contextTotal=="number"&&m.contextUsed>=0&&m.contextTotal>0){const b=Math.round(m.contextUsed/m.contextTotal*100);g.push(`Context: ${m.contextUsed}/${m.contextTotal} (${b}%)`)}if(m.outputTokensUsed>0)if(m.outputTokensMax<=0)g.push(`Output: ${m.outputTokensUsed}/∞`);else{const b=Math.round(m.outputTokensUsed/m.outputTokensMax*100);g.push(`Output: ${m.outputTokensUsed}/${m.outputTokensMax} (${b}%)`)}return m.tokensPerSecond&&m.tokensPerSecond>0&&g.push(`${m.tokensPerSecond.toFixed(1)} ${yO.TOKENS_PER_SECOND}`),m.speculative&&g.push("Speculative decoding enabled"),g}function c(){const m=f(n)||f(e);if(!m)return[];const g=[];if(typeof m.contextTotal=="number"&&m.contextUsed>=0&&m.contextTotal>0){const b=Math.round(m.contextUsed/m.contextTotal*100);g.push(`Context: ${m.contextUsed}/${m.contextTotal} (${b}%)`)}if(m.outputTokensUsed>0)if(m.outputTokensMax<=0)g.push(`Output: ${m.outputTokensUsed}/∞`);else{const b=Math.round(m.outputTokensUsed/m.outputTokensMax*100);g.push(`Output: ${m.outputTokensUsed}/${m.outputTokensMax} (${b}%)`)}return m.tokensPerSecond&&m.tokensPerSecond>0&&g.push(`${m.tokensPerSecond.toFixed(1)} ${yO.TOKENS_PER_SECOND}`),m.speculative&&g.push("Speculative decoding enabled"),g}function u(){return f(n)!==null&&f(n).status!=="idle"}function d(){if(!f(n)?.promptProgress)return null;const{processed:m,total:g,cache:b}=f(n).promptProgress,_=m-b,v=g-b,y=Math.round(_/v*100),E=a(_,v,f(n).promptProgress.time_ms);if(E!==void 0){const S=Math.ceil(E);return`Processing ${y}% (ETA: ${S}s)`}return`Processing ${y}%`}function h(){if(f(n)?.promptProgress){const{processed:m,total:g,time_ms:b,cache:_}=f(n).promptProgress,v=m-_,y=g-_;if(v>0&&b>0){const E=v/(b/1e3);return{tokensProcessed:v,totalTokens:y,timeMs:b,tokensPerSecond:E}}}return f(t)}function p(){if(!f(n))return null;const{tokensDecoded:m,tokensPerSecond:g}=f(n);if(m<=0)return null;const b=g&&g>0?m/g*1e3:0;return{tokensGenerated:m,timeMs:b,tokensPerSecond:g||0}}return{get Line truncated
`)){M(i,!0);return}const h=new ResizeObserver(p=>{for(const m of p){const g=m.target;M(i,g.offsetHeight>24*1.5)}});return h.observe(f(s)),()=>{h.disconnect()}});var l=z3e(),c=j(l);{var u=h=>{cq(h,{})},d=h=>{var p=G3e(),m=L(p);{var g=E=>{var S=F3e(),w=j(S);E$(w,{get attachments(){return e.message.extra},readonly:!0,imageHeight:"h-80"}),H(S),T(E,S)};le(m,E=>{e.message.extra&&e.message.extra.length>0&&E(g)})}var b=ee(m,2);{var _=E=>{{let S=F(()=>f(i)?"":void 0);Oc(E,{class:"max-w-[80%] overflow-y-auto rounded-[1.125rem] border-none bg-primary/5 px-3.75 py-1.5 text-foreground backdrop-blur-md data-[multiline]:py-2.5 dark:bg-primary/15",get"data-multiline"(){return f(S)},style:"max-height: var(--max-message-height); overflow-wrap: anywhere; word-break: break-word;",children:(w,C)=>{var x=se(),N=L(x);{var I=V=>{var q=B3e(),$=j(q);O6($,{class:"markdown-user-content -my-4",get content(){return e.message.content}}),H(q),pr(q,K=>M(s,K),()=>f(s)),T(V,q)},D=V=>{var q=U3e(),$=j(q,!0);H(q),pr(q,K=>M(s,K),()=>f(s)),Ce(()=>Ge($,e.message.content)),T(V,q)};le(N,V=>{o.renderUserContentAsMarkdown?V(I):V(D,!1)})}T(w,x)},$$slots:{default:!0}})}};le(b,E=>{e.message.content.trim()&&E(_)})}var v=ee(b,2);{var y=E=>{var S=$3e(),w=j(S);vy(w,{actionsPosition:"right",get deletionInfo(){return e.deletionInfo},justify:"end",get onConfirmDelete(){return e.onConfirmDelete},get onCopy(){return e.onCopy},get onDelete(){return e.onDelete},get onEdit(){return e.onEdit},get onForkConversation(){return e.onForkConversation},get onNavigateToSibling(){return e.onNavigateToSibling},get onShowDeleteDialogChange(){return e.onShowDeleteDialogChange},get siblingInfo(){return n()},get showDeleteDialog(){return e.showDeleteDialog},get role(){return Jt.USER}}),H(S),T(E,S)};le(v,E=>{e.message.timestamp&&E(y)})}T(h,p)};le(c,h=>{a.isEditing?h(u):h(d,!1)})}H(l),Ce(()=>yt(l,1,`group flex flex-col items-end gap-3 md:gap-2 ${t()??""}`)),T(r,l),we()}function uq(){let r=_e(!1),e=_e(null),t=_e(null);const n=F(()=>f(r)?L2e():f(e));Nt(()=>{f(n)&&f(r)&&M(e,f(n),!0)}),Nt(()=>{if(f(n)?.promptProgress){const{processed:m,total:g,time_ms:b,cache:_}=f(n).promptProgress,v=m-_,y=g-_;if(v>0&&b>0){const E=v/(b/1e3);M(t,{tokensProcessed:v,totalTokens:y,timeMs:b,tokensPerSecond:E},!0)}}});function a(m,g,b){const _=b/1e3;return m===0||_<.5?void 0:_*(g/m-1)}function i(){f(r)||M(r,!0)}function s(){if(!f(r))return;M(r,!1),An().keepStatsVisible||(M(e,null),M(t,null))}function o(){if(!f(n))return"Processing...";switch(f(n).status){case"initializing":return"Initializing...";case"preparing":return f(n).progressPercent!==void 0?`Processing (${f(n).progressPercent}%)`:"Preparing response...";case"generating":return"";default:return"Processing..."}}function l(){const m=f(n)||f(e);if(!m)return[];const g=[];if(m.promptProgress){const{processed:b,total:_,time_ms:v,cache:y}=m.promptProgress,E=b-y,S=_-y;if(E<S&&E>0){const w=Math.round(E/S*100),C=a(E,S,v);if(C!==void 0){const x=Math.ceil(C);g.push(`Processing ${w}% (ETA: ${x}s)`)}else g.push(`Processing ${w}%`)}}if(typeof m.contextTotal=="number"&&m.contextUsed>=0&&m.contextTotal>0){const b=Math.round(m.contextUsed/m.contextTotal*100);g.push(`Context: ${m.contextUsed}/${m.contextTotal} (${b}%)`)}if(m.outputTokensUsed>0)if(m.outputTokensMax<=0)g.push(`Output: ${m.outputTokensUsed}/∞`);else{const b=Math.round(m.outputTokensUsed/m.outputTokensMax*100);g.push(`Output: ${m.outputTokensUsed}/${m.outputTokensMax} (${b}%)`)}return m.tokensPerSecond&&m.tokensPerSecond>0&&g.push(`${m.tokensPerSecond.toFixed(1)} ${yO.TOKENS_PER_SECOND}`),m.speculative&&g.push("Speculative decoding enabled"),g}function c(){const m=f(n)||f(e);if(!m)return[];const g=[];if(typeof m.contextTotal=="number"&&m.contextUsed>=0&&m.contextTotal>0){const b=Math.round(m.contextUsed/m.contextTotal*100);g.push(`Context: ${m.contextUsed}/${m.contextTotal} (${b}%)`)}if(m.outputTokensUsed>0)if(m.outputTokensMax<=0)g.push(`Output: ${m.outputTokensUsed}/∞`);else{const b=Math.round(m.outputTokensUsed/m.outputTokensMax*100);g.push(`Output: ${m.outputTokensUsed}/${m.outputTokensMax} (${b}%)`)}return m.tokensPerSecond&&m.tokensPerSecond>0&&g.push(`${m.tokensPerSecond.toFixed(1)} ${yO.TOKENS_PER_SECOND}`),m.speculative&&g.push("Speculative decoding enabled"),g}function u(){return f(n)!==null&&f(n).status!=="idle"}function d(){if(!f(n)?.promptProgress)return null;const{processed:m,total:g,cache:b}=f(n).promptProgress,_=m-b,v=g-b,y=Math.round(_/v*100),E=a(_,v,f(n).promptProgress.time_ms);if(E!==void 0){const S=Math.ceil(E);return`Processing ${y}% (ETA: ${S}s)`}return`Processing ${y}%`}function h(){if(f(n)?.promptProgress){const{processed:m,total:g,time_ms:b,cache:_}=f(n).promptProgress,v=m-_,y=g-_;if(v>0&&b>0){const E=v/(b/1e3);return{tokensProcessed:v,totalTokens:y,timeMs:b,tokensPerSecond:E}}}return f(t)}function p(){if(!f(n))return null;const{tokensDecoded:m,tokensPerSecond:g}=f(n);if(m<=0)return null;const b=g&&g>0?m/g*1e3:0;return{tokensGenerated:m,timeMs:b,tokensPerSecond:g||0}}return{get Line truncated
parameters to the values provided by the server's /props endpoint and remove all your custom
configurations.`);T(W,k)},$$slots:{default:!0}})}),T(D,q)},$$slots:{default:!0}})});var x=ee(C,2);me(x,()=>Ju,(N,I)=>{I(N,{children:(D,V)=>{var q=h5e(),$=L(q);me($,()=>Dx,(z,re)=>{re(z,{children:(W,ie)=>{et();var k=Ot("Cancel");T(W,k)},$$slots:{default:!0}})});var K=ee($,2);me(K,()=>fh,(z,re)=>{re(z,{onclick:a,children:(W,ie)=>{et();var k=Ot("Reset to Default");T(W,k)},$$slots:{default:!0}})}),T(D,q)},$$slots:{default:!0}})}),T(E,w)},$$slots:{default:!0}})}),T(m,b)},$$slots:{default:!0}})}),T(r,s),we()}var g5e=G('<span class="absolute right-2 flex size-3.5 items-center justify-center"><!></span> <!>',1);function _5e(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class","value","label","children"]);var a=se(),i=L(a);{const s=(l,c)=>{let u=()=>c?.().selected,d=()=>c?.().highlighted;var h=g5e(),p=L(h),m=j(p);{var g=y=>{Lv(y,{class:"size-4"})};le(m,y=>{u()&&y(g)})}H(p);var b=ee(p,2);{var _=y=>{var E=se(),S=L(E);ke(S,()=>e.children,()=>({selected:u(),highlighted:d()})),T(y,E)},v=y=>{var E=Ot();Ce(()=>Ge(E,e.label||e.value)),T(y,E)};le(b,y=>{e.children?y(_):y(v,!1)})}T(l,h)};let o=F(()=>Kt("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e.class));me(i,()=>wee,(l,c)=>{c(l,ot({get value(){return e.value},"data-slot":"select-item",get class(){return f(o)}},()=>n,{get ref(){return t()},set ref(u){t(u)},children:s,$$slots:{default:!0}}))})}T(r,a),we()}function b5e(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>Kt("flex cursor-default items-center justify-center py-1",e.class));me(i,()=>Iee,(o,l)=>{l(o,ot({"data-slot":"select-scroll-up-button",get class(){return f(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)},children:(c,u)=>{lre(c,{class:"size-4"})},$$slots:{default:!0}}))})}T(r,a),we()}function v5e(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>Kt("flex cursor-default items-center justify-center py-1",e.class));me(i,()=>Ree,(o,l)=>{l(o,ot({"data-slot":"select-scroll-down-button",get class(){return f(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)},children:(c,u)=>{Uc(c,{class:"size-4"})},$$slots:{default:!0}}))})}T(r,a),we()}var y5e=G("<!> <!> <!>",1);function S5e(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Y(e,"sideOffset",3,4),a=Ye(e,["$$slots","$$events","$$legacy","ref","class","sideOffset","portalProps","children"]),i;bi(()=>{const l={passive:!1},c=d=>{if(!t())return;const h=d.target;(!h||!t().contains(h))&&(d.preventDefault(),d.stopPropagation())},u=d=>{if(!t())return;const h=d.target;(!h||!t().contains(h))&&(d.preventDefault(),d.stopPropagation())};return document.addEventListener("wheel",c,l),document.addEventListener("touchmove",u,l),()=>{document.removeEventListener("wheel",c,l),document.removeEventListener("touchmove",u,l)}}),Nt(()=>{const l=t();if(i?.(),!l)return;const c=d=>{d.stopPropagation()},u=d=>{d.stopPropagation()};l.addEventListener("wheel",c),l.addEventListener("touchmove",u),i=()=>{l.removeEventListener("wheel",c),l.removeEventListener("touchmove",u)}}),h5(()=>{i?.()});var s=se(),o=L(s);me(o,()=>Jc,(l,c)=>{c(l,ot(()=>e.portalProps,{children:(u,d)=>{var h=se(),p=L(h);{let m=F(()=>Kt("relative z-[var(--layer-popover,1000000)] max-h-(--bits-select-content-available-height) min-w-[8rem] origin-(--bits-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:translate-y-1 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:-translate-x-1 data-[side=left]:slide-in-from-right-2 data-[side=right]:translate-x-1 data-[side=right]:slide-in-from-left-2 data-[side=top]:-translate-y-1 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e.class));me(p,()=>yee,(g,b)=>{b(g,ot({get sideOffset(){return n()},"data-slot":"select-content",get class(){return f(m)}},()=>a,{get ref(){return t()},set ref(_){t(_)},children:(_,v)=>{var y=y5e(),E=L(y);b5e(E,{});var S=ee(E,2);{let C=F(()=>Kt("h-(--bits-select-anchor-height) w-full min-w-(--bits-select-anchor-width) scroll-my-1 p-1"));me(S,()=>Cee,(x,N)=>{N(x,{get class(){return f(C)},children:(I,D)=>{var V=se(),q=L(V);ke(q,()=>e.children??$e),T(I,V)},$$slots:{default:!0}})})}var w=ee(S,2);v5e(w,{}),T(_,y)},$$slots:{default:!0}}))})}T(u,h)},$$slots:{default:!0}}))}),T(r,s),we()}var E5e=G("<!> <!>",1);function w5e(r, Line truncated
configurations.`);T(W,k)},$$slots:{default:!0}})}),T(D,q)},$$slots:{default:!0}})});var x=ee(C,2);me(x,()=>ed,(N,I)=>{I(N,{children:(D,V)=>{var q=h5e(),$=L(q);me($,()=>Dx,(z,re)=>{re(z,{children:(W,ie)=>{et();var k=Ot("Cancel");T(W,k)},$$slots:{default:!0}})});var K=ee($,2);me(K,()=>fh,(z,re)=>{re(z,{onclick:a,children:(W,ie)=>{et();var k=Ot("Reset to Default");T(W,k)},$$slots:{default:!0}})}),T(D,q)},$$slots:{default:!0}})}),T(E,w)},$$slots:{default:!0}})}),T(m,b)},$$slots:{default:!0}})}),T(r,s),we()}var g5e=G('<span class="absolute right-2 flex size-3.5 items-center justify-center"><!></span> <!>',1);function _5e(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class","value","label","children"]);var a=se(),i=L(a);{const s=(l,c)=>{let u=()=>c?.().selected,d=()=>c?.().highlighted;var h=g5e(),p=L(h),m=j(p);{var g=y=>{Lv(y,{class:"size-4"})};le(m,y=>{u()&&y(g)})}H(p);var b=ee(p,2);{var _=y=>{var E=se(),S=L(E);ke(S,()=>e.children,()=>({selected:u(),highlighted:d()})),T(y,E)},v=y=>{var E=Ot();Ce(()=>Ge(E,e.label||e.value)),T(y,E)};le(b,y=>{e.children?y(_):y(v,!1)})}T(l,h)};let o=F(()=>Kt("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e.class));me(i,()=>wee,(l,c)=>{c(l,ot({get value(){return e.value},"data-slot":"select-item",get class(){return f(o)}},()=>n,{get ref(){return t()},set ref(u){t(u)},children:s,$$slots:{default:!0}}))})}T(r,a),we()}function b5e(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>Kt("flex cursor-default items-center justify-center py-1",e.class));me(i,()=>Iee,(o,l)=>{l(o,ot({"data-slot":"select-scroll-up-button",get class(){return f(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)},children:(c,u)=>{lre(c,{class:"size-4"})},$$slots:{default:!0}}))})}T(r,a),we()}function v5e(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>Kt("flex cursor-default items-center justify-center py-1",e.class));me(i,()=>Ree,(o,l)=>{l(o,ot({"data-slot":"select-scroll-down-button",get class(){return f(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)},children:(c,u)=>{Uc(c,{class:"size-4"})},$$slots:{default:!0}}))})}T(r,a),we()}var y5e=G("<!> <!> <!>",1);function S5e(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Y(e,"sideOffset",3,4),a=Ye(e,["$$slots","$$events","$$legacy","ref","class","sideOffset","portalProps","children"]),i;bi(()=>{const l={passive:!1},c=d=>{if(!t())return;const h=d.target;(!h||!t().contains(h))&&(d.preventDefault(),d.stopPropagation())},u=d=>{if(!t())return;const h=d.target;(!h||!t().contains(h))&&(d.preventDefault(),d.stopPropagation())};return document.addEventListener("wheel",c,l),document.addEventListener("touchmove",u,l),()=>{document.removeEventListener("wheel",c,l),document.removeEventListener("touchmove",u,l)}}),Nt(()=>{const l=t();if(i?.(),!l)return;const c=d=>{d.stopPropagation()},u=d=>{d.stopPropagation()};l.addEventListener("wheel",c),l.addEventListener("touchmove",u),i=()=>{l.removeEventListener("wheel",c),l.removeEventListener("touchmove",u)}}),h5(()=>{i?.()});var s=se(),o=L(s);me(o,()=>Jc,(l,c)=>{c(l,ot(()=>e.portalProps,{children:(u,d)=>{var h=se(),p=L(h);{let m=F(()=>Kt("relative z-[var(--layer-popover,1000000)] max-h-(--bits-select-content-available-height) min-w-[8rem] origin-(--bits-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:translate-y-1 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:-translate-x-1 data-[side=left]:slide-in-from-right-2 data-[side=right]:translate-x-1 data-[side=right]:slide-in-from-left-2 data-[side=top]:-translate-y-1 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e.class));me(p,()=>yee,(g,b)=>{b(g,ot({get sideOffset(){return n()},"data-slot":"select-content",get class(){return f(m)}},()=>a,{get ref(){return t()},set ref(_){t(_)},children:(_,v)=>{var y=y5e(),E=L(y);b5e(E,{});var S=ee(E,2);{let C=F(()=>Kt("h-(--bits-select-anchor-height) w-full min-w-(--bits-select-anchor-width) scroll-my-1 p-1"));me(S,()=>Cee,(x,N)=>{N(x,{get class(){return f(C)},children:(I,D)=>{var V=se(),q=L(V);ke(q,()=>e.children??$e),T(I,V)},$$slots:{default:!0}})})}var w=ee(S,2);v5e(w,{}),T(_,y)},$$slots:{default:!0}}))})}T(u,h)},$$slots:{default:!0}}))}),T(r,s),we()}var E5e=G("<!> <!>",1);function w5e(r, Line truncated
conversation history.</p> <!> <!></div> <div class="grid border-t border-border/30 pt-4"><h4 class="mb-2 text-sm font-medium">Import Conversations</h4> <p class="mb-4 text-sm text-muted-foreground">Import one or more conversations from a previously exported JSON file. This will merge with
your existing conversations.</p> <!> <!></div> <div class="grid border-t border-border/30 pt-4"><h4 class="mb-2 text-sm font-medium text-destructive">Delete All Conversations</h4> <p class="mb-4 text-sm text-muted-foreground">Permanently delete all conversations and their messages. This action cannot be undone.
Consider exporting your conversations first if you want to keep a backup.</p> <!></div></div></div> <!> <!> <!>`,1);function t9e(r,e){Ee(e,!0);let t=_e(Sr([])),n=_e(Sr([])),a=_e(!1),i=_e(!1),s=_e(!1),o=_e(!1),l=_e(Sr([])),c=_e(Sr(new Map)),u=_e(Sr([])),d=_e(!1);async function h(){try{const ie=Dd();if(ie.length===0){Jn.info("No conversations to export");return}const k=await Promise.all(ie.map(async B=>{const te=await rt.getConversationMessages(B.id);return{conv:B,messages:te}}));M(c,t8(k),!0),M(l,ie,!0),M(s,!0)}catch(ie){console.error("Failed to load conversations:",ie),alert("Failed to load conversations")}}async function p(ie){try{const k=await Promise.all(ie.map(async B=>{const te=await rt.getConversationMessages(B.id);return{conv:rf(B),messages:rf(te)}}));rt.downloadConversationFile(k,`${new Date().toISOString().split(ZU)[0]}_conversations.json`),M(t,ie,!0),M(a,!0),M(i,!1),M(s,!1)}catch(k){console.error("Export failed:",k),alert("Failed to export conversations")}}async function m(){try{const ie=document.createElement("input");ie.type="file",ie.accept=".json",ie.onchange=async k=>{const B=k.target?.files?.[0];if(B)try{const te=await B.text(),O=JSON.parse(te);let R;if(Array.isArray(O))R=O;else if(O&&typeof O=="object"&&"conv"in O&&"messages"in O)R=[O];else throw new Error("Invalid file format: expected array of conversations or single conversation object");M(u,R,!0),M(l,R.map(U=>U.conv),!0),M(c,t8(R),!0),M(o,!0)}catch(te){const O=te instanceof Error?te.message:"Unknown error";console.error("Failed to parse file:",te),alert(`Failed to parse file: ${O}`)}},ie.click()}catch(ie){console.error("Import failed:",ie),alert("Failed to import conversations")}}async function g(ie){try{const k=new Set(ie.map(te=>te.id)),B=rf(f(u)).filter(te=>k.has(te.conv.id));await rt.importConversationsData(B),M(n,ie,!0),M(i,!0),M(a,!1),M(o,!1)}catch(k){console.error("Import failed:",k),alert("Failed to import conversations. Please check the file format.")}}async function b(){try{if(Dd().length===0){Jn.info("No conversations to delete");return}M(d,!0)}catch(ie){console.error("Failed to load conversations for deletion:",ie),Jn.error("Failed to load conversations")}}async function _(){try{await rt.deleteAll(),M(d,!1)}catch(ie){console.error("Failed to delete conversations:",ie)}}function v(){M(d,!1)}var y=e9e(),E=L(y),S=j(E),w=j(S),C=ee(j(w),4);kr(C,{class:"w-full justify-start justify-self-start md:w-auto",onclick:h,variant:"outline",children:(ie,k)=>{var B=V5e(),te=L(B);Fv(te,{class:"mr-2 h-4 w-4"}),et(),T(ie,B)},$$slots:{default:!0}});var x=ee(C,2);{var N=ie=>{var k=j5e(),B=j(k),te=j(B);H(B);var O=ee(B,2),R=j(O);Ir(R,17,()=>f(t).slice(0,10),ne=>ne.id,(ne,ue)=>{var he=Y5e(),be=j(he);H(he),Ce(()=>Ge(be,`• ${f(ue).name||"Untitled conversation"}`)),T(ne,he)});var U=ee(R,2);{var Q=ne=>{var ue=W5e(),he=j(ue);H(ue),Ce(()=>Ge(he,`... and ${f(t).length-10} more`)),T(ne,ue)};le(U,ne=>{f(t).length>10&&ne(Q)})}H(O),H(k),Ce(()=>Ge(te,`Exported ${f(t).length??""} conversation${f(t).length===1?"":"s"}`)),T(ie,k)};le(x,ie=>{f(a)&&f(t).length>0&&ie(N)})}H(w);var I=ee(w,2),D=ee(j(I),4);kr(D,{class:"w-full justify-start justify-self-start md:w-auto",onclick:m,variant:"outline",children:(ie,k)=>{var B=K5e(),te=L(B);UU(te,{class:"mr-2 h-4 w-4"}),et(),T(ie,B)},$$slots:{default:!0}});var V=ee(D,2);{var q=ie=>{var k=Z5e(),B=j(k),te=j(B);H(B);var O=ee(B,2),R=j(O);Ir(R,17,()=>f(n).slice(0,10),ne=>ne.id,(ne,ue)=>{var he=X5e(),be=j(he);H(he),Ce(()=>Ge(be,`• ${f(ue).name||"Untitled conversation"}`)),T(ne,he)});var U=ee(R,2);{var Q=ne=>{var ue=Q5e(),he=j(ue);H(ue),Ce(()=>Ge(he,`... and ${f(n).length-10} more`)),T(ne,ue)};le(U,ne=>{f(n).length>10&&ne(Q)})}H(O),H(k),Ce(()=>Ge(te,`Imported ${f(n).length??""} conversation${f(n).length===1?"":"s"}`)),T(ie,k)};le(V,ie=>{f(i)&&f(n).length>0&&ie(q)})}H(I);var $=ee(I,2),K=ee(j($),4);kr(K,{class:"text-destructive-foreground w-full justify-start justify-self-start bg-destructive hover:bg-destructive/80 md:w-auto",onclick:b,variant:"destructive",children:(ie,k)=>{var B=J5e(),te=L(B);Gc(te,{class:"mr-2 h-4 w-4"}),et(),T(ie,B)},$$slots:{default:!0}}),H($),H(S),H(E);var z=ee(E,2);GD(z,{get conversations(){return f(l)},get messageCountMap(){return f(c)},mode:"export",onCancel:()=>M(s,!1),onConfirm:p,get open(){return f(s)},set open(ie){M(s,ie,!0)}});var re=ee(z,2);GD(re,{get conversations(){return f(l)},get messageCountMap(){return f(c)},mode:"import",onCancel:()=>M(o,!1),onConfirm:g,get open(){return f(o)},set open(ie){M(o,ie,!0)}});var W=ee(re,2);eh(W,{title:"Delete all conversations",description:"Are you sure you want to delete all conversations? This action cannot be undone and will permanently remove all your conversations and messages.",confirmText:"Delete All",cancelText:"Cancel",variant:"destructive",get icon(){return Gc},onConfirm:_,onCancel:v,get open(){return f(d)},set open(ie){M(d,ie,!0)}}),T(r,y),we()}var r9e=G("<!> Custom",1);function XD(r,e){let t=Y(e,"class",3,"");Rs(r,{variant:"secondary",get class(){Line truncated
Consider exporting your conversations first if you want to keep a backup.</p> <!></div></div></div> <!> <!> <!>`,1);function t9e(r,e){Ee(e,!0);let t=_e(Sr([])),n=_e(Sr([])),a=_e(!1),i=_e(!1),s=_e(!1),o=_e(!1),l=_e(Sr([])),c=_e(Sr(new Map)),u=_e(Sr([])),d=_e(!1);async function h(){try{const ie=Dd();if(ie.length===0){Jn.info("No conversations to export");return}const k=await Promise.all(ie.map(async B=>{const te=await rt.getConversationMessages(B.id);return{conv:B,messages:te}}));M(c,t8(k),!0),M(l,ie,!0),M(s,!0)}catch(ie){console.error("Failed to load conversations:",ie),alert("Failed to load conversations")}}async function p(ie){try{const k=await Promise.all(ie.map(async B=>{const te=await rt.getConversationMessages(B.id);return{conv:rf(B),messages:rf(te)}}));rt.downloadConversationFile(k,`${new Date().toISOString().split(ZU)[0]}_conversations.json`),M(t,ie,!0),M(a,!0),M(i,!1),M(s,!1)}catch(k){console.error("Export failed:",k),alert("Failed to export conversations")}}async function m(){try{const ie=document.createElement("input");ie.type="file",ie.accept=".json",ie.onchange=async k=>{const B=k.target?.files?.[0];if(B)try{const te=await B.text(),O=JSON.parse(te);let R;if(Array.isArray(O))R=O;else if(O&&typeof O=="object"&&"conv"in O&&"messages"in O)R=[O];else throw new Error("Invalid file format: expected array of conversations or single conversation object");M(u,R,!0),M(l,R.map(U=>U.conv),!0),M(c,t8(R),!0),M(o,!0)}catch(te){const O=te instanceof Error?te.message:"Unknown error";console.error("Failed to parse file:",te),alert(`Failed to parse file: ${O}`)}},ie.click()}catch(ie){console.error("Import failed:",ie),alert("Failed to import conversations")}}async function g(ie){try{const k=new Set(ie.map(te=>te.id)),B=rf(f(u)).filter(te=>k.has(te.conv.id));await rt.importConversationsData(B),M(n,ie,!0),M(i,!0),M(a,!1),M(o,!1)}catch(k){console.error("Import failed:",k),alert("Failed to import conversations. Please check the file format.")}}async function b(){try{if(Dd().length===0){Jn.info("No conversations to delete");return}M(d,!0)}catch(ie){console.error("Failed to load conversations for deletion:",ie),Jn.error("Failed to load conversations")}}async function _(){try{await rt.deleteAll(),M(d,!1)}catch(ie){console.error("Failed to delete conversations:",ie)}}function v(){M(d,!1)}var y=e9e(),E=L(y),S=j(E),w=j(S),C=ee(j(w),4);kr(C,{class:"w-full justify-start justify-self-start md:w-auto",onclick:h,variant:"outline",children:(ie,k)=>{var B=V5e(),te=L(B);Fv(te,{class:"mr-2 h-4 w-4"}),et(),T(ie,B)},$$slots:{default:!0}});var x=ee(C,2);{var N=ie=>{var k=j5e(),B=j(k),te=j(B);H(B);var O=ee(B,2),R=j(O);Ir(R,17,()=>f(t).slice(0,10),ne=>ne.id,(ne,ue)=>{var he=Y5e(),be=j(he);H(he),Ce(()=>Ge(be,`• ${f(ue).name||"Untitled conversation"}`)),T(ne,he)});var U=ee(R,2);{var Q=ne=>{var ue=W5e(),he=j(ue);H(ue),Ce(()=>Ge(he,`... and ${f(t).length-10} more`)),T(ne,ue)};le(U,ne=>{f(t).length>10&&ne(Q)})}H(O),H(k),Ce(()=>Ge(te,`Exported ${f(t).length??""} conversation${f(t).length===1?"":"s"}`)),T(ie,k)};le(x,ie=>{f(a)&&f(t).length>0&&ie(N)})}H(w);var I=ee(w,2),D=ee(j(I),4);kr(D,{class:"w-full justify-start justify-self-start md:w-auto",onclick:m,variant:"outline",children:(ie,k)=>{var B=K5e(),te=L(B);UU(te,{class:"mr-2 h-4 w-4"}),et(),T(ie,B)},$$slots:{default:!0}});var V=ee(D,2);{var q=ie=>{var k=Z5e(),B=j(k),te=j(B);H(B);var O=ee(B,2),R=j(O);Ir(R,17,()=>f(n).slice(0,10),ne=>ne.id,(ne,ue)=>{var he=X5e(),be=j(he);H(he),Ce(()=>Ge(be,`• ${f(ue).name||"Untitled conversation"}`)),T(ne,he)});var U=ee(R,2);{var Q=ne=>{var ue=Q5e(),he=j(ue);H(ue),Ce(()=>Ge(he,`... and ${f(n).length-10} more`)),T(ne,ue)};le(U,ne=>{f(n).length>10&&ne(Q)})}H(O),H(k),Ce(()=>Ge(te,`Imported ${f(n).length??""} conversation${f(n).length===1?"":"s"}`)),T(ie,k)};le(V,ie=>{f(i)&&f(n).length>0&&ie(q)})}H(I);var $=ee(I,2),K=ee(j($),4);kr(K,{class:"text-destructive-foreground w-full justify-start justify-self-start bg-destructive hover:bg-destructive/80 md:w-auto",onclick:b,variant:"destructive",children:(ie,k)=>{var B=J5e(),te=L(B);Gc(te,{class:"mr-2 h-4 w-4"}),et(),T(ie,B)},$$slots:{default:!0}}),H($),H(S),H(E);var z=ee(E,2);GD(z,{get conversations(){return f(l)},get messageCountMap(){return f(c)},mode:"export",onCancel:()=>M(s,!1),onConfirm:p,get open(){return f(s)},set open(ie){M(s,ie,!0)}});var re=ee(z,2);GD(re,{get conversations(){return f(l)},get messageCountMap(){return f(c)},mode:"import",onCancel:()=>M(o,!1),onConfirm:g,get open(){return f(o)},set open(ie){M(o,ie,!0)}});var W=ee(re,2);eh(W,{title:"Delete all conversations",description:"Are you sure you want to delete all conversations? This action cannot be undone and will permanently remove all your conversations and messages.",confirmText:"Delete All",cancelText:"Cancel",variant:"destructive",get icon(){return Gc},onConfirm:_,onCancel:v,get open(){return f(d)},set open(ie){M(d,ie,!0)}}),T(r,y),we()}var r9e=G("<!> Custom",1);function XD(r,e){let t=Y(e,"class",3,"");Rs(r,{variant:"secondary",get class(){Line truncated
`;break}case-3:{s=`\r
`;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&a)continue;s=" ";break}default:s=String.fromCharCode(i)}a=i===-2,n.push(s)}return n.join("")}function vxe(r){const n={constructs:pq([mxe,...(r||{}).extensions||[]]),content:a(D9e),defined:[],document:a(L9e),flow:a(exe),lazy:{},string:a(nxe),text:a(axe)};return n;function a(i){return s;function s(o){return gxe(n,i,o)}}}function yxe(r){for(;!vq(r););return r}const sP=/[\0\t\n\r]/g;function Sxe(){let r=1,e="",t=!0,n;return a;function a(i,s,o){const l=[];let c,u,d,h,p;for(i=e+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),d=0,e="",t&&(i.charCodeAt(0)===65279&&d++,t=void 0);d<i.length;){if(sP.lastIndex=d,c=sP.exec(i),h=c&&c.index!==void 0?c.index:i.length,p=i.charCodeAt(h),!c){e=i.slice(d);break}if(p===10&&d===h&&n)l.push(-3),n=void 0;else switch(n&&(l.push(-5),n=void 0),d<h&&(l.push(i.slice(d,h)),r+=h-d),p){case 0:{l.push(65533),r++;break}case 9:{for(u=Math.ceil(r/4)*4,l.push(-2);r++<u;)l.push(-1);break}case 10:{l.push(-4),r=1;break}default:n=!0,r=1}d=h+1}return o&&(n&&l.push(-5),e&&l.push(e),l.push(null)),l}}const Exe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Cq(r){return r.replace(Exe,wxe)}function wxe(r,e,t){if(e)return e;if(t.charCodeAt(0)===35){const a=t.charCodeAt(1),i=a===120||a===88;return mq(t.slice(i?2:1),i?16:10)}return Yx(t)||r}function N_(r){return!r||typeof r!="object"?"":"position"in r||"type"in r?oP(r.position):"start"in r||"end"in r?oP(r):"line"in r||"column"in r?yA(r):""}function yA(r){return lP(r&&r.line)+":"+lP(r&&r.column)}function oP(r){return yA(r&&r.start)+"-"+yA(r&&r.end)}function lP(r){return r&&typeof r=="number"?r:1}const Aq={}.hasOwnProperty;function Txe(r,e,t){return typeof e!="string"&&(t=e,e=void 0),Cxe(t)(yxe(vxe(t).document().write(Sxe()(r,e,!0))))}function Cxe(r){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ue),autolinkProtocol:N,autolinkEmail:N,atxHeading:i(ye),blockQuote:i(be),characterEscape:N,characterReference:N,codeFenced:i(Z),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(Z,s),codeText:i(ae,s),codeTextData:N,data:N,codeFlowValue:N,definition:i(fe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(pe),hardBreakEscape:i(Te),hardBreakTrailing:i(Te),htmlFlow:i(Oe,s),htmlFlowData:N,htmlText:i(Oe,s),htmlTextData:N,image:i(Ne),label:s,link:i(Ue),listItem:i(Ke),listItemValue:h,listOrdered:i(Fe,d),listUnordered:i(Fe),paragraph:i(He),reference:O,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(ye),strong:i(it),thematicBreak:i(dt)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:he,autolinkProtocol:ue,blockQuote:l(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:U,characterReferenceMarkerNumeric:U,characterReferenceValue:Q,characterReference:ne,codeFenced:l(b),codeFencedFence:g,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:I,codeIndented:l(_),codeText:l(K),codeTextData:I,data:I,definition:l(),definitionDestinationString:E,definitionLabelString:v,definitionTitleString:y,emphasis:l(),hardBreakEscape:l(V),hardBreakTrailing:l(V),htmlFlow:l(q),htmlFlowData:I,htmlText:l($),htmlTextData:I,image:l(re),label:ie,labelText:W,lineEnding:D,link:l(z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:R,resourceDestinationString:k,resourceTitleString:B,resource:te,setextHeading:l(x),setextHeadingLineSequence:C,setextHeadingText:w,strong:l(),thematicBreak:l()}};xq(e,(r||{}).mdastExtensions||[]);const t={};return n;function n(Ae){let Le={type:"root",children:[]};const ht={stack:[Le],tokenStack:[],config:e,enter:o,exit:c,buffer:s,resume:u,data:t},ze=[];let mt=-1;for(;++mt<Ae.length;)if(Ae[mt][1].type==="listOrdered"||Ae[mt][1].type==="listUnordered")if(Ae[mt][0]==="enter")ze.push(mt);else{const At=ze.pop();mt=a(Ae,At,mt)}for(mt=-1;++mt<Ae.length;){const At=e[Ae[mt][0]];Aq.call(At,Ae[mt][1].type)&&At[Ae[mt][1].type].call(Object.assign({sliceSerialize:Ae[mt][2].sliceSerialize},ht),Ae[mt][1])}if(ht.tokenStack.length>0){const At=ht.tokenStack[ht.tokenStack.length-1];(At[1]||cP).call(ht,void 0,At[0])}for(Le.position={start:fu(Ae.length>0?Ae[0][1].start:{line:1,column:1,offset:0}),end:fu(Ae.length>0?Ae[Ae.length-2][1].end:{line:1,column:1,offset:0})},mt=-1;++mt<e.transforms.length;)Le=e.transforms[mt](Le)||Le;return Le}function a(Ae,Le,ht){let ze=Le-1,mt=-1,At=!1,xt,qt,ar,fr;for(;++ze<=ht;){const ct=Ae[ze];switch(ct[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ct[0]==="enter"?mt++:mt--,fr=void 0;break}case"lineEndingBlank":{ct[0]==="enter"&&(xt&&!fr&&!mt&&!ar&&(ar=ze),fr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:fr=void 0}if(!mt&&ct[0]==="enter"&&ct[1].type==="listItemPrefix"||mt===-1&&ct[0]==="exit"&&(ct[1].type==="listUnordered"||ct[1].type==="listOrdered")){if(xLine truncated
`;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&a)continue;s=" ";break}default:s=String.fromCharCode(i)}a=i===-2,n.push(s)}return n.join("")}function vxe(r){const n={constructs:pq([mxe,...(r||{}).extensions||[]]),content:a(D9e),defined:[],document:a(L9e),flow:a(exe),lazy:{},string:a(nxe),text:a(axe)};return n;function a(i){return s;function s(o){return gxe(n,i,o)}}}function yxe(r){for(;!vq(r););return r}const sP=/[\0\t\n\r]/g;function Sxe(){let r=1,e="",t=!0,n;return a;function a(i,s,o){const l=[];let c,u,d,h,p;for(i=e+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),d=0,e="",t&&(i.charCodeAt(0)===65279&&d++,t=void 0);d<i.length;){if(sP.lastIndex=d,c=sP.exec(i),h=c&&c.index!==void 0?c.index:i.length,p=i.charCodeAt(h),!c){e=i.slice(d);break}if(p===10&&d===h&&n)l.push(-3),n=void 0;else switch(n&&(l.push(-5),n=void 0),d<h&&(l.push(i.slice(d,h)),r+=h-d),p){case 0:{l.push(65533),r++;break}case 9:{for(u=Math.ceil(r/4)*4,l.push(-2);r++<u;)l.push(-1);break}case 10:{l.push(-4),r=1;break}default:n=!0,r=1}d=h+1}return o&&(n&&l.push(-5),e&&l.push(e),l.push(null)),l}}const Exe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Cq(r){return r.replace(Exe,wxe)}function wxe(r,e,t){if(e)return e;if(t.charCodeAt(0)===35){const a=t.charCodeAt(1),i=a===120||a===88;return mq(t.slice(i?2:1),i?16:10)}return Yx(t)||r}function N_(r){return!r||typeof r!="object"?"":"position"in r||"type"in r?oP(r.position):"start"in r||"end"in r?oP(r):"line"in r||"column"in r?yA(r):""}function yA(r){return lP(r&&r.line)+":"+lP(r&&r.column)}function oP(r){return yA(r&&r.start)+"-"+yA(r&&r.end)}function lP(r){return r&&typeof r=="number"?r:1}const Aq={}.hasOwnProperty;function Txe(r,e,t){return typeof e!="string"&&(t=e,e=void 0),Cxe(t)(yxe(vxe(t).document().write(Sxe()(r,e,!0))))}function Cxe(r){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ue),autolinkProtocol:N,autolinkEmail:N,atxHeading:i(ye),blockQuote:i(be),characterEscape:N,characterReference:N,codeFenced:i(Z),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(Z,s),codeText:i(ae,s),codeTextData:N,data:N,codeFlowValue:N,definition:i(fe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(pe),hardBreakEscape:i(Te),hardBreakTrailing:i(Te),htmlFlow:i(Oe,s),htmlFlowData:N,htmlText:i(Oe,s),htmlTextData:N,image:i(Ne),label:s,link:i(Ue),listItem:i(Ke),listItemValue:h,listOrdered:i(Fe,d),listUnordered:i(Fe),paragraph:i(He),reference:O,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(ye),strong:i(it),thematicBreak:i(dt)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:he,autolinkProtocol:ue,blockQuote:l(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:U,characterReferenceMarkerNumeric:U,characterReferenceValue:Q,characterReference:ne,codeFenced:l(b),codeFencedFence:g,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:I,codeIndented:l(_),codeText:l(K),codeTextData:I,data:I,definition:l(),definitionDestinationString:E,definitionLabelString:v,definitionTitleString:y,emphasis:l(),hardBreakEscape:l(V),hardBreakTrailing:l(V),htmlFlow:l(q),htmlFlowData:I,htmlText:l($),htmlTextData:I,image:l(re),label:ie,labelText:W,lineEnding:D,link:l(z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:R,resourceDestinationString:k,resourceTitleString:B,resource:te,setextHeading:l(x),setextHeadingLineSequence:C,setextHeadingText:w,strong:l(),thematicBreak:l()}};xq(e,(r||{}).mdastExtensions||[]);const t={};return n;function n(Ae){let Le={type:"root",children:[]};const ht={stack:[Le],tokenStack:[],config:e,enter:o,exit:c,buffer:s,resume:u,data:t},ze=[];let mt=-1;for(;++mt<Ae.length;)if(Ae[mt][1].type==="listOrdered"||Ae[mt][1].type==="listUnordered")if(Ae[mt][0]==="enter")ze.push(mt);else{const At=ze.pop();mt=a(Ae,At,mt)}for(mt=-1;++mt<Ae.length;){const At=e[Ae[mt][0]];Aq.call(At,Ae[mt][1].type)&&At[Ae[mt][1].type].call(Object.assign({sliceSerialize:Ae[mt][2].sliceSerialize},ht),Ae[mt][1])}if(ht.tokenStack.length>0){const At=ht.tokenStack[ht.tokenStack.length-1];(At[1]||cP).call(ht,void 0,At[0])}for(Le.position={start:pu(Ae.length>0?Ae[0][1].start:{line:1,column:1,offset:0}),end:pu(Ae.length>0?Ae[Ae.length-2][1].end:{line:1,column:1,offset:0})},mt=-1;++mt<e.transforms.length;)Le=e.transforms[mt](Le)||Le;return Le}function a(Ae,Le,ht){let ze=Le-1,mt=-1,At=!1,xt,qt,ar,fr;for(;++ze<=ht;){const ct=Ae[ze];switch(ct[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ct[0]==="enter"?mt++:mt--,fr=void 0;break}case"lineEndingBlank":{ct[0]==="enter"&&(xt&&!fr&&!mt&&!ar&&(ar=ze),fr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:fr=void 0}if(!mt&&ct[0]==="enter"&&ct[1].type==="listItemPrefix"||mt===-1&&ct[0]==="exit"&&(ct[1].type==="listUnordered"||ct[1].type==="listOrdered")){if(xLine truncated
`&&Nq(t.stack,t.unsafe[a]))return/[ \t]/.test(n.before)?"":" ";return`\\
`}function Iq(r,e){const t=String(r);let n=t.indexOf(e),a=n,i=0,s=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;n!==-1;)n===a?++i>s&&(s=i):i=1,a=n+e.length,n=t.indexOf(e,a);return s}function SA(r,e){return!!(e.options.fences===!1&&r.value&&!r.lang&&/[^ \r\n]/.test(r.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(r.value))}function kxe(r){const e=r.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function Mxe(r,e,t,n){const a=kxe(t),i=r.value||"",s=a==="`"?"GraveAccent":"Tilde";if(SA(r,t)){const d=t.enter("codeIndented"),h=t.indentLines(i,Dxe);return d(),h}const o=t.createTracker(n),l=a.repeat(Math.max(Iq(i,a)+1,3)),c=t.enter("codeFenced");let u=o.move(l);if(r.lang){const d=t.enter(`codeFencedLang${s}`);u+=o.move(t.safe(r.lang,{before:u,after:" ",encode:["`"],...o.current()})),d()}if(r.lang&&r.meta){const d=t.enter(`codeFencedMeta${s}`);u+=o.move(" "),u+=o.move(t.safe(r.meta,{before:u,after:`
`,encode:["`"],...o.current()})),d()}return u+=o.move(`
`),i&&(u+=o.move(i+`
`)),u+=o.move(l),c(),u}function Dxe(r,e,t){return(t?"":" ")+r}function jx(r){const e=r.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function Pxe(r,e,t,n){const a=jx(t),i=a==='"'?"Quote":"Apostrophe",s=t.enter("definition");let o=t.enter("label");const l=t.createTracker(n);let c=l.move("[");return c+=l.move(t.safe(t.associationId(r),{before:c,after:"]",...l.current()})),c+=l.move("]: "),o(),!r.url||/[\0- \u007F]/.test(r.url)?(o=t.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(t.safe(r.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=t.enter("destinationRaw"),c+=l.move(t.safe(r.url,{before:c,after:r.title?" ":`
`,...l.current()}))),o(),r.title&&(o=t.enter(`title${i}`),c+=l.move(" "+a),c+=l.move(t.safe(r.title,{before:c,after:a,...l.current()})),c+=l.move(a),o()),s(),c}function Lxe(r){const e=r.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function $u(r){return"&#x"+r.toString(16).toUpperCase()+";"}function Bb(r,e,t){const n=$f(r),a=$f(e);return n===void 0?a===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}kq.peek=Fxe;function kq(r,e,t,n){const a=Lxe(t),i=t.enter("emphasis"),s=t.createTracker(n),o=s.move(a);let l=s.move(t.containerPhrasing(r,{after:a,before:o,...s.current()}));const c=l.charCodeAt(0),u=Bb(n.before.charCodeAt(n.before.length-1),c,a);u.inside&&(l=$u(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=Bb(n.after.charCodeAt(0),d,a);h.inside&&(l=l.slice(0,-1)+$u(d));const p=s.move(a);return i(),t.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},o+l+p}function Fxe(r,e,t){return t.options.emphasis||"*"}const Og=function(r){if(r==null)return Gxe;if(typeof r=="function")return wy(r);if(typeof r=="object")return Array.isArray(r)?Bxe(r):Uxe(r);if(typeof r=="string")return $xe(r);throw new Error("Expected function, string, or object as test")};function Bxe(r){const e=[];let t=-1;for(;++t<r.length;)e[t]=Og(r[t]);return wy(n);function n(...a){let i=-1;for(;++i<e.length;)if(e[i].apply(this,a))return!0;return!1}}function Uxe(r){const e=r;return wy(t);function t(n){const a=n;let i;for(i in r)if(a[i]!==e[i])return!1;return!0}}function $xe(r){return wy(e);function e(t){return t&&t.type===r}}function wy(r){return e;function e(t,n,a){return!!(zxe(t)&&r.call(this,t,typeof n=="number"?n:void 0,a||void 0))}}function Gxe(){return!0}function zxe(r){return r!==null&&typeof r=="object"&&"type"in r}const Mq=[],qxe=!0,EA=!1,Dq="skip";function Ty(r,e,t,n){let a;typeof e=="function"&&typeof t!="function"?(n=t,t=e):a=e;const i=Og(a),s=n?-1:1;o(r,void 0,[])();function o(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=Mq,m,g,b;if((!e||i(l,c,u[u.length-1]||void 0))&&(p=Hxe(t(l,u)),p[0]===EA))return p;if("children"in l&&l.children){const _=l;if(_.children&&p[0]!==Dq)for(g=(n?_.children.length:-1)+s,b=u.concat(_);g>-1&&g<_.children.length;){const v=_.children[g];if(m=o(v,g,b)(),m[0]===EA)return m;g=typeof m[1]=="number"?m[1]:g+s}}return p}}}function Hxe(r){return Array.isArray(r)?r:typeof r=="number"?[qxe,r]:r==null?Mq:[r]}function id(r,e,t,n){let a,i,s;typeof e=="function"&&typeof t!="function"?(i=void 0,s=e,a=t):(i=e,s=t,a=n),Ty(r,i,o,a);function o(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return s(l,d,u)}}function Pq(r,e){let t=!1;return id(r,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return t=!0,EA}),!!((!r.depth||r.depth<3)&&Vx(r)&&(e.options.setext||t))}function Vxe(r,e,t,n){const a=Math.max(Math.min(6,r.depth||1),1),i=t.createTracker(n);if(Pq(r,t)){const u=t.enter("headingSetext"),d=t.enter("phrasing"),h=t.containerPhrasing(r,{...i.current(),before:`
`,...l.current()}))),o(),r.title&&(o=t.enter(`title${i}`),c+=l.move(" "+a),c+=l.move(t.safe(r.title,{before:c,after:a,...l.current()})),c+=l.move(a),o()),s(),c}function Lxe(r){const e=r.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function Gu(r){return"&#x"+r.toString(16).toUpperCase()+";"}function Bb(r,e,t){const n=$f(r),a=$f(e);return n===void 0?a===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}kq.peek=Fxe;function kq(r,e,t,n){const a=Lxe(t),i=t.enter("emphasis"),s=t.createTracker(n),o=s.move(a);let l=s.move(t.containerPhrasing(r,{after:a,before:o,...s.current()}));const c=l.charCodeAt(0),u=Bb(n.before.charCodeAt(n.before.length-1),c,a);u.inside&&(l=Gu(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=Bb(n.after.charCodeAt(0),d,a);h.inside&&(l=l.slice(0,-1)+Gu(d));const p=s.move(a);return i(),t.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},o+l+p}function Fxe(r,e,t){return t.options.emphasis||"*"}const Og=function(r){if(r==null)return Gxe;if(typeof r=="function")return wy(r);if(typeof r=="object")return Array.isArray(r)?Bxe(r):Uxe(r);if(typeof r=="string")return $xe(r);throw new Error("Expected function, string, or object as test")};function Bxe(r){const e=[];let t=-1;for(;++t<r.length;)e[t]=Og(r[t]);return wy(n);function n(...a){let i=-1;for(;++i<e.length;)if(e[i].apply(this,a))return!0;return!1}}function Uxe(r){const e=r;return wy(t);function t(n){const a=n;let i;for(i in r)if(a[i]!==e[i])return!1;return!0}}function $xe(r){return wy(e);function e(t){return t&&t.type===r}}function wy(r){return e;function e(t,n,a){return!!(zxe(t)&&r.call(this,t,typeof n=="number"?n:void 0,a||void 0))}}function Gxe(){return!0}function zxe(r){return r!==null&&typeof r=="object"&&"type"in r}const Mq=[],qxe=!0,EA=!1,Dq="skip";function Ty(r,e,t,n){let a;typeof e=="function"&&typeof t!="function"?(n=t,t=e):a=e;const i=Og(a),s=n?-1:1;o(r,void 0,[])();function o(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=Mq,m,g,b;if((!e||i(l,c,u[u.length-1]||void 0))&&(p=Hxe(t(l,u)),p[0]===EA))return p;if("children"in l&&l.children){const _=l;if(_.children&&p[0]!==Dq)for(g=(n?_.children.length:-1)+s,b=u.concat(_);g>-1&&g<_.children.length;){const v=_.children[g];if(m=o(v,g,b)(),m[0]===EA)return m;g=typeof m[1]=="number"?m[1]:g+s}}return p}}}function Hxe(r){return Array.isArray(r)?r:typeof r=="number"?[qxe,r]:r==null?Mq:[r]}function eu(r,e,t,n){let a,i,s;typeof e=="function"&&typeof t!="function"?(i=void 0,s=e,a=t):(i=e,s=t,a=n),Ty(r,i,o,a);function o(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return s(l,d,u)}}function Pq(r,e){let t=!1;return eu(r,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return t=!0,EA}),!!((!r.depth||r.depth<3)&&Vx(r)&&(e.options.setext||t))}function Vxe(r,e,t,n){const a=Math.max(Math.min(6,r.depth||1),1),i=t.createTracker(n);if(Pq(r,t)){const u=t.enter("headingSetext"),d=t.enter("phrasing"),h=t.containerPhrasing(r,{...i.current(),before:`
`,after:`
`});return d(),u(),h+`
`+(a===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
`))+1))}const s="#".repeat(a),o=t.enter("headingAtx"),l=t.enter("phrasing");i.move(s+" ");let c=t.containerPhrasing(r,{before:"# ",after:`
`,...i.current()});return/^[\t ]/.test(c)&&(c=$u(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,t.options.closeAtx&&(c+=" "+s),l(),o(),c}Lq.peek=Yxe;function Lq(r){return r.value||""}function Yxe(){return"<"}Fq.peek=Wxe;function Fq(r,e,t,n){const a=jx(t),i=a==='"'?"Quote":"Apostrophe",s=t.enter("image");let o=t.enter("label");const l=t.createTracker(n);let c=l.move("![");return c+=l.move(t.safe(r.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),o(),!r.url&&r.title||/[\0- \u007F]/.test(r.url)?(o=t.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(t.safe(r.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=t.enter("destinationRaw"),c+=l.move(t.safe(r.url,{before:c,after:r.title?" ":")",...l.current()}))),o(),r.title&&(o=t.enter(`title${i}`),c+=l.move(" "+a),c+=l.move(t.safe(r.title,{before:c,after:a,...l.current()})),c+=l.move(a),o()),c+=l.move(")"),s(),c}function Wxe(){return"!"}Bq.peek=jxe;function Bq(r,e,t,n){const a=r.referenceType,i=t.enter("imageReference");let s=t.enter("label");const o=t.createTracker(n);let l=o.move("![");const c=t.safe(r.alt,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),s();const u=t.stack;t.stack=[],s=t.enter("reference");const d=t.safe(t.associationId(r),{before:l,after:"]",...o.current()});return s(),t.stack=u,i(),a==="full"||!c||c!==d?l+=o.move(d+"]"):a==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function jxe(){return"!"}Uq.peek=Kxe;function Uq(r,e,t){let n=r.value||"",a="`",i=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(n);)a+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++i<t.unsafe.length;){const s=t.unsafe[i],o=t.compilePattern(s);let l;if(s.atBreak)for(;l=o.exec(n);){let c=l.index;n.charCodeAt(c)===10&&n.charCodeAt(c-1)===13&&c--,n=n.slice(0,c)+" "+n.slice(l.index+1)}}return a+n+a}function Kxe(){return"`"}function $q(r,e){const t=Vx(r);return!!(!e.options.resourceLink&&r.url&&!r.title&&r.children&&r.children.length===1&&r.children[0].type==="text"&&(t===r.url||"mailto:"+t===r.url)&&/^[a-z][a-z+.-]+:/i.test(r.url)&&!/[\0- <>\u007F]/.test(r.url))}Gq.peek=Xxe;function Gq(r,e,t,n){const a=jx(t),i=a==='"'?"Quote":"Apostrophe",s=t.createTracker(n);let o,l;if($q(r,t)){const u=t.stack;t.stack=[],o=t.enter("autolink");let d=s.move("<");return d+=s.move(t.containerPhrasing(r,{before:d,after:">",...s.current()})),d+=s.move(">"),o(),t.stack=u,d}o=t.enter("link"),l=t.enter("label");let c=s.move("[");return c+=s.move(t.containerPhrasing(r,{before:c,after:"](",...s.current()})),c+=s.move("]("),l(),!r.url&&r.title||/[\0- \u007F]/.test(r.url)?(l=t.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(t.safe(r.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(l=t.enter("destinationRaw"),c+=s.move(t.safe(r.url,{before:c,after:r.title?" ":")",...s.current()}))),l(),r.title&&(l=t.enter(`title${i}`),c+=s.move(" "+a),c+=s.move(t.safe(r.title,{before:c,after:a,...s.current()})),c+=s.move(a),l()),c+=s.move(")"),o(),c}function Xxe(r,e,t){return $q(r,t)?"<":"["}zq.peek=Qxe;function zq(r,e,t,n){const a=r.referenceType,i=t.enter("linkReference");let s=t.enter("label");const o=t.createTracker(n);let l=o.move("[");const c=t.containerPhrasing(r,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),s();const u=t.stack;t.stack=[],s=t.enter("reference");const d=t.safe(t.associationId(r),{before:l,after:"]",...o.current()});return s(),t.stack=u,i(),a==="full"||!c||c!==d?l+=o.move(d+"]"):a==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function Qxe(){return"["}function Kx(r){const e=r.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function Zxe(r){const e=Kx(r),t=r.options.bulletOther;if(!t)return e==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+t+"`) to be different");return t}function Jxe(r){const e=r.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function qq(r){const e=r.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function e6e(r,e,t,n){const a=t.enter("list"),i=t.bulletCurrent;let s=r.ordered?Jxe(t):Kx(t);const o=r.ordered?s==="."?")":".":Zxe(t);let l=e&&t.bulletLastUsed?s===t.bulletLastUsed:!1;if(!r.ordered){const u=r.children?r.children[0]:void 0;if((s==="*"||s==="-")&&u&&(!u.children||!u.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(l=!0),qq(t)===s&&u){let d=-Line truncated
`,...i.current()});return/^[\t ]/.test(c)&&(c=Gu(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,t.options.closeAtx&&(c+=" "+s),l(),o(),c}Lq.peek=Yxe;function Lq(r){return r.value||""}function Yxe(){return"<"}Fq.peek=Wxe;function Fq(r,e,t,n){const a=jx(t),i=a==='"'?"Quote":"Apostrophe",s=t.enter("image");let o=t.enter("label");const l=t.createTracker(n);let c=l.move("![");return c+=l.move(t.safe(r.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),o(),!r.url&&r.title||/[\0- \u007F]/.test(r.url)?(o=t.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(t.safe(r.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=t.enter("destinationRaw"),c+=l.move(t.safe(r.url,{before:c,after:r.title?" ":")",...l.current()}))),o(),r.title&&(o=t.enter(`title${i}`),c+=l.move(" "+a),c+=l.move(t.safe(r.title,{before:c,after:a,...l.current()})),c+=l.move(a),o()),c+=l.move(")"),s(),c}function Wxe(){return"!"}Bq.peek=jxe;function Bq(r,e,t,n){const a=r.referenceType,i=t.enter("imageReference");let s=t.enter("label");const o=t.createTracker(n);let l=o.move("![");const c=t.safe(r.alt,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),s();const u=t.stack;t.stack=[],s=t.enter("reference");const d=t.safe(t.associationId(r),{before:l,after:"]",...o.current()});return s(),t.stack=u,i(),a==="full"||!c||c!==d?l+=o.move(d+"]"):a==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function jxe(){return"!"}Uq.peek=Kxe;function Uq(r,e,t){let n=r.value||"",a="`",i=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(n);)a+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++i<t.unsafe.length;){const s=t.unsafe[i],o=t.compilePattern(s);let l;if(s.atBreak)for(;l=o.exec(n);){let c=l.index;n.charCodeAt(c)===10&&n.charCodeAt(c-1)===13&&c--,n=n.slice(0,c)+" "+n.slice(l.index+1)}}return a+n+a}function Kxe(){return"`"}function $q(r,e){const t=Vx(r);return!!(!e.options.resourceLink&&r.url&&!r.title&&r.children&&r.children.length===1&&r.children[0].type==="text"&&(t===r.url||"mailto:"+t===r.url)&&/^[a-z][a-z+.-]+:/i.test(r.url)&&!/[\0- <>\u007F]/.test(r.url))}Gq.peek=Xxe;function Gq(r,e,t,n){const a=jx(t),i=a==='"'?"Quote":"Apostrophe",s=t.createTracker(n);let o,l;if($q(r,t)){const u=t.stack;t.stack=[],o=t.enter("autolink");let d=s.move("<");return d+=s.move(t.containerPhrasing(r,{before:d,after:">",...s.current()})),d+=s.move(">"),o(),t.stack=u,d}o=t.enter("link"),l=t.enter("label");let c=s.move("[");return c+=s.move(t.containerPhrasing(r,{before:c,after:"](",...s.current()})),c+=s.move("]("),l(),!r.url&&r.title||/[\0- \u007F]/.test(r.url)?(l=t.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(t.safe(r.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(l=t.enter("destinationRaw"),c+=s.move(t.safe(r.url,{before:c,after:r.title?" ":")",...s.current()}))),l(),r.title&&(l=t.enter(`title${i}`),c+=s.move(" "+a),c+=s.move(t.safe(r.title,{before:c,after:a,...s.current()})),c+=s.move(a),l()),c+=s.move(")"),o(),c}function Xxe(r,e,t){return $q(r,t)?"<":"["}zq.peek=Qxe;function zq(r,e,t,n){const a=r.referenceType,i=t.enter("linkReference");let s=t.enter("label");const o=t.createTracker(n);let l=o.move("[");const c=t.containerPhrasing(r,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),s();const u=t.stack;t.stack=[],s=t.enter("reference");const d=t.safe(t.associationId(r),{before:l,after:"]",...o.current()});return s(),t.stack=u,i(),a==="full"||!c||c!==d?l+=o.move(d+"]"):a==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function Qxe(){return"["}function Kx(r){const e=r.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function Zxe(r){const e=Kx(r),t=r.options.bulletOther;if(!t)return e==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+t+"`) to be different");return t}function Jxe(r){const e=r.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function qq(r){const e=r.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function e6e(r,e,t,n){const a=t.enter("list"),i=t.bulletCurrent;let s=r.ordered?Jxe(t):Kx(t);const o=r.ordered?s==="."?")":".":Zxe(t);let l=e&&t.bulletLastUsed?s===t.bulletLastUsed:!1;if(!r.ordered){const u=r.children?r.children[0]:void 0;if((s==="*"||s==="-")&&u&&(!u.children||!u.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(l=!0),qq(t)===s&&u){let d=-Line truncated
`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:Td},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:Td},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
*])`},{character:"*",inConstruct:"phrasing",notInConstruct:Td},{atBreak:!0,character:"+",after:`(?:[ \r
])`},{atBreak:!0,character:"-",after:`(?:[ \r
-])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ \r
]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:Td},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:Td},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:Td},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:Td},{atBreak:!0,character:"~"}];function p6e(r){return r.label||!r.identifier?r.label||"":Cq(r.identifier)}function m6e(r){if(!r._compiled){const e=(r.atBreak?"[\\r\\n][\\t ]*":"")+(r.before?"(?:"+r.before+")":"");r._compiled=new RegExp((e?"("+e+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(r.character)?"\\":"")+r.character+(r.after?"(?:"+r.after+")":""),"g")}return r._compiled}function g6e(r,e,t){const n=e.indexStack,a=r.children||[],i=[];let s=-1,o=t.before,l;n.push(-1);let c=e.createTracker(t);for(;++s<a.length;){const u=a[s];let d;if(n[n.length-1]=s,s+1<a.length){let m=e.handle.handlers[a[s+1].type];m&&m.peek&&(m=m.peek),d=m?m(a[s+1],r,e,{before:"",after:"",...c.current()}).charAt(0):""}else d=t.after;i.length>0&&(o==="\r"||o===`
`)&&u.type==="html"&&(i[i.length-1]=i[i.length-1].replace(/(\r?\n|\r)$/," "),o=" ",c=e.createTracker(t),c.move(i.join("")));let h=e.handle(u,r,e,{...c.current(),after:d,before:o});l&&l===h.slice(0,1)&&(h=$u(l.charCodeAt(0))+h.slice(1));const p=e.attentionEncodeSurroundingInfo;e.attentionEncodeSurroundingInfo=void 0,l=void 0,p&&(i.length>0&&p.before&&o===i[i.length-1].slice(-1)&&(i[i.length-1]=i[i.length-1].slice(0,-1)+$u(o.charCodeAt(0))),p.after&&(l=d)),c.move(h),i.push(h),o=h.slice(-1)}return n.pop(),i.join("")}function _6e(r,e,t){const n=e.indexStack,a=r.children||[],i=e.createTracker(t),s=[];let o=-1;for(n.push(-1);++o<a.length;){const l=a[o];n[n.length-1]=o,s.push(i.move(e.handle(l,r,e,{before:`
`)&&u.type==="html"&&(i[i.length-1]=i[i.length-1].replace(/(\r?\n|\r)$/," "),o=" ",c=e.createTracker(t),c.move(i.join("")));let h=e.handle(u,r,e,{...c.current(),after:d,before:o});l&&l===h.slice(0,1)&&(h=Gu(l.charCodeAt(0))+h.slice(1));const p=e.attentionEncodeSurroundingInfo;e.attentionEncodeSurroundingInfo=void 0,l=void 0,p&&(i.length>0&&p.before&&o===i[i.length-1].slice(-1)&&(i[i.length-1]=i[i.length-1].slice(0,-1)+Gu(o.charCodeAt(0))),p.after&&(l=d)),c.move(h),i.push(h),o=h.slice(-1)}return n.pop(),i.join("")}function _6e(r,e,t){const n=e.indexStack,a=r.children||[],i=e.createTracker(t),s=[];let o=-1;for(n.push(-1);++o<a.length;){const l=a[o];n[n.length-1]=o,s.push(i.move(e.handle(l,r,e,{before:`
`,after:`
`,...i.current()}))),l.type!=="list"&&(e.bulletLastUsed=void 0),o<a.length-1&&s.push(i.move(b6e(l,a[o+1],r,e)))}return n.pop(),s.join("")}function b6e(r,e,t,n){let a=n.join.length;for(;a--;){const i=n.join[a](r,e,t,n);if(i===!0||i===1)break;if(typeof i=="number")return`
`.repeat(1+i);if(i===!1)return`
@@ -171,18 +171,18 @@ ${i.text}`):"blob"in i&&i.blob&&e.push(`
`}return`
`}const v6e=/\r?\n|\r/g;function y6e(r,e){const t=[];let n=0,a=0,i;for(;i=v6e.exec(r);)s(r.slice(n,i.index)),t.push(i[0]),n=i.index+i[0].length,a++;return s(r.slice(n)),t.join("");function s(o){t.push(e(o,a,!o))}}function S6e(r,e,t){const n=(t.before||"")+(e||"")+(t.after||""),a=[],i=[],s={};let o=-1;for(;++o<r.unsafe.length;){const u=r.unsafe[o];if(!Nq(r.stack,u))continue;const d=r.compilePattern(u);let h;for(;h=d.exec(n);){const p="before"in u||!!u.atBreak,m="after"in u,g=h.index+(p?h[1].length:0);a.includes(g)?(s[g].before&&!p&&(s[g].before=!1),s[g].after&&!m&&(s[g].after=!1)):(a.push(g),s[g]={before:p,after:m})}}a.sort(E6e);let l=t.before?t.before.length:0;const c=n.length-(t.after?t.after.length:0);for(o=-1;++o<a.length;){const u=a[o];u<l||u>=c||u+1<c&&a[o+1]===u+1&&s[u].after&&!s[u+1].before&&!s[u+1].after||a[o-1]===u-1&&s[u].before&&!s[u-1].before&&!s[u-1].after||(l!==u&&i.push(pP(n.slice(l,u),"\\")),l=u,/[!-/:-@[-`{-~]/.test(n.charAt(u))&&(!t.encode||!t.encode.includes(n.charAt(u)))?i.push("\\"):(i.push($u(n.charCodeAt(u))),l++))}return i.push(pP(n.slice(l,c),t.after)),i.join("")}function E6e(r,e){return r-e}function pP(r,e){const t=/\\(?=[!-/:-@[-`{-~])/g,n=[],a=[],i=r+e;let s=-1,o=0,l;for(;l=t.exec(i);)n.push(l.index);for(;++s<n.length;)o!==n[s]&&a.push(r.slice(o,n[s])),a.push("\\"),o=n[s];return a.push(r.slice(o)),a.join("")}function w6e(r){const e=r||{},t=e.now||{};let n=e.lineShift||0,a=t.line||1,i=t.column||1;return{move:l,current:s,shift:o};function s(){return{now:{line:a,column:i},lineShift:n}}function o(c){n+=c}function l(c){const u=c||"",d=u.split(/\r?\n|\r/g),h=d[d.length-1];return a+=d.length-1,i=d.length===1?i+h.length:1+h.length+n,u}}function T6e(r,e){const t=e||{},n={associationId:p6e,containerPhrasing:R6e,containerFlow:O6e,createTracker:w6e,compilePattern:m6e,enter:i,handlers:{...Xx},handle:void 0,indentLines:y6e,indexStack:[],join:[...d6e],options:{},safe:N6e,stack:[],unsafe:[...f6e]};Oq(n,t),n.options.tightDefinitions&&n.join.push(x6e),n.handle=Rq("type",{invalid:C6e,unknown:A6e,handlers:n.handlers});let a=n.handle(r,void 0,n,{before:`
`}const v6e=/\r?\n|\r/g;function y6e(r,e){const t=[];let n=0,a=0,i;for(;i=v6e.exec(r);)s(r.slice(n,i.index)),t.push(i[0]),n=i.index+i[0].length,a++;return s(r.slice(n)),t.join("");function s(o){t.push(e(o,a,!o))}}function S6e(r,e,t){const n=(t.before||"")+(e||"")+(t.after||""),a=[],i=[],s={};let o=-1;for(;++o<r.unsafe.length;){const u=r.unsafe[o];if(!Nq(r.stack,u))continue;const d=r.compilePattern(u);let h;for(;h=d.exec(n);){const p="before"in u||!!u.atBreak,m="after"in u,g=h.index+(p?h[1].length:0);a.includes(g)?(s[g].before&&!p&&(s[g].before=!1),s[g].after&&!m&&(s[g].after=!1)):(a.push(g),s[g]={before:p,after:m})}}a.sort(E6e);let l=t.before?t.before.length:0;const c=n.length-(t.after?t.after.length:0);for(o=-1;++o<a.length;){const u=a[o];u<l||u>=c||u+1<c&&a[o+1]===u+1&&s[u].after&&!s[u+1].before&&!s[u+1].after||a[o-1]===u-1&&s[u].before&&!s[u-1].before&&!s[u-1].after||(l!==u&&i.push(pP(n.slice(l,u),"\\")),l=u,/[!-/:-@[-`{-~]/.test(n.charAt(u))&&(!t.encode||!t.encode.includes(n.charAt(u)))?i.push("\\"):(i.push(Gu(n.charCodeAt(u))),l++))}return i.push(pP(n.slice(l,c),t.after)),i.join("")}function E6e(r,e){return r-e}function pP(r,e){const t=/\\(?=[!-/:-@[-`{-~])/g,n=[],a=[],i=r+e;let s=-1,o=0,l;for(;l=t.exec(i);)n.push(l.index);for(;++s<n.length;)o!==n[s]&&a.push(r.slice(o,n[s])),a.push("\\"),o=n[s];return a.push(r.slice(o)),a.join("")}function w6e(r){const e=r||{},t=e.now||{};let n=e.lineShift||0,a=t.line||1,i=t.column||1;return{move:l,current:s,shift:o};function s(){return{now:{line:a,column:i},lineShift:n}}function o(c){n+=c}function l(c){const u=c||"",d=u.split(/\r?\n|\r/g),h=d[d.length-1];return a+=d.length-1,i=d.length===1?i+h.length:1+h.length+n,u}}function T6e(r,e){const t=e||{},n={associationId:p6e,containerPhrasing:R6e,containerFlow:O6e,createTracker:w6e,compilePattern:m6e,enter:i,handlers:{...Xx},handle:void 0,indentLines:y6e,indexStack:[],join:[...d6e],options:{},safe:N6e,stack:[],unsafe:[...f6e]};Oq(n,t),n.options.tightDefinitions&&n.join.push(x6e),n.handle=Rq("type",{invalid:C6e,unknown:A6e,handlers:n.handlers});let a=n.handle(r,void 0,n,{before:`
`,after:`
`,now:{line:1,column:1},lineShift:0});return a&&a.charCodeAt(a.length-1)!==10&&a.charCodeAt(a.length-1)!==13&&(a+=`
`),a;function i(s){return n.stack.push(s),o;function o(){n.stack.pop()}}}function C6e(r){throw new Error("Cannot handle value `"+r+"`, expected node")}function A6e(r){const e=r;throw new Error("Cannot handle unknown node `"+e.type+"`")}function x6e(r,e){if(r.type==="definition"&&r.type===e.type)return 0}function R6e(r,e){return g6e(r,this,e)}function O6e(r,e){return _6e(r,this,e)}function N6e(r,e){return S6e(this,r,e)}function I6e(r){const e=this;e.compiler=t;function t(n){return T6e(n,{...e.data("settings"),...r,extensions:e.data("toMarkdownExtensions")||[]})}}function mP(r){if(r)throw r}var GT,gP;function k6e(){if(gP)return GT;gP=1;var r=Object.prototype.hasOwnProperty,e=Object.prototype.toString,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,a=function(c){return typeof Array.isArray=="function"?Array.isArray(c):e.call(c)==="[object Array]"},i=function(c){if(!c||e.call(c)!=="[object Object]")return!1;var u=r.call(c,"constructor"),d=c.constructor&&c.constructor.prototype&&r.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!d)return!1;var h;for(h in c);return typeof h>"u"||r.call(c,h)},s=function(c,u){t&&u.name==="__proto__"?t(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},o=function(c,u){if(u==="__proto__")if(r.call(c,u)){if(n)return n(c,u).value}else return;return c[u]};return GT=function l(){var c,u,d,h,p,m,g=arguments[0],b=1,_=arguments.length,v=!1;for(typeof g=="boolean"&&(v=g,g=arguments[1]||{},b=2),(g==null||typeof g!="object"&&typeof g!="function")&&(g={});b<_;++b)if(c=arguments[b],c!=null)for(u in c)d=o(g,u),h=o(c,u),g!==h&&(v&&h&&(i(h)||(p=a(h)))?(p?(p=!1,m=d&&a(d)?d:[]):m=d&&i(d)?d:{},s(g,{name:u,newValue:l(v,m,h)})):typeof h<"u"&&s(g,{name:u,newValue:h}));return g},GT}var M6e=k6e();const zT=sh(M6e);function wA(r){if(typeof r!="object"||r===null)return!1;const e=Object.getPrototypeOf(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)}function D6e(){const r=[],e={run:t,use:n};return e;function t(...a){let i=-1;const s=a.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);o(null,...a);function o(l,...c){const u=r[++i];let d=-1;if(l){s(l);return}for(;++d<a.length;)(c[d]===null||c[d]===void 0)&&(c[d]=a[d]);a=c,u?P6e(u,o)(...c):s(null,...c)}}function n(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return r.push(a),e}}function P6e(r,e){let t;return n;function n(...s){const o=r.length>s.length;let l;o&&s.push(a);try{l=r.apply(this,s)}catch(c){const u=c;if(o&&t)throw u;return a(u)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,a):l instanceof Error?a(l):i(l))}function a(s,...o){t||(t=!0,e(s,...o))}function i(s){a(null,s)}}function L6e(r){return!r||typeof r!="object"?"":"position"in r||"type"in r?_P(r.position):"start"in r||"end"in r?_P(r):"line"in r||"column"in r?TA(r):""}function TA(r){return bP(r&&r.line)+":"+bP(r&&r.column)}function _P(r){return TA(r&&r.start)+"-"+TA(r&&r.end)}function bP(r){return r&&typeof r=="number"?r:1}class Ms extends Error{constructor(e,t,n){super(),typeof t=="string"&&(n=t,t=void 0);let a="",i={},s=!1;if(t&&("line"in t&&"column"in t?i={place:t}:"start"in t&&"end"in t?i={place:t}:"type"in t?i={ancestors:[t],place:t.position}:i={...t}),typeof e=="string"?a=e:!i.cause&&e&&(s=!0,a=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n=="string"){const l=n.indexOf(":");l===-1?i.ruleId=n:(i.source=n.slice(0,l),i.ruleId=n.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file,this.message=a,this.line=o?o.line:void 0,this.name=L6e(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}Ms.prototype.file="";Ms.prototype.name="";Ms.prototype.reason="";Ms.prototype.message="";Ms.prototype.stack="";Ms.prototype.column=void 0;Ms.prototype.line=void 0;Ms.prototype.ancestors=void 0;Ms.prototype.cause=void 0;Ms.prototype.fatal=void 0;Ms.prototype.place=void 0;Ms.prototype.ruleId=void 0;Ms.prototype.source=void 0;const Sl={basename:F6e,dirname:B6e,extname:U6e,join:$6e,sep:"/"};function F6e(r,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');Ng(r);let t=0,n=-1,a=r.length,i;if(e===void 0||e.length===0||e.length>r.length){for(;a--;)if(r.codePointAt(a)===47){if(i){t=a+1;break}}else n<0&&(i=!0,n=a+1);return n<0?"":r.slice(t,n)}if(e===r)return"";let s=-1,o=e.length-1;for(;a--;)if(r.codePointAt(a)===47){if(i){t=a+1;break}}else s<0&&(i=!0,s=a+1),o>-1&&(r.codePointAt(a)===e.codePointAt(o--)?o<0&&(n= Line truncated
`:" ")+i.indentLines(i.containerFlow(n,o.current()),e?jq:kRe))),c(),l}}function kRe(r,e,t){return e===0?r:jq(r,e,t)}function jq(r,e,t){return(t?"":" ")+r}const MRe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Kq.peek=BRe;function DRe(){return{canContainEols:["delete"],enter:{strikethrough:LRe},exit:{strikethrough:FRe}}}function PRe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:MRe}],handlers:{delete:Kq}}}function LRe(r){this.enter({type:"delete",children:[]},r)}function FRe(r){this.exit(r)}function Kq(r,e,t,n){const a=t.createTracker(n),i=t.enter("strikethrough");let s=a.move("~~");return s+=t.containerPhrasing(r,{...a.current(),before:s,after:"~"}),s+=a.move("~~"),i(),s}function BRe(){return"~"}function URe(r){return r.length}function $Re(r,e){const t=e||{},n=(t.align||[]).concat(),a=t.stringLength||URe,i=[],s=[],o=[],l=[];let c=0,u=-1;for(;++u<r.length;){const g=[],b=[];let _=-1;for(r[u].length>c&&(c=r[u].length);++_<r[u].length;){const v=GRe(r[u][_]);if(t.alignDelimiters!==!1){const y=a(v);b[_]=y,(l[_]===void 0||y>l[_])&&(l[_]=y)}g.push(v)}s[u]=g,o[u]=b}let d=-1;if(typeof n=="object"&&"length"in n)for(;++d<c;)i[d]=EP(n[d]);else{const g=EP(n);for(;++d<c;)i[d]=g}d=-1;const h=[],p=[];for(;++d<c;){const g=i[d];let b="",_="";g===99?(b=":",_=":"):g===108?b=":":g===114&&(_=":");let v=t.alignDelimiters===!1?1:Math.max(1,l[d]-b.length-_.length);const y=b+"-".repeat(v)+_;t.alignDelimiters!==!1&&(v=b.length+v+_.length,v>l[d]&&(l[d]=v),p[d]=v),h[d]=y}s.splice(1,0,h),o.splice(1,0,p),u=-1;const m=[];for(;++u<s.length;){const g=s[u],b=o[u];d=-1;const _=[];for(;++d<c;){const v=g[d]||"";let y="",E="";if(t.alignDelimiters!==!1){const S=l[d]-(b[d]||0),w=i[d];w===114?y=" ".repeat(S):w===99?S%2?(y=" ".repeat(S/2+.5),E=" ".repeat(S/2-.5)):(y=" ".repeat(S/2),E=y):E=" ".repeat(S)}t.delimiterStart!==!1&&!d&&_.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&v==="")&&(t.delimiterStart!==!1||d)&&_.push(" "),t.alignDelimiters!==!1&&_.push(y),_.push(v),t.alignDelimiters!==!1&&_.push(E),t.padding!==!1&&_.push(" "),(t.delimiterEnd!==!1||d!==c-1)&&_.push("|")}m.push(t.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return m.join(`
`)}function GRe(r){return r==null?"":String(r)}function EP(r){const e=typeof r=="string"?r.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function zRe(){return{enter:{table:qRe,tableData:wP,tableHeader:wP,tableRow:VRe},exit:{codeText:YRe,table:HRe,tableData:ZT,tableHeader:ZT,tableRow:ZT}}}function qRe(r){const e=r._align;this.enter({type:"table",align:e.map(function(t){return t==="none"?null:t}),children:[]},r),this.data.inTable=!0}function HRe(r){this.exit(r),this.data.inTable=void 0}function VRe(r){this.enter({type:"tableRow",children:[]},r)}function ZT(r){this.exit(r)}function wP(r){this.enter({type:"tableCell",children:[]},r)}function YRe(r){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,WRe));const t=this.stack[this.stack.length-1];t.type,t.value=e,this.exit(r)}function WRe(r,e){return e==="|"?e:r}function jRe(r){const e=r||{},t=e.tableCellPadding,n=e.tablePipeAlign,a=e.stringLength,i=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:s,tableCell:l,tableRow:o}};function s(p,m,g,b){return c(u(p,g,b),p.align)}function o(p,m,g,b){const _=d(p,g,b),v=c([_]);return v.slice(0,v.indexOf(`
`))}function l(p,m,g,b){const _=g.enter("tableCell"),v=g.enter("phrasing"),y=g.containerPhrasing(p,{...b,before:i,after:i});return v(),_(),y}function c(p,m){return $Re(p,{align:m,alignDelimiters:n,padding:t,stringLength:a})}function u(p,m,g){const b=p.children;let _=-1;const v=[],y=m.enter("table");for(;++_<b.length;)v[_]=d(b[_],m,g);return y(),v}function d(p,m,g){const b=p.children;let _=-1;const v=[],y=m.enter("tableRow");for(;++_<b.length;)v[_]=l(b[_],p,m,g);return y(),v}function h(p,m,g){let b=Xx.inlineCode(p,m,g);return g.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function KRe(){return{exit:{taskListCheckValueChecked:TP,taskListCheckValueUnchecked:TP,paragraph:QRe}}}function XRe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:ZRe}}}function TP(r){const e=this.stack[this.stack.length-2];e.type,e.checked=r.type==="taskListCheckValueChecked"}function QRe(r){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const t=this.stack[this.stack.length-1];t.type;const n=t.children[0];if(n&&n.type==="text"){const a=e.children;let i=-1,s;for(;++i<a.length;){const o=a[i];if(o.type==="paragraph"){s=o;break}}s===t&&(n.value=n.value.slice(1),n.value.length===0?t.children.shift():t.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,t.position.start=Object.assign({},n.position.start)))}}this.exit(r)}function ZRe(r,e,t,n){const a=r.children[0],i=typeof r.checked=="boolean"&&a&&a.type==="paragraph",s="["+(r.checked?"x":" ")+"] ",o=t.createTracker(n);i&&o.move(s);let l=Xx.listItem(r,e,t,{...n,...o.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+s}}function JRe(){return[cRe(),NRe(),DRe(),zRe(),KRe()]}function eOe(r){return{extensions:[uRe(),IRe(r),PRe(),jRe(r),XRe()]}}const tOe={tokenize:oOe,partial:!0},Xq={tokenize:lOe,partial:!0},Qq={tokenize:cOe,partial:!0},Zq={tokenize:uOe,partial:!0},rOe={tokenize:dOe,partial:!0},Jq={name:"wwwAutolink",tokenize:iOe,previous:tH},eH={name:"protocolAutolink",tokenize:sOe,previous:rH},eu={name:"emailAutolink",tokenize:aOe,previous:nH},Wl={};function nOe(){return{text:Wl}}let Cd=48;for(;Cd<123;)Wl[Cd]=eu,Cd++,Cd===58?Cd=65:Cd===91&&(Cd=97);Wl[43]=eu;Wl[45]=eu;Wl[46]=eu;Wl[95]=eu;Wl[72]=[eu,eH];Wl[104]=[eu,eH];Wl[87]=[eu,Jq];Wl[119]=[eu,Jq];function aOe(r,e,t){const n=this;let a,i;return s;function s(d){return!AA(d)||!nH.call(n,n.previous)||Zx(n.events)?t(d):(r.enter("literalAutolink"),r.enter("literalAutolinkEmail"),o(d))}function o(d){return AA(d)?(r.consume(d),o):d===64?(r.consume(d),l):t(d)}function l(d){return d===46?r.check(rOe,u,c)(d):d===45||d===95||zi(d)?(i=!0,r.consume(d),l):u(d)}function c(d){return r.consume(d),a=!0,l}function u(d){return i&&a&&is(n.previous)?(r.exit("literalAutolinkEmail"),r.exit("literalAutolink"),e(d)):t(d)}}function iOe(r,e,t){const n=this;return a;function a(s){return s!==87&&s!==119||!tH.call(n,n.previous)||Zx(n.events)?t(s):(r.enter("literalAutolink"),r.enter("literalAutolinkWww"),r.check(tOe,r.attempt(Xq,r.attempt(Qq,i),t),t)(s))}function i(s){return r.exit("literalAutolinkWww"),r.exit("literalAutolink"),e(s)}}function sOe(r,e,t){const n=this;let a="",i=!1;return s;function s(d){return(d===72||d===104)&&rH.call(n,n.previous)&&!Zx(n.events)?(r.enter("literalAutolink"),r.enter("literalAutolinkHttp"),a+=String.fromCodePoint(d),r.consume(d),o):t(d)}function o(d){if(is(d)&&a.length<5)return a+=String.fromCodePoint(d),r.consume(d),o;if(d===58){const h=a.toLowerCase();if(h==="http"||h==="https")return r.consume(d),l}return t(d)}function l(d){return d===47?(r.consume(d),i?c:(i=!0,l)):t(d)}function c(d){return d===null||Fb(d)||ra(d)||th(d)||Sy(d)?t(d):r.attempt(Xq,r.attempt(Qq,u),t)(d)}function u(d){return r.exit("literalAutolinkHttp"),r.exit("literalAutolink"),e(d)}}function oOe(r,e,t){let n=0;return a;function a(s){return(s===87||s===119)&&n<3?(n++,r.consume(s),a):s===46&&n===3?(r.consume(s),i):t(s)}function i(s){return s===null?t(s):e(s)}}function lOe(r,e,t){let n,a,i;return s;function s(c){return c===46||c===95?r.check(Zq,l,o)(c):c===null||ra(c)||th(c)||c!==45&&Sy(c)?l(c):(i=!0,r.consume(c),s)}function o(c){return c===95?n=!0:(a=n,n=void 0),r.consume(c),s}function l(c){return a||n||!i?t(c):e(c)}}function cOe(r,e){let t=0,n=0;return a;function a(s){return s===40?(t++,r.consume(s),a):s===41&&n<t?i(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?r.check(Zq,e,i)(s):s===null||ra(s)||th(s)?e(s):(r.consume(s),a)}function i(s){return s===41&&n++,r.consume(s),a}}function uOe(r,e,t){return n;function n(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(r.consume(o),n):o===38?(r.consume(o),i):o===93?(r.consume(o),a):o===60||o===null||ra(o)||th(o)?e(o):t(o)}function a(o){return o===null||o===40||o===91||ra(o)||th(o)?e(o):n(o)}function i(o){ Line truncated
`))}function l(p,m,g,b){const _=g.enter("tableCell"),v=g.enter("phrasing"),y=g.containerPhrasing(p,{...b,before:i,after:i});return v(),_(),y}function c(p,m){return $Re(p,{align:m,alignDelimiters:n,padding:t,stringLength:a})}function u(p,m,g){const b=p.children;let _=-1;const v=[],y=m.enter("table");for(;++_<b.length;)v[_]=d(b[_],m,g);return y(),v}function d(p,m,g){const b=p.children;let _=-1;const v=[],y=m.enter("tableRow");for(;++_<b.length;)v[_]=l(b[_],p,m,g);return y(),v}function h(p,m,g){let b=Xx.inlineCode(p,m,g);return g.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function KRe(){return{exit:{taskListCheckValueChecked:TP,taskListCheckValueUnchecked:TP,paragraph:QRe}}}function XRe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:ZRe}}}function TP(r){const e=this.stack[this.stack.length-2];e.type,e.checked=r.type==="taskListCheckValueChecked"}function QRe(r){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const t=this.stack[this.stack.length-1];t.type;const n=t.children[0];if(n&&n.type==="text"){const a=e.children;let i=-1,s;for(;++i<a.length;){const o=a[i];if(o.type==="paragraph"){s=o;break}}s===t&&(n.value=n.value.slice(1),n.value.length===0?t.children.shift():t.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,t.position.start=Object.assign({},n.position.start)))}}this.exit(r)}function ZRe(r,e,t,n){const a=r.children[0],i=typeof r.checked=="boolean"&&a&&a.type==="paragraph",s="["+(r.checked?"x":" ")+"] ",o=t.createTracker(n);i&&o.move(s);let l=Xx.listItem(r,e,t,{...n,...o.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+s}}function JRe(){return[cRe(),NRe(),DRe(),zRe(),KRe()]}function eOe(r){return{extensions:[uRe(),IRe(r),PRe(),jRe(r),XRe()]}}const tOe={tokenize:oOe,partial:!0},Xq={tokenize:lOe,partial:!0},Qq={tokenize:cOe,partial:!0},Zq={tokenize:uOe,partial:!0},rOe={tokenize:dOe,partial:!0},Jq={name:"wwwAutolink",tokenize:iOe,previous:tH},eH={name:"protocolAutolink",tokenize:sOe,previous:rH},tu={name:"emailAutolink",tokenize:aOe,previous:nH},Wl={};function nOe(){return{text:Wl}}let Cd=48;for(;Cd<123;)Wl[Cd]=tu,Cd++,Cd===58?Cd=65:Cd===91&&(Cd=97);Wl[43]=tu;Wl[45]=tu;Wl[46]=tu;Wl[95]=tu;Wl[72]=[tu,eH];Wl[104]=[tu,eH];Wl[87]=[tu,Jq];Wl[119]=[tu,Jq];function aOe(r,e,t){const n=this;let a,i;return s;function s(d){return!AA(d)||!nH.call(n,n.previous)||Zx(n.events)?t(d):(r.enter("literalAutolink"),r.enter("literalAutolinkEmail"),o(d))}function o(d){return AA(d)?(r.consume(d),o):d===64?(r.consume(d),l):t(d)}function l(d){return d===46?r.check(rOe,u,c)(d):d===45||d===95||zi(d)?(i=!0,r.consume(d),l):u(d)}function c(d){return r.consume(d),a=!0,l}function u(d){return i&&a&&is(n.previous)?(r.exit("literalAutolinkEmail"),r.exit("literalAutolink"),e(d)):t(d)}}function iOe(r,e,t){const n=this;return a;function a(s){return s!==87&&s!==119||!tH.call(n,n.previous)||Zx(n.events)?t(s):(r.enter("literalAutolink"),r.enter("literalAutolinkWww"),r.check(tOe,r.attempt(Xq,r.attempt(Qq,i),t),t)(s))}function i(s){return r.exit("literalAutolinkWww"),r.exit("literalAutolink"),e(s)}}function sOe(r,e,t){const n=this;let a="",i=!1;return s;function s(d){return(d===72||d===104)&&rH.call(n,n.previous)&&!Zx(n.events)?(r.enter("literalAutolink"),r.enter("literalAutolinkHttp"),a+=String.fromCodePoint(d),r.consume(d),o):t(d)}function o(d){if(is(d)&&a.length<5)return a+=String.fromCodePoint(d),r.consume(d),o;if(d===58){const h=a.toLowerCase();if(h==="http"||h==="https")return r.consume(d),l}return t(d)}function l(d){return d===47?(r.consume(d),i?c:(i=!0,l)):t(d)}function c(d){return d===null||Fb(d)||ra(d)||th(d)||Sy(d)?t(d):r.attempt(Xq,r.attempt(Qq,u),t)(d)}function u(d){return r.exit("literalAutolinkHttp"),r.exit("literalAutolink"),e(d)}}function oOe(r,e,t){let n=0;return a;function a(s){return(s===87||s===119)&&n<3?(n++,r.consume(s),a):s===46&&n===3?(r.consume(s),i):t(s)}function i(s){return s===null?t(s):e(s)}}function lOe(r,e,t){let n,a,i;return s;function s(c){return c===46||c===95?r.check(Zq,l,o)(c):c===null||ra(c)||th(c)||c!==45&&Sy(c)?l(c):(i=!0,r.consume(c),s)}function o(c){return c===95?n=!0:(a=n,n=void 0),r.consume(c),s}function l(c){return a||n||!i?t(c):e(c)}}function cOe(r,e){let t=0,n=0;return a;function a(s){return s===40?(t++,r.consume(s),a):s===41&&n<t?i(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?r.check(Zq,e,i)(s):s===null||ra(s)||th(s)?e(s):(r.consume(s),a)}function i(s){return s===41&&n++,r.consume(s),a}}function uOe(r,e,t){return n;function n(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(r.consume(o),n):o===38?(r.consume(o),i):o===93?(r.consume(o),a):o===60||o===null||ra(o)||th(o)?e(o):t(o)}function a(o){return o===null||o===40||o===91||ra(o)||th(o)?e(o):n(o)}function i(o){ Line truncated
`,inConstruct:"mathFlowMeta"},{character:"$",after:e?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:t,inlineMath:n}};function t(i,s,o,l){const c=i.value||"",u=o.createTracker(l),d="$".repeat(Math.max(Iq(c,"$")+1,2)),h=o.enter("mathFlow");let p=u.move(d);if(i.meta){const m=o.enter("mathFlowMeta");p+=u.move(o.safe(i.meta,{after:`
`,before:p,encode:["$"],...u.current()})),m()}return p+=u.move(`
`),c&&(p+=u.move(c+`
`)),p+=u.move(d),h(),p}function n(i,s,o){let l=i.value||"",c=1;for(e||c++;new RegExp("(^|[^$])"+"\\$".repeat(c)+"([^$]|$)").test(l);)c++;const u="$".repeat(c);/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^\$|\$$/.test(l))&&(l=" "+l+" ");let d=-1;for(;++d<o.unsafe.length;){const h=o.unsafe[d];if(!h.atBreak)continue;const p=o.compilePattern(h);let m;for(;m=p.exec(l);){let g=m.index;l.codePointAt(g)===10&&l.codePointAt(g-1)===13&&g--,l=l.slice(0,g)+" "+l.slice(m.index+1)}}return u+l+u}function a(){return"$"}}const FOe={tokenize:BOe,concrete:!0,name:"mathFlow"},AP={tokenize:UOe,partial:!0};function BOe(r,e,t){const n=this,a=n.events[n.events.length-1],i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0;let s=0;return o;function o(v){return r.enter("mathFlow"),r.enter("mathFlowFence"),r.enter("mathFlowFenceSequence"),l(v)}function l(v){return v===36?(r.consume(v),s++,l):s<2?t(v):(r.exit("mathFlowFenceSequence"),vn(r,c,"whitespace")(v))}function c(v){return v===null||Nr(v)?d(v):(r.enter("mathFlowFenceMeta"),r.enter("chunkString",{contentType:"string"}),u(v))}function u(v){return v===null||Nr(v)?(r.exit("chunkString"),r.exit("mathFlowFenceMeta"),d(v)):v===36?t(v):(r.consume(v),u)}function d(v){return r.exit("mathFlowFence"),n.interrupt?e(v):r.attempt(AP,h,b)(v)}function h(v){return r.attempt({tokenize:_,partial:!0},b,p)(v)}function p(v){return(i?vn(r,m,"linePrefix",i+1):m)(v)}function m(v){return v===null?b(v):Nr(v)?r.attempt(AP,h,b)(v):(r.enter("mathFlowValue"),g(v))}function g(v){return v===null||Nr(v)?(r.exit("mathFlowValue"),m(v)):(r.consume(v),g)}function b(v){return r.exit("mathFlow"),e(v)}function _(v,y,E){let S=0;return vn(v,w,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function w(N){return v.enter("mathFlowFence"),v.enter("mathFlowFenceSequence"),C(N)}function C(N){return N===36?(S++,v.consume(N),C):S<s?E(N):(v.exit("mathFlowFenceSequence"),vn(v,x,"whitespace")(N))}function x(N){return N===null||Nr(N)?(v.exit("mathFlowFence"),y(N)):E(N)}}}function UOe(r,e,t){const n=this;return a;function a(s){return s===null?e(s):(r.enter("lineEnding"),r.consume(s),r.exit("lineEnding"),i)}function i(s){return n.parser.lazy[n.now().line]?t(s):e(s)}}function $Oe(r){let t=(r||{}).singleDollarTextMath;return t==null&&(t=!0),{tokenize:n,resolve:GOe,previous:zOe,name:"mathText"};function n(a,i,s){let o=0,l,c;return u;function u(g){return a.enter("mathText"),a.enter("mathTextSequence"),d(g)}function d(g){return g===36?(a.consume(g),o++,d):o<2&&!t?s(g):(a.exit("mathTextSequence"),h(g))}function h(g){return g===null?s(g):g===36?(c=a.enter("mathTextSequence"),l=0,m(g)):g===32?(a.enter("space"),a.consume(g),a.exit("space"),h):Nr(g)?(a.enter("lineEnding"),a.consume(g),a.exit("lineEnding"),h):(a.enter("mathTextData"),p(g))}function p(g){return g===null||g===32||g===36||Nr(g)?(a.exit("mathTextData"),h(g)):(a.consume(g),p)}function m(g){return g===36?(a.consume(g),l++,m):l===o?(a.exit("mathTextSequence"),a.exit("mathText"),i(g)):(c.type="mathTextData",p(g))}}}function GOe(r){let e=r.length-4,t=3,n,a;if((r[t][1].type==="lineEnding"||r[t][1].type==="space")&&(r[e][1].type==="lineEnding"||r[e][1].type==="space")){for(n=t;++n<e;)if(r[n][1].type==="mathTextData"){r[e][1].type="mathTextPadding",r[t][1].type="mathTextPadding",t+=2,e-=2;break}}for(n=t-1,e++;++n<=e;)a===void 0?n!==e&&r[n][1].type!=="lineEnding"&&(a=n):(n===e||r[n][1].type==="lineEnding")&&(r[a][1].type="mathTextData",n!==a+2&&(r[a][1].end=r[n-1][1].end,r.splice(a+2,n-a-2),e-=n-a-2,n=a+2),a=void 0);return r}function zOe(r){return r!==36||this.events[this.events.length-1][1].type==="characterEscape"}function qOe(r){return{flow:{36:FOe},text:{36:$Oe(r)}}}class Ws{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?!e||!e.loc||!t.loc||e.loc.lexer!==t.loc.lexer?null:new Ws(e.loc.lexer,e.loc.start,t.loc.end):e&&e.loc}}class Oo{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new Oo(t,Ws.range(this,e))}}class $t{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n="KaTeX parse error: "+e,a,i,s=t&&t.loc;if(s&&s.start<=s.end){var o=s.lexer.input;a=s.start,i=s.end,a===o.length?n+=" at end of input: ":n+=" at position "+(a+1)+": ";var l=o.slice(a,i).replace(/[^]/g,"$&̲"),c;a>15?c="…"+o.slice(a-15,a):c=o.slice(0,a);var u;i+15<o.length?u=o.slice(i,i+15)+"…":u=o.slice(i),n+=c+l+u}var d=new Error(n);return d.name="ParseError",d.__proto__=$t.prototype,d.position=a,a!=null&&i!=null&&(d.length=i-a),d.rawMessage=e,d}}$t.prototype.__proto__=Error.prototype;var HOe=function(e,t){return e.indexOf(t)!==-1},VOe=function(e,t){return e===void 0?t:e},YOe=/([A-Z])/g,WOe=function(e){return e.replace(YOe,"-$1").toLowerCase()},jOe={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},KOe=/[&><"']/g;function X Line truncated
`)),p+=u.move(d),h(),p}function n(i,s,o){let l=i.value||"",c=1;for(e||c++;new RegExp("(^|[^$])"+"\\$".repeat(c)+"([^$]|$)").test(l);)c++;const u="$".repeat(c);/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^\$|\$$/.test(l))&&(l=" "+l+" ");let d=-1;for(;++d<o.unsafe.length;){const h=o.unsafe[d];if(!h.atBreak)continue;const p=o.compilePattern(h);let m;for(;m=p.exec(l);){let g=m.index;l.codePointAt(g)===10&&l.codePointAt(g-1)===13&&g--,l=l.slice(0,g)+" "+l.slice(m.index+1)}}return u+l+u}function a(){return"$"}}const FOe={tokenize:BOe,concrete:!0,name:"mathFlow"},AP={tokenize:UOe,partial:!0};function BOe(r,e,t){const n=this,a=n.events[n.events.length-1],i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0;let s=0;return o;function o(v){return r.enter("mathFlow"),r.enter("mathFlowFence"),r.enter("mathFlowFenceSequence"),l(v)}function l(v){return v===36?(r.consume(v),s++,l):s<2?t(v):(r.exit("mathFlowFenceSequence"),vn(r,c,"whitespace")(v))}function c(v){return v===null||Nr(v)?d(v):(r.enter("mathFlowFenceMeta"),r.enter("chunkString",{contentType:"string"}),u(v))}function u(v){return v===null||Nr(v)?(r.exit("chunkString"),r.exit("mathFlowFenceMeta"),d(v)):v===36?t(v):(r.consume(v),u)}function d(v){return r.exit("mathFlowFence"),n.interrupt?e(v):r.attempt(AP,h,b)(v)}function h(v){return r.attempt({tokenize:_,partial:!0},b,p)(v)}function p(v){return(i?vn(r,m,"linePrefix",i+1):m)(v)}function m(v){return v===null?b(v):Nr(v)?r.attempt(AP,h,b)(v):(r.enter("mathFlowValue"),g(v))}function g(v){return v===null||Nr(v)?(r.exit("mathFlowValue"),m(v)):(r.consume(v),g)}function b(v){return r.exit("mathFlow"),e(v)}function _(v,y,E){let S=0;return vn(v,w,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function w(N){return v.enter("mathFlowFence"),v.enter("mathFlowFenceSequence"),C(N)}function C(N){return N===36?(S++,v.consume(N),C):S<s?E(N):(v.exit("mathFlowFenceSequence"),vn(v,x,"whitespace")(N))}function x(N){return N===null||Nr(N)?(v.exit("mathFlowFence"),y(N)):E(N)}}}function UOe(r,e,t){const n=this;return a;function a(s){return s===null?e(s):(r.enter("lineEnding"),r.consume(s),r.exit("lineEnding"),i)}function i(s){return n.parser.lazy[n.now().line]?t(s):e(s)}}function $Oe(r){let t=(r||{}).singleDollarTextMath;return t==null&&(t=!0),{tokenize:n,resolve:GOe,previous:zOe,name:"mathText"};function n(a,i,s){let o=0,l,c;return u;function u(g){return a.enter("mathText"),a.enter("mathTextSequence"),d(g)}function d(g){return g===36?(a.consume(g),o++,d):o<2&&!t?s(g):(a.exit("mathTextSequence"),h(g))}function h(g){return g===null?s(g):g===36?(c=a.enter("mathTextSequence"),l=0,m(g)):g===32?(a.enter("space"),a.consume(g),a.exit("space"),h):Nr(g)?(a.enter("lineEnding"),a.consume(g),a.exit("lineEnding"),h):(a.enter("mathTextData"),p(g))}function p(g){return g===null||g===32||g===36||Nr(g)?(a.exit("mathTextData"),h(g)):(a.consume(g),p)}function m(g){return g===36?(a.consume(g),l++,m):l===o?(a.exit("mathTextSequence"),a.exit("mathText"),i(g)):(c.type="mathTextData",p(g))}}}function GOe(r){let e=r.length-4,t=3,n,a;if((r[t][1].type==="lineEnding"||r[t][1].type==="space")&&(r[e][1].type==="lineEnding"||r[e][1].type==="space")){for(n=t;++n<e;)if(r[n][1].type==="mathTextData"){r[e][1].type="mathTextPadding",r[t][1].type="mathTextPadding",t+=2,e-=2;break}}for(n=t-1,e++;++n<=e;)a===void 0?n!==e&&r[n][1].type!=="lineEnding"&&(a=n):(n===e||r[n][1].type==="lineEnding")&&(r[a][1].type="mathTextData",n!==a+2&&(r[a][1].end=r[n-1][1].end,r.splice(a+2,n-a-2),e-=n-a-2,n=a+2),a=void 0);return r}function zOe(r){return r!==36||this.events[this.events.length-1][1].type==="characterEscape"}function qOe(r){return{flow:{36:FOe},text:{36:$Oe(r)}}}class Ws{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?!e||!e.loc||!t.loc||e.loc.lexer!==t.loc.lexer?null:new Ws(e.loc.lexer,e.loc.start,t.loc.end):e&&e.loc}}class Oo{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new Oo(t,Ws.range(this,e))}}class $t{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n="KaTeX parse error: "+e,a,i,s=t&&t.loc;if(s&&s.start<=s.end){var o=s.lexer.input;a=s.start,i=s.end,a===o.length?n+=" at end of input: ":n+=" at position "+(a+1)+": ";var l=o.slice(a,i).replace(/[^]/g,"$&̲"),c;a>15?c="…"+o.slice(a-15,a):c=o.slice(0,a);var u;i+15<o.length?u=o.slice(i,i+15)+"…":u=o.slice(i),n+=c+l+u}var d=new Error(n);return d.name="ParseError",d.__proto__=$t.prototype,d.position=a,a!=null&&i!=null&&(d.length=i-a),d.rawMessage=e,d}}$t.prototype.__proto__=Error.prototype;var HOe=function(e,t){return e.indexOf(t)!==-1},VOe=function(e,t){return e===void 0?t:e},YOe=/([A-Z])/g,WOe=function(e){return e.replace(YOe,"-$1").toLowerCase()},jOe={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},KOe=/[&><"']/g;function X Line truncated
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
@@ -436,23 +436,23 @@ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class Ig{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return Lr.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){var e=t=>t.toText();return this.children.map(e).join("")}}var Nl={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,. Line truncated
`+C+" children.");for(var D=0;D<C;D++){var V=new zu(y[D]),q=new Hc([V],{width:"400em",height:Xt(w),viewBox:"0 0 "+o+" "+S,preserveAspectRatio:N[D]+" slice"}),$=lt.makeSvgSpan([x[D]],[q],t);if(C===1)return{span:$,minWidth:E,height:w};$.style.height=Xt(w),_.push($)}return{span:lt.makeSpan(["stretchy"],_,t),minWidth:E,height:w}}}var{span:a,minWidth:i,height:s}=n();return a.height=s,a.style.height=Xt(s),i>0&&(a.style.minWidth=Xt(i)),a},rIe=function(e,t,n,a,i){var s,o=e.height+e.depth+n+a;if(/fbox|color|angl/.test(t)){if(s=lt.makeSpan(["stretchy",t],[],i),t==="fbox"){var l=i.color&&i.getColor();l&&(s.style.borderColor=l)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new OA({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&c.push(new OA({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var u=new Hc(c,{width:"100%",height:Xt(o)});s=lt.makeSvgSpan([],[u],i)}return s.height=o,s.style.height=Xt(o),s},Yc={encloseSpan:rIe,mathMLnode:ZNe,svgSpan:tIe};function on(r,e){if(!r||r.type!==e)throw new Error("Expected node of type "+e+", but got "+(r?"node of type "+r.type:String(r)));return r}function s6(r){var e=xy(r);if(!e)throw new Error("Expected node of symbol group type, but got "+(r?"node of type "+r.type:String(r)));return e}function xy(r){return r&&(r.type==="atom"||xNe.hasOwnProperty(r.type))?r:null}var o6=(r,e)=>{var t,n,a;r&&r.type==="supsub"?(n=on(r.base,"accent"),t=n.base,r.base=t,a=CNe(Bn(r,e)),r.base=n):(n=on(r,"accent"),t=n.base);var i=Bn(t,e.havingCrampedStyle()),s=n.isShifty&&Lr.isCharacterBox(t),o=0;if(s){var l=Lr.getBaseElem(t),c=Bn(l,e.havingCrampedStyle());o=IP(c).skew}var u=n.label==="\\c",d=u?i.height+i.depth:Math.min(i.height,e.fontMetrics().xHeight),h;if(n.isStretchy)h=Yc.svgSpan(n,e),h=lt.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:h,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Xt(2*o)+")",marginLeft:Xt(2*o)}:void 0}]},e);else{var p,m;n.label==="\\vec"?(p=lt.staticSvg("vec",e),m=lt.svgData.vec[1]):(p=lt.makeOrd({mode:n.mode,text:n.label},e,"textord"),p=IP(p),p.italic=0,m=p.width,u&&(d+=p.depth)),h=lt.makeSpan(["accent-body"],[p]);var g=n.label==="\\textcircled";g&&(h.classes.push("accent-full"),d=i.height);var b=o;g||(b-=m/2),h.style.left=Xt(b),n.label==="\\textcircled"&&(h.style.top=".2em"),h=lt.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-d},{type:"elem",elem:h}]},e)}var _=lt.makeSpan(["mord","accent"],[h],e);return a?(a.children[0]=_,a.height=Math.max(_.height,a.height),a.classes[0]="mord",a):_},yH=(r,e)=>{var t=r.isStretchy?Yc.mathMLnode(r.label):new Bt.MathNode("mo",[Do(r.label,r.mode)]),n=new Bt.MathNode("mover",[na(r.base,e),t]);return n.setAttribute("accent","true"),n},nIe=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(r=>"\\"+r).join("|"));ur({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(r,e)=>{var t=Hb(e[0]),n=!nIe.test(r.funcName),a=!n||r.funcName==="\\widehat"||r.funcName==="\\widetilde"||r.funcName==="\\widecheck";return{type:"accent",mode:r.parser.mode,label:r.funcName,isStretchy:n,isShifty:a,base:t}},htmlBuilder:o6,mathmlBuilder:yH});ur({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(r,e)=>{var t=e[0],n=r.parser.mode;return n==="math"&&(r.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+r.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:r.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:o6,mathmlBuilder:yH});ur({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:n}=r,a=e[0];return{type:"accentUnder",mode:t.mode,label:n,base:a}},htmlBuilder:(r,e)=>{var t=Bn(r.base,e),n=Yc.svgSpan(r,e),a=r.label==="\\utilde"?.12:0,i=lt.makeVList({positionType:"top",positionData:t.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:a},{type:"elem",elem:t}]},e);return lt.makeSpan(["mord","accentunder"],[i],e)},mathmlBuilder:(r,e)=>{var t=Yc.mathMLnode(r.label),n=new Bt.MathNode("munder",[na(r.base,e),t]);return n.setAttribute("accentunder","true"),n}});var r_=r=>{var e=new Bt.MathNode("mpadded",r?[r]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};ur({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLLine truncated
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class Ig{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return Lr.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){var e=t=>t.toText();return this.children.map(e).join("")}}var Nl={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,. Line truncated
`+C+" children.");for(var D=0;D<C;D++){var V=new qu(y[D]),q=new Hc([V],{width:"400em",height:Xt(w),viewBox:"0 0 "+o+" "+S,preserveAspectRatio:N[D]+" slice"}),$=lt.makeSvgSpan([x[D]],[q],t);if(C===1)return{span:$,minWidth:E,height:w};$.style.height=Xt(w),_.push($)}return{span:lt.makeSpan(["stretchy"],_,t),minWidth:E,height:w}}}var{span:a,minWidth:i,height:s}=n();return a.height=s,a.style.height=Xt(s),i>0&&(a.style.minWidth=Xt(i)),a},rIe=function(e,t,n,a,i){var s,o=e.height+e.depth+n+a;if(/fbox|color|angl/.test(t)){if(s=lt.makeSpan(["stretchy",t],[],i),t==="fbox"){var l=i.color&&i.getColor();l&&(s.style.borderColor=l)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new OA({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&c.push(new OA({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var u=new Hc(c,{width:"100%",height:Xt(o)});s=lt.makeSvgSpan([],[u],i)}return s.height=o,s.style.height=Xt(o),s},Yc={encloseSpan:rIe,mathMLnode:ZNe,svgSpan:tIe};function on(r,e){if(!r||r.type!==e)throw new Error("Expected node of type "+e+", but got "+(r?"node of type "+r.type:String(r)));return r}function s6(r){var e=xy(r);if(!e)throw new Error("Expected node of symbol group type, but got "+(r?"node of type "+r.type:String(r)));return e}function xy(r){return r&&(r.type==="atom"||xNe.hasOwnProperty(r.type))?r:null}var o6=(r,e)=>{var t,n,a;r&&r.type==="supsub"?(n=on(r.base,"accent"),t=n.base,r.base=t,a=CNe(Bn(r,e)),r.base=n):(n=on(r,"accent"),t=n.base);var i=Bn(t,e.havingCrampedStyle()),s=n.isShifty&&Lr.isCharacterBox(t),o=0;if(s){var l=Lr.getBaseElem(t),c=Bn(l,e.havingCrampedStyle());o=IP(c).skew}var u=n.label==="\\c",d=u?i.height+i.depth:Math.min(i.height,e.fontMetrics().xHeight),h;if(n.isStretchy)h=Yc.svgSpan(n,e),h=lt.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:h,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Xt(2*o)+")",marginLeft:Xt(2*o)}:void 0}]},e);else{var p,m;n.label==="\\vec"?(p=lt.staticSvg("vec",e),m=lt.svgData.vec[1]):(p=lt.makeOrd({mode:n.mode,text:n.label},e,"textord"),p=IP(p),p.italic=0,m=p.width,u&&(d+=p.depth)),h=lt.makeSpan(["accent-body"],[p]);var g=n.label==="\\textcircled";g&&(h.classes.push("accent-full"),d=i.height);var b=o;g||(b-=m/2),h.style.left=Xt(b),n.label==="\\textcircled"&&(h.style.top=".2em"),h=lt.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-d},{type:"elem",elem:h}]},e)}var _=lt.makeSpan(["mord","accent"],[h],e);return a?(a.children[0]=_,a.height=Math.max(_.height,a.height),a.classes[0]="mord",a):_},yH=(r,e)=>{var t=r.isStretchy?Yc.mathMLnode(r.label):new Bt.MathNode("mo",[Do(r.label,r.mode)]),n=new Bt.MathNode("mover",[na(r.base,e),t]);return n.setAttribute("accent","true"),n},nIe=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(r=>"\\"+r).join("|"));ur({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(r,e)=>{var t=Hb(e[0]),n=!nIe.test(r.funcName),a=!n||r.funcName==="\\widehat"||r.funcName==="\\widetilde"||r.funcName==="\\widecheck";return{type:"accent",mode:r.parser.mode,label:r.funcName,isStretchy:n,isShifty:a,base:t}},htmlBuilder:o6,mathmlBuilder:yH});ur({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(r,e)=>{var t=e[0],n=r.parser.mode;return n==="math"&&(r.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+r.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:r.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:o6,mathmlBuilder:yH});ur({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:n}=r,a=e[0];return{type:"accentUnder",mode:t.mode,label:n,base:a}},htmlBuilder:(r,e)=>{var t=Bn(r.base,e),n=Yc.svgSpan(r,e),a=r.label==="\\utilde"?.12:0,i=lt.makeVList({positionType:"top",positionData:t.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:a},{type:"elem",elem:t}]},e);return lt.makeSpan(["mord","accentunder"],[i],e)},mathmlBuilder:(r,e)=>{var t=Yc.mathMLnode(r.label),n=new Bt.MathNode("munder",[na(r.base,e),t]);return n.setAttribute("accentunder","true"),n}});var r_=r=>{var e=new Bt.MathNode("mpadded",r?[r]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};ur({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLLine truncated
]`,NIe="\\\\[a-zA-Z@]+",IIe="\\\\[^\uD800-\uDFFF]",kIe="("+NIe+")"+WH+"*",MIe=`\\\\(
|[ \r ]+
?)[ \r ]*`,PA="[̀-ͯ]",DIe=new RegExp(PA+"+$"),PIe="("+WH+"+)|"+(MIe+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(PA+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(PA+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+kIe)+("|"+IIe+")");class rL{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(PIe,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new Oo("EOF",new Ws(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new $t("Unexpected character: '"+e[t]+"'",new Oo(e[t],new Ws(this,t,t+1)));var a=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[a]===14){var i=e.indexOf(`
`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new Oo(a,new Ws(this,t,this.tokenRegex.lastIndex))}}class LIe{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new $t("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var a=0;a<this.undefStack.length;a++)delete this.undefStack[a][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}}var FIe=LH;Se("\\noexpand",function(r){var e=r.popToken();return r.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});Se("\\expandafter",function(r){var e=r.popToken();return r.expandOnce(!0),{tokens:[e],numArgs:0}});Se("\\@firstoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[0],numArgs:0}});Se("\\@secondoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[1],numArgs:0}});Se("\\@ifnextchar",function(r){var e=r.consumeArgs(3);r.consumeSpaces();var t=r.future();return e[0].length===1&&e[0][0].text===t.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});Se("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");Se("\\TextOrMath",function(r){var e=r.consumeArgs(2);return r.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var nL={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Se("\\char",function(r){var e=r.popToken(),t,n="";if(e.text==="'")t=8,e=r.popToken();else if(e.text==='"')t=16,e=r.popToken();else if(e.text==="`")if(e=r.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new $t("\\char` missing argument");n=e.text.charCodeAt(0)}else t=10;if(t){if(n=nL[e.text],n==null||n>=t)throw new $t("Invalid base-"+t+" digit "+e.text);for(var a;(a=nL[r.future().text])!=null&&a<t;)n*=t,n+=a,r.popToken()}return"\\@char{"+n+"}"});var m6=(r,e,t,n)=>{var a=r.consumeArg().tokens;if(a.length!==1)throw new $t("\\newcommand's first argument must be a macro name");var i=a[0].text,s=r.isDefined(i);if(s&&!e)throw new $t("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!s&&!t)throw new $t("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(a=r.consumeArg().tokens,a.length===1&&a[0].text==="["){for(var l="",c=r.expandNextToken();c.text!=="]"&&c.text!=="EOF";)l+=c.text,c=r.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new $t("Invalid number of arguments: "+l);o=parseInt(l),a=r.consumeArg().tokens}return s&&n||r.macros.set(i,{tokens:a,numArgs:o}),""};Se("\\newcommand",r=>m6(r,!1,!0,!1));Se("\\renewcommand",r=>m6(r,!0,!1,!1));Se("\\providecommand",r=>m6(r,!0,!0,!0));Se("\\message",r=>{var e=r.consumeArgs(1)[0];return console.log(e.reverse().map(t=>t.text).join("")),""});Se("\\errmessage",r=>{var e=r.consumeArgs(1)[0];return console.error(e.reverse().map(t=>t.text).join("")),""});Se("\\show",r=>{var e=r.popToken(),t=e.text;return console.log(e,r.macros.get(t),wu[t],sa.math[t],sa.text[t]),""});Se("\\bgroup","{");Se("\\egroup","}");Se("~","\\nobreakspace");Se("\\lq","`");Se("\\rq","'");Se("\\aa","\\r a");Se("\\AA","\\r A");Se("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");Se("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");Se("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");Se("ℬ","\\mathscr{B}");Se("ℰ","\\mathscr{E}");Se("ℱ","\\mathscr{F}");Se("ℋ","\\mathscr{H}");Se("ℐ","\\mathscr{I}");Se("ℒ","\\mathscr{L}");Se("ℳ","\\mathscr{M}");Se("ℛ","\\mathscr{R}");Se("ℭ","\\mathfrak{C}");Se("ℌ","\\mathfrak{H}");Se("ℨ","\\mathfrak{Z}");Se("\\Bbbk","\\Bbb{k}");Se("·","\\cdotp");Se("\\llap","\\mathllap{\\textrm{#1}}");Se("\\rlap","\\mathrlap{\\textrm{#1}}");Se("\\clap","\\mathclap{\\textrm{#1}}");Se("\\mathstrut","\\vphantom{(}");Se("\\underbar","\\underline{\\text{#1}}");Se("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');Se("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");Se("\\ne","\\neq");Se("≠","\\neq");Se("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\ms Line truncated
please report what input caused this bug`);return n=n.slice(1,-1),{type:"verb",mode:"text",body:n,star:a}}sL.hasOwnProperty(t[0])&&!sa[this.mode][t[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=sL[t[0]]+t.slice(1));var i=DIe.exec(t);i&&(t=t.substring(0,i.index),t==="i"?t="ı":t==="j"&&(t="ȷ"));var s;if(sa[this.mode][t]){this.settings.strict&&this.mode==="math"&&NA.indexOf(t)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var o=sa[this.mode][t].group,l=Ws.range(e),c;if(ANe.hasOwnProperty(o)){var u=o;c={type:"atom",mode:this.mode,family:u,loc:l,text:t}}else c={type:o,mode:this.mode,loc:l,text:t};s=c}else if(t.charCodeAt(0)>=128)this.settings.strict&&(iH(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),e)),s={type:"textord",mode:"text",loc:Ws.range(e),text:t};else return null;if(this.consume(),i)for(var d=0;d<i[0].length;d++){var h=i[0][d];if(!fC[h])throw new $t("Unknown accent ' "+h+"'",e);var p=fC[h][this.mode]||fC[h].text;if(!p)throw new $t("Accent "+h+" unsupported in "+this.mode+" mode",e);s={type:"accent",mode:this.mode,loc:Ws.range(e),label:p,isStretchy:!1,isShifty:!0,base:s}}return s}}Iy.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var _6=function(e,t){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new Iy(e,t);delete n.gullet.macros.current["\\df@tag"];var a=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new $t("\\tag works only in display equations");a=[{type:"tag",mode:"text",body:a,tag:n.subparse([new Oo("\\df@tag")])}]}return a},QH=function(e,t,n){t.textContent="";var a=b6(e,n).toNode();t.appendChild(a)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),QH=function(){throw new $t("KaTeX doesn't work in quirks mode.")});var UIe=function(e,t){var n=b6(e,t).toMarkup();return n},$Ie=function(e,t){var n=new Jx(t);return _6(e,n)},ZH=function(e,t,n){if(n.throwOnError||!(e instanceof $t))throw e;var a=lt.makeSpan(["katex-error"],[new Mo(t)]);return a.setAttribute("title",e.toString()),a.setAttribute("style","color:"+n.errorColor),a},b6=function(e,t){var n=new Jx(t);try{var a=_6(e,n);return KNe(a,e,n)}catch(i){return ZH(i,e,n)}},GIe=function(e,t){var n=new Jx(t);try{var a=_6(e,n);return XNe(a,e,n)}catch(i){return ZH(i,e,n)}},zIe="0.16.22",qIe={Span:kg,Anchor:r6,SymbolNode:Mo,SvgNode:Hc,PathNode:zu,LineNode:OA},oL={version:zIe,render:QH,renderToString:UIe,ParseError:$t,SETTINGS_SCHEMA:I_,__parse:$Ie,__renderToDomTree:b6,__renderToHTMLTree:GIe,__setFontMetrics:bNe,__defineSymbol:X,__defineFunction:ur,__defineMacro:Se,__domTree:qIe};const HIe={};function VIe(r){const e=this,t=r||HIe,n=e.data(),a=n.micromarkExtensions||(n.micromarkExtensions=[]),i=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),s=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);a.push(qOe(t)),i.push(POe()),s.push(LOe(t))}const lL=function(r,e,t){const n=Og(t);if(!r||!r.type||!r.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=r.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++e<r.children.length;)if(n(r.children[e],e,r))return r.children[e]},mh=function(r){if(r==null)return jIe;if(typeof r=="string")return WIe(r);if(typeof r=="object")return YIe(r);if(typeof r=="function")return v6(r);throw new Error("Expected function, string, or array as `test`")};function YIe(r){const e=[];let t=-1;for(;++t<r.length;)e[t]=mh(r[t]);return v6(n);function n(...a){let i=-1;for(;++i<e.length;)if(e[i].apply(this,a))return!0;return!1}}function WIe(r){return v6(e);function e(t){return t.tagName===r}}function v6(r){return e;function e(t,n,a){return!!(KIe(t)&&r.call(this,t,typeof n=="number"?n:void 0,a||void 0))}}function jIe(r){return!!(r&&typeof r=="object"&&"type"in r&&r.type==="element"&&"tagName"in r&&typeof r.tagName=="string")}function KIe(r){return r!==null&&typeof r=="object"&&"type"in r&&"tagName"in r}const cL=/\n/g,uL=/[\t ]+/g,LA=mh("br"),dL=mh(r7e),XIe=mh("p"),hL=mh("tr"),QIe=mh(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",t7e,n7e]),JH=mh(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1" Line truncated
`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new Oo(a,new Ws(this,t,this.tokenRegex.lastIndex))}}class LIe{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new $t("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var a=0;a<this.undefStack.length;a++)delete this.undefStack[a][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}}var FIe=LH;Se("\\noexpand",function(r){var e=r.popToken();return r.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});Se("\\expandafter",function(r){var e=r.popToken();return r.expandOnce(!0),{tokens:[e],numArgs:0}});Se("\\@firstoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[0],numArgs:0}});Se("\\@secondoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[1],numArgs:0}});Se("\\@ifnextchar",function(r){var e=r.consumeArgs(3);r.consumeSpaces();var t=r.future();return e[0].length===1&&e[0][0].text===t.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});Se("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");Se("\\TextOrMath",function(r){var e=r.consumeArgs(2);return r.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var nL={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Se("\\char",function(r){var e=r.popToken(),t,n="";if(e.text==="'")t=8,e=r.popToken();else if(e.text==='"')t=16,e=r.popToken();else if(e.text==="`")if(e=r.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new $t("\\char` missing argument");n=e.text.charCodeAt(0)}else t=10;if(t){if(n=nL[e.text],n==null||n>=t)throw new $t("Invalid base-"+t+" digit "+e.text);for(var a;(a=nL[r.future().text])!=null&&a<t;)n*=t,n+=a,r.popToken()}return"\\@char{"+n+"}"});var m6=(r,e,t,n)=>{var a=r.consumeArg().tokens;if(a.length!==1)throw new $t("\\newcommand's first argument must be a macro name");var i=a[0].text,s=r.isDefined(i);if(s&&!e)throw new $t("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!s&&!t)throw new $t("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(a=r.consumeArg().tokens,a.length===1&&a[0].text==="["){for(var l="",c=r.expandNextToken();c.text!=="]"&&c.text!=="EOF";)l+=c.text,c=r.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new $t("Invalid number of arguments: "+l);o=parseInt(l),a=r.consumeArg().tokens}return s&&n||r.macros.set(i,{tokens:a,numArgs:o}),""};Se("\\newcommand",r=>m6(r,!1,!0,!1));Se("\\renewcommand",r=>m6(r,!0,!1,!1));Se("\\providecommand",r=>m6(r,!0,!0,!0));Se("\\message",r=>{var e=r.consumeArgs(1)[0];return console.log(e.reverse().map(t=>t.text).join("")),""});Se("\\errmessage",r=>{var e=r.consumeArgs(1)[0];return console.error(e.reverse().map(t=>t.text).join("")),""});Se("\\show",r=>{var e=r.popToken(),t=e.text;return console.log(e,r.macros.get(t),Tu[t],sa.math[t],sa.text[t]),""});Se("\\bgroup","{");Se("\\egroup","}");Se("~","\\nobreakspace");Se("\\lq","`");Se("\\rq","'");Se("\\aa","\\r a");Se("\\AA","\\r A");Se("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");Se("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");Se("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");Se("ℬ","\\mathscr{B}");Se("ℰ","\\mathscr{E}");Se("ℱ","\\mathscr{F}");Se("ℋ","\\mathscr{H}");Se("ℐ","\\mathscr{I}");Se("ℒ","\\mathscr{L}");Se("ℳ","\\mathscr{M}");Se("ℛ","\\mathscr{R}");Se("ℭ","\\mathfrak{C}");Se("ℌ","\\mathfrak{H}");Se("ℨ","\\mathfrak{Z}");Se("\\Bbbk","\\Bbb{k}");Se("·","\\cdotp");Se("\\llap","\\mathllap{\\textrm{#1}}");Se("\\rlap","\\mathrlap{\\textrm{#1}}");Se("\\clap","\\mathclap{\\textrm{#1}}");Se("\\mathstrut","\\vphantom{(}");Se("\\underbar","\\underline{\\text{#1}}");Se("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');Se("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");Se("\\ne","\\neq");Se("≠","\\neq");Se("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\ms Line truncated
please report what input caused this bug`);return n=n.slice(1,-1),{type:"verb",mode:"text",body:n,star:a}}sL.hasOwnProperty(t[0])&&!sa[this.mode][t[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=sL[t[0]]+t.slice(1));var i=DIe.exec(t);i&&(t=t.substring(0,i.index),t==="i"?t="ı":t==="j"&&(t="ȷ"));var s;if(sa[this.mode][t]){this.settings.strict&&this.mode==="math"&&NA.indexOf(t)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var o=sa[this.mode][t].group,l=Ws.range(e),c;if(ANe.hasOwnProperty(o)){var u=o;c={type:"atom",mode:this.mode,family:u,loc:l,text:t}}else c={type:o,mode:this.mode,loc:l,text:t};s=c}else if(t.charCodeAt(0)>=128)this.settings.strict&&(iH(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),e)),s={type:"textord",mode:"text",loc:Ws.range(e),text:t};else return null;if(this.consume(),i)for(var d=0;d<i[0].length;d++){var h=i[0][d];if(!fC[h])throw new $t("Unknown accent ' "+h+"'",e);var p=fC[h][this.mode]||fC[h].text;if(!p)throw new $t("Accent "+h+" unsupported in "+this.mode+" mode",e);s={type:"accent",mode:this.mode,loc:Ws.range(e),label:p,isStretchy:!1,isShifty:!0,base:s}}return s}}Iy.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var _6=function(e,t){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new Iy(e,t);delete n.gullet.macros.current["\\df@tag"];var a=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new $t("\\tag works only in display equations");a=[{type:"tag",mode:"text",body:a,tag:n.subparse([new Oo("\\df@tag")])}]}return a},QH=function(e,t,n){t.textContent="";var a=b6(e,n).toNode();t.appendChild(a)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),QH=function(){throw new $t("KaTeX doesn't work in quirks mode.")});var UIe=function(e,t){var n=b6(e,t).toMarkup();return n},$Ie=function(e,t){var n=new Jx(t);return _6(e,n)},ZH=function(e,t,n){if(n.throwOnError||!(e instanceof $t))throw e;var a=lt.makeSpan(["katex-error"],[new Mo(t)]);return a.setAttribute("title",e.toString()),a.setAttribute("style","color:"+n.errorColor),a},b6=function(e,t){var n=new Jx(t);try{var a=_6(e,n);return KNe(a,e,n)}catch(i){return ZH(i,e,n)}},GIe=function(e,t){var n=new Jx(t);try{var a=_6(e,n);return XNe(a,e,n)}catch(i){return ZH(i,e,n)}},zIe="0.16.22",qIe={Span:kg,Anchor:r6,SymbolNode:Mo,SvgNode:Hc,PathNode:qu,LineNode:OA},oL={version:zIe,render:QH,renderToString:UIe,ParseError:$t,SETTINGS_SCHEMA:I_,__parse:$Ie,__renderToDomTree:b6,__renderToHTMLTree:GIe,__setFontMetrics:bNe,__defineSymbol:X,__defineFunction:ur,__defineMacro:Se,__domTree:qIe};const HIe={};function VIe(r){const e=this,t=r||HIe,n=e.data(),a=n.micromarkExtensions||(n.micromarkExtensions=[]),i=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),s=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);a.push(qOe(t)),i.push(POe()),s.push(LOe(t))}const lL=function(r,e,t){const n=Og(t);if(!r||!r.type||!r.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=r.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++e<r.children.length;)if(n(r.children[e],e,r))return r.children[e]},mh=function(r){if(r==null)return jIe;if(typeof r=="string")return WIe(r);if(typeof r=="object")return YIe(r);if(typeof r=="function")return v6(r);throw new Error("Expected function, string, or array as `test`")};function YIe(r){const e=[];let t=-1;for(;++t<r.length;)e[t]=mh(r[t]);return v6(n);function n(...a){let i=-1;for(;++i<e.length;)if(e[i].apply(this,a))return!0;return!1}}function WIe(r){return v6(e);function e(t){return t.tagName===r}}function v6(r){return e;function e(t,n,a){return!!(KIe(t)&&r.call(this,t,typeof n=="number"?n:void 0,a||void 0))}}function jIe(r){return!!(r&&typeof r=="object"&&"type"in r&&r.type==="element"&&"tagName"in r&&typeof r.tagName=="string")}function KIe(r){return r!==null&&typeof r=="object"&&"type"in r&&"tagName"in r}const cL=/\n/g,uL=/[\t ]+/g,LA=mh("br"),dL=mh(r7e),XIe=mh("p"),hL=mh("tr"),QIe=mh(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",t7e,n7e]),JH=mh(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1" Line truncated
`.repeat(c)||" "),c=-1,l.push(u))}return l.join("")}function tV(r,e,t){return r.type==="element"?ZIe(r,e,t):r.type==="text"?t.whitespace==="normal"?rV(r,t):JIe(r):[]}function ZIe(r,e,t){const n=nV(r,t),a=r.children||[];let i=-1,s=[];if(QIe(r))return s;let o,l;for(LA(r)||hL(r)&&lL(e,r,hL)?l=`
`:XIe(r)?(o=2,l=2):JH(r)&&(o=1,l=1);++i<a.length;)s=s.concat(tV(a[i],r,{whitespace:n,breakBefore:i?void 0:o,breakAfter:i<a.length-1?LA(a[i+1]):l}));return dL(r)&&lL(e,r,dL)&&s.push(" "),o&&s.unshift(o),l&&s.push(l),s}function rV(r,e){const t=String(r.value),n=[],a=[];let i=0;for(;i<=t.length;){cL.lastIndex=i;const l=cL.exec(t),c=l&&"index"in l?l.index:t.length;n.push(e7e(t.slice(i,c).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),i===0?e.breakBefore:!0,c===t.length?e.breakAfter:!0)),i=c+1}let s=-1,o;for(;++s<n.length;)n[s].charCodeAt(n[s].length-1)===8203||s<n.length-1&&n[s+1].charCodeAt(0)===8203?(a.push(n[s]),o=void 0):n[s]?(typeof o=="number"&&a.push(o),a.push(n[s]),o=0):(s===0||s===n.length-1)&&a.push(0);return a}function JIe(r){return[String(r.value)]}function e7e(r,e,t){const n=[];let a=0,i;for(;a<r.length;){uL.lastIndex=a;const s=uL.exec(r);i=s?s.index:r.length,!a&&!i&&s&&!e&&n.push(""),a!==i&&n.push(r.slice(a,i)),a=s?i+s[0].length:i}return a!==i&&!t&&n.push(""),n.join(" ")}function nV(r,e){if(r.type==="element"){const t=r.properties||{};switch(r.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return t.wrap?"pre-wrap":"pre";case"td":case"th":return t.noWrap?"nowrap":e.whitespace;case"textarea":return"pre-wrap"}}return e.whitespace}function t7e(r){return!!(r.properties||{}).hidden}function r7e(r){return r.tagName==="td"||r.tagName==="th"}function n7e(r){return r.tagName==="dialog"&&!(r.properties||{}).open}function a7e(r){const e=r.regex,t=r.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",s="(?!struct)("+n+"|"+e.optional(a)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[r.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},r.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},r.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},t,r.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:e.optional(a)+r.IDENT_RE,relevance:0},p=e.optional(a)+r.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],b=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],_=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fpu Line truncated
`},c]}}const k7e=r=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:r.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[r.APOS_STRING_MODE,r.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:r.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),M7e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],D7e=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],P7e=[...M7e,...D7e],L7e=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),lV=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),cV=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),F7e=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-t Line truncated
]`,m={scope:"string",variants:[u,c,d,h]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},b=["false","null","true"],_=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],v=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],E={keyword:_,literal:($=>{const K=[];return $.forEach(z=>{K.push(z),z.toLowerCase()===z?K.push(z.toUpperCase()):K.push(z.toLowerCase())}),K})(b),built_in:v},S=$=>$.map(K=>K.replace(/\|\d+$/,"")),w={variants:[{match:[/new/,e.concat(p,"+"),e.concat("(?!",S(v).join("\\b|"),"\\b)"),a],scope:{1:"keyword",4:"title.class"}}]},C=e.concat(n,"\\b(?!\\()"),x={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),C],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[a,e.concat(/::/,e.lookahead(/(?!class\b)/)),C],scope:{1:"title.class",3:"variable.constant"}},{match:[a,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[a,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},N={scope:"attr",match:e.concat(n,e.lookahead(":"),e.lookahead(/(?!::)/))},I={relevance:0,begin:/\(/,end:/\)/,keywords:E,contains:[N,s,x,r.C_BLOCK_COMMENT_MODE,m,g,w]},D={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",S(_).join("\\b|"),"|",S(v).join("\\b|"),"\\b)"),n,e.concat(p,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[I]};I.contains.push(D);const V=[N,x,r.C_BLOCK_COMMENT_MODE,m,g,w],q={begin:e.concat(/#\[\s*\\?/,e.either(a,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:b,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:b,keyword:["new","array"]},contains:["self",...V]},...V,{scope:"meta",variants:[{match:a},{match:i}]}]};return{case_insensitive:!1,keywords:E,contains:[q,r.HASH_COMMENT_MODE,r.COMMENT("//","$"),r.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:r.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},o,{scope:"variable.language",match:/\$this\b/},s,D,x,{match:[/const/,/\s/,n],scope:{1:"keyword",3:"variable.constant"}},w,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},r.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:E,contains:["self",q,s,x,r.C_BLOCK_COMMENT_MODE,m,g]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"cl Line truncated
]`,m={scope:"string",variants:[u,c,d,h]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},b=["false","null","true"],_=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],v=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],E={keyword:_,literal:($=>{const K=[];return $.forEach(z=>{K.push(z),z.toLowerCase()===z?K.push(z.toUpperCase()):K.push(z.toLowerCase())}),K})(b),built_in:v},S=$=>$.map(K=>K.replace(/\|\d+$/,"")),w={variants:[{match:[/new/,e.concat(p,"+"),e.concat("(?!",S(v).join("\\b|"),"\\b)"),a],scope:{1:"keyword",4:"title.class"}}]},C=e.concat(n,"\\b(?!\\()"),x={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),C],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[a,e.concat(/::/,e.lookahead(/(?!class\b)/)),C],scope:{1:"title.class",3:"variable.constant"}},{match:[a,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[a,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},N={scope:"attr",match:e.concat(n,e.lookahead(":"),e.lookahead(/(?!::)/))},I={relevance:0,begin:/\(/,end:/\)/,keywords:E,contains:[N,s,x,r.C_BLOCK_COMMENT_MODE,m,g,w]},D={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",S(_).join("\\b|"),"|",S(v).join("\\b|"),"\\b)"),n,e.concat(p,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[I]};I.contains.push(D);const V=[N,x,r.C_BLOCK_COMMENT_MODE,m,g,w],q={begin:e.concat(/#\[\s*\\?/,e.either(a,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:b,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:b,keyword:["new","array"]},contains:["self",...V]},...V,{scope:"meta",variants:[{match:a},{match:i}]}]};return{case_insensitive:!1,keywords:E,contains:[q,r.HASH_COMMENT_MODE,r.COMMENT("//","$"),r.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:r.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},o,{scope:"variable.language",match:/\$this\b/},s,D,x,{match:[/const/,/\s/,n],scope:{1:"keyword",3:"variable.constant"}},w,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},r.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:E,contains:["self",q,s,x,r.C_BLOCK_COMMENT_MODE,m,g]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"cl Line truncated
`}]}function P8e(r,e){const t=e.value?e.value+`
`:"",n={},a=e.lang?e.lang.split(/\s+/):[];a.length>0&&(n.className=["language-"+a[0]]);let i={type:"element",tagName:"code",properties:n,children:[{type:"text",value:t}]};return e.meta&&(i.data={meta:e.meta}),r.patch(e,i),i=r.applyData(e,i),i={type:"element",tagName:"pre",properties:{},children:[i]},r.patch(e,i),i}function L8e(r,e){const t={type:"element",tagName:"del",properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}function F8e(r,e){const t={type:"element",tagName:"em",properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}function B8e(r,e){const t=typeof r.options.clobberPrefix=="string"?r.options.clobberPrefix:"user-content-",n=String(e.identifier).toUpperCase(),a=op(n.toLowerCase()),i=r.footnoteOrder.indexOf(n);let s,o=r.footnoteCounts.get(n);o===void 0?(o=0,r.footnoteOrder.push(n),s=r.footnoteOrder.length):s=i+1,o+=1,r.footnoteCounts.set(n,o);const l={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+a,id:t+"fnref-"+a+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};r.patch(e,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return r.patch(e,c),r.applyData(e,c)}function U8e(r,e){const t={type:"element",tagName:"h"+e.depth,properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}function $8e(r,e){if(r.options.allowDangerousHtml){const t={type:"raw",value:e.value};return r.patch(e,t),r.applyData(e,t)}}function SV(r,e){const t=e.referenceType;let n="]";if(t==="collapsed"?n+="[]":t==="full"&&(n+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+n}];const a=r.all(e),i=a[0];i&&i.type==="text"?i.value="["+i.value:a.unshift({type:"text",value:"["});const s=a[a.length-1];return s&&s.type==="text"?s.value+=n:a.push({type:"text",value:n}),a}function G8e(r,e){const t=String(e.identifier).toUpperCase(),n=r.definitionById.get(t);if(!n)return SV(r,e);const a={src:op(n.url||""),alt:e.alt};n.title!==null&&n.title!==void 0&&(a.title=n.title);const i={type:"element",tagName:"img",properties:a,children:[]};return r.patch(e,i),r.applyData(e,i)}function z8e(r,e){const t={src:op(e.url)};e.alt!==null&&e.alt!==void 0&&(t.alt=e.alt),e.title!==null&&e.title!==void 0&&(t.title=e.title);const n={type:"element",tagName:"img",properties:t,children:[]};return r.patch(e,n),r.applyData(e,n)}function q8e(r,e){const t={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};r.patch(e,t);const n={type:"element",tagName:"code",properties:{},children:[t]};return r.patch(e,n),r.applyData(e,n)}function H8e(r,e){const t=String(e.identifier).toUpperCase(),n=r.definitionById.get(t);if(!n)return SV(r,e);const a={href:op(n.url||"")};n.title!==null&&n.title!==void 0&&(a.title=n.title);const i={type:"element",tagName:"a",properties:a,children:r.all(e)};return r.patch(e,i),r.applyData(e,i)}function V8e(r,e){const t={href:op(e.url)};e.title!==null&&e.title!==void 0&&(t.title=e.title);const n={type:"element",tagName:"a",properties:t,children:r.all(e)};return r.patch(e,n),r.applyData(e,n)}function Y8e(r,e,t){const n=r.all(e),a=t?W8e(t):EV(e),i={},s=[];if(typeof e.checked=="boolean"){const u=n[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},n.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o<n.length;){const u=n[o];(a||o!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
`}),u.type==="element"&&u.tagName==="p"&&!a?s.push(...u.children):s.push(u)}const l=n[n.length-1];l&&(a||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
`});const c={type:"element",tagName:"li",properties:i,children:s};return r.patch(e,c),r.applyData(e,c)}function W8e(r){let e=!1;if(r.type==="list"){e=r.spread||!1;const t=r.children;let n=-1;for(;!e&&++n<t.length;)e=EV(t[n])}return e}function EV(r){const e=r.spread;return e??r.children.length>1}function j8e(r,e){const t={},n=r.all(e);let a=-1;for(typeof e.start=="number"&&e.start!==1&&(t.start=e.start);++a<n.length;){const s=n[a];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const i={type:"element",tagName:e.ordered?"ol":"ul",properties:t,children:r.wrap(n,!0)};return r.patch(e,i),r.applyData(e,i)}function K8e(r,e){const t={type:"element",tagName:"p",properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}function X8e(r,e){const t={type:"root",children:r.wrap(r.all(e))};return r.patch(e,t),r.applyData(e,t)}function Q8e(r,e){const t={type:"element",tagName:"strong",properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}const wV=CV("end"),TV=CV("start");function CV(r){return e;function e(t){const n=t&&t.position&&t.position[r]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function Z8e(r){const e=TV(r),t=wV(r);if(e&&t)return{start:e,end:t}}function J8e(r,e){const t=r.all(e),n=t.shift(),a=[];if(n){const s={type:"element",tagName:"thead",properties:{},children:r.wrap([n],!0)};r.patch(e.children[0],s),a.push(s)}if(t.length>0){const s={type:"element",tagName:"tbody",properties:{},children:r.wrap(t,!0)},o=TV(e.children[1]),l=wV(e.children[e.children.length-1]);o&&l&&(s.position={start:o,end:l}),a.push(s)}const i={type:"element",tagName:"table",properties:{},children:r.wrap(a,!0)};return r.patch(e,i),r.applyData(e,i)}function eke(r,e,t){const n=t?t.children:void 0,i=(n?n.indexOf(e):1)===0?"th":"td",s=t&&t.type==="table"?t.align:void 0,o=s?s.length:e.children.length;let l=-1;const c=[];for(;++l<o;){const d=e.children[l],h={},p=s?s[l]:void 0;p&&(h.align=p);let m={type:"element",tagName:i,properties:h,children:[]};d&&(m.children=r.all(d),r.patch(d,m),m=r.applyData(d,m)),c.push(m)}const u={type:"element",tagName:"tr",properties:{},children:r.wrap(c,!0)};return r.patch(e,u),r.applyData(e,u)}function tke(r,e){const t={type:"element",tagName:"td",properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}const vL=9,yL=32;function rke(r){const e=String(r),t=/\r?\n|\r/g;let n=t.exec(e),a=0;const i=[];for(;n;)i.push(SL(e.slice(a,n.index),a>0,!0),n[0]),a=n.index+n[0].length,n=t.exec(e);return i.push(SL(e.slice(a),a>0,!1)),i.join("")}function SL(r,e,t){let n=0,a=r.length;if(e){let i=r.codePointAt(n);for(;i===vL||i===yL;)n++,i=r.codePointAt(n)}if(t){let i=r.codePointAt(a-1);for(;i===vL||i===yL;)a--,i=r.codePointAt(a-1)}return a>n?r.slice(n,a):""}function nke(r,e){const t={type:"text",value:rke(String(e.value))};return r.patch(e,t),r.applyData(e,t)}function ake(r,e){const t={type:"element",tagName:"hr",properties:{},children:[]};return r.patch(e,t),r.applyData(e,t)}const ike={blockquote:M8e,break:D8e,code:P8e,delete:L8e,emphasis:F8e,footnoteReference:B8e,heading:U8e,html:$8e,imageReference:G8e,image:z8e,inlineCode:q8e,linkReference:H8e,link:V8e,listItem:Y8e,list:j8e,paragraph:K8e,root:X8e,strong:Q8e,table:J8e,tableCell:tke,tableRow:eke,text:nke,thematicBreak:ake,toml:u_,yaml:u_,definition:u_,footnoteDefinition:u_};function u_(){}const AV=-1,ky=0,dm=1,Wb=2,S6=3,E6=4,w6=5,T6=6,xV=7,RV=8,EL=typeof self=="object"?self:globalThis,ske=(r,e)=>{const t=(a,i)=>(r.set(i,a),a),n=a=>{if(r.has(a))return r.get(a);const[i,s]=e[a];switch(i){case ky:case AV:return t(s,a);case dm:{const o=t([],a);for(const l of s)o.push(n(l));return o}case Wb:{const o=t({},a);for(const[l,c]of s)o[n(l)]=n(c);return o}case S6:return t(new Date(s),a);case E6:{const{source:o,flags:l}=s;return t(new RegExp(o,l),a)}case w6:{const o=t(new Map,a);for(const[l,c]of s)o.set(n(l),n(c));return o}case T6:{const o=t(new Set,a);for(const l of s)o.add(n(l));return o}case xV:{const{name:o,message:l}=s;return t(new EL[o](l),a)}case RV:return t(BigInt(s),a);case"BigInt":return t(Object(BigInt(s)),a);case"ArrayBuffer":return t(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:o}=new Uint8Array(s);return t(new DataView(o),s)}}return t(new EL[i](s),a)};return n},wL=r=>ske(new Map,r)(0),Dh="",{toString:oke}={},{keys:lke}=Object,Bp=r=>{const e=typeof r;if(e!=="object"||!r)return[ky,e];const t=oke.call(r).slice(8,-1);switch(t){case"Array":return[dm,Dh];case"Object":return[Wb,Dh];case"Date":return[S6,Dh];case"RegExp":return[E6,Dh];case"Map":return[w6,Dh];case"Set":return[T6,Dh];case"DataView":return[dm,t]}return t.includes("Array")?[dm,t]:t.includes("Error")?[xV,t]:[Wb,t]},d_=([r,e])=>r===ky&&(e==="function"||e==="symbol"),cke=(r,e,t,n)=>{const a=(s,o)=>{const l=n.push(s)-1; Line truncated
`},{type:"element",tagName:"ol",properties:{},children:r.wrap(o,!0)},{type:"text",value:`
`}]}}const FA={}.hasOwnProperty,fke={};function pke(r,e){const t=e||fke,n=new Map,a=new Map,i=new Map,s={...ike,...t.handlers},o={all:c,applyData:gke,definitionById:n,footnoteById:a,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:t,patch:mke,wrap:bke};return id(r,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?n:a,h=String(u.identifier).toUpperCase();d.has(h)||d.set(h,u)}}),o;function l(u,d){const h=u.type,p=o.handlers[h];if(FA.call(o.handlers,h)&&p)return p(o,u,d);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in u){const{children:g,...b}=u,_=jb(b);return _.children=o.all(u),_}return jb(u)}return(o.options.unknownHandler||_ke)(o,u,d)}function c(u){const d=[];if("children"in u){const h=u.children;let p=-1;for(;++p<h.length;){const m=o.one(h[p],u);if(m){if(p&&h[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=CL(m.value)),!Array.isArray(m)&&m.type==="element")){const g=m.children[0];g&&g.type==="text"&&(g.value=CL(g.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function mke(r,e){r.position&&(e.position=Z8e(r))}function gke(r,e){let t=e;if(r&&r.data){const n=r.data.hName,a=r.data.hChildren,i=r.data.hProperties;if(typeof n=="string")if(t.type==="element")t.tagName=n;else{const s="children"in t?t.children:[t];t={type:"element",tagName:n,properties:{},children:s}}t.type==="element"&&i&&Object.assign(t.properties,jb(i)),"children"in t&&t.children&&a!==null&&a!==void 0&&(t.children=a)}return t}function _ke(r,e){const t=e.data||{},n="value"in e&&!(FA.call(t,"hProperties")||FA.call(t,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:r.all(e)};return r.patch(e,n),r.applyData(e,n)}function bke(r,e){const t=[];let n=-1;for(e&&t.push({type:"text",value:`
`}]}}const FA={}.hasOwnProperty,fke={};function pke(r,e){const t=e||fke,n=new Map,a=new Map,i=new Map,s={...ike,...t.handlers},o={all:c,applyData:gke,definitionById:n,footnoteById:a,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:t,patch:mke,wrap:bke};return eu(r,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?n:a,h=String(u.identifier).toUpperCase();d.has(h)||d.set(h,u)}}),o;function l(u,d){const h=u.type,p=o.handlers[h];if(FA.call(o.handlers,h)&&p)return p(o,u,d);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in u){const{children:g,...b}=u,_=jb(b);return _.children=o.all(u),_}return jb(u)}return(o.options.unknownHandler||_ke)(o,u,d)}function c(u){const d=[];if("children"in u){const h=u.children;let p=-1;for(;++p<h.length;){const m=o.one(h[p],u);if(m){if(p&&h[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=CL(m.value)),!Array.isArray(m)&&m.type==="element")){const g=m.children[0];g&&g.type==="text"&&(g.value=CL(g.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function mke(r,e){r.position&&(e.position=Z8e(r))}function gke(r,e){let t=e;if(r&&r.data){const n=r.data.hName,a=r.data.hChildren,i=r.data.hProperties;if(typeof n=="string")if(t.type==="element")t.tagName=n;else{const s="children"in t?t.children:[t];t={type:"element",tagName:n,properties:{},children:s}}t.type==="element"&&i&&Object.assign(t.properties,jb(i)),"children"in t&&t.children&&a!==null&&a!==void 0&&(t.children=a)}return t}function _ke(r,e){const t=e.data||{},n="value"in e&&!(FA.call(t,"hProperties")||FA.call(t,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:r.all(e)};return r.patch(e,n),r.applyData(e,n)}function bke(r,e){const t=[];let n=-1;for(e&&t.push({type:"text",value:`
`});++n<r.length;)n&&t.push({type:"text",value:`
`}),t.push(r[n]);return e&&r.length>0&&t.push({type:"text",value:`
`}),t}function CL(r){let e=0,t=r.charCodeAt(e);for(;t===9||t===32;)e++,t=r.charCodeAt(e);return r.slice(e)}function AL(r,e){const t=pke(r,e),n=t.one(r,void 0),a=hke(t),i=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return a&&i.children.push({type:"text",value:`
@@ -465,5 +465,5 @@ l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
\f\r "&'<=>\``.split("")],[`\0
\f\r "&'<=>\``.split(""),`\0
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function FMe(r,e,t,n){const a=n.schema,i=a.space==="svg"?!1:n.settings.omitOptionalTags;let s=a.space==="svg"?n.settings.closeEmptyElements:n.settings.voids.includes(r.tagName.toLowerCase());const o=[];let l;a.space==="html"&&r.tagName==="svg"&&(n.schema=A6);const c=BMe(n,r.properties),u=n.all(a.space==="html"&&r.tagName==="template"?r.content:r);return n.schema=a,u&&(s=!1),(c||!i||!IMe(r,e,t))&&(o.push("<",r.tagName,c?" "+c:""),s&&(a.space==="svg"||n.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!n.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&o.push(" "),o.push("/")),o.push(">")),o.push(u),!s&&(!i||!R6(r,e,t))&&o.push("</"+r.tagName+">"),o.join("")}function BMe(r,e){const t=[];let n=-1,a;if(e){for(a in e)if(e[a]!==null&&e[a]!==void 0){const i=UMe(r,a,e[a]);i&&t.push(i)}}for(;++n<t.length;){const i=r.settings.tightAttributes?t[n].charAt(t[n].length-1):void 0;n!==t.length-1&&i!=='"'&&i!=="'"&&(t[n]+=" ")}return t.join("")}function UMe(r,e,t){const n=LV(r.schema,e),a=r.settings.allowParseErrors&&r.schema.space==="html"?0:1,i=r.settings.allowDangerousCharacters?0:1;let s=r.quote,o;if(n.overloadedBoolean&&(t===n.attribute||t==="")?t=!0:(n.boolean||n.overloadedBoolean)&&(typeof t!="string"||t===n.attribute||t==="")&&(t=!!t),t==null||t===!1||typeof t=="number"&&Number.isNaN(t))return"";const l=bf(n.attribute,Object.assign({},r.settings.characterReferences,{subset:f_.name[a][i]}));return t===!0||(t=Array.isArray(t)?(n.commaSeparated?xke:Oke)(t,{padLeft:!r.settings.tightCommaSeparatedLists}):String(t),r.settings.collapseEmptyAttributes&&!t)?l:(r.settings.preferUnquoted&&(o=bf(t,Object.assign({},r.settings.characterReferences,{attribute:!0,subset:f_.unquoted[a][i]}))),o!==t&&(r.settings.quoteSmart&&Ub(t,s)>Ub(t,r.alternative)&&(s=r.alternative),o=s+bf(t,Object.assign({},r.settings.characterReferences,{subset:(s==="'"?f_.single:f_.double)[a][i],attribute:!0}))+s),l+(o&&"="+o))}const $Me=["<","&"];function VV(r,e,t,n){return t&&t.type==="element"&&(t.tagName==="script"||t.tagName==="style")?r.value:bf(r.value,Object.assign({},n.settings.characterReferences,{subset:$Me}))}function GMe(r,e,t,n){return n.settings.allowDangerousHtml?r.value:VV(r,e,t,n)}function zMe(r,e,t,n){return n.all(r)}const qMe=Rq("type",{invalid:HMe,unknown:VMe,handlers:{comment:pMe,doctype:mMe,element:FMe,raw:GMe,root:zMe,text:VV}});function HMe(r){throw new Error("Expected node, not `"+r+"`")}function VMe(r){const e=r;throw new Error("Cannot compile unknown node `"+e.type+"`")}const YMe={},WMe={},jMe=[];function KMe(r,e){const t=e||YMe,n=t.quote||'"',a=n==='"'?"'":'"';if(n!=='"'&&n!=="'")throw new Error("Invalid quote `"+n+"`, expected `'` or `\"`");return{one:XMe,all:QMe,settings:{omitOptionalTags:t.omitOptionalTags||!1,allowParseErrors:t.allowParseErrors||!1,allowDangerousCharacters:t.allowDangerousCharacters||!1,quoteSmart:t.quoteSmart||!1,preferUnquoted:t.preferUnquoted||!1,tightAttributes:t.tightAttributes||!1,upperDoctype:t.upperDoctype||!1,tightDoctype:t.tightDoctype||!1,bogusComments:t.bogusComments||!1,tightCommaSeparatedLists:t.tightCommaSeparatedLists||!1,tightSelfClosing:t.tightSelfClosing||!1,collapseEmptyAttributes:t.collapseEmptyAttributes||!1,allowDangerousHtml:t.allowDangerousHtml||!1,voids:t.voids||jke,characterReferences:t.characterReferences||WMe,closeSelfClosing:t.closeSelfClosing||!1,closeEmptyElements:t.closeEmptyElements||!1},schema:t.space==="svg"?A6:FV,quote:n,alternative:a}.one(Array.isArray(r)?{type:"root",children:r}:r,void 0,void 0)}function XMe(r,e,t){return qMe(r,e,t,this)}function QMe(r){const e=[],t=r&&r.children||jMe;let n=-1;for(;++n<t.length;)e[n]=this.one(t[n],n,r);return e.join("")}function ZMe(r){const e=this,t={...e.data("settings"),...r};e.compiler=n;function n(a){return KMe(a,t)}}function YV(r){const e=[...r.matchAll(_ae)];if(!e.length)return[{type:"text",value:r}];const t=[];let n=0;for(const a of e)a.index>n&&t.push({type:"text",value:r.slice(n,a.index)}),t.push({type:"element",tagName:"br",properties:{},children:[]}),n=a.index+a[0].length;return n<r.length&&t.push({type:"text",value:r.slice(n)}),t}function JMe(r){const e=r.trim().match(bae);if(!e)return null;const t=e[1],n=[];let a=0;for(const i of t.matchAll(vae)){if(t.slice(a,i.index).trim())return null;n.push({type:"element",tagName:"li",properties:{},children:YV(i[1]??"")}),a=i.index+i[0].length}return!n.length||t.slice(a).trim()?null:{type:"element",tagName:"ul",properties:{},children:n}}function eDe(r){Ty(r,"text",(e,t)=>{const n=t[t.length-1];if(!n||n.type!=="element")return;const i=n.children,s=i.indexOf(e);if(s===-1)return;let o="",l=s;for(let d=s;d<i.length;d++){const h=i[d];if(h.type==="text")o+=h.value,l=d;else if(h.type==="element"&&h.tagName==="br")o+=`
`,l=d;else break}const c=JMe(o);if(c){i.splice(s,l-s+1,c);return}const u=YV(e.value);(u.length!==1||u[0]!==e)&&i.splice(s,1,...u)})}const tDe=()=>r=>{id(r,"element",e=>{(e.tagName==="td"||e.tagName==="th")&&eDe(e)})},rDe=()=>r=>{id(r,"element",e=>{if(e.tagName!=="a")return;const t=e.properties??{};t.href&&(t.target="_blank",t.rel="noopener noreferrer",e.properties=t)})},nDe='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy-icon lucide-copy"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>',aDe='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-eye lucide-eye-icon"><path d="M2.062 12.345a1 1 0 0 1 0-.69C3.5 7.73 7.36 5 12 5s8.5 2.73 9.938 6.655a1 1 0 0 1 0 .69C20.5 16.27 16.64 19 12 19s-8.5-2.73-9.938-6.655"/><circle cx="12" cy="12" r="3"/></svg>';function WV(r){return{type:"element",tagName:"span",properties:{},children:[{type:"raw",value:r}]}}function iDe(r){return{type:"element",tagName:"button",properties:{className:[Jre],"data-code-id":r,title:"Copy code",type:"button"},children:[WV(nDe)]}}function sDe(r){return{type:"element",tagName:"button",properties:{className:[ene],"data-code-id":r,title:"Preview code",type:"button"},children:[WV(aDe)]}}function oDe(r,e){const t=[iDe(e)];return r.toLowerCase()==="html"&&t.push(sDe(e)),{type:"element",tagName:"div",properties:{className:[Xre]},children:[{type:"element",tagName:"span",properties:{className:[Zre]},children:[{type:"text",value:r}]},{type:"element",tagName:"div",properties:{className:[Qre]},children:t}]}}function lDe(r){return{type:"element",tagName:"div",properties:{className:[jre]},children:[r]}}function cDe(r,e){return{type:"element",tagName:"div",properties:{className:[Kre,tne]},children:[r,lDe(e)]}}function uDe(r){const e=r.properties?.className;if(!Array.isArray(e))return"text";for(const t of e)if(typeof t=="string"&&t.startsWith("language-"))return t.replace("language-","");return"text"}function dDe(){return typeof window<"u"?`code-${window.idxCodeBlock=(window.idxCodeBlock??0)+1}`:`code-${Date.now()}-${Math.random().toString(36).slice(2,7)}`}const hDe=()=>r=>{id(r,"element",(e,t,n)=>{if(e.tagName!=="pre"||!n||t===void 0)return;const a=e.children.find(c=>c.type==="element"&&c.tagName==="code");if(!a)return;const i=uDe(a),s=dDe();a.properties={...a.properties,"data-code-id":s};const o=oDe(i,s),l=cDe(o,e);n.children[t]=l})};function fDe(r){return e=>{id(e,"element",t=>{if(t.tagName==="img"&&t.properties?.src){const n=String(t.properties.src);if(n.startsWith(lo.DATA)||n.startsWith(lo.HTTP))return;const a=r.attachments?.find(i=>i.type===Kr.IMAGE&&i.name===n);a?.base64Url&&(t.properties.src=a.base64Url)}})}}function pDe(r){let e=0,t="";for(;e<r.length;){const n=r[e];if(n===" "){t+=WU,e+=1;continue}if(n===" "){t+=Ane,e+=1;continue}break}return t+r.slice(e)}function mDe(r){const e=r.split(Tne),t=[];for(const[n,a]of e.entries())n>0&&t.push({type:"break"}),t.push({type:"text",value:pDe(a)});return t.length||t.push({type:"text",value:""}),t}const gDe=()=>r=>{id(r,"html",(e,t,n)=>{if(!n||typeof t!="number")return;const a=mDe(e.value);if(!Cne.has(n.type)){const i={type:"paragraph",children:a,data:{literalHtml:!0}},s=n.children;if(s.splice(t,1,i),t>0){const o=s[t-1];if(o?.type==="paragraph"&&o.data?.literalHtml){const l=o.children;return l.length&&l[l.length-1].type!=="break"&&l.push({type:"break"}),l.push(...i.children),s.splice(t,1),t}}return t+1}return n.children.splice(t,1,...a),t+a.length})},jV="pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#79c0ff}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-comment,.hljs-code,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}",KV="pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#24292e;background:#fff}.hljs-do Line truncated
undone.`,1),XPe=G("<!> <!>",1),QPe=G("<!> <!>",1),ZPe=G("<!> <!>",1);function JPe(r,e){Ee(e,!0);let t=Y(e,"open",15);var n=se(),a=L(n);me(a,()=>nd,(i,s)=>{s(i,{get onOpenChange(){return e.onOpenChange},get open(){return t()},set open(o){t(o)},children:(o,l)=>{var c=se(),u=L(c);me(u,()=>td,(d,h)=>{h(d,{children:(p,m)=>{var g=ZPe(),b=L(g);me(b,()=>ed,(v,y)=>{y(v,{children:(E,S)=>{var w=XPe(),C=L(w);me(C,()=>Zu,(N,I)=>{I(N,{children:(D,V)=>{et();var q=Ot("Delete Server");T(D,q)},$$slots:{default:!0}})});var x=ee(C,2);me(x,()=>rd,(N,I)=>{I(N,{children:(D,V)=>{et();var q=KPe(),$=ee(L(q)),K=j($,!0);H($),et(),Ce(()=>Ge(K,e.displayName)),T(D,q)},$$slots:{default:!0}})}),T(E,w)},$$slots:{default:!0}})});var _=ee(b,2);me(_,()=>Ju,(v,y)=>{y(v,{children:(E,S)=>{var w=QPe(),C=L(w);me(C,()=>Dx,(N,I)=>{I(N,{children:(D,V)=>{et();var q=Ot("Cancel");T(D,q)},$$slots:{default:!0}})});var x=ee(C,2);me(x,()=>fh,(N,I)=>{I(N,{class:"text-destructive-foreground bg-destructive hover:bg-destructive/90",get onclick(){return e.onConfirm},children:(D,V)=>{et();var q=Ot("Delete");T(D,q)},$$slots:{default:!0}})}),T(E,w)},$$slots:{default:!0}})}),T(p,g)},$$slots:{default:!0}})}),T(o,c)},$$slots:{default:!0}})}),T(r,n),we()}var eLe=G('<div class="flex items-center justify-between gap-4"><div class="flex items-center gap-2"><!> <!> <!></div> <!></div> <div class="flex flex-wrap gap-1.5"><!> <!> <!></div> <div class="space-y-1.5"><!> <!></div> <!> <div class="flex justify-end gap-2"><!> <!> <!></div>',1);function tLe(r){Oc(r,{class:"grid gap-3 p-4",children:(e,t)=>{var n=eLe(),a=L(n),i=j(a),s=j(i);Fa(s,{class:"h-5 w-5 rounded"});var o=ee(s,2);Fa(o,{class:"h-5 w-28"});var l=ee(o,2);Fa(l,{class:"h-5 w-12 rounded-full"}),H(i);var c=ee(i,2);Fa(c,{class:"h-6 w-11 rounded-full"}),H(a);var u=ee(a,2),d=j(u);Fa(d,{class:"h-5 w-14 rounded-full"});var h=ee(d,2);Fa(h,{class:"h-5 w-12 rounded-full"});var p=ee(h,2);Fa(p,{class:"h-5 w-16 rounded-full"}),H(u);var m=ee(u,2),g=j(m);Fa(g,{class:"h-4 w-40"});var b=ee(g,2);Fa(b,{class:"h-4 w-52"}),H(m);var _=ee(m,2);Fa(_,{class:"h-3.5 w-36"});var v=ee(_,2),y=j(v);Fa(y,{class:"h-8 w-8 rounded"});var E=ee(y,2);Fa(E,{class:"h-8 w-8 rounded"});var S=ee(E,2);Fa(S,{class:"h-8 w-8 rounded"}),H(v),T(e,n)},$$slots:{default:!0}})}var rLe=G("<!> <span>Server instructions</span>",1),nLe=G('<p class="rounded bg-muted/50 p-2 text-xs text-muted-foreground"> </p>'),aLe=G("<!> <!>",1);function iLe(r,e){let t=_e(!1);var n=se(),a=L(n);{var i=s=>{var o=se(),l=L(o);me(l,()=>zf,(c,u)=>{u(c,{get class(){return e.class},get open(){return f(t)},set open(d){M(t,d,!0)},children:(d,h)=>{var p=aLe(),m=L(p);me(m,()=>qf,(b,_)=>{_(b,{class:"flex w-full items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:(v,y)=>{var E=rLe(),S=L(E);{var w=x=>{Uc(x,{class:"h-3.5 w-3.5"})},C=x=>{$c(x,{class:"h-3.5 w-3.5"})};le(S,x=>{f(t)?x(w):x(C,!1)})}et(2),T(v,E)},$$slots:{default:!0}})});var g=ee(m,2);me(g,()=>Hf,(b,_)=>{_(b,{class:"mt-2",children:(v,y)=>{var E=nLe(),S=j(E,!0);H(E),Ce(()=>Ge(S,e.instructions)),T(v,E)},$$slots:{default:!0}})}),T(d,p)},$$slots:{default:!0}})}),T(s,o)};le(a,s=>{e.instructions&&s(i)})}T(r,n)}var sLe=G('<div class="flex flex-col gap-2"><div class="mb-2 flex items-center gap-4"><!> <!></div> <h3 class="text-sm font-medium">Available resources</h3></div>');function oLe(r,e){Ee(e,!0);let t=Y(e,"searchQuery",3,"");var n=sLe(),a=j(n),i=j(a);My(i,{placeholder:"Search resources...",get value(){return t()},onInput:o=>e.onSearch?.(o)});var s=ee(i,2);kr(s,{variant:"ghost",size:"sm",class:"h-8 w-8 p-0",get onclick(){return e.onRefresh},get disabled(){return e.isLoading},title:"Refresh resources",children:(o,l)=>{var c=se(),u=L(c);{var d=p=>{Ka(p,{class:"h-4 w-4 animate-spin"})},h=p=>{Tc(p,{class:"h-4 w-4"})};le(u,p=>{e.isLoading?p(d):p(h,!1)})}T(o,c)},$$slots:{default:!0}}),H(a),et(2),H(n),T(r,n),we()}var lLe=G('<div class="py-4 text-center text-sm text-muted-foreground"><!></div>');function cLe(r,e){var t=lLe(),n=j(t);{var a=s=>{var o=Ot("Loading resources...");T(s,o)},i=s=>{var o=Ot("No resources available");T(s,o)};le(n,s=>{e.isLoading?s(a):s(i,!1)})}H(t),T(r,t)}function uLe(r,e){return r.title?.toLowerCase().includes(e)||r.uri.toLowerCase().includes(e)}function dLe(r,e,t){const n={name:"root",children:new Map};if(!t||!t.trim()){for(const s of r){const o=db(s.uri);let l=n;for(let u=0;u<o.length-1;u++){const d=o[u];l.children.has(d)||l.children.set(d,{name:d,children:new Map}),l=l.children.get(d)}const c=o[o.length-1]||s.name;l.children.set(s.uri,{name:c,resource:{...s,serverName:e},children:new Map})}return n}const a=t.toLowerCase();for(const s of r){if(!uLe(s,a))continue;const o=db(s.uri);let l=n;for(let u=0;u<o.length-1;u++){const d=o[u];l.children.has(d)||l.children.set(d,{name:d,children:new Map,isFiltered:!0}),l=l.children.get(d)}const c=o[o.length-1]||s.name;l.children.set(s.uri,{name:c,resource:{...s,serverName:e},children:new Map,isFiltered:!0})}function i(s){if(s.resource)return!0;const o=[];for(co Line truncated
`,l=d;else break}const c=JMe(o);if(c){i.splice(s,l-s+1,c);return}const u=YV(e.value);(u.length!==1||u[0]!==e)&&i.splice(s,1,...u)})}const tDe=()=>r=>{eu(r,"element",e=>{(e.tagName==="td"||e.tagName==="th")&&eDe(e)})},rDe=()=>r=>{eu(r,"element",e=>{if(e.tagName!=="a")return;const t=e.properties??{};t.href&&(t.target="_blank",t.rel="noopener noreferrer",e.properties=t)})},nDe='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy-icon lucide-copy"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>',aDe='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-eye lucide-eye-icon"><path d="M2.062 12.345a1 1 0 0 1 0-.69C3.5 7.73 7.36 5 12 5s8.5 2.73 9.938 6.655a1 1 0 0 1 0 .69C20.5 16.27 16.64 19 12 19s-8.5-2.73-9.938-6.655"/><circle cx="12" cy="12" r="3"/></svg>';function WV(r){return{type:"element",tagName:"span",properties:{},children:[{type:"raw",value:r}]}}function iDe(r){return{type:"element",tagName:"button",properties:{className:[Jre],"data-code-id":r,title:"Copy code",type:"button"},children:[WV(nDe)]}}function sDe(r){return{type:"element",tagName:"button",properties:{className:[ene],"data-code-id":r,title:"Preview code",type:"button"},children:[WV(aDe)]}}function oDe(r,e){const t=[iDe(e)];return r.toLowerCase()==="html"&&t.push(sDe(e)),{type:"element",tagName:"div",properties:{className:[Xre]},children:[{type:"element",tagName:"span",properties:{className:[Zre]},children:[{type:"text",value:r}]},{type:"element",tagName:"div",properties:{className:[Qre]},children:t}]}}function lDe(r){return{type:"element",tagName:"div",properties:{className:[jre]},children:[r]}}function cDe(r,e){return{type:"element",tagName:"div",properties:{className:[Kre,tne]},children:[r,lDe(e)]}}function uDe(r){const e=r.properties?.className;if(!Array.isArray(e))return"text";for(const t of e)if(typeof t=="string"&&t.startsWith("language-"))return t.replace("language-","");return"text"}function dDe(){return typeof window<"u"?`code-${window.idxCodeBlock=(window.idxCodeBlock??0)+1}`:`code-${Date.now()}-${Math.random().toString(36).slice(2,7)}`}const hDe=()=>r=>{eu(r,"element",(e,t,n)=>{if(e.tagName!=="pre"||!n||t===void 0)return;const a=e.children.find(c=>c.type==="element"&&c.tagName==="code");if(!a)return;const i=uDe(a),s=dDe();a.properties={...a.properties,"data-code-id":s};const o=oDe(i,s),l=cDe(o,e);n.children[t]=l})};function fDe(r){return e=>{eu(e,"element",t=>{if(t.tagName==="img"&&t.properties?.src){const n=String(t.properties.src);if(n.startsWith(lo.DATA)||n.startsWith(lo.HTTP))return;const a=r.attachments?.find(i=>i.type===Kr.IMAGE&&i.name===n);a?.base64Url&&(t.properties.src=a.base64Url)}})}}const pDe=()=>r=>{eu(r,"element",e=>{e.children&&e.children.length>0&&(e.properties={...e.properties,dir:"auto"})})};function mDe(r){let e=0,t="";for(;e<r.length;){const n=r[e];if(n===" "){t+=WU,e+=1;continue}if(n===" "){t+=Ane,e+=1;continue}break}return t+r.slice(e)}function gDe(r){const e=r.split(Tne),t=[];for(const[n,a]of e.entries())n>0&&t.push({type:"break"}),t.push({type:"text",value:mDe(a)});return t.length||t.push({type:"text",value:""}),t}const _De=()=>r=>{eu(r,"html",(e,t,n)=>{if(!n||typeof t!="number")return;const a=gDe(e.value);if(!Cne.has(n.type)){const i={type:"paragraph",children:a,data:{literalHtml:!0}},s=n.children;if(s.splice(t,1,i),t>0){const o=s[t-1];if(o?.type==="paragraph"&&o.data?.literalHtml){const l=o.children;return l.length&&l[l.length-1].type!=="break"&&l.push({type:"break"}),l.push(...i.children),s.splice(t,1),t}}return t+1}return n.children.splice(t,1,...a),t+a.length})},jV="pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#79c0ff}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-comment,.hljs-code,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}",KV="pre code. Line truncated
undone.`,1),QPe=G("<!> <!>",1),ZPe=G("<!> <!>",1),JPe=G("<!> <!>",1);function eLe(r,e){Ee(e,!0);let t=Y(e,"open",15);var n=se(),a=L(n);me(a,()=>ad,(i,s)=>{s(i,{get onOpenChange(){return e.onOpenChange},get open(){return t()},set open(o){t(o)},children:(o,l)=>{var c=se(),u=L(c);me(u,()=>rd,(d,h)=>{h(d,{children:(p,m)=>{var g=JPe(),b=L(g);me(b,()=>td,(v,y)=>{y(v,{children:(E,S)=>{var w=QPe(),C=L(w);me(C,()=>Ju,(N,I)=>{I(N,{children:(D,V)=>{et();var q=Ot("Delete Server");T(D,q)},$$slots:{default:!0}})});var x=ee(C,2);me(x,()=>nd,(N,I)=>{I(N,{children:(D,V)=>{et();var q=XPe(),$=ee(L(q)),K=j($,!0);H($),et(),Ce(()=>Ge(K,e.displayName)),T(D,q)},$$slots:{default:!0}})}),T(E,w)},$$slots:{default:!0}})});var _=ee(b,2);me(_,()=>ed,(v,y)=>{y(v,{children:(E,S)=>{var w=ZPe(),C=L(w);me(C,()=>Dx,(N,I)=>{I(N,{children:(D,V)=>{et();var q=Ot("Cancel");T(D,q)},$$slots:{default:!0}})});var x=ee(C,2);me(x,()=>fh,(N,I)=>{I(N,{class:"text-destructive-foreground bg-destructive hover:bg-destructive/90",get onclick(){return e.onConfirm},children:(D,V)=>{et();var q=Ot("Delete");T(D,q)},$$slots:{default:!0}})}),T(E,w)},$$slots:{default:!0}})}),T(p,g)},$$slots:{default:!0}})}),T(o,c)},$$slots:{default:!0}})}),T(r,n),we()}var tLe=G('<div class="flex items-center justify-between gap-4"><div class="flex items-center gap-2"><!> <!> <!></div> <!></div> <div class="flex flex-wrap gap-1.5"><!> <!> <!></div> <div class="space-y-1.5"><!> <!></div> <!> <div class="flex justify-end gap-2"><!> <!> <!></div>',1);function rLe(r){Oc(r,{class:"grid gap-3 p-4",children:(e,t)=>{var n=tLe(),a=L(n),i=j(a),s=j(i);Fa(s,{class:"h-5 w-5 rounded"});var o=ee(s,2);Fa(o,{class:"h-5 w-28"});var l=ee(o,2);Fa(l,{class:"h-5 w-12 rounded-full"}),H(i);var c=ee(i,2);Fa(c,{class:"h-6 w-11 rounded-full"}),H(a);var u=ee(a,2),d=j(u);Fa(d,{class:"h-5 w-14 rounded-full"});var h=ee(d,2);Fa(h,{class:"h-5 w-12 rounded-full"});var p=ee(h,2);Fa(p,{class:"h-5 w-16 rounded-full"}),H(u);var m=ee(u,2),g=j(m);Fa(g,{class:"h-4 w-40"});var b=ee(g,2);Fa(b,{class:"h-4 w-52"}),H(m);var _=ee(m,2);Fa(_,{class:"h-3.5 w-36"});var v=ee(_,2),y=j(v);Fa(y,{class:"h-8 w-8 rounded"});var E=ee(y,2);Fa(E,{class:"h-8 w-8 rounded"});var S=ee(E,2);Fa(S,{class:"h-8 w-8 rounded"}),H(v),T(e,n)},$$slots:{default:!0}})}var nLe=G("<!> <span>Server instructions</span>",1),aLe=G('<p class="rounded bg-muted/50 p-2 text-xs text-muted-foreground"> </p>'),iLe=G("<!> <!>",1);function sLe(r,e){let t=_e(!1);var n=se(),a=L(n);{var i=s=>{var o=se(),l=L(o);me(l,()=>zf,(c,u)=>{u(c,{get class(){return e.class},get open(){return f(t)},set open(d){M(t,d,!0)},children:(d,h)=>{var p=iLe(),m=L(p);me(m,()=>qf,(b,_)=>{_(b,{class:"flex w-full items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:(v,y)=>{var E=nLe(),S=L(E);{var w=x=>{Uc(x,{class:"h-3.5 w-3.5"})},C=x=>{$c(x,{class:"h-3.5 w-3.5"})};le(S,x=>{f(t)?x(w):x(C,!1)})}et(2),T(v,E)},$$slots:{default:!0}})});var g=ee(m,2);me(g,()=>Hf,(b,_)=>{_(b,{class:"mt-2",children:(v,y)=>{var E=aLe(),S=j(E,!0);H(E),Ce(()=>Ge(S,e.instructions)),T(v,E)},$$slots:{default:!0}})}),T(d,p)},$$slots:{default:!0}})}),T(s,o)};le(a,s=>{e.instructions&&s(i)})}T(r,n)}var oLe=G('<div class="flex flex-col gap-2"><div class="mb-2 flex items-center gap-4"><!> <!></div> <h3 class="text-sm font-medium">Available resources</h3></div>');function lLe(r,e){Ee(e,!0);let t=Y(e,"searchQuery",3,"");var n=oLe(),a=j(n),i=j(a);My(i,{placeholder:"Search resources...",get value(){return t()},onInput:o=>e.onSearch?.(o)});var s=ee(i,2);kr(s,{variant:"ghost",size:"sm",class:"h-8 w-8 p-0",get onclick(){return e.onRefresh},get disabled(){return e.isLoading},title:"Refresh resources",children:(o,l)=>{var c=se(),u=L(c);{var d=p=>{Ka(p,{class:"h-4 w-4 animate-spin"})},h=p=>{Tc(p,{class:"h-4 w-4"})};le(u,p=>{e.isLoading?p(d):p(h,!1)})}T(o,c)},$$slots:{default:!0}}),H(a),et(2),H(n),T(r,n),we()}var cLe=G('<div class="py-4 text-center text-sm text-muted-foreground"><!></div>');function uLe(r,e){var t=cLe(),n=j(t);{var a=s=>{var o=Ot("Loading resources...");T(s,o)},i=s=>{var o=Ot("No resources available");T(s,o)};le(n,s=>{e.isLoading?s(a):s(i,!1)})}H(t),T(r,t)}function dLe(r,e){return r.title?.toLowerCase().includes(e)||r.uri.toLowerCase().includes(e)}function hLe(r,e,t){const n={name:"root",children:new Map};if(!t||!t.trim()){for(const s of r){const o=db(s.uri);let l=n;for(let u=0;u<o.length-1;u++){const d=o[u];l.children.has(d)||l.children.set(d,{name:d,children:new Map}),l=l.children.get(d)}const c=o[o.length-1]||s.name;l.children.set(s.uri,{name:c,resource:{...s,serverName:e},children:new Map})}return n}const a=t.toLowerCase();for(const s of r){if(!dLe(s,a))continue;const o=db(s.uri);let l=n;for(let u=0;u<o.length-1;u++){const d=o[u];l.children.has(d)||l.children.set(d,{name:d,children:new Map,isFiltered:!0}),l=l.children.get(d)}const c=o[o.length-1]||s.name;l.children.set(s.uri,{name:c,resource:{...s,serverName:e},children:new Map,isFiltered:!0})}function i(s){if(s.resource)return!0;const o=[];for(co Line truncated
+1 -1
View File
@@ -18,7 +18,7 @@
<div style="display: contents">
<script>
{
__sveltekit_1trm5n9 = {
__sveltekit_1y361v9 = {
base: new URL('.', location).pathname.slice(0, -1)
};
-8
View File
@@ -51,7 +51,6 @@
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-storybook": "^10.2.4",
"eslint-plugin-svelte": "^3.0.0",
"fflate": "^0.8.2",
"globals": "^16.0.0",
"http-server": "^14.1.1",
"mdast": "^3.0.0",
@@ -5051,13 +5050,6 @@
}
}
},
"node_modules/fflate": {
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz",
"integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==",
"dev": true,
"license": "MIT"
},
"node_modules/file-entry-cache": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz",
@@ -16,6 +16,7 @@
import { rehypeEnhanceLinks } from '$lib/markdown/enhance-links';
import { rehypeEnhanceCodeBlocks } from '$lib/markdown/enhance-code-blocks';
import { rehypeResolveAttachmentImages } from '$lib/markdown/resolve-attachment-images';
import { rehypeRtlSupport } from '$lib/markdown/rehype-rtl-support';
import { remarkLiteralHtml } from '$lib/markdown/literal-html';
import { copyCodeToClipboard, preprocessLaTeX, getImageErrorFallbackHtml } from '$lib/utils';
import {
@@ -101,6 +102,7 @@
.use(rehypeEnhanceLinks) // Add target="_blank" to links
.use(rehypeEnhanceCodeBlocks) // Wrap code blocks with header and actions
.use(rehypeResolveAttachmentImages, { attachments })
.use(rehypeRtlSupport) // Add bidirectional text support
.use(rehypeStringify, { allowDangerousHtml: true }); // Convert to HTML string
});
@@ -781,19 +783,19 @@
/* Lists */
div :global(ul) {
list-style-type: disc;
margin-left: 1.5rem;
margin-inline-start: 1.5rem;
margin-bottom: 1rem;
}
div :global(ol) {
list-style-type: decimal;
margin-left: 1.5rem;
margin-inline-start: 1.5rem;
margin-bottom: 1rem;
}
div :global(li) {
margin-bottom: 0.25rem;
padding-left: 0.5rem;
padding-inline-start: 0.5rem;
}
div :global(li::marker) {
@@ -816,8 +818,8 @@
/* Task lists */
div :global(.task-list-item) {
list-style: none;
margin-left: 0;
padding-left: 0;
margin-inline-start: 0;
padding-inline-start: 0;
}
div :global(.task-list-item-checkbox) {
@@ -0,0 +1,28 @@
/**
* Rehype plugin to provide comprehensive RTL support by adding dir="auto"
* to all text-containing elements.
*
* This operates directly on the HAST tree, ensuring that all elements
* (including those not in a predefined list) receive the attribute.
*/
import type { Plugin } from 'unified';
import type { Root, Element } from 'hast';
import { visit } from 'unist-util-visit';
/**
* Rehype plugin to add dir="auto" to all elements that have children.
* This provides bidirectional text support for mixed RTL/LTR content.
*/
export const rehypeRtlSupport: Plugin<[], Root> = () => {
return (tree: Root) => {
visit(tree, 'element', (node: Element) => {
if (node.children && node.children.length > 0) {
node.properties = {
...node.properties,
dir: 'auto'
};
}
});
};
};