wherever-dev 0.19.2 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.js +41 -1
- package/dist/index.js.map +1 -1
- package/dist/session-pool.d.ts +19 -0
- package/dist/session-pool.d.ts.map +1 -1
- package/dist/session-pool.js +31 -7
- package/dist/session-pool.js.map +1 -1
- package/dist/session-stars.d.ts +61 -0
- package/dist/session-stars.d.ts.map +1 -0
- package/dist/session-stars.js +193 -0
- package/dist/session-stars.js.map +1 -0
- package/dist/session-types.d.ts +5 -0
- package/dist/session-types.d.ts.map +1 -1
- package/package.json +1 -1
- package/public/_app/immutable/assets/{0.Be_gG-_m.css → 0.BKJ49K71.css} +1 -1
- package/public/_app/immutable/chunks/Bd5ZlnTc.js +2 -0
- package/public/_app/immutable/chunks/{DuS4tUIT.js.map → Bd5ZlnTc.js.map} +1 -1
- package/public/_app/immutable/chunks/C9ocFjai.js +2 -0
- package/public/_app/immutable/chunks/{BQPpGHw6.js.map → C9ocFjai.js.map} +1 -1
- package/public/_app/immutable/chunks/{DxTGwxLe.js → Dv0k4836.js} +2 -2
- package/public/_app/immutable/chunks/{DxTGwxLe.js.map → Dv0k4836.js.map} +1 -1
- package/public/_app/immutable/entry/{app.D0o7KH5i.js → app.XDJeHJSD.js} +3 -3
- package/public/_app/immutable/entry/{app.D0o7KH5i.js.map → app.XDJeHJSD.js.map} +1 -1
- package/public/_app/immutable/entry/start.DmSDB-jz.js +2 -0
- package/public/_app/immutable/entry/start.DmSDB-jz.js.map +1 -0
- package/public/_app/immutable/nodes/{0.QmgixO0O.js → 0.D1iNBbQ-.js} +3 -3
- package/public/_app/immutable/nodes/{0.QmgixO0O.js.map → 0.D1iNBbQ-.js.map} +1 -1
- package/public/_app/immutable/nodes/{1.1znPEWAi.js → 1.CBLPrzOP.js} +2 -2
- package/public/_app/immutable/nodes/{1.1znPEWAi.js.map → 1.CBLPrzOP.js.map} +1 -1
- package/public/_app/immutable/nodes/2.Cypexl_F.js +120 -0
- package/public/_app/immutable/nodes/2.Cypexl_F.js.map +1 -0
- package/public/_app/version.json +1 -1
- package/public/index.html +11 -11
- package/public/service-worker.js +1 -1
- package/public/_app/immutable/chunks/BQPpGHw6.js +0 -2
- package/public/_app/immutable/chunks/DuS4tUIT.js +0 -2
- package/public/_app/immutable/entry/start.UO7O7dio.js +0 -2
- package/public/_app/immutable/entry/start.UO7O7dio.js.map +0 -1
- package/public/_app/immutable/nodes/2._c_bFISu.js +0 -120
- package/public/_app/immutable/nodes/2._c_bFISu.js.map +0 -1
package/public/_app/version.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"
|
|
1
|
+
{"version":"463ead2"}
|
package/public/index.html
CHANGED
|
@@ -49,33 +49,33 @@
|
|
|
49
49
|
})();
|
|
50
50
|
</script>
|
|
51
51
|
|
|
52
|
-
<link href="./_app/immutable/entry/start.
|
|
53
|
-
<link href="./_app/immutable/chunks/
|
|
52
|
+
<link href="./_app/immutable/entry/start.DmSDB-jz.js" rel="modulepreload">
|
|
53
|
+
<link href="./_app/immutable/chunks/C9ocFjai.js" rel="modulepreload">
|
|
54
54
|
<link href="./_app/immutable/chunks/CAL8yDNt.js" rel="modulepreload">
|
|
55
|
-
<link href="./_app/immutable/entry/app.
|
|
55
|
+
<link href="./_app/immutable/entry/app.XDJeHJSD.js" rel="modulepreload">
|
|
56
56
|
<link href="./_app/immutable/chunks/BORm3wtc.js" rel="modulepreload">
|
|
57
57
|
<link href="./_app/immutable/chunks/DsnmJJEf.js" rel="modulepreload">
|
|
58
58
|
<link href="./_app/immutable/chunks/Cjaz9aih.js" rel="modulepreload">
|
|
59
|
-
<link href="./_app/immutable/nodes/0.
|
|
60
|
-
<link href="./_app/immutable/chunks/
|
|
61
|
-
<link href="./_app/immutable/chunks/
|
|
62
|
-
<link href="./_app/immutable/nodes/2.
|
|
59
|
+
<link href="./_app/immutable/nodes/0.D1iNBbQ-.js" rel="modulepreload">
|
|
60
|
+
<link href="./_app/immutable/chunks/Bd5ZlnTc.js" rel="modulepreload">
|
|
61
|
+
<link href="./_app/immutable/chunks/Dv0k4836.js" rel="modulepreload">
|
|
62
|
+
<link href="./_app/immutable/nodes/2.Cypexl_F.js" rel="modulepreload">
|
|
63
63
|
|
|
64
|
-
<link href="./_app/immutable/assets/0.
|
|
64
|
+
<link href="./_app/immutable/assets/0.BKJ49K71.css" rel="stylesheet">
|
|
65
65
|
</head>
|
|
66
66
|
<body data-sveltekit-preload-data="hover">
|
|
67
67
|
<div style="display: contents">
|
|
68
68
|
<script>
|
|
69
69
|
{
|
|
70
|
-
|
|
70
|
+
__sveltekit_1pkch5y = {
|
|
71
71
|
base: new URL(".", location).pathname.slice(0, -1)
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
const element = document.currentScript.parentElement;
|
|
75
75
|
|
|
76
76
|
Promise.all([
|
|
77
|
-
import("./_app/immutable/entry/start.
|
|
78
|
-
import("./_app/immutable/entry/app.
|
|
77
|
+
import("./_app/immutable/entry/start.DmSDB-jz.js"),
|
|
78
|
+
import("./_app/immutable/entry/app.XDJeHJSD.js")
|
|
79
79
|
]).then(([kit, app]) => {
|
|
80
80
|
kit.start(app, element);
|
|
81
81
|
});
|
package/public/service-worker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a=location.pathname.split("/").slice(0,-1).join("/"),b=[a+"/_app/immutable/entry/start.
|
|
1
|
+
const a=location.pathname.split("/").slice(0,-1).join("/"),b=[a+"/_app/immutable/entry/start.DmSDB-jz.js",a+"/_app/immutable/entry/app.XDJeHJSD.js",a+"/_app/immutable/nodes/0.D1iNBbQ-.js",a+"/_app/immutable/assets/0.BKJ49K71.css",a+"/_app/immutable/assets/SymbolsNerdFontMono-Regular.D4tvPAg7.woff2",a+"/_app/immutable/nodes/1.CBLPrzOP.js",a+"/_app/immutable/nodes/2.Cypexl_F.js",a+"/_app/immutable/chunks/BORm3wtc.js",a+"/_app/immutable/chunks/Bd5ZlnTc.js",a+"/_app/immutable/chunks/C9ocFjai.js",a+"/_app/immutable/chunks/CAL8yDNt.js",a+"/_app/immutable/chunks/Cjaz9aih.js",a+"/_app/immutable/chunks/DsnmJJEf.js",a+"/_app/immutable/chunks/Dv0k4836.js"],y=[a+"/logo.svg",a+"/pwa/apple-touch-icon.png",a+"/pwa/favicon-192.png",a+"/pwa/favicon-512.png",a+"/pwa/favicon-maskable-192.png",a+"/pwa/favicon-maskable-512.png",a+"/pwa/favicon.ico",a+"/pwa/favicon.svg",a+"/pwa/manifest.webmanifest",a+"/pwa/screenshot-desktop.png",a+"/pwa/screenshot-mobile.png",a+"/robots.txt"],v=[a+"/"],m="463ead2",k=m,s=self;let w=[];w=b.concat(v).concat(y.filter(t=>t.indexOf("pwa/")===-1)).filter(t=>t.indexOf("SymbolsNerdFont")===-1);let u=!0;function o(...t){u&&console.debug(`[Service Worker #${k}] ${t[0]}`,...t.slice(1))}const d=`cache-${m}`,h=[];h.push("localhost");const $=["/sessions(\\?|$|/)","/models(\\?|$|/)","/config(\\?|$|/)","/check-path(\\?|$|/)","/autocomplete-path(\\?|$|/)","/session/","/health(\\?|$)"];for(const t of $)h.push(t);const O=[],x=[s.location.origin,"cdn",".*\\.png$",".*\\.svg$"],_=[];o(`Origin: ${s.location.origin}`);s.addEventListener("install",t=>{o("Install"),t.waitUntil(caches.open(d).then(i=>(o(`Creating cache: ${d}`),i.addAll(w))).then(()=>{o("cache fully fetched!")}))});s.addEventListener("activate",t=>{o("Activate"),t.waitUntil(caches.keys().then(i=>Promise.all(i.map(e=>{if(e!==d)return o(`Deleting: ${e}`),caches.delete(e)})).then(()=>s.clients.claim())))});async function g(t,i){try{const e=await fetch(t);try{const c=await caches.open(d);return t.method==="GET"&&t.url.startsWith("http")&&c.put(t,e.clone()),e}catch(c){return o(`error: ${c}`),e}}catch{return i||new Response(`Could Not fetch ${t.url}`,{status:503,headers:{"Content-Type":"text/plain"}})}}const j={method:(t,i)=>{o(`Cache first: ${t.url}`);const e=g(t,i);return i||e},regexes:x},C={method:(t,i)=>(o(`Cache only: ${t.url}`),i||g(t,i)),regexes:_},f={method:(t,i)=>(o(`Online first: ${t.url}`),g(t,i)),regexes:h},A={method:t=>(o(`Online only: ${t.url}`),fetch(t)),regexes:O};async function E(t){const i=t.request,e=s.registration;if(t.request.mode==="navigate"&&t.request.method==="GET"&&e.waiting&&(await s.clients.matchAll()).length<2)return o("only one client, skipWaiting as we navigate the page"),e.waiting.postMessage("skipWaiting"),new Response("",{headers:{Refresh:"0"}});if(t.request.mode==="navigate"&&t.request.method==="GET"){const n=await caches.match(i);return f.method(i,n)}return await caches.match(i).then(n=>{const l=[f,A,j,C];for(const r of l)for(const p of r.regexes)if(RegExp(p).test(i.url))return r.method(i,n);return f.method(i,n)})}s.addEventListener("fetch",t=>{t.respondWith(E(t))});s.addEventListener("message",async function(t){t.data&&t.data.type==="debug"?(u=t.data.enabled&&t.data.level>=5,u&&o(`log enabled ${t.data.level}`)):t.data&&t.data.type==="ping"?o("pong"):t.data==="skipWaiting"&&(o("skipWaiting received"),t.waitUntil(s.skipWaiting()))});async function F(){const t=await s.clients.matchAll({type:"window",includeUncontrolled:!0});let i,e,c;for(var n=0;n<t.length;n++){const l=t[n],r=l.visibilityState==="visible",p=l.focused;if(r&&!i&&(i=l),p&&!e&&(e=l),p&&r){c=l;break}}return{atLeastOneFocused:e,atLeastOneVisible:i,atLeastOneVisibleAndFocused:c}}async function L(t){const i=await F(),e={title:"Notification",options:{body:"You have a new notification",icon:"/favicon.png",badge:"/favicon.png"}};if(t)try{const c=JSON.parse(t);if(c.web_push===8030){const n=c.notification;e.options={badge:n.badge,body:n.body,data:n.data,dir:n.dir,icon:n.icon,lang:n.lang,requireInteraction:n.requireInteraction,silent:n.silent,tag:n.tag},e.title=n.title,e.options.icon||(e.options.icon=n.image),n.navigate&&(e.options.data?typeof e.options.data=="object"&&!e.options.data.navigate&&(e.options.data={...e.options.data,navigate:n.navigate}):e.options.data={navigate:n.navigate})}else e.title=c.notification?.title||c.title||"Notification",e.options=c.notification||c.options}catch{e.options.body=t}o("handlePush",t,e),i.atLeastOneVisibleAndFocused?(o("posting notification to active app",e),i.atLeastOneVisibleAndFocused.postMessage({type:"notification",notification:{title:e.title,options:e.options}})):await s.registration.showNotification(e.title,e.options)}s.addEventListener("push",function(t){const i=t.data?.text();t.waitUntil(L(i))});async function D(t){const i=await s.clients.matchAll({type:"window",includeUncontrolled:!0}),e=location.pathname,c=e.substring(0,e.lastIndexOf("/")+1);let n=t.data?.navigate;n&&!n.startsWith("/")&&n.indexOf(":/")==-1&&(n=c+n);for(const l of i)if(o(`${"focus"in l?"focus-available: ":""}: ${l.url}`),"focus"in l)return n&&"navigate"in l?l.focus().then(()=>l.navigate(n)):l.focus();if(s.clients.openWindow)return s.clients.openWindow(n||"/")}s.addEventListener("notificationclick",function(t){t.notification.close(),t.waitUntil(D(t.notification))});
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{be as Le,aD as Ke,b1 as A,af as U,aT as T,b7 as re,b3 as bt,aX as kt,b9 as St}from"./CAL8yDNt.js";class Ae{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Ue{constructor(t,n){try{new Headers({location:n})}catch{throw new Error(`Invalid redirect location ${JSON.stringify(n)}: this string contains characters that cannot be used in HTTP headers`)}this.status=t,this.location=n}}class Te extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function Et(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function Rt(e){return e.split("%25").map(decodeURI).join("%25")}function xt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function we({href:e}){return e.split("#")[0]}function O(){}function Lt(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;function At(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const Ut=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&Y.delete($e(e)),Ut(e,t));const Y=new Map;function Tt(e,t){const n=$e(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...i}=JSON.parse(r.textContent);const o=r.getAttribute("data-ttl");return o&&Y.set(n,{body:a,init:i,ttl:1e3*Number(o)}),r.getAttribute("data-b64")!==null&&(a=At(a)),Promise.resolve(new Response(a,i))}return window.fetch(e,t)}function $t(e,t,n){if(Y.size>0){const r=$e(e,n),a=Y.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(a.body,a.init);Y.delete(r)}}return window.fetch(t,n)}function $e(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${Lt(...a)}"]`}return r}const It=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Pt(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${Ze(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const i=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(i)return t.push({name:i[1],matcher:i[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const o=r.split(/\[(.+?)\](?!\])/);return"/"+o.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return ye(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return ye(String.fromCharCode(...l.slice(2).split("-").map(g=>parseInt(g,16))));const f=It.exec(l),[,p,v,d,u]=f;return t.push({name:d,matcher:u,optional:!!p,rest:!!v,chained:v?c===1&&o[0]==="":!1}),v?"([^]*?)":p?"([^/]*)?":"([^/]+?)"}return ye(l)}).join("")}).join("")}/?$`),params:t}}function jt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Ze(e){return e.slice(1).split("/").filter(jt)}function Ot(e,t,n){const r={},a=e.slice(1),i=a.filter(s=>s!==void 0);let o=0;for(let s=0;s<t.length;s+=1){const l=t[s];let c=a[s-o];if(l.chained&&l.rest&&o&&(c=a.slice(s-o,s+1).filter(f=>f).join("/"),o=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||n[l.matcher](c)){r[l.name]=c;const f=t[s+1],p=a[s+1];f&&!f.rest&&f.optional&&p&&l.chained&&(o=0),!f&&!p&&Object.keys(r).length===i.length&&(o=0);continue}if(l.optional&&l.chained){o++;continue}return}if(!o)return r}function ye(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}const Ct=/\[(\[)?(\.\.\.)?(\w+?)(?:=(\w+))?\]\]?/g;function _n(e,t){const n=Ze(e),r=e!="/"&&e.endsWith("/");return"/"+n.map(a=>a.replace(Ct,(i,o,s,l)=>{const c=t[l];if(!c){if(o||s&&c!==void 0)return"";throw new Error(`Missing parameter '${l}' in route ${e}`)}if(c.startsWith("/")||c.endsWith("/"))throw new Error(`Parameter '${l}' in route ${e} cannot start or end with a slash -- this would cause an invalid route like foo//bar`);return c})).filter(Boolean).join("/")+(r?"/":"")}function Nt({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([s,[l,c,f]])=>{const{pattern:p,params:v}=Pt(s),d={id:s,exec:u=>{const g=p.exec(u);if(g)return Ot(g,v,r)},errors:[1,...f||[]].map(u=>e[u]),layouts:[0,...c||[]].map(o),leaf:i(l)};return d.errors.length=d.layouts.length=Math.max(d.errors.length,d.layouts.length),d});function i(s){const l=s<0;return l&&(s=~s),[l,e[s]]}function o(s){return s===void 0?s:[a.has(s),e[s]]}}function et(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function Fe(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const L=globalThis.__sveltekit_aofpnj?.base??"",qt=globalThis.__sveltekit_aofpnj?.assets??L??"",Dt="43f768b",tt="sveltekit:snapshot",nt="sveltekit:scroll",Ie="sveltekit:states",rt="sveltekit:pageurl",D="sveltekit:history",K="sveltekit:navigation",q={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},Pe=location.origin;function je(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function V(){return{x:pageXOffset,y:pageYOffset}}function M(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Ge={...q,"":q.hover};function at(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function ot(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=at(e)}}function Se(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const s=location.hash.split("#")[1]||"/";r.hash=`#${s}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,i=!r||!!a||he(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),o=r?.origin===Pe&&e.hasAttribute("download");return{url:r,external:i,target:a,download:o}}function ae(e){let t=null,n=null,r=null,a=null,i=null,o=null,s=e;for(;s&&s!==document.documentElement;)r===null&&(r=M(s,"preload-code")),a===null&&(a=M(s,"preload-data")),t===null&&(t=M(s,"keepfocus")),n===null&&(n=M(s,"noscroll")),i===null&&(i=M(s,"reload")),o===null&&(o=M(s,"replacestate")),s=at(s);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Ge[r??"off"],preload_data:Ge[a??"off"],keepfocus:l(t),noscroll:l(n),reload:l(i),replace_state:l(o)}}function He(e){const t=Le(e);let n=!0;function r(){n=!0,t.update(o=>o)}function a(o){n=!1,t.set(o)}function i(o){let s;return t.subscribe(l=>{(s===void 0||n&&l!==s)&&o(s=l)})}return{notify:r,set:a,subscribe:i}}const st={v:O};function Vt(){const{set:e,subscribe:t}=Le(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${qt}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const o=(await a.json()).version!==Dt;return o&&(e(!0),st.v(),clearTimeout(n)),o}catch{return!1}}return{subscribe:t,check:r}}function he(e,t,n){return e.origin!==Pe||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function gn(e){}const it=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...it];const Mt=new Set([...it]);[...Mt];function Bt(e){return e.filter(t=>t!=null)}function te(e,t){return e+"/"+t}function Oe(e){return e instanceof Ae||e instanceof Te?e.status:500}function Wt(e){return e instanceof Te?e.text:"Internal Error"}let b,z,be;const Kt=Ke.toString().includes("$$")||/function \w+\(\) \{\}/.test(Ke.toString()),Je="a:";Kt?(b={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(Je)},z={current:null},be={current:!1}):(b=new class{#e=A({});get data(){return U(this.#e)}set data(t){T(this.#e,t)}#t=A(null);get form(){return U(this.#t)}set form(t){T(this.#t,t)}#n=A(null);get error(){return U(this.#n)}set error(t){T(this.#n,t)}#r=A({});get params(){return U(this.#r)}set params(t){T(this.#r,t)}#a=A({id:null});get route(){return U(this.#a)}set route(t){T(this.#a,t)}#o=A({});get state(){return U(this.#o)}set state(t){T(this.#o,t)}#s=A(-1);get status(){return U(this.#s)}set status(t){T(this.#s,t)}#i=A(new URL(Je));get url(){return U(this.#i)}set url(t){T(this.#i,t)}},z=new class{#e=A(null);get current(){return U(this.#e)}set current(t){T(this.#e,t)}},be=new class{#e=A(!1);get current(){return U(this.#e)}set current(t){T(this.#e,t)}},st.v=()=>be.current=!0);function lt(e){Object.assign(b,e)}const{onMount:Ft}=bt,Gt=St??(e=>e()),Ht=new Set(["icon","shortcut icon","apple-touch-icon"]);let H=null;const N=et(nt)??{},X=et(tt)??{},C={url:He({}),page:He({}),navigating:Le(null),updated:Vt()};function pe(e){N[e]=V()}function ct(e,t){let n=e+1;for(;N[n];)delete N[n],n+=1;for(n=t+1;X[n];)delete X[n],n+=1}function Q(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(O)}async function ut(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(L||"/");e&&await e.update()}}let Ce,Ee,oe,$,Re,y;const se=[],ie=[];let x=null;function le(){x?.fork?.then(e=>e?.discard()),x=null}const ne=new Map,ft=new Set,Jt=new Set,B=new Set;let m={branch:[],error:null,url:null},dt=!1,ce=!1,Ye=!0,Z=!1,J=!1,Ne=!1,qe=!1,De,w,E,j;const ue=new Set,ze=new Map,Xe=new Map;async function yn(e,t,n){globalThis.__sveltekit_aofpnj&&(globalThis.__sveltekit_aofpnj.query,globalThis.__sveltekit_aofpnj.prerender),document.URL!==location.href&&(location.href=location.href),y=e,await e.hooks.init?.(),Ce=Nt(e),$=document.documentElement,Re=t,Ee=e.nodes[0],oe=e.nodes[1],Ee(),oe(),w=history.state?.[D],E=history.state?.[K],w||(w=E=Date.now(),history.replaceState({...history.state,[D]:w,[K]:E},""));const r=N[w];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await un(Re,n)):(await W({type:"enter",url:je(y.hash?hn(new URL(location.href)):location.href),replace_state:!0}),a()),cn()}function Yt(){se.length=0,qe=!1}function ht(e){ie.some(t=>t?.snapshot)&&(X[e]=ie.map(t=>t?.snapshot?.capture()))}function pt(e){X[e]?.forEach((t,n)=>{ie[n]?.snapshot?.restore(t)})}function Qe(){pe(w),Fe(nt,N),ht(E),Fe(tt,X)}async function zt(e,t,n,r){let a,i;t.invalidateAll&&le(),await W({type:"goto",url:je(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{if(t.invalidateAll){qe=!0,a=new Set;for(const[o,s]of ze)for(const l of s.keys())a.add(te(o,l));i=new Set;for(const[o,s]of Xe)for(const l of s.keys())i.add(te(o,l))}t.invalidate&&t.invalidate.forEach(ln)}}),t.invalidateAll&&re().then(re).then(()=>{for(const[o,s]of ze)for(const[l,{resource:c}]of s)a?.has(te(o,l))&&c.refresh();for(const[o,s]of Xe)for(const[l,{resource:c}]of s)i?.has(te(o,l))&&c.reconnect()})}async function Xt(e){if(e.id!==x?.id){le();const t={};ue.add(t),x={id:e.id,token:t,promise:gt({...e,preload:t}).then(n=>(ue.delete(t),n.type==="loaded"&&n.state.error&&le(),n)),fork:null}}return x.promise}async function ke(e){const t=(await _e(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(n=>n[1]()))}async function _t(e,t,n){const r={params:m.params,route:{id:m.route?.id??null},url:new URL(location.href)};m={...e.state,nav:r};const a=document.querySelector("style[data-sveltekit]");if(a&&a.remove(),lt(e.props.page),De=new y.root({target:t,props:{...e.props,stores:C,components:ie},hydrate:n,sync:!1,transformError:void 0}),await Promise.resolve(),pt(E),n){const i={from:null,to:{...r,scroll:N[w]??V()},willUnload:!1,type:"enter",complete:Promise.resolve()};B.forEach(o=>o(i))}ce=!0}async function fe({url:e,params:t,branch:n,errors:r,status:a,error:i,route:o,form:s}){let l="never";if(L&&(e.pathname===L||e.pathname===L+"/"))l="always";else for(const u of n)u?.slash!==void 0&&(l=u.slash);e.pathname=Et(e.pathname,l),e.search=e.search;const c={type:"loaded",state:{url:e,params:t,branch:n,error:i,route:o},props:{constructors:Bt(n).map(u=>u.node.component),page:ge(b)}};s!==void 0&&(c.props.form=s);let f={},p=!b,v=0;for(let u=0;u<Math.max(n.length,m.branch.length);u+=1){const g=n[u],_=m.branch[u];g?.data!==_?.data&&(p=!0),g&&(f={...f,...g.data},p&&(c.props[`data_${v}`]=f),v+=1)}return(!m.url||e.href!==m.url.href||m.error!==i||s!==void 0&&s!==b.form||p)&&(c.props.page={error:i,params:t,route:{id:o?.id??null},state:{},status:a,url:new URL(e),form:s??null,data:p?f:b.data}),c}async function Ve({loader:e,parent:t,url:n,params:r,route:a,server_data_node:i}){let o=null;const s={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},l=await e();return{node:l,loader:e,server:i,universal:l.universal?.load?{type:"data",data:o,uses:s}:null,data:o??i?.data??null,slash:l.universal?.trailingSlash??i?.slash}}function Qt(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const i=ce?$t(r,a.href,t):Tt(r,t);return{resolved:a,promise:i}}function Zt(e,t,n,r,a,i){if(qe)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const o of a.search_params)if(r.has(o))return!0;for(const o of a.params)if(i[o]!==m.params[o])return!0;for(const o of a.dependencies)if(se.some(s=>s(new URL(o))))return!0;return!1}function Me(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function en(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),i=t.searchParams.getAll(r);a.every(o=>i.includes(o))&&i.every(o=>a.includes(o))&&n.delete(r)}return n}function tn({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:ge(b),constructors:[]}}}async function gt({id:e,invalidating:t,url:n,params:r,route:a,preload:i}){if(x?.id===e)return ue.delete(x.token),x.promise;const{errors:o,layouts:s,leaf:l}=a,c=[...s,l];o.forEach(_=>_?.().catch(O)),c.forEach(_=>_?.[1]().catch(O));const f=m.url?e!==de(m.url):!1,p=m.route?a.id!==m.route.id:!1,v=en(m.url,n);let d=!1;const u=c.map(async(_,h)=>{if(!_)return;const k=m.branch[h];return _[1]===k?.loader&&!Zt(d,p,f,v,k.universal?.uses,r)?k:(d=!0,Ve({loader:_[1],url:n,params:r,route:a,parent:async()=>{const I={};for(let P=0;P<h;P+=1)Object.assign(I,(await u[P])?.data);return I},server_data_node:Me(_[0]?{type:"skip"}:null,_[0]?k?.server:void 0)}))});for(const _ of u)_.catch(O);const g=[];for(let _=0;_<c.length;_+=1)if(c[_])try{g.push(await u[_])}catch(h){if(h instanceof Ue)return{type:"redirect",location:h.location};if(ue.has(i))return tn({error:await ee(h,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let k=Oe(h),R;if(h instanceof Ae)R=h.body;else{if(await C.updated.check())return await ut(),await Q(n);R=await ee(h,{params:r,url:n,route:{id:a.id}})}const I=await nn(_,g,o);return I?fe({url:n,params:r,branch:g.slice(0,I.idx).concat(I.node),errors:o,status:k,error:R,route:a}):await vt(n,{id:a.id},R,k)}else g.push(void 0);return fe({url:n,params:r,branch:g,errors:o,status:200,error:null,route:a,form:t?void 0:null})}async function nn(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function Be({status:e,error:t,url:n,route:r}){const a={};let i=null;try{const o=await Ve({loader:Ee,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Me(i)}),s={node:await oe(),loader:oe,universal:null,server:null,data:null};return fe({url:n,params:a,branch:[o,s],status:e,error:t,errors:[],route:null})}catch(o){if(o instanceof Ue)return zt(new URL(o.location,location.href),{},0);throw o}}async function rn(e){const t=e.href;if(ne.has(t))return ne.get(t);let n;try{const r=(async()=>{let a=await y.hooks.reroute({url:new URL(e),fetch:async(i,o)=>Qt(i,o,e).promise})??e;if(typeof a=="string"){const i=new URL(e);y.hash?i.hash=a:i.pathname=a,a=i}return a})();ne.set(t,r),n=await r}catch{ne.delete(t);return}return n}async function _e(e,t){if(e&&!he(e,L,y.hash)){const n=await rn(e);if(!n)return;const r=an(n);for(const a of Ce){const i=a.exec(r);if(i)return{id:de(e),invalidating:t,route:a,params:xt(i),url:e}}}}function an(e){return Rt(y.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(L.length))||"/"}function de(e){return(y.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function mt({url:e,type:t,intent:n,delta:r,event:a,scroll:i}){let o=!1;const s=We(m,n,e,t,i??null);r!==void 0&&(s.navigation.delta=r),a!==void 0&&(s.navigation.event=a);const l={...s.navigation,cancel:()=>{o=!0,s.reject(new Error("navigation cancelled"))}};return Z||ft.forEach(c=>c(l)),o?null:s}async function W({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:i,state:o={},redirect_count:s=0,nav_token:l={},accept:c=O,block:f=O,event:p}){const v=j;j=l;const d=await _e(t,!1),u=e==="enter"?We(m,d,t,e):mt({url:t,type:e,delta:n?.delta,intent:d,scroll:n?.scroll,event:p});if(!u){f(),j===l&&(j=v);return}const g=w,_=E;c(),Z=!0,ce&&u.navigation.type!=="enter"&&C.navigating.set(z.current=u.navigation);let h=d&&await gt(d);if(!h){if(he(t,L,y.hash))return await Q(t,i);h=await vt(t,{id:null},await ee(new Te(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,i)}if(t=d?.url||t,j!==l)return u.reject(new Error("navigation aborted")),!1;if(h.type==="redirect"){if(s<20){await W({type:e,url:new URL(h.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:i,state:o,redirect_count:s+1,nav_token:l}),u.fulfil(void 0);return}h=await Be({status:500,error:await ee(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else h.props.page.status>=400&&await C.updated.check()&&(await ut(),await Q(t,i));if(Yt(),pe(g),ht(_),h.props.page.url.pathname!==t.pathname&&(t.pathname=h.props.page.url.pathname),o=n?n.state:o,!n){const S=i?0:1,F={[D]:w+=S,[K]:E+=S,[Ie]:o};(i?history.replaceState:history.pushState).call(history,F,"",t),i||ct(w,E)}const k=d&&x?.id===d.id?x.fork:null;x?.fork&&!k&&le(),x=null,h.props.page.state=o;let R;if(ce){const S=(await Promise.all(Array.from(Jt,G=>G(u.navigation)))).filter(G=>typeof G=="function");if(S.length>0){let G=function(){S.forEach(ve=>{B.delete(ve)})};S.push(G),S.forEach(ve=>{B.add(ve)})}const F=u.navigation.to;m={...h.state,nav:{params:F.params,route:F.route,url:F.url}},h.props.page&&(h.props.page.url=t);const me=k&&await k;me?R=me.commit():(H=null,De.$set(h.props),H&&Object.assign(h.props.page,H),lt(h.props.page),R=kt?.()),Ne=!0}else await _t(h,Re,!1);const{activeElement:I}=document;if(await R,await re(),await re(),j!==l)return u.reject(new Error("navigation aborted")),!1;h.props.page&&H&&Object.assign(h.props.page,H);let P=null;if(Ye){const S=n?n.scroll:a?V():null;S?scrollTo(S.x,S.y):(P=t.hash&&document.getElementById(wt(t)))?P.scrollIntoView():scrollTo(0,0)}const yt=document.activeElement!==I&&document.activeElement!==document.body;!r&&!yt&&dn(t,!P),Ye=!0,Z=!1,e==="popstate"&&pt(E),u.fulfil(void 0),u.navigation.to&&(u.navigation.to.scroll=V()),B.forEach(S=>S(u.navigation)),C.navigating.set(z.current=null)}async function vt(e,t,n,r,a){return e.origin===Pe&&e.pathname===location.pathname&&!dt?await Be({status:r,error:n,url:e,route:t}):await Q(e,a)}function on(){let e,t={element:void 0,href:void 0},n;$.addEventListener("mousemove",s=>{const l=s.target;clearTimeout(e),e=setTimeout(()=>{i(l,q.hover)},20)});function r(s){s.defaultPrevented||i(s.composedPath()[0],q.tap)}$.addEventListener("mousedown",r),$.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(s=>{for(const l of s)l.isIntersecting&&(ke(new URL(l.target.href)),a.unobserve(l.target))},{threshold:0});async function i(s,l){const c=ot(s,$),f=c===t.element&&c?.href===t.href&&l>=n;if(!c||f)return;const{url:p,external:v,download:d}=Se(c,L,y.hash);if(v||d)return;const u=ae(c),g=p&&de(m.url)===de(p);if(!(u.reload||g))if(l<=u.preload_data){t={element:c,href:c.href},n=q.tap;const _=await _e(p,!1);if(!_)return;Xt(_)}else l<=u.preload_code&&(t={element:c,href:c.href},n=l,ke(p))}function o(){a.disconnect();for(const s of $.querySelectorAll("a")){const{url:l,external:c,download:f}=Se(s,L,y.hash);if(c||f)continue;const p=ae(s);p.reload||(p.preload_code===q.viewport&&a.observe(s),p.preload_code===q.eager&&ke(l))}}B.add(o),o()}function ee(e,t){if(e instanceof Ae)return e.body;const n=Oe(e),r=Wt(e);return y.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function sn(e,t){Ft(()=>(e.add(t),()=>{e.delete(t)}))}function bn(e){sn(B,e)}function ln(e){if(typeof e=="function")se.push(e);else{const{href:t}=new URL(e,location.href);se.push(n=>n.href===t)}}function kn(e,t){pe(w);const n={[D]:w+=1,[K]:E,[rt]:b.url.href,[Ie]:t};history.pushState(n,"",je(e)),Ne=!0,b.state=t,De.$set({page:Gt(()=>ge(b))}),ct(w,E)}function cn(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(Qe(),!Z){const r=We(m,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};ft.forEach(i=>i(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Qe()}),navigator.connection?.saveData||on(),$.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=ot(t.composedPath()[0],$);if(!n)return;const{url:r,external:a,target:i,download:o}=Se(n,L,y.hash);if(!r)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const s=ae(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||o)return;const[c,f]=(y.hash?r.hash.replace(/^#/,""):r.href).split("#"),p=c===we(location);if(a||s.reload&&(!p||!f)){mt({url:r,type:"link",event:t})?Z=!0:t.preventDefault();return}if(f!==void 0&&p){const[,v]=m.url.href.split("#");if(v===f){if(t.preventDefault(),f===""||f==="top"&&n.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const d=n.ownerDocument.getElementById(decodeURIComponent(f));d&&(d.scrollIntoView(),d.focus())}return}if(J=!0,pe(w),e(r),!s.replace_state)return;J=!1}t.preventDefault(),await new Promise(v=>{requestAnimationFrame(()=>{setTimeout(v,0)}),setTimeout(v,100)}),await W({type:"link",url:r,keepfocus:s.keepfocus,noscroll:s.noscroll,replace_state:s.replace_state??r.href===location.href,event:t})}),$.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),r=t.submitter;if((r?.formTarget||n.target)==="_blank"||(r?.formMethod||n.method)!=="get")return;const o=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(he(o,L,!1))return;const s=t.target,l=ae(s);if(l.reload)return;t.preventDefault(),t.stopPropagation();const c=new FormData(s,r);o.search=new URLSearchParams(c).toString(),W({type:"form",url:o,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??o.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!xe){if(t.state?.[D]){const n=t.state[D];if(j={},n===w)return;const r=N[n],a=t.state[Ie]??{},i=new URL(t.state[rt]??location.href),o=t.state[K],s=m.url?we(location)===we(m.url):!1;if(o===E&&(Ne||s)){a!==b.state&&(b.state=a),e(i),N[w]=V(),r&&scrollTo(r.x,r.y),w=n;return}const c=n-w;await W({type:"popstate",url:i,popped:{state:a,scroll:r,delta:c},accept:()=>{w=n,E=o},block:()=>{history.go(-c)},nav_token:j,event:t})}else if(!J){const n=new URL(location.href);e(n),y.hash&&location.reload()}}}),addEventListener("hashchange",()=>{J&&(J=!1,history.replaceState({...history.state,[D]:++w,[K]:E},"",location.href))});for(const t of document.querySelectorAll("link"))Ht.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&C.navigating.set(z.current=null)});function e(t){m.url=b.url=t,C.page.set(ge(b)),C.page.notify()}}async function un(e,{status:t=200,error:n,node_ids:r,params:a,route:i,server_route:o,data:s,form:l}){dt=!0;const c=new URL(location.href);let f;({params:a={},route:i={id:null}}=await _e(c,!1)||{}),f=Ce.find(({id:d})=>d===i.id);let p,v=!0;try{const d=r.map(async(g,_)=>{const h=s[_];return h?.uses&&(h.uses=fn(h.uses)),Ve({loader:y.nodes[g],url:c,params:a,route:i,parent:async()=>{const k={};for(let R=0;R<_;R+=1)Object.assign(k,(await d[R]).data);return k},server_data_node:Me(h)})}),u=await Promise.all(d);if(f){const g=f.layouts;for(let _=0;_<g.length;_++)g[_]||u.splice(_,0,void 0)}p=await fe({url:c,params:a,branch:u,status:t,error:n,errors:f?.errors,form:l,route:f??null})}catch(d){if(d instanceof Ue){await Q(new URL(d.location,location.href));return}p=await Be({status:Oe(d),error:await ee(d,{url:c,params:a,route:i}),url:c,route:i}),e.textContent="",v=!1}p.props.page&&(p.props.page.state={}),await _t(p,e,v)}function fn(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}let xe=!1;function dn(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=wt(e);if(r&&document.getElementById(r)){const{x:i,y:o}=V();setTimeout(()=>{const s=history.state;xe=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(s,"",e),t&&scrollTo(i,o),xe=!1})}else{const i=document.body,o=i.getAttribute("tabindex");i.tabIndex=-1,i.focus({preventScroll:!0,focusVisible:!1}),o!==null?i.setAttribute("tabindex",o):i.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const i=[];for(let o=0;o<a.rangeCount;o+=1)i.push(a.getRangeAt(o));setTimeout(()=>{if(a.rangeCount===i.length){for(let o=0;o<a.rangeCount;o+=1){const s=i[o],l=a.getRangeAt(o);if(s.commonAncestorContainer!==l.commonAncestorContainer||s.startContainer!==l.startContainer||s.endContainer!==l.endContainer||s.startOffset!==l.startOffset||s.endOffset!==l.endOffset)return}a.removeAllRanges()}})}}}function We(e,t,n,r,a=null){let i,o;const s=new Promise((c,f)=>{i=c,o=f});return s.catch(O),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:V()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:a},willUnload:!t,type:r,complete:s},fulfil:i,reject:o}}function ge(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function hn(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function wt(e){let t;if(y.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{bn as a,L as b,kn as c,C as d,gn as l,b as p,_n as r,yn as s,Dt as v};
|
|
2
|
-
//# sourceMappingURL=BQPpGHw6.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{W as K,J as $e,ao as F,aU as Y,ai as Ae,am as Ce,af as se,aK as Ie,m as Re,a$ as ae,aV as q,an as z,b as Ue,j as Fe,aq as ie,X as Me,h as y,K as Z,a6 as Le,aY as Ne,a4 as Oe,as as Pe,z as re,g as He,f as De,az as We,b0 as ce,E as xe,D as je,aP as me,aE as be,I as G,a as ze,O as Be,ay as Ve,a5 as Ke,aj as Ye,e as ke,aJ as Se,d as qe,A as Ge,N as Je,ak as Xe,F as Qe,x as Ze,o as et,ah as tt,n as Ee,ae as M,be as E}from"./CAL8yDNt.js";import{b as nt,r as rt,c as ot,v as st}from"./BQPpGHw6.js";import{p as at}from"./DxTGwxLe.js";function qt(e,t){return t}function it(e,t,n){for(var o=[],r=t.length,a,s=t.length,l=0;l<r;l++){let b=t[l];be(b,()=>{if(a){if(a.pending.delete(b),a.done.add(b),a.pending.size===0){var p=e.outrogroups;ee(e,re(a.done)),p.delete(a),p.size===0&&(e.outrogroups=null)}}else s-=1},!1)}if(s===0){var i=o.length===0&&n!==null;if(i){var u=n,f=u.parentNode;Be(f),f.append(u),e.items.clear()}ee(e,t,!i)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function ee(e,t,n=!0){var o;if(e.pending.size>0){o=new Set;for(const s of e.pending.values())for(const l of s)o.add(e.items.get(l).e)}for(var r=0;r<t.length;r++){var a=t[r];if(o?.has(a)){a.f|=y;const s=document.createDocumentFragment();Ve(a,s)}else Ke(t[r],n)}}var le;function Gt(e,t,n,o,r,a=null){var s=e,l=new Map,i=(t&ke)!==0;if(i){var u=e;s=F?Y(Ae(u)):u.appendChild(K())}F&&Ce();var f=null,b=Oe(()=>{var h=n();return Pe(h)?h:h==null?[]:re(h)}),p,k=new Map,S=!0;function L(h){(C.effect.f&je)===0&&(C.pending.delete(h),C.fallback=f,ct(C,p,s,t,o),f!==null&&(p.length===0?(f.f&y)===0?me(f):(f.f^=y,H(f,null,s)):be(f,()=>{f=null})))}function c(h){C.pending.delete(h)}var d=$e(()=>{p=se(b);var h=p.length;let m=!1;if(F){var x=Ie(s)===Re;x!==(h===0)&&(s=ae(),Y(s),q(!1),m=!0)}for(var I=new Set,g=Me,N=Ne(),R=0;R<h;R+=1){F&&z.nodeType===Ue&&z.data===Fe&&(s=z,m=!0,q(!1));var _=p[R],j=o(_,R),T=S?null:l.get(j);T?(T.v&&ie(T.v,_),T.i&&ie(T.i,R),N&&g.unskip_effect(T.e)):(T=lt(l,S?s:le??=K(),_,j,R,r,t,n),S||(T.e.f|=y),l.set(j,T)),I.add(j)}if(h===0&&a&&!f&&(S?f=Z(()=>a(s)):(f=Z(()=>a(le??=K())),f.f|=y)),h>I.size&&Le(),F&&h>0&&Y(ae()),!S)if(k.set(g,I),N){for(const[ye,Te]of l)I.has(ye)||g.skip_effect(Te.e);g.oncommit(L),g.ondiscard(c)}else L(g);m&&q(!0),se(b)}),C={effect:d,items:l,pending:k,outrogroups:null,fallback:f};S=!1,F&&(s=z)}function O(e){for(;e!==null&&(e.f&ze)===0;)e=e.next;return e}function ct(e,t,n,o,r){var a=(o&qe)!==0,s=t.length,l=e.items,i=O(e.effect.first),u,f=null,b,p=[],k=[],S,L,c,d;if(a)for(d=0;d<s;d+=1)S=t[d],L=r(S,d),c=l.get(L).e,(c.f&y)===0&&(c.nodes?.a?.measure(),(b??=new Set).add(c));for(d=0;d<s;d+=1){if(S=t[d],L=r(S,d),c=l.get(L).e,e.outrogroups!==null)for(const _ of e.outrogroups)_.pending.delete(c),_.done.delete(c);if((c.f&G)!==0&&(me(c),a&&(c.nodes?.a?.unfix(),(b??=new Set).delete(c))),(c.f&y)!==0)if(c.f^=y,c===i)H(c,null,n);else{var C=f?f.next:i;c===e.effect.last&&(e.effect.last=c.prev),c.prev&&(c.prev.next=c.next),c.next&&(c.next.prev=c.prev),U(e,f,c),U(e,c,C),H(c,C,n),f=c,p=[],k=[],i=O(f.next);continue}if(c!==i){if(u!==void 0&&u.has(c)){if(p.length<k.length){var h=k[0],m;f=h.prev;var x=p[0],I=p[p.length-1];for(m=0;m<p.length;m+=1)H(p[m],h,n);for(m=0;m<k.length;m+=1)u.delete(k[m]);U(e,x.prev,I.next),U(e,f,x),U(e,I,h),i=h,f=I,d-=1,p=[],k=[]}else u.delete(c),H(c,i,n),U(e,c.prev,c.next),U(e,c,f===null?e.effect.first:f.next),U(e,f,c),f=c;continue}for(p=[],k=[];i!==null&&i!==c;)(u??=new Set).add(i),k.push(i),i=O(i.next);if(i===null)continue}(c.f&y)===0&&p.push(c),f=c,i=O(c.next)}if(e.outrogroups!==null){for(const _ of e.outrogroups)_.pending.size===0&&(ee(e,re(_.done)),e.outrogroups?.delete(_));e.outrogroups.size===0&&(e.outrogroups=null)}if(i!==null||u!==void 0){var g=[];if(u!==void 0)for(c of u)(c.f&G)===0&&g.push(c);for(;i!==null;)(i.f&G)===0&&i!==e.fallback&&g.push(i),i=O(i.next);var N=g.length;if(N>0){var R=(o&ke)!==0&&s===0?n:null;if(a){for(d=0;d<N;d+=1)g[d].nodes?.a?.measure();for(d=0;d<N;d+=1)g[d].nodes?.a?.fix()}it(e,g,R)}}a&&Se(()=>{if(b!==void 0)for(c of b)c.nodes?.a?.apply()})}function lt(e,t,n,o,r,a,s,l){var i=(s&He)!==0?(s&De)===0?We(n,!1,!1):ce(n):null,u=(s&xe)!==0?ce(r):null;return{v:i,i:u,e:Z(()=>(a(t,i??n,u??r,l),()=>{e.delete(o)}))}}function H(e,t,n){if(e.nodes)for(var o=e.nodes.start,r=e.nodes.end,a=t&&(t.f&y)===0?t.nodes.start:n;o!==null;){var s=Ye(o);if(a.before(o),o===r)return;o=s}}function U(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}const ft=Symbol("is custom element"),ut=Symbol("is html"),dt=Ee?"link":"LINK",pt=Ee?"progress":"PROGRESS";function Jt(e){if(F){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var o=e.value;fe(e,"value",null),e.value=o}if(e.hasAttribute("checked")){var r=e.checked;fe(e,"checked",null),e.checked=r}}};e[Qe]=n,Se(n),Ze()}}function Xt(e,t){var n=oe(e);n.value===(n.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!==pt)||(e.value=t??"")}function Qt(e,t){var n=oe(e);n.checked!==(n.checked=t??void 0)&&(e.checked=t)}function fe(e,t,n,o){var r=oe(e);F&&(r[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName===dt)||r[t]!==(r[t]=n)&&(t==="loading"&&(e[et]=n),n==null?e.removeAttribute(t):typeof n!="string"&&ht(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function oe(e){return e[Ge]??={[ft]:e.nodeName.includes("-"),[ut]:e.namespaceURI===Je}}var ue=new Map;function ht(e){var t=e.getAttribute("is")||e.nodeName,n=ue.get(t);if(n)return n;ue.set(t,n=[]);for(var o,r=e,a=Element.prototype;a!==r;){o=tt(r);for(var s in o)o[s].set&&s!=="innerHTML"&&s!=="textContent"&&s!=="innerText"&&n.push(s);r=Xe(r)}return n}const gt="";function vt(...e){if(!e[0].startsWith("/"))throw new Error(`Cannot use \`resolve(...)\` with a non-absolute pathname or route ID (got "${e[0]}"). \`resolve\` is only for internal pathnames and route IDs; external URLs should be used directly.`);return nt+gt+rt(e[0],e[1])}const v=()=>{},wt={assert:v,error:v,warn:v,info:v,log:v,debug:v,dir:v,table:v,trace:v,write:v,time:v,timeEnd:v,timeLog:v};function mt(){return globalThis?._logFactory}function bt(e,t){const n=mt();return n?n(e,{decoration:t?.decoration}):wt}function kt(e,t){let n=performance.now();function o(r){const a=performance.now();a-n>t.idle&&e.update(),n=a}return["focus","pointerdown"].forEach(r=>window.addEventListener(r,o)),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&e.update()}),e.update(),setInterval(()=>e.update(),t.checks)}function St(e,t){function n(){e.installing&&e.installing.addEventListener("statechange",function(){this.state==="installed"&&t(e)})}if(e){if(e.waiting)return t(e);e.installing?n():e.addEventListener("updatefound",n)}}function Et(){let e=1;const t=E([]);function n(a){t.update(s=>[...s,{...a,id:++e}])}function o(a){t.update(s=>s.filter(l=>l.id!==a))}function r(a){const s=M(t).find(l=>l.id==a);o(a),s?.type==="push-notification"&&s.data.options.data?.navigate&&ot(s.data.options.data.navigate,at.state)}return{subscribe:t.subscribe,add:n,remove:o,onClick:r}}const _t=Et(),w=bt("service-worker");function J(e){e&&(w.enabled?w.debug(`enabling logging for service worker, level: ${w.level}`):w.debug(`disabling logging for service worker, level: ${w.level}`),e.postMessage({type:"debug",level:w.level,enabled:w.enabled}))}const yt=180*1e3,Tt=1800*1e3;function $t(){const e=E(void 0);function t(s="active"){n({type:"ping"},s)}function n(s,l="active"){const i=M(e);if(!i)throw new Error("not loaded");if(i.notSupported)throw new Error("not supported");if(i.registering)throw new Error("is registering...");const u=i.registration;if(!u)throw new Error("no registration");if(!u[l])throw new Error(`no registration in state: ${l}`);u[l].postMessage(s)}function o(){w.log("accepting update...");const s=M(e);if(!s)throw new Error("not loaded");if(s.notSupported)throw new Error("not supported");if(s.registering)throw new Error("is registering...");if(s.updateAvailable&&s.registration){const l=s.registration;if(!l)throw new Error("no registration");l.waiting?(w.log("was waiting, skipping..."),l.waiting.postMessage("skipWaiting")):(w.log("was not waiting, should we reload?"),w.error("not waiting..., todo reload?")),w.log("update store"),e.set({notSupported:!1,updateAvailable:!1,registration:s.registration,registering:s.registering})}}function r(){const s=M(e);if(!s)throw new Error("not loaded");if(s.notSupported)throw new Error("not supported");if(s.registering)throw new Error("is registering...");e.set({notSupported:!1,updateAvailable:!1,registration:s.registration,registering:s.registering})}function a(){if(typeof navigator<"u"&&"serviceWorker"in navigator){e.set({notSupported:!1,registering:!0});let s=!1;navigator.serviceWorker.addEventListener("controllerchange",()=>{s||(s=!0,window.location.reload())}),navigator.serviceWorker.onmessage=i=>{i.data&&i.data.type==="notification"&&(console.log(i),_t.add({type:"push-notification",data:i.data.notification}))};const l=vt("/service-worker.js");navigator.serviceWorker.register(l,{type:"classic"}).then(i=>{try{kt(i,{idle:yt,checks:Tt})}catch{}e.set({notSupported:!1,updateAvailable:!1,registration:i,registering:!1}),J(i.installing),J(i.waiting),J(i.active),St(i,()=>{e.set({notSupported:!1,updateAvailable:!0,registration:i,registering:!1})})}).catch(i=>{console.error(i),e.set({registering:!1,notSupported:!1,updateAvailable:!1,registration:void 0,error:{message:"failed to register service-worker",cause:i.message||i}}),w.error("Failed to register service worker",i)})}else typeof window<"u"&&e.set({notSupported:!0})}return{subscribe:e.subscribe,set:e.set,get registration(){const s=M(e);if(s&&"registration"in s)return s.registration},get updateAvailable(){const s=M(e);return s&&"updateAvailable"in s?s.updateAvailable:!1},register:a,pingServideWorker:t,sendMessage:n,skipWaiting:o,skip:r}}function At(e){if(!e)return{params:{},pathname:""};const t={},n=e.lastIndexOf("#");let o=e;n!==-1&&(o=o.slice(0,n));const r=o.indexOf("?");r!==-1&&o.slice(r+1).split("&").forEach(s=>{const[l,i=""]=s.split("=");t[decodeURIComponent(l)]=i===""?"true":decodeURIComponent(i)});let a=o.slice(0,r)||"";return a&&!a.endsWith("/")&&(a+="/"),{params:t,pathname:a}}function Ct(){return typeof window>"u"?{params:{}}:At(window.location.href)}function It(e){if(typeof window>"u")return{};const t=window.location.hash,n={},o=t.lastIndexOf("#");return o!==-1&&t.slice(o+1).split("&").forEach(r=>{const[a,s=""]=r.split("=");n[decodeURIComponent(a)]=decodeURIComponent(s)}),n}const Zt=$t();It();const{params:en}=Ct();console.log(`VERSION: ${st}`);const de={brandDark:"--color-brand-dark",brandSurface:"--color-brand-surface",brandSurface2:"--color-brand-surface-2",brandSurface3:"--color-brand-surface-3",brandBorder:"--color-brand-border",brandText:"--color-brand-text",brandTextMuted:"--color-brand-text-muted",brandCyan:"--color-brand-cyan",brandBlue:"--color-brand-blue",brandPurple:"--color-brand-purple"},Rt=["--color-brand-cyan","--color-brand-blue","--color-brand-purple"],Ut={label:"",accent:null,colors:null,frame:!1,pattern:"none"};function tn(e){if(typeof document>"u")return;const t=document.documentElement;for(const n of Object.values(de))t.style.removeProperty(n);if(t.classList.remove("wherever-framed"),delete t.dataset.whereverPattern,e.accent){for(const n of Rt)t.style.setProperty(n,e.accent);document.querySelector('meta[name="theme-color"]')?.setAttribute("content",e.accent)}if(e.frame&&t.classList.add("wherever-framed"),e.pattern&&e.pattern!=="none"&&(t.dataset.whereverPattern=e.pattern),e.colors)for(const[n,o]of Object.entries(e.colors)){const r=de[n];r&&typeof o=="string"&&t.style.setProperty(r,o)}}const pe="wherever-config",Ft="token";function he(e,t){const n=e.startsWith(t)?e.slice(1):e;if(!n)return{present:!1,value:"",rest:e};const o=new URLSearchParams(n),r=[...new Set([...o.keys()].filter(i=>i.toLowerCase()===Ft))];if(r.length===0)return{present:!1,value:"",rest:e};const s=r.flatMap(i=>o.getAll(i)).find(i=>i.trim())??"";for(const i of r)o.delete(i);const l=o.toString();return{present:!0,value:s,rest:l?`${t}${l}`:""}}function _e(e,t){const n=he(t||"","#"),o=he(e||"","?"),r=n.value||o.value;return{token:r||null,present:n.present||o.present,search:o.rest,hash:n.rest}}function Mt(){if(typeof window>"u"||!window.location)return!1;const e=window.location,t=_e(e.search||"",e.hash||"");if(!t.present)return!1;try{const n=window.history;if(n&&typeof n.replaceState=="function"){const o=e.pathname||"/";return n.replaceState(n.state??null,"",`${o}${t.search}${t.hash}`),!0}}catch{}return!1}function Lt(){if(typeof window>"u"||!window.location)return!1;const e=window.location,t=_e(e.search||"",e.hash||"");if(!t.present||(Mt(),!t.token))return!1;let n={};try{const o=localStorage.getItem(pe);if(o){const r=JSON.parse(o);r&&typeof r=="object"&&(n=r)}}catch{n={}}try{return localStorage.setItem(pe,JSON.stringify({...n,token:t.token})),!0}catch{return!1}}let ge=!1;function Nt(){return ge?!1:(ge=!0,Lt())}Nt();const W=E({folders:[],activeSessions:[],currentSession:null,loading:!1}),X=E({models:[],loading:!1}),B=E({folders:[],activeSessions:[],currentSession:null,loading:!1});function Q(){if(typeof window<"u"&&window.location){const e=window.location;if(e.port)return Number(e.port);if(e.protocol==="https:")return 443;if(e.protocol==="http:")return 80}return 31415}function $(){const e=localStorage.getItem("wherever-config"),t=typeof window<"u"&&window.location&&window.location.hostname?window.location.hostname:"localhost";if(e){const n=JSON.parse(e),o=window.location.protocol==="https:"?"https:":"http:";let r=n.host||t;(r==="localhost"||r==="127.0.0.1")&&t&&t!=="localhost"&&t!=="127.0.0.1"&&(r=t),r=r.startsWith("http")?r.replace(/^wss?:\/\//,""):r;let a=n.port;return(a===31415||a===void 0)&&Q()!==31415&&(a=Q()),`${o}//${r}:${a||Q()}`}return`${window.location.protocol}//${window.location.host}`}let P=null,D=[],te=!1,ne=!1,ve=0;const Ot=150,Pt=1e3;async function Ht(){te=!0;try{const e=$(),t=A(),n=`${e}/sessions${t?`?token=${encodeURIComponent(t)}`:""}`,o=await fetch(n);if(!o.ok)throw new Error(`HTTP ${o.status}`);const r=await o.json();W.set({folders:r.folders||[],activeSessions:(r.activeSessions||[]).map(a=>a.sessionFile),currentSession:M(W).currentSession,loading:!1})}catch(e){W.update(t=>({...t,loading:!1})),console.error("Failed to fetch sessions:",e)}finally{te=!1}}function nn(){W.update(n=>({...n,loading:!0}));const e=new Promise(n=>{D.push(n)});if(te)return ne=!0,e;const t=Date.now();if(!P)ve=t;else if(clearTimeout(P),t-ve>=Pt)return P=null,we(),e;return P=setTimeout(()=>{P=null,we()},Ot),e}async function we(){try{do{ne=!1;const e=D;D=[];try{await Ht()}finally{for(const t of e)t()}}while(ne)}finally{const e=D;D=[];for(const t of e)t()}}async function rn(){B.update(e=>({...e,loading:!0}));try{const e=$(),t=A(),n=`${e}/sessions?view=readonly${t?`&token=${encodeURIComponent(t)}`:""}`,o=await fetch(n);if(!o.ok)throw new Error(`HTTP ${o.status}`);const r=await o.json();B.set({folders:r.folders||[],activeSessions:(r.activeSessions||[]).map(a=>a.sessionFile),currentSession:M(B).currentSession,loading:!1})}catch(e){B.update(t=>({...t,loading:!1})),console.error("Failed to fetch read-only sessions:",e)}}let V=null;async function on(e,t="default"){V?.abort();const n=new AbortController;V=n;try{const o=$(),r=A(),a=new URLSearchParams({q:e});t==="readonly"&&a.set("view","readonly"),r&&a.set("token",r);const s=await fetch(`${o}/search?${a.toString()}`,{signal:n.signal});return s.ok?await s.json():{status:"error",query:e,hits:[],message:s.status===401?"Unauthorized: check the token in Connection Settings.":`Search failed (HTTP ${s.status}).`}}catch(o){return o?.name==="AbortError"?null:{status:"error",query:e,hits:[],message:o?.message||"Search request failed."}}finally{V===n&&(V=null)}}async function sn(){X.update(e=>({...e,loading:!0}));try{const e=$(),t=A(),n=`${e}/models${t?`?token=${encodeURIComponent(t)}`:""}`,o=await fetch(n);if(!o.ok)throw new Error(`HTTP ${o.status}`);const r=await o.json();X.set({models:r.models||[],loading:!1})}catch(e){X.update(t=>({...t,loading:!1})),console.error("Failed to fetch models:",e)}}function A(){try{const e=localStorage.getItem("wherever-config");if(e)return JSON.parse(e).token||""}catch{}return""}const Dt=E(!1),Wt=E("websocket"),xt=E(null),jt=E(!1),zt=E(null),Bt=E(Ut);async function an(e){if(!e.trim())return null;try{const t=$(),n=A(),o=`${t}/check-path?path=${encodeURIComponent(e)}${n?`&token=${encodeURIComponent(n)}`:""}`,r=await fetch(o);if(!r.ok)throw new Error(`HTTP ${r.status}`);return await r.json()}catch(t){return console.error("Failed to check path:",t),null}}async function cn(e){if(!e.trim())return null;try{const t=$(),n=A(),o=`${t}/check-remote-repo?path=${encodeURIComponent(e)}${n?`&token=${encodeURIComponent(n)}`:""}`,r=await fetch(o);if(!r.ok)throw new Error(`HTTP ${r.status}`);return await r.json()}catch(t){return console.error("Failed to check remote repo:",t),null}}async function ln(e){if(!e.trim())return[];try{const t=$(),n=A(),o=`${t}/remote-candidates?path=${encodeURIComponent(e)}${n?`&token=${encodeURIComponent(n)}`:""}`,r=await fetch(o);if(!r.ok)throw new Error(`HTTP ${r.status}`);const a=await r.json();return Array.isArray(a.candidates)?a.candidates:[]}catch(t){return console.error("Failed to resolve remote candidates:",t),[]}}async function fn(e){try{const t=$(),n=A(),o=`${t}/autocomplete-path?path=${encodeURIComponent(e)}${n?`&token=${encodeURIComponent(n)}`:""}`,r=await fetch(o);if(!r.ok)throw new Error(`HTTP ${r.status}`);return(await r.json()).completions||[]}catch(t){return console.error("Failed to autocomplete path:",t),[]}}async function un(){try{const e=$(),t=A(),n=`${e}/config${t?`?token=${encodeURIComponent(t)}`:""}`,o=await fetch(n);if(!o.ok)throw new Error(`HTTP ${o.status}`);const r=await o.json();Dt.set(!!r.gitInitDefault),Wt.set(r.uploadMethod||"websocket"),xt.set(r.searchFolder||null),jt.set(!!r.searchCreateRemote),zt.set(r.searchDefaultModel||null);const a={label:r.appearance?.label||"",accent:r.appearance?.accent||null,colors:r.appearance?.colors||null,frame:!!r.appearance?.frame,pattern:r.appearance?.pattern||"none"};Bt.set(a)}catch(e){console.error("Failed to fetch config:",e)}}function dn(e){W.update(t=>({...t,currentSession:e}))}export{Zt as A,W as B,dn as C,fe as D,Qt as E,Xt as F,Wt as G,Nt as a,Bt as b,tn as c,fn as d,X as e,an as f,cn as g,Gt as h,un as i,sn as j,rn as k,ln as l,nn as m,$ as n,A as o,Dt as p,qt as q,_t as r,B as s,Jt as t,vt as u,Mt as v,on as w,jt as x,zt as y,xt as z};
|
|
2
|
-
//# sourceMappingURL=DuS4tUIT.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"start.UO7O7dio.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|