diff --git a/src/core/transform.ts b/src/core/transform.ts index d76c8bb..71122ec 100644 --- a/src/core/transform.ts +++ b/src/core/transform.ts @@ -846,6 +846,11 @@ export interface TransformInfo { /** Pixel dimensions of the first image. */ firstImageWidth?: number; firstImageHeight?: number; + /** Every rendered PNG for this request, in render order. images[0] === firstImagePng. + * Surfaced separately so the dashboard can pin any image individually. */ + imagePngs?: Uint8Array[]; + /** Matching pixel dimensions for each entry in imagePngs. */ + imageDims?: Array<{ width: number; height: number }>; /** Number of images we added by compressing `` blocks in * the first user message. */ reminderImgs?: number; @@ -2141,6 +2146,8 @@ export async function transformRequest( info.firstImagePng = images[0]!.png; info.firstImageWidth = images[0]!.width; info.firstImageHeight = images[0]!.height; + info.imagePngs = images.map((i) => i.png); + info.imageDims = images.map((i) => ({ width: i.width, height: i.height })); } // 4. Splice images back into the request. diff --git a/src/dashboard-bundle.ts b/src/dashboard-bundle.ts index ed4692f..c8a8dcd 100644 --- a/src/dashboard-bundle.ts +++ b/src/dashboard-bundle.ts @@ -1,64 +1,64 @@ // AUTO-GENERATED by scripts/build-dashboard-ui.mjs — do not edit by hand. // Source: src/dashboard/ (Svelte). Run `pnpm run build:dashboard-ui` to regenerate. -// Size: 82471 chars (80.5 KB). +// Size: 83072 chars (81.1 KB). -export const DASHBOARD_JS = `"use strict";(()=>{var ii=globalThis.process?.env?.NODE_ENV,m=ii&&!ii.toLowerCase().startsWith("prod");var Nt=Array.isArray,si=Array.prototype.indexOf,ct=Array.prototype.includes,mr=Array.from,Kn=Object.keys,_e=Object.defineProperty,We=Object.getOwnPropertyDescriptor,on=Object.getOwnPropertyDescriptors,Xn=Object.prototype,ai=Array.prototype,Jt=Object.getPrototypeOf,Zn=Object.isExtensible;var Oe=()=>{};function li(e){return e()}function vr(e){for(var t=0;t{e=n,t=i});return{promise:r,resolve:e,reject:t}}var we=Symbol("$state"),an=Symbol("legacy props"),fi=Symbol(""),ln=Symbol("proxy path"),fn=Symbol("attributes"),Dr=Symbol("class"),Mr=Symbol("style"),Lr=Symbol("text");var Jn=Symbol("hmr anchor"),Yt=new class extends Error{name="StaleReactionError";message="The reaction that called \`getAbortSignal()\` was re-run or destroyed"},Qn=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");var Qt=3,tt=8;function ci(e){if(m){let t=new Error(\`invariant_violation +export const DASHBOARD_JS = `"use strict";(()=>{var si=globalThis.process?.env?.NODE_ENV,m=si&&!si.toLowerCase().startsWith("prod");var Rt=Array.isArray,ai=Array.prototype.indexOf,pt=Array.prototype.includes,hr=Array.from,Kn=Object.keys,_e=Object.defineProperty,We=Object.getOwnPropertyDescriptor,on=Object.getOwnPropertyDescriptors,Xn=Object.prototype,li=Array.prototype,nr=Object.getPrototypeOf,Zn=Object.isExtensible;var Oe=()=>{};function fi(e){return e()}function gr(e){for(var t=0;t{e=n,t=o});return{promise:r,resolve:e,reject:t}}var we=Symbol("$state"),an=Symbol("legacy props"),ci=Symbol(""),ln=Symbol("proxy path"),fn=Symbol("attributes"),Mr=Symbol("class"),Lr=Symbol("style"),Fr=Symbol("text");var Jn=Symbol("hmr anchor"),Ht=new class extends Error{name="StaleReactionError";message="The reaction that called \`getAbortSignal()\` was re-run or destroyed"},Qn=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");var or=3,nt=8;function ui(e){if(m){let t=new Error(\`invariant_violation An invariant violation occurred, meaning Svelte's internal assumptions were flawed. This is a bug in Svelte, not your app \\u2014 please open an issue at https://github.com/sveltejs/svelte, citing the following message: "\${e}" -https://svelte.dev/e/invariant_violation\`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/invariant_violation")}function di(){if(m){let e=new Error("async_derived_orphan\\nCannot create a \`$derived(...)\` with an \`await\` expression outside of an effect tree\\nhttps://svelte.dev/e/async_derived_orphan");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/async_derived_orphan")}function pi(){if(m){let e=new Error(\`derived_references_self +https://svelte.dev/e/invariant_violation\`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/invariant_violation")}function pi(){if(m){let e=new Error("async_derived_orphan\\nCannot create a \`$derived(...)\` with an \`await\` expression outside of an effect tree\\nhttps://svelte.dev/e/async_derived_orphan");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/async_derived_orphan")}function _i(){if(m){let e=new Error(\`derived_references_self A derived value cannot reference itself recursively https://svelte.dev/e/derived_references_self\`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/derived_references_self")}function eo(e,t,r){if(m){let n=new Error(\`each_key_duplicate \${r?\`Keyed each block has duplicate key \\\`\${r}\\\` at indexes \${e} and \${t}\`:\`Keyed each block has duplicate key at indexes \${e} and \${t}\`} -https://svelte.dev/e/each_key_duplicate\`);throw n.name="Svelte error",n}else throw new Error("https://svelte.dev/e/each_key_duplicate")}function _i(e,t,r){if(m){let n=new Error(\`each_key_volatile +https://svelte.dev/e/each_key_duplicate\`);throw n.name="Svelte error",n}else throw new Error("https://svelte.dev/e/each_key_duplicate")}function mi(e,t,r){if(m){let n=new Error(\`each_key_volatile Keyed each block has key that is not idempotent \\u2014 the key for item at index \${e} was \\\`\${t}\\\` but is now \\\`\${r}\\\`. Keys must be the same each time for a given item -https://svelte.dev/e/each_key_volatile\`);throw n.name="Svelte error",n}else throw new Error("https://svelte.dev/e/each_key_volatile")}function mi(e){if(m){let t=new Error(\`effect_in_teardown +https://svelte.dev/e/each_key_volatile\`);throw n.name="Svelte error",n}else throw new Error("https://svelte.dev/e/each_key_volatile")}function vi(e){if(m){let t=new Error(\`effect_in_teardown \\\`\${e}\\\` cannot be used inside an effect cleanup function -https://svelte.dev/e/effect_in_teardown\`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function vi(){if(m){let e=new Error("effect_in_unowned_derived\\nEffect cannot be created inside a \`$derived\` value that was not itself created inside an effect\\nhttps://svelte.dev/e/effect_in_unowned_derived");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function hi(e){if(m){let t=new Error(\`effect_orphan +https://svelte.dev/e/effect_in_teardown\`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function hi(){if(m){let e=new Error("effect_in_unowned_derived\\nEffect cannot be created inside a \`$derived\` value that was not itself created inside an effect\\nhttps://svelte.dev/e/effect_in_unowned_derived");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function gi(e){if(m){let t=new Error(\`effect_orphan \\\`\${e}\\\` can only be used inside an effect (e.g. during component initialisation) -https://svelte.dev/e/effect_orphan\`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_orphan")}function gi(){if(m){let e=new Error(\`effect_update_depth_exceeded +https://svelte.dev/e/effect_orphan\`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_orphan")}function bi(){if(m){let e=new Error(\`effect_update_depth_exceeded Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state -https://svelte.dev/e/effect_update_depth_exceeded\`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function bi(){if(m){let e=new Error(\`hydration_failed +https://svelte.dev/e/effect_update_depth_exceeded\`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function $i(){if(m){let e=new Error(\`hydration_failed Failed to hydrate the application -https://svelte.dev/e/hydration_failed\`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/hydration_failed")}function $i(e){if(m){let t=new Error(\`rune_outside_svelte +https://svelte.dev/e/hydration_failed\`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/hydration_failed")}function xi(e){if(m){let t=new Error(\`rune_outside_svelte The \\\`\${e}\\\` rune is only available inside \\\`.svelte\\\` and \\\`.svelte.js/ts\\\` files -https://svelte.dev/e/rune_outside_svelte\`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function xi(){if(m){let e=new Error("state_descriptors_fixed\\nProperty descriptors defined on \`$state\` objects must contain \`value\` and always be \`enumerable\`, \`configurable\` and \`writable\`.\\nhttps://svelte.dev/e/state_descriptors_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function yi(){if(m){let e=new Error("state_prototype_fixed\\nCannot set prototype of \`$state\` object\\nhttps://svelte.dev/e/state_prototype_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function wi(){if(m){let e=new Error("state_unsafe_mutation\\nUpdating state inside \`$derived(...)\`, \`$inspect(...)\` or a template expression is forbidden. If the value should not be reactive, declare it without \`$state\`\\nhttps://svelte.dev/e/state_unsafe_mutation");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Ei(){if(m){let e=new Error("svelte_boundary_reset_onerror\\nA \`\` \`reset\` function cannot be called while an error is still being handled\\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var Rt={};var J=Symbol(),rt=Symbol("filename");var cn="http://www.w3.org/1999/xhtml";var Ct="font-weight: bold",Ot="font-weight: normal";function Ti(e){m?console.warn(\`%c[svelte] await_reactivity_loss +https://svelte.dev/e/rune_outside_svelte\`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function yi(){if(m){let e=new Error("state_descriptors_fixed\\nProperty descriptors defined on \`$state\` objects must contain \`value\` and always be \`enumerable\`, \`configurable\` and \`writable\`.\\nhttps://svelte.dev/e/state_descriptors_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function wi(){if(m){let e=new Error("state_prototype_fixed\\nCannot set prototype of \`$state\` object\\nhttps://svelte.dev/e/state_prototype_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Ei(){if(m){let e=new Error("state_unsafe_mutation\\nUpdating state inside \`$derived(...)\`, \`$inspect(...)\` or a template expression is forbidden. If the value should not be reactive, declare it without \`$state\`\\nhttps://svelte.dev/e/state_unsafe_mutation");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Ti(){if(m){let e=new Error("svelte_boundary_reset_onerror\\nA \`\` \`reset\` function cannot be called while an error is still being handled\\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var Ct={};var J=Symbol(),ot=Symbol("filename");var cn="http://www.w3.org/1999/xhtml";var It="font-weight: bold",Ot="font-weight: normal";function ki(e){m?console.warn(\`%c[svelte] await_reactivity_loss %cDetected reactivity loss when reading \\\`\${e}\\\`. This happens when state is read in an async function after an earlier \\\`await\\\` -https://svelte.dev/e/await_reactivity_loss\`,Ct,Ot):console.warn("https://svelte.dev/e/await_reactivity_loss")}function ki(e,t){m?console.warn(\`%c[svelte] await_waterfall +https://svelte.dev/e/await_reactivity_loss\`,It,Ot):console.warn("https://svelte.dev/e/await_reactivity_loss")}function Si(e,t){m?console.warn(\`%c[svelte] await_waterfall %cAn async derived, \\\`\${e}\\\` (\${t}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app -https://svelte.dev/e/await_waterfall\`,Ct,Ot):console.warn("https://svelte.dev/e/await_waterfall")}function Si(){m?console.warn(\`%c[svelte] derived_inert +https://svelte.dev/e/await_waterfall\`,It,Ot):console.warn("https://svelte.dev/e/await_waterfall")}function Ai(){m?console.warn(\`%c[svelte] derived_inert %cReading a derived belonging to a now-destroyed effect may result in stale values -https://svelte.dev/e/derived_inert\`,Ct,Ot):console.warn("https://svelte.dev/e/derived_inert")}function Ai(e,t,r){m?console.warn(\`%c[svelte] hydration_attribute_changed +https://svelte.dev/e/derived_inert\`,It,Ot):console.warn("https://svelte.dev/e/derived_inert")}function Ni(e,t,r){m?console.warn(\`%c[svelte] hydration_attribute_changed %cThe \\\`\${e}\\\` attribute on \\\`\${t}\\\` changed its value between server and client renders. The client value, \\\`\${r}\\\`, will be ignored in favour of the server value -https://svelte.dev/e/hydration_attribute_changed\`,Ct,Ot):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function er(e){m?console.warn(\`%c[svelte] hydration_mismatch +https://svelte.dev/e/hydration_attribute_changed\`,It,Ot):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function ir(e){m?console.warn(\`%c[svelte] hydration_mismatch %c\${e?\`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near \${e}\`:"Hydration failed because the initial UI does not match what was rendered on the server"} -https://svelte.dev/e/hydration_mismatch\`,Ct,Ot):console.warn("https://svelte.dev/e/hydration_mismatch")}function Ni(){m?console.warn(\`%c[svelte] lifecycle_double_unmount +https://svelte.dev/e/hydration_mismatch\`,It,Ot):console.warn("https://svelte.dev/e/hydration_mismatch")}function Ri(){m?console.warn(\`%c[svelte] lifecycle_double_unmount %cTried to unmount a component that was not mounted -https://svelte.dev/e/lifecycle_double_unmount\`,Ct,Ot):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function un(e){m?console.warn(\`%c[svelte] state_proxy_equality_mismatch +https://svelte.dev/e/lifecycle_double_unmount\`,It,Ot):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function un(e){m?console.warn(\`%c[svelte] state_proxy_equality_mismatch %cReactive \\\`$state(...)\\\` proxies and the values they proxy have different identities. Because of this, comparisons with \\\`\${e}\\\` will produce unexpected results -https://svelte.dev/e/state_proxy_equality_mismatch\`,Ct,Ot):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function Ri(){m?console.warn(\`%c[svelte] state_proxy_unmount +https://svelte.dev/e/state_proxy_equality_mismatch\`,It,Ot):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function Ci(){m?console.warn(\`%c[svelte] state_proxy_unmount %cTried to unmount a state proxy, rather than a component -https://svelte.dev/e/state_proxy_unmount\`,Ct,Ot):console.warn("https://svelte.dev/e/state_proxy_unmount")}function Ci(){m?console.warn("%c[svelte] svelte_boundary_reset_noop\\n%cA \`\` \`reset\` function only resets the boundary the first time it is called\\nhttps://svelte.dev/e/svelte_boundary_reset_noop",Ct,Ot):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var T=!1;function ae(e){T=e}var I;function G(e){if(e===null)throw er(),Rt;return I=e}function Ie(){return G(ke(I))}function g(e){if(T){if(ke(I)!==null)throw er(),Rt;I=e}}function Pr(e=1){if(T){for(var t=e,r=I;t--;)r=ke(r);I=r}}function bt(e=!0){for(var t=0,r=I;;){if(r.nodeType===tt){var n=r.data;if(n==="]"){if(t===0)return r;t-=1}else(n==="["||n==="[!"||n[0]==="["&&!isNaN(Number(n.slice(1))))&&(t+=1)}var i=ke(r);e&&r.remove(),r=i}}function Br(e){if(!e||e.nodeType!==tt)throw er(),Rt;return e.data}function dn(e){return e===this.v}function pn(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function _n(e){return!pn(e,this.v)}var me=!1,Ht=!1,ut=!1;function Oi(){Ht=!0}var qr=null;function De(e,t){return e.label=t,vn(e.v,t),e}function vn(e,t){return e?.[ln]?.(t),e}function dt(e){let t=new Error,r=va();return r.length===0?null:(r.unshift(\` +https://svelte.dev/e/state_proxy_unmount\`,It,Ot):console.warn("https://svelte.dev/e/state_proxy_unmount")}function Ii(){m?console.warn("%c[svelte] svelte_boundary_reset_noop\\n%cA \`\` \`reset\` function only resets the boundary the first time it is called\\nhttps://svelte.dev/e/svelte_boundary_reset_noop",It,Ot):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var k=!1;function ae(e){k=e}var I;function U(e){if(e===null)throw ir(),Ct;return I=e}function De(){return U(ke(I))}function g(e){if(k){if(ke(I)!==null)throw ir(),Ct;I=e}}function qr(e=1){if(k){for(var t=e,r=I;t--;)r=ke(r);I=r}}function yt(e=!0){for(var t=0,r=I;;){if(r.nodeType===nt){var n=r.data;if(n==="]"){if(t===0)return r;t-=1}else(n==="["||n==="[!"||n[0]==="["&&!isNaN(Number(n.slice(1))))&&(t+=1)}var o=ke(r);e&&r.remove(),r=o}}function Br(e){if(!e||e.nodeType!==nt)throw ir(),Ct;return e.data}function dn(e){return e===this.v}function pn(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function _n(e){return!pn(e,this.v)}var me=!1,Vt=!1,_t=!1;function Oi(){Vt=!0}var zr=null;function Me(e,t){return e.label=t,vn(e.v,t),e}function vn(e,t){return e?.[ln]?.(t),e}function mt(e){let t=new Error,r=ha();return r.length===0?null:(r.unshift(\` \`),_e(t,"stack",{value:r.join(\` -\`)}),_e(t,"name",{value:e}),t)}function va(){let e=Error.stackTraceLimit;Error.stackTraceLimit=1/0;let t=new Error().stack;if(Error.stackTraceLimit=e,!t)return[];let r=t.split(\` -\`),n=[];for(let i=0;i{t===tr&&Li()})}tr.push(e)}function Fi(){for(;tr.length>0;)Li()}var ro=new WeakMap;function gn(e){var t=E;if(t===null)return R.f|=8388608,e;if(m&&e instanceof Error&&!ro.has(e)&&ro.set(e,ha(e,t)),(t.f&32768)===0&&(t.f&4)===0)throw m&&!t.parent&&e instanceof Error&&Pi(e),e;ot(e,t)}function ot(e,t){for(;t!==null;){if((t.f&128)!==0){if((t.f&32768)===0)throw e;try{t.b.error(e);return}catch(r){e=r}}t=t.parent}throw m&&e instanceof Error&&Pi(e),e}function ha(e,t){let r=We(e,"message");if(!(r&&!r.configurable)){for(var n=Yr?" ":" ",i=\` -\${n}in \${t.fn?.name||""}\`,o=t.ctx;o!==null;)i+=\` -\${n}in \${o.function?.[rt].split("/").pop()}\`,o=o.p;return{message:e.message+\` -\${i} +\`)}),_e(t,"name",{value:e}),t)}function ha(){let e=Error.stackTraceLimit;Error.stackTraceLimit=1/0;let t=new Error().stack;if(Error.stackTraceLimit=e,!t)return[];let r=t.split(\` +\`),n=[];for(let o=0;o{t===sr&&Fi()})}sr.push(e)}function Pi(){for(;sr.length>0;)Fi()}var ro=new WeakMap;function gn(e){var t=E;if(t===null)return N.f|=8388608,e;if(m&&e instanceof Error&&!ro.has(e)&&ro.set(e,ga(e,t)),(t.f&32768)===0&&(t.f&4)===0)throw m&&!t.parent&&e instanceof Error&&qi(e),e;st(e,t)}function st(e,t){for(;t!==null;){if((t.f&128)!==0){if((t.f&32768)===0)throw e;try{t.b.error(e);return}catch(r){e=r}}t=t.parent}throw m&&e instanceof Error&&qi(e),e}function ga(e,t){let r=We(e,"message");if(!(r&&!r.configurable)){for(var n=Hr?" ":" ",o=\` +\${n}in \${t.fn?.name||""}\`,i=t.ctx;i!==null;)o+=\` +\${n}in \${i.function?.[ot].split("/").pop()}\`,i=i.p;return{message:e.message+\` +\${o} \`,stack:e.stack?.split(\` \`).filter(s=>!s.includes("svelte/src/internal")).join(\` -\`)}}}function Pi(e){let t=ro.get(e);t&&(_e(e,"message",{value:t.message}),_e(e,"stack",{value:t.stack}))}var ga=-7169;function U(e,t){e.f=e.f&ga|t}function $r(e){(e.f&512)!==0||e.deps===null?U(e,1024):U(e,4096)}function Bi(e){if(e!==null)for(let t of e)(t.f&2)===0||(t.f&65536)===0||(t.f^=65536,Bi(t.deps))}function bn(e,t,r){(e.f&2048)!==0?t.add(e):(e.f&4096)!==0&&r.add(e),Bi(e.deps),U(e,1024)}function $n(e,t,r){if(e==null)return t(void 0),r&&r(void 0),Oe;let n=$(()=>e.subscribe(t,r));return n.unsubscribe?()=>n.unsubscribe():n}var xr=[];function no(e,t){return{subscribe:yr(e,t).subscribe}}function yr(e,t=Oe){let r=null,n=new Set;function i(a){if(pn(e,a)&&(e=a,r)){let f=!xr.length;for(let c of n)c[1](),xr.push(c,e);if(f){for(let c=0;c{n.delete(c),n.size===0&&r&&(r(),r=null)}}return{set:i,update:o,subscribe:s}}function xn(e){let t;return $n(e,r=>t=r)(),t}var qi=!1;var oo=Symbol();function he(e,t,r){let n=r[t]??={store:null,source:D(void 0),unsubscribe:Oe};if(m&&(n.source.label=t),n.store!==e&&!(oo in r))if(n.unsubscribe(),n.store=e??null,e==null)n.source.v=void 0,n.unsubscribe=Oe;else{var i=!0;n.unsubscribe=$n(e,o=>{i?n.source.v=o:S(n.source,o)}),i=!1}return e&&oo in r?xn(e):l(n.source)}function Ae(){let e={};function t(){ge(()=>{for(var r in e)e[r].unsubscribe();_e(e,oo,{enumerable:!1,value:!0})})}return[e,t]}var yn=null,Er=null,C=null,Tr=null,be=null,ao=null,rr=!1,io=!1,nr=null,Hr=null,zi=0,so=new Set,$a=1,Xe=class e{id=$a++;#e=!1;linked=!0;#t=null;#r=null;async_deriveds=new Map;current=new Map;previous=new Map;unblocked=new Set;#l=new Set;#n=new Set;#i=new Set;#o=0;#s=new Map;#d=null;#a=[];#_=[];#p=new Set;#c=new Set;#u=new Map;#f=new Set;is_fork=!1;#h=!1;#x(){if(this.is_fork)return!0;for(let n of this.#s.keys()){for(var t=n,r=!1;t.parent!==null;){if(this.#u.has(t)){r=!0;break}t=t.parent}if(!r)return!0}return!1}skip_effect(t){this.#u.has(t)||this.#u.set(t,{d:[],m:[]}),this.#f.delete(t)}unskip_effect(t,r=n=>this.schedule(n)){var n=this.#u.get(t);if(n){this.#u.delete(t);for(var i of n.d)U(i,2048),r(i);for(i of n.m)U(i,4096),r(i)}this.#f.add(t)}#v(){if(this.#e=!0,zi++>1e3&&(this.#$(),xa()),m)for(let f of this.current.keys())so.add(f);if(!this.#x()){for(let f of this.#p)this.#c.delete(f),U(f,2048),this.schedule(f);for(let f of this.#c)U(f,4096),this.schedule(f)}let t=this.#a;this.#a=[],this.apply();var r=nr=[],n=[],i=Hr=[];for(let f of t)try{this.#y(f,r,n)}catch(c){throw Ui(f),c}if(C=null,i.length>0){var o=e.ensure();for(let f of i)o.schedule(f)}if(nr=null,Hr=null,this.#x()){this.#m(n),this.#m(r);for(let[f,c]of this.#u)Vi(f,c);i.length>0&&C.#v();return}let s=this.#w();if(s){s.#g(this);return}this.#p.clear(),this.#c.clear();for(let f of this.#l)f(this);this.#l.clear(),Tr=this,Yi(n),Yi(r),Tr=null,this.#d?.resolve();var a=C;if(this.linked&&this.#o===0&&this.#$(),me&&!this.linked&&(this.#E(),C=a),this.#a.length>0){a===null&&(a=this,this.#b());let f=a;f.#a.push(...this.#a.filter(c=>!f.#a.includes(c)))}a!==null&&a.#v()}#y(t,r,n){t.f^=1024;for(var i=t.first;i!==null;){var o=i.f,s=(o&96)!==0,a=s&&(o&1024)!==0,f=a||(o&8192)!==0||this.#u.has(i);if(!f&&i.fn!==null){s?i.f^=1024:(o&4)!==0?r.push(i):me&&(o&16777224)!==0?n.push(i):Ft(i)&&((o&16)!==0&&this.#c.add(i),mt(i));var c=i.first;if(c!==null){i=c;continue}}for(;i!==null;){var p=i.next;if(p!==null){i=p;break}i=i.parent}}}#w(){for(var t=this.#t;t!==null;){if(!t.is_fork){for(let[r,[,n]]of this.current)if(t.current.has(r)&&!n)return t}t=t.#t}return null}#g(t){for(let[n,i]of t.current)!this.previous.has(n)&&t.previous.has(n)&&this.previous.set(n,t.previous.get(n)),this.current.set(n,i);for(let[n,i]of t.async_deriveds){let o=this.async_deriveds.get(n);o&&i.promise.then(o.resolve)}let r=n=>{var i=n.reactions;if(i!==null)for(let a of i){var o=a.f;if((o&2)!==0)r(a);else{var s=a;o&4194320&&!this.async_deriveds.has(s)&&(this.#c.delete(s),U(s,2048),this.schedule(s))}}};for(let n of this.current.keys())r(n);this.oncommit(()=>t.discard()),t.#$(),C=this,this.#v()}#m(t){for(var r=0;r!this.current.has(d));if(i.length===0)t&&p.discard();else if(r.length>0){if(m&&Di(p.#a.length===0,"Batch has scheduled roots"),t)for(let d of this.#f)p.unskip_effect(d,u=>{(u.f&4194320)!==0?p.schedule(u):p.#m([u])});p.activate();var o=new Set,s=new Map;for(var a of r)Hi(a,i,o,s);s=new Map;var f=[...p.current.keys()].filter(d=>this.current.has(d)?this.current.get(d)[0]!==d.v:!0);if(f.length>0)for(let d of this.#_)(d.f&155648)===0&&lo(d,f,s)&&((d.f&4194320)!==0?(U(d,2048),p.schedule(d)):p.#p.add(d));if(p.#a.length>0){p.apply();for(var c of p.#a)p.#y(c,[],[]);p.#a=[]}p.deactivate()}}}}increment(t,r){if(this.#o+=1,t){let n=this.#s.get(r)??0;this.#s.set(r,n+1)}}decrement(t,r){if(this.#o-=1,t){let n=this.#s.get(r)??0;n===1?this.#s.delete(r):this.#s.set(r,n-1)}this.#h||(this.#h=!0,ve(()=>{this.#h=!1,this.linked&&this.flush()}))}transfer_effects(t,r){for(let n of t)this.#p.add(n);for(let n of r)this.#c.add(n);t.clear(),r.clear()}oncommit(t){this.#l.add(t)}ondiscard(t){this.#n.add(t)}on_fork_commit(t){this.#i.add(t)}run_fork_commit_callbacks(){for(let t of this.#i)t(this);this.#i.clear()}settled(){return(this.#d??=sn()).promise}static ensure(){if(C===null){let t=C=new e;t.#b(),!io&&!rr&&ve(()=>{t.#e||t.flush()})}return C}apply(){if(!me||!this.is_fork&&this.#t===null&&this.#r===null){be=null;return}be=new Map;for(let[r,[n]]of this.current)be.set(r,n);for(let r=yn;r!==null;r=r.#r)if(!(r===this||r.is_fork)){var t=!1;if(r.id0)){Lt.clear();for(let i of st){if((i.f&24576)!==0)continue;let o=[i],s=i.parent;for(;s!==null;)st.has(s)&&(st.delete(s),o.push(s)),s=s.parent;for(let a=o.length-1;a>=0;a--){let f=o[a];(f.f&24576)===0&&mt(f)}}st.clear()}}st=null}}function Hi(e,t,r,n){if(!r.has(e)&&(r.add(e),e.reactions!==null))for(let i of e.reactions){let o=i.f;(o&2)!==0?Hi(i,t,r,n):(o&4194320)!==0&&(o&2048)===0&&lo(i,t,n)&&(U(i,2048),Vr(i))}}function lo(e,t,r){let n=r.get(e);if(n!==void 0)return n;if(e.deps!==null)for(let i of e.deps){if(ct.call(t,i))return!0;if((i.f&2)!==0&&lo(i,t,r))return r.set(i,!0),!0}return r.set(e,!1),!1}function Vr(e){C.schedule(e)}function Vi(e,t){if(!((e.f&32)!==0&&(e.f&1024)!==0)){(e.f&2048)!==0?t.d.push(e):(e.f&4096)!==0&&t.m.push(e),U(e,1024);for(var r=e.first;r!==null;)Vi(r,t),r=r.next}}function Ui(e){U(e,1024);for(var t=e.first;t!==null;)Ui(t),t=t.next}function co(e){let t=0,r=Pe(0),n;return m&&De(r,"createSubscriber version"),()=>{It()&&(l(r),$e(()=>(t===0&&(n=$(()=>e(()=>ir(r)))),t+=1,()=>{ve(()=>{t-=1,t===0&&(n?.(),n=void 0,ir(r))})})))}}var wa=589824;function po(e,t,r,n){new uo(e,t,r,n)}var uo=class{parent;is_pending=!1;transform_error;#e;#t=T?I:null;#r;#l;#n;#i=null;#o=null;#s=null;#d=null;#a=0;#_=0;#p=!1;#c=new Set;#u=new Set;#f=null;#h=co(()=>(this.#f=Pe(this.#a),m&&De(this.#f,"$effect.pending()"),()=>{this.#f=null}));constructor(t,r,n,i){this.#e=t,this.#r=r,this.#l=o=>{var s=E;s.b=this,s.f|=128,n(o)},this.parent=E.b,this.transform_error=i??this.parent?.transform_error??(o=>o),this.#n=Je(()=>{if(T){let o=this.#t;Ie();let s=o.data==="[!";if(o.data.startsWith("[?")){let f=JSON.parse(o.data.slice("[?".length));this.#v(f)}else s?this.#y():this.#x()}else this.#w()},wa),T&&(this.#e=I)}#x(){try{this.#i=pe(()=>this.#l(this.#e))}catch(t){this.error(t)}}#v(t){let r=this.#r.failed;r&&(this.#s=pe(()=>{r(this.#e,()=>t,()=>()=>{})}))}#y(){let t=this.#r.pending;t&&(this.is_pending=!0,this.#o=pe(()=>t(this.#e)),ve(()=>{var r=this.#d=document.createDocumentFragment(),n=ie();r.append(n),this.#i=this.#m(()=>pe(()=>this.#l(n))),this.#_===0&&(this.#e.before(r),this.#d=null,yt(this.#o,()=>{this.#o=null}),this.#g(C))}))}#w(){try{if(this.is_pending=this.has_pending_snippet(),this.#_=0,this.#a=0,this.#i=pe(()=>{this.#l(this.#e)}),this.#_>0){var t=this.#d=document.createDocumentFragment();Ar(this.#i,t);let r=this.#r.pending;this.#o=pe(()=>r(this.#e))}else this.#g(C)}catch(r){this.error(r)}}#g(t){this.is_pending=!1,t.transfer_effects(this.#c,this.#u)}defer_effect(t){bn(t,this.#c,this.#u)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#r.pending}#m(t){var r=E,n=R,i=q;oe(this.#n),se(this.#n),Dt(this.#n.ctx);try{return Xe.ensure(),t()}catch(o){return gn(o),null}finally{oe(r),se(n),Dt(i)}}#E(t,r){if(!this.has_pending_snippet()){this.parent&&this.parent.#E(t,r);return}this.#_+=t,this.#_===0&&(this.#g(r),this.#o&&yt(this.#o,()=>{this.#o=null}),this.#d&&(this.#e.before(this.#d),this.#d=null))}update_pending_count(t,r){this.#E(t,r),this.#a+=t,!(!this.#f||this.#p)&&(this.#p=!0,ve(()=>{this.#p=!1,this.#f&&vt(this.#f,this.#a)}))}get_effect_pending(){return this.#h(),l(this.#f)}error(t){if(!this.#r.onerror&&!this.#r.failed)throw t;C?.is_fork?(this.#i&&C.skip_effect(this.#i),this.#o&&C.skip_effect(this.#o),this.#s&&C.skip_effect(this.#s),C.on_fork_commit(()=>{this.#b(t)})):this.#b(t)}#b(t){this.#i&&(ne(this.#i),this.#i=null),this.#o&&(ne(this.#o),this.#o=null),this.#s&&(ne(this.#s),this.#s=null),T&&(G(this.#t),Pr(),G(bt()));var r=this.#r.onerror;let n=this.#r.failed;var i=!1,o=!1;let s=()=>{if(i){Ci();return}i=!0,o&&Ei(),this.#s!==null&&yt(this.#s,()=>{this.#s=null}),this.#m(()=>{this.#w()})},a=f=>{try{o=!0,r?.(f,s),o=!1}catch(c){ot(c,this.#n&&this.#n.parent)}n&&(this.#s=this.#m(()=>{try{return pe(()=>{var c=E;c.b=this,c.f|=128,n(this.#e,()=>f,()=>s)})}catch(c){return ot(c,this.#n.parent),null}}))};ve(()=>{var f;try{f=this.transform_error(t)}catch(c){ot(c,this.#n&&this.#n.parent);return}f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(a,c=>ot(c,this.#n&&this.#n.parent)):a(f)})}};function kn(e,t,r,n){let i=xt()?sr:Rr;var o=e.filter(u=>!u.settled);if(r.length===0&&o.length===0){n(t.map(i));return}var s=E,a=Wi(),f=o.length===1?o[0].promise:o.length>1?Promise.all(o.map(u=>u.promise)):null;function c(u){if((s.f&16384)===0){a();try{n(u)}catch(_){ot(_,s)}Nr()}}var p=_o();if(r.length===0){f.then(()=>c(t.map(i))).finally(p);return}function d(){Promise.all(r.map(u=>vo(u))).then(u=>c([...t.map(i),...u])).catch(u=>ot(u,s)).finally(p)}f?f.then(()=>{a(),d(),Nr()}):d()}function Wi(){var e=E,t=R,r=q,n=C;if(m)var i=$t;return function(s=!0){oe(e),se(t),Dt(r),s&&(e.f&16384)===0&&(n?.activate(),n?.apply()),m&&(mo(null),br(i))}}function Nr(e=!0){oe(null),se(null),Dt(null),e&&C?.deactivate(),m&&(mo(null),br(null))}function _o(){var e=E,t=e.b,r=C,n=t.is_rendered();return t.update_pending_count(1,r),r.increment(n,e),()=>{t.update_pending_count(-1,r),r.decrement(n,e)}}var je=null;function mo(e){je=e}var Ur=new Set;function sr(e){var t=2050;E!==null&&(E.f|=524288);let r={ctx:q,deps:null,effects:null,equals:dn,f:t,fn:e,reactions:null,rv:0,v:J,wv:0,parent:E,ac:null};return m&&ut&&(r.created=dt("created at")),r}var Sn=Symbol("obsolete");function vo(e,t,r){let n=E;n===null&&di();var i=void 0,o=Pe(J);m&&(o.label=t??e.toString());var s=!R,a=new Set;return Zi(()=>{var f=E;m&&(je={effect:f,effect_deps:new Set,warned:!1});var c=sn();i=c.promise;try{Promise.resolve(e()).then(c.resolve,_=>{_!==Yt&&c.reject(_)}).finally(Nr)}catch(_){c.reject(_),Nr()}if(m){if(je){if(f.deps!==null)for(let _=0;_{m&&(je=null),d?.(),a.delete(c),v!==Sn&&(p.activate(),v?(o.f|=8388608,vt(o,v)):((o.f&8388608)!==0&&(o.f^=8388608),vt(o,_),m&&r!==void 0&&(Ur.add(o),setTimeout(()=>{Ur.has(o)&&(f.f&16384)===0&&(ki(o.label,r),Ur.delete(o))}))),p.deactivate())};c.promise.then(u,_=>u(null,_||"unknown"))}),ge(()=>{for(let f of a)f.reject(Sn)}),m&&(o.f|=4194304),new Promise(f=>{function c(p){function d(){p===i?f(o):c(i)}p.then(d,d)}c(i)})}function go(e){let t=sr(e);return me||Nn(t),t}function Rr(e){let t=sr(e);return t.equals=_n,t}function Ki(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r5){let o=dt("updated at");if(o!==null){let s=e.updated.get(o.stack);s||(s={error:o,count:0},e.updated.set(o.stack,s)),s.count++}}}E!==null&&(e.set_during_effect=!0)}if((e.f&2)!==0){let i=e;(e.f&2048)!==0&&jr(i),be===null&&$r(i)}e.wv=Sr(),Qi(e,2048,r),xt()&&E!==null&&(E.f&1024)!==0&&(E.f&96)===0&&(et===null?es([e]):et.push(e)),!n.is_fork&&ar.size>0&&!xo&&Tn()}return t}function Tn(){xo=!1;for(let e of ar){(e.f&1024)!==0&&U(e,4096);let t;try{t=Ft(e)}catch{t=!0}t&&mt(e)}ar.clear()}function ir(e){S(e,e.v+1)}function Qi(e,t,r){var n=e.reactions;if(n!==null)for(var i=xt(),o=n.length,s=0;s{if(jt===s)return d();var u=R,_=jt;se(null),yo(s);var v=d();return se(u),yo(_),v};n&&(r.set("length",wt(e.length,o)),m&&(e=Sa(e)));var f="";let c=!1;function p(d){if(!c){c=!0,f=d,De(i,\`\${f} version\`);for(let[u,_]of r)De(_,fr(f,u));c=!1}}return new Proxy(e,{defineProperty(d,u,_){(!("value"in _)||_.configurable===!1||_.enumerable===!1||_.writable===!1)&&xi();var v=r.get(u);return v===void 0?a(()=>{var x=wt(_.value,o);return r.set(u,x),m&&typeof u=="string"&&De(x,fr(f,u)),x}):S(v,_.value,!0),!0},deleteProperty(d,u){var _=r.get(u);if(_===void 0){if(u in d){let v=a(()=>wt(J,o));r.set(u,v),ir(i),m&&De(v,fr(f,u))}}else S(_,J),ir(i);return!0},get(d,u,_){if(u===we)return e;if(m&&u===ln)return p;var v=r.get(u),x=u in d;if(v===void 0&&(!x||We(d,u)?.writable)&&(v=a(()=>{var A=Ut(x?d[u]:J),B=wt(A,o);return m&&De(B,fr(f,u)),B}),r.set(u,v)),v!==void 0){var h=l(v);return h===J?void 0:h}return Reflect.get(d,u,_)},getOwnPropertyDescriptor(d,u){var _=Reflect.getOwnPropertyDescriptor(d,u);if(_&&"value"in _){var v=r.get(u);v&&(_.value=l(v))}else if(_===void 0){var x=r.get(u),h=x?.v;if(x!==void 0&&h!==J)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return _},has(d,u){if(u===we)return!0;var _=r.get(u),v=_!==void 0&&_.v!==J||Reflect.has(d,u);if(_!==void 0||E!==null&&(!v||We(d,u)?.writable)){_===void 0&&(_=a(()=>{var h=v?Ut(d[u]):J,A=wt(h,o);return m&&De(A,fr(f,u)),A}),r.set(u,_));var x=l(_);if(x===J)return!1}return v},set(d,u,_,v){var x=r.get(u),h=u in d;if(n&&u==="length")for(var A=_;Awt(J,o)),r.set(A+"",B),m&&De(B,fr(f,A)))}if(x===void 0)(!h||We(d,u)?.writable)&&(x=a(()=>wt(void 0,o)),m&&De(x,fr(f,u)),S(x,Ut(_)),r.set(u,x));else{h=x.v!==J;var L=a(()=>Ut(_));S(x,L)}var j=Reflect.getOwnPropertyDescriptor(d,u);if(j?.set&&j.set.call(v,_),!h){if(n&&typeof u=="string"){var k=r.get("length"),y=Number(u);Number.isInteger(y)&&y>=k.v&&S(k,y+1)}ir(i)}return!0},ownKeys(d){l(i);var u=Reflect.ownKeys(d).filter(x=>{var h=r.get(x);return h===void 0||h.v!==J});for(var[_,v]of r)v.v!==J&&!(_ in d)&&u.push(_);return u},setPrototypeOf(){yi()}})}function fr(e,t){return typeof t=="symbol"?\`\${e}[Symbol(\${t.description??""})]\`:Ta.test(t)?\`\${e}.\${t}\`:/^\\d+$/.test(t)?\`\${e}[\${t}]\`:\`\${e}['\${t}']\`}function Rn(e){try{if(e!==null&&typeof e=="object"&&we in e)return e[we]}catch{}return e}var ka=new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function Sa(e){return new Proxy(e,{get(t,r,n){var i=Reflect.get(t,r,n);return ka.has(r)?function(...o){Ji();var s=i.apply(this,o);return Tn(),s}:i}})}function ts(){let e=Array.prototype,t=Array.__svelte_cleanup;t&&t();let{indexOf:r,lastIndexOf:n,includes:i}=e;e.indexOf=function(o,s){let a=r.call(this,o,s);if(a===-1){for(let f=s??0;f{e.indexOf=r,e.lastIndexOf=n,e.includes=i}}var wo,rs,Yr,ns,os;function Cn(){if(wo===void 0){wo=window,rs=document,Yr=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;ns=We(t,"firstChild").get,os=We(t,"nextSibling").get,Zn(e)&&(e[Dr]=void 0,e[fn]=null,e[Mr]=void 0,e.__e=void 0),Zn(r)&&(r[Lr]=void 0),m&&(e.__svelte_meta=null,ts())}}function ie(e=""){return document.createTextNode(e)}function Be(e){return ns.call(e)}function ke(e){return os.call(e)}function b(e,t){if(!T)return Be(e);var r=Be(I);if(r===null)r=I.appendChild(ie());else if(t&&r.nodeType!==Qt){var n=ie();return r?.before(n),G(n),n}return t&&Kr(r),G(r),r}function qe(e,t=!1){if(!T){var r=Be(e);return r instanceof Comment&&r.data===""?ke(r):r}if(t){if(I?.nodeType!==Qt){var n=ie();return I?.before(n),G(n),n}Kr(I)}return I}function w(e,t=1,r=!1){let n=T?I:e;for(var i;t--;)i=n,n=ke(n);if(!T)return n;if(r){if(n?.nodeType!==Qt){var o=ie();return n===null?i?.after(o):n.before(o),G(o),o}Kr(n)}return G(n),n}function Wr(e){e.textContent=""}function On(){if(!me||st!==null)return!1;var e=E.f;return(e&32768)!==0}function Et(e,t,r){let n=r?{is:r}:void 0;return document.createElementNS(t??cn,e,n)}function Kr(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===Qt;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Gt(e){var t=R,r=E;se(null),oe(null);try{return e()}finally{se(t),oe(r)}}function To(e){E===null&&(R===null&&hi(e),vi()),at&&mi(e)}function Na(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function ht(e,t){var r=E;if(m)for(;r!==null&&(r.f&131072)!==0;)r=r.parent;r!==null&&(r.f&8192)!==0&&(e|=8192);var n={ctx:q,deps:null,nodes:null,f:e|2048|512,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};m&&(n.component_function=pt),C?.register_created_effect(n);var i=n;if((e&4)!==0)nr!==null?nr.push(n):Xe.ensure().schedule(n);else if(t!==null){try{mt(n)}catch(s){throw ne(n),s}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&524288)===0&&(i=i.first,(e&16)!==0&&(e&65536)!==0&&i!==null&&(i.f|=65536))}if(i!==null&&(i.parent=r,r!==null&&Na(i,r),R!==null&&(R.f&2)!==0&&(e&64)===0)){var o=R;(o.effects??=[]).push(i)}return n}function It(){return R!==null&&!He}function ge(e){let t=ht(8,null);return U(t,1024),t.teardown=e,t}function Xr(e){To("$effect"),m&&_e(e,"name",{value:"$effect"});var t=E.f,r=!R&&(t&32)!==0&&(t&32768)===0;if(r){var n=q;(n.e??=[]).push(e)}else return to(e)}function to(e){return ht(1048580,e)}function Zr(e){return To("$effect.pre"),m&&_e(e,"name",{value:"$effect.pre"}),ht(1048584,e)}function In(e){Xe.ensure();let t=ht(524352,e);return()=>{ne(t)}}function ls(e){Xe.ensure();let t=ht(524352,e);return(r={})=>new Promise(n=>{r.outro?yt(t,()=>{ne(t),n(void 0)}):(ne(t),n(void 0))})}function lt(e){return ht(4,e)}function P(e,t){var r=q,n={effect:null,ran:!1,deps:e};r.l.$.push(n),n.effect=$e(()=>{if(e(),!n.ran){n.ran=!0;var i=E;try{oe(i.parent),$(t)}finally{oe(i)}}})}function Ve(){var e=q;$e(()=>{for(var t of e.l.$){t.deps();var r=t.effect;(r.f&1024)!==0&&r.deps!==null&&U(r,4096),Ft(r)&&mt(r),t.ran=!1}})}function Zi(e){return ht(4718592,e)}function $e(e,t=0){return ht(8|t,e)}function K(e,t=[],r=[],n=[]){kn(n,t,r,i=>{ht(8,()=>e(...i.map(l)))})}function Je(e,t=0){var r=ht(16|t,e);return m&&(r.dev_stack=$t),r}function pe(e){return ht(524320,e)}function ko(e){var t=e.teardown;if(t!==null){let r=at,n=R;Eo(!0),se(null);try{t.call(null)}finally{Eo(r),se(n)}}}function Gr(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){let i=r.ac;i!==null&&Gt(()=>{i.abort(Yt)});var n=r.next;(r.f&64)!==0?r.parent=null:ne(r,t),r=n}}function fs(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&32)===0&&ne(t),t=r}}function ne(e,t=!0){var r=!1;(t||(e.f&262144)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(cs(e.nodes.start,e.nodes.end),r=!0),U(e,33554432),Gr(e,t&&!r),lr(e,0);var n=e.nodes&&e.nodes.t;if(n!==null)for(let o of n)o.stop();ko(e),e.f^=33554432,e.f|=16384;var i=e.parent;i!==null&&i.first!==null&&fo(e),m&&(e.component_function=null),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function cs(e,t){for(;e!==null;){var r=e===t?null:ke(e);e.remove(),e=r}}function fo(e){var t=e.parent,r=e.prev,n=e.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),t!==null&&(t.first===e&&(t.first=n),t.last===e&&(t.last=r))}function yt(e,t,r=!0){var n=[];us(e,n,!0);var i=()=>{r&&ne(e),t&&t()},o=n.length;if(o>0){var s=()=>--o||i();for(var a of n)a.out(s)}else i()}function us(e,t,r){if((e.f&8192)===0){e.f^=8192;var n=e.nodes&&e.nodes.t;if(n!==null)for(let a of n)(a.is_global||r)&&t.push(a);for(var i=e.first;i!==null;){var o=i.next;if((i.f&64)===0){var s=(i.f&65536)!==0||(i.f&32)!==0&&(e.f&16)!==0;us(i,t,s?r:!1)}i=o}}}function Jr(e){ds(e,!0)}function ds(e,t){if((e.f&8192)!==0){e.f^=8192,(e.f&1024)===0&&(U(e,2048),Xe.ensure().schedule(e));for(var r=e.first;r!==null;){var n=r.next,i=(r.f&65536)!==0||(r.f&32)!==0;ds(r,i?t:!1),r=n}var o=e.nodes&&e.nodes.t;if(o!==null)for(let s of o)(s.is_global||t)&&s.in()}}function Ar(e,t){if(e.nodes)for(var r=e.nodes.start,n=e.nodes.end;r!==null;){var i=r===n?null:ke(r);t.append(r),r=i}}var ps=null;var Dn=!1,at=!1;function Eo(e){at=e}var R=null,He=!1;function se(e){R=e}var E=null;function oe(e){E=e}var Qe=null;function Nn(e){R!==null&&(!me||(R.f&2)!==0)&&(Qe===null?Qe=[e]:Qe.push(e))}var xe=null,Ye=0,et=null;function es(e){et=e}var _s=1,cr=0,jt=cr;function yo(e){jt=e}function Sr(){return++_s}function Ft(e){var t=e.f;if((t&2048)!==0)return!0;if(t&2&&(e.f&=-65537),(t&4096)!==0){for(var r=e.deps,n=r.length,i=0;ie.wv)return!0}(t&512)!==0&&be===null&&U(e,1024)}return!1}function ms(e,t,r=!0){var n=e.reactions;if(n!==null&&!(!me&&Qe!==null&&ct.call(Qe,e)))for(var i=0;i{e.ac.abort(Yt)}),e.ac=null);try{e.f|=2097152;var p=e.fn,d=p();e.f|=32768;var u=e.deps,_=C?.is_fork;if(xe!==null){var v;if(_||lr(e,Ye),u!==null&&Ye>0)for(u.length=Ye+xe.length,v=0;vr?.call(this,o))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?ve(()=>{t.addEventListener(e,i,n)}):t.addEventListener(e,i,n),i}function Bt(e,t,r,n,i){var o={capture:n,passive:i},s=Ts(e,t,r,o);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&ge(()=>{t.removeEventListener(e,s,o)})}var ws=null;function Fn(e){var t=this,r=t.ownerDocument,n=e.type,i=e.composedPath?.()||[],o=i[0]||e.target;ws=e;var s=0,a=ws===e&&e[Ln];if(a){var f=i.indexOf(a);if(f!==-1&&(t===document||t===window)){e[Ln]=t;return}var c=i.indexOf(t);if(c===-1)return;f<=c&&(s=f)}if(o=i[s]||e.target,o!==t){_e(e,"currentTarget",{configurable:!0,get(){return o||r}});var p=R,d=E;se(null),oe(null);try{for(var u,_=[];o!==null;){var v=o.assignedSlot||o.parentNode||o.host||null;try{var x=o[Ln]?.[n];x!=null&&(!o.disabled||e.target===o)&&x.call(o,e)}catch(h){u?_.push(h):u=h}if(e.cancelBubble||v===t||v===null)break;o=v}if(u){for(let h of _)queueMicrotask(()=>{throw h});throw u}}finally{e[Ln]=t,delete e.currentTarget,se(p),oe(d)}}}var La=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function ks(e){return La?.createHTML(e)??e}function Ao(e){var t=Et("template");return t.innerHTML=ks(e.replaceAll("","")),t.content}function ft(e,t){var r=E;r.nodes===null&&(r.nodes={start:e,end:t,a:null,t:null})}function z(e,t){var r=(t&1)!==0,n=(t&2)!==0,i,o=!e.startsWith("");return()=>{if(T)return ft(I,null),I;i===void 0&&(i=Ao(o?e:""+e),r||(i=Be(i)));var s=n||Yr?document.importNode(i,!0):i.cloneNode(!0);if(r){var a=Be(s),f=s.lastChild;ft(a,f)}else ft(s,s);return s}}function Tt(e=""){if(!T){var t=ie(e+"");return ft(t,t),t}var r=I;return r.nodeType!==Qt?(r.before(r=ie()),G(r)):Kr(r),ft(r,r),r}function Ro(){if(T)return ft(I,null),I;var e=document.createDocumentFragment(),t=document.createComment(""),r=ie();return e.append(t,r),ft(t,r),e}function M(e,t){if(T){var r=E;((r.f&32768)===0||r.nodes.end===null)&&(r.nodes.end=I),Ie();return}e!==null&&e.before(t)}var Co=!0;function O(e,t){var r=t==null?"":typeof t=="object"?\`\${t}\`:t;r!==(e[Lr]??=e.nodeValue)&&(e[Lr]=r,e.nodeValue=\`\${r}\`)}function Or(e,t){return Ss(e,t)}function Io(e,t){Cn(),t.intro=t.intro??!1;let r=t.target,n=T,i=I;try{for(var o=Be(r);o&&(o.nodeType!==tt||o.data!=="[");)o=ke(o);if(!o)throw Rt;ae(!0),G(o);let s=Ss(e,{...t,anchor:o});return ae(!1),s}catch(s){if(s instanceof Error&&s.message.split(\` -\`).some(a=>a.startsWith("https://svelte.dev/e/")))throw s;return s!==Rt&&console.warn("Failed to hydrate: ",s),t.recover===!1&&bi(),Cn(),Wr(r),ae(!1),Or(e,t)}finally{ae(n),G(i)}}var Pn=new Map;function Ss(e,{target:t,anchor:r,props:n={},events:i,context:o,intro:s=!0,transformError:a}){Cn();var f=void 0,c=ls(()=>{var p=r??t.appendChild(ie());po(p,{pending:()=>{}},_=>{le({});var v=q;if(o&&(v.c=o),i&&(n.$$events=i),T&&ft(_,null),Co=s,f=e(_,n)||{},Co=!0,T&&(E.nodes.end=I,I===null||I.nodeType!==tt||I.data!=="]"))throw er(),Rt;fe()},a);var d=new Set,u=_=>{for(var v=0;v<_.length;v++){var x=_[v];if(!d.has(x)){d.add(x);var h=gs(x);for(let L of[t,document]){var A=Pn.get(L);A===void 0&&(A=new Map,Pn.set(L,A));var B=A.get(x);B===void 0?(L.addEventListener(x,Fn,{passive:h}),A.set(x,1)):A.set(x,B+1)}}}};return u(mr(Es)),So.add(u),()=>{for(var _ of d)for(let h of[t,document]){var v=Pn.get(h),x=v.get(_);--x==0?(h.removeEventListener(_,Fn),v.delete(_),v.size===0&&Pn.delete(h)):v.set(_,x)}So.delete(u),p!==r&&p.parentNode?.removeChild(p)}});return Oo.set(f,c),f}var Oo=new WeakMap;function Do(e,t){let r=Oo.get(e);return r?(Oo.delete(e),r(t)):(m&&(we in e?Ri():Ni()),Promise.resolve())}var qt=class{anchor;#e=new Map;#t=new Map;#r=new Map;#l=new Set;#n=!0;constructor(t,r=!0){this.anchor=t,this.#n=r}#i=t=>{if(this.#e.has(t)){var r=this.#e.get(t),n=this.#t.get(r);if(n)Jr(n),this.#l.delete(r);else{var i=this.#r.get(r);i&&(this.#t.set(r,i.effect),this.#r.delete(r),m&&(i.fragment.lastChild[Jn]=this.anchor),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),n=i.effect)}for(let[o,s]of this.#e){if(this.#e.delete(o),o===t)break;let a=this.#r.get(s);a&&(ne(a.effect),this.#r.delete(s))}for(let[o,s]of this.#t){if(o===r||this.#l.has(o))continue;let a=()=>{if(Array.from(this.#e.values()).includes(o)){var c=document.createDocumentFragment();Ar(s,c),c.append(ie()),this.#r.set(o,{effect:s,fragment:c})}else ne(s);this.#l.delete(o),this.#t.delete(o)};this.#n||!n?(this.#l.add(o),yt(s,a,!1)):a()}}};#o=t=>{this.#e.delete(t);let r=Array.from(this.#e.values());for(let[n,i]of this.#r)r.includes(n)||(ne(i.effect),this.#r.delete(n))};ensure(t,r){var n=C,i=On();if(r&&!this.#t.has(t)&&!this.#r.has(t))if(i){var o=document.createDocumentFragment(),s=ie();o.append(s),this.#r.set(t,{effect:pe(()=>r(s)),fragment:o})}else this.#t.set(t,pe(()=>r(this.anchor)));if(this.#e.set(n,t),i){for(let[a,f]of this.#t)a===t?n.unskip_effect(f):n.skip_effect(f);for(let[a,f]of this.#r)a===t?n.unskip_effect(f.effect):n.skip_effect(f.effect);n.oncommit(this.#i),n.ondiscard(this.#o)}else T&&(this.anchor=I),this.#i(n)}};function Ne(e,t,r=!1){var n;T&&(n=I,Ie());var i=new qt(e),o=r?65536:0;function s(a,f){if(T){var c=Br(n);if(a!==parseInt(c.substring(1))){var p=bt();G(p),i.anchor=p,ae(!1),i.ensure(a,f),ae(!0);return}}i.ensure(a,f)}Je(()=>{var a=!1;t((f,c=0)=>{a=!0,s(c,f)}),a||s(-1,null)},o)}function Ga(e,t,r){for(var n=[],i=t.length,o,s=t.length,a=0;a{if(o){if(o.pending.delete(d),o.done.add(d),o.pending.size===0){var u=e.outrogroups;Mo(e,mr(o.done)),u.delete(o),u.size===0&&(e.outrogroups=null)}}else s-=1},!1)}if(s===0){var f=n.length===0&&r!==null;if(f){var c=r,p=c.parentNode;Wr(p),p.append(c),e.items.clear()}Mo(e,t,!f)}else o={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(o)}function Mo(e,t,r=!0){var n;if(e.pending.size>0){n=new Set;for(let s of e.pending.values())for(let a of s)n.add(e.items.get(a).e)}for(var i=0;i{var L=r();return Nt(L)?L:L==null?[]:mr(L)});m&&De(d,"{#each ...}");var u,_=new Map,v=!0;function x(L){(B.effect.f&16384)===0&&(B.pending.delete(L),B.fallback=p,Wa(B,u,s,t,n),p!==null&&(u.length===0?(p.f&33554432)===0?Jr(p):(p.f^=33554432,en(p,null,s)):yt(p,()=>{p=null})))}function h(L){B.pending.delete(L)}var A=Je(()=>{u=l(d);var L=u.length;let j=!1;if(T){var k=Br(s)==="[!";k!==(L===0)&&(s=bt(),G(s),ae(!1),j=!0)}for(var y=new Set,N=C,Y=On(),X=0;Xo(s)):(p=pe(()=>o(As??=ie())),p.f|=33554432)),L>y.size&&(m?Xa(u,n):eo("","","")),T&&L>0&&G(bt()),!v)if(_.set(N,y),Y){for(let[ye,Ge]of a)y.has(ye)||N.skip_effect(Ge.e);N.oncommit(x),N.ondiscard(h)}else x(N);j&&ae(!0),l(d)}),B={effect:A,flags:t,items:a,pending:_,outrogroups:null,fallback:p};v=!1,T&&(s=I)}function Qr(e){for(;e!==null&&(e.f&32)===0;)e=e.next;return e}function Wa(e,t,r,n,i){var o=(n&8)!==0,s=t.length,a=e.items,f=Qr(e.effect.first),c,p=null,d,u=[],_=[],v,x,h,A;if(o)for(A=0;A0){var X=(n&4)!==0&&s===0?r:null;if(o){for(A=0;A{if(d!==void 0)for(h of d)h.nodes?.a?.apply()})}function Ka(e,t,r,n,i,o,s,a){var f=(s&1)!==0?(s&16)===0?D(r,!1,!1):Pe(r):null,c=(s&2)!==0?Pe(i):null;return m&&f&&(f.trace=()=>{a()[c?.v??i]}),{v:f,i:c,e:pe(()=>(o(t,f??r,c??i,a),()=>{e.delete(n)}))}}function en(e,t,r){if(e.nodes)for(var n=e.nodes.start,i=e.nodes.end,o=t&&(t.f&33554432)===0?t.nodes.start:r;n!==null;){var s=ke(n);if(o.before(n),n===i)return;n=s}}function Wt(e,t,r){t===null?e.effect.first=r:t.next=r,r===null?e.effect.last=t:r.prev=t}function Xa(e,t){let r=new Map,n=e.length;for(let i=0;i{var r=e.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+t.hash)){let i=Et("style");i.id=t.hash,i.textContent=t.code,n.appendChild(i),m&&xs(t.hash,i)}})}var Rs=[...\` -\\r\\f\\xA0\\v\\uFEFF\`];function Os(e,t,r){var n=e==null?"":""+e;if(t&&(n=n?n+" "+t:t),r){for(var i of Object.keys(r))if(r[i])n=n?n+" "+i:i;else if(n.length)for(var o=i.length,s=0;(s=n.indexOf(i,s))>=0;){var a=s+o;(s===0||Rs.includes(n[s-1]))&&(a===n.length||Rs.includes(n[a]))?n=(s===0?"":n.substring(0,s))+n.substring(a+1):s=a}}return n===""?null:n}function Cs(e,t=!1){var r=t?" !important;":";",n="";for(var i of Object.keys(e)){var o=e[i];o!=null&&o!==""&&(n+=" "+i+": "+o+r)}return n}function Lo(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function Is(e,t){if(t){var r="",n,i;if(Array.isArray(t)?(n=t[0],i=t[1]):n=t,e){e=String(e).replaceAll(/\\s*\\/\\*.*?\\*\\/\\s*/g,"").trim();var o=!1,s=0,a=!1,f=[];n&&f.push(...Object.keys(n).map(Lo)),i&&f.push(...Object.keys(i).map(Lo));var c=0,p=-1;let x=e.length;for(var d=0;dt.trim().split(" ").filter(Boolean))}function vl(e,t){var r=Ms(e.srcset),n=Ms(t);return n.length===r.length&&n.every(([i,o],s)=>o===r[s][1]&&(Po(r[s][0],i)||Po(i,r[s][0])))}function Ce(e=!1){let t=q,r=t.l.u;if(!r)return;let n=()=>Q(t.s);if(e){let i=0,o={},s=sr(()=>{let a=!1,f=t.s;for(let c in f)f[c]!==o[c]&&(o[c]=f[c],a=!0);return a&&i++,i});n=()=>l(s)}r.b.length&&Zr(()=>{Ps(t,n),vr(r.b)}),Xr(()=>{let i=$(()=>r.m.map(li));return()=>{for(let o of i)typeof o=="function"&&o()}}),r.a.length&&Xr(()=>{Ps(t,n),vr(r.a)})}function Ps(e,t){if(e.l.s)for(let r of e.l.s)l(r);t()}function Bs(e){return new Bo(e)}var Bo=class{#e;#t;constructor(t){var r=new Map,n=(o,s)=>{var a=D(s,!1,!1);return r.set(o,a),a};let i=new Proxy({...t.props||{},$$events:{}},{get(o,s){return l(r.get(s)??n(s,Reflect.get(o,s)))},has(o,s){return s===an?!0:(l(r.get(s)??n(s,Reflect.get(o,s))),Reflect.has(o,s))},set(o,s,a){return S(r.get(s)??n(s,a),a),Reflect.set(o,s,a)}});this.#t=(t.hydrate?Io:Or)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),!me&&(!t?.props?.$$host||t.sync===!1)&&kr(),this.#e=i.$$events;for(let o of Object.keys(this.#t))o==="$set"||o==="$destroy"||o==="$on"||_e(this,o,{get(){return this.#t[o]},set(s){this.#t[o]=s},enumerable:!0});this.#t.$set=o=>{Object.assign(i,o)},this.#t.$destroy=()=>{Do(this.#t)}}$set(t){this.#t.$set(t)}$on(t,r){this.#e[t]=this.#e[t]||[];let n=(...i)=>r.call(this,...i);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(i=>i!==n)}}$destroy(){this.#t.$destroy()}};var Tl;typeof HTMLElement=="function"&&(Tl=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,r){super(),this.$$ctor=e,this.$$s=t,r&&(this.$$shadowRoot=this.attachShadow(r))}addEventListener(e,t,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,r)}removeEventListener(e,t,r){if(super.removeEventListener(e,t,r),this.$$c){let n=this.$$l_u.get(t);n&&(n(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(n){return i=>{let o=Et("slot");n!=="default"&&(o.name=n),M(i,o)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let t={},r=kl(this);for(let n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=e(n),t.default=!0):t[n]=e(n));for(let n of this.attributes){let i=this.$$g_p(n.name);i in this.$$d||(this.$$d[i]=qo(i,n.value,this.$$p_d,"toProp"))}for(let n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=Bs({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=In(()=>{$e(()=>{this.$$r=!0;for(let n of Kn(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];let i=qo(n,this.$$d[n],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,i)}this.$$r=!1})});for(let n in this.$$l)for(let i of this.$$l[n]){let o=this.$$c.$on(n,i);this.$$l_u.set(i,o)}this.$$l={}}}attributeChangedCallback(e,t,r){this.$$r||(e=this.$$g_p(e),this.$$d[e]=qo(e,r,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return Kn(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function qo(e,t,r,n){let i=r[e]?.type;if(t=i==="Boolean"&&typeof t!="boolean"?t!=null:t,!n||!r[e])return t;if(n==="toAttribute")switch(i){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function kl(e){let t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}if(m){let e=function(t){if(!(t in globalThis)){let r;Object.defineProperty(globalThis,t,{configurable:!0,get:()=>{if(r!==void 0)return r;$i(t)},set:n=>{r=n}})}};e("$state"),e("$effect"),e("$derived"),e("$inspect"),e("$props"),e("$bindable")}typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");Oi();var Al={stats:"/proxy-stats",recent:"/proxy-recent",latestPng:"/proxy-latest-png",sessions:"/api/sessions.json",fullStats:"/api/stats.json",currentSession:"/api/current-session.json",compressionToggle:"/api/compression"};async function zo(e,t){let r=await fetch(e,t);if(!r.ok){let n="";try{n=await r.text()}catch{}throw new Error(\`\${e}: \${r.status} \${r.statusText}\${n?\` \\u2014 \${n.slice(0,200)}\`:""}\`)}return r.json()}async function Nl(e,t){return zo(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)})}async function qs(e){return Nl(Al.compressionToggle,{enabled:e})}function Ir(e,t){let r=()=>{};return{subscribe:no({data:null,error:null,loading:!0},i=>{let o=!1,s=null,a=null,f=async()=>{try{let c=await zo(e);if(o)return;a=c,i({data:c,error:null,loading:!1})}catch(c){if(o)return;i({data:a,error:c.message,loading:!1})}};return r=()=>{f()},f(),s=setInterval(f,t),()=>{o=!0,r=()=>{},s&&clearInterval(s)}}).subscribe,run:()=>r()}}var zn=Ir("/proxy-stats",2e3),pr=Ir("/proxy-recent",2e3),zs=Ir("/api/sessions.json",5e3),l0=Ir("/api/stats.json",5e3),Ys=Ir("/api/current-session.json",2e3),tn=yr(null);function Rl(){let{subscribe:e,update:t}=yr([]),r=1;return{subscribe:e,push(n,i){let o=r++;t(s=>[...s,{id:o,level:n,text:i}]),setTimeout(()=>t(s=>s.filter(a=>a.id!==o)),5e3)},dismiss(n){t(i=>i.filter(o=>o.id!==n))}}}var rn=Rl();function F(e){return Math.round(Number(e)||0).toLocaleString()}function Hs(e){if(!e)return"-";let t=String(e).split("/");return t[t.length-1]||e}var Cl=z(''),Ol=z('-'),Il=z(' '),Dl=z('no requests yet'),Ml=z('
#statuspathcccrbaselineactualsavedimg
'),Ll={hash:"svelte-hn7ohq",code:\`table.svelte-hn7ohq {width:100%;border-collapse:collapse;font-size:12px;}th.svelte-hn7ohq {text-align:left;color:#6e7681;font-weight:500;padding:6px 8px;border-bottom:1px solid #30363d;}td.svelte-hn7ohq {padding:6px 8px;border-bottom:1px solid #21262d;font-variant-numeric:tabular-nums;}tr.svelte-hn7ohq:last-child td:where(.svelte-hn7ohq) {border-bottom:none;}th.num.svelte-hn7ohq, - td.num.svelte-hn7ohq {text-align:right;}.small.svelte-hn7ohq {font-size:11px;color:#6e7681;}td.good.svelte-hn7ohq {color:#3fb950;}td.warn.svelte-hn7ohq {color:#d29922;}td.bad.svelte-hn7ohq {color:#f85149;}td.pos.svelte-hn7ohq {color:#3fb950;}.muted.svelte-hn7ohq {color:#6e7681;}.view-btn.svelte-hn7ohq {font-size:11px;background:#21262d;color:#58a6ff;border:1px solid #30363d;border-radius:4px;padding:1px 6px;cursor:pointer;}.view-btn.svelte-hn7ohq:hover {background:#30363d;}\`};function Yo(e,t){le(t,!1),Re(e,Ll);let r=()=>he(pr,"$recent",n),[n,i]=Ae(),o=D();function s(p){return p>=500?"bad":p>=400?"warn":"good"}function a(p){if(!p)return"-";let d=p.split("/");return d[d.length-1]||p}P(()=>r(),()=>{S(o,r().data?.recent??[])}),Ve(),Ce();var f=Ml(),c=w(b(f));ur(c,7,()=>(l(o),$(()=>l(o).slice().reverse())),(p,d)=>p.ts+":"+d,(p,d,u)=>{var _=Il(),v=b(_),x=b(v,!0);g(v);var h=w(v),A=b(h,!0);g(h);var B=w(h),L=b(B,!0);g(B);var j=w(B),k=b(j,!0);g(j);var y=w(j),N=b(y,!0);g(y);var Y=w(y),X=b(Y,!0);g(Y);var ee=w(Y),H=b(ee,!0);g(ee);var re=w(ee),V=b(re,!0);g(re);var ye=w(re),Ge=b(ye);{var Zt=ze=>{var Ue=Cl();Bt("click",Ue,()=>tn.set(l(d).img_id??null)),M(ze,Ue)},St=ze=>{var Ue=Ol();M(ze,Ue)};Ne(Ge,ze=>{l(d),$(()=>l(d).img_id!=null)?ze(Zt):ze(St,-1)})}g(ye),g(_),K((ze,Ue,zt,_r,At,gt)=>{O(x,l(u)+1),Kt(h,1,\`num \${ze??""}\`,"svelte-hn7ohq"),O(A,(l(d),$(()=>l(d).status))),O(L,Ue),O(k,(l(d),$(()=>l(d).cc_added?"\\u2713":"-"))),O(N,zt),O(X,_r),O(H,At),O(V,gt)},[()=>(l(d),$(()=>s(l(d).status))),()=>(l(d),$(()=>a(l(d).path))),()=>(l(d),Q(F),$(()=>l(d).cache_read!=null?F(l(d).cache_read):"-")),()=>(l(d),Q(F),$(()=>l(d).baseline_input!=null?F(l(d).baseline_input):"-")),()=>(l(d),Q(F),$(()=>l(d).actual_input!=null?F(l(d).actual_input):"-")),()=>(l(d),Q(F),$(()=>(l(d).session_saved_so_far_delta??0)>0?"+"+F(l(d).session_saved_so_far_delta??0):"-"))]),M(p,_)},p=>{var d=Dl();M(p,d)}),g(c),g(f),M(e,f),fe(),i()}var Fl=z('
'),Pl=z('
'),Bl=z('
',1),ql=z('
latest rendered
'),zl=z('
(none yet)
'),Yl=z('
',1),Hl={hash:"svelte-3whs73",code:\`.wrap.svelte-3whs73 {margin-top:0;} +\`)}}}function qi(e){let t=ro.get(e);t&&(_e(e,"message",{value:t.message}),_e(e,"stack",{value:t.stack}))}var ba=-7169;function V(e,t){e.f=e.f&ba|t}function yr(e){(e.f&512)!==0||e.deps===null?V(e,1024):V(e,4096)}function Bi(e){if(e!==null)for(let t of e)(t.f&2)===0||(t.f&65536)===0||(t.f^=65536,Bi(t.deps))}function bn(e,t,r){(e.f&2048)!==0?t.add(e):(e.f&4096)!==0&&r.add(e),Bi(e.deps),V(e,1024)}function $n(e,t,r){if(e==null)return t(void 0),r&&r(void 0),Oe;let n=x(()=>e.subscribe(t,r));return n.unsubscribe?()=>n.unsubscribe():n}var wr=[];function no(e,t){return{subscribe:Er(e,t).subscribe}}function Er(e,t=Oe){let r=null,n=new Set;function o(a){if(pn(e,a)&&(e=a,r)){let f=!wr.length;for(let u of n)u[1](),wr.push(u,e);if(f){for(let u=0;u{n.delete(u),n.size===0&&r&&(r(),r=null)}}return{set:o,update:i,subscribe:s}}function xn(e){let t;return $n(e,r=>t=r)(),t}var zi=!1;var oo=Symbol();function he(e,t,r){let n=r[t]??={store:null,source:M(void 0),unsubscribe:Oe};if(m&&(n.source.label=t),n.store!==e&&!(oo in r))if(n.unsubscribe(),n.store=e??null,e==null)n.source.v=void 0,n.unsubscribe=Oe;else{var o=!0;n.unsubscribe=$n(e,i=>{o?n.source.v=i:A(n.source,i)}),o=!1}return e&&oo in r?xn(e):l(n.source)}function Ae(){let e={};function t(){ge(()=>{for(var r in e)e[r].unsubscribe();_e(e,oo,{enumerable:!1,value:!0})})}return[e,t]}var yn=null,kr=null,R=null,Sr=null,be=null,ao=null,ar=!1,io=!1,lr=null,Vr=null,Yi=0,so=new Set,xa=1,Xe=class e{id=xa++;#e=!1;linked=!0;#t=null;#r=null;async_deriveds=new Map;current=new Map;previous=new Map;unblocked=new Set;#l=new Set;#n=new Set;#i=new Set;#o=0;#s=new Map;#d=null;#a=[];#_=[];#p=new Set;#c=new Set;#u=new Map;#f=new Set;is_fork=!1;#h=!1;#x(){if(this.is_fork)return!0;for(let n of this.#s.keys()){for(var t=n,r=!1;t.parent!==null;){if(this.#u.has(t)){r=!0;break}t=t.parent}if(!r)return!0}return!1}skip_effect(t){this.#u.has(t)||this.#u.set(t,{d:[],m:[]}),this.#f.delete(t)}unskip_effect(t,r=n=>this.schedule(n)){var n=this.#u.get(t);if(n){this.#u.delete(t);for(var o of n.d)V(o,2048),r(o);for(o of n.m)V(o,4096),r(o)}this.#f.add(t)}#v(){if(this.#e=!0,Yi++>1e3&&(this.#$(),ya()),m)for(let f of this.current.keys())so.add(f);if(!this.#x()){for(let f of this.#p)this.#c.delete(f),V(f,2048),this.schedule(f);for(let f of this.#c)V(f,4096),this.schedule(f)}let t=this.#a;this.#a=[],this.apply();var r=lr=[],n=[],o=Vr=[];for(let f of t)try{this.#y(f,r,n)}catch(u){throw ji(f),u}if(R=null,o.length>0){var i=e.ensure();for(let f of o)i.schedule(f)}if(lr=null,Vr=null,this.#x()){this.#m(n),this.#m(r);for(let[f,u]of this.#u)Ui(f,u);o.length>0&&R.#v();return}let s=this.#w();if(s){s.#g(this);return}this.#p.clear(),this.#c.clear();for(let f of this.#l)f(this);this.#l.clear(),Sr=this,Hi(n),Hi(r),Sr=null,this.#d?.resolve();var a=R;if(this.linked&&this.#o===0&&this.#$(),me&&!this.linked&&(this.#E(),R=a),this.#a.length>0){a===null&&(a=this,this.#b());let f=a;f.#a.push(...this.#a.filter(u=>!f.#a.includes(u)))}a!==null&&a.#v()}#y(t,r,n){t.f^=1024;for(var o=t.first;o!==null;){var i=o.f,s=(i&96)!==0,a=s&&(i&1024)!==0,f=a||(i&8192)!==0||this.#u.has(o);if(!f&&o.fn!==null){s?o.f^=1024:(i&4)!==0?r.push(o):me&&(i&16777224)!==0?n.push(o):Pt(o)&&((i&16)!==0&&this.#c.add(o),gt(o));var u=o.first;if(u!==null){o=u;continue}}for(;o!==null;){var p=o.next;if(p!==null){o=p;break}o=o.parent}}}#w(){for(var t=this.#t;t!==null;){if(!t.is_fork){for(let[r,[,n]]of this.current)if(t.current.has(r)&&!n)return t}t=t.#t}return null}#g(t){for(let[n,o]of t.current)!this.previous.has(n)&&t.previous.has(n)&&this.previous.set(n,t.previous.get(n)),this.current.set(n,o);for(let[n,o]of t.async_deriveds){let i=this.async_deriveds.get(n);i&&o.promise.then(i.resolve)}let r=n=>{var o=n.reactions;if(o!==null)for(let a of o){var i=a.f;if((i&2)!==0)r(a);else{var s=a;i&4194320&&!this.async_deriveds.has(s)&&(this.#c.delete(s),V(s,2048),this.schedule(s))}}};for(let n of this.current.keys())r(n);this.oncommit(()=>t.discard()),t.#$(),R=this,this.#v()}#m(t){for(var r=0;r!this.current.has(c));if(o.length===0)t&&p.discard();else if(r.length>0){if(m&&Mi(p.#a.length===0,"Batch has scheduled roots"),t)for(let c of this.#f)p.unskip_effect(c,d=>{(d.f&4194320)!==0?p.schedule(d):p.#m([d])});p.activate();var i=new Set,s=new Map;for(var a of r)Vi(a,o,i,s);s=new Map;var f=[...p.current.keys()].filter(c=>this.current.has(c)?this.current.get(c)[0]!==c.v:!0);if(f.length>0)for(let c of this.#_)(c.f&155648)===0&&lo(c,f,s)&&((c.f&4194320)!==0?(V(c,2048),p.schedule(c)):p.#p.add(c));if(p.#a.length>0){p.apply();for(var u of p.#a)p.#y(u,[],[]);p.#a=[]}p.deactivate()}}}}increment(t,r){if(this.#o+=1,t){let n=this.#s.get(r)??0;this.#s.set(r,n+1)}}decrement(t,r){if(this.#o-=1,t){let n=this.#s.get(r)??0;n===1?this.#s.delete(r):this.#s.set(r,n-1)}this.#h||(this.#h=!0,ve(()=>{this.#h=!1,this.linked&&this.flush()}))}transfer_effects(t,r){for(let n of t)this.#p.add(n);for(let n of r)this.#c.add(n);t.clear(),r.clear()}oncommit(t){this.#l.add(t)}ondiscard(t){this.#n.add(t)}on_fork_commit(t){this.#i.add(t)}run_fork_commit_callbacks(){for(let t of this.#i)t(this);this.#i.clear()}settled(){return(this.#d??=sn()).promise}static ensure(){if(R===null){let t=R=new e;t.#b(),!io&&!ar&&ve(()=>{t.#e||t.flush()})}return R}apply(){if(!me||!this.is_fork&&this.#t===null&&this.#r===null){be=null;return}be=new Map;for(let[r,[n]]of this.current)be.set(r,n);for(let r=yn;r!==null;r=r.#r)if(!(r===this||r.is_fork)){var t=!1;if(r.id0)){Ft.clear();for(let o of lt){if((o.f&24576)!==0)continue;let i=[o],s=o.parent;for(;s!==null;)lt.has(s)&&(lt.delete(s),i.push(s)),s=s.parent;for(let a=i.length-1;a>=0;a--){let f=i[a];(f.f&24576)===0&>(f)}}lt.clear()}}lt=null}}function Vi(e,t,r,n){if(!r.has(e)&&(r.add(e),e.reactions!==null))for(let o of e.reactions){let i=o.f;(i&2)!==0?Vi(o,t,r,n):(i&4194320)!==0&&(i&2048)===0&&lo(o,t,n)&&(V(o,2048),Ur(o))}}function lo(e,t,r){let n=r.get(e);if(n!==void 0)return n;if(e.deps!==null)for(let o of e.deps){if(pt.call(t,o))return!0;if((o.f&2)!==0&&lo(o,t,r))return r.set(o,!0),!0}return r.set(e,!1),!1}function Ur(e){R.schedule(e)}function Ui(e,t){if(!((e.f&32)!==0&&(e.f&1024)!==0)){(e.f&2048)!==0?t.d.push(e):(e.f&4096)!==0&&t.m.push(e),V(e,1024);for(var r=e.first;r!==null;)Ui(r,t),r=r.next}}function ji(e){V(e,1024);for(var t=e.first;t!==null;)ji(t),t=t.next}function co(e){let t=0,r=qe(0),n;return m&&Me(r,"createSubscriber version"),()=>{Dt()&&(l(r),$e(()=>(t===0&&(n=x(()=>e(()=>cr(r)))),t+=1,()=>{ve(()=>{t-=1,t===0&&(n?.(),n=void 0,cr(r))})})))}}var Ea=589824;function po(e,t,r,n){new uo(e,t,r,n)}var uo=class{parent;is_pending=!1;transform_error;#e;#t=k?I:null;#r;#l;#n;#i=null;#o=null;#s=null;#d=null;#a=0;#_=0;#p=!1;#c=new Set;#u=new Set;#f=null;#h=co(()=>(this.#f=qe(this.#a),m&&Me(this.#f,"$effect.pending()"),()=>{this.#f=null}));constructor(t,r,n,o){this.#e=t,this.#r=r,this.#l=i=>{var s=E;s.b=this,s.f|=128,n(i)},this.parent=E.b,this.transform_error=o??this.parent?.transform_error??(i=>i),this.#n=Je(()=>{if(k){let i=this.#t;De();let s=i.data==="[!";if(i.data.startsWith("[?")){let f=JSON.parse(i.data.slice("[?".length));this.#v(f)}else s?this.#y():this.#x()}else this.#w()},Ea),k&&(this.#e=I)}#x(){try{this.#i=pe(()=>this.#l(this.#e))}catch(t){this.error(t)}}#v(t){let r=this.#r.failed;r&&(this.#s=pe(()=>{r(this.#e,()=>t,()=>()=>{})}))}#y(){let t=this.#r.pending;t&&(this.is_pending=!0,this.#o=pe(()=>t(this.#e)),ve(()=>{var r=this.#d=document.createDocumentFragment(),n=ie();r.append(n),this.#i=this.#m(()=>pe(()=>this.#l(n))),this.#_===0&&(this.#e.before(r),this.#d=null,Tt(this.#o,()=>{this.#o=null}),this.#g(R))}))}#w(){try{if(this.is_pending=this.has_pending_snippet(),this.#_=0,this.#a=0,this.#i=pe(()=>{this.#l(this.#e)}),this.#_>0){var t=this.#d=document.createDocumentFragment();Rr(this.#i,t);let r=this.#r.pending;this.#o=pe(()=>r(this.#e))}else this.#g(R)}catch(r){this.error(r)}}#g(t){this.is_pending=!1,t.transfer_effects(this.#c,this.#u)}defer_effect(t){bn(t,this.#c,this.#u)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#r.pending}#m(t){var r=E,n=N,o=q;oe(this.#n),se(this.#n),Mt(this.#n.ctx);try{return Xe.ensure(),t()}catch(i){return gn(i),null}finally{oe(r),se(n),Mt(o)}}#E(t,r){if(!this.has_pending_snippet()){this.parent&&this.parent.#E(t,r);return}this.#_+=t,this.#_===0&&(this.#g(r),this.#o&&Tt(this.#o,()=>{this.#o=null}),this.#d&&(this.#e.before(this.#d),this.#d=null))}update_pending_count(t,r){this.#E(t,r),this.#a+=t,!(!this.#f||this.#p)&&(this.#p=!0,ve(()=>{this.#p=!1,this.#f&&bt(this.#f,this.#a)}))}get_effect_pending(){return this.#h(),l(this.#f)}error(t){if(!this.#r.onerror&&!this.#r.failed)throw t;R?.is_fork?(this.#i&&R.skip_effect(this.#i),this.#o&&R.skip_effect(this.#o),this.#s&&R.skip_effect(this.#s),R.on_fork_commit(()=>{this.#b(t)})):this.#b(t)}#b(t){this.#i&&(ne(this.#i),this.#i=null),this.#o&&(ne(this.#o),this.#o=null),this.#s&&(ne(this.#s),this.#s=null),k&&(U(this.#t),qr(),U(yt()));var r=this.#r.onerror;let n=this.#r.failed;var o=!1,i=!1;let s=()=>{if(o){Ii();return}o=!0,i&&Ti(),this.#s!==null&&Tt(this.#s,()=>{this.#s=null}),this.#m(()=>{this.#w()})},a=f=>{try{i=!0,r?.(f,s),i=!1}catch(u){st(u,this.#n&&this.#n.parent)}n&&(this.#s=this.#m(()=>{try{return pe(()=>{var u=E;u.b=this,u.f|=128,n(this.#e,()=>f,()=>s)})}catch(u){return st(u,this.#n.parent),null}}))};ve(()=>{var f;try{f=this.transform_error(t)}catch(u){st(u,this.#n&&this.#n.parent);return}f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(a,u=>st(u,this.#n&&this.#n.parent)):a(f)})}};function kn(e,t,r,n){let o=Et()?ur:jt;var i=e.filter(d=>!d.settled);if(r.length===0&&i.length===0){n(t.map(o));return}var s=E,a=Ki(),f=i.length===1?i[0].promise:i.length>1?Promise.all(i.map(d=>d.promise)):null;function u(d){if((s.f&16384)===0){a();try{n(d)}catch(_){st(_,s)}Cr()}}var p=_o();if(r.length===0){f.then(()=>u(t.map(o))).finally(p);return}function c(){Promise.all(r.map(d=>vo(d))).then(d=>u([...t.map(o),...d])).catch(d=>st(d,s)).finally(p)}f?f.then(()=>{a(),c(),Cr()}):c()}function Ki(){var e=E,t=N,r=q,n=R;if(m)var o=wt;return function(s=!0){oe(e),se(t),Mt(r),s&&(e.f&16384)===0&&(n?.activate(),n?.apply()),m&&(mo(null),xr(o))}}function Cr(e=!0){oe(null),se(null),Mt(null),e&&R?.deactivate(),m&&(mo(null),xr(null))}function _o(){var e=E,t=e.b,r=R,n=t.is_rendered();return t.update_pending_count(1,r),r.increment(n,e),()=>{t.update_pending_count(-1,r),r.decrement(n,e)}}var je=null;function mo(e){je=e}var jr=new Set;function ur(e){var t=2050;E!==null&&(E.f|=524288);let r={ctx:q,deps:null,effects:null,equals:dn,f:t,fn:e,reactions:null,rv:0,v:J,wv:0,parent:E,ac:null};return m&&_t&&(r.created=mt("created at")),r}var Sn=Symbol("obsolete");function vo(e,t,r){let n=E;n===null&&pi();var o=void 0,i=qe(J);m&&(i.label=t??e.toString());var s=!N,a=new Set;return Ji(()=>{var f=E;m&&(je={effect:f,effect_deps:new Set,warned:!1});var u=sn();o=u.promise;try{Promise.resolve(e()).then(u.resolve,_=>{_!==Ht&&u.reject(_)}).finally(Cr)}catch(_){u.reject(_),Cr()}if(m){if(je){if(f.deps!==null)for(let _=0;_{m&&(je=null),c?.(),a.delete(u),v!==Sn&&(p.activate(),v?(i.f|=8388608,bt(i,v)):((i.f&8388608)!==0&&(i.f^=8388608),bt(i,_),m&&r!==void 0&&(jr.add(i),setTimeout(()=>{jr.has(i)&&(f.f&16384)===0&&(Si(i.label,r),jr.delete(i))}))),p.deactivate())};u.promise.then(d,_=>d(null,_||"unknown"))}),ge(()=>{for(let f of a)f.reject(Sn)}),m&&(i.f|=4194304),new Promise(f=>{function u(p){function c(){p===o?f(i):u(o)}p.then(c,c)}u(o)})}function go(e){let t=ur(e);return me||Nn(t),t}function jt(e){let t=ur(e);return t.equals=_n,t}function Xi(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r5){let i=mt("updated at");if(i!==null){let s=e.updated.get(i.stack);s||(s={error:i,count:0},e.updated.set(i.stack,s)),s.count++}}}E!==null&&(e.set_during_effect=!0)}if((e.f&2)!==0){let o=e;(e.f&2048)!==0&&Gr(o),be===null&&yr(o)}e.wv=Nr(),es(e,2048,r),Et()&&E!==null&&(E.f&1024)!==0&&(E.f&96)===0&&(et===null?ts([e]):et.push(e)),!n.is_fork&&dr.size>0&&!xo&&Tn()}return t}function Tn(){xo=!1;for(let e of dr){(e.f&1024)!==0&&V(e,4096);let t;try{t=Pt(e)}catch{t=!0}t&>(e)}dr.clear()}function cr(e){A(e,e.v+1)}function es(e,t,r){var n=e.reactions;if(n!==null)for(var o=Et(),i=n.length,s=0;s{if(Wt===s)return c();var d=N,_=Wt;se(null),yo(s);var v=c();return se(d),yo(_),v};n&&(r.set("length",kt(e.length,i)),m&&(e=Aa(e)));var f="";let u=!1;function p(c){if(!u){u=!0,f=c,Me(o,\`\${f} version\`);for(let[d,_]of r)Me(_,_r(f,d));u=!1}}return new Proxy(e,{defineProperty(c,d,_){(!("value"in _)||_.configurable===!1||_.enumerable===!1||_.writable===!1)&&yi();var v=r.get(d);return v===void 0?a(()=>{var y=kt(_.value,i);return r.set(d,y),m&&typeof d=="string"&&Me(y,_r(f,d)),y}):A(v,_.value,!0),!0},deleteProperty(c,d){var _=r.get(d);if(_===void 0){if(d in c){let v=a(()=>kt(J,i));r.set(d,v),cr(o),m&&Me(v,_r(f,d))}}else A(_,J),cr(o);return!0},get(c,d,_){if(d===we)return e;if(m&&d===ln)return p;var v=r.get(d),y=d in c;if(v===void 0&&(!y||We(c,d)?.writable)&&(v=a(()=>{var S=Gt(y?c[d]:J),z=kt(S,i);return m&&Me(z,_r(f,d)),z}),r.set(d,v)),v!==void 0){var h=l(v);return h===J?void 0:h}return Reflect.get(c,d,_)},getOwnPropertyDescriptor(c,d){var _=Reflect.getOwnPropertyDescriptor(c,d);if(_&&"value"in _){var v=r.get(d);v&&(_.value=l(v))}else if(_===void 0){var y=r.get(d),h=y?.v;if(y!==void 0&&h!==J)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return _},has(c,d){if(d===we)return!0;var _=r.get(d),v=_!==void 0&&_.v!==J||Reflect.has(c,d);if(_!==void 0||E!==null&&(!v||We(c,d)?.writable)){_===void 0&&(_=a(()=>{var h=v?Gt(c[d]):J,S=kt(h,i);return m&&Me(S,_r(f,d)),S}),r.set(d,_));var y=l(_);if(y===J)return!1}return v},set(c,d,_,v){var y=r.get(d),h=d in c;if(n&&d==="length")for(var S=_;Skt(J,i)),r.set(S+"",z),m&&Me(z,_r(f,S)))}if(y===void 0)(!h||We(c,d)?.writable)&&(y=a(()=>kt(void 0,i)),m&&Me(y,_r(f,d)),A(y,Gt(_)),r.set(d,y));else{h=y.v!==J;var F=a(()=>Gt(_));A(y,F)}var P=Reflect.getOwnPropertyDescriptor(c,d);if(P?.set&&P.set.call(v,_),!h){if(n&&typeof d=="string"){var T=r.get("length"),$=Number(d);Number.isInteger($)&&$>=T.v&&A(T,$+1)}cr(o)}return!0},ownKeys(c){l(o);var d=Reflect.ownKeys(c).filter(y=>{var h=r.get(y);return h===void 0||h.v!==J});for(var[_,v]of r)v.v!==J&&!(_ in c)&&d.push(_);return d},setPrototypeOf(){wi()}})}function _r(e,t){return typeof t=="symbol"?\`\${e}[Symbol(\${t.description??""})]\`:ka.test(t)?\`\${e}.\${t}\`:/^\\d+$/.test(t)?\`\${e}[\${t}]\`:\`\${e}['\${t}']\`}function Rn(e){try{if(e!==null&&typeof e=="object"&&we in e)return e[we]}catch{}return e}var Sa=new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function Aa(e){return new Proxy(e,{get(t,r,n){var o=Reflect.get(t,r,n);return Sa.has(r)?function(...i){Qi();var s=o.apply(this,i);return Tn(),s}:o}})}function rs(){let e=Array.prototype,t=Array.__svelte_cleanup;t&&t();let{indexOf:r,lastIndexOf:n,includes:o}=e;e.indexOf=function(i,s){let a=r.call(this,i,s);if(a===-1){for(let f=s??0;f{e.indexOf=r,e.lastIndexOf=n,e.includes=o}}var wo,ns,Hr,os,is;function Cn(){if(wo===void 0){wo=window,ns=document,Hr=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;os=We(t,"firstChild").get,is=We(t,"nextSibling").get,Zn(e)&&(e[Mr]=void 0,e[fn]=null,e[Lr]=void 0,e.__e=void 0),Zn(r)&&(r[Fr]=void 0),m&&(e.__svelte_meta=null,rs())}}function ie(e=""){return document.createTextNode(e)}function Be(e){return os.call(e)}function ke(e){return is.call(e)}function b(e,t){if(!k)return Be(e);var r=Be(I);if(r===null)r=I.appendChild(ie());else if(t&&r.nodeType!==or){var n=ie();return r?.before(n),U(n),n}return t&&Xr(r),U(r),r}function ze(e,t=!1){if(!k){var r=Be(e);return r instanceof Comment&&r.data===""?ke(r):r}if(t){if(I?.nodeType!==or){var n=ie();return I?.before(n),U(n),n}Xr(I)}return I}function w(e,t=1,r=!1){let n=k?I:e;for(var o;t--;)o=n,n=ke(n);if(!k)return n;if(r){if(n?.nodeType!==or){var i=ie();return n===null?o?.after(i):n.before(i),U(i),i}Xr(n)}return U(n),n}function Kr(e){e.textContent=""}function In(){if(!me||lt!==null)return!1;var e=E.f;return(e&32768)!==0}function St(e,t,r){let n=r?{is:r}:void 0;return document.createElementNS(t??cn,e,n)}function Xr(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===or;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Kt(e){var t=N,r=E;se(null),oe(null);try{return e()}finally{se(t),oe(r)}}function To(e){E===null&&(N===null&&gi(e),hi()),ft&&vi(e)}function Ra(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function $t(e,t){var r=E;if(m)for(;r!==null&&(r.f&131072)!==0;)r=r.parent;r!==null&&(r.f&8192)!==0&&(e|=8192);var n={ctx:q,deps:null,nodes:null,f:e|2048|512,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};m&&(n.component_function=vt),R?.register_created_effect(n);var o=n;if((e&4)!==0)lr!==null?lr.push(n):Xe.ensure().schedule(n);else if(t!==null){try{gt(n)}catch(s){throw ne(n),s}o.deps===null&&o.teardown===null&&o.nodes===null&&o.first===o.last&&(o.f&524288)===0&&(o=o.first,(e&16)!==0&&(e&65536)!==0&&o!==null&&(o.f|=65536))}if(o!==null&&(o.parent=r,r!==null&&Ra(o,r),N!==null&&(N.f&2)!==0&&(e&64)===0)){var i=N;(i.effects??=[]).push(o)}return n}function Dt(){return N!==null&&!He}function ge(e){let t=$t(8,null);return V(t,1024),t.teardown=e,t}function Zr(e){To("$effect"),m&&_e(e,"name",{value:"$effect"});var t=E.f,r=!N&&(t&32)!==0&&(t&32768)===0;if(r){var n=q;(n.e??=[]).push(e)}else return to(e)}function to(e){return $t(1048580,e)}function Jr(e){return To("$effect.pre"),m&&_e(e,"name",{value:"$effect.pre"}),$t(1048584,e)}function On(e){Xe.ensure();let t=$t(524352,e);return()=>{ne(t)}}function fs(e){Xe.ensure();let t=$t(524352,e);return(r={})=>new Promise(n=>{r.outro?Tt(t,()=>{ne(t),n(void 0)}):(ne(t),n(void 0))})}function ct(e){return $t(4,e)}function B(e,t){var r=q,n={effect:null,ran:!1,deps:e};r.l.$.push(n),n.effect=$e(()=>{if(e(),!n.ran){n.ran=!0;var o=E;try{oe(o.parent),x(t)}finally{oe(o)}}})}function Ve(){var e=q;$e(()=>{for(var t of e.l.$){t.deps();var r=t.effect;(r.f&1024)!==0&&r.deps!==null&&V(r,4096),Pt(r)&>(r),t.ran=!1}})}function Ji(e){return $t(4718592,e)}function $e(e,t=0){return $t(8|t,e)}function j(e,t=[],r=[],n=[]){kn(n,t,r,o=>{$t(8,()=>e(...o.map(l)))})}function Je(e,t=0){var r=$t(16|t,e);return m&&(r.dev_stack=wt),r}function pe(e){return $t(524320,e)}function ko(e){var t=e.teardown;if(t!==null){let r=ft,n=N;Eo(!0),se(null);try{t.call(null)}finally{Eo(r),se(n)}}}function Wr(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){let o=r.ac;o!==null&&Kt(()=>{o.abort(Ht)});var n=r.next;(r.f&64)!==0?r.parent=null:ne(r,t),r=n}}function cs(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&32)===0&&ne(t),t=r}}function ne(e,t=!0){var r=!1;(t||(e.f&262144)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(us(e.nodes.start,e.nodes.end),r=!0),V(e,33554432),Wr(e,t&&!r),pr(e,0);var n=e.nodes&&e.nodes.t;if(n!==null)for(let i of n)i.stop();ko(e),e.f^=33554432,e.f|=16384;var o=e.parent;o!==null&&o.first!==null&&fo(e),m&&(e.component_function=null),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function us(e,t){for(;e!==null;){var r=e===t?null:ke(e);e.remove(),e=r}}function fo(e){var t=e.parent,r=e.prev,n=e.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),t!==null&&(t.first===e&&(t.first=n),t.last===e&&(t.last=r))}function Tt(e,t,r=!0){var n=[];ds(e,n,!0);var o=()=>{r&&ne(e),t&&t()},i=n.length;if(i>0){var s=()=>--i||o();for(var a of n)a.out(s)}else o()}function ds(e,t,r){if((e.f&8192)===0){e.f^=8192;var n=e.nodes&&e.nodes.t;if(n!==null)for(let a of n)(a.is_global||r)&&t.push(a);for(var o=e.first;o!==null;){var i=o.next;if((o.f&64)===0){var s=(o.f&65536)!==0||(o.f&32)!==0&&(e.f&16)!==0;ds(o,t,s?r:!1)}o=i}}}function Qr(e){ps(e,!0)}function ps(e,t){if((e.f&8192)!==0){e.f^=8192,(e.f&1024)===0&&(V(e,2048),Xe.ensure().schedule(e));for(var r=e.first;r!==null;){var n=r.next,o=(r.f&65536)!==0||(r.f&32)!==0;ps(r,o?t:!1),r=n}var i=e.nodes&&e.nodes.t;if(i!==null)for(let s of i)(s.is_global||t)&&s.in()}}function Rr(e,t){if(e.nodes)for(var r=e.nodes.start,n=e.nodes.end;r!==null;){var o=r===n?null:ke(r);t.append(r),r=o}}var _s=null;var Dn=!1,ft=!1;function Eo(e){ft=e}var N=null,He=!1;function se(e){N=e}var E=null;function oe(e){E=e}var Qe=null;function Nn(e){N!==null&&(!me||(N.f&2)!==0)&&(Qe===null?Qe=[e]:Qe.push(e))}var xe=null,Ye=0,et=null;function ts(e){et=e}var ms=1,mr=0,Wt=mr;function yo(e){Wt=e}function Nr(){return++ms}function Pt(e){var t=e.f;if((t&2048)!==0)return!0;if(t&2&&(e.f&=-65537),(t&4096)!==0){for(var r=e.deps,n=r.length,o=0;oe.wv)return!0}(t&512)!==0&&be===null&&V(e,1024)}return!1}function vs(e,t,r=!0){var n=e.reactions;if(n!==null&&!(!me&&Qe!==null&&pt.call(Qe,e)))for(var o=0;o{e.ac.abort(Ht)}),e.ac=null);try{e.f|=2097152;var p=e.fn,c=p();e.f|=32768;var d=e.deps,_=R?.is_fork;if(xe!==null){var v;if(_||pr(e,Ye),d!==null&&Ye>0)for(d.length=Ye+xe.length,v=0;vr?.call(this,i))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?ve(()=>{t.addEventListener(e,o,n)}):t.addEventListener(e,o,n),o}function Bt(e,t,r,n,o){var i={capture:n,passive:o},s=ks(e,t,r,i);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&ge(()=>{t.removeEventListener(e,s,i)})}var Es=null;function Fn(e){var t=this,r=t.ownerDocument,n=e.type,o=e.composedPath?.()||[],i=o[0]||e.target;Es=e;var s=0,a=Es===e&&e[Ln];if(a){var f=o.indexOf(a);if(f!==-1&&(t===document||t===window)){e[Ln]=t;return}var u=o.indexOf(t);if(u===-1)return;f<=u&&(s=f)}if(i=o[s]||e.target,i!==t){_e(e,"currentTarget",{configurable:!0,get(){return i||r}});var p=N,c=E;se(null),oe(null);try{for(var d,_=[];i!==null;){var v=i.assignedSlot||i.parentNode||i.host||null;try{var y=i[Ln]?.[n];y!=null&&(!i.disabled||e.target===i)&&y.call(i,e)}catch(h){d?_.push(h):d=h}if(e.cancelBubble||v===t||v===null)break;i=v}if(d){for(let h of _)queueMicrotask(()=>{throw h});throw d}}finally{e[Ln]=t,delete e.currentTarget,se(p),oe(c)}}}var Fa=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function Ss(e){return Fa?.createHTML(e)??e}function Ao(e){var t=St("template");return t.innerHTML=Ss(e.replaceAll("","")),t.content}function ut(e,t){var r=E;r.nodes===null&&(r.nodes={start:e,end:t,a:null,t:null})}function Y(e,t){var r=(t&1)!==0,n=(t&2)!==0,o,i=!e.startsWith("");return()=>{if(k)return ut(I,null),I;o===void 0&&(o=Ao(i?e:""+e),r||(o=Be(o)));var s=n||Hr?document.importNode(o,!0):o.cloneNode(!0);if(r){var a=Be(s),f=s.lastChild;ut(a,f)}else ut(s,s);return s}}function At(e=""){if(!k){var t=ie(e+"");return ut(t,t),t}var r=I;return r.nodeType!==or?(r.before(r=ie()),U(r)):Xr(r),ut(r,r),r}function Ro(){if(k)return ut(I,null),I;var e=document.createDocumentFragment(),t=document.createComment(""),r=ie();return e.append(t,r),ut(t,r),e}function O(e,t){if(k){var r=E;((r.f&32768)===0||r.nodes.end===null)&&(r.nodes.end=I),De();return}e!==null&&e.before(t)}var Co=!0;function C(e,t){var r=t==null?"":typeof t=="object"?\`\${t}\`:t;r!==(e[Fr]??=e.nodeValue)&&(e[Fr]=r,e.nodeValue=\`\${r}\`)}function Or(e,t){return As(e,t)}function Oo(e,t){Cn(),t.intro=t.intro??!1;let r=t.target,n=k,o=I;try{for(var i=Be(r);i&&(i.nodeType!==nt||i.data!=="[");)i=ke(i);if(!i)throw Ct;ae(!0),U(i);let s=As(e,{...t,anchor:i});return ae(!1),s}catch(s){if(s instanceof Error&&s.message.split(\` +\`).some(a=>a.startsWith("https://svelte.dev/e/")))throw s;return s!==Ct&&console.warn("Failed to hydrate: ",s),t.recover===!1&&$i(),Cn(),Kr(r),ae(!1),Or(e,t)}finally{ae(n),U(o)}}var Pn=new Map;function As(e,{target:t,anchor:r,props:n={},events:o,context:i,intro:s=!0,transformError:a}){Cn();var f=void 0,u=fs(()=>{var p=r??t.appendChild(ie());po(p,{pending:()=>{}},_=>{le({});var v=q;if(i&&(v.c=i),o&&(n.$$events=o),k&&ut(_,null),Co=s,f=e(_,n)||{},Co=!0,k&&(E.nodes.end=I,I===null||I.nodeType!==nt||I.data!=="]"))throw ir(),Ct;fe()},a);var c=new Set,d=_=>{for(var v=0;v<_.length;v++){var y=_[v];if(!c.has(y)){c.add(y);var h=bs(y);for(let F of[t,document]){var S=Pn.get(F);S===void 0&&(S=new Map,Pn.set(F,S));var z=S.get(y);z===void 0?(F.addEventListener(y,Fn,{passive:h}),S.set(y,1)):S.set(y,z+1)}}}};return d(hr(Ts)),So.add(d),()=>{for(var _ of c)for(let h of[t,document]){var v=Pn.get(h),y=v.get(_);--y==0?(h.removeEventListener(_,Fn),v.delete(_),v.size===0&&Pn.delete(h)):v.set(_,y)}So.delete(d),p!==r&&p.parentNode?.removeChild(p)}});return Io.set(f,u),f}var Io=new WeakMap;function Do(e,t){let r=Io.get(e);return r?(Io.delete(e),r(t)):(m&&(we in e?Ci():Ri()),Promise.resolve())}var zt=class{anchor;#e=new Map;#t=new Map;#r=new Map;#l=new Set;#n=!0;constructor(t,r=!0){this.anchor=t,this.#n=r}#i=t=>{if(this.#e.has(t)){var r=this.#e.get(t),n=this.#t.get(r);if(n)Qr(n),this.#l.delete(r);else{var o=this.#r.get(r);o&&(this.#t.set(r,o.effect),this.#r.delete(r),m&&(o.fragment.lastChild[Jn]=this.anchor),o.fragment.lastChild.remove(),this.anchor.before(o.fragment),n=o.effect)}for(let[i,s]of this.#e){if(this.#e.delete(i),i===t)break;let a=this.#r.get(s);a&&(ne(a.effect),this.#r.delete(s))}for(let[i,s]of this.#t){if(i===r||this.#l.has(i))continue;let a=()=>{if(Array.from(this.#e.values()).includes(i)){var u=document.createDocumentFragment();Rr(s,u),u.append(ie()),this.#r.set(i,{effect:s,fragment:u})}else ne(s);this.#l.delete(i),this.#t.delete(i)};this.#n||!n?(this.#l.add(i),Tt(s,a,!1)):a()}}};#o=t=>{this.#e.delete(t);let r=Array.from(this.#e.values());for(let[n,o]of this.#r)r.includes(n)||(ne(o.effect),this.#r.delete(n))};ensure(t,r){var n=R,o=In();if(r&&!this.#t.has(t)&&!this.#r.has(t))if(o){var i=document.createDocumentFragment(),s=ie();i.append(s),this.#r.set(t,{effect:pe(()=>r(s)),fragment:i})}else this.#t.set(t,pe(()=>r(this.anchor)));if(this.#e.set(n,t),o){for(let[a,f]of this.#t)a===t?n.unskip_effect(f):n.skip_effect(f);for(let[a,f]of this.#r)a===t?n.unskip_effect(f.effect):n.skip_effect(f.effect);n.oncommit(this.#i),n.ondiscard(this.#o)}else k&&(this.anchor=I),this.#i(n)}};function Ne(e,t,r=!1){var n;k&&(n=I,De());var o=new zt(e),i=r?65536:0;function s(a,f){if(k){var u=Br(n);if(a!==parseInt(u.substring(1))){var p=yt();U(p),o.anchor=p,ae(!1),o.ensure(a,f),ae(!0);return}}o.ensure(a,f)}Je(()=>{var a=!1;t((f,u=0)=>{a=!0,s(u,f)}),a||s(-1,null)},i)}function Lo(e,t){return t}function Wa(e,t,r){for(var n=[],o=t.length,i,s=t.length,a=0;a{if(i){if(i.pending.delete(c),i.done.add(c),i.pending.size===0){var d=e.outrogroups;Mo(e,hr(i.done)),d.delete(i),d.size===0&&(e.outrogroups=null)}}else s-=1},!1)}if(s===0){var f=n.length===0&&r!==null;if(f){var u=r,p=u.parentNode;Kr(p),p.append(u),e.items.clear()}Mo(e,t,!f)}else i={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(i)}function Mo(e,t,r=!0){var n;if(e.pending.size>0){n=new Set;for(let s of e.pending.values())for(let a of s)n.add(e.items.get(a).e)}for(var o=0;o{var F=r();return Rt(F)?F:F==null?[]:hr(F)});m&&Me(c,"{#each ...}");var d,_=new Map,v=!0;function y(F){(z.effect.f&16384)===0&&(z.pending.delete(F),z.fallback=p,Ka(z,d,s,t,n),p!==null&&(d.length===0?(p.f&33554432)===0?Qr(p):(p.f^=33554432,tn(p,null,s)):Tt(p,()=>{p=null})))}function h(F){z.pending.delete(F)}var S=Je(()=>{d=l(c);var F=d.length;let P=!1;if(k){var T=Br(s)==="[!";T!==(F===0)&&(s=yt(),U(s),ae(!1),P=!0)}for(var $=new Set,D=R,G=In(),te=0;tei(s)):(p=pe(()=>i(Ns??=ie())),p.f|=33554432)),F>$.size&&(m?Za(d,n):eo("","","")),k&&F>0&&U(yt()),!v)if(_.set(D,$),G){for(let[ye,tt]of a)$.has(ye)||D.skip_effect(tt.e);D.oncommit(y),D.ondiscard(h)}else y(D);P&&ae(!0),l(c)}),z={effect:S,flags:t,items:a,pending:_,outrogroups:null,fallback:p};v=!1,k&&(s=I)}function en(e){for(;e!==null&&(e.f&32)===0;)e=e.next;return e}function Ka(e,t,r,n,o){var i=(n&8)!==0,s=t.length,a=e.items,f=en(e.effect.first),u,p=null,c,d=[],_=[],v,y,h,S;if(i)for(S=0;S0){var te=(n&4)!==0&&s===0?r:null;if(i){for(S=0;S{if(c!==void 0)for(h of c)h.nodes?.a?.apply()})}function Xa(e,t,r,n,o,i,s,a){var f=(s&1)!==0?(s&16)===0?M(r,!1,!1):qe(r):null,u=(s&2)!==0?qe(o):null;return m&&f&&(f.trace=()=>{a()[u?.v??o]}),{v:f,i:u,e:pe(()=>(i(t,f??r,u??o,a),()=>{e.delete(n)}))}}function tn(e,t,r){if(e.nodes)for(var n=e.nodes.start,o=e.nodes.end,i=t&&(t.f&33554432)===0?t.nodes.start:r;n!==null;){var s=ke(n);if(i.before(n),n===o)return;n=s}}function Xt(e,t,r){t===null?e.effect.first=r:t.next=r,r===null?e.effect.last=t:r.prev=t}function Za(e,t){let r=new Map,n=e.length;for(let o=0;o{var r=e.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+t.hash)){let o=St("style");o.id=t.hash,o.textContent=t.code,n.appendChild(o),m&&ys(t.hash,o)}})}var Cs=[...\` +\\r\\f\\xA0\\v\\uFEFF\`];function Os(e,t,r){var n=e==null?"":""+e;if(t&&(n=n?n+" "+t:t),r){for(var o of Object.keys(r))if(r[o])n=n?n+" "+o:o;else if(n.length)for(var i=o.length,s=0;(s=n.indexOf(o,s))>=0;){var a=s+i;(s===0||Cs.includes(n[s-1]))&&(a===n.length||Cs.includes(n[a]))?n=(s===0?"":n.substring(0,s))+n.substring(a+1):s=a}}return n===""?null:n}function Is(e,t=!1){var r=t?" !important;":";",n="";for(var o of Object.keys(e)){var i=e[o];i!=null&&i!==""&&(n+=" "+o+": "+i+r)}return n}function Fo(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function Ds(e,t){if(t){var r="",n,o;if(Array.isArray(t)?(n=t[0],o=t[1]):n=t,e){e=String(e).replaceAll(/\\s*\\/\\*.*?\\*\\/\\s*/g,"").trim();var i=!1,s=0,a=!1,f=[];n&&f.push(...Object.keys(n).map(Fo)),o&&f.push(...Object.keys(o).map(Fo));var u=0,p=-1;let y=e.length;for(var c=0;ct.trim().split(" ").filter(Boolean))}function hl(e,t){var r=Ls(e.srcset),n=Ls(t);return n.length===r.length&&n.every(([o,i],s)=>i===r[s][1]&&(qo(r[s][0],o)||qo(o,r[s][0])))}function Ce(e=!1){let t=q,r=t.l.u;if(!r)return;let n=()=>Q(t.s);if(e){let o=0,i={},s=ur(()=>{let a=!1,f=t.s;for(let u in f)f[u]!==i[u]&&(i[u]=f[u],a=!0);return a&&o++,o});n=()=>l(s)}r.b.length&&Jr(()=>{qs(t,n),gr(r.b)}),Zr(()=>{let o=x(()=>r.m.map(fi));return()=>{for(let i of o)typeof i=="function"&&i()}}),r.a.length&&Zr(()=>{qs(t,n),gr(r.a)})}function qs(e,t){if(e.l.s)for(let r of e.l.s)l(r);t()}function Bs(e){return new Bo(e)}var Bo=class{#e;#t;constructor(t){var r=new Map,n=(i,s)=>{var a=M(s,!1,!1);return r.set(i,a),a};let o=new Proxy({...t.props||{},$$events:{}},{get(i,s){return l(r.get(s)??n(s,Reflect.get(i,s)))},has(i,s){return s===an?!0:(l(r.get(s)??n(s,Reflect.get(i,s))),Reflect.has(i,s))},set(i,s,a){return A(r.get(s)??n(s,a),a),Reflect.set(i,s,a)}});this.#t=(t.hydrate?Oo:Or)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),!me&&(!t?.props?.$$host||t.sync===!1)&&Ar(),this.#e=o.$$events;for(let i of Object.keys(this.#t))i==="$set"||i==="$destroy"||i==="$on"||_e(this,i,{get(){return this.#t[i]},set(s){this.#t[i]=s},enumerable:!0});this.#t.$set=i=>{Object.assign(o,i)},this.#t.$destroy=()=>{Do(this.#t)}}$set(t){this.#t.$set(t)}$on(t,r){this.#e[t]=this.#e[t]||[];let n=(...o)=>r.call(this,...o);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(o=>o!==n)}}$destroy(){this.#t.$destroy()}};var kl;typeof HTMLElement=="function"&&(kl=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,r){super(),this.$$ctor=e,this.$$s=t,r&&(this.$$shadowRoot=this.attachShadow(r))}addEventListener(e,t,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,r)}removeEventListener(e,t,r){if(super.removeEventListener(e,t,r),this.$$c){let n=this.$$l_u.get(t);n&&(n(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(n){return o=>{let i=St("slot");n!=="default"&&(i.name=n),O(o,i)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let t={},r=Sl(this);for(let n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=e(n),t.default=!0):t[n]=e(n));for(let n of this.attributes){let o=this.$$g_p(n.name);o in this.$$d||(this.$$d[o]=zo(o,n.value,this.$$p_d,"toProp"))}for(let n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=Bs({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=On(()=>{$e(()=>{this.$$r=!0;for(let n of Kn(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];let o=zo(n,this.$$d[n],this.$$p_d,"toAttribute");o==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,o)}this.$$r=!1})});for(let n in this.$$l)for(let o of this.$$l[n]){let i=this.$$c.$on(n,o);this.$$l_u.set(o,i)}this.$$l={}}}attributeChangedCallback(e,t,r){this.$$r||(e=this.$$g_p(e),this.$$d[e]=zo(e,r,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return Kn(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function zo(e,t,r,n){let o=r[e]?.type;if(t=o==="Boolean"&&typeof t!="boolean"?t!=null:t,!n||!r[e])return t;if(n==="toAttribute")switch(o){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(o){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function Sl(e){let t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}if(m){let e=function(t){if(!(t in globalThis)){let r;Object.defineProperty(globalThis,t,{configurable:!0,get:()=>{if(r!==void 0)return r;xi(t)},set:n=>{r=n}})}};e("$state"),e("$effect"),e("$derived"),e("$inspect"),e("$props"),e("$bindable")}typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");Oi();var Nl={stats:"/proxy-stats",recent:"/proxy-recent",latestPng:"/proxy-latest-png",sessions:"/api/sessions.json",fullStats:"/api/stats.json",currentSession:"/api/current-session.json",compressionToggle:"/api/compression"};async function Yo(e,t){let r=await fetch(e,t);if(!r.ok){let n="";try{n=await r.text()}catch{}throw new Error(\`\${e}: \${r.status} \${r.statusText}\${n?\` \\u2014 \${n.slice(0,200)}\`:""}\`)}return r.json()}async function Rl(e,t){return Yo(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)})}async function zs(e){return Rl(Nl.compressionToggle,{enabled:e})}function Dr(e,t){let r=()=>{};return{subscribe:no({data:null,error:null,loading:!0},o=>{let i=!1,s=null,a=null,f=async()=>{try{let u=await Yo(e);if(i)return;a=u,o({data:u,error:null,loading:!1})}catch(u){if(i)return;o({data:a,error:u.message,loading:!1})}};return r=()=>{f()},f(),s=setInterval(f,t),()=>{i=!0,r=()=>{},s&&clearInterval(s)}}).subscribe,run:()=>r()}}var zn=Dr("/proxy-stats",2e3),vr=Dr("/proxy-recent",2e3),Ys=Dr("/api/sessions.json",5e3),f0=Dr("/api/stats.json",5e3),Hs=Dr("/api/current-session.json",2e3),rn=Er(null);function Cl(){let{subscribe:e,update:t}=Er([]),r=1;return{subscribe:e,push(n,o){let i=r++;t(s=>[...s,{id:i,level:n,text:o}]),setTimeout(()=>t(s=>s.filter(a=>a.id!==i)),5e3)},dismiss(n){t(o=>o.filter(i=>i.id!==n))}}}var nn=Cl();function L(e){return Math.round(Number(e)||0).toLocaleString()}function Vs(e){if(!e)return"-";let t=String(e).split("/");return t[t.length-1]||e}var Il=Y(''),Ol=Y('
'),Dl=Y('-'),Ml=Y(' '),Ll=Y('no requests yet'),Fl=Y('
#statuspathcccrbaselineactualsavedimg
'),Pl={hash:"svelte-hn7ohq",code:\`table.svelte-hn7ohq {width:100%;border-collapse:collapse;font-size:12px;}th.svelte-hn7ohq {text-align:left;color:#6e7681;font-weight:500;padding:6px 8px;border-bottom:1px solid #30363d;}td.svelte-hn7ohq {padding:6px 8px;border-bottom:1px solid #21262d;font-variant-numeric:tabular-nums;}tr.svelte-hn7ohq:last-child td:where(.svelte-hn7ohq) {border-bottom:none;}th.num.svelte-hn7ohq, + td.num.svelte-hn7ohq {text-align:right;}.small.svelte-hn7ohq {font-size:11px;color:#6e7681;}td.good.svelte-hn7ohq {color:#3fb950;}td.warn.svelte-hn7ohq {color:#d29922;}td.bad.svelte-hn7ohq {color:#f85149;}td.pos.svelte-hn7ohq {color:#3fb950;}.muted.svelte-hn7ohq {color:#6e7681;}.thumb-strip.svelte-hn7ohq {display:flex;gap:3px;align-items:center;justify-content:flex-end;}.thumb-btn.svelte-hn7ohq {padding:0;border:1px solid #30363d;border-radius:3px;background:#fff;cursor:pointer;line-height:0;}.thumb-btn.svelte-hn7ohq:hover, + .thumb-btn.svelte-hn7ohq:focus-visible {border-color:#58a6ff;outline:none;}.thumb.svelte-hn7ohq {height:28px;width:auto;max-width:28px;object-fit:cover;object-position:top left;display:block;image-rendering:pixelated;}.img-cell.svelte-hn7ohq {text-align:right;}\`};function Ho(e,t){le(t,!1),Re(e,Pl);let r=()=>he(vr,"$recent",n),[n,o]=Ae(),i=M();function s(p){return p>=500?"bad":p>=400?"warn":"good"}function a(p){if(!p)return"-";let c=p.split("/");return c[c.length-1]||p}B(()=>r(),()=>{A(i,r().data?.recent??[])}),Ve(),Ce();var f=Fl(),u=w(b(f));Zt(u,7,()=>(l(i),x(()=>l(i).slice().reverse())),(p,c)=>p.ts+":"+c,(p,c,d)=>{var _=Ml(),v=b(_),y=b(v,!0);g(v);var h=w(v),S=b(h,!0);g(h);var z=w(h),F=b(z,!0);g(z);var P=w(z),T=b(P,!0);g(P);var $=w(P),D=b($,!0);g($);var G=w($),te=b(G,!0);g(G);var X=w(G),H=b(X,!0);g(X);var re=w(X),W=b(re,!0);g(re);var ye=w(re),tt=b(ye);{var er=Ge=>{let dt=jt(()=>(l(c),x(()=>l(c).img_ids??(l(c).img_id!=null?[l(c).img_id]:[]))));var rt=Ol();Zt(rt,5,()=>l(dt),Lo,(Yt,Ue)=>{var Ie=Il(),rr=b(Ie);g(Ie),j(()=>{xt(Ie,"title",\`image #\${l(Ue)??""}\`),xt(rr,"src",\`/proxy-latest-png?id=\${l(Ue)??""}\`),xt(rr,"alt",\`img \${l(Ue)??""}\`)}),Bt("click",Ie,()=>rn.set(l(Ue))),O(Yt,Ie)}),g(rt),O(Ge,rt)},tr=Ge=>{var dt=Dl();O(Ge,dt)};Ne(tt,Ge=>{l(c),x(()=>l(c).img_ids&&l(c).img_ids.length>0||l(c).img_id!=null)?Ge(er):Ge(tr,-1)})}g(ye),g(_),j((Ge,dt,rt,Yt,Ue,Ie)=>{C(y,l(d)+1),Jt(h,1,\`num \${Ge??""}\`,"svelte-hn7ohq"),C(S,(l(c),x(()=>l(c).status))),C(F,dt),C(T,(l(c),x(()=>l(c).cc_added?"\\u2713":"-"))),C(D,rt),C(te,Yt),C(H,Ue),C(W,Ie)},[()=>(l(c),x(()=>s(l(c).status))),()=>(l(c),x(()=>a(l(c).path))),()=>(l(c),Q(L),x(()=>l(c).cache_read!=null?L(l(c).cache_read):"-")),()=>(l(c),Q(L),x(()=>l(c).baseline_input!=null?L(l(c).baseline_input):"-")),()=>(l(c),Q(L),x(()=>l(c).actual_input!=null?L(l(c).actual_input):"-")),()=>(l(c),Q(L),x(()=>(l(c).session_saved_so_far_delta??0)>0?"+"+L(l(c).session_saved_so_far_delta??0):"-"))]),O(p,_)},p=>{var c=Ll();O(p,c)}),g(u),g(f),O(e,f),fe(),o()}var ql=Y('
'),Bl=Y('
'),zl=Y('
',1),Yl=Y('
latest rendered
'),Hl=Y('
(none yet)
'),Vl=Y('
',1),Ul={hash:"svelte-3whs73",code:\`.wrap.svelte-3whs73 {margin-top:0;} /* Crop is done client-side via CSS (object-position + overflow:hidden). The legacy dashboard pulled a separately-cropped PNG which doubled image traffic. The full 1466\\xD71568 image lives on disk; we just show - the top-left corner at native res. */.preview-crop.svelte-3whs73 {width:100%;height:400px;overflow:hidden;background:#fff;border:1px solid #30363d;border-radius:4px;padding:4px;box-sizing:border-box;}.preview-crop.svelte-3whs73 img:where(.svelte-3whs73) {display:block;width:auto;height:auto;max-width:none;image-rendering:pixelated;}.sub.svelte-3whs73 {color:#6e7681;font-size:12px;}.small.svelte-3whs73 {font-size:11px;color:#6e7681;margin-top:8px;}.pin-bar.svelte-3whs73 {margin-bottom:8px;}.back-btn.svelte-3whs73 {font-size:11px;background:#21262d;color:#58a6ff;border:1px solid #30363d;border-radius:4px;padding:2px 8px;cursor:pointer;}.back-btn.svelte-3whs73:hover {background:#30363d;}.evicted.svelte-3whs73 {font-size:11px;color:#6e7681;padding:12px 0;}\`};function Ho(e,t){le(t,!1),Re(e,Hl);let r=()=>he(pr,"$recent",i),n=()=>he(tn,"$selectedImageId",i),[i,o]=Ae(),s=D(),a=D(),f=D(),c=D(),p=D(),d=D(),u=D();P(()=>r(),()=>{S(s,r().data?.has_preview===!0)}),P(()=>r(),()=>{S(a,r().data?.preview_meta??"")}),P(()=>r(),()=>{S(f,r().data?.image_ids??[])}),P(()=>n(),()=>{S(c,n())}),P(()=>(l(c),l(f)),()=>{S(p,l(c)!=null&&!l(f).includes(l(c)))}),P(()=>(l(c),l(s),l(a)),()=>{S(d,l(c)!=null?\`/proxy-latest-png?id=\${l(c)}\`:l(s)?"/proxy-latest-png?t="+encodeURIComponent(l(a)):"")}),P(()=>(l(c),l(a)),()=>{S(u,l(c)!=null?\`image #\${l(c)}\`:l(a)?l(a)+" - showing top-left at native resolution":"")}),Ve(),Ce();var _=Yl(),v=qe(_),x=b(v);{var h=k=>{var y=Bl(),N=qe(y),Y=b(N);g(N);var X=w(N,2);{var ee=re=>{var V=Fl(),ye=b(V);g(V),K(()=>O(ye,\`(image #\${l(c)??""} no longer in buffer)\`)),M(re,V)},H=re=>{var V=Pl(),ye=b(V);g(V),K(()=>{dr(ye,"src",l(d)),dr(ye,"alt",\`image #\${l(c)??""}\`)}),M(re,V)};Ne(X,re=>{l(p)?re(ee):re(H,-1)})}Bt("click",Y,()=>tn.set(null)),M(k,y)},A=k=>{var y=ql(),N=b(y);g(y),K(()=>dr(N,"src",l(d))),M(k,y)},B=k=>{var y=zl();M(k,y)};Ne(x,k=>{l(c)!=null?k(h):l(s)?k(A,1):k(B,-1)})}g(v);var L=w(v,2),j=b(L,!0);g(L),K(()=>O(j,l(u))),M(e,_),fe(),o()}var Vl=z('
'),Ul=z('
'),jl=z('
',1),Gl=z('
no sessions yet
'),Wl=z('
',1),Kl={hash:"svelte-c2rstm",code:".status.svelte-c2rstm {margin-bottom:12px;color:#6e7681;font-size:12px;}.chart.svelte-c2rstm {display:flex;flex-direction:column;gap:8px;}.bar-row.svelte-c2rstm {display:flex;align-items:center;gap:10px;font-size:12px;}.label.svelte-c2rstm {width:132px;flex:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#c9d1d9;}.track.svelte-c2rstm {flex:1;min-width:0;height:14px;background:#21262d;border-radius:3px;overflow:hidden;}.fill.svelte-c2rstm {height:100%;background:#3fb950;border-radius:3px;}.value.svelte-c2rstm {width:72px;flex:none;text-align:right;font-variant-numeric:tabular-nums;color:#3fb950;}.value.neg.svelte-c2rstm {color:#f85149;}.axis.svelte-c2rstm {margin-top:12px;color:#6e7681;font-size:11px;}.empty.svelte-c2rstm {text-align:center;color:#6e7681;padding:24px;font-size:12px;}"};function Vo(e,t){le(t,!1),Re(e,Kl);let r=()=>he(zs,"$sessions",n),[n,i]=Ae(),o=D(),s=D(),a=D(),f=8;function c(k){let y=k.claudeCode?.projectPath||k.project;return y?Hs(y):k.id.slice(0,8)}function p(k){return Math.round(k).toLocaleString("en-US")}function d(k){return l(a)<=0||k<=0?0:k/l(a)*100}P(()=>r(),()=>{S(o,r().data?.sessions??[])}),P(()=>l(o),()=>{S(s,[...l(o)].sort((k,y)=>(y.tokensSavedEst??0)-(k.tokensSavedEst??0)).slice(0,f))}),P(()=>l(s),()=>{S(a,l(s).reduce((k,y)=>Math.max(k,y.tokensSavedEst??0),0))}),Ve(),Ce();var u=Wl(),_=qe(u),v=b(_);{var x=k=>{var y=Tt("loading\\u2026");M(k,y)},h=k=>{var y=Tt();K(()=>O(y,(r(),$(()=>r().error)))),M(k,y)},A=k=>{var y=Tt();K(()=>O(y,\`\${l(o),$(()=>l(o).length)??""} session\${l(o),$(()=>l(o).length===1?"":"s")??""}\`)),M(k,y)};Ne(v,k=>{r(),l(o),$(()=>r().loading&&l(o).length===0)?k(x):(r(),$(()=>r().error)?k(h,1):k(A,-1))})}g(_);var B=w(_,2);{var L=k=>{var y=jl(),N=qe(y);ur(N,5,()=>l(s),ee=>ee.id,(ee,H)=>{var re=Ul(),V=b(re),ye=b(V,!0);g(V);var Ge=w(V,2),Zt=b(Ge);{var St=At=>{var gt=Vl();K(nn=>Bn(gt,\`width:max(3px,\${nn??""}%)\`),[()=>(l(H),$(()=>d(l(H).tokensSavedEst??0)))]),M(At,gt)},ze=go(()=>(l(H),$(()=>d(l(H).tokensSavedEst??0)>0)));Ne(Zt,At=>{l(ze)&&At(St)})}g(Ge);var Ue=w(Ge,2);let zt;var _r=b(Ue,!0);g(Ue),g(re),K((At,gt)=>{dr(V,"title",(l(H),$(()=>l(H).claudeCode?.projectPath||l(H).project||l(H).id))),O(ye,At),zt=Kt(Ue,1,"value svelte-c2rstm",null,zt,{neg:(l(H).tokensSavedEst??0)<0}),O(_r,gt)},[()=>(l(H),$(()=>c(l(H)))),()=>(l(H),$(()=>p(l(H).tokensSavedEst??0)))]),M(ee,re)}),g(N);var Y=w(N,2),X=b(Y);g(Y),K(()=>O(X,\`input tokens saved (cache-aware) \\xB7 top \${l(s),$(()=>l(s).length)??""} of \${l(o),$(()=>l(o).length)??""}\`)),M(k,y)},j=k=>{var y=Gl();M(k,y)};Ne(B,k=>{l(s),$(()=>l(s).length>0)?k(L):(r(),$(()=>!r().loading&&!r().error)&&k(j,1))})}M(e,u),fe(),i()}var Xl=z('requests 2xx / 4xx / 5xx compressed passthrough input tokens cache create cache read cache hit (tok) cache hit (ev) orig chars image bytes bytes/char latency p50/p95 first-byte p50/p95 ',1),Zl=z('
',1),Jl={hash:"svelte-1bksro2",code:".status.svelte-1bksro2 {margin-bottom:12px;color:#6e7681;font-size:12px;}table.svelte-1bksro2 {width:100%;border-collapse:collapse;font-size:12px;}td.svelte-1bksro2 {padding:6px 8px;border-bottom:1px solid #21262d;vertical-align:top;font-variant-numeric:tabular-nums;}td.svelte-1bksro2:last-child {border-bottom:none;}.num.svelte-1bksro2 {text-align:right;}"};function Uo(e,t){le(t,!1),Re(e,Jl);let r=()=>he(zn,"$stats",n),[n,i]=Ae(),o=D(),s=D(),a=D(),f=D(),c=D(),p=D();P(()=>r(),()=>{S(o,r().data)}),P(()=>l(o),()=>{S(s,l(o)?.error)}),P(()=>l(o),()=>{S(a,l(o)?.summary)}),P(()=>l(a),()=>{S(f,(()=>{if(!l(a))return"-";let y=(l(a).inputTokensTotal||0)+(l(a).cacheCreateTokensTotal||0)+(l(a).cacheReadTokensTotal||0);return y>0?(l(a).cacheReadTokensTotal/y*100).toFixed(1)+"%":"-"})())}),P(()=>l(a),()=>{S(c,l(a)&&l(a).eventsWithBaseline>0?(l(a).cacheHitEvents/l(a).eventsWithBaseline*100).toFixed(1)+"%":"-")}),P(()=>l(a),()=>{S(p,l(a)&&l(a).origCharsTotal>0?(l(a).imageBytesTotal/l(a).origCharsTotal*100).toFixed(3)+"x":"-")}),Ve(),Ce();var d=Zl(),u=qe(d),_=b(u);{var v=y=>{var N=Tt("loading\\u2026");M(y,N)},x=y=>{var N=Tt();K(()=>O(N,l(s))),M(y,N)},h=y=>{var N=Tt();K(Y=>O(N,\`\${Y??""} events parsed\`),[()=>(Q(F),l(o),$(()=>F(l(o).parsed)))]),M(y,N)},A=y=>{var N=Tt("-");M(y,N)};Ne(_,y=>{r(),l(o),$(()=>r().loading&&!l(o))?y(v):l(s)?y(x,1):l(o)?y(h,2):y(A,-1)})}g(u);var B=w(u,2),L=b(B),j=b(L);{var k=y=>{var N=Xl(),Y=qe(N),X=w(b(Y)),ee=b(X,!0);g(X),g(Y);var H=w(Y,2),re=w(b(H)),V=b(re);g(re),g(H);var ye=w(H,2),Ge=w(b(ye)),Zt=b(Ge,!0);g(Ge),g(ye);var St=w(ye,2),ze=w(b(St)),Ue=b(ze,!0);g(ze),g(St);var zt=w(St,2),_r=w(b(zt)),At=b(_r,!0);g(_r),g(zt);var gt=w(zt,2),nn=w(b(gt)),Us=b(nn,!0);g(nn),g(gt);var Yn=w(gt,2),Xo=w(b(Yn)),js=b(Xo,!0);g(Xo),g(Yn);var Hn=w(Yn,2),Zo=w(b(Hn)),Gs=b(Zo,!0);g(Zo),g(Hn);var Vn=w(Hn,2),Jo=w(b(Vn)),Ws=b(Jo,!0);g(Jo),g(Vn);var Un=w(Vn,2),Qo=w(b(Un)),Ks=b(Qo,!0);g(Qo),g(Un);var jn=w(Un,2),ei=w(b(jn)),Xs=b(ei,!0);g(ei),g(jn);var Gn=w(jn,2),ti=w(b(Gn)),Zs=b(ti,!0);g(ti),g(Gn);var Wn=w(Gn,2),ri=w(b(Wn)),Js=b(ri);g(ri),g(Wn);var ni=w(Wn,2),oi=w(b(ni)),Qs=b(oi);g(oi),g(ni),K((ea,ta,ra,na,oa,ia,sa,aa,la,fa,ca,ua,da,pa,_a)=>{O(ee,ea),O(V,\`\${ta??""} / \${ra??""} / \${na??""}\`),O(Zt,oa),O(Ue,ia),O(At,sa),O(Us,aa),O(js,la),O(Gs,l(f)),O(Ws,l(c)),O(Ks,fa),O(Xs,ca),O(Zs,l(p)),O(Js,\`\${ua??""} / \${da??""} ms\`),O(Qs,\`\${pa??""} / \${_a??""} ms\`)},[()=>(Q(F),l(a),$(()=>F(l(a).total))),()=>(Q(F),l(a),$(()=>F(l(a).ok2xx))),()=>(Q(F),l(a),$(()=>F(l(a).err4xx))),()=>(Q(F),l(a),$(()=>F(l(a).err5xx))),()=>(Q(F),l(a),$(()=>F(l(a).compressed))),()=>(Q(F),l(a),$(()=>F(l(a).passthrough))),()=>(Q(F),l(a),$(()=>F(l(a).inputTokensTotal))),()=>(Q(F),l(a),$(()=>F(l(a).cacheCreateTokensTotal))),()=>(Q(F),l(a),$(()=>F(l(a).cacheReadTokensTotal))),()=>(Q(F),l(a),$(()=>F(l(a).origCharsTotal))),()=>(Q(F),l(a),$(()=>F(l(a).imageBytesTotal))),()=>(Q(F),l(a),$(()=>F(l(a).durationP50))),()=>(Q(F),l(a),$(()=>F(l(a).durationP95))),()=>(Q(F),l(a),$(()=>F(l(a).firstBytemsP50))),()=>(Q(F),l(a),$(()=>F(l(a).firstBytemsP95)))]),M(y,N)};Ne(j,y=>{l(a)&&y(k)})}g(L),g(B),M(e,d),fe(),i()}var Ql=z(\`\`),rf=Y('
runtime kill switch \\xB7 not persisted across restart
',1),nf={hash:"svelte-1mocmsr",code:".banner.svelte-1mocmsr {display:inline-block;margin:8px 0;padding:10px 14px;background:#21262d;border:1px solid #f85149;border-radius:6px;color:#f85149;font-size:12px;}.toggle-wrap.svelte-1mocmsr {margin-bottom:14px;display:flex;align-items:center;gap:10px;}.toggle.svelte-1mocmsr {background:#21262d;color:#c9d1d9;border:1px solid #30363d;padding:6px 12px;cursor:pointer;border-radius:6px;font:inherit;font-size:12px;}.toggle.svelte-1mocmsr:disabled {opacity:0.5;cursor:wait;}.hint.svelte-1mocmsr {color:#6e7681;font-size:11px;}"};function Go(e,t){le(t,!1),Re(e,nf);let r=()=>he(vr,"$recent",n),[n,o]=Ae(),i=M(),s=M(!1);async function a(){if(l(s))return;let v=!l(i);if(!(!v&&!window.confirm(\`Disable compression? -/v1/messages will forward unchanged to upstream. Use this when upstream is unhealthy or to A/B test the proxy. Restart resets to enabled.\`))){S(s,!0);try{await qs(v),pr.run()}catch(x){rn.push({level:"error",text:"failed to toggle: "+x.message})}finally{S(s,!1)}}}P(()=>r(),()=>{S(o,r().data?.compression_enabled!==!1)}),Ve(),Ce();var f=ef(),c=qe(f);{var p=v=>{var x=Ql();M(v,x)};Ne(c,v=>{l(o)||v(p)})}var d=w(c,2),u=b(d),_=b(u,!0);g(u),Pr(2),g(d),K(()=>{u.disabled=l(s),O(_,l(s)?"loading\\u2026":l(o)?"Disable compression":"Enable compression")}),Bt("click",u,a),M(e,f),fe(),i()}var rf=z('
'),nf=z(\`
THIS SESSION \\u2014 saved of total bill - ( ) - \\xB7
\`),of={hash:"svelte-1pvo6o9",code:".line.svelte-1pvo6o9 {font-size:14px;color:#c9d1d9;margin-bottom:12px;padding:8px 12px;background:#161b22;border:1px solid #30363d;border-radius:6px;}.label.svelte-1pvo6o9 {font-weight:600;color:#8b949e;letter-spacing:0.04em;}.num.svelte-1pvo6o9 {font-variant-numeric:tabular-nums;color:#3fb950;font-weight:600;}.muted.svelte-1pvo6o9 {color:#6e7681;}"};function Go(e,t){le(t,!1),Re(e,of);let r=()=>he(Ys,"$currentSession",n),[n,i]=Ae(),o=D(),s=D(),a=D(),f=D(),c=D(),p=D(),d=D(),u=D(),_=D(),v=D(),x=D(),h=5,A=5;function B(N){return"$"+N.toFixed(2)}P(()=>r(),()=>{S(o,r().data)}),P(()=>r(),()=>{S(s,r().error)}),P(()=>l(o),()=>{S(a,l(o)?.baselineInputWeighted??0)}),P(()=>l(o),()=>{S(f,l(o)?.actualInputWeighted??0)}),P(()=>(l(a),l(f)),()=>{S(c,Math.max(0,l(a)-l(f)))}),P(()=>l(c),()=>{S(p,l(c)*h/1e6)}),P(()=>l(o),()=>{S(d,l(o)?.allActualInputWeighted??0)}),P(()=>l(o),()=>{S(u,l(o)?.allOutputWeighted??0)}),P(()=>(l(d),l(u)),()=>{S(_,l(d)*h/1e6+l(u)*A/1e6)}),P(()=>(l(_),l(p)),()=>{S(v,l(_)>0?l(p)/l(_)*100:0)}),P(()=>l(o),()=>{S(x,l(o)?.baselineMeasuredCount??0)}),Ve(),Ce();var L=Ro(),j=qe(L);{var k=N=>{var Y=rf(),X=b(Y);g(Y),K(()=>O(X,\`session: \${l(s)??""}\`)),M(N,Y)},y=N=>{var Y=nf(),X=w(b(Y),2),ee=b(X,!0);g(X);var H=w(X,2),re=b(H,!0);g(H);var V=w(H,2),ye=b(V);g(V);var Ge=w(V,2),Zt=b(Ge);g(Ge),g(Y),K((St,ze,Ue)=>{O(ee,St),O(re,ze),O(ye,\`\${Ue??""}%\`),O(Zt,\`\${l(x)??""} requests\`)},[()=>(l(p),$(()=>B(l(p)))),()=>(l(_),$(()=>B(l(_)))),()=>(l(v),$(()=>l(v).toFixed(1)))]),M(N,Y)};Ne(j,N=>{l(s)?N(k):l(x)>0&&N(y,1)})}M(e,L),fe(),i()}var sf=z('
'),af=z('
'),lf={hash:"svelte-1c4to2y",code:".tray.svelte-1c4to2y {position:fixed;bottom:16px;right:16px;display:flex;flex-direction:column;gap:8px;z-index:1000;pointer-events:none;}.toast.svelte-1c4to2y {background:#21262d;color:#c9d1d9;border:1px solid #30363d;border-radius:6px;padding:10px 14px;font-size:12px;box-shadow:0 4px 12px rgba(0, 0, 0, 0.4);display:flex;align-items:center;gap:12px;pointer-events:auto;max-width:360px;}.toast.error.svelte-1c4to2y {border-color:#f85149;color:#f85149;}.toast.warn.svelte-1c4to2y {border-color:#d29922;color:#d29922;}.toast.info.svelte-1c4to2y {border-color:#58a6ff;}button.svelte-1c4to2y {background:transparent;color:inherit;border:0;cursor:pointer;font-size:16px;line-height:1;padding:0;}"};function Wo(e,t){le(t,!1),Re(e,lf);let r=()=>he(rn,"$toasts",n),[n,i]=Ae();Ce();var o=af();ur(o,5,r,s=>s.id,(s,a)=>{var f=sf(),c=b(f),p=b(c,!0);g(c);var d=w(c,2);g(f),K(()=>{Kt(f,1,\`toast \${l(a),$(()=>l(a).level)??""}\`,"svelte-1c4to2y"),O(p,(l(a),$(()=>l(a).text)))}),Bt("click",d,()=>rn.dismiss(l(a).id)),M(s,f)}),g(o),M(e,o),fe(),i()}var ff=z('

pixelpipe

recent requests

latest rendered image

sessions (top savers)

stats (full history)

',1),cf={hash:"svelte-1bzzuab",code:\` +/v1/messages will forward unchanged to upstream. Use this when upstream is unhealthy or to A/B test the proxy. Restart resets to enabled.\`))){A(s,!0);try{await zs(v),vr.run()}catch(y){nn.push({level:"error",text:"failed to toggle: "+y.message})}finally{A(s,!1)}}}B(()=>r(),()=>{A(i,r().data?.compression_enabled!==!1)}),Ve(),Ce();var f=rf(),u=ze(f);{var p=v=>{var y=tf();O(v,y)};Ne(u,v=>{l(i)||v(p)})}var c=w(u,2),d=b(c),_=b(d,!0);g(d),qr(2),g(c),j(()=>{d.disabled=l(s),C(_,l(s)?"loading\\u2026":l(i)?"Disable compression":"Enable compression")}),Bt("click",d,a),O(e,f),fe(),o()}var of=Y('
'),sf=Y(\`
THIS SESSION \\u2014 saved ( of baseline) + \\u2014
\`),af={hash:"svelte-1pvo6o9",code:".line.svelte-1pvo6o9 {font-size:14px;color:#c9d1d9;margin-bottom:12px;padding:8px 12px;background:#161b22;border:1px solid #30363d;border-radius:6px;}.label.svelte-1pvo6o9 {font-weight:600;color:#8b949e;letter-spacing:0.04em;}.num.svelte-1pvo6o9 {font-variant-numeric:tabular-nums;color:#3fb950;font-weight:600;}.muted.svelte-1pvo6o9 {color:#6e7681;}"};function Wo(e,t){le(t,!1),Re(e,af);let r=()=>he(Hs,"$currentSession",n),[n,o]=Ae(),i=M(),s=M(),a=M(),f=M(),u=M(),p=M(),c=M(),d=M(),_=M(),v=5;function y(P){return"$"+P.toFixed(2)}B(()=>r(),()=>{A(i,r().data)}),B(()=>r(),()=>{A(s,r().error)}),B(()=>l(i),()=>{A(a,l(i)?.baselineInputWeighted??0)}),B(()=>l(i),()=>{A(f,l(i)?.actualInputWeighted??0)}),B(()=>(l(a),l(f)),()=>{A(u,Math.max(0,l(a)-l(f)))}),B(()=>l(u),()=>{A(p,l(u)*v/1e6)}),B(()=>l(a),()=>{A(c,l(a)*v/1e6)}),B(()=>(l(c),l(p)),()=>{A(d,l(c)>0?l(p)/l(c)*100:0)}),B(()=>l(i),()=>{A(_,l(i)?.baselineMeasuredCount??0)}),Ve(),Ce();var h=Ro(),S=ze(h);{var z=P=>{var T=of(),$=b(T);g(T),j(()=>C($,\`session: \${l(s)??""}\`)),O(P,T)},F=P=>{var T=sf(),$=w(b(T),2),D=b($,!0);g($);var G=w($,2),te=b(G);g(G);var X=w(G,2),H=b(X,!0);g(X);var re=w(X,2),W=b(re);g(re),g(T),j((ye,tt,er)=>{C(D,ye),C(te,\`\${tt??""}%\`),C(H,er),C(W,\`\${l(_)??""} requests\`)},[()=>(l(p),x(()=>y(l(p)))),()=>(l(d),x(()=>l(d).toFixed(1))),()=>(l(c),x(()=>y(l(c))))]),O(P,T)};Ne(S,P=>{l(s)?P(z):l(_)>0&&P(F,1)})}O(e,h),fe(),o()}var lf=Y('
'),ff=Y('
'),cf={hash:"svelte-1c4to2y",code:".tray.svelte-1c4to2y {position:fixed;bottom:16px;right:16px;display:flex;flex-direction:column;gap:8px;z-index:1000;pointer-events:none;}.toast.svelte-1c4to2y {background:#21262d;color:#c9d1d9;border:1px solid #30363d;border-radius:6px;padding:10px 14px;font-size:12px;box-shadow:0 4px 12px rgba(0, 0, 0, 0.4);display:flex;align-items:center;gap:12px;pointer-events:auto;max-width:360px;}.toast.error.svelte-1c4to2y {border-color:#f85149;color:#f85149;}.toast.warn.svelte-1c4to2y {border-color:#d29922;color:#d29922;}.toast.info.svelte-1c4to2y {border-color:#58a6ff;}button.svelte-1c4to2y {background:transparent;color:inherit;border:0;cursor:pointer;font-size:16px;line-height:1;padding:0;}"};function Ko(e,t){le(t,!1),Re(e,cf);let r=()=>he(nn,"$toasts",n),[n,o]=Ae();Ce();var i=ff();Zt(i,5,r,s=>s.id,(s,a)=>{var f=lf(),u=b(f),p=b(u,!0);g(u);var c=w(u,2);g(f),j(()=>{Jt(f,1,\`toast \${l(a),x(()=>l(a).level)??""}\`,"svelte-1c4to2y"),C(p,(l(a),x(()=>l(a).text)))}),Bt("click",c,()=>nn.dismiss(l(a).id)),O(s,f)}),g(i),O(e,i),fe(),o()}var uf=Y('

pixelpipe

recent requests

latest rendered image

sessions (top savers)

stats (full history)

',1),df={hash:"svelte-1bzzuab",code:\` /* Match the legacy dashboard 1:1 \\u2014 same fonts, colors, spacing. The page looks identical pre/post rewrite to keep visual regression cheap. */body {margin:0;padding:24px;background:#0d1117;color:#c9d1d9;font:14px/1.45 -apple-system, BlinkMacSystemFont, @@ -80,5 +80,5 @@ https://svelte.dev/e/state_proxy_unmount\`,Ct,Ot):console.warn("https://svelte.d 50% { opacity: 0.4; } - }\`};function Ko(e,t){le(t,!1),Re(e,cf);let r=()=>he(zn,"$stats",n),[n,i]=Ae(),o=D();function s(y){y=Math.floor(y);let N=Math.floor(y/3600),Y=Math.floor(y%3600/60),X=y%60;return(N?N+"h ":"")+(Y||N?Y+"m ":"")+X+"s"}P(()=>r(),()=>{S(o,r().data?\`port \${location.port||"80"} \\xB7 uptime \${s(r().data.uptime_sec)} \\xB7 live\`:r().error?"proxy unreachable":"connecting...")}),Ve(),Ce();var a=ff(),f=w(qe(a),2),c=b(f,!0);g(f);var p=w(f,2);jo(p,{});var d=w(p,2);Go(d,{});var u=w(d,2),_=b(u),v=w(b(_),2);Yo(v,{}),g(_);var x=w(_,2),h=w(b(x),2);Ho(h,{}),g(x),g(u);var A=w(u,2),B=w(b(A),2);Vo(B,{}),g(A);var L=w(A,2),j=w(b(L),2);Uo(j,{}),g(L);var k=w(L,2);Wo(k,{}),K(()=>O(c,l(o))),M(e,a),fe(),i()}var Vs=document.getElementById("app");Vs?Or(Ko,{target:Vs}):document.body.textContent="pixelpipe dashboard: mount target #app missing";})(); + }\`};function Xo(e,t){le(t,!1),Re(e,df);let r=()=>he(zn,"$stats",n),[n,o]=Ae(),i=M();function s($){$=Math.floor($);let D=Math.floor($/3600),G=Math.floor($%3600/60),te=$%60;return(D?D+"h ":"")+(G||D?G+"m ":"")+te+"s"}B(()=>r(),()=>{A(i,r().data?\`port \${location.port||"80"} \\xB7 uptime \${s(r().data.uptime_sec)} \\xB7 live\`:r().error?"proxy unreachable":"connecting...")}),Ve(),Ce();var a=uf(),f=w(ze(a),2),u=b(f,!0);g(f);var p=w(f,2);Go(p,{});var c=w(p,2);Wo(c,{});var d=w(c,2),_=b(d),v=w(b(_),2);Ho(v,{}),g(_);var y=w(_,2),h=w(b(y),2);Vo(h,{}),g(y),g(d);var S=w(d,2),z=w(b(S),2);Uo(z,{}),g(S);var F=w(S,2),P=w(b(F),2);jo(P,{}),g(F);var T=w(F,2);Ko(T,{}),j(()=>C(u,l(i))),O(e,a),fe(),o()}var Us=document.getElementById("app");Us?Or(Xo,{target:Us}):document.body.textContent="pixelpipe dashboard: mount target #app missing";})(); `; diff --git a/src/dashboard.ts b/src/dashboard.ts index de3a79a..8f079eb 100644 --- a/src/dashboard.ts +++ b/src/dashboard.ts @@ -109,6 +109,7 @@ export interface RecentRow { * request rendered no image, or once the image has been evicted from the * ring (the id stays on the row but no longer fetches). */ img_id?: number; + img_ids?: number[]; } /** Aggregate over the whole session. Reset on process restart unless @@ -367,33 +368,42 @@ export class DashboardState { this.ccMapFn = ccMapFn ?? (() => claudeCodeMap()); } - /** Stash a rendered image into the ring (called from onRequest with the raw - * ProxyEvent before info.firstImagePng is dropped by toTrackEvent). - * Returns the assigned image id, or undefined when there's no image — - * the caller stamps it onto the RecentRow as `img_id`. */ - captureImage(info: NonNullable): number | undefined { - if (!info.firstImagePng) return undefined; - const id = this.nextImageId++; - const width = info.firstImageWidth ?? 0; - const height = info.firstImageHeight ?? 0; - const kb = (info.firstImagePng.length / 1024).toFixed(1); - const meta = - `${width}×${height} · ${kb} KB · ` + - `${info.imageCount ?? 0} image${info.imageCount === 1 ? '' : 's'} total`; - this.images.push({ - id, - png: info.firstImagePng, - meta, - width, - height, - ts: Date.now() / 1000, - }); + /** Stash every rendered image into the ring (called from onRequest with the + * raw ProxyEvent before info.firstImagePng is dropped by toTrackEvent). + * Returns the assigned image ids in render order; empty array when there + * are no images. The caller stamps ids[0] onto the RecentRow as `img_id` + * for back-compat and the full list as `img_ids`. */ + captureImage(info: NonNullable): number[] { + const pngs = info.imagePngs ?? (info.firstImagePng ? [info.firstImagePng] : []); + if (pngs.length === 0) return []; + const dims = + info.imageDims ?? + (info.firstImagePng + ? [{ width: info.firstImageWidth ?? 0, height: info.firstImageHeight ?? 0 }] + : []); + const ids: number[] = []; + for (let i = 0; i < pngs.length; i++) { + const id = this.nextImageId++; + const width = dims[i]?.width ?? 0; + const height = dims[i]?.height ?? 0; + const kb = (pngs[i]!.length / 1024).toFixed(1); + const meta = `${width}×${height} · ${kb} KB · image ${i + 1}/${pngs.length}`; + this.images.push({ + id, + png: pngs[i]!, + meta, + width, + height, + ts: Date.now() / 1000, + }); + ids.push(id); + } // Evict the oldest entries past the cap. splice() keeps insertion order // so images[images.length - 1] is always the latest render. if (this.images.length > IMAGE_RING_CAP) { this.images.splice(0, this.images.length - IMAGE_RING_CAP); } - return id; + return ids; } /** Fold one event into the running totals + ring buffer. @@ -406,7 +416,8 @@ export class DashboardState { // Stash the image bytes before they get GC'd by the request finishing. // The returned id (if any) is stamped onto this request's RecentRow so // the dashboard can pull the exact image that request rendered. - const imgId = ev.info ? this.captureImage(ev.info) : undefined; + const imgIds = ev.info ? this.captureImage(ev.info) : []; + const imgId = imgIds[0]; const u = ev.usage; const info = ev.info; @@ -580,6 +591,7 @@ export class DashboardState { session_saved_so_far_delta: haveBaseline && haveUsage ? round1(baselineInputEff - actualInputEff) : undefined, img_id: imgId, + img_ids: imgIds, }; this.recent.push(row); if (this.recent.length > RECENT_CAP) this.recent.splice(0, this.recent.length - RECENT_CAP); diff --git a/src/dashboard/components/RecentRequests.svelte b/src/dashboard/components/RecentRequests.svelte index 0c44936..0420660 100644 --- a/src/dashboard/components/RecentRequests.svelte +++ b/src/dashboard/components/RecentRequests.svelte @@ -50,9 +50,17 @@ ? '+' + numFmt(e.session_saved_so_far_delta ?? 0) : '-'} - - {#if e.img_id != null} - + + {#if (e.img_ids && e.img_ids.length > 0) || e.img_id != null} + {@const ids = e.img_ids ?? (e.img_id != null ? [e.img_id] : [])} +
+ {#each ids as id} + + {/each} +
{:else} - {/if} @@ -108,16 +116,35 @@ .muted { color: #6e7681; } - .view-btn { - font-size: 11px; - background: #21262d; - color: #58a6ff; - border: 1px solid #30363d; - border-radius: 4px; - padding: 1px 6px; - cursor: pointer; + .thumb-strip { + display: flex; + gap: 3px; + align-items: center; + justify-content: flex-end; } - .view-btn:hover { - background: #30363d; + .thumb-btn { + padding: 0; + border: 1px solid #30363d; + border-radius: 3px; + background: #fff; + cursor: pointer; + line-height: 0; + } + .thumb-btn:hover, + .thumb-btn:focus-visible { + border-color: #58a6ff; + outline: none; + } + .thumb { + height: 28px; + width: auto; + max-width: 28px; + object-fit: cover; + object-position: top left; + display: block; + image-rendering: pixelated; + } + .img-cell { + text-align: right; } diff --git a/src/dashboard/components/SessionSummary.svelte b/src/dashboard/components/SessionSummary.svelte index 12bdf71..9c728d4 100644 --- a/src/dashboard/components/SessionSummary.svelte +++ b/src/dashboard/components/SessionSummary.svelte @@ -28,23 +28,20 @@ $: err = $currentSession.error; // backend exposes raw weighted tokens; convert to $ at Opus 4.x rates. - // These MUST stay in lockstep with the server-side constants - // `ASSUMED_INPUT_USD_PER_MTOK` and `OUTPUT_TOKEN_RATE` in src/dashboard.ts. + // These MUST stay in lockstep with the server-side constant + // `ASSUMED_INPUT_USD_PER_MTOK` in src/dashboard.ts. const INPUT_USD_PER_MTOK = 5.0; - const OUTPUT_TOKEN_RATE = 5.0; // Numerator: honest savings over the MEASURED slice. $: baselineTok = data?.baselineInputWeighted ?? 0; $: actualTok = data?.actualInputWeighted ?? 0; $: savedTok = Math.max(0, baselineTok - actualTok); $: savedUsd = (savedTok * INPUT_USD_PER_MTOK) / 1_000_000; - // Denominator: ALL-rows session bill ($) = input + output across every - // request the proxy saw this session, measured or not. - $: allActualTok = data?.allActualInputWeighted ?? 0; - $: allOutputTok = data?.allOutputWeighted ?? 0; - $: totalBillUsd = - (allActualTok * INPUT_USD_PER_MTOK) / 1_000_000 + - (allOutputTok * OUTPUT_TOKEN_RATE) / 1_000_000; - $: savedPct = totalBillUsd > 0 ? (savedUsd / totalBillUsd) * 100 : 0; + // Denominator: BASELINE input $ over the same MEASURED slice. The proxy + // only touches input tokens — output is identical with/without proxy — so + // scoping both sides of the ratio to baseline input $ on measured rows + // gives an apples-to-apples "what fraction of the baseline did we save". + $: baselineUsd = (baselineTok * INPUT_USD_PER_MTOK) / 1_000_000; + $: savedPct = baselineUsd > 0 ? (savedUsd / baselineUsd) * 100 : 0; $: measuredReqs = data?.baselineMeasuredCount ?? 0; function fmtUsd(n: number): string { @@ -58,9 +55,9 @@
THIS SESSION — saved {fmtUsd(savedUsd)} - of {fmtUsd(totalBillUsd)} total bill - ({savedPct.toFixed(1)}%) - · {measuredReqs} requests + ({savedPct.toFixed(1)}% of + {fmtUsd(baselineUsd)} baseline) + — {measuredReqs} requests
{/if} diff --git a/src/dashboard/types.ts b/src/dashboard/types.ts index f81eaa2..962ed71 100644 --- a/src/dashboard/types.ts +++ b/src/dashboard/types.ts @@ -86,6 +86,7 @@ export interface RecentRow { baseline_input?: number; session_saved_so_far_delta?: number; img_id?: number; + img_ids?: number[]; } /** /api/sessions.json payload — bulk session aggregate + selection table. */