Files
garage/backend/cmd/previewserver/web/assets/index-CyEkKMVz.js
T
2026-08-06 18:26:45 +12:00

12 lines
135 KiB
JavaScript

var ks=Object.defineProperty;var da=e=>{throw TypeError(e)};var Ss=(e,t,r)=>t in e?ks(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Ne=(e,t,r)=>Ss(e,typeof t!="symbol"?t+"":t,r),$n=(e,t,r)=>t.has(e)||da("Cannot "+r);var E=(e,t,r)=>($n(e,t,"read from private field"),r?r.call(e):t.get(e)),re=(e,t,r)=>t.has(e)?da("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ae=(e,t,r,n)=>($n(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),ge=(e,t,r)=>($n(e,t,"access private method"),r);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();const go=!1;var Wi=Array.isArray,Cs=Array.prototype.indexOf,Un=Array.prototype.includes,Qn=Array.from,po=Object.defineProperty,Xt=Object.getOwnPropertyDescriptor,mo=Object.getOwnPropertyDescriptors,As=Object.prototype,Ts=Array.prototype,Qi=Object.getPrototypeOf,va=Object.isExtensible;function rn(e){return typeof e=="function"}const $t=()=>{};function Is(e){return e()}function Mi(e){for(var t=0;t<e.length;t++)e[t]()}function _o(){var e,t,r=new Promise((n,i)=>{e=n,t=i});return{promise:r,resolve:e,reject:t}}const qe=2,Ur=4,Cn=8,bo=1<<24,mt=16,ft=32,jt=64,Pi=128,ct=512,Fe=1024,Le=2048,bt=4096,Ye=8192,nt=16384,Wr=32768,ha=1<<25,tr=65536,Hn=1<<17,Ms=1<<18,Qr=1<<19,yo=1<<20,kt=1<<25,pr=65536,zn=1<<21,Nr=1<<22,er=1<<23,Ft=Symbol("$state"),wo=Symbol("legacy props"),Ps=Symbol(""),Dn=Symbol("attributes"),Ri=Symbol("class"),Rs=Symbol("style"),on=Symbol("text"),Bn=Symbol("form reset"),An=new class extends Error{constructor(){super(...arguments);Ne(this,"name","StaleReactionError");Ne(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var fo;const Ns=!!((fo=globalThis.document)!=null&&fo.contentType)&&globalThis.document.contentType.includes("xml");function Ls(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Ds(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Bs(e,t,r){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Fs(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Os(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function qs(e){throw new Error("https://svelte.dev/e/effect_orphan")}function js(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Us(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Hs(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function zs(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Vs(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Ks(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Ys=1,Gs=2,xo=4,Js=8,Ws=16,Qs=1,Zs=2,Xs=4,$s=8,el=16,tl=1,rl=2,De=Symbol("uninitialized"),nl="http://www.w3.org/1999/xhtml";function il(){console.warn("https://svelte.dev/e/derived_inert")}function al(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function ol(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Eo(e){return e===this.v}function ko(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function So(e){return!ko(e,this.v)}let Zr=!1,sl=!1;function ll(){Zr=!0}let Te=null;function Hr(e){Te=e}function Se(e,t=!1,r){Te={p:Te,i:!1,c:null,e:null,s:e,x:null,r:ve,l:Zr&&!t?{s:null,u:null,$:[]}:null}}function Ce(e){var t=Te,r=t.e;if(r!==null){t.e=null;for(var n of r)Go(n)}return t.i=!0,Te=t.p,{}}function Tn(){return!Zr||Te!==null&&Te.l===null}let ar=[];function Co(){var e=ar;ar=[],Mi(e)}function St(e){if(ar.length===0&&!dn){var t=ar;queueMicrotask(()=>{t===ar&&Co()})}ar.push(e)}function ul(){for(;ar.length>0;)Co()}function Ao(e){var t=ve;if(t===null)return de.f|=er,e;if((t.f&Wr)===0&&(t.f&Ur)===0)throw e;Qt(e,t)}function Qt(e,t){if(!(t!==null&&(t.f&nt)!==0)){for(;t!==null;){if((t.f&Pi)!==0){if((t.f&Wr)===0)throw e;try{t.b.error(e);return}catch(r){e=r}}t=t.parent}throw e}}const cl=-7169;function Me(e,t){e.f=e.f&cl|t}function Zi(e){(e.f&ct)!==0||e.deps===null?Me(e,Fe):Me(e,bt)}function To(e){if(e!==null)for(const t of e)(t.f&qe)===0||(t.f&pr)===0||(t.f^=pr,To(t.deps))}function Io(e,t,r){(e.f&Le)!==0?t.add(e):(e.f&bt)!==0&&r.add(e),To(e.deps),Me(e,Fe)}function Mo(e,t,r){if(e==null)return t(void 0),$t;const n=ir(()=>e.subscribe(t,r));return n.unsubscribe?()=>n.unsubscribe():n}const Tr=[];function fl(e,t=$t){let r=null;const n=new Set;function i(s){if(ko(e,s)&&(e=s,r)){const u=!Tr.length;for(const c of n)c[1](),Tr.push(c,e);if(u){for(let c=0;c<Tr.length;c+=2)Tr[c][0](Tr[c+1]);Tr.length=0}}}function a(s){i(s(e))}function o(s,u=$t){const c=[s,u];return n.add(c),n.size===1&&(r=t(i,a)||$t),s(e),()=>{n.delete(c),n.size===0&&r&&(r(),r=null)}}return{set:i,update:a,subscribe:o}}function dl(e){let t;return Mo(e,r=>t=r)(),t}let Ni=!1,Rn=!1,Li=Symbol("unmounted");function vl(e,t,r){const n=r[t]??(r[t]={store:null,source:jo(void 0),unsubscribe:$t});if(n.store!==e&&!(Li in r))if(n.unsubscribe(),n.store=e??null,e==null)n.source.v=void 0,n.unsubscribe=$t;else{var i=!0;n.unsubscribe=Mo(e,a=>{i?n.source.v=a:v(n.source,a)}),i=!1}return e&&Li in r?dl(e):l(n.source)}function ga(e,t){return gl(e,t),t}function hl(){const e={};function t(){Zn(()=>{for(var r in e)e[r].unsubscribe();po(e,Li,{enumerable:!1,value:!0})})}return[e,t]}function gl(e,t){Ni=!0;try{e.set(t)}finally{Ni=!1}}function pl(e){var t=Rn;try{return Rn=!1,[e(),Rn]}finally{Rn=t}}function ml(e,t){{const r=document.body;e.autofocus=!0,St(()=>{document.activeElement===r&&e.focus()})}}let pa=!1;function _l(){pa||(pa=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const r of e.target.elements)(t=r[Bn])==null||t.call(r)})},{capture:!0}))}function Xr(e){var t=de,r=ve;dt(null),Tt(null);try{return e()}finally{dt(t),Tt(r)}}function Xi(e,t,r,n=r){e.addEventListener(t,()=>Xr(r));const i=e[Bn];i?e[Bn]=()=>{i(),n(!0)}:e[Bn]=()=>n(!0),_l()}function bl(e){let t=0,r=_r(0),n;return()=>{na()&&(l(r),ia(()=>(t===0&&(n=ir(()=>e(()=>vn(r)))),t+=1,()=>{St(()=>{t-=1,t===0&&(n==null||n(),n=void 0,vn(r))})})))}}var yl=tr|Qr;function wl(e,t,r,n){new xl(e,t,r,n)}var ot,Ji,st,lr,We,lt,Ke,tt,Nt,ur,Jt,Lr,mn,_n,Lt,Gn,ke,El,kl,Di,Sl,Bi,Fn,On,Fi,Oi;class xl{constructor(t,r,n,i){re(this,ke);Ne(this,"parent");Ne(this,"is_pending",!1);Ne(this,"transform_error");re(this,ot);re(this,Ji,null);re(this,st);re(this,lr);re(this,We);re(this,lt,null);re(this,Ke,null);re(this,tt,null);re(this,Nt,null);re(this,ur,0);re(this,Jt,0);re(this,Lr,!1);re(this,mn,new Set);re(this,_n,new Set);re(this,Lt,null);re(this,Gn,bl(()=>(ae(this,Lt,_r(E(this,ur))),()=>{ae(this,Lt,null)})));var a;ae(this,ot,t),ae(this,st,r),ae(this,lr,o=>{var s=ve;s.b=this,s.f|=Pi,n(o)}),this.parent=ve.b,this.transform_error=i??((a=this.parent)==null?void 0:a.transform_error)??(o=>o),ae(this,We,Mn(()=>{ge(this,ke,Bi).call(this)},yl))}defer_effect(t){Io(t,E(this,mn),E(this,_n))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!E(this,st).pending}update_pending_count(t,r){ge(this,ke,Fi).call(this,t,r),ae(this,ur,E(this,ur)+t),!(!E(this,Lt)||E(this,Lr))&&(ae(this,Lr,!0),St(()=>{ae(this,Lr,!1),E(this,Lt)&&Vr(E(this,Lt),E(this,ur))}))}get_effect_pending(){return E(this,Gn).call(this),l(E(this,Lt))}error(t){if(!E(this,st).onerror&&!E(this,st).failed)throw t;W!=null&&W.is_fork?(E(this,lt)&&W.skip_effect(E(this,lt)),E(this,Ke)&&W.skip_effect(E(this,Ke)),E(this,tt)&&W.skip_effect(E(this,tt)),W.oncommit(()=>{ge(this,ke,Oi).call(this,t)})):ge(this,ke,Oi).call(this,t)}}ot=new WeakMap,Ji=new WeakMap,st=new WeakMap,lr=new WeakMap,We=new WeakMap,lt=new WeakMap,Ke=new WeakMap,tt=new WeakMap,Nt=new WeakMap,ur=new WeakMap,Jt=new WeakMap,Lr=new WeakMap,mn=new WeakMap,_n=new WeakMap,Lt=new WeakMap,Gn=new WeakMap,ke=new WeakSet,El=function(){try{ae(this,lt,ut(()=>E(this,lr).call(this,E(this,ot))))}catch(t){this.error(t)}},kl=function(t){const r=E(this,st).failed,{reset:n,invoke_onerror:i}=ge(this,ke,Di).call(this,t);St(i),r&&ae(this,tt,ut(()=>{r(E(this,ot),()=>t,()=>n)}))},Di=function(t){var r=!1,n=!1;const i=()=>{if(r){ol();return}r=!0,n&&Ks(),E(this,tt)!==null&&hr(E(this,tt),()=>{ae(this,tt,null)}),ge(this,ke,On).call(this,()=>{ge(this,ke,Bi).call(this)})};return{reset:i,invoke_onerror:()=>{var o,s;try{n=!0,(s=(o=E(this,st)).onerror)==null||s.call(o,t,i),n=!1}catch(u){Qt(u,E(this,We)&&E(this,We).parent)}}}},Sl=function(){const t=E(this,st).pending;t&&(this.is_pending=!0,ae(this,Ke,ut(()=>t(E(this,ot)))),St(()=>{var r=ae(this,Nt,document.createDocumentFragment()),n=Ot();r.append(n),ae(this,lt,ge(this,ke,On).call(this,()=>ut(()=>E(this,lr).call(this,n)))),E(this,Jt)===0&&(E(this,ot).before(r),ae(this,Nt,null),hr(E(this,Ke),()=>{ae(this,Ke,null)}),ge(this,ke,Fn).call(this,W))}))},Bi=function(){try{if(this.is_pending=this.has_pending_snippet(),ae(this,Jt,0),ae(this,ur,0),ae(this,lt,ut(()=>{E(this,lr).call(this,E(this,ot))})),E(this,Jt)>0){var t=ae(this,Nt,document.createDocumentFragment());oa(E(this,lt),t);const r=E(this,st).pending;ae(this,Ke,ut(()=>r(E(this,ot))))}else ge(this,ke,Fn).call(this,W)}catch(r){this.error(r)}},Fn=function(t){this.is_pending=!1,t.transfer_effects(E(this,mn),E(this,_n))},On=function(t){var r=ve,n=de,i=Te;Tt(E(this,We)),dt(E(this,We)),Hr(E(this,We).ctx);try{return mr.ensure(),t()}catch(a){return Ao(a),null}finally{Tt(r),dt(n),Hr(i)}},Fi=function(t,r){var n;if(!this.has_pending_snippet()){this.parent&&ge(n=this.parent,ke,Fi).call(n,t,r);return}ae(this,Jt,E(this,Jt)+t),E(this,Jt)===0&&(ge(this,ke,Fn).call(this,r),E(this,Ke)&&hr(E(this,Ke),()=>{ae(this,Ke,null)}),E(this,Nt)&&(E(this,ot).before(E(this,Nt)),ae(this,Nt,null)))},Oi=function(t){E(this,lt)&&(Xe(E(this,lt)),ae(this,lt,null)),E(this,Ke)&&(Xe(E(this,Ke)),ae(this,Ke,null)),E(this,tt)&&(Xe(E(this,tt)),ae(this,tt,null));let r=E(this,st).failed;const n=i=>{const{reset:a,invoke_onerror:o}=ge(this,ke,Di).call(this,i);o(),r&&ae(this,tt,ge(this,ke,On).call(this,()=>{try{return ut(()=>{var s=ve;s.b=this,s.f|=Pi,r(E(this,ot),()=>i,()=>a)})}catch(s){return Qt(s,E(this,We).parent),null}}))};St(()=>{var i;try{i=this.transform_error(t)}catch(a){Qt(a,E(this,We)&&E(this,We).parent);return}i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(n,a=>Qt(a,E(this,We)&&E(this,We).parent)):n(i)})};function Cl(e,t,r,n){const i=Tn()?zr:$i;var a=e.filter(g=>!g.settled),o=t.map(i);if(r.length===0&&a.length===0){n(o);return}var s=ve,u=Al(),c=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(g=>g.promise)):null;function f(g){if((s.f&nt)===0){u();try{n([...o,...g])}catch(b){Qt(b,s)}Vn()}}var m=Po();if(r.length===0){c.then(()=>f([])).finally(m);return}function d(){Promise.all(r.map(g=>Tl(g))).then(f).catch(g=>Qt(g,s)).finally(m)}c?c.then(()=>{u(),d(),Vn()}):d()}function Al(){var e=ve,t=de,r=Te,n=W;return function(a=!0){Tt(e),dt(t),Hr(r),a&&(e.f&nt)===0&&(n==null||n.activate(),n==null||n.apply())}}function Vn(e=!0){Tt(null),dt(null),Hr(null),e&&(W==null||W.deactivate())}function Po(){var e=ve,t=e.b,r=W,n=!!(t!=null&&t.is_rendered());return t==null||t.update_pending_count(1,r),r.increment(n,e),()=>{t==null||t.update_pending_count(-1,r),r.decrement(n,e)}}function zr(e){var t=qe|Le;return ve!==null&&(ve.f|=Qr),{ctx:Te,deps:null,effects:null,equals:Eo,f:t,fn:e,reactions:null,rv:0,v:De,wv:0,parent:ve,ac:null}}const sn=Symbol("obsolete");function Tl(e,t,r){let n=ve;n===null&&Ds();var i=void 0,a=_r(De),o=!de,s=new Set;return Vl(()=>{var g,b;var u=ve,c=_o();i=c.promise;try{Promise.resolve(e()).then(c.resolve,C=>{C!==An&&c.reject(C)}).finally(Vn)}catch(C){c.reject(C),Vn()}var f=W;if(o){if((u.f&Wr)!==0)var m=Po();if((g=n.b)!=null&&g.is_rendered())(b=f.async_deriveds.get(u))==null||b.reject(sn);else for(const C of s.values())C.reject(sn);s.add(c),f.async_deriveds.set(u,c)}const d=(C,k=void 0)=>{m==null||m(),s.delete(c),k!==sn&&(f.activate(),k?(a.f|=er,Vr(a,k)):((a.f&er)!==0&&(a.f^=er),Vr(a,C)),f.deactivate())};c.promise.then(d,C=>d(null,C||"unknown"))}),Zn(()=>{for(const u of s)u.reject(sn)}),new Promise(u=>{function c(f){function m(){f===i?u(a):c(i)}f.then(m,m)}c(i)})}function Ct(e){const t=zr(e);return Xo(t),t}function $i(e){const t=zr(e);return t.equals=So,t}function Il(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)Xe(t[r])}}function ea(e){var t,r=ve,n=e.parent;if(!Ut&&n!==null&&e.v!==De&&(n.f&(nt|Ye))!==0)return il(),e.v;Tt(n);try{e.f&=~pr,Il(e),t=rs(e)}finally{Tt(r)}return t}function Ro(e){var t=ea(e);if(!e.equals(t)&&(e.wv=es(),(!(W!=null&&W.is_fork)||e.deps===null)&&(W!==null?(W.capture(e,t,!0),fn==null||fn.capture(e,t,!0)):e.v=t,e.deps===null))){Me(e,Fe);return}Ut||(je!==null?(na()||W!=null&&W.is_fork)&&je.set(e,t):Zi(e))}function Ml(e){var t;if(e.effects!==null)for(const r of e.effects)(r.teardown||r.ac)&&((t=r.teardown)==null||t.call(r),r.ac!==null&&Xr(()=>{r.ac.abort(An),r.ac=null}),r.fn!==null&&(r.teardown=$t),gn(r,0),aa(r))}function No(e){if(e.effects!==null)for(const t of e.effects)t.teardown&&t.fn!==null&&Yr(t)}let ei=null,Ir=null,W=null,fn=null,je=null,qi=null,dn=!1,ti=!1,Rr=null,qn=null;var ma=0;let Pl=1;var Dr,Wt,cr,Br,Fr,Or,Dt,qr,Qe,bn,Bt,gt,xt,jr,fr,we,ji,ln,Ui,Lo,Do,Pr,Rl,un;const Jn=class Jn{constructor(){re(this,we);Ne(this,"id",Pl++);re(this,Dr,!1);Ne(this,"linked",!0);re(this,Wt,null);re(this,cr,null);Ne(this,"async_deriveds",new Map);Ne(this,"current",new Map);Ne(this,"previous",new Map);re(this,Br,new Set);re(this,Fr,new Set);re(this,Or,0);re(this,Dt,new Map);re(this,qr,null);re(this,Qe,[]);re(this,bn,[]);re(this,Bt,new Set);re(this,gt,new Set);re(this,xt,new Map);re(this,jr,new Set);Ne(this,"is_fork",!1);re(this,fr,!1);Ir===null?ei=Ir=this:(ae(Ir,cr,this),ae(this,Wt,Ir)),Ir=this}skip_effect(t){E(this,xt).has(t)||E(this,xt).set(t,{d:[],m:[]}),E(this,jr).delete(t)}unskip_effect(t,r=n=>this.schedule(n)){var n=E(this,xt).get(t);if(n){E(this,xt).delete(t);for(var i of n.d)Me(i,Le),r(i);for(i of n.m)Me(i,bt),r(i)}E(this,jr).add(t)}capture(t,r,n=!1){t.v!==De&&!this.previous.has(t)&&this.previous.set(t,t.v),(t.f&er)===0&&(this.current.set(t,[r,n]),je==null||je.set(t,r)),this.is_fork||(t.v=r)}activate(){W=this}deactivate(){W=null,je=null}flush(){try{ti=!0,W=this,ge(this,we,ln).call(this)}finally{ma=0,qi=null,Rr=null,qn=null,ti=!1,W=null,je=null,vr.clear()}}discard(){var t;for(const r of E(this,Fr))r(this);E(this,Fr).clear();for(const r of this.async_deriveds.values())r.reject(sn);ge(this,we,un).call(this),(t=E(this,qr))==null||t.resolve()}register_created_effect(t){E(this,bn).push(t)}increment(t,r){if(ae(this,Or,E(this,Or)+1),t){let n=E(this,Dt).get(r)??0;E(this,Dt).set(r,n+1)}}decrement(t,r){if(ae(this,Or,E(this,Or)-1),t){let n=E(this,Dt).get(r)??0;n===1?E(this,Dt).delete(r):E(this,Dt).set(r,n-1)}E(this,fr)||(ae(this,fr,!0),St(()=>{ae(this,fr,!1),this.linked&&this.flush()}))}transfer_effects(t,r){for(const n of t)E(this,Bt).add(n);for(const n of r)E(this,gt).add(n);t.clear(),r.clear()}oncommit(t){E(this,Br).add(t)}ondiscard(t){E(this,Fr).add(t)}settled(){return(E(this,qr)??ae(this,qr,_o())).promise}static ensure(){if(W===null){const t=W=new Jn;!ti&&!dn&&St(()=>{E(t,Dr)||t.flush()})}return W}apply(){{je=null;return}}schedule(t){var i;if(qi=t,(i=t.b)!=null&&i.is_pending&&(t.f&(Ur|Cn|bo))!==0&&(t.f&Wr)===0){t.b.defer_effect(t);return}for(var r=t;r.parent!==null;){r=r.parent;var n=r.f;if(Rr!==null&&r===ve&&(de===null||(de.f&qe)===0)&&!Ni)return;if((n&(jt|ft))!==0){if((n&Fe)===0)return;r.f^=Fe}}E(this,Qe).push(r)}};Dr=new WeakMap,Wt=new WeakMap,cr=new WeakMap,Br=new WeakMap,Fr=new WeakMap,Or=new WeakMap,Dt=new WeakMap,qr=new WeakMap,Qe=new WeakMap,bn=new WeakMap,Bt=new WeakMap,gt=new WeakMap,xt=new WeakMap,jr=new WeakMap,fr=new WeakMap,we=new WeakSet,ji=function(){if(this.is_fork)return!0;for(const n of E(this,Dt).keys()){for(var t=n,r=!1;t.parent!==null;){if(E(this,xt).has(t)){r=!0;break}t=t.parent}if(!r)return!0}return!1},ln=function(){var u,c,f,m;ae(this,Dr,!0),ma++>1e3&&(ge(this,we,un).call(this),Ll());for(const d of E(this,Bt))E(this,gt).delete(d),Me(d,Le),this.schedule(d);for(const d of E(this,gt))Me(d,bt),this.schedule(d);const t=E(this,Qe);ae(this,Qe,[]),this.apply();var r=Rr=[],n=[],i=qn=[];for(const d of t)try{ge(this,we,Ui).call(this,d,r,n)}catch(g){throw Oo(d),ge(this,we,ji).call(this)||this.discard(),g}if(W=null,i.length>0){var a=Jn.ensure();for(const d of i)a.schedule(d)}if(Rr=null,qn=null,ge(this,we,ji).call(this)){ge(this,we,Pr).call(this,n),ge(this,we,Pr).call(this,r);for(const[d,g]of E(this,xt))Fo(d,g);i.length>0&&ge(u=W,we,ln).call(u);return}const o=ge(this,we,Lo).call(this);if(o){ge(this,we,Pr).call(this,n),ge(this,we,Pr).call(this,r),ge(c=o,we,Do).call(c,this);return}E(this,Bt).clear(),E(this,gt).clear();for(const d of E(this,Br))d(this);E(this,Br).clear(),fn=this,_a(n),_a(r),fn=null,(f=E(this,qr))==null||f.resolve();var s=W;if(E(this,Or)===0&&(E(this,Qe).length===0||s!==null)&&ge(this,we,un).call(this),E(this,Qe).length>0)if(s!==null){const d=s;E(d,Qe).push(...E(this,Qe).filter(g=>!E(d,Qe).includes(g)))}else s=this;s!==null&&ge(m=s,we,ln).call(m)},Ui=function(t,r,n){t.f^=Fe;for(var i=t.first;i!==null;){var a=i.f,o=(a&(ft|jt))!==0,s=o&&(a&Fe)!==0,u=s||(a&Ye)!==0||E(this,xt).has(i);if(!u&&i.fn!==null){o?i.f^=Fe:(a&Ur)!==0?r.push(i):Pn(i)&&((a&mt)!==0&&E(this,gt).add(i),Yr(i));var c=i.first;if(c!==null){i=c;continue}}for(;i!==null;){var f=i.next;if(f!==null){i=f;break}i=i.parent}}},Lo=function(){for(var t=E(this,Wt);t!==null;){if(!t.is_fork){for(const[r,[,n]]of this.current)if(t.current.has(r)&&!n)return t}t=E(t,Wt)}return null},Do=function(t){var n;for(const[i,a]of t.current)!this.previous.has(i)&&t.previous.has(i)&&this.previous.set(i,t.previous.get(i)),this.current.set(i,a);for(const[i,a]of t.async_deriveds){const o=this.async_deriveds.get(i);o&&a.promise.then(o.resolve).catch(o.reject)}t.async_deriveds.clear(),this.transfer_effects(E(t,Bt),E(t,gt));const r=i=>{var a=i.reactions;if(a!==null&&!((i.f&qe)!==0&&(i.f&(Le|bt))===0))for(const u of a){var o=u.f;if((o&qe)!==0)r(u);else{var s=u;o&(Nr|mt)&&!this.async_deriveds.has(s)&&(E(this,gt).delete(s),Me(s,Le),this.schedule(s))}}};for(const i of this.current.keys())r(i);this.oncommit(()=>t.discard()),ge(n=t,we,un).call(n),W=this,ge(this,we,ln).call(this)},Pr=function(t){for(var r=0;r<t.length;r+=1)Io(t[r],E(this,Bt),E(this,gt))},Rl=function(){var m;for(let d=ei;d!==null;d=E(d,cr)){var t=d.id<this.id,r=[];for(const[g,[b,C]]of this.current){if(d.current.has(g)){var n=d.current.get(g)[0];if(t&&b!==n)d.current.set(g,[b,C]);else continue}r.push(g)}if(t)for(const[g,b]of this.async_deriveds){const C=d.async_deriveds.get(g);C&&b.promise.then(C.resolve).catch(C.reject)}var i=[...d.current.keys()].filter(g=>!d.current.get(g)[1]);if(!(!E(d,Dr)||i.length===0)){var a=i.filter(g=>!this.current.has(g));if(a.length===0)t&&d.discard();else if(r.length>0){if(t)for(const g of E(this,jr))d.unskip_effect(g,b=>{var C;(b.f&(mt|Nr))!==0?d.schedule(b):ge(C=d,we,Pr).call(C,[b])});d.activate();var o=new Set,s=new Map;for(var u of r)Bo(u,a,o,s);s=new Map;var c=[...d.current].filter(([g,b])=>{const C=this.current.get(g);return C?C[0]!==b[0]||C[1]!==b[1]:!0}).map(([g])=>g);if(c.length>0)for(const g of E(this,bn))(g.f&(nt|Ye|Hn))===0&&ta(g,c,s)&&((g.f&(Nr|mt))!==0?(Me(g,Le),d.schedule(g)):E(d,Bt).add(g));if(E(d,Qe).length>0&&!E(d,fr)){d.apply();for(var f of E(d,Qe))ge(m=d,we,Ui).call(m,f,[],[]);ae(d,Qe,[])}d.deactivate()}}}},un=function(){if(this.linked){var t=E(this,Wt),r=E(this,cr);t===null?ei=r:ae(t,cr,r),r===null?Ir=t:ae(r,Wt,t),this.linked=!1}};let mr=Jn;function Nl(e){var t=dn;dn=!0;try{for(var r;;){if(ul(),W===null)return r;W.flush()}}finally{dn=t}}function Ll(){try{js()}catch(e){Qt(e,qi)}}let ht=null;function _a(e){var t=e.length;if(t!==0){for(var r=0;r<t;){var n=e[r++];if((n.f&(nt|Ye))===0&&Pn(n)&&(ht=new Set,Yr(n),n.deps===null&&n.first===null&&n.nodes===null&&n.teardown===null&&n.ac===null&&Wo(n),(ht==null?void 0:ht.size)>0)){vr.clear();for(const i of ht){if((i.f&(nt|Ye))!==0)continue;const a=[i];let o=i.parent;for(;o!==null;)ht.has(o)&&(ht.delete(o),a.push(o)),o=o.parent;for(let s=a.length-1;s>=0;s--){const u=a[s];(u.f&(nt|Ye))===0&&Yr(u)}}ht.clear()}}ht=null}}function Bo(e,t,r,n){if(!r.has(e)&&(r.add(e),e.reactions!==null))for(const i of e.reactions){const a=i.f;(a&qe)!==0?Bo(i,t,r,n):(a&(Nr|mt))!==0&&(a&Le)===0&&ta(i,t,n)&&(Me(i,Le),ra(i))}}function ta(e,t,r){const n=r.get(e);if(n!==void 0)return n;if(e.deps!==null)for(const i of e.deps){if(Un.call(t,i))return!0;if((i.f&qe)!==0&&ta(i,t,r))return r.set(i,!0),!0}return r.set(e,!1),!1}function ra(e){W.schedule(e)}function Fo(e,t){if(!((e.f&ft)!==0&&(e.f&Fe)!==0)){(e.f&Le)!==0?t.d.push(e):(e.f&bt)!==0&&t.m.push(e),Me(e,Fe);for(var r=e.first;r!==null;)Fo(r,t),r=r.next}}function Oo(e){Me(e,Fe);for(var t=e.first;t!==null;)Oo(t),t=t.next}let Kn=new Set;const vr=new Map;let qo=!1;function _r(e,t){var r={f:0,v:e,reactions:null,equals:Eo,rv:0,wv:0};return r}function B(e,t){const r=_r(e);return Xo(r),r}function jo(e,t=!1,r=!0){var i;const n=_r(e);return t||(n.equals=So),Zr&&r&&Te!==null&&Te.l!==null&&((i=Te.l).s??(i.s=[])).push(n),n}function v(e,t,r=!1){de!==null&&(!_t||(de.f&Hn)!==0)&&Tn()&&(de.f&(qe|mt|Nr|Hn))!==0&&(At===null||!At.has(e))&&Vs();let n=r?ne(t):t;return Vr(e,n,qn)}function Vr(e,t,r=null){if(!e.equals(t)){vr.set(e,Ut?t:e.v);var n=mr.ensure();if(n.capture(e,t),(e.f&qe)!==0){const i=e;(e.f&Le)!==0&&ea(i),je===null&&Zi(i)}e.wv=es(),Uo(e,Le,r),Tn()&&ve!==null&&(ve.f&Fe)!==0&&(ve.f&(ft|jt))===0&&(at===null?Gl([e]):at.push(e)),!n.is_fork&&Kn.size>0&&!qo&&Dl()}return t}function Dl(){qo=!1;for(const e of Kn){(e.f&Fe)!==0&&Me(e,bt);let t;try{t=Pn(e)}catch{t=!0}t&&Yr(e)}Kn.clear()}function vn(e){v(e,e.v+1)}function Uo(e,t,r){var n=e.reactions;if(n!==null)for(var i=Tn(),a=n.length,o=0;o<a;o++){var s=n[o],u=s.f;if(!(!i&&s===ve)){var c=(u&Le)===0;if(c&&Me(s,t),(u&Hn)!==0)Kn.add(s);else if((u&qe)!==0){var f=s;je==null||je.delete(f),(u&pr)===0&&(u&ct&&(ve===null||(ve.f&zn)===0)&&(s.f|=pr),Uo(f,bt,r))}else if(c){var m=s;(u&mt)!==0&&ht!==null&&ht.add(m),r!==null?r.push(m):ra(m)}}}}function ne(e){if(typeof e!="object"||e===null||Ft in e)return e;const t=Qi(e);if(t!==As&&t!==Ts)return e;var r=new Map,n=Wi(e),i=B(0),a=gr,o=s=>{if(gr===a)return s();var u=de,c=gr;dt(null),wa(a);var f=s();return dt(u),wa(c),f};return n&&r.set("length",B(e.length)),new Proxy(e,{defineProperty(s,u,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&Hs();var f=r.get(u);return f===void 0?o(()=>{var m=B(c.value);return r.set(u,m),m}):v(f,c.value,!0),!0},deleteProperty(s,u){var c=r.get(u);if(c===void 0){if(u in s){const f=o(()=>B(De));r.set(u,f),vn(i)}}else v(c,De),vn(i);return!0},get(s,u,c){var g;if(u===Ft)return e;var f=r.get(u),m=u in s;if(f===void 0&&(!m||(g=Xt(s,u))!=null&&g.writable)&&(f=o(()=>{var b=ne(m?s[u]:De),C=B(b);return C}),r.set(u,f)),f!==void 0){var d=l(f);return d===De?void 0:d}return Reflect.get(s,u,c)},getOwnPropertyDescriptor(s,u){var c=Reflect.getOwnPropertyDescriptor(s,u);if(c&&"value"in c){var f=r.get(u);f&&(c.value=l(f))}else if(c===void 0){var m=r.get(u),d=m==null?void 0:m.v;if(m!==void 0&&d!==De)return{enumerable:!0,configurable:!0,value:d,writable:!0}}return c},has(s,u){var d;if(u===Ft)return!0;var c=r.get(u),f=c!==void 0&&c.v!==De||Reflect.has(s,u);if(c!==void 0||ve!==null&&(!f||(d=Xt(s,u))!=null&&d.writable)){c===void 0&&(c=o(()=>{var g=f?ne(s[u]):De,b=B(g);return b}),r.set(u,c));var m=l(c);if(m===De)return!1}return f},set(s,u,c,f){var M;var m=r.get(u),d=u in s;if(n&&u==="length")for(var g=c;g<m.v;g+=1){var b=r.get(g+"");b!==void 0?v(b,De):g in s&&(b=o(()=>B(De)),r.set(g+"",b))}if(m===void 0)(!d||(M=Xt(s,u))!=null&&M.writable)&&(m=o(()=>B(void 0)),v(m,ne(c)),r.set(u,m));else{d=m.v!==De;var C=o(()=>ne(c));v(m,C)}var k=Reflect.getOwnPropertyDescriptor(s,u);if(k!=null&&k.set&&k.set.call(f,c),!d){if(n&&typeof u=="string"){var S=r.get("length"),I=Number(u);Number.isInteger(I)&&I>=S.v&&v(S,I+1)}vn(i)}return!0},ownKeys(s){l(i);var u=Reflect.ownKeys(s).filter(m=>{var d=r.get(m);return d===void 0||d.v!==De});for(var[c,f]of r)f.v!==De&&!(c in s)&&u.push(c);return u},setPrototypeOf(){zs()}})}function ba(e){try{if(e!==null&&typeof e=="object"&&Ft in e)return e[Ft]}catch{}return e}function Bl(e,t){return Object.is(ba(e),ba(t))}var Hi,Ho,zo,Vo;function Fl(){if(Hi===void 0){Hi=window,Ho=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;zo=Xt(t,"firstChild").get,Vo=Xt(t,"nextSibling").get,va(e)&&(e[Ri]=void 0,e[Dn]=null,e[Rs]=void 0,e.__e=void 0),va(r)&&(r[on]=void 0)}}function Ot(e=""){return document.createTextNode(e)}function Kr(e){return zo.call(e)}function In(e){return Vo.call(e)}function h(e,t){return Kr(e)}function Pe(e,t=!1){{var r=Kr(e);return r instanceof Comment&&r.data===""?In(r):r}}function _(e,t=1,r=!1){let n=e;for(;t--;)n=In(n);return n}function Ol(e){e.textContent=""}function Ko(){return!1}function ql(e,t,r){return r?document.createElement(e,{is:r}):document.createElement(e)}function Yo(e){ve===null&&(de===null&&qs(),Os()),Ut&&Fs()}function jl(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function Mt(e,t){var r=ve;r!==null&&(r.f&Ye)!==0&&(e|=Ye);var n={ctx:Te,deps:null,nodes:null,f:e|Le|ct,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};W==null||W.register_created_effect(n);var i=n;if((e&Ur)!==0)Rr!==null?Rr.push(n):mr.ensure().schedule(n);else if(t!==null){try{Yr(n)}catch(o){throw Xe(n),o}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&Qr)===0&&(i=i.first,(e&mt)!==0&&(e&tr)!==0&&i!==null&&(i.f|=tr))}if(i!==null&&(i.parent=r,r!==null&&jl(i,r),de!==null&&(de.f&qe)!==0&&(e&jt)===0)){var a=de;(a.effects??(a.effects=[])).push(i)}return n}function na(){return de!==null&&!_t}function Zn(e){const t=Mt(Cn,null);return Me(t,Fe),t.teardown=e,t}function it(e){Yo();var t=ve.f,r=!de&&(t&ft)!==0&&Te!==null&&!Te.i;if(r){var n=Te;(n.e??(n.e=[])).push(e)}else return Go(e)}function Go(e){return Mt(Ur|yo,e)}function Ul(e){return Yo(),Mt(Cn|yo,e)}function Hl(e){mr.ensure();const t=Mt(jt|Qr,e);return(r={})=>new Promise(n=>{r.outro?hr(t,()=>{Xe(t),n(void 0)}):(Xe(t),n(void 0))})}function zl(e){return Mt(Ur,e)}function Vl(e){return Mt(Nr|Qr,e)}function ia(e,t=0){return Mt(Cn|t,e)}function U(e,t=[],r=[],n=[]){Cl(n,t,r,i=>{Mt(Cn,()=>{e(...i.map(l))})})}function Mn(e,t=0){var r=Mt(mt|t,e);return r}function ut(e){return Mt(ft|Qr,e)}function Jo(e){var t=e.teardown;if(t!==null){const r=Ut,n=de;ya(!0),dt(null);try{t.call(null)}finally{ya(r),dt(n)}}}function aa(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){const i=r.ac;i!==null&&Xr(()=>{i.abort(An)});var n=r.next;(r.f&jt)!==0?r.parent=null:Xe(r,t),r=n}}function Kl(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&ft)===0&&Xe(t),t=r}}function Xe(e,t=!0){var r=!1;(t||(e.f&Ms)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(Yl(e.nodes.start,e.nodes.end),r=!0),e.f|=ha,aa(e,t&&!r),gn(e,0);var n=e.nodes&&e.nodes.t;if(n!==null)for(const a of n)a.stop();Jo(e),e.f^=ha,e.f|=nt;var i=e.parent;i!==null&&i.first!==null&&Wo(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Yl(e,t){for(;e!==null;){var r=e===t?null:In(e);e.remove(),e=r}}function Wo(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 hr(e,t,r=!0){var n=[];Qo(e,n,!0);var i=()=>{r&&Xe(e),t&&t()},a=n.length;if(a>0){var o=()=>--a||i();for(var s of n)s.out(o)}else i()}function Qo(e,t,r){if((e.f&Ye)===0){e.f^=Ye;var n=e.nodes&&e.nodes.t;if(n!==null)for(const s of n)(s.is_global||r)&&t.push(s);for(var i=e.first;i!==null;){var a=i.next;if((i.f&jt)===0){var o=(i.f&tr)!==0||(i.f&ft)!==0&&(e.f&mt)!==0;Qo(i,t,o?r:!1)}i=a}}}function Yn(e){Zo(e,!0)}function Zo(e,t){if((e.f&Ye)!==0){e.f^=Ye,(e.f&Fe)===0&&(Me(e,Le),mr.ensure().schedule(e));for(var r=e.first;r!==null;){var n=r.next,i=(r.f&tr)!==0||(r.f&ft)!==0;Zo(r,i?t:!1),r=n}var a=e.nodes&&e.nodes.t;if(a!==null)for(const o of a)(o.is_global||t)&&o.in()}}function oa(e,t){if(e.nodes)for(var r=e.nodes.start,n=e.nodes.end;r!==null;){var i=r===n?null:In(r);t.append(r),r=i}}let jn=!1,Ut=!1;function ya(e){Ut=e}let de=null,_t=!1;function dt(e){de=e}let ve=null;function Tt(e){ve=e}let At=null;function Xo(e){de!==null&&(At??(At=new Set)).add(e)}let Ze=null,et=0,at=null;function Gl(e){at=e}let $o=1,or=0,gr=or;function wa(e){gr=e}function es(){return++$o}function Pn(e){var t=e.f;if((t&Le)!==0)return!0;if(t&qe&&(e.f&=~pr),(t&bt)!==0){for(var r=e.deps,n=r.length,i=0;i<n;i++){var a=r[i];if(Pn(a)&&Ro(a),a.wv>e.wv)return!0}(t&ct)!==0&&je===null&&Me(e,Fe)}return!1}function ts(e,t,r=!0){var n=e.reactions;if(n!==null&&!(At!==null&&At.has(e)))for(var i=0;i<n.length;i++){var a=n[i];(a.f&qe)!==0?ts(a,t,!1):t===a&&(r?Me(a,Le):(a.f&Fe)!==0&&Me(a,bt),ra(a))}}function rs(e){var C;var t=Ze,r=et,n=at,i=de,a=At,o=Te,s=_t,u=gr,c=e.f;Ze=null,et=0,at=null,de=(c&(ft|jt))===0?e:null,At=null,Hr(e.ctx),_t=!1,gr=++or,e.ac!==null&&(Xr(()=>{e.ac.abort(An)}),e.ac=null);try{e.f|=zn;var f=e.fn,m=f();e.f|=Wr;var d=e.deps,g=W==null?void 0:W.is_fork;if(Ze!==null){var b;if(g||gn(e,et),d!==null&&et>0)for(d.length=et+Ze.length,b=0;b<Ze.length;b++)d[et+b]=Ze[b];else e.deps=d=Ze;if(na()&&(e.f&ct)!==0)for(b=et;b<d.length;b++)((C=d[b]).reactions??(C.reactions=[])).push(e)}else!g&&d!==null&&et<d.length&&(gn(e,et),d.length=et);if(Tn()&&at!==null&&!_t&&d!==null&&(e.f&(qe|bt|Le))===0)for(b=0;b<at.length;b++)ts(at[b],e);if(i!==null&&i!==e){if(or++,i.deps!==null)for(let k=0;k<r;k+=1)i.deps[k].rv=or;if(t!==null)for(const k of t)k.rv=or;at!==null&&(n===null?n=at:n.push(...at))}return(e.f&er)!==0&&(e.f^=er),m}catch(k){return Ao(k)}finally{e.f^=zn,Ze=t,et=r,at=n,de=i,At=a,Hr(o),_t=s,gr=u}}function Jl(e,t){let r=t.reactions;if(r!==null){var n=Cs.call(r,e);if(n!==-1){var i=r.length-1;i===0?r=t.reactions=null:(r[n]=r[i],r.pop())}}if(r===null&&(t.f&qe)!==0&&(Ze===null||!Un.call(Ze,t))){var a=t;(a.f&ct)!==0&&(a.f^=ct,a.f&=~pr),a.v!==De&&Zi(a),a.ac!==null&&Xr(()=>{a.ac.abort(An),a.ac=null,Me(a,Le)}),Ml(a),gn(a,0)}}function gn(e,t){var r=e.deps;if(r!==null)for(var n=t;n<r.length;n++)Jl(e,r[n])}function Yr(e){var t=e.f;if((t&nt)===0){Me(e,Fe);var r=ve,n=jn;ve=e,jn=(t&(ft|jt))===0;try{(t&(mt|bo))!==0?Kl(e):aa(e),Jo(e);var i=rs(e);e.teardown=typeof i=="function"?i:null,e.wv=$o;var a;go&&sl&&(e.f&Le)!==0&&e.deps}finally{jn=n,ve=r}}}async function sa(){await Promise.resolve(),Nl()}function l(e){var t=e.f,r=(t&qe)!==0;if(de!==null&&!_t){var n=ve!==null&&(ve.f&nt)!==0;if(!n&&(At===null||!At.has(e))){var i=de.deps;if((de.f&zn)!==0)e.rv<or&&(e.rv=or,Ze===null&&i!==null&&i[et]===e?et++:Ze===null?Ze=[e]:Ze.push(e));else{de.deps??(de.deps=[]),Un.call(de.deps,e)||de.deps.push(e);var a=e.reactions;a===null?e.reactions=[de]:Un.call(a,de)||a.push(de)}}}if(Ut&&vr.has(e))return vr.get(e);if(r){var o=e;if(Ut){var s=o.v;return((o.f&Fe)===0&&o.reactions!==null||is(o))&&(s=ea(o)),vr.set(o,s),s}var u=(o.f&ct)===0&&!_t&&de!==null&&(jn||(de.f&ct)!==0),c=(o.f&Wr)===0;Pn(o)&&(u&&(o.f|=ct),Ro(o)),u&&!c&&(No(o),ns(o))}if(je!=null&&je.has(e))return je.get(e);if((e.f&er)!==0)throw e.v;return e.v}function ns(e){if(e.f|=ct,e.deps!==null)for(const t of e.deps)(t.reactions??(t.reactions=[])).push(e),(t.f&qe)!==0&&(t.f&ct)===0&&(No(t),ns(t))}function is(e){if(e.v===De)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(vr.has(t)||(t.f&qe)!==0&&is(t))return!0;return!1}function ir(e){var t=_t;try{return _t=!0,e()}finally{_t=t}}function Wl(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(Ft in e)zi(e);else if(!Array.isArray(e))for(let t in e){const r=e[t];typeof r=="object"&&r&&Ft in r&&zi(r)}}}function zi(e,t=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let n in e)try{zi(e[n],t)}catch{}const r=Qi(e);if(r!==Object.prototype&&r!==Array.prototype&&r!==Map.prototype&&r!==Set.prototype&&r!==Date.prototype){const n=mo(r);for(let i in n){const a=n[i].get;if(a)try{a.call(e)}catch{}}}}}const Ql=["touchstart","touchmove"];function Zl(e){return Ql.includes(e)}const sr=Symbol("events"),as=new Set,Vi=new Set;function Xl(e,t,r,n={}){function i(a){if(n.capture||Ki.call(t,a),!a.cancelBubble)return Xr(()=>r==null?void 0:r.call(this,a))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?St(()=>{t.addEventListener(e,i,n)}):t.addEventListener(e,i,n),i}function br(e,t,r,n,i){var a={capture:n,passive:i},o=Xl(e,t,r,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Zn(()=>{t.removeEventListener(e,o,a)})}function se(e,t,r){(t[sr]??(t[sr]={}))[e]=r}function ze(e){for(var t=0;t<e.length;t++)as.add(e[t]);for(var r of Vi)r(e)}let xa=null;function Ki(e){var C,k;var t=this,r=t.ownerDocument,n=e.type,i=((C=e.composedPath)==null?void 0:C.call(e))||[],a=i[0]||e.target;xa=e;var o=0,s=xa===e&&e[sr];if(s){var u=i.indexOf(s);if(u!==-1&&(t===document||t===window)){e[sr]=t;return}var c=i.indexOf(t);if(c===-1)return;u<=c&&(o=u)}if(a=i[o]||e.target,a!==t){po(e,"currentTarget",{configurable:!0,get(){return a||r}});var f=de,m=ve;dt(null),Tt(null);try{for(var d,g=[];a!==null&&a!==t;){try{var b=(k=a[sr])==null?void 0:k[n];b!=null&&(!a.disabled||e.target===a)&&b.call(a,e)}catch(S){d?g.push(S):d=S}if(e.cancelBubble)break;o++,a=o<i.length?i[o]:null}if(d){for(let S of g)queueMicrotask(()=>{throw S});throw d}}finally{e[sr]=t,delete e.currentTarget,dt(f),Tt(m)}}}var vo;const ri=((vo=globalThis==null?void 0:globalThis.window)==null?void 0:vo.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function $l(e){return(ri==null?void 0:ri.createHTML(e))??e}function os(e){var t=ql("template");return t.innerHTML=$l(e.replaceAll("<!>","<!---->")),t.content}function pn(e,t){var r=ve;r.nodes===null&&(r.nodes={start:e,end:t,a:null,t:null})}function q(e,t){var r=(t&tl)!==0,n=(t&rl)!==0,i,a=!e.startsWith("<!>");return()=>{i===void 0&&(i=os(a?e:"<!>"+e),r||(i=Kr(i)));var o=n||Ho?document.importNode(i,!0):i.cloneNode(!0);if(r){var s=Kr(o),u=o.lastChild;pn(s,u)}else pn(o,o);return o}}function eu(e,t,r="svg"){var n=!e.startsWith("<!>"),i=`<${r}>${n?e:"<!>"+e}</${r}>`,a;return()=>{if(!a){var o=os(i),s=Kr(o);a=Kr(s)}var u=a.cloneNode(!0);return pn(u,u),u}}function ss(e,t){return eu(e,t,"svg")}function Gr(e=""){{var t=Ot(e+"");return pn(t,t),t}}function Zt(){var e=document.createDocumentFragment(),t=document.createComment(""),r=Ot();return e.append(t,r),pn(t,r),e}function L(e,t){e!==null&&e.before(t)}function z(e,t){var r=t==null?"":typeof t=="object"?`${t}`:t;r!==(e[on]??(e[on]=e.nodeValue))&&(e[on]=r,e.nodeValue=`${r}`)}function tu(e,t){return ru(e,t)}const Nn=new Map;function ru(e,{target:t,anchor:r,props:n={},events:i,context:a,intro:o=!0,transformError:s}){Fl();var u=void 0,c=Hl(()=>{var f=r??t.appendChild(Ot());wl(f,{pending:()=>{}},g=>{Se({});var b=Te;a&&(b.c=a),i&&(n.$$events=i),u=e(g,n)||{},Ce()},s);var m=new Set,d=g=>{for(var b=0;b<g.length;b++){var C=g[b];if(!m.has(C)){m.add(C);var k=Zl(C);for(const M of[t,document]){var S=Nn.get(M);S===void 0&&(S=new Map,Nn.set(M,S));var I=S.get(C);I===void 0?(M.addEventListener(C,Ki,{passive:k}),S.set(C,1)):S.set(C,I+1)}}}};return d(Qn(as)),Vi.add(d),()=>{var k;for(var g of m)for(const S of[t,document]){var b=Nn.get(S),C=b.get(g);--C==0?(S.removeEventListener(g,Ki),b.delete(g),b.size===0&&Nn.delete(S)):b.set(g,C)}Vi.delete(d),f!==r&&((k=f.parentNode)==null||k.removeChild(f))}});return nu.set(u,c),u}let nu=new WeakMap;var pt,Et,rt,dr,yn,wn,Wn;class la{constructor(t,r=!0){Ne(this,"anchor");re(this,pt,new Map);re(this,Et,new Map);re(this,rt,new Map);re(this,dr,new Set);re(this,yn,!0);re(this,wn,t=>{if(E(this,pt).has(t)){var r=E(this,pt).get(t),n=E(this,Et).get(r);if(n)Yn(n),E(this,dr).delete(r);else{var i=E(this,rt).get(r);i&&(Yn(i.effect),E(this,Et).set(r,i.effect),E(this,rt).delete(r),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),n=i.effect)}for(const[a,o]of E(this,pt)){if(E(this,pt).delete(a),a===t)break;const s=E(this,rt).get(o);s&&(Xe(s.effect),E(this,rt).delete(o))}for(const[a,o]of E(this,Et)){if(a===r||E(this,dr).has(a))continue;const s=()=>{if(Array.from(E(this,pt).values()).includes(a)){var c=document.createDocumentFragment();oa(o,c),c.append(Ot()),E(this,rt).set(a,{effect:o,fragment:c})}else Xe(o);E(this,dr).delete(a),E(this,Et).delete(a)};E(this,yn)||!n?(E(this,dr).add(a),hr(o,s,!1)):s()}}});re(this,Wn,t=>{E(this,pt).delete(t);const r=Array.from(E(this,pt).values());for(const[n,i]of E(this,rt))r.includes(n)||(Xe(i.effect),E(this,rt).delete(n))});this.anchor=t,ae(this,yn,r)}ensure(t,r){var n=W,i=Ko();if(r&&!E(this,Et).has(t)&&!E(this,rt).has(t))if(i){var a=document.createDocumentFragment(),o=Ot();a.append(o),E(this,rt).set(t,{effect:ut(()=>r(o)),fragment:a})}else E(this,Et).set(t,ut(()=>r(this.anchor)));if(E(this,pt).set(n,t),i){for(const[s,u]of E(this,Et))s===t?n.unskip_effect(u):n.skip_effect(u);for(const[s,u]of E(this,rt))s===t?n.unskip_effect(u.effect):n.skip_effect(u.effect);n.oncommit(E(this,wn)),n.ondiscard(E(this,Wn))}else E(this,wn).call(this,n)}}pt=new WeakMap,Et=new WeakMap,rt=new WeakMap,dr=new WeakMap,yn=new WeakMap,wn=new WeakMap,Wn=new WeakMap;function V(e,t,r=!1){var n=new la(e),i=r?tr:0;function a(o,s){n.ensure(o,s)}Mn(()=>{var o=!1;t((s,u=0)=>{o=!0,a(u,s)}),o||a(-1,null)},i)}function iu(e,t,r){for(var n=[],i=t.length,a,o=t.length,s=0;s<i;s++){let m=t[s];hr(m,()=>{if(a){if(a.pending.delete(m),a.done.add(m),a.pending.size===0){var d=e.outrogroups;Yi(e,Qn(a.done)),d.delete(a),d.size===0&&(e.outrogroups=null)}}else o-=1},!1)}if(o===0){var u=n.length===0&&r!==null;if(u){var c=r,f=c.parentNode;Ol(f),f.append(c),e.items.clear()}Yi(e,t,!u)}else a={pending:new Set(t),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(a)}function Yi(e,t,r=!0){var n;if(e.pending.size>0){n=new Set;for(const o of e.pending.values())for(const s of o)n.add(e.items.get(s).e)}for(var i=0;i<t.length;i++){var a=t[i];if(n!=null&&n.has(a)){a.f|=kt;const o=document.createDocumentFragment();oa(a,o)}else Xe(t[i],r)}}var Ea;function zt(e,t,r,n,i,a=null){var o=e,s=new Map,u=(t&xo)!==0;if(u){var c=e;o=c.appendChild(Ot())}var f=null,m=$i(()=>{var M=r();return Wi(M)?M:M==null?[]:Qn(M)}),d,g=new Map,b=!0;function C(M){(I.effect.f&nt)===0&&(I.pending.delete(M),I.fallback=f,au(I,d,o,t,n),f!==null&&(d.length===0?(f.f&kt)===0?Yn(f):(f.f^=kt,cn(f,null,o)):hr(f,()=>{f=null})))}function k(M){I.pending.delete(M)}var S=Mn(()=>{d=l(m);for(var M=d.length,R=new Set,A=W,p=Ko(),x=0;x<M;x+=1){var D=d[x],y=n(D,x),w=b?null:s.get(y);w?(w.v&&Vr(w.v,D),w.i&&Vr(w.i,x),p&&A.unskip_effect(w.e)):(w=ou(s,b?o:Ea??(Ea=Ot()),D,y,x,i,t,r),b||(w.e.f|=kt),s.set(y,w)),R.add(y)}if(M===0&&a&&!f&&(b?f=ut(()=>a(o)):(f=ut(()=>a(Ea??(Ea=Ot()))),f.f|=kt)),M>R.size&&Bs(),!b)if(g.set(A,R),p){for(const[T,N]of s)R.has(T)||A.skip_effect(N.e);A.oncommit(C),A.ondiscard(k)}else C(A);l(m)}),I={effect:S,items:s,pending:g,outrogroups:null,fallback:f};b=!1}function nn(e){for(;e!==null&&(e.f&ft)===0;)e=e.next;return e}function au(e,t,r,n,i){var w,T,N,F,P,H,G,Q,oe;var a=(n&Js)!==0,o=t.length,s=e.items,u=nn(e.effect.first),c,f=null,m,d=[],g=[],b,C,k,S;if(a)for(S=0;S<o;S+=1)b=t[S],C=i(b,S),k=s.get(C).e,(k.f&kt)===0&&((T=(w=k.nodes)==null?void 0:w.a)==null||T.measure(),(m??(m=new Set)).add(k));for(S=0;S<o;S+=1){if(b=t[S],C=i(b,S),k=s.get(C).e,e.outrogroups!==null)for(const X of e.outrogroups)X.pending.delete(k),X.done.delete(k);if((k.f&Ye)!==0&&(Yn(k),a&&((F=(N=k.nodes)==null?void 0:N.a)==null||F.unfix(),(m??(m=new Set)).delete(k))),(k.f&kt)!==0)if(k.f^=kt,k===u)cn(k,null,r);else{var I=f?f.next:u;k===e.effect.last&&(e.effect.last=k.prev),k.prev&&(k.prev.next=k.next),k.next&&(k.next.prev=k.prev),Yt(e,f,k),Yt(e,k,I),cn(k,I,r),f=k,d=[],g=[],u=nn(f.next);continue}if(k!==u){if(c!==void 0&&c.has(k)){if(d.length<g.length){var M=g[0],R;f=M.prev;var A=d[0],p=d[d.length-1];for(R=0;R<d.length;R+=1)cn(d[R],M,r);for(R=0;R<g.length;R+=1)c.delete(g[R]);Yt(e,A.prev,p.next),Yt(e,f,A),Yt(e,p,M),u=M,f=p,S-=1,d=[],g=[]}else c.delete(k),cn(k,u,r),Yt(e,k.prev,k.next),Yt(e,k,f===null?e.effect.first:f.next),Yt(e,f,k),f=k;continue}for(d=[],g=[];u!==null&&u!==k;)(c??(c=new Set)).add(u),g.push(u),u=nn(u.next);if(u===null)continue}(k.f&kt)===0&&d.push(k),f=k,u=nn(k.next)}if(e.outrogroups!==null){for(const X of e.outrogroups)X.pending.size===0&&(Yi(e,Qn(X.done)),(P=e.outrogroups)==null||P.delete(X));e.outrogroups.size===0&&(e.outrogroups=null)}if(u!==null||c!==void 0){var x=[];if(c!==void 0)for(k of c)(k.f&Ye)===0&&x.push(k);for(;u!==null;)(u.f&Ye)===0&&u!==e.fallback&&x.push(u),u=nn(u.next);var D=x.length;if(D>0){var y=(n&xo)!==0&&o===0?r:null;if(a){for(S=0;S<D;S+=1)(G=(H=x[S].nodes)==null?void 0:H.a)==null||G.measure();for(S=0;S<D;S+=1)(oe=(Q=x[S].nodes)==null?void 0:Q.a)==null||oe.fix()}iu(e,x,y)}}a&&St(()=>{var X,J;if(m!==void 0)for(k of m)(J=(X=k.nodes)==null?void 0:X.a)==null||J.apply()})}function ou(e,t,r,n,i,a,o,s){var u=(o&Ys)!==0?(o&Ws)===0?jo(r,!1,!1):_r(r):null,c=(o&Gs)!==0?_r(i):null;return{v:u,i:c,e:ut(()=>(a(t,u??r,c??i,s),()=>{e.delete(n)}))}}function cn(e,t,r){if(e.nodes)for(var n=e.nodes.start,i=e.nodes.end,a=t&&(t.f&kt)===0?t.nodes.start:r;n!==null;){var o=In(n);if(a.before(n),n===i)return;n=o}}function Yt(e,t,r){t===null?e.effect.first=r:t.next=r,r===null?e.effect.last=t:r.prev=t}function su(e,t,...r){var n=new la(e);Mn(()=>{const i=t()??null;n.ensure(i,i&&(a=>i(a,...r)))},tr)}function ka(e,t,r){var n=new la(e);Mn(()=>{var i=t()??null;n.ensure(i,i&&(a=>r(a,i)))},tr)}function ls(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=ls(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function lu(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=ls(e))&&(n&&(n+=" "),n+=t);return n}function j(e){return typeof e=="object"?lu(e):e??""}function uu(e,t,r){var n=e==null?"":""+e;return n===""?null:n}function O(e,t,r,n,i,a){var o=e[Ri];if(o!==r||o===void 0){var s=uu(r);s==null?e.removeAttribute("class"):t?e.className=s:e.setAttribute("class",s),e[Ri]=r}return a}function us(e,t,r=!1){if(e.multiple){if(t==null)return;if(!Wi(t))return al();for(var n of e.options)n.selected=t.includes(hn(n));return}for(n of e.options){var i=hn(n);if(Bl(i,t)){n.selected=!0;return}}(!r||t!==void 0)&&(e.selectedIndex=-1)}function cu(e){var t=new MutationObserver(()=>{"__value"in e&&us(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Zn(()=>{t.disconnect()})}function fu(e,t,r=t){var n=new WeakSet,i=!0;Xi(e,"change",a=>{var o=a?"[selected]":":checked",s;if(e.multiple)s=[].map.call(e.querySelectorAll(o),hn);else{var u=e.querySelector(o)??e.querySelector("option:not([disabled])");s=u&&hn(u)}r(s),e.__value=s,W!==null&&n.add(W)}),zl(()=>{var a=t();if(e===document.activeElement){var o=W;if(n.has(o))return}if(us(e,a,i),i&&a===void 0){var s=e.querySelector(":checked");s!==null&&(a=hn(s),r(a))}e.__value=a,i=!1}),cu(e)}function hn(e){return"__value"in e?e.__value:e.value}const du=Symbol("is custom element"),vu=Symbol("is html"),hu=Ns?"progress":"PROGRESS";function gu(e,t){var r=cs(e);r.value===(r.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!==hu)||(e.value=t??"")}function Ge(e,t,r,n){var i=cs(e);i[t]!==(i[t]=r)&&(t==="loading"&&(e[Ps]=r),r==null?e.removeAttribute(t):typeof r!="string"&&pu(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function cs(e){return e[Dn]??(e[Dn]={[du]:e.nodeName.includes("-"),[vu]:e.namespaceURI===nl})}var Sa=new Map;function pu(e){var t=e.getAttribute("is")||e.nodeName,r=Sa.get(t);if(r)return r;Sa.set(t,r=[]);for(var n,i=e,a=Element.prototype;a!==i;){n=mo(i);for(var o in n)n[o].set&&o!=="innerHTML"&&o!=="textContent"&&o!=="innerText"&&r.push(o);i=Qi(i)}return r}function Ee(e,t,r=t){var n=new WeakSet;Xi(e,"input",async i=>{var a=i?e.defaultValue:e.value;if(a=ni(e)?ii(a):a,r(a),W!==null&&n.add(W),await sa(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,u=e.value.length;if(e.value=a??"",s!==null){var c=e.value.length;o===s&&s===u&&c>u?(e.selectionStart=c,e.selectionEnd=c):(e.selectionStart=o,e.selectionEnd=Math.min(s,c))}}}),ir(t)==null&&e.value&&(r(ni(e)?ii(e.value):e.value),W!==null&&n.add(W)),ia(()=>{var i=t();if(e===document.activeElement){var a=W;if(n.has(a))return}ni(e)&&i===ii(e.value)||e.type==="date"&&!i&&!e.value||i!==e.value&&(e.value=i??"")})}function mu(e,t,r=t){Xi(e,"change",n=>{var i=n?e.defaultChecked:e.checked;r(i)}),ir(t)==null&&r(e.checked),ia(()=>{var n=t();e.checked=!!n})}function ni(e){var t=e.type;return t==="number"||t==="range"}function ii(e){return e===""?null:+e}function _u(e=!1){const t=Te,r=t.l.u;if(!r)return;let n=()=>Wl(t.s);if(e){let i=0,a={};const o=zr(()=>{let s=!1;const u=t.s;for(const c in u)u[c]!==a[c]&&(a[c]=u[c],s=!0);return s&&i++,i});n=()=>l(o)}r.b.length&&Ul(()=>{Ca(t,n),Mi(r.b)}),it(()=>{const i=ir(()=>r.m.map(Is));return()=>{for(const a of i)typeof a=="function"&&a()}}),r.a.length&&it(()=>{Ca(t,n),Mi(r.a)})}function Ca(e,t){if(e.l.s)for(const r of e.l.s)l(r);t()}const bu={get(e,t){let r=e.props.length;for(;r--;){let n=e.props[r];if(rn(n)&&(n=n()),typeof n=="object"&&n!==null&&t in n)return n[t]}},set(e,t,r){let n=e.props.length;for(;n--;){let i=e.props[n];rn(i)&&(i=i());const a=Xt(i,t);if(a&&a.set)return a.set(r),!0}return!1},getOwnPropertyDescriptor(e,t){let r=e.props.length;for(;r--;){let n=e.props[r];if(rn(n)&&(n=n()),typeof n=="object"&&n!==null&&t in n){const i=Xt(n,t);return i&&!i.configurable&&(i.configurable=!0),i}}},has(e,t){if(t===Ft||t===wo)return!1;for(let r of e.props)if(rn(r)&&(r=r()),r!=null&&t in r)return!0;return!1},ownKeys(e){const t=[];for(let r of e.props)if(rn(r)&&(r=r()),!!r){for(const n in r)t.includes(n)||t.push(n);for(const n of Object.getOwnPropertySymbols(r))t.includes(n)||t.push(n)}return t}};function Aa(...e){return new Proxy({props:e},bu)}function Be(e,t,r,n){var R;var i=!Zr||(r&Zs)!==0,a=(r&$s)!==0,o=(r&el)!==0,s=n,u=!0,c=void 0,f=()=>o&&i?(c??(c=zr(n)),l(c)):(u&&(u=!1,s=o?ir(n):n),s);let m;if(a){var d=Ft in e||wo in e;m=((R=Xt(e,t))==null?void 0:R.set)??(d&&t in e?A=>e[t]=A:void 0)}var g,b=!1;a?[g,b]=pl(()=>e[t]):g=e[t],g===void 0&&n!==void 0&&(g=f(),m&&(i&&Us(),m(g)));var C;if(i?C=()=>{var A=e[t];return A===void 0?f():(u=!0,A)}:C=()=>{var A=e[t];return A!==void 0&&(s=void 0),A===void 0?s:A},i&&(r&Xs)===0)return C;if(m){var k=e.$$legacy;return(function(A,p){return arguments.length>0?((!i||!p||k||b)&&m(p?C():A),A):C()})}var S=!1,I=((r&Qs)!==0?zr:$i)(()=>(S=!1,C()));a&&l(I);var M=ve;return(function(A,p){if(arguments.length>0){const x=p?l(I):i&&a?ne(A):A;return v(I,x),S=!0,s!==void 0&&(s=x),A}return Ut&&S||(M.f&nt)!==0?I.v:l(I)})}function fs(e){Te===null&&Ls(),Zr&&Te.l!==null?yu(Te).m.push(e):it(()=>{const t=ir(e);if(typeof t=="function")return t})}function yu(e){var t=e.l;return t.u??(t.u={a:[],b:[],m:[]})}const wu="5";var ho;typeof window<"u"&&((ho=window.__svelte??(window.__svelte={})).v??(ho.v=new Set)).add(wu);function Ta(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var r,n,i,a,o=[],s="",u=e.split("/");for(u[0]||u.shift();i=u.shift();)r=i[0],r==="*"?(o.push("wild"),s+="/(.*)"):r===":"?(n=i.indexOf("?",1),a=i.indexOf(".",1),o.push(i.substring(1,~n?n:~a?a:i.length)),s+=~n&&!~a?"(?:/([^/]+?))?":"/([^/]+?)",~a&&(s+=(~n?"?":"")+"\\"+i.substring(a))):s+="/"+i;return{keys:o,pattern:new RegExp("^"+s+"/?$","i")}}var xn,En,kn,Sn;class xu{constructor(){re(this,xn,B(Ia()));re(this,En,Ct(()=>this._loc.location));re(this,kn,Ct(()=>this._loc.querystring));re(this,Sn,B(void 0));typeof window<"u"?window.addEventListener("hashchange",()=>{this._loc=Ia()}):console.warn("[svelte-spa-router] window 'window' is not defined, skipping initiation")}get _loc(){return l(E(this,xn))}set _loc(t){v(E(this,xn),t)}get _location(){return l(E(this,En))}set _location(t){v(E(this,En),t)}get _querystring(){return l(E(this,kn))}set _querystring(t){v(E(this,kn),t)}get _params(){return l(E(this,Sn))}set _params(t){v(E(this,Sn),t)}get loc(){return this._loc}get location(){return this._location}get querystring(){return this._querystring}get params(){return this._params}}xn=new WeakMap,En=new WeakMap,kn=new WeakMap,Sn=new WeakMap;const ai=new xu;function Ia(){const e=typeof window<"u"?window.location.href:"",t=e.indexOf("#/");let r=t>-1?e.substr(t+1):"/";const n=r.indexOf("?");let i="";return n>-1&&(i=r.substr(n+1),r=r.substr(0,n)),{location:r,querystring:i}}async function ua(e){if(!e||e.length<1||e.charAt(0)!="/"&&e.indexOf("#/")!==0)throw Error("Invalid parameter location");await sa(),history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},""),window.location.hash=(e.charAt(0)=="#"?"":"#")+e}function Ma(e){e?window.scrollTo(e.__svelte_spa_router_scrollX||0,e.__svelte_spa_router_scrollY||0):window.scrollTo(0,0)}function Pa(e,t){Se(t,!0);const r=Be(t,"routes",19,()=>({})),n=Be(t,"prefix",3,""),i=Be(t,"restoreScrollState",3,!1),a=Be(t,"onConditionsFailed",3,()=>{}),o=Be(t,"onRouteLoaded",3,()=>{}),s=Be(t,"onRouteLoading",3,()=>{}),u=Be(t,"onRouteEvent",3,()=>{});class c{constructor(p,x){Ne(this,"path");Ne(this,"component");Ne(this,"conditions");Ne(this,"userData");Ne(this,"props");Ne(this,"_pattern");Ne(this,"_keys");const D=w=>typeof w=="object"&&w!==null&&w._sveltesparouter===!0;if(!x||typeof x!="function"&&!D(x))throw Error("Invalid component object");if(!p||typeof p=="string"&&(p.length<1||p.charAt(0)!="/"&&p.charAt(0)!="*")||typeof p=="object"&&!(p instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const y=Ta(p);if(this.path=p,D(x)){const w=x;this.component=w.component,this.conditions=w.conditions||[],this.userData=w.userData,this.props=w.props||{}}else{const w=x;this.component=()=>Promise.resolve(w),this.conditions=[],this.props={}}this._pattern=y.pattern,this._keys=y.keys}match(p){if(n()){if(typeof n()=="string")if(p.startsWith(n()))p=p.substr(n().length)||"/";else return null;else if(n()instanceof RegExp){const w=p.match(n());if(w&&w[0])p=p.substr(w[0].length)||"/";else return null}}const x=this._pattern.exec(p);if(x===null)return null;if(this._keys===!1)return x;const D={};let y=0;for(;y<this._keys.length;){try{D[this._keys[y]]=decodeURIComponent(x[y+1]||"")||null}catch{D[this._keys[y]]=null}y++}return D}async checkConditions(p){for(let x=0;x<this.conditions.length;x++)if(!await this.conditions[x](p))return!1;return!0}}const f=[];r()instanceof Map?r().forEach((A,p)=>{f.push(new c(p,A))}):Object.keys(r()).forEach(A=>{const p=r();f.push(new c(A,p[A]))});let m=B(null),d=B(null),g=B({}),b=null,C=null;it(()=>{history.scrollRestoration=i()?"manual":"auto"}),it(()=>{if(!i())return;const A=p=>{p.state&&(p.state.__svelte_spa_router_scrollY||p.state.__svelte_spa_router_scrollX)?b=p.state:b=null};return window.addEventListener("popstate",A),()=>window.removeEventListener("popstate",A)});async function k(A,p){await sa(),A(p)}it(()=>{const A=ai.loc;let p=!1;return ir(async()=>{let x=0;for(;x<f.length;){const D=f[x].match(A.location);if(!D){x++;continue}const y=S(D),w={route:f[x].path,location:A.location,querystring:A.querystring||"",userData:f[x].userData,params:y};if(!await f[x].checkConditions(w)){if(p)return;v(m,null),C=null,k(a(),w);return}if(p)return;k(s(),{...w});const T=f[x].component;if(C!=T){if(T.loading){v(m,T.loading),C=T,v(d,T.loadingParams||null),v(g,{});const P=T.loading;k(o(),{...w,component:P,name:P.name,params:T.loadingParams||null})}else v(m,null),C=null;const F=await T();if(p)return;v(m,F&&typeof F=="object"&&"default"in F?F.default:F),C=T}v(d,y),v(g,f[x].props);const N=l(m);N&&k(o(),{...w,component:N,name:N.name,params:y}),ai._params=y,i()&&(Ma(b),b=null);return}v(m,null),C=null,ai._params=void 0,i()&&(Ma(b),b=null)}),()=>{p=!0}});function S(A){return A&&typeof A=="object"&&Object.keys(A).length?A:null}var I=Zt(),M=Pe(I);{var R=A=>{const p=Ct(()=>l(m));var x=Zt(),D=Pe(x);{var y=T=>{var N=Zt(),F=Pe(N);ka(F,()=>l(p),(P,H)=>{H(P,Aa({get params(){return l(d)},get onRouteEvent(){return u()}},()=>l(g)))}),L(T,N)},w=T=>{var N=Zt(),F=Pe(N);ka(F,()=>l(p),(P,H)=>{H(P,Aa({get onRouteEvent(){return u()}},()=>l(g)))}),L(T,N)};V(D,T=>{l(d)?T(y):T(w,-1)})}L(A,x)};V(M,A=>{l(m)&&A(R)})}L(e,I),Ce()}const yr="/api";async function $r(e){if(e.status===204)return null;const r=(e.headers.get("content-type")||"").includes("application/json")?await e.json():await e.text();if(!e.ok){const n=r&&r.error||e.statusText;throw new Error(n)}return r}function He(e){return fetch(yr+e).then($r)}function wr(e,t){return fetch(yr+e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then($r)}function en(e,t){return fetch(yr+e,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then($r)}function Eu(e,t){return fetch(yr+e,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then($r)}function xr(e){return fetch(yr+e,{method:"DELETE"}).then($r)}function ds(e,t){const r=new FormData;return r.append("file",t),fetch(yr+e,{method:"POST",body:r}).then($r)}function Jr(e){return yr+e}const oi=fl(null);ll();var ku=q('<div class="flex min-h-screen items-center justify-center bg-stone-100" style="background-image: repeating-linear-gradient(135deg, transparent, transparent 22px, rgba(0,0,0,0.025) 22px, rgba(0,0,0,0.025) 24px);"><div class="mx-4 w-full max-w-sm rounded-lg border border-stone-200 bg-white p-8 text-center shadow-sm"><div class="mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-lg bg-teal-700 text-2xl shadow-sm shadow-teal-900/30">🔧</div> <h1 class="text-xl font-semibold tracking-tight text-stone-900">My Garage</h1> <p class="mt-1.5 text-sm text-stone-500">Service history, rego &amp; WoF reminders, and a knowledgebase for every car you own.</p> <a href="/api/auth/login" class="mt-6 inline-flex w-full items-center justify-center gap-1.5 rounded-lg bg-teal-700 px-5 py-2.5 text-sm font-medium text-white shadow-sm shadow-teal-900/20 transition-colors hover:bg-teal-600">Log in</a></div></div>');function Su(e){var t=ku();L(e,t)}var Cu=q("<span> </span>");function ca(e,t){let r=Be(t,"size",3,"md");const n={sm:"px-2 py-0.5 text-xs tracking-wider",md:"px-3 py-1 text-base tracking-widest",lg:"px-4 py-2 text-2xl tracking-widest"};var i=Cu(),a=h(i);U(()=>{O(i,1,`inline-block rounded border-2 border-stone-900 bg-gradient-to-b from-white to-stone-100 font-mono font-bold text-stone-900 shadow-sm ${n[r()]??""}`),z(a,t.rego)}),L(e,i)}function It(e){return e?new Date(e).toLocaleDateString("en-NZ",{day:"numeric",month:"short",year:"numeric"}):"—"}function Gi(e){if(!e)return null;const t=new Date;t.setHours(0,0,0,0);const r=new Date(e);return r.setHours(0,0,0,0),Math.round((r-t)/864e5)}const Au={service:"Service",wheel_rotation:"Wheel rotation",alignment:"Alignment",rego:"Rego",wof:"WoF",custom:"Custom"};function Tu(e){const t=e.kind??e.reminderType;return t==="custom"&&e.label?e.label:Au[t]||t}const Ht="inline-flex items-center justify-center gap-1.5 rounded-lg bg-teal-700 px-4 py-2 text-sm font-medium text-white shadow-sm shadow-teal-900/20 hover:bg-teal-600 active:bg-teal-800 disabled:opacity-50 disabled:pointer-events-none transition-colors",rr="inline-flex items-center justify-center gap-1.5 rounded-lg border border-stone-300 bg-white px-4 py-2 text-sm font-medium text-stone-700 hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none transition-colors",vs="inline-flex items-center justify-center gap-1.5 rounded-lg border border-red-200 px-4 py-2 text-sm font-medium text-red-600 hover:bg-red-50 transition-colors",nr="inline-flex items-center gap-1 rounded-md px-2 py-1 text-sm font-medium text-teal-600 hover:bg-teal-50 transition-colors",qt="inline-flex items-center justify-center rounded-md p-1.5 text-stone-400 hover:bg-stone-100 hover:text-stone-700 transition-colors",Xn="rounded-lg border border-stone-200 bg-white shadow-sm",hs="rounded-lg border border-stone-200 border-t-4 border-t-teal-700 bg-white shadow-sm p-5",be="w-full rounded-lg border border-stone-300 bg-white px-3 py-2 text-sm text-stone-900 placeholder-stone-400 focus:outline-none focus:ring-2 focus:ring-teal-500/40 focus:border-teal-500 transition-shadow",ye="mb-1 block text-sm font-medium text-stone-700",Iu="text-sm font-semibold uppercase tracking-wide text-stone-500";var Mu=ss('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path></path><circle cx="12" cy="13" r="3.2"></circle></svg>'),Pu=ss('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path></path></svg>');function _e(e,t){let r=Be(t,"class",3,"w-4 h-4");const n={plus:"M12 5v14M5 12h14",pencil:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z",trash:"M4 7h16M9 7V5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2m-8 0v12a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V7",x:"M6 6l12 12M18 6L6 18",check:"M5 13l4 4L19 7",chevronDown:"M6 9l6 6 6-6",chevronRight:"M9 6l6 6-6 6",paperclip:"M8 12.5l6.5-6.5a3 3 0 1 1 4.24 4.24l-8.5 8.5a5 5 0 1 1-7.07-7.07L11 3.84",bookOpen:"M12 6c-1.5-1.2-4-2-7-2v13c3 0 5.5.8 7 2m0-13c1.5-1.2 4-2 7-2v13c-3 0-5.5.8-7 2m0-13v13",undo:"M9 14l-4-4 4-4M5 10h9a5 5 0 0 1 0 10h-1",share:"M12 15V3m0 0 4 4m-4-4-4 4M5 13v6a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6",fuel:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-9 4-4"},i="M4 8a2 2 0 0 1 2-2h1.5l1-1.5h5l1 1.5H17a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8z";var a=Zt(),o=Pe(a);{var s=c=>{var f=Mu(),m=h(f);Ge(m,"d",i),U(()=>O(f,0,j(r()))),L(c,f)},u=c=>{var f=Pu(),m=h(f);U(()=>{O(f,0,j(r())),Ge(m,"d",n[t.name]??"")}),L(c,f)};V(o,c=>{t.name==="camera"?c(s):c(u,-1)})}L(e,a)}var Ru=q('<div class="flex shrink-0 gap-1"><button aria-label="Edit entry"><!></button> <button aria-label="Delete entry"><!></button></div>'),Nu=q('<p class="mt-1.5 whitespace-pre-wrap text-sm text-stone-700"> </p>'),Lu=q('<a target="_blank" rel="noopener" class="inline-flex items-center gap-1 rounded-md border border-stone-200 px-2 py-1 text-xs text-stone-600 hover:bg-stone-50"><!> </a>'),Du=q('<div class="mt-2 flex flex-wrap gap-2"></div>'),Bu=q('<div class="flex items-start justify-between gap-2"><div><p class="text-xs text-stone-400"> </p> <p class="font-medium text-stone-900"> </p> <p class="text-sm text-stone-500"><!> <!></p></div> <!></div> <!> <!>',1);function Fu(e,t){Se(t,!0);let r=Be(t,"fileHref",3,A=>Jr(`/files/${A.id}`));var n=Bu(),i=Pe(n),a=h(i),o=h(a),s=h(o),u=_(o,2),c=h(u),f=_(u,2),m=h(f);{var d=A=>{var p=Gr();U(()=>z(p,t.entry.performedAt)),L(A,p)};V(m,A=>{t.entry.performedAt&&A(d)})}var g=_(m,2);{var b=A=>{var p=Gr();U(x=>z(p,`${t.entry.performedAt?" · ":""}${x??""} km`),[()=>t.entry.odometer.toLocaleString()]),L(A,p)};V(g,A=>{t.entry.odometer&&A(b)})}var C=_(a,2);{var k=A=>{var p=Ru(),x=h(p),D=h(x);_e(D,{name:"pencil",class:"h-4 w-4"});var y=_(x,2),w=h(y);_e(w,{name:"trash",class:"h-4 w-4"}),U(()=>{O(x,1,j(qt)),O(y,1,`${qt} hover:text-red-600`)}),se("click",x,()=>{var T;return(T=t.onEdit)==null?void 0:T.call(t,t.entry)}),se("click",y,()=>{var T;return(T=t.onDelete)==null?void 0:T.call(t,t.entry)}),L(A,p)};V(C,A=>{(t.onEdit||t.onDelete)&&A(k)})}var S=_(i,2);{var I=A=>{var p=Nu(),x=h(p);U(()=>z(x,t.entry.description)),L(A,p)};V(S,A=>{t.entry.description&&A(I)})}var M=_(S,2);{var R=A=>{var p=Du();zt(p,21,()=>t.entry.files,x=>x.id,(x,D)=>{var y=Lu(),w=h(y);_e(w,{name:"paperclip",class:"h-3.5 w-3.5"});var T=_(w);U(N=>{Ge(y,"href",N),z(T,` ${l(D).fileName??""}`)},[()=>r()(l(D))]),L(x,y)}),L(A,p)};V(M,A=>{var p;(p=t.entry.files)!=null&&p.length&&A(R)})}U(A=>{z(s,A),z(c,t.entry.entryType)},[()=>It(t.entry.entryDate)]),L(e,n),Ce()}ze(["click"]);var Ou=q('<p class="text-sm text-stone-400">No service history yet.</p>'),qu=q('<span class="w-px flex-1 bg-stone-200"></span>'),ju=q('<li class="flex gap-4"><div class="flex w-2.5 shrink-0 flex-col items-center"><span class="mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-teal-700"></span> <!></div> <div class="min-w-0 flex-1 pb-6"><!></div></li>'),Uu=q("<ol></ol>");function gs(e,t){Se(t,!0);var r=Zt(),n=Pe(r);{var i=o=>{var s=Ou();L(o,s)},a=o=>{var s=Uu();zt(s,23,()=>t.entries,u=>u.id,(u,c,f)=>{var m=ju(),d=h(m),g=_(h(d),2);{var b=S=>{var I=qu();L(S,I)};V(g,S=>{l(f)<t.entries.length-1&&S(b)})}var C=_(d,2),k=h(C);Fu(k,{get entry(){return l(c)},get onEdit(){return t.onEdit},get onDelete(){return t.onDelete},get fileHref(){return t.fileHref}}),L(u,m)}),L(o,s)};V(n,o=>{t.entries.length===0?o(i):o(a,-1)})}L(e,r),Ce()}var Hu=q('<p class="text-sm text-stone-400">Loading…</p>'),zu=q('<p class="text-sm text-red-600"> </p>'),Vu=q('<img class="h-20 w-28 rounded-lg border border-stone-200 object-cover"/>'),Ku=q("<button>Load more</button>"),Yu=q('<div class="mb-6 flex items-center gap-4"><!> <div><!> <p class="mt-1 text-sm text-stone-500"> </p></div></div> <h2 class="mb-3 text-sm font-semibold uppercase tracking-wide text-stone-500">Service history</h2> <div class="rounded-lg border border-t-4 border-stone-200 border-t-teal-700 bg-white p-5 shadow-sm"><!> <!></div>',1),Gu=q('<div class="min-h-screen bg-stone-50"><div class="h-1.5 bg-teal-700"></div> <header class="border-b border-stone-200 bg-white/90 px-4 py-3"><div class="mx-auto flex max-w-2xl items-center gap-2"><span class="flex h-7 w-7 items-center justify-center rounded-lg bg-teal-700 text-sm">🔧</span> <span class="font-semibold text-stone-900">My Garage</span> <span class="text-sm text-stone-400">· shared service history</span></div></header> <main class="mx-auto max-w-2xl px-4 py-6"><!></main></div>');function Ju(e,t){Se(t,!0);const r=t.params.token;let n=B(null),i=B(ne([])),a=B(!1),o=B(!0),s=B("");async function u(){try{v(n,await He(`/public/cars/${r}`),!0);const S=await He(`/public/cars/${r}/service-entries?limit=20&offset=0`);v(i,S.items,!0),v(a,S.hasMore,!0)}catch{v(s,"This share link is invalid, or sharing has been turned off.")}finally{v(o,!1)}}u();async function c(){const S=await He(`/public/cars/${r}/service-entries?limit=20&offset=${l(i).length}`);v(i,[...l(i),...S.items],!0),v(a,S.hasMore,!0)}const f=S=>Jr(`/public/cars/${r}/files/${S.id}`);var m=Gu(),d=_(h(m),4),g=h(d);{var b=S=>{var I=Hu();L(S,I)},C=S=>{var I=zu(),M=h(I);U(()=>z(M,l(s))),L(S,I)},k=S=>{var I=Yu(),M=Pe(I),R=h(M);{var A=P=>{var H=Vu();U(G=>{Ge(H,"src",G),Ge(H,"alt",l(n).rego)},[()=>Jr(`/public/cars/${r}/photo`)]),L(P,H)};V(R,P=>{l(n).hasPhoto&&P(A)})}var p=_(R,2),x=h(p);ca(x,{get rego(){return l(n).rego},size:"md"});var D=_(x,2),y=h(D),w=_(M,4),T=h(w);gs(T,{get entries(){return l(i)},fileHref:f});var N=_(T,2);{var F=P=>{var H=Ku();U(()=>O(H,1,`${nr} mt-3`)),se("click",H,c),L(P,H)};V(N,P=>{l(a)&&P(F)})}U(P=>z(y,`${P??""}${l(n).color?` · ${l(n).color}`:""}`),[()=>[l(n).year,l(n).make,l(n).model].filter(Boolean).join(" ")]),L(S,I)};V(g,S=>{l(o)?S(b):l(s)?S(C,1):l(n)&&S(k,2)})}L(e,m),Ce()}ze(["click"]);var Wu=q('<img class="h-full w-full object-cover transition-transform group-hover:scale-105"/>'),Qu=q('<div class="flex h-full w-full items-center justify-center text-5xl opacity-30">🚗</div>'),Zu=q("<span> </span>"),Xu=q('<span class="text-sm text-stone-500"> </span>'),$u=q('<p class="mt-2 text-sm text-stone-500"> </p>'),ec=q('<a><div class="relative aspect-video overflow-hidden bg-stone-100" style="background-image: repeating-linear-gradient(135deg, transparent, transparent 14px, rgba(0,0,0,0.04) 14px, rgba(0,0,0,0.04) 16px);"><!> <!></div> <div class="p-4"><div class="flex items-center justify-between gap-2"><!> <!></div> <!> <div class="mt-3 flex gap-3 text-xs text-stone-400"><span> </span> <span> </span></div></div></a>');function tc(e,t){Se(t,!0);let r=Ct(()=>{const p=[Gi(t.car.regoExpiry),Gi(t.car.wofExpiry)].filter(x=>x!==null);return p.some(x=>x<0)?"overdue":p.some(x=>x<=30)?"upcoming":null});var n=ec(),i=h(n),a=h(i);{var o=p=>{var x=Wu();U(D=>{Ge(x,"src",D),Ge(x,"alt",t.car.rego)},[()=>Jr(`/cars/${t.car.id}/photo`)]),L(p,x)},s=p=>{var x=Qu();L(p,x)};V(a,p=>{t.car.hasPhoto?p(o):p(s,-1)})}var u=_(a,2);{var c=p=>{var x=Zu(),D=h(x);U(()=>{O(x,1,`absolute right-2 top-2 rounded px-2 py-0.5 text-xs font-semibold uppercase tracking-wide shadow-sm
${l(r)==="overdue"?"bg-red-600 text-white":"bg-amber-500 text-white"}`),z(D,l(r)==="overdue"?"Overdue":"Due soon")}),L(p,x)};V(u,p=>{l(r)&&p(c)})}var f=_(i,2),m=h(f),d=h(m);ca(d,{get rego(){return t.car.rego},size:"sm"});var g=_(d,2);{var b=p=>{var x=Xu(),D=h(x);U(()=>z(D,`${t.car.year??""??""} ${t.car.make??""??""}`)),L(p,x)};V(g,p=>{(t.car.year||t.car.make)&&p(b)})}var C=_(m,2);{var k=p=>{var x=$u(),D=h(x);U(()=>z(D,t.car.model)),L(p,x)};V(C,p=>{t.car.model&&p(k)})}var S=_(C,2),I=h(S),M=h(I),R=_(I,2),A=h(R);U((p,x)=>{Ge(n,"href",`#/cars/${t.car.id??""}`),O(n,1,`${Xn} group block overflow-hidden transition-all hover:-translate-y-0.5 hover:shadow-lg`),z(M,`Rego: ${p??""}`),z(A,`WoF: ${x??""}`)},[()=>It(t.car.regoExpiry),()=>It(t.car.wofExpiry)]),L(e,n),Ce()}var rc=q('<div class="fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-4 sm:items-center sm:p-6"><button type="button" aria-label="Close" class="fixed inset-0 bg-stone-900/60 backdrop-blur-sm"></button> <div><div class="flex items-center justify-between border-b border-stone-100 px-5 py-4"><h3 class="text-base font-semibold text-stone-900"> </h3> <button type="button" aria-label="Close" class="rounded-md p-1 text-stone-400 hover:bg-stone-100 hover:text-stone-600"><!></button></div> <div class="max-h-[75vh] overflow-y-auto p-5"><!></div></div></div>');function yt(e,t){Se(t,!0);let r=Be(t,"wide",3,!1);function n(b){var C;b.key==="Escape"&&((C=t.onClose)==null||C.call(t))}var i=rc();br("keydown",Hi,n);var a=h(i),o=_(a,2),s=h(o),u=h(s),c=h(u),f=_(u,2),m=h(f);_e(m,{name:"x",class:"h-5 w-5"});var d=_(s,2),g=h(d);su(g,()=>t.children??$t),U(()=>{O(o,1,`relative my-8 w-full ${r()?"max-w-2xl":"max-w-lg"} rounded-lg border border-stone-200 bg-white shadow-xl sm:my-0`),z(c,t.title)}),se("click",a,()=>{var b;return(b=t.onClose)==null?void 0:b.call(t)}),se("click",f,()=>{var b;return(b=t.onClose)==null?void 0:b.call(t)}),L(e,i),Ce()}ze(["click"]);var nc=q("<option> </option>"),ic=q('<div><label for="reminder-label">Label *</label> <input id="reminder-label" placeholder="Spark plugs"/></div>'),ac=q('<p class="text-sm text-red-600"> </p>'),oc=q('<form class="space-y-4"><div><label for="reminder-type">Type</label> <select id="reminder-type"></select></div> <!> <div class="grid grid-cols-2 gap-4"><div><label for="reminder-due-date">Due date</label> <input id="reminder-due-date" type="date"/></div> <div><label for="reminder-due-odometer">Due odometer (km)</label> <input id="reminder-due-odometer" type="number"/></div></div> <div><label for="reminder-notes">Notes</label> <textarea id="reminder-notes" rows="2"></textarea></div> <!> <div class="flex justify-end gap-2 pt-2"><button type="button">Cancel</button> <button type="submit"> </button></div></form>');function Ra(e,t){var oe,X,J,$,ue,Z;Se(t,!0);let r=Be(t,"reminder",3,null);const n=[{value:"service",label:"Service"},{value:"wheel_rotation",label:"Wheel rotation"},{value:"alignment",label:"Alignment"},{value:"custom",label:"Custom…"}];let i=B(ne(((oe=r())==null?void 0:oe.reminderType)??"service")),a=B(ne(((X=r())==null?void 0:X.label)??"")),o=B(ne((($=(J=r())==null?void 0:J.dueDate)==null?void 0:$.slice(0,10))??"")),s=B(ne(((ue=r())==null?void 0:ue.dueOdometer)??"")),u=B(ne(((Z=r())==null?void 0:Z.notes)??"")),c=B(!1),f=B("");async function m(Y){var le;if(Y.preventDefault(),l(i)==="custom"&&!l(a).trim()){v(f,"Label is required for a custom reminder");return}if(!l(o)&&!l(s)){v(f,"Set a due date or a due odometer reading");return}v(c,!0),v(f,"");const ie={reminderType:l(i),label:l(i)==="custom"?l(a).trim():null,dueDate:l(o)||null,dueOdometer:l(s)?Number(l(s)):null,notes:l(u)||null};try{r()?await en(`/reminders/${r().id}`,ie):await wr(`/cars/${t.carId}/reminders`,ie),(le=t.onSaved)==null||le.call(t)}catch(fe){v(f,fe.message,!0)}finally{v(c,!1)}}var d=oc(),g=h(d),b=h(g),C=_(b,2);zt(C,21,()=>n,Y=>Y.value,(Y,ie)=>{var le=nc(),fe=h(le),he={};U(()=>{z(fe,l(ie).label),he!==(he=l(ie).value)&&(le.value=(le.__value=l(ie).value)??"")}),L(Y,le)});var k=_(g,2);{var S=Y=>{var ie=ic(),le=h(ie),fe=_(le,2);U(()=>{O(le,1,j(ye)),O(fe,1,j(be))}),Ee(fe,()=>l(a),he=>v(a,he)),L(Y,ie)};V(k,Y=>{l(i)==="custom"&&Y(S)})}var I=_(k,2),M=h(I),R=h(M),A=_(R,2),p=_(M,2),x=h(p),D=_(x,2),y=_(I,2),w=h(y),T=_(w,2),N=_(y,2);{var F=Y=>{var ie=ac(),le=h(ie);U(()=>z(le,l(f))),L(Y,ie)};V(N,Y=>{l(f)&&Y(F)})}var P=_(N,2),H=h(P),G=_(H,2),Q=h(G);U(()=>{O(b,1,j(ye)),O(C,1,j(be)),O(R,1,j(ye)),O(A,1,j(be)),O(x,1,j(ye)),O(D,1,j(be)),O(w,1,j(ye)),O(T,1,j(be)),O(H,1,j(rr)),G.disabled=l(c),O(G,1,j(Ht)),z(Q,l(c)?"Saving…":r()?"Save changes":"Add reminder")}),br("submit",d,m),fu(C,()=>l(i),Y=>v(i,Y)),Ee(A,()=>l(o),Y=>v(o,Y)),Ee(D,()=>l(s),Y=>v(s,Y)),Ee(T,()=>l(u),Y=>v(u,Y)),se("click",H,()=>{var Y;return(Y=t.onCancel)==null?void 0:Y.call(t)}),L(e,d),Ce()}ze(["click"]);var sc=q('<p class="text-sm text-stone-400">Loading…</p>'),lc=q('<p class="text-sm text-red-600"> </p>'),uc=q('<p class="text-sm text-stone-400"> </p>'),cc=q('<span class="rounded-full bg-red-100 px-2 py-0.5 text-xs font-medium text-red-700">Overdue</span>'),fc=q('<span class="rounded-full bg-amber-100 px-2 py-0.5 text-xs font-medium text-amber-700">Due soon</span>'),dc=q('<span class="font-normal text-stone-400"> </span>'),vc=q('<div class="flex shrink-0 items-center gap-1"><button><!></button> <button aria-label="Edit reminder"><!></button> <button aria-label="Delete reminder"><!></button></div>'),hc=q('<a class="shrink-0 text-xs font-medium text-teal-600 hover:underline">View car</a>'),gc=q('<li class="flex items-center justify-between gap-3 py-3 first:pt-0 last:pb-0"><div class="min-w-0"><p class="flex flex-wrap items-center gap-2 font-medium text-stone-900"> <!> <!></p> <p class="text-sm text-stone-500"><!> <!></p></div> <!></li>'),pc=q('<ul class="divide-y divide-stone-100"></ul>'),mc=q('<div class="mt-3 flex items-center justify-between"><button><!> Add reminder</button> <button class="text-xs text-stone-400 hover:text-stone-600"> </button></div>'),_c=q("<!> <!> <!> <!>",1);function ps(e,t){Se(t,!0);let r=Be(t,"carId",3,null),n=B(ne([])),i=B(!0),a=B(""),o=B(!1),s=B(!1),u=B(null);async function c(){v(i,!0),v(a,"");try{r()?v(n,await He(`/cars/${r()}/reminders${l(o)?"?completed=1":""}`),!0):v(n,await He("/dashboard"),!0)}catch(y){v(a,y.message,!0)}finally{v(i,!1)}}it(()=>{r(),l(o),c()});async function f(y){await en(`/reminders/${y.id}`,{completed:!y.completedAt}),await c()}async function m(y){confirm("Delete this reminder?")&&(await xr(`/reminders/${y.id}`),await c())}function d(){v(s,!1),v(u,null),c()}var g=_c(),b=Pe(g);{var C=y=>{var w=sc();L(y,w)},k=y=>{var w=lc(),T=h(w);U(()=>z(T,l(a))),L(y,w)},S=y=>{var w=uc(),T=h(w);U(()=>z(T,l(o)?"No completed reminders.":`Nothing due${r()?"":" across your garage"}.`)),L(y,w)},I=y=>{var w=pc();zt(w,21,()=>l(n),T=>T.id??`${T.reminderType}-${T.carId}`,(T,N)=>{var F=gc(),P=h(F),H=h(P),G=h(H),Q=_(G);{var oe=K=>{var ce=cc();L(K,ce)},X=K=>{var ce=fc();L(K,ce)};V(Q,K=>{l(N).status==="overdue"?K(oe):l(N).status==="upcoming"&&K(X,1)})}var J=_(Q,2);{var $=K=>{var ce=dc(),pe=h(ce);U(()=>z(pe,`· ${l(N).carRego??""}`)),L(K,ce)};V(J,K=>{r()||K($)})}var ue=_(H,2),Z=h(ue);{var Y=K=>{var ce=Gr();U(pe=>z(ce,`Due ${pe??""}`),[()=>It(l(N).dueDate)]),L(K,ce)};V(Z,K=>{l(N).dueDate&&K(Y)})}var ie=_(Z,2);{var le=K=>{var ce=Gr();U(pe=>z(ce,`${l(N).dueDate?" · ":"Due "}${pe??""} km`),[()=>l(N).dueOdometer.toLocaleString()]),L(K,ce)};V(ie,K=>{l(N).dueOdometer&&K(le)})}var fe=_(P,2);{var he=K=>{var ce=vc(),pe=h(ce),$e=h(pe);{let Ae=Ct(()=>l(N).completedAt?"undo":"check");_e($e,{get name(){return l(Ae)},class:"h-4 w-4"})}var Ue=_(pe,2),vt=h(Ue);_e(vt,{name:"pencil",class:"h-4 w-4"});var ee=_(Ue,2),me=h(ee);_e(me,{name:"trash",class:"h-4 w-4"}),U(()=>{Ge(pe,"aria-label",l(N).completedAt?"Reopen":"Mark done"),O(pe,1,j(qt)),O(Ue,1,j(qt)),O(ee,1,`${qt} hover:text-red-600`)}),se("click",pe,()=>f(l(N))),se("click",Ue,()=>v(u,l(N),!0)),se("click",ee,()=>m(l(N))),L(K,ce)},Ie=K=>{var ce=hc();U(()=>Ge(ce,"href",`#/cars/${l(N).carId??""}`)),L(K,ce)};V(fe,K=>{r()&&l(N).id?K(he):!r()&&l(N).carId&&K(Ie,1)})}U(K=>z(G,`${K??""} `),[()=>Tu(l(N))]),L(T,F)}),L(y,w)};V(b,y=>{l(i)?y(C):l(a)?y(k,1):l(n).length===0?y(S,2):y(I,-1)})}var M=_(b,2);{var R=y=>{var w=mc(),T=h(w),N=h(T);_e(N,{name:"plus",class:"h-4 w-4"});var F=_(T,2),P=h(F);U(()=>{O(T,1,j(nr)),z(P,l(o)?"Hide completed":"Show completed")}),se("click",T,()=>v(s,!0)),se("click",F,()=>v(o,!l(o))),L(y,w)};V(M,y=>{r()&&y(R)})}var A=_(M,2);{var p=y=>{yt(y,{title:"Add reminder",onClose:()=>v(s,!1),children:(w,T)=>{Ra(w,{get carId(){return r()},onSaved:d,onCancel:()=>v(s,!1)})},$$slots:{default:!0}})};V(A,y=>{l(s)&&y(p)})}var x=_(A,2);{var D=y=>{yt(y,{title:"Edit reminder",onClose:()=>v(u,null),children:(w,T)=>{Ra(w,{get carId(){return r()},get reminder(){return l(u)},onSaved:d,onCancel:()=>v(u,null)})},$$slots:{default:!0}})};V(x,y=>{l(u)&&y(D)})}L(e,g),Ce()}ze(["click"]);var bc=q('<p class="text-sm text-stone-400">Loading…</p>'),yc=q('<p class="text-sm text-red-600"> </p>'),wc=q('<div><span class="text-4xl">🚗</span> <p class="text-sm text-stone-500">No cars yet — add your first one to get started.</p> <a href="#/cars/new"><!> Add car</a></div>'),xc=q('<div class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3"></div>'),Ec=q('<div class="space-y-8"><section><h2>Coming up</h2> <!></section> <section><div class="mb-4 flex items-center justify-between"><h2 class="text-lg font-semibold tracking-tight text-stone-900">Your garage</h2> <a href="#/cars/new"><!> Add car</a></div> <!></section></div>');function kc(e,t){Se(t,!0);let r=B(ne([])),n=B(!0),i=B("");fs(async()=>{try{v(r,await He("/cars"),!0)}catch(I){v(i,I.message,!0)}finally{v(n,!1)}});var a=Ec(),o=h(a),s=h(o),u=_(s,2);ps(u,{});var c=_(o,2),f=h(c),m=_(h(f),2),d=h(m);_e(d,{name:"plus",class:"h-4 w-4"});var g=_(f,2);{var b=I=>{var M=bc();L(I,M)},C=I=>{var M=yc(),R=h(M);U(()=>z(R,l(i))),L(I,M)},k=I=>{var M=wc(),R=_(h(M),4),A=h(R);_e(A,{name:"plus",class:"h-4 w-4"}),U(()=>{O(M,1,`${Xn} flex flex-col items-center gap-3 px-6 py-12 text-center`),O(R,1,j(Ht))}),L(I,M)},S=I=>{var M=xc();zt(M,21,()=>l(r),R=>R.id,(R,A)=>{tc(R,{get car(){return l(A)}})}),L(I,M)};V(g,I=>{l(n)?I(b):l(i)?I(C,1):l(r).length===0?I(k,2):I(S,-1)})}U(()=>{O(o,1,j(hs)),O(s,1,`${Iu} mb-3`),O(m,1,j(Ht))}),L(e,a),Ce()}var Sc=q('<label class="group relative block aspect-[21/9] w-full cursor-pointer overflow-hidden rounded-lg border border-stone-200"><img class="h-full w-full object-cover"/> <div class="absolute inset-0 flex items-center justify-center bg-black/0 opacity-0 transition-all group-hover:bg-black/40 group-hover:opacity-100"><span class="inline-flex items-center gap-1.5 rounded-lg bg-white/90 px-3 py-1.5 text-sm font-medium text-stone-900 shadow"><!> </span></div> <input type="file" accept="image/png,image/jpeg" class="hidden"/></label>'),Cc=q('<label class="group relative flex aspect-[21/9] w-full cursor-pointer flex-col items-center justify-center gap-2 overflow-hidden rounded-lg border-2 border-dashed border-stone-300 bg-stone-100 text-stone-500 transition-colors hover:border-teal-600 hover:bg-teal-50/50 hover:text-teal-700" style="background-image: repeating-linear-gradient(135deg, transparent, transparent 14px, rgba(0,0,0,0.04) 14px, rgba(0,0,0,0.04) 16px);"><!> <span class="text-sm font-medium"> </span> <input type="file" accept="image/png,image/jpeg" class="hidden"/></label>'),Ac=q('<p class="text-sm text-red-600"> </p>'),Tc=q('<div class="space-y-1.5"><!> <!></div>');function Ic(e,t){Se(t,!0);let r=Be(t,"hasPhoto",3,!1),n=Be(t,"alt",3,"Car photo"),i=B(!1),a=B(""),o=B(0);async function s(b){var k;const C=b.target.files[0];if(C){v(i,!0),v(a,"");try{await ds(`/cars/${t.carId}/photo`,C),v(o,l(o)+1),(k=t.onUploaded)==null||k.call(t)}catch(S){v(a,S.message,!0)}finally{v(i,!1),b.target.value=""}}}var u=Tc(),c=h(u);{var f=b=>{var C=Sc(),k=h(C),S=_(k,2),I=h(S),M=h(I);_e(M,{name:"camera",class:"h-4 w-4"});var R=_(M),A=_(S,2);U(p=>{Ge(k,"src",p),Ge(k,"alt",n()),z(R,` ${l(i)?"Uploading…":"Replace photo"}`),A.disabled=l(i)},[()=>Jr(`/cars/${t.carId}/photo?v=${l(o)}`)]),se("change",A,s),L(b,C)},m=b=>{var C=Cc(),k=h(C);_e(k,{name:"camera",class:"h-8 w-8"});var S=_(k,2),I=h(S),M=_(S,2);U(()=>{z(I,l(i)?"Uploading…":"Add a photo"),M.disabled=l(i)}),se("change",M,s),L(b,C)};V(c,b=>{r()?b(f):b(m,-1)})}var d=_(c,2);{var g=b=>{var C=Ac(),k=h(C);U(()=>z(k,l(a))),L(b,C)};V(d,b=>{l(a)&&b(g)})}L(e,u),Ce()}ze(["change"]);function Mc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mr={},si,Na;function Pc(){return Na||(Na=1,si=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),si}var li={},Gt={},La;function Er(){if(La)return Gt;La=1;let e;const t=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return Gt.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return n*4+17},Gt.getSymbolTotalCodewords=function(n){return t[n]},Gt.getBCHDigit=function(r){let n=0;for(;r!==0;)n++,r>>>=1;return n},Gt.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');e=n},Gt.isKanjiModeEnabled=function(){return typeof e<"u"},Gt.toSJIS=function(n){return e(n)},Gt}var ui={},Da;function fa(){return Da||(Da=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+r)}}e.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},e.from=function(n,i){if(e.isValid(n))return n;try{return t(n)}catch{return i}}})(ui)),ui}var ci,Ba;function Rc(){if(Ba)return ci;Ba=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(t){const r=Math.floor(t/8);return(this.buffer[r]>>>7-t%8&1)===1},put:function(t,r){for(let n=0;n<r;n++)this.putBit((t>>>r-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),t&&(this.buffer[r]|=128>>>this.length%8),this.length++}},ci=e,ci}var fi,Fa;function Nc(){if(Fa)return fi;Fa=1;function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return e.prototype.set=function(t,r,n,i){const a=t*this.size+r;this.data[a]=n,i&&(this.reservedBit[a]=!0)},e.prototype.get=function(t,r){return this.data[t*this.size+r]},e.prototype.xor=function(t,r,n){this.data[t*this.size+r]^=n},e.prototype.isReserved=function(t,r){return this.reservedBit[t*this.size+r]},fi=e,fi}var di={},Oa;function Lc(){return Oa||(Oa=1,(function(e){const t=Er().getSymbolSize;e.getRowColCoords=function(n){if(n===1)return[];const i=Math.floor(n/7)+2,a=t(n),o=a===145?26:Math.ceil((a-13)/(2*i-2))*2,s=[a-7];for(let u=1;u<i-1;u++)s[u]=s[u-1]-o;return s.push(6),s.reverse()},e.getPositions=function(n){const i=[],a=e.getRowColCoords(n),o=a.length;for(let s=0;s<o;s++)for(let u=0;u<o;u++)s===0&&u===0||s===0&&u===o-1||s===o-1&&u===0||i.push([a[s],a[u]]);return i}})(di)),di}var vi={},qa;function Dc(){if(qa)return vi;qa=1;const e=Er().getSymbolSize,t=7;return vi.getPositions=function(n){const i=e(n);return[[0,0],[i-t,0],[0,i-t]]},vi}var hi={},ja;function Bc(){return ja||(ja=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},e.from=function(i){return e.isValid(i)?parseInt(i,10):void 0},e.getPenaltyN1=function(i){const a=i.size;let o=0,s=0,u=0,c=null,f=null;for(let m=0;m<a;m++){s=u=0,c=f=null;for(let d=0;d<a;d++){let g=i.get(m,d);g===c?s++:(s>=5&&(o+=t.N1+(s-5)),c=g,s=1),g=i.get(d,m),g===f?u++:(u>=5&&(o+=t.N1+(u-5)),f=g,u=1)}s>=5&&(o+=t.N1+(s-5)),u>=5&&(o+=t.N1+(u-5))}return o},e.getPenaltyN2=function(i){const a=i.size;let o=0;for(let s=0;s<a-1;s++)for(let u=0;u<a-1;u++){const c=i.get(s,u)+i.get(s,u+1)+i.get(s+1,u)+i.get(s+1,u+1);(c===4||c===0)&&o++}return o*t.N2},e.getPenaltyN3=function(i){const a=i.size;let o=0,s=0,u=0;for(let c=0;c<a;c++){s=u=0;for(let f=0;f<a;f++)s=s<<1&2047|i.get(c,f),f>=10&&(s===1488||s===93)&&o++,u=u<<1&2047|i.get(f,c),f>=10&&(u===1488||u===93)&&o++}return o*t.N3},e.getPenaltyN4=function(i){let a=0;const o=i.data.length;for(let u=0;u<o;u++)a+=i.data[u];return Math.abs(Math.ceil(a*100/o/5)-10)*t.N4};function r(n,i,a){switch(n){case e.Patterns.PATTERN000:return(i+a)%2===0;case e.Patterns.PATTERN001:return i%2===0;case e.Patterns.PATTERN010:return a%3===0;case e.Patterns.PATTERN011:return(i+a)%3===0;case e.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(a/3))%2===0;case e.Patterns.PATTERN101:return i*a%2+i*a%3===0;case e.Patterns.PATTERN110:return(i*a%2+i*a%3)%2===0;case e.Patterns.PATTERN111:return(i*a%3+(i+a)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}e.applyMask=function(i,a){const o=a.size;for(let s=0;s<o;s++)for(let u=0;u<o;u++)a.isReserved(u,s)||a.xor(u,s,r(i,u,s))},e.getBestMask=function(i,a){const o=Object.keys(e.Patterns).length;let s=0,u=1/0;for(let c=0;c<o;c++){a(c),e.applyMask(c,i);const f=e.getPenaltyN1(i)+e.getPenaltyN2(i)+e.getPenaltyN3(i)+e.getPenaltyN4(i);e.applyMask(c,i),f<u&&(u=f,s=c)}return s}})(hi)),hi}var Ln={},Ua;function ms(){if(Ua)return Ln;Ua=1;const e=fa(),t=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return Ln.getBlocksCount=function(i,a){switch(a){case e.L:return t[(i-1)*4+0];case e.M:return t[(i-1)*4+1];case e.Q:return t[(i-1)*4+2];case e.H:return t[(i-1)*4+3];default:return}},Ln.getTotalCodewordsCount=function(i,a){switch(a){case e.L:return r[(i-1)*4+0];case e.M:return r[(i-1)*4+1];case e.Q:return r[(i-1)*4+2];case e.H:return r[(i-1)*4+3];default:return}},Ln}var gi={},an={},Ha;function Fc(){if(Ha)return an;Ha=1;const e=new Uint8Array(512),t=new Uint8Array(256);return(function(){let n=1;for(let i=0;i<255;i++)e[i]=n,t[n]=i,n<<=1,n&256&&(n^=285);for(let i=255;i<512;i++)e[i]=e[i-255]})(),an.log=function(n){if(n<1)throw new Error("log("+n+")");return t[n]},an.exp=function(n){return e[n]},an.mul=function(n,i){return n===0||i===0?0:e[t[n]+t[i]]},an}var za;function Oc(){return za||(za=1,(function(e){const t=Fc();e.mul=function(n,i){const a=new Uint8Array(n.length+i.length-1);for(let o=0;o<n.length;o++)for(let s=0;s<i.length;s++)a[o+s]^=t.mul(n[o],i[s]);return a},e.mod=function(n,i){let a=new Uint8Array(n);for(;a.length-i.length>=0;){const o=a[0];for(let u=0;u<i.length;u++)a[u]^=t.mul(i[u],o);let s=0;for(;s<a.length&&a[s]===0;)s++;a=a.slice(s)}return a},e.generateECPolynomial=function(n){let i=new Uint8Array([1]);for(let a=0;a<n;a++)i=e.mul(i,new Uint8Array([1,t.exp(a)]));return i}})(gi)),gi}var pi,Va;function qc(){if(Va)return pi;Va=1;const e=Oc();function t(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}return t.prototype.initialize=function(n){this.degree=n,this.genPoly=e.generateECPolynomial(this.degree)},t.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");const i=new Uint8Array(n.length+this.degree);i.set(n);const a=e.mod(i,this.genPoly),o=this.degree-a.length;if(o>0){const s=new Uint8Array(this.degree);return s.set(a,o),s}return a},pi=t,pi}var mi={},_i={},bi={},Ka;function _s(){return Ka||(Ka=1,bi.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),bi}var wt={},Ya;function bs(){if(Ya)return wt;Ya=1;const e="[0-9]+",t="[A-Z $%*+\\-./:]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const n="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+`)(?:.|[\r
]))+`;wt.KANJI=new RegExp(r,"g"),wt.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),wt.BYTE=new RegExp(n,"g"),wt.NUMERIC=new RegExp(e,"g"),wt.ALPHANUMERIC=new RegExp(t,"g");const i=new RegExp("^"+r+"$"),a=new RegExp("^"+e+"$"),o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return wt.testKanji=function(u){return i.test(u)},wt.testNumeric=function(u){return a.test(u)},wt.testAlphanumeric=function(u){return o.test(u)},wt}var Ga;function kr(){return Ga||(Ga=1,(function(e){const t=_s(),r=bs();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(a,o){if(!a.ccBits)throw new Error("Invalid mode: "+a);if(!t.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?a.ccBits[0]:o<27?a.ccBits[1]:a.ccBits[2]},e.getBestModeForData=function(a){return r.testNumeric(a)?e.NUMERIC:r.testAlphanumeric(a)?e.ALPHANUMERIC:r.testKanji(a)?e.KANJI:e.BYTE},e.toString=function(a){if(a&&a.id)return a.id;throw new Error("Invalid mode")},e.isValid=function(a){return a&&a.bit&&a.ccBits};function n(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+i)}}e.from=function(a,o){if(e.isValid(a))return a;try{return n(a)}catch{return o}}})(_i)),_i}var Ja;function jc(){return Ja||(Ja=1,(function(e){const t=Er(),r=ms(),n=fa(),i=kr(),a=_s(),o=7973,s=t.getBCHDigit(o);function u(d,g,b){for(let C=1;C<=40;C++)if(g<=e.getCapacity(C,b,d))return C}function c(d,g){return i.getCharCountIndicator(d,g)+4}function f(d,g){let b=0;return d.forEach(function(C){const k=c(C.mode,g);b+=k+C.getBitsLength()}),b}function m(d,g){for(let b=1;b<=40;b++)if(f(d,b)<=e.getCapacity(b,g,i.MIXED))return b}e.from=function(g,b){return a.isValid(g)?parseInt(g,10):b},e.getCapacity=function(g,b,C){if(!a.isValid(g))throw new Error("Invalid QR Code version");typeof C>"u"&&(C=i.BYTE);const k=t.getSymbolTotalCodewords(g),S=r.getTotalCodewordsCount(g,b),I=(k-S)*8;if(C===i.MIXED)return I;const M=I-c(C,g);switch(C){case i.NUMERIC:return Math.floor(M/10*3);case i.ALPHANUMERIC:return Math.floor(M/11*2);case i.KANJI:return Math.floor(M/13);case i.BYTE:default:return Math.floor(M/8)}},e.getBestVersionForData=function(g,b){let C;const k=n.from(b,n.M);if(Array.isArray(g)){if(g.length>1)return m(g,k);if(g.length===0)return 1;C=g[0]}else C=g;return u(C.mode,C.getLength(),k)},e.getEncodedBits=function(g){if(!a.isValid(g)||g<7)throw new Error("Invalid QR Code version");let b=g<<12;for(;t.getBCHDigit(b)-s>=0;)b^=o<<t.getBCHDigit(b)-s;return g<<12|b}})(mi)),mi}var yi={},Wa;function Uc(){if(Wa)return yi;Wa=1;const e=Er(),t=1335,r=21522,n=e.getBCHDigit(t);return yi.getEncodedBits=function(a,o){const s=a.bit<<3|o;let u=s<<10;for(;e.getBCHDigit(u)-n>=0;)u^=t<<e.getBCHDigit(u)-n;return(s<<10|u)^r},yi}var wi={},xi,Qa;function Hc(){if(Qa)return xi;Qa=1;const e=kr();function t(r){this.mode=e.NUMERIC,this.data=r.toString()}return t.getBitsLength=function(n){return 10*Math.floor(n/3)+(n%3?n%3*3+1:0)},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(n){let i,a,o;for(i=0;i+3<=this.data.length;i+=3)a=this.data.substr(i,3),o=parseInt(a,10),n.put(o,10);const s=this.data.length-i;s>0&&(a=this.data.substr(i),o=parseInt(a,10),n.put(o,s*3+1))},xi=t,xi}var Ei,Za;function zc(){if(Za)return Ei;Za=1;const e=kr(),t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(n){this.mode=e.ALPHANUMERIC,this.data=n}return r.getBitsLength=function(i){return 11*Math.floor(i/2)+6*(i%2)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(i){let a;for(a=0;a+2<=this.data.length;a+=2){let o=t.indexOf(this.data[a])*45;o+=t.indexOf(this.data[a+1]),i.put(o,11)}this.data.length%2&&i.put(t.indexOf(this.data[a]),6)},Ei=r,Ei}var ki,Xa;function Vc(){if(Xa)return ki;Xa=1;const e=kr();function t(r){this.mode=e.BYTE,typeof r=="string"?this.data=new TextEncoder().encode(r):this.data=new Uint8Array(r)}return t.getBitsLength=function(n){return n*8},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(r){for(let n=0,i=this.data.length;n<i;n++)r.put(this.data[n],8)},ki=t,ki}var Si,$a;function Kc(){if($a)return Si;$a=1;const e=kr(),t=Er();function r(n){this.mode=e.KANJI,this.data=n}return r.getBitsLength=function(i){return i*13},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(n){let i;for(i=0;i<this.data.length;i++){let a=t.toSJIS(this.data[i]);if(a>=33088&&a<=40956)a-=33088;else if(a>=57408&&a<=60351)a-=49472;else throw new Error("Invalid SJIS character: "+this.data[i]+`
Make sure your charset is UTF-8`);a=(a>>>8&255)*192+(a&255),n.put(a,13)}},Si=r,Si}var Ci={exports:{}},eo;function Yc(){return eo||(eo=1,(function(e){var t={single_source_shortest_paths:function(r,n,i){var a={},o={};o[n]=0;var s=t.PriorityQueue.make();s.push(n,0);for(var u,c,f,m,d,g,b,C,k;!s.empty();){u=s.pop(),c=u.value,m=u.cost,d=r[c]||{};for(f in d)d.hasOwnProperty(f)&&(g=d[f],b=m+g,C=o[f],k=typeof o[f]>"u",(k||C>b)&&(o[f]=b,s.push(f,b),a[f]=c))}if(typeof i<"u"&&typeof o[i]>"u"){var S=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(S)}return a},extract_shortest_path_from_predecessor_list:function(r,n){for(var i=[],a=n;a;)i.push(a),r[a],a=r[a];return i.reverse(),i},find_path:function(r,n,i){var a=t.single_source_shortest_paths(r,n,i);return t.extract_shortest_path_from_predecessor_list(a,i)},PriorityQueue:{make:function(r){var n=t.PriorityQueue,i={},a;r=r||{};for(a in n)n.hasOwnProperty(a)&&(i[a]=n[a]);return i.queue=[],i.sorter=r.sorter||n.default_sorter,i},default_sorter:function(r,n){return r.cost-n.cost},push:function(r,n){var i={value:r,cost:n};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(Ci)),Ci.exports}var to;function Gc(){return to||(to=1,(function(e){const t=kr(),r=Hc(),n=zc(),i=Vc(),a=Kc(),o=bs(),s=Er(),u=Yc();function c(S){return unescape(encodeURIComponent(S)).length}function f(S,I,M){const R=[];let A;for(;(A=S.exec(M))!==null;)R.push({data:A[0],index:A.index,mode:I,length:A[0].length});return R}function m(S){const I=f(o.NUMERIC,t.NUMERIC,S),M=f(o.ALPHANUMERIC,t.ALPHANUMERIC,S);let R,A;return s.isKanjiModeEnabled()?(R=f(o.BYTE,t.BYTE,S),A=f(o.KANJI,t.KANJI,S)):(R=f(o.BYTE_KANJI,t.BYTE,S),A=[]),I.concat(M,R,A).sort(function(x,D){return x.index-D.index}).map(function(x){return{data:x.data,mode:x.mode,length:x.length}})}function d(S,I){switch(I){case t.NUMERIC:return r.getBitsLength(S);case t.ALPHANUMERIC:return n.getBitsLength(S);case t.KANJI:return a.getBitsLength(S);case t.BYTE:return i.getBitsLength(S)}}function g(S){return S.reduce(function(I,M){const R=I.length-1>=0?I[I.length-1]:null;return R&&R.mode===M.mode?(I[I.length-1].data+=M.data,I):(I.push(M),I)},[])}function b(S){const I=[];for(let M=0;M<S.length;M++){const R=S[M];switch(R.mode){case t.NUMERIC:I.push([R,{data:R.data,mode:t.ALPHANUMERIC,length:R.length},{data:R.data,mode:t.BYTE,length:R.length}]);break;case t.ALPHANUMERIC:I.push([R,{data:R.data,mode:t.BYTE,length:R.length}]);break;case t.KANJI:I.push([R,{data:R.data,mode:t.BYTE,length:c(R.data)}]);break;case t.BYTE:I.push([{data:R.data,mode:t.BYTE,length:c(R.data)}])}}return I}function C(S,I){const M={},R={start:{}};let A=["start"];for(let p=0;p<S.length;p++){const x=S[p],D=[];for(let y=0;y<x.length;y++){const w=x[y],T=""+p+y;D.push(T),M[T]={node:w,lastCount:0},R[T]={};for(let N=0;N<A.length;N++){const F=A[N];M[F]&&M[F].node.mode===w.mode?(R[F][T]=d(M[F].lastCount+w.length,w.mode)-d(M[F].lastCount,w.mode),M[F].lastCount+=w.length):(M[F]&&(M[F].lastCount=w.length),R[F][T]=d(w.length,w.mode)+4+t.getCharCountIndicator(w.mode,I))}}A=D}for(let p=0;p<A.length;p++)R[A[p]].end=0;return{map:R,table:M}}function k(S,I){let M;const R=t.getBestModeForData(S);if(M=t.from(I,R),M!==t.BYTE&&M.bit<R.bit)throw new Error('"'+S+'" cannot be encoded with mode '+t.toString(M)+`.
Suggested mode is: `+t.toString(R));switch(M===t.KANJI&&!s.isKanjiModeEnabled()&&(M=t.BYTE),M){case t.NUMERIC:return new r(S);case t.ALPHANUMERIC:return new n(S);case t.KANJI:return new a(S);case t.BYTE:return new i(S)}}e.fromArray=function(I){return I.reduce(function(M,R){return typeof R=="string"?M.push(k(R,null)):R.data&&M.push(k(R.data,R.mode)),M},[])},e.fromString=function(I,M){const R=m(I,s.isKanjiModeEnabled()),A=b(R),p=C(A,M),x=u.find_path(p.map,"start","end"),D=[];for(let y=1;y<x.length-1;y++)D.push(p.table[x[y]].node);return e.fromArray(g(D))},e.rawSplit=function(I){return e.fromArray(m(I,s.isKanjiModeEnabled()))}})(wi)),wi}var ro;function Jc(){if(ro)return li;ro=1;const e=Er(),t=fa(),r=Rc(),n=Nc(),i=Lc(),a=Dc(),o=Bc(),s=ms(),u=qc(),c=jc(),f=Uc(),m=kr(),d=Gc();function g(p,x){const D=p.size,y=a.getPositions(x);for(let w=0;w<y.length;w++){const T=y[w][0],N=y[w][1];for(let F=-1;F<=7;F++)if(!(T+F<=-1||D<=T+F))for(let P=-1;P<=7;P++)N+P<=-1||D<=N+P||(F>=0&&F<=6&&(P===0||P===6)||P>=0&&P<=6&&(F===0||F===6)||F>=2&&F<=4&&P>=2&&P<=4?p.set(T+F,N+P,!0,!0):p.set(T+F,N+P,!1,!0))}}function b(p){const x=p.size;for(let D=8;D<x-8;D++){const y=D%2===0;p.set(D,6,y,!0),p.set(6,D,y,!0)}}function C(p,x){const D=i.getPositions(x);for(let y=0;y<D.length;y++){const w=D[y][0],T=D[y][1];for(let N=-2;N<=2;N++)for(let F=-2;F<=2;F++)N===-2||N===2||F===-2||F===2||N===0&&F===0?p.set(w+N,T+F,!0,!0):p.set(w+N,T+F,!1,!0)}}function k(p,x){const D=p.size,y=c.getEncodedBits(x);let w,T,N;for(let F=0;F<18;F++)w=Math.floor(F/3),T=F%3+D-8-3,N=(y>>F&1)===1,p.set(w,T,N,!0),p.set(T,w,N,!0)}function S(p,x,D){const y=p.size,w=f.getEncodedBits(x,D);let T,N;for(T=0;T<15;T++)N=(w>>T&1)===1,T<6?p.set(T,8,N,!0):T<8?p.set(T+1,8,N,!0):p.set(y-15+T,8,N,!0),T<8?p.set(8,y-T-1,N,!0):T<9?p.set(8,15-T-1+1,N,!0):p.set(8,15-T-1,N,!0);p.set(y-8,8,1,!0)}function I(p,x){const D=p.size;let y=-1,w=D-1,T=7,N=0;for(let F=D-1;F>0;F-=2)for(F===6&&F--;;){for(let P=0;P<2;P++)if(!p.isReserved(w,F-P)){let H=!1;N<x.length&&(H=(x[N]>>>T&1)===1),p.set(w,F-P,H),T--,T===-1&&(N++,T=7)}if(w+=y,w<0||D<=w){w-=y,y=-y;break}}}function M(p,x,D){const y=new r;D.forEach(function(P){y.put(P.mode.bit,4),y.put(P.getLength(),m.getCharCountIndicator(P.mode,p)),P.write(y)});const w=e.getSymbolTotalCodewords(p),T=s.getTotalCodewordsCount(p,x),N=(w-T)*8;for(y.getLengthInBits()+4<=N&&y.put(0,4);y.getLengthInBits()%8!==0;)y.putBit(0);const F=(N-y.getLengthInBits())/8;for(let P=0;P<F;P++)y.put(P%2?17:236,8);return R(y,p,x)}function R(p,x,D){const y=e.getSymbolTotalCodewords(x),w=s.getTotalCodewordsCount(x,D),T=y-w,N=s.getBlocksCount(x,D),F=y%N,P=N-F,H=Math.floor(y/N),G=Math.floor(T/N),Q=G+1,oe=H-G,X=new u(oe);let J=0;const $=new Array(N),ue=new Array(N);let Z=0;const Y=new Uint8Array(p.buffer);for(let Ie=0;Ie<N;Ie++){const K=Ie<P?G:Q;$[Ie]=Y.slice(J,J+K),ue[Ie]=X.encode($[Ie]),J+=K,Z=Math.max(Z,K)}const ie=new Uint8Array(y);let le=0,fe,he;for(fe=0;fe<Z;fe++)for(he=0;he<N;he++)fe<$[he].length&&(ie[le++]=$[he][fe]);for(fe=0;fe<oe;fe++)for(he=0;he<N;he++)ie[le++]=ue[he][fe];return ie}function A(p,x,D,y){let w;if(Array.isArray(p))w=d.fromArray(p);else if(typeof p=="string"){let H=x;if(!H){const G=d.rawSplit(p);H=c.getBestVersionForData(G,D)}w=d.fromString(p,H||40)}else throw new Error("Invalid data");const T=c.getBestVersionForData(w,D);if(!T)throw new Error("The amount of data is too big to be stored in a QR Code");if(!x)x=T;else if(x<T)throw new Error(`
The chosen QR Code version cannot contain this amount of data.
Minimum version required to store current data is: `+T+`.
`);const N=M(x,D,w),F=e.getSymbolSize(x),P=new n(F);return g(P,x),b(P),C(P,x),S(P,D,0),x>=7&&k(P,x),I(P,N),isNaN(y)&&(y=o.getBestMask(P,S.bind(null,P,D))),o.applyMask(y,P),S(P,D,y),{modules:P,version:x,errorCorrectionLevel:D,maskPattern:y,segments:w}}return li.create=function(x,D){if(typeof x>"u"||x==="")throw new Error("No input text");let y=t.M,w,T;return typeof D<"u"&&(y=t.from(D.errorCorrectionLevel,t.M),w=c.from(D.version),T=o.from(D.maskPattern),D.toSJISFunc&&e.setToSJISFunction(D.toSJISFunc)),A(x,w,y,T)},li}var Ai={},Ti={},no;function ys(){return no||(no=1,(function(e){function t(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let n=r.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+r);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(a){return[a,a]}))),n.length===6&&n.push("F","F");const i=parseInt(n.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+n.slice(0,6).join("")}}e.getOptions=function(n){n||(n={}),n.color||(n.color={});const i=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,a=n.width&&n.width>=21?n.width:void 0,o=n.scale||4;return{width:a,scale:a?4:o,margin:i,color:{dark:t(n.color.dark||"#000000ff"),light:t(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},e.getScale=function(n,i){return i.width&&i.width>=n+i.margin*2?i.width/(n+i.margin*2):i.scale},e.getImageWidth=function(n,i){const a=e.getScale(n,i);return Math.floor((n+i.margin*2)*a)},e.qrToImageData=function(n,i,a){const o=i.modules.size,s=i.modules.data,u=e.getScale(o,a),c=Math.floor((o+a.margin*2)*u),f=a.margin*u,m=[a.color.light,a.color.dark];for(let d=0;d<c;d++)for(let g=0;g<c;g++){let b=(d*c+g)*4,C=a.color.light;if(d>=f&&g>=f&&d<c-f&&g<c-f){const k=Math.floor((d-f)/u),S=Math.floor((g-f)/u);C=m[s[k*o+S]?1:0]}n[b++]=C.r,n[b++]=C.g,n[b++]=C.b,n[b]=C.a}}})(Ti)),Ti}var io;function Wc(){return io||(io=1,(function(e){const t=ys();function r(i,a,o){i.clearRect(0,0,a.width,a.height),a.style||(a.style={}),a.height=o,a.width=o,a.style.height=o+"px",a.style.width=o+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(a,o,s){let u=s,c=o;typeof u>"u"&&(!o||!o.getContext)&&(u=o,o=void 0),o||(c=n()),u=t.getOptions(u);const f=t.getImageWidth(a.modules.size,u),m=c.getContext("2d"),d=m.createImageData(f,f);return t.qrToImageData(d.data,a,u),r(m,c,f),m.putImageData(d,0,0),c},e.renderToDataURL=function(a,o,s){let u=s;typeof u>"u"&&(!o||!o.getContext)&&(u=o,o=void 0),u||(u={});const c=e.render(a,o,u),f=u.type||"image/png",m=u.rendererOpts||{};return c.toDataURL(f,m.quality)}})(Ai)),Ai}var Ii={},ao;function Qc(){if(ao)return Ii;ao=1;const e=ys();function t(i,a){const o=i.a/255,s=a+'="'+i.hex+'"';return o<1?s+" "+a+'-opacity="'+o.toFixed(2).slice(1)+'"':s}function r(i,a,o){let s=i+a;return typeof o<"u"&&(s+=" "+o),s}function n(i,a,o){let s="",u=0,c=!1,f=0;for(let m=0;m<i.length;m++){const d=Math.floor(m%a),g=Math.floor(m/a);!d&&!c&&(c=!0),i[m]?(f++,m>0&&d>0&&i[m-1]||(s+=c?r("M",d+o,.5+g+o):r("m",u,0),u=0,c=!1),d+1<a&&i[m+1]||(s+=r("h",f),f=0)):u++}return s}return Ii.render=function(a,o,s){const u=e.getOptions(o),c=a.modules.size,f=a.modules.data,m=c+u.margin*2,d=u.color.light.a?"<path "+t(u.color.light,"fill")+' d="M0 0h'+m+"v"+m+'H0z"/>':"",g="<path "+t(u.color.dark,"stroke")+' d="'+n(f,c,u.margin)+'"/>',b='viewBox="0 0 '+m+" "+m+'"',k='<svg xmlns="http://www.w3.org/2000/svg" '+(u.width?'width="'+u.width+'" height="'+u.width+'" ':"")+b+' shape-rendering="crispEdges">'+d+g+`</svg>
`;return typeof s=="function"&&s(null,k),k},Ii}var oo;function Zc(){if(oo)return Mr;oo=1;const e=Pc(),t=Jc(),r=Wc(),n=Qc();function i(a,o,s,u,c){const f=[].slice.call(arguments,1),m=f.length,d=typeof f[m-1]=="function";if(!d&&!e())throw new Error("Callback required as last argument");if(d){if(m<2)throw new Error("Too few arguments provided");m===2?(c=s,s=o,o=u=void 0):m===3&&(o.getContext&&typeof c>"u"?(c=u,u=void 0):(c=u,u=s,s=o,o=void 0))}else{if(m<1)throw new Error("Too few arguments provided");return m===1?(s=o,o=u=void 0):m===2&&!o.getContext&&(u=s,s=o,o=void 0),new Promise(function(g,b){try{const C=t.create(s,u);g(a(C,o,u))}catch(C){b(C)}})}try{const g=t.create(s,u);c(null,a(g,o,u))}catch(g){c(g)}}return Mr.create=t.create,Mr.toCanvas=i.bind(null,r.render),Mr.toDataURL=i.bind(null,r.renderToDataURL),Mr.toString=i.bind(null,function(a,o,s){return n.render(a,s)}),Mr}var Xc=Zc();const $c=Mc(Xc);var ef=q("<button> </button>"),tf=q('<img alt="QR code for share link" class="h-48 w-48"/>'),rf=q('<div class="flex flex-col items-center gap-3 rounded-lg border border-stone-200 p-4"><!> <div class="flex w-full items-center gap-2"><input readonly="" class="flex-1 rounded-md border border-stone-300 bg-stone-50 px-2 py-1.5 text-xs text-stone-600"/> <button> </button></div></div> <div class="flex gap-2"><button>Regenerate link</button> <button>Turn off sharing</button></div>',1),nf=q('<p class="text-sm text-red-600"> </p>'),af=q('<div class="space-y-4"><p class="text-sm text-stone-500"> </p> <!> <!></div>');function of(e,t){Se(t,!0);let r=B(ne(t.car.shareToken)),n=B(""),i=B(!1),a=B(!1),o=B(""),s=Ct(()=>l(r)?`${window.location.origin}/#/share/${l(r)}`:"");it(()=>{if(!l(s)){v(n,"");return}$c.toDataURL(l(s),{width:220,margin:1}).then(R=>v(n,R,!0))});async function u(){var R;v(i,!0),v(o,"");try{const A=await wr(`/cars/${t.car.id}/share`,{});v(r,A.shareToken,!0),(R=t.onUpdated)==null||R.call(t,A)}catch(A){v(o,A.message,!0)}finally{v(i,!1)}}async function c(){confirm("Regenerate the link? The current QR code/link will stop working.")&&await u()}async function f(){var R;if(confirm("Turn off sharing? The current link/QR code will stop working.")){v(i,!0),v(o,"");try{await xr(`/cars/${t.car.id}/share`),v(r,null),(R=t.onUpdated)==null||R.call(t,{...t.car,shareToken:null})}catch(A){v(o,A.message,!0)}finally{v(i,!1)}}}async function m(){await navigator.clipboard.writeText(l(s)),v(a,!0),setTimeout(()=>v(a,!1),1500)}var d=af(),g=h(d),b=h(g),C=_(g,2);{var k=R=>{var A=ef(),p=h(A);U(()=>{A.disabled=l(i),O(A,1,j(Ht)),z(p,l(i)?"Generating…":"Turn on sharing")}),se("click",A,u),L(R,A)},S=R=>{var A=rf(),p=Pe(A),x=h(p);{var D=G=>{var Q=tf();U(()=>Ge(Q,"src",l(n))),L(G,Q)};V(x,G=>{l(n)&&G(D)})}var y=_(x,2),w=h(y),T=_(w,2),N=h(T),F=_(p,2),P=h(F),H=_(P,2);U(()=>{gu(w,l(s)),O(T,1,j(rr)),z(N,l(a)?"Copied!":"Copy"),P.disabled=l(i),O(P,1,j(rr)),H.disabled=l(i),O(H,1,j(vs))}),se("click",T,m),se("click",P,c),se("click",H,f),L(R,A)};V(C,R=>{l(r)?R(S,-1):R(k)})}var I=_(C,2);{var M=R=>{var A=nf(),p=h(A);U(()=>z(p,l(o))),L(R,A)};V(I,R=>{l(o)&&R(M)})}U(()=>z(b,`Share a read-only view of ${t.car.rego??""}'s service history (including attached docs) — no login required. Handy for
a QR code in the glovebox, or a link when selling the car.`)),L(e,d),Ce()}ze(["click"]);var sf=q('<p class="text-sm text-red-600"> </p>'),lf=q('<form class="space-y-4"><div><label for="kb-title">Title *</label> <input id="kb-title" placeholder="Coolant type" required=""/></div> <div><label for="kb-body">Details</label> <textarea id="kb-body" rows="8" placeholder="e.g. Toyota Super Long Life Coolant, pink, diluted 50/50. Bleed via the top-left nipple with the heater on full."></textarea></div> <!> <div class="flex justify-end gap-2 pt-2"><button type="button">Cancel</button> <button type="submit"> </button></div></form>');function so(e,t){var A,p;Se(t,!0);let r=Be(t,"entry",3,null),n=B(ne(((A=r())==null?void 0:A.title)??"")),i=B(ne(((p=r())==null?void 0:p.body)??"")),a=B(!1),o=B("");async function s(x){var y;if(x.preventDefault(),!l(n).trim()){v(o,"Title is required");return}v(a,!0),v(o,"");const D={title:l(n).trim(),body:l(i)};try{r()?await en(`/knowledge/${r().id}`,D):await wr(`/cars/${t.carId}/knowledge`,D),(y=t.onSaved)==null||y.call(t)}catch(w){v(o,w.message,!0)}finally{v(a,!1)}}var u=lf(),c=h(u),f=h(c),m=_(f,2),d=_(c,2),g=h(d),b=_(g,2),C=_(d,2);{var k=x=>{var D=sf(),y=h(D);U(()=>z(y,l(o))),L(x,D)};V(C,x=>{l(o)&&x(k)})}var S=_(C,2),I=h(S),M=_(I,2),R=h(M);U(()=>{O(f,1,j(ye)),O(m,1,j(be)),O(g,1,j(ye)),O(b,1,j(be)),O(I,1,j(rr)),M.disabled=l(a),O(M,1,j(Ht)),z(R,l(a)?"Saving…":r()?"Save changes":"Add entry")}),br("submit",u,s),Ee(m,()=>l(n),x=>v(n,x)),Ee(b,()=>l(i),x=>v(i,x)),se("click",I,()=>{var x;return(x=t.onCancel)==null?void 0:x.call(t)}),L(e,u),Ce()}ze(["click"]);var uf=q('<p class="text-sm text-stone-400">Loading…</p>'),cf=q('<p class="text-sm text-red-600"> </p>'),ff=q('<p class="text-sm text-stone-400">No knowledgebase entries yet — document procedures, common problems, or reference info like coolant type.</p>'),df=q('<button type="button" class="flex w-full items-center justify-between gap-2 py-3 text-left hover:text-teal-700"><span class="min-w-0"><span class="block truncate font-medium text-stone-900"> </span> <span class="text-xs text-stone-400"> </span></span> <!></button>'),vf=q("<button><!> </button>"),hf=q('<div class="divide-y divide-stone-100"></div> <!>',1),gf=q('<p class="whitespace-pre-wrap text-sm text-stone-700"> </p> <div class="mt-4 flex items-center justify-between border-t border-stone-100 pt-3"><span class="text-xs text-stone-400"> </span> <div class="flex gap-1"><button aria-label="Edit entry"><!></button> <button aria-label="Delete entry"><!></button></div></div>',1),pf=q("<!> <button><!> Add knowledge</button> <!> <!> <!>",1);function mf(e,t){Se(t,!0);const r=20;let n=B(ne([])),i=B(!1),a=B(!0),o=B(!1),s=B(""),u=B(null),c=B(!1),f=B(null);async function m(){v(a,!0),v(s,"");try{const P=await He(`/cars/${t.carId}/knowledge?limit=${r}&offset=0`);v(n,P.items,!0),v(i,P.hasMore,!0)}catch(P){v(s,P.message,!0)}finally{v(a,!1)}}async function d(){v(o,!0);try{const P=await He(`/cars/${t.carId}/knowledge?limit=${r}&offset=${l(n).length}`);v(n,[...l(n),...P.items],!0),v(i,P.hasMore,!0)}catch(P){v(s,P.message,!0)}finally{v(o,!1)}}it(()=>{t.carId,m()});async function g(P){confirm(`Delete "${P.title}"?`)&&(await xr(`/knowledge/${P.id}`),v(u,null),m())}function b(){v(c,!1),v(f,null),m()}function C(P){v(u,null),v(f,P,!0)}var k=pf(),S=Pe(k);{var I=P=>{var H=uf();L(P,H)},M=P=>{var H=cf(),G=h(H);U(()=>z(G,l(s))),L(P,H)},R=P=>{var H=ff();L(P,H)},A=P=>{var H=hf(),G=Pe(H);zt(G,21,()=>l(n),X=>X.id,(X,J)=>{var $=df(),ue=h($),Z=h(ue),Y=h(Z),ie=_(Z,2),le=h(ie),fe=_(ue,2);_e(fe,{name:"chevronRight",class:"h-4 w-4 shrink-0 text-stone-400"}),U(he=>{z(Y,l(J).title),z(le,`Updated ${he??""}`)},[()=>It(l(J).updatedAt)]),se("click",$,()=>v(u,l(J),!0)),L(X,$)});var Q=_(G,2);{var oe=X=>{var J=vf(),$=h(J);_e($,{name:"chevronDown",class:"h-4 w-4"});var ue=_($);U(()=>{J.disabled=l(o),O(J,1,`${nr} mt-3 disabled:opacity-50`),z(ue,` ${l(o)?"Loading…":"Load more"}`)}),se("click",J,d),L(X,J)};V(Q,X=>{l(i)&&X(oe)})}L(P,H)};V(S,P=>{l(a)?P(I):l(s)?P(M,1):l(n).length===0?P(R,2):P(A,-1)})}var p=_(S,2),x=h(p);_e(x,{name:"plus",class:"h-4 w-4"});var D=_(p,2);{var y=P=>{yt(P,{get title(){return l(u).title},onClose:()=>v(u,null),wide:!0,children:(H,G)=>{var Q=gf(),oe=Pe(Q),X=h(oe),J=_(oe,2),$=h(J),ue=h($),Z=_($,2),Y=h(Z),ie=h(Y);_e(ie,{name:"pencil",class:"h-4 w-4"});var le=_(Y,2),fe=h(le);_e(fe,{name:"trash",class:"h-4 w-4"}),U(he=>{z(X,l(u).body),z(ue,`Updated ${he??""}`),O(Y,1,j(qt)),O(le,1,`${qt} hover:text-red-600`)},[()=>It(l(u).updatedAt)]),se("click",Y,()=>C(l(u))),se("click",le,()=>g(l(u))),L(H,Q)},$$slots:{default:!0}})};V(D,P=>{l(u)&&P(y)})}var w=_(D,2);{var T=P=>{yt(P,{title:"Add knowledge entry",onClose:()=>v(c,!1),children:(H,G)=>{so(H,{get carId(){return t.carId},onSaved:b,onCancel:()=>v(c,!1)})},$$slots:{default:!0}})};V(w,P=>{l(c)&&P(T)})}var N=_(w,2);{var F=P=>{yt(P,{title:"Edit knowledge entry",onClose:()=>v(f,null),children:(H,G)=>{so(H,{get carId(){return t.carId},get entry(){return l(f)},onSaved:b,onCancel:()=>v(f,null)})},$$slots:{default:!0}})};V(N,P=>{l(f)&&P(F)})}U(()=>O(p,1,`${nr} mt-3`)),se("click",p,()=>v(c,!0)),L(e,k),Ce()}ze(["click"]);var _f=q('<span class="inline-flex items-center gap-1.5 rounded-md border border-stone-200 py-1 pl-2 pr-1 text-xs text-stone-600"><!> <a target="_blank" rel="noopener" class="hover:underline"> </a> <button type="button" aria-label="Remove file" class="rounded p-0.5 text-stone-400 hover:bg-stone-100 hover:text-red-600"><!></button></span>'),bf=q('<div><span>Attached files</span> <div class="flex flex-wrap gap-2"></div></div>'),yf=q('<p class="mt-1 text-xs text-stone-400"> </p>'),wf=q('<p class="text-sm text-red-600"> </p>'),xf=q(`<form class="space-y-4"><div class="grid grid-cols-2 gap-4"><div><label for="entry-date">Date</label> <input id="entry-date" type="date" required=""/></div> <div><label for="entry-type">Type *</label> <input id="entry-type" placeholder="Oil change" required=""/></div></div> <div class="grid grid-cols-2 gap-4"><div><label for="entry-performed-at">Where</label> <input id="entry-performed-at" placeholder="Bob's Garage"/></div> <div><label for="entry-odometer">Odometer</label> <input id="entry-odometer" type="number"/></div></div> <div><label for="entry-description">Notes</label> <textarea id="entry-description" rows="3"></textarea></div> <label class="flex items-center gap-2 text-sm text-stone-700"><input type="checkbox" class="h-4 w-4 rounded border-stone-300 text-teal-700 focus:ring-teal-500/40"/> This was a full service (resets the service-due reminder)</label> <!> <div><label for="entry-files"> </label> <input id="entry-files" type="file" accept="image/png,application/pdf" multiple="" class="block w-full text-sm text-stone-600 file:mr-3 file:rounded-lg file:border-0 file:bg-stone-100 file:px-3 file:py-1.5 file:text-sm file:font-medium file:text-stone-700 hover:file:bg-stone-200"/> <!></div> <!> <div class="flex justify-end gap-2 pt-2"><button type="button">Cancel</button> <button type="submit"> </button></div></form>`);function lo(e,t){var Ue,vt,ee,me,Ae,Oe,Pt,Ve;Se(t,!0);let r=Be(t,"entry",3,null),n=B(ne(((vt=(Ue=r())==null?void 0:Ue.entryDate)==null?void 0:vt.slice(0,10))??new Date().toISOString().slice(0,10))),i=B(ne(((ee=r())==null?void 0:ee.entryType)??"")),a=B(ne(((me=r())==null?void 0:me.performedAt)??"")),o=B(ne(((Ae=r())==null?void 0:Ae.odometer)??"")),s=B(ne(((Oe=r())==null?void 0:Oe.description)??"")),u=B(ne(((Pt=r())==null?void 0:Pt.isService)??!1)),c=B(ne([])),f=B(ne(((Ve=r())==null?void 0:Ve.files)??[])),m=B(!1),d=B("");function g(te){v(c,Array.from(te.target.files),!0)}async function b(te){confirm(`Remove "${te.fileName}"?`)&&(await xr(`/files/${te.id}`),v(f,l(f).filter(Re=>Re.id!==te.id),!0))}async function C(te){var Je;if(te.preventDefault(),!l(i).trim()){v(d,"Type is required");return}v(m,!0),v(d,"");const Re={entryDate:l(n),entryType:l(i).trim(),performedAt:l(a)||null,odometer:l(o)?Number(l(o)):null,description:l(s)||null,isService:l(u)};try{const Vt=r()?await en(`/service-entries/${r().id}`,Re):await wr(`/cars/${t.carId}/service-entries`,Re);for(const Kt of l(c))await ds(`/service-entries/${Vt.id}/files`,Kt);(Je=t.onSaved)==null||Je.call(t)}catch(Vt){v(d,Vt.message,!0)}finally{v(m,!1)}}var k=xf(),S=h(k),I=h(S),M=h(I),R=_(M,2),A=_(I,2),p=h(A),x=_(p,2),D=_(S,2),y=h(D),w=h(y),T=_(w,2),N=_(y,2),F=h(N),P=_(F,2),H=_(D,2),G=h(H),Q=_(G,2),oe=_(H,2),X=h(oe),J=_(oe,2);{var $=te=>{var Re=bf(),Je=h(Re),Vt=_(Je,2);zt(Vt,21,()=>l(f),Kt=>Kt.id,(Kt,Sr)=>{var tn=_f(),xe=h(tn);_e(xe,{name:"paperclip",class:"h-3.5 w-3.5 shrink-0"});var Rt=_(xe,2),Cr=h(Rt),Ar=_(Rt,2),xs=h(Ar);_e(xs,{name:"x",class:"h-3 w-3"}),U(Es=>{Ge(Rt,"href",Es),z(Cr,l(Sr).fileName)},[()=>Jr(`/files/${l(Sr).id}`)]),se("click",Ar,()=>b(l(Sr))),L(Kt,tn)}),U(()=>O(Je,1,j(ye))),L(te,Re)};V(J,te=>{l(f).length>0&&te($)})}var ue=_(J,2),Z=h(ue),Y=h(Z),ie=_(Z,2),le=_(ie,2);{var fe=te=>{var Re=yf(),Je=h(Re);U(()=>z(Je,`${l(c).length??""} file${l(c).length===1?"":"s"} selected`)),L(te,Re)};V(le,te=>{l(c).length>0&&te(fe)})}var he=_(ue,2);{var Ie=te=>{var Re=wf(),Je=h(Re);U(()=>z(Je,l(d))),L(te,Re)};V(he,te=>{l(d)&&te(Ie)})}var K=_(he,2),ce=h(K),pe=_(ce,2),$e=h(pe);U(()=>{O(M,1,j(ye)),O(R,1,j(be)),O(p,1,j(ye)),O(x,1,j(be)),O(w,1,j(ye)),O(T,1,j(be)),O(F,1,j(ye)),O(P,1,j(be)),O(G,1,j(ye)),O(Q,1,j(be)),O(Z,1,j(ye)),z(Y,l(f).length>0?"Attach more files (PNG/PDF)":"Attach files (PNG/PDF)"),O(ce,1,j(rr)),pe.disabled=l(m),O(pe,1,j(Ht)),z($e,l(m)?"Saving…":r()?"Save changes":"Add entry")}),br("submit",k,C),Ee(R,()=>l(n),te=>v(n,te)),Ee(x,()=>l(i),te=>v(i,te)),Ee(T,()=>l(a),te=>v(a,te)),Ee(P,()=>l(o),te=>v(o,te)),Ee(Q,()=>l(s),te=>v(s,te)),mu(X,()=>l(u),te=>v(u,te)),se("change",ie,g),se("click",ce,()=>{var te;return(te=t.onCancel)==null?void 0:te.call(t)}),L(e,k),Ce()}ze(["click","change"]);var Ef=q('<p class="text-sm text-stone-400">Loading…</p>'),kf=q('<p class="text-sm text-red-600"> </p>'),Sf=q("<button><!> </button>"),Cf=q("<!> <!>",1),Af=q("<!> <button><!> Add service entry</button> <!> <!>",1);function Tf(e,t){Se(t,!0);const r=20;let n=B(ne([])),i=B(!1),a=B(!0),o=B(!1),s=B(""),u=B(!1),c=B(null);async function f(){v(a,!0),v(s,"");try{const y=await He(`/cars/${t.carId}/service-entries?limit=${r}&offset=0`);v(n,y.items,!0),v(i,y.hasMore,!0)}catch(y){v(s,y.message,!0)}finally{v(a,!1)}}async function m(){v(o,!0);try{const y=await He(`/cars/${t.carId}/service-entries?limit=${r}&offset=${l(n).length}`);v(n,[...l(n),...y.items],!0),v(i,y.hasMore,!0)}catch(y){v(s,y.message,!0)}finally{v(o,!1)}}it(()=>{t.carId,f()});async function d(y){confirm(`Delete "${y.entryType}"?`)&&(await xr(`/service-entries/${y.id}`),f())}function g(){v(u,!1),v(c,null),f()}var b=Af(),C=Pe(b);{var k=y=>{var w=Ef();L(y,w)},S=y=>{var w=kf(),T=h(w);U(()=>z(T,l(s))),L(y,w)},I=y=>{var w=Cf(),T=Pe(w);gs(T,{get entries(){return l(n)},onEdit:P=>v(c,P,!0),onDelete:d});var N=_(T,2);{var F=P=>{var H=Sf(),G=h(H);_e(G,{name:"chevronDown",class:"h-4 w-4"});var Q=_(G);U(()=>{H.disabled=l(o),O(H,1,`${nr} mt-3 disabled:opacity-50`),z(Q,` ${l(o)?"Loading…":"Load more"}`)}),se("click",H,m),L(P,H)};V(N,P=>{l(i)&&P(F)})}L(y,w)};V(C,y=>{l(a)?y(k):l(s)?y(S,1):y(I,-1)})}var M=_(C,2),R=h(M);_e(R,{name:"plus",class:"h-4 w-4"});var A=_(M,2);{var p=y=>{yt(y,{title:"Add service entry",onClose:()=>v(u,!1),children:(w,T)=>{lo(w,{get carId(){return t.carId},onSaved:g,onCancel:()=>v(u,!1)})},$$slots:{default:!0}})};V(A,y=>{l(u)&&y(p)})}var x=_(A,2);{var D=y=>{yt(y,{title:"Edit service entry",onClose:()=>v(c,null),children:(w,T)=>{lo(w,{get carId(){return t.carId},get entry(){return l(c)},onSaved:g,onCancel:()=>v(c,null)})},$$slots:{default:!0}})};V(x,y=>{l(c)&&y(D)})}U(()=>O(M,1,`${nr} mt-3`)),se("click",M,()=>v(u,!0)),L(e,b),Ce()}ze(["click"]);var If=q('<p class="text-sm text-red-600"> </p>'),Mf=q('<form class="space-y-4"><div class="grid grid-cols-2 gap-4"><div><label for="fuel-date">Date</label> <input id="fuel-date" type="date" required=""/></div> <div><label for="fuel-location">Where</label> <input id="fuel-location" placeholder="BP"/></div></div> <div class="grid grid-cols-3 gap-4"><div><label for="fuel-litres">Litres *</label> <input id="fuel-litres" type="number" step="0.01" required=""/></div> <div><label for="fuel-cost">Total cost *</label> <input id="fuel-cost" type="number" step="0.01" required=""/></div> <div><label for="fuel-odometer">Odometer</label> <input id="fuel-odometer" type="number"/></div></div> <div><label for="fuel-notes">Notes</label> <textarea id="fuel-notes" rows="2"></textarea></div> <!> <div class="flex justify-end gap-2 pt-2"><button type="button">Cancel</button> <button type="submit"> </button></div></form>');function uo(e,t){var Z,Y,ie,le,fe,he,Ie;Se(t,!0);let r=Be(t,"entry",3,null),n=B(ne(((Y=(Z=r())==null?void 0:Z.entryDate)==null?void 0:Y.slice(0,10))??new Date().toISOString().slice(0,10))),i=B(ne(((ie=r())==null?void 0:ie.litres)??"")),a=B(ne(((le=r())==null?void 0:le.cost)??"")),o=B(ne(((fe=r())==null?void 0:fe.odometer)??"")),s=B(ne(((he=r())==null?void 0:he.location)??"")),u=B(ne(((Ie=r())==null?void 0:Ie.notes)??"")),c=B(!1),f=B("");async function m(K){var pe;if(K.preventDefault(),!l(i)||Number(l(i))<=0){v(f,"Litres is required");return}if(!l(a)||Number(l(a))<=0){v(f,"Cost is required");return}v(c,!0),v(f,"");const ce={entryDate:l(n),litres:Number(l(i)),cost:Number(l(a)),odometer:l(o)?Number(l(o)):null,location:l(s)||null,notes:l(u)||null};try{r()?await en(`/fuel-entries/${r().id}`,ce):await wr(`/cars/${t.carId}/fuel-entries`,ce),(pe=t.onSaved)==null||pe.call(t)}catch($e){v(f,$e.message,!0)}finally{v(c,!1)}}var d=Mf(),g=h(d),b=h(g),C=h(b),k=_(C,2),S=_(b,2),I=h(S),M=_(I,2),R=_(g,2),A=h(R),p=h(A),x=_(p,2),D=_(A,2),y=h(D),w=_(y,2),T=_(D,2),N=h(T),F=_(N,2),P=_(R,2),H=h(P),G=_(H,2),Q=_(P,2);{var oe=K=>{var ce=If(),pe=h(ce);U(()=>z(pe,l(f))),L(K,ce)};V(Q,K=>{l(f)&&K(oe)})}var X=_(Q,2),J=h(X),$=_(J,2),ue=h($);U(()=>{O(C,1,j(ye)),O(k,1,j(be)),O(I,1,j(ye)),O(M,1,j(be)),O(p,1,j(ye)),O(x,1,j(be)),O(y,1,j(ye)),O(w,1,j(be)),O(N,1,j(ye)),O(F,1,j(be)),O(H,1,j(ye)),O(G,1,j(be)),O(J,1,j(rr)),$.disabled=l(c),O($,1,j(Ht)),z(ue,l(c)?"Saving…":r()?"Save changes":"Add fuel-up")}),br("submit",d,m),Ee(k,()=>l(n),K=>v(n,K)),Ee(M,()=>l(s),K=>v(s,K)),Ee(x,()=>l(i),K=>v(i,K)),Ee(w,()=>l(a),K=>v(a,K)),Ee(F,()=>l(o),K=>v(o,K)),Ee(G,()=>l(u),K=>v(u,K)),se("click",J,()=>{var K;return(K=t.onCancel)==null?void 0:K.call(t)}),L(e,d),Ce()}ze(["click"]);var Pf=q('<p class="text-sm text-stone-400">Loading…</p>'),Rf=q('<p class="text-sm text-red-600"> </p>'),Nf=q('<div class="mb-4 grid grid-cols-2 gap-3 sm:grid-cols-4"><div class="rounded-lg border border-stone-200 p-3"><p class="text-xs text-stone-400">This month</p> <p class="text-lg font-semibold text-stone-900"> </p></div> <div class="rounded-lg border border-stone-200 p-3"><p class="text-xs text-stone-400">Last 14 days</p> <p class="text-lg font-semibold text-stone-900"> </p></div> <div class="rounded-lg border border-stone-200 p-3"><p class="text-xs text-stone-400">Avg price/L</p> <p class="text-lg font-semibold text-stone-900"> </p></div> <div class="rounded-lg border border-stone-200 p-3"><p class="text-xs text-stone-400">Avg L/100km</p> <p class="text-lg font-semibold text-stone-900"> </p></div></div>'),Lf=q('<p class="text-sm text-stone-400">No fuel-ups logged yet.</p>'),Df=q('<li class="flex items-center justify-between gap-3 py-3 first:pt-0 last:pb-0"><div class="min-w-0"><p class="font-medium text-stone-900"> <span class="font-normal text-stone-400"> </span></p> <p class="text-sm text-stone-500"> <!> <!></p></div> <div class="flex shrink-0 gap-1"><button aria-label="Edit fuel entry"><!></button> <button aria-label="Delete fuel entry"><!></button></div></li>'),Bf=q("<button><!> </button>"),Ff=q('<ul class="divide-y divide-stone-100"></ul> <!>',1),Of=q("<!> <!>",1),qf=q("<!> <button><!> Add fuel-up</button> <!> <!>",1);function jf(e,t){Se(t,!0);const r=20;let n=B(ne([])),i=B(!1),a=B(!0),o=B(!1),s=B(""),u=B(!1),c=B(null);async function f(){v(a,!0),v(s,"");try{const w=await He(`/cars/${t.carId}/fuel-entries?limit=${r}&offset=0`);v(n,w.items,!0),v(i,w.hasMore,!0)}catch(w){v(s,w.message,!0)}finally{v(a,!1)}}async function m(){v(o,!0);try{const w=await He(`/cars/${t.carId}/fuel-entries?limit=${r}&offset=${l(n).length}`);v(n,[...l(n),...w.items],!0),v(i,w.hasMore,!0)}catch(w){v(s,w.message,!0)}finally{v(o,!1)}}it(()=>{t.carId,f()});async function d(w){confirm(`Delete this fuel entry from ${It(w.entryDate)}?`)&&(await xr(`/fuel-entries/${w.id}`),f())}function g(){v(u,!1),v(c,null),f()}let b=Ct(()=>{const w=new Date,T=new Date(w.getFullYear(),w.getMonth(),1),N=new Date(w);N.setDate(w.getDate()-14);let F=0,P=0,H=0,G=0;for(const J of l(n)){const $=new Date(J.entryDate);H+=J.cost,G+=J.litres,$>=T&&(F+=J.cost),$>=N&&(P+=J.cost)}const Q=G>0?H/G:null,oe=l(n).filter(J=>J.odometer!=null).slice().sort((J,$)=>J.odometer-$.odometer);let X=null;if(oe.length>=2){const J=oe[0],$=oe[oe.length-1],ue=$.odometer-J.odometer,Z=l(n).filter(Y=>Y.odometer>J.odometer&&Y.odometer<=$.odometer).reduce((Y,ie)=>Y+ie.litres,0);ue>0&&Z>0&&(X=Z/ue*100)}return{monthCost:F,fortnightCost:P,avgPricePerLitre:Q,avgL100km:X}});var C=qf(),k=Pe(C);{var S=w=>{var T=Pf();L(w,T)},I=w=>{var T=Rf(),N=h(T);U(()=>z(N,l(s))),L(w,T)},M=w=>{var T=Of(),N=Pe(T);{var F=Q=>{var oe=Nf(),X=h(oe),J=_(h(X),2),$=h(J),ue=_(X,2),Z=_(h(ue),2),Y=h(Z),ie=_(ue,2),le=_(h(ie),2),fe=h(le),he=_(ie,2),Ie=_(h(he),2),K=h(Ie);U((ce,pe,$e,Ue)=>{z($,`$${ce??""}`),z(Y,`$${pe??""}`),z(fe,$e),z(K,Ue)},[()=>l(b).monthCost.toFixed(2),()=>l(b).fortnightCost.toFixed(2),()=>l(b).avgPricePerLitre!=null?`$${l(b).avgPricePerLitre.toFixed(2)}`:"—",()=>l(b).avgL100km!=null?l(b).avgL100km.toFixed(1):"—"]),L(Q,oe)};V(N,Q=>{l(n).length>0&&Q(F)})}var P=_(N,2);{var H=Q=>{var oe=Lf();L(Q,oe)},G=Q=>{var oe=Ff(),X=Pe(oe);zt(X,21,()=>l(n),ue=>ue.id,(ue,Z)=>{var Y=Df(),ie=h(Y),le=h(ie),fe=h(le),he=_(fe),Ie=h(he),K=_(le,2),ce=h(K),pe=_(ce);{var $e=Ve=>{var te=Gr();U(()=>z(te,`· ${l(Z).location??""}`)),L(Ve,te)};V(pe,Ve=>{l(Z).location&&Ve($e)})}var Ue=_(pe,2);{var vt=Ve=>{var te=Gr();U(Re=>z(te,`· ${Re??""} km`),[()=>l(Z).odometer.toLocaleString()]),L(Ve,te)};V(Ue,Ve=>{l(Z).odometer&&Ve(vt)})}var ee=_(ie,2),me=h(ee),Ae=h(me);_e(Ae,{name:"pencil",class:"h-4 w-4"});var Oe=_(me,2),Pt=h(Oe);_e(Pt,{name:"trash",class:"h-4 w-4"}),U((Ve,te,Re,Je)=>{z(fe,`${Ve??""} L · $${te??""} `),z(Ie,`($${Re??""}/L)`),z(ce,`${Je??""} `),O(me,1,j(qt)),O(Oe,1,`${qt} hover:text-red-600`)},[()=>l(Z).litres.toFixed(1),()=>l(Z).cost.toFixed(2),()=>(l(Z).cost/l(Z).litres).toFixed(2),()=>It(l(Z).entryDate)]),se("click",me,()=>v(c,l(Z),!0)),se("click",Oe,()=>d(l(Z))),L(ue,Y)});var J=_(X,2);{var $=ue=>{var Z=Bf(),Y=h(Z);_e(Y,{name:"chevronDown",class:"h-4 w-4"});var ie=_(Y);U(()=>{Z.disabled=l(o),O(Z,1,`${nr} mt-3 disabled:opacity-50`),z(ie,` ${l(o)?"Loading…":"Load more"}`)}),se("click",Z,m),L(ue,Z)};V(J,ue=>{l(i)&&ue($)})}L(Q,oe)};V(P,Q=>{l(n).length===0?Q(H):Q(G,-1)})}L(w,T)};V(k,w=>{l(a)?w(S):l(s)?w(I,1):w(M,-1)})}var R=_(k,2),A=h(R);_e(A,{name:"plus",class:"h-4 w-4"});var p=_(R,2);{var x=w=>{yt(w,{title:"Add fuel-up",onClose:()=>v(u,!1),children:(T,N)=>{uo(T,{get carId(){return t.carId},onSaved:g,onCancel:()=>v(u,!1)})},$$slots:{default:!0}})};V(p,w=>{l(u)&&w(x)})}var D=_(p,2);{var y=w=>{yt(w,{title:"Edit fuel-up",onClose:()=>v(c,null),children:(T,N)=>{uo(T,{get carId(){return t.carId},get entry(){return l(c)},onSaved:g,onCancel:()=>v(c,null)})},$$slots:{default:!0}})};V(D,w=>{l(c)&&w(y)})}U(()=>O(R,1,`${nr} mt-3`)),se("click",R,()=>v(u,!0)),L(e,C),Ce()}ze(["click"]);var Uf=q('<p class="text-sm text-stone-400">Loading…</p>'),Hf=q('<p class="text-sm text-red-600"> </p>'),zf=q('<form class="mt-1 flex items-center gap-2"><input type="number"/> <button type="submit"> </button> <button type="button" class="text-sm text-stone-500">Cancel</button></form>'),Vf=q('<button class="mt-0.5 flex items-center gap-1.5 text-lg font-semibold text-stone-900 hover:text-teal-700"> <!></button>'),Kf=q('<div><p class="text-xs uppercase tracking-wide text-stone-400">Estimated usage</p> <p class="mt-0.5 text-lg font-semibold text-stone-900"> </p></div>'),Yf=q('<span class="text-sm font-normal text-stone-400"> </span>'),Gf=q('<div><p class="text-xs uppercase tracking-wide text-stone-400">Next 100,000 km</p> <p class="mt-0.5 text-lg font-semibold text-stone-900"> <!></p> <p class="mt-0.5 text-xs text-stone-400">At your current rate, from today — not tied to a round odometer number.</p></div>'),Jf=q('<p class="text-xs text-stone-400">Log a service or fuel-up with an odometer reading (from a different date) to start estimating your usage rate.</p>'),Wf=q('<div><p class="text-xs uppercase tracking-wide text-stone-400">Odometer</p> <!></div> <!> <!>',1),Qf=q('<div class="space-y-4"><!></div>');function Zf(e,t){Se(t,!0);let r=B(null),n=B(!0),i=B(""),a=B(!1),o=B(""),s=B(!1);async function u(){v(n,!0),v(i,"");try{v(r,await He(`/cars/${t.carId}/mileage`),!0)}catch(k){v(i,k.message,!0)}finally{v(n,!1)}}it(()=>{t.carId,u()});function c(){v(o,t.odometer??"",!0),v(a,!0)}async function f(k){var S;if(k.preventDefault(),!(l(o)===""||Number(l(o))<0)){v(s,!0);try{await Eu(`/cars/${t.carId}/odometer`,{odometer:Number(l(o))}),v(a,!1),await u(),(S=t.onUpdated)==null||S.call(t)}catch(I){v(i,I.message,!0)}finally{v(s,!1)}}}var m=Qf(),d=h(m);{var g=k=>{var S=Uf();L(k,S)},b=k=>{var S=Hf(),I=h(S);U(()=>z(I,l(i))),L(k,S)},C=k=>{var S=Wf(),I=Pe(S),M=_(h(I),2);{var R=T=>{var N=zf(),F=h(N);ml(F);var P=_(F,2),H=h(P),G=_(P,2);U(()=>{O(F,1,`${be} w-32 py-1`),P.disabled=l(s),O(P,1,`${Ht} px-3 py-1 text-sm`),z(H,l(s)?"Saving…":"Save")}),br("submit",N,f),Ee(F,()=>l(o),Q=>v(o,Q)),se("click",G,()=>v(a,!1)),L(T,N)},A=T=>{var N=Vf(),F=h(N),P=_(F);_e(P,{name:"pencil",class:"h-3.5 w-3.5 text-stone-400"}),U(H=>z(F,`${H??""} `),[()=>l(r).currentOdometer!=null?`${l(r).currentOdometer.toLocaleString()} km`:"Not set"]),se("click",N,c),L(T,N)};V(M,T=>{l(a)?T(R):T(A,-1)})}var p=_(I,2);{var x=T=>{var N=Kf(),F=_(h(N),2),P=h(F);U(H=>z(P,`~${H??""} km/year`),[()=>Math.round(l(r).kmPerYear).toLocaleString()]),L(T,N)};V(p,T=>{l(r).kmPerYear&&T(x)})}var D=_(p,2);{var y=T=>{var N=Gf(),F=_(h(N),2),P=h(F),H=_(P);{var G=Q=>{var oe=Yf(),X=h(oe);U(J=>z(X,`· by ~${J??""}`),[()=>It(l(r).next100kEta)]),L(Q,oe)};V(H,Q=>{l(r).next100kEta&&Q(G)})}U(Q=>z(P,`~${Q??""} years `),[()=>l(r).yearsPer100k.toFixed(1)]),L(T,N)},w=T=>{var N=Jf();L(T,N)};V(D,T=>{l(r).yearsPer100k?T(y):T(w,-1)})}L(k,S)};V(d,k=>{l(n)?k(g):l(i)?k(b,1):l(r)&&k(C,2)})}L(e,m),Ce()}ze(["click"]);var Xf=q('<p class="text-sm text-stone-400">Loading…</p>'),$f=q('<p class="text-sm text-red-600"> </p>'),co=q("<span> </span>"),ed=q("<button><!> </button>"),td=q('<div class="space-y-6"><!> <div class="flex flex-wrap items-start justify-between gap-4"><div><!> <p class="mt-2 text-stone-500"> </p> <div class="mt-2 flex flex-wrap gap-2"><!> <!> <button class="rounded-full border border-stone-200 px-2.5 py-0.5 text-xs font-medium text-stone-600 hover:border-teal-600 hover:text-teal-700"> </button></div></div> <div class="flex shrink-0 gap-2"><button><!> Share</button> <a><!> Edit</a> <button><!> Delete</button></div></div> <div class="flex gap-1 overflow-x-auto border-b border-stone-200"></div> <div><!></div></div> <!> <!>',1);function rd(e,t){Se(t,!0);let r=Ct(()=>t.params.id),n=B(null),i=B(!0),a=B(""),o=B(!1),s=B(!1);const u=[{key:"reminders",label:"Reminders",icon:"check"},{key:"knowledge",label:"Knowledgebase",icon:"bookOpen"},{key:"service",label:"Service history",icon:"paperclip"},{key:"fuel",label:"Fuel",icon:"fuel"}];let c=B("reminders");async function f(){v(n,await He(`/cars/${l(r)}`),!0)}it(()=>{l(r),v(i,!0),v(a,""),f().catch(I=>v(a,I.message,!0)).finally(()=>v(i,!1))});async function m(){confirm(`Delete ${l(n).rego} and all its history? This can't be undone.`)&&(await xr(`/cars/${l(r)}`),ua("/"))}function d(I,M){const R=Gi(I);let A="border-stone-200 text-stone-600";return R!==null&&(R<0?A="border-red-200 bg-red-50 text-red-700":R<=30&&(A="border-amber-200 bg-amber-50 text-amber-700")),{text:`${M} ${It(I)}`,tone:A}}var g=Zt(),b=Pe(g);{var C=I=>{var M=Xf();L(I,M)},k=I=>{var M=$f(),R=h(M);U(()=>z(R,l(a))),L(I,M)},S=I=>{var M=td(),R=Pe(M),A=h(R);Ic(A,{get carId(){return l(r)},get hasPhoto(){return l(n).hasPhoto},get alt(){return l(n).rego},onUploaded:f});var p=_(A,2),x=h(p),D=h(x);ca(D,{get rego(){return l(n).rego},size:"lg"});var y=_(D,2),w=h(y),T=_(y,2),N=h(T);{var F=ee=>{const me=Ct(()=>d(l(n).regoExpiry,"Rego"));var Ae=co(),Oe=h(Ae);U(()=>{O(Ae,1,`rounded-full border px-2.5 py-0.5 text-xs font-medium ${l(me).tone??""}`),z(Oe,l(me).text)}),L(ee,Ae)};V(N,ee=>{l(n).regoExpiry&&ee(F)})}var P=_(N,2);{var H=ee=>{const me=Ct(()=>d(l(n).wofExpiry,"WoF"));var Ae=co(),Oe=h(Ae);U(()=>{O(Ae,1,`rounded-full border px-2.5 py-0.5 text-xs font-medium ${l(me).tone??""}`),z(Oe,l(me).text)}),L(ee,Ae)};V(P,ee=>{l(n).wofExpiry&&ee(H)})}var G=_(P,2),Q=h(G),oe=_(x,2),X=h(oe),J=h(X);_e(J,{name:"share",class:"h-4 w-4"});var $=_(X,2),ue=h($);_e(ue,{name:"pencil",class:"h-4 w-4"});var Z=_($,2),Y=h(Z);_e(Y,{name:"trash",class:"h-4 w-4"});var ie=_(p,2);zt(ie,21,()=>u,ee=>ee.key,(ee,me)=>{var Ae=ed(),Oe=h(Ae);_e(Oe,{get name(){return l(me).icon},class:"h-4 w-4"});var Pt=_(Oe);U(()=>{O(Ae,1,`flex shrink-0 items-center gap-1.5 border-b-2 px-3 py-2.5 text-sm font-medium transition-colors
${l(c)===l(me).key?"border-teal-700 text-teal-700":"border-transparent text-stone-500 hover:border-stone-300 hover:text-stone-900"}`),z(Pt,` ${l(me).label??""}`)}),se("click",Ae,()=>v(c,l(me).key,!0)),L(ee,Ae)});var le=_(ie,2),fe=h(le);{var he=ee=>{ps(ee,{get carId(){return l(r)}})},Ie=ee=>{mf(ee,{get carId(){return l(r)}})},K=ee=>{Tf(ee,{get carId(){return l(r)}})},ce=ee=>{jf(ee,{get carId(){return l(r)}})};V(fe,ee=>{l(c)==="reminders"?ee(he):l(c)==="knowledge"?ee(Ie,1):l(c)==="service"?ee(K,2):l(c)==="fuel"&&ee(ce,3)})}var pe=_(R,2);{var $e=ee=>{yt(ee,{get title(){return`Share ${l(n).rego??""}`},onClose:()=>v(o,!1),children:(me,Ae)=>{of(me,{get car(){return l(n)},onUpdated:Oe=>v(n,Oe,!0)})},$$slots:{default:!0}})};V(pe,ee=>{l(o)&&ee($e)})}var Ue=_(pe,2);{var vt=ee=>{yt(ee,{title:"Mileage",onClose:()=>v(s,!1),children:(me,Ae)=>{Zf(me,{get carId(){return l(r)},get odometer(){return l(n).odometer},onUpdated:f})},$$slots:{default:!0}})};V(Ue,ee=>{l(s)&&ee(vt)})}U((ee,me)=>{z(w,`${ee??""}${l(n).color?` · ${l(n).color}`:""}`),z(Q,me),O(X,1,j(rr)),Ge($,"href",`#/cars/${l(r)??""}/edit`),O($,1,j(rr)),O(Z,1,j(vs)),O(le,1,j(hs))},[()=>[l(n).year,l(n).make,l(n).model].filter(Boolean).join(" "),()=>l(n).odometer?`${l(n).odometer.toLocaleString()} km`:"Set odometer"]),se("click",G,()=>v(s,!0)),se("click",X,()=>v(o,!0)),se("click",Z,m),L(I,M)};V(b,I=>{l(i)?I(C):l(a)?I(k,1):l(n)&&I(S,2)})}L(e,g),Ce()}ze(["click"]);var nd=q('<p class="text-sm text-red-600"> </p>'),id=q('<form class="space-y-4"><div><label for="car-rego">Rego *</label> <input id="car-rego" required=""/></div> <div class="grid grid-cols-2 gap-4"><div><label for="car-make">Make</label> <input id="car-make"/></div> <div><label for="car-model">Model</label> <input id="car-model"/></div></div> <div class="grid grid-cols-3 gap-4"><div><label for="car-year">Year</label> <input id="car-year" type="number"/></div> <div><label for="car-color">Color</label> <input id="car-color"/></div> <div><label for="car-odometer">Odometer</label> <input id="car-odometer" type="number"/></div></div> <div class="grid grid-cols-2 gap-4"><div><label for="car-rego-expiry">Rego expiry</label> <input id="car-rego-expiry" type="date"/></div> <div><label for="car-wof-expiry">WoF expiry</label> <input id="car-wof-expiry" type="date"/></div></div> <div><span>Service interval (optional)</span> <p class="mb-1.5 -mt-1 text-xs text-stone-400">Whichever comes first triggers a reminder, counted from the last entry marked "full service".</p> <div class="grid grid-cols-2 gap-4"><div><label for="car-service-km" class="sr-only">Every (km)</label> <input id="car-service-km" type="number" placeholder="Every (km)"/></div> <div><label for="car-service-months" class="sr-only">Every (months)</label> <input id="car-service-months" type="number" placeholder="Every (months)"/></div></div></div> <!> <button type="submit"> </button></form>');function ws(e,t){var Oe,Pt,Ve,te,Re,Je,Vt,Kt,Sr,tn;Se(t,!0);let r=Be(t,"car",3,null),n=B(ne(((Oe=r())==null?void 0:Oe.rego)??"")),i=B(ne(((Pt=r())==null?void 0:Pt.make)??"")),a=B(ne(((Ve=r())==null?void 0:Ve.model)??"")),o=B(ne(((te=r())==null?void 0:te.year)??"")),s=B(ne(((Re=r())==null?void 0:Re.color)??"")),u=B(ne(((Je=r())==null?void 0:Je.odometer)??"")),c=B(ne((Vt=r())!=null&&Vt.regoExpiry?r().regoExpiry.slice(0,10):"")),f=B(ne((Kt=r())!=null&&Kt.wofExpiry?r().wofExpiry.slice(0,10):"")),m=B(ne(((Sr=r())==null?void 0:Sr.serviceIntervalKm)??"")),d=B(ne(((tn=r())==null?void 0:tn.serviceIntervalMonths)??"")),g=B(!1),b=B("");async function C(xe){var Cr;if(xe.preventDefault(),!l(n).trim()){v(b,"Rego is required");return}v(g,!0),v(b,"");const Rt={rego:l(n).trim(),make:l(i)||null,model:l(a)||null,year:l(o)?Number(l(o)):null,color:l(s)||null,odometer:l(u)?Number(l(u)):null,regoExpiry:l(c)||null,wofExpiry:l(f)||null,serviceIntervalKm:l(m)?Number(l(m)):null,serviceIntervalMonths:l(d)?Number(l(d)):null};try{const Ar=r()?await en(`/cars/${r().id}`,Rt):await wr("/cars",Rt);(Cr=t.onSave)==null||Cr.call(t,Ar)}catch(Ar){v(b,Ar.message,!0)}finally{v(g,!1)}}var k=id(),S=h(k),I=h(S),M=_(I,2),R=_(S,2),A=h(R),p=h(A),x=_(p,2),D=_(A,2),y=h(D),w=_(y,2),T=_(R,2),N=h(T),F=h(N),P=_(F,2),H=_(N,2),G=h(H),Q=_(G,2),oe=_(H,2),X=h(oe),J=_(X,2),$=_(T,2),ue=h($),Z=h(ue),Y=_(Z,2),ie=_(ue,2),le=h(ie),fe=_(le,2),he=_($,2),Ie=h(he),K=_(Ie,4),ce=h(K),pe=_(h(ce),2),$e=_(ce,2),Ue=_(h($e),2),vt=_(he,2);{var ee=xe=>{var Rt=nd(),Cr=h(Rt);U(()=>z(Cr,l(b))),L(xe,Rt)};V(vt,xe=>{l(b)&&xe(ee)})}var me=_(vt,2),Ae=h(me);U(()=>{O(I,1,j(ye)),O(M,1,j(be)),O(p,1,j(ye)),O(x,1,j(be)),O(y,1,j(ye)),O(w,1,j(be)),O(F,1,j(ye)),O(P,1,j(be)),O(G,1,j(ye)),O(Q,1,j(be)),O(X,1,j(ye)),O(J,1,j(be)),O(Z,1,j(ye)),O(Y,1,j(be)),O(le,1,j(ye)),O(fe,1,j(be)),O(Ie,1,j(ye)),O(pe,1,j(be)),O(Ue,1,j(be)),me.disabled=l(g),O(me,1,j(Ht)),z(Ae,l(g)?"Saving…":r()?"Save changes":"Create car")}),br("submit",k,C),Ee(M,()=>l(n),xe=>v(n,xe)),Ee(x,()=>l(i),xe=>v(i,xe)),Ee(w,()=>l(a),xe=>v(a,xe)),Ee(P,()=>l(o),xe=>v(o,xe)),Ee(Q,()=>l(s),xe=>v(s,xe)),Ee(J,()=>l(u),xe=>v(u,xe)),Ee(Y,()=>l(c),xe=>v(c,xe)),Ee(fe,()=>l(f),xe=>v(f,xe)),Ee(pe,()=>l(m),xe=>v(m,xe)),Ee(Ue,()=>l(d),xe=>v(d,xe)),L(e,k),Ce()}var ad=q('<div class="mx-auto max-w-md"><h2 class="mb-4 text-lg font-semibold tracking-tight text-stone-900">Add a car</h2> <div><!></div></div>');function od(e,t){Se(t,!1);function r(o){ua(`/cars/${o.id}`)}_u();var n=ad(),i=_(h(n),2),a=h(i);ws(a,{onSave:r}),U(()=>O(i,1,`${Xn} p-5`)),L(e,n),Ce()}var sd=q('<p class="text-sm text-stone-400">Loading…</p>'),ld=q('<p class="text-sm text-red-600"> </p>'),ud=q("<div><!></div>"),cd=q('<div class="mx-auto max-w-md"><h2 class="mb-4 text-lg font-semibold tracking-tight text-stone-900">Edit car</h2> <!></div>');function fd(e,t){Se(t,!0);let r=B(null),n=B(!0),i=B("");fs(async()=>{try{v(r,await He(`/cars/${t.params.id}`),!0)}catch(m){v(i,m.message,!0)}finally{v(n,!1)}});function a(){ua(`/cars/${t.params.id}`)}var o=cd(),s=_(h(o),2);{var u=m=>{var d=sd();L(m,d)},c=m=>{var d=ld(),g=h(d);U(()=>z(g,l(i))),L(m,d)},f=m=>{var d=ud(),g=h(d);ws(g,{get car(){return l(r)},onSave:a}),U(()=>O(d,1,`${Xn} p-5`)),L(m,d)};V(s,m=>{l(n)?m(u):l(i)?m(c,1):m(f,-1)})}L(e,o),Ce()}var dd=q('<div class="flex min-h-screen items-center justify-center text-stone-400">Loading…</div>'),vd=q('<div class="min-h-screen bg-stone-50"><div class="h-1.5 bg-teal-700"></div> <header class="border-b border-stone-200 bg-white/90 backdrop-blur-sm"><div class="mx-auto flex max-w-4xl items-center justify-between px-4 py-3"><a href="#/" class="flex items-center gap-2 text-base font-semibold tracking-tight text-stone-900"><span class="flex h-8 w-8 items-center justify-center rounded-lg bg-teal-700 text-base shadow-sm shadow-teal-900/30">🔧</span> My Garage</a> <div class="flex items-center gap-3"><span class="flex h-8 w-8 items-center justify-center rounded-full bg-teal-100 text-xs font-semibold text-teal-700"> </span> <button class="text-sm text-stone-500 hover:text-stone-900">Log out</button></div></div></header> <main class="mx-auto max-w-4xl px-4 py-6"><!></main></div>');function hd(e,t){Se(t,!0);const r=()=>vl(oi,"$user",n),[n,i]=hl(),a={"/":kc,"/cars/new":od,"/cars/:id/edit":fd,"/cars/:id":rd,"/share/:token":Ju};let o=B(ne(window.location.hash.startsWith("#/share/")));window.addEventListener("hashchange",()=>{v(o,window.location.hash.startsWith("#/share/"),!0)});let s=B(!0),u=B(!1);async function c(){try{ga(oi,await He("/me")),v(u,!0)}catch{v(u,!1)}finally{v(s,!1)}}l(o)?v(s,!1):c();async function f(){await wr("/auth/logout",{}),ga(oi,null),v(u,!1)}function m(I,M){return(I||M||"?").split(/\s+/).map(A=>A[0]).slice(0,2).join("").toUpperCase()}var d=Zt(),g=Pe(d);{var b=I=>{Pa(I,{get routes(){return a}})},C=I=>{var M=dd();L(I,M)},k=I=>{Su(I)},S=I=>{var M=vd(),R=_(h(M),2),A=h(R),p=_(h(A),2),x=h(p),D=h(x),y=_(x,2),w=_(R,2),T=h(w);Pa(T,{get routes(){return a}}),U(N=>z(D,N),[()=>{var N,F;return m((N=r())==null?void 0:N.name,(F=r())==null?void 0:F.email)}]),se("click",y,f),L(I,M)};V(g,I=>{l(o)?I(b):l(s)?I(C,1):l(u)?I(S,-1):I(k,2)})}L(e,d),Ce(),i()}ze(["click"]);tu(hd,{target:document.getElementById("app")});