studiograph 1.3.15 → 1.3.17
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/dist/agent/tools/graph-tools.js +95 -0
- package/dist/agent/tools/graph-tools.js.map +1 -1
- package/dist/core/graph.d.ts +5 -0
- package/dist/core/graph.js +33 -0
- package/dist/core/graph.js.map +1 -1
- package/dist/server/routes/sync-api.js +50 -0
- package/dist/server/routes/sync-api.js.map +1 -1
- package/dist/services/import-service.d.ts +25 -0
- package/dist/services/import-service.js +176 -0
- package/dist/services/import-service.js.map +1 -0
- package/dist/web/_app/immutable/assets/{3.CtJi4Cy9.css → 3.C-bIa9M8.css} +1 -1
- package/dist/web/_app/immutable/assets/{AppShell.Ch_ef9hJ.css → AppShell.D3hRAjzT.css} +1 -1
- package/dist/web/_app/immutable/chunks/{Cs_ROD7H.js → 0x0awhVy.js} +2 -2
- package/dist/web/_app/immutable/chunks/{BeBar3OL.js → 8FUQuwgM.js} +1 -1
- package/dist/web/_app/immutable/chunks/{WSUKABI_.js → BUSlXG5Y.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BuOTIbJu.js → BVmVTxxa.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BB_5th5W.js → BaUG0bh_.js} +2 -2
- package/dist/web/_app/immutable/chunks/Bl1mtM70.js +1 -0
- package/dist/web/_app/immutable/chunks/{CYrVHOHA.js → BpUdqMox.js} +1 -1
- package/dist/web/_app/immutable/chunks/Bxlwy1pA.js +28 -0
- package/dist/web/_app/immutable/chunks/C7R6dA2m.js +1 -0
- package/dist/web/_app/immutable/chunks/CbJfRYJV.js +1 -0
- package/dist/web/_app/immutable/chunks/{CCso8YCJ.js → D8Tke-Cy.js} +1 -1
- package/dist/web/_app/immutable/chunks/DJKRyj_1.js +1 -0
- package/dist/web/_app/immutable/chunks/{CRJX8CU6.js → DKIAzWea.js} +1 -1
- package/dist/web/_app/immutable/chunks/DLX3YXva.js +1 -0
- package/dist/web/_app/immutable/chunks/{C7OMGY7C.js → DlO1k6-D.js} +1 -1
- package/dist/web/_app/immutable/chunks/DxxhVGi2.js +1 -0
- package/dist/web/_app/immutable/chunks/EDLlAC9C.js +2 -0
- package/dist/web/_app/immutable/chunks/{CG8Yxrb8.js → pFRFqWMS.js} +11 -11
- package/dist/web/_app/immutable/entry/app.DdWuEeFT.js +2 -0
- package/dist/web/_app/immutable/entry/start.BzB3ns3v.js +1 -0
- package/dist/web/_app/immutable/nodes/0.B5o3d5X8.js +10 -0
- package/dist/web/_app/immutable/nodes/1.B5Mts5LU.js +1 -0
- package/dist/web/_app/immutable/nodes/2.Byiqvg8R.js +1 -0
- package/dist/web/_app/immutable/nodes/3.D_YfR2w4.js +11 -0
- package/dist/web/_app/immutable/nodes/{4.DeVmoWsp.js → 4.DzzO-Wza.js} +2 -2
- package/dist/web/_app/immutable/nodes/5.CWHutd51.js +2 -0
- package/dist/web/_app/immutable/nodes/6.CMT_d5RM.js +1 -0
- package/dist/web/_app/immutable/nodes/7.B_36JWv3.js +2 -0
- package/dist/web/_app/immutable/nodes/8.7DwRR4iA.js +1 -0
- package/dist/web/_app/version.json +1 -1
- package/dist/web/index.html +10 -11
- package/package.json +1 -1
- package/dist/web/_app/immutable/chunks/CQCkXCml.js +0 -1
- package/dist/web/_app/immutable/chunks/D1U4kU-D.js +0 -27
- package/dist/web/_app/immutable/chunks/DCGSm8Hl.js +0 -1
- package/dist/web/_app/immutable/chunks/DNDUUFGV.js +0 -1
- package/dist/web/_app/immutable/chunks/DP09rP34.js +0 -2
- package/dist/web/_app/immutable/chunks/DiP47fAp.js +0 -1
- package/dist/web/_app/immutable/chunks/O0fx2ss6.js +0 -1
- package/dist/web/_app/immutable/chunks/PPVm8Dsz.js +0 -1
- package/dist/web/_app/immutable/chunks/xBRYfpah.js +0 -1
- package/dist/web/_app/immutable/entry/app.C_0-Wmzc.js +0 -2
- package/dist/web/_app/immutable/entry/start.B1ZCxsoD.js +0 -1
- package/dist/web/_app/immutable/nodes/0.DCUsl6Uv.js +0 -10
- package/dist/web/_app/immutable/nodes/1.CzPUYLZX.js +0 -1
- package/dist/web/_app/immutable/nodes/2.N3pkdL5K.js +0 -1
- package/dist/web/_app/immutable/nodes/3.ChWSPZZx.js +0 -11
- package/dist/web/_app/immutable/nodes/5.CvUCgHfR.js +0 -2
- package/dist/web/_app/immutable/nodes/6.BWUz16oH.js +0 -1
- package/dist/web/_app/immutable/nodes/7.ClIxLwPU.js +0 -2
- package/dist/web/_app/immutable/nodes/8.BcmpHU8z.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aF as _e,bx as yt,R as ze,L as A,m as U,K as P,S as re,by as bt}from"./BeBar3OL.js";const V=[];function Ue(e,t=_e){let n=null;const r=new Set;function a(o){if(yt(e,o)&&(e=o,n)){const l=!V.length;for(const c of r)c[1](),V.push(c,e);if(l){for(let c=0;c<V.length;c+=2)V[c][0](V[c+1]);V.length=0}}}function i(o){a(o(e))}function s(o,l=_e){const c=[o,l];return r.add(c),r.size===1&&(n=t(a,i)||_e),o(e),()=>{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:a,update:i,subscribe:s}}class Pe{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 Te{constructor(t,n){this.status=t,this.location=n}}class Ie extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function kt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function St(e){return e.split("%25").map(decodeURI).join("%25")}function Et(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function we({href:e}){return e.split("#")[0]}function Rt(e,t,n,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(s,o){if(o==="get"||o==="getAll"||o==="has")return(c,...d)=>(n(c),s[o](c,...d));t();const l=Reflect.get(s,o);return typeof l=="function"?l.bind(s):l}}),enumerable:!0,configurable:!0});const i=["href","pathname","search","toString","toJSON"];r&&i.push("hash");for(const s of i)Object.defineProperty(a,s,{get(){return t(),e[s]},enumerable:!0,configurable:!0});return a}function xt(...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;new TextDecoder;function Lt(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 At=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&M.delete(Oe(e)),At(e,t));const M=new Map;function Ut(e,t){const n=Oe(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...i}=JSON.parse(r.textContent);const s=r.getAttribute("data-ttl");return s&&M.set(n,{body:a,init:i,ttl:1e3*Number(s)}),r.getAttribute("data-b64")!==null&&(a=Lt(a)),Promise.resolve(new Response(a,i))}return window.fetch(e,t)}function Pt(e,t,n){if(M.size>0){const r=Oe(e,n),a=M.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);M.delete(r)}}return window.fetch(t,n)}function Oe(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="${xt(...a)}"]`}return r}const Tt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function It(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${$t(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 s=r.split(/\[(.+?)\](?!\])/);return"/"+s.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return ve(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return ve(String.fromCharCode(...l.slice(2).split("-").map(w=>parseInt(w,16))));const d=Tt.exec(l),[,p,f,u,h]=d;return t.push({name:u,matcher:h,optional:!!p,rest:!!f,chained:f?c===1&&s[0]==="":!1}),f?"([^]*?)":p?"([^/]*)?":"([^/]+?)"}return ve(l)}).join("")}).join("")}/?$`),params:t}}function Ot(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function $t(e){return e.slice(1).split("/").filter(Ot)}function Ct(e,t,n){const r={},a=e.slice(1),i=a.filter(o=>o!==void 0);let s=0;for(let o=0;o<t.length;o+=1){const l=t[o];let c=a[o-s];if(l.chained&&l.rest&&s&&(c=a.slice(o-s,o+1).filter(d=>d).join("/"),s=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||n[l.matcher](c)){r[l.name]=c;const d=t[o+1],p=a[o+1];d&&!d.rest&&d.optional&&p&&l.chained&&(s=0),!d&&!p&&Object.keys(r).length===i.length&&(s=0);continue}if(l.optional&&l.chained){s++;continue}return}if(!s)return r}function ve(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function jt({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[l,c,d]])=>{const{pattern:p,params:f}=It(o),u={id:o,exec:h=>{const w=p.exec(h);if(w)return Ct(w,f,r)},errors:[1,...d||[]].map(h=>e[h]),layouts:[0,...c||[]].map(s),leaf:i(l)};return u.errors.length=u.layouts.length=Math.max(u.errors.length,u.layouts.length),u});function i(o){const l=o<0;return l&&(o=~o),[l,e[o]]}function s(o){return o===void 0?o:[a.has(o),e[o]]}}function Ze(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function He(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const x=globalThis.__sveltekit_1gg7dp8?.base??"",Nt=globalThis.__sveltekit_1gg7dp8?.assets??x??"",qt="1774324835025",et="sveltekit:snapshot",tt="sveltekit:scroll",nt="sveltekit:states",Dt="sveltekit:pageurl",B="sveltekit:history",H="sveltekit:navigation",N={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},pe=location.origin;function $e(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 q(){return{x:pageXOffset,y:pageYOffset}}function K(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const We={...N,"":N.hover};function rt(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function at(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=rt(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 o=location.hash.split("#")[1]||"/";r.hash=`#${o}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,i=!r||!!a||ge(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),s=r?.origin===pe&&e.hasAttribute("download");return{url:r,external:i,target:a,download:s}}function ae(e){let t=null,n=null,r=null,a=null,i=null,s=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=K(o,"preload-code")),a===null&&(a=K(o,"preload-data")),t===null&&(t=K(o,"keepfocus")),n===null&&(n=K(o,"noscroll")),i===null&&(i=K(o,"reload")),s===null&&(s=K(o,"replacestate")),o=rt(o);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:We[r??"off"],preload_data:We[a??"off"],keepfocus:l(t),noscroll:l(n),reload:l(i),replace_state:l(s)}}function Je(e){const t=Ue(e);let n=!0;function r(){n=!0,t.update(s=>s)}function a(s){n=!1,t.set(s)}function i(s){let o;return t.subscribe(l=>{(o===void 0||n&&l!==o)&&s(o=l)})}return{notify:r,set:a,subscribe:i}}const ot={v:()=>{}};function Vt(){const{set:e,subscribe:t}=Ue(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Nt}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const s=(await a.json()).version!==qt;return s&&(e(!0),ot.v(),clearTimeout(n)),s}catch{return!1}}return{subscribe:t,check:r}}function ge(e,t,n){return e.origin!==pe||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function dn(e){}const st=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...st];const Kt=new Set([...st]);[...Kt];function Bt(e){return e.filter(t=>t!=null)}function Ce(e){return e instanceof Pe||e instanceof Ie?e.status:500}function Ft(e){return e instanceof Ie?e.text:"Internal Error"}let b,W,ye;const Gt=ze.toString().includes("$$")||/function \w+\(\) \{\}/.test(ze.toString());Gt?(b={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},W={current:null},ye={current:!1}):(b=new class{#e=A({});get data(){return U(this.#e)}set data(t){P(this.#e,t)}#t=A(null);get form(){return U(this.#t)}set form(t){P(this.#t,t)}#n=A(null);get error(){return U(this.#n)}set error(t){P(this.#n,t)}#r=A({});get params(){return U(this.#r)}set params(t){P(this.#r,t)}#a=A({id:null});get route(){return U(this.#a)}set route(t){P(this.#a,t)}#o=A({});get state(){return U(this.#o)}set state(t){P(this.#o,t)}#s=A(-1);get status(){return U(this.#s)}set status(t){P(this.#s,t)}#i=A(new URL("https://example.com"));get url(){return U(this.#i)}set url(t){P(this.#i,t)}},W=new class{#e=A(null);get current(){return U(this.#e)}set current(t){P(this.#e,t)}},ye=new class{#e=A(!1);get current(){return U(this.#e)}set current(t){P(this.#e,t)}},ot.v=()=>ye.current=!0);function it(e){Object.assign(b,e)}const Ye={spanContext(){return Mt},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},Mt={traceId:"",spanId:"",traceFlags:0},zt=new Set(["icon","shortcut icon","apple-touch-icon"]),j=Ze(tt)??{},J=Ze(et)??{},C={url:Je({}),page:Je({}),navigating:Ue(null),updated:Vt()};function je(e){j[e]=q()}function Ht(e,t){let n=e+1;for(;j[n];)delete j[n],n+=1;for(n=t+1;J[n];)delete J[n],n+=1}function Y(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function lt(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(x||"/");e&&await e.update()}}function Ee(){}let Ne,Re,oe,T,xe,v;const se=[],ie=[];let L=null;function le(){L?.fork?.then(e=>e?.discard()),L=null}const ne=new Map,ct=new Set,Wt=new Set,z=new Set;let _={branch:[],error:null,url:null},ut=!1,ce=!1,Xe=!0,X=!1,G=!1,ft=!1,Z=!1,qe,y,R,I;const ue=new Set;let be;const fe=new Map;async function mn(e,t,n){globalThis.__sveltekit_1gg7dp8?.data&&globalThis.__sveltekit_1gg7dp8.data,document.URL!==location.href&&(location.href=location.href),v=e,await e.hooks.init?.(),Ne=jt(e),T=document.documentElement,xe=t,Re=e.nodes[0],oe=e.nodes[1],Re(),oe(),y=history.state?.[B],R=history.state?.[H],y||(y=R=Date.now(),history.replaceState({...history.state,[B]:y,[H]:R},""));const r=j[y];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await sn(xe,n)):(await F({type:"enter",url:$e(v.hash?un(new URL(location.href)):location.href),replace_state:!0}),a()),on()}async function Jt(e=!0,t=!0){if(await(be||=Promise.resolve()),!be)return;be=null;const n=I={},r=await ee(_.url,!0);if(le(),Z&&fe.forEach(({resource:a})=>{a.refresh?.()}),e){const a=b.state,i=r&&await Be(r);if(!i||n!==I)return;if(i.type==="redirect")return De(new URL(i.location,_.url).href,{replaceState:!0},1,n);t||(i.props.page.state=a),it(i.props.page),_=i.state,Le(),qe.$set(i.props)}else Le();await Promise.all([...fe.values()].map(({resource:a})=>a)).catch(Ee)}function Le(){se.length=0,Z=!1}function dt(e){ie.some(t=>t?.snapshot)&&(J[e]=ie.map(t=>t?.snapshot?.capture()))}function ht(e){J[e]?.forEach((t,n)=>{ie[n]?.snapshot?.restore(t)})}function Qe(){je(y),He(tt,j),dt(R),He(et,J)}async function De(e,t,n,r){let a;t.invalidateAll&&le(),await F({type:"goto",url:$e(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Z=!0,a=[...fe.keys()]),t.invalidate&&t.invalidate.forEach(an)}}),t.invalidateAll&&re().then(re).then(()=>{fe.forEach(({resource:i},s)=>{a?.includes(s)&&i.refresh?.()})})}async function Yt(e){if(e.id!==L?.id){le();const t={};ue.add(t),L={id:e.id,token:t,promise:Be({...e,preload:t}).then(n=>(ue.delete(t),n.type==="loaded"&&n.state.error&&le(),n)),fork:null}}return L.promise}async function ke(e){const t=(await ee(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(n=>n[1]()))}async function pt(e,t,n){_=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(b,e.props.page),qe=new v.root({target:t,props:{...e.props,stores:C,components:ie},hydrate:n,sync:!1}),await Promise.resolve(),ht(R),n){const a={from:null,to:{params:_.params,route:{id:_.route?.id??null},url:new URL(location.href),scroll:j[y]??q()},willUnload:!1,type:"enter",complete:Promise.resolve()};z.forEach(i=>i(a))}ce=!0}function de({url:e,params:t,branch:n,status:r,error:a,route:i,form:s}){let o="never";if(x&&(e.pathname===x||e.pathname===x+"/"))o="always";else for(const u of n)u?.slash!==void 0&&(o=u.slash);e.pathname=kt(e.pathname,o),e.search=e.search;const l={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:i},props:{constructors:Bt(n).map(u=>u.node.component),page:Me(b)}};s!==void 0&&(l.props.form=s);let c={},d=!b,p=0;for(let u=0;u<Math.max(n.length,_.branch.length);u+=1){const h=n[u],w=_.branch[u];h?.data!==w?.data&&(d=!0),h&&(c={...c,...h.data},d&&(l.props[`data_${p}`]=c),p+=1)}return(!_.url||e.href!==_.url.href||_.error!==a||s!==void 0&&s!==b.form||d)&&(l.props.page={error:a,params:t,route:{id:i?.id??null},state:{},status:r,url:new URL(e),form:s??null,data:d?c:b.data}),l}async function Ve({loader:e,parent:t,url:n,params:r,route:a,server_data_node:i}){let s=null,o=!0;const l={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},c=await e();if(c.universal?.load){let d=function(...f){for(const u of f){const{href:h}=new URL(u,n);l.dependencies.add(h)}};const p={tracing:{enabled:!1,root:Ye,current:Ye},route:new Proxy(a,{get:(f,u)=>(o&&(l.route=!0),f[u])}),params:new Proxy(r,{get:(f,u)=>(o&&l.params.add(u),f[u])}),data:i?.data??null,url:Rt(n,()=>{o&&(l.url=!0)},f=>{o&&l.search_params.add(f)},v.hash),async fetch(f,u){f instanceof Request&&(u={body:f.method==="GET"||f.method==="HEAD"?void 0:await f.blob(),cache:f.cache,credentials:f.credentials,headers:[...f.headers].length>0?f?.headers:void 0,integrity:f.integrity,keepalive:f.keepalive,method:f.method,mode:f.mode,redirect:f.redirect,referrer:f.referrer,referrerPolicy:f.referrerPolicy,signal:f.signal,...u});const{resolved:h,promise:w}=gt(f,u,n);return o&&d(h.href),w},setHeaders:()=>{},depends:d,parent(){return o&&(l.parent=!0),t()},untrack(f){o=!1;try{return f()}finally{o=!0}}};s=await c.universal.load.call(null,p)??null}return{node:c,loader:e,server:i,universal:c.universal?.load?{type:"data",data:s,uses:l}:null,data:s??i?.data??null,slash:c.universal?.trailingSlash??i?.slash}}function gt(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?Pt(r,a.href,t):Ut(r,t);return{resolved:a,promise:i}}function Xt(e,t,n,r,a,i){if(Z)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const s of a.search_params)if(r.has(s))return!0;for(const s of a.params)if(i[s]!==_.params[s])return!0;for(const s of a.dependencies)if(se.some(o=>o(new URL(s))))return!0;return!1}function Ke(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function Qt(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(s=>i.includes(s))&&i.every(s=>a.includes(s))&&n.delete(r)}return n}function Zt({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:Me(b),constructors:[]}}}async function Be({id:e,invalidating:t,url:n,params:r,route:a,preload:i}){if(L?.id===e)return ue.delete(L.token),L.promise;const{errors:s,layouts:o,leaf:l}=a,c=[...o,l];s.forEach(m=>m?.().catch(()=>{})),c.forEach(m=>m?.[1]().catch(()=>{}));const d=_.url?e!==he(_.url):!1,p=_.route?a.id!==_.route.id:!1,f=Qt(_.url,n);let u=!1;const h=c.map(async(m,g)=>{if(!m)return;const S=_.branch[g];return m[1]===S?.loader&&!Xt(u,p,d,f,S.universal?.uses,r)?S:(u=!0,Ve({loader:m[1],url:n,params:r,route:a,parent:async()=>{const O={};for(let $=0;$<g;$+=1)Object.assign(O,(await h[$])?.data);return O},server_data_node:Ke(m[0]?{type:"skip"}:null,m[0]?S?.server:void 0)}))});for(const m of h)m.catch(()=>{});const w=[];for(let m=0;m<c.length;m+=1)if(c[m])try{w.push(await h[m])}catch(g){if(g instanceof Te)return{type:"redirect",location:g.location};if(ue.has(i))return Zt({error:await Q(g,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let S=Ce(g),E;if(g instanceof Pe)E=g.body;else{if(await C.updated.check())return await lt(),await Y(n);E=await Q(g,{params:r,url:n,route:{id:a.id}})}const O=await en(m,w,s);return O?de({url:n,params:r,branch:w.slice(0,O.idx).concat(O.node),status:S,error:E,route:a}):await _t(n,{id:a.id},E,S)}else w.push(void 0);return de({url:n,params:r,branch:w,status:200,error:null,route:a,form:t?void 0:null})}async function en(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 Fe({status:e,error:t,url:n,route:r}){const a={};let i=null;try{const s=await Ve({loader:Re,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Ke(i)}),o={node:await oe(),loader:oe,universal:null,server:null,data:null};return de({url:n,params:a,branch:[s,o],status:e,error:t,route:null})}catch(s){if(s instanceof Te)return De(new URL(s.location,location.href),{},0);throw s}}async function tn(e){const t=e.href;if(ne.has(t))return ne.get(t);let n;try{const r=(async()=>{let a=await v.hooks.reroute({url:new URL(e),fetch:async(i,s)=>gt(i,s,e).promise})??e;if(typeof a=="string"){const i=new URL(e);v.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 ee(e,t){if(e&&!ge(e,x,v.hash)){const n=await tn(e);if(!n)return;const r=nn(n);for(const a of Ne){const i=a.exec(r);if(i)return{id:he(e),invalidating:t,route:a,params:Et(i),url:e}}}}function nn(e){return St(v.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(x.length))||"/"}function he(e){return(v.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function mt({url:e,type:t,intent:n,delta:r,event:a,scroll:i}){let s=!1;const o=Ge(_,n,e,t,i??null);r!==void 0&&(o.navigation.delta=r),a!==void 0&&(o.navigation.event=a);const l={...o.navigation,cancel:()=>{s=!0,o.reject(new Error("navigation cancelled"))}};return X||ct.forEach(c=>c(l)),s?null:o}async function F({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s={},redirect_count:o=0,nav_token:l={},accept:c=Ee,block:d=Ee,event:p}){const f=I;I=l;const u=await ee(t,!1),h=e==="enter"?Ge(_,u,t,e):mt({url:t,type:e,delta:n?.delta,intent:u,scroll:n?.scroll,event:p});if(!h){d(),I===l&&(I=f);return}const w=y,m=R;c(),X=!0,ce&&h.navigation.type!=="enter"&&C.navigating.set(W.current=h.navigation);let g=u&&await Be(u);if(!g){if(ge(t,x,v.hash))return await Y(t,i);g=await _t(t,{id:null},await Q(new Ie(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,i)}if(t=u?.url||t,I!==l)return h.reject(new Error("navigation aborted")),!1;if(g.type==="redirect"){if(o<20){await F({type:e,url:new URL(g.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s,redirect_count:o+1,nav_token:l}),h.fulfil(void 0);return}g=await Fe({status:500,error:await Q(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else g.props.page.status>=400&&await C.updated.check()&&(await lt(),await Y(t,i));if(Le(),je(w),dt(m),g.props.page.url.pathname!==t.pathname&&(t.pathname=g.props.page.url.pathname),s=n?n.state:s,!n){const k=i?0:1,te={[B]:y+=k,[H]:R+=k,[nt]:s};(i?history.replaceState:history.pushState).call(history,te,"",t),i||Ht(y,R)}const S=u&&L?.id===u.id?L.fork:null;L=null,g.props.page.state=s;let E;if(ce){const k=(await Promise.all(Array.from(Wt,D=>D(h.navigation)))).filter(D=>typeof D=="function");if(k.length>0){let D=function(){k.forEach(me=>{z.delete(me)})};k.push(D),k.forEach(me=>{z.add(me)})}_=g.state,g.props.page&&(g.props.page.url=t);const te=S&&await S;te?E=te.commit():(qe.$set(g.props),it(g.props.page),E=bt?.()),ft=!0}else await pt(g,xe,!1);const{activeElement:O}=document;await E,await re(),await re();let $=null;if(Xe){const k=n?n.scroll:a?q():null;k?scrollTo(k.x,k.y):($=t.hash&&document.getElementById(wt(t)))?$.scrollIntoView():scrollTo(0,0)}const vt=document.activeElement!==O&&document.activeElement!==document.body;!r&&!vt&&cn(t,!$),Xe=!0,g.props.page&&Object.assign(b,g.props.page),X=!1,e==="popstate"&&ht(R),h.fulfil(void 0),h.navigation.to&&(h.navigation.to.scroll=q()),z.forEach(k=>k(h.navigation)),C.navigating.set(W.current=null)}async function _t(e,t,n,r,a){return e.origin===pe&&e.pathname===location.pathname&&!ut?await Fe({status:r,error:n,url:e,route:t}):await Y(e,a)}function rn(){let e,t={element:void 0,href:void 0},n;T.addEventListener("mousemove",o=>{const l=o.target;clearTimeout(e),e=setTimeout(()=>{i(l,N.hover)},20)});function r(o){o.defaultPrevented||i(o.composedPath()[0],N.tap)}T.addEventListener("mousedown",r),T.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(o=>{for(const l of o)l.isIntersecting&&(ke(new URL(l.target.href)),a.unobserve(l.target))},{threshold:0});async function i(o,l){const c=at(o,T),d=c===t.element&&c?.href===t.href&&l>=n;if(!c||d)return;const{url:p,external:f,download:u}=Se(c,x,v.hash);if(f||u)return;const h=ae(c),w=p&&he(_.url)===he(p);if(!(h.reload||w))if(l<=h.preload_data){t={element:c,href:c.href},n=N.tap;const m=await ee(p,!1);if(!m)return;Yt(m)}else l<=h.preload_code&&(t={element:c,href:c.href},n=l,ke(p))}function s(){a.disconnect();for(const o of T.querySelectorAll("a")){const{url:l,external:c,download:d}=Se(o,x,v.hash);if(c||d)continue;const p=ae(o);p.reload||(p.preload_code===N.viewport&&a.observe(o),p.preload_code===N.eager&&ke(l))}}z.add(s),s()}function Q(e,t){if(e instanceof Pe)return e.body;const n=Ce(e),r=Ft(e);return v.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function _n(e,t={}){return e=new URL($e(e)),e.origin!==pe?Promise.reject(new Error("goto: invalid URL")):De(e,t,0)}function an(e){if(typeof e=="function")se.push(e);else{const{href:t}=new URL(e,location.href);se.push(n=>n.href===t)}}function wn(){return Z=!0,Jt()}function on(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(Qe(),!X){const r=Ge(_,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};ct.forEach(i=>i(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Qe()}),navigator.connection?.saveData||rn(),T.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=at(t.composedPath()[0],T);if(!n)return;const{url:r,external:a,target:i,download:s}=Se(n,x,v.hash);if(!r)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const o=ae(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||s)return;const[c,d]=(v.hash?r.hash.replace(/^#/,""):r.href).split("#"),p=c===we(location);if(a||o.reload&&(!p||!d)){mt({url:r,type:"link",event:t})?X=!0:t.preventDefault();return}if(d!==void 0&&p){const[,f]=_.url.href.split("#");if(f===d){if(t.preventDefault(),d===""||d==="top"&&n.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const u=n.ownerDocument.getElementById(decodeURIComponent(d));u&&(u.scrollIntoView(),u.focus())}return}if(G=!0,je(y),e(r),!o.replace_state)return;G=!1}t.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await F({type:"link",url:r,keepfocus:o.keepfocus,noscroll:o.noscroll,replace_state:o.replace_state??r.href===location.href,event:t})}),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 s=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(ge(s,x,!1))return;const o=t.target,l=ae(o);if(l.reload)return;t.preventDefault(),t.stopPropagation();const c=new FormData(o,r);s.search=new URLSearchParams(c).toString(),F({type:"form",url:s,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??s.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!Ae){if(t.state?.[B]){const n=t.state[B];if(I={},n===y)return;const r=j[n],a=t.state[nt]??{},i=new URL(t.state[Dt]??location.href),s=t.state[H],o=_.url?we(location)===we(_.url):!1;if(s===R&&(ft||o)){a!==b.state&&(b.state=a),e(i),j[y]=q(),r&&scrollTo(r.x,r.y),y=n;return}const c=n-y;await F({type:"popstate",url:i,popped:{state:a,scroll:r,delta:c},accept:()=>{y=n,R=s},block:()=>{history.go(-c)},nav_token:I,event:t})}else if(!G){const n=new URL(location.href);e(n),v.hash&&location.reload()}}}),addEventListener("hashchange",()=>{G&&(G=!1,history.replaceState({...history.state,[B]:++y,[H]:R},"",location.href))});for(const t of document.querySelectorAll("link"))zt.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&C.navigating.set(W.current=null)});function e(t){_.url=b.url=t,C.page.set(Me(b)),C.page.notify()}}async function sn(e,{status:t=200,error:n,node_ids:r,params:a,route:i,server_route:s,data:o,form:l}){ut=!0;const c=new URL(location.href);let d;({params:a={},route:i={id:null}}=await ee(c,!1)||{}),d=Ne.find(({id:u})=>u===i.id);let p,f=!0;try{const u=r.map(async(w,m)=>{const g=o[m];return g?.uses&&(g.uses=ln(g.uses)),Ve({loader:v.nodes[w],url:c,params:a,route:i,parent:async()=>{const S={};for(let E=0;E<m;E+=1)Object.assign(S,(await u[E]).data);return S},server_data_node:Ke(g)})}),h=await Promise.all(u);if(d){const w=d.layouts;for(let m=0;m<w.length;m++)w[m]||h.splice(m,0,void 0)}p=de({url:c,params:a,branch:h,status:t,error:n,form:l,route:d??null})}catch(u){if(u instanceof Te){await Y(new URL(u.location,location.href));return}p=await Fe({status:Ce(u),error:await Q(u,{url:c,params:a,route:i}),url:c,route:i}),e.textContent="",f=!1}p.props.page&&(p.props.page.state={}),await pt(p,e,f)}function ln(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 Ae=!1;function cn(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:s}=q();setTimeout(()=>{const o=history.state;Ae=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(o,"",e),t&&scrollTo(i,s),Ae=!1})}else{const i=document.body,s=i.getAttribute("tabindex");i.tabIndex=-1,i.focus({preventScroll:!0,focusVisible:!1}),s!==null?i.setAttribute("tabindex",s):i.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const i=[];for(let s=0;s<a.rangeCount;s+=1)i.push(a.getRangeAt(s));setTimeout(()=>{if(a.rangeCount===i.length){for(let s=0;s<a.rangeCount;s+=1){const o=i[s],l=a.getRangeAt(s);if(o.commonAncestorContainer!==l.commonAncestorContainer||o.startContainer!==l.startContainer||o.endContainer!==l.endContainer||o.startOffset!==l.startOffset||o.endOffset!==l.endOffset)return}a.removeAllRanges()}})}}}function Ge(e,t,n,r,a=null){let i,s;const o=new Promise((c,d)=>{i=c,s=d});return o.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:q()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:a},willUnload:!t,type:r,complete:o},fulfil:i,reject:s}}function Me(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 un(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function wt(e){let t;if(v.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{mn as a,_n as g,wn as i,dn as l,b as p,C as s};
|
|
1
|
+
import{aF as me,bx as yt,R as Me,F as A,g as U,D as P,S as re,by as bt}from"./8FUQuwgM.js";const V=[];function Ue(e,t=me){let n=null;const r=new Set;function a(o){if(yt(e,o)&&(e=o,n)){const l=!V.length;for(const c of r)c[1](),V.push(c,e);if(l){for(let c=0;c<V.length;c+=2)V[c][0](V[c+1]);V.length=0}}}function i(o){a(o(e))}function s(o,l=me){const c=[o,l];return r.add(c),r.size===1&&(n=t(a,i)||me),o(e),()=>{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:a,update:i,subscribe:s}}class Pe{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 Te{constructor(t,n){this.status=t,this.location=n}}class Ie extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function kt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function St(e){return e.split("%25").map(decodeURI).join("%25")}function Et(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function ve({href:e}){return e.split("#")[0]}function Rt(e,t,n,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(s,o){if(o==="get"||o==="getAll"||o==="has")return(c,...d)=>(n(c),s[o](c,...d));t();const l=Reflect.get(s,o);return typeof l=="function"?l.bind(s):l}}),enumerable:!0,configurable:!0});const i=["href","pathname","search","toString","toJSON"];r&&i.push("hash");for(const s of i)Object.defineProperty(a,s,{get(){return t(),e[s]},enumerable:!0,configurable:!0});return a}function xt(...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;new TextDecoder;function Lt(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 At=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&G.delete(Oe(e)),At(e,t));const G=new Map;function Ut(e,t){const n=Oe(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...i}=JSON.parse(r.textContent);const s=r.getAttribute("data-ttl");return s&&G.set(n,{body:a,init:i,ttl:1e3*Number(s)}),r.getAttribute("data-b64")!==null&&(a=Lt(a)),Promise.resolve(new Response(a,i))}return window.fetch(e,t)}function Pt(e,t,n){if(G.size>0){const r=Oe(e,n),a=G.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);G.delete(r)}}return window.fetch(t,n)}function Oe(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="${xt(...a)}"]`}return r}const Tt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function It(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${$t(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 s=r.split(/\[(.+?)\](?!\])/);return"/"+s.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return we(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return we(String.fromCharCode(...l.slice(2).split("-").map(v=>parseInt(v,16))));const d=Tt.exec(l),[,p,f,u,h]=d;return t.push({name:u,matcher:h,optional:!!p,rest:!!f,chained:f?c===1&&s[0]==="":!1}),f?"([^]*?)":p?"([^/]*)?":"([^/]+?)"}return we(l)}).join("")}).join("")}/?$`),params:t}}function Ot(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function $t(e){return e.slice(1).split("/").filter(Ot)}function Ct(e,t,n){const r={},a=e.slice(1),i=a.filter(o=>o!==void 0);let s=0;for(let o=0;o<t.length;o+=1){const l=t[o];let c=a[o-s];if(l.chained&&l.rest&&s&&(c=a.slice(o-s,o+1).filter(d=>d).join("/"),s=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||n[l.matcher](c)){r[l.name]=c;const d=t[o+1],p=a[o+1];d&&!d.rest&&d.optional&&p&&l.chained&&(s=0),!d&&!p&&Object.keys(r).length===i.length&&(s=0);continue}if(l.optional&&l.chained){s++;continue}return}if(!s)return r}function we(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function jt({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[l,c,d]])=>{const{pattern:p,params:f}=It(o),u={id:o,exec:h=>{const v=p.exec(h);if(v)return Ct(v,f,r)},errors:[1,...d||[]].map(h=>e[h]),layouts:[0,...c||[]].map(s),leaf:i(l)};return u.errors.length=u.layouts.length=Math.max(u.errors.length,u.layouts.length),u});function i(o){const l=o<0;return l&&(o=~o),[l,e[o]]}function s(o){return o===void 0?o:[a.has(o),e[o]]}}function Ze(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function He(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const x=globalThis.__sveltekit_1ve7xz2?.base??"",Nt=globalThis.__sveltekit_1ve7xz2?.assets??x??"",qt="1774337141692",et="sveltekit:snapshot",tt="sveltekit:scroll",nt="sveltekit:states",Dt="sveltekit:pageurl",F="sveltekit:history",H="sveltekit:navigation",N={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},pe=location.origin;function $e(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 q(){return{x:pageXOffset,y:pageYOffset}}function z(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const We={...N,"":N.hover};function rt(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function at(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=rt(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 o=location.hash.split("#")[1]||"/";r.hash=`#${o}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,i=!r||!!a||ge(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),s=r?.origin===pe&&e.hasAttribute("download");return{url:r,external:i,target:a,download:s}}function ae(e){let t=null,n=null,r=null,a=null,i=null,s=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=z(o,"preload-code")),a===null&&(a=z(o,"preload-data")),t===null&&(t=z(o,"keepfocus")),n===null&&(n=z(o,"noscroll")),i===null&&(i=z(o,"reload")),s===null&&(s=z(o,"replacestate")),o=rt(o);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:We[r??"off"],preload_data:We[a??"off"],keepfocus:l(t),noscroll:l(n),reload:l(i),replace_state:l(s)}}function Je(e){const t=Ue(e);let n=!0;function r(){n=!0,t.update(s=>s)}function a(s){n=!1,t.set(s)}function i(s){let o;return t.subscribe(l=>{(o===void 0||n&&l!==o)&&s(o=l)})}return{notify:r,set:a,subscribe:i}}const ot={v:()=>{}};function Vt(){const{set:e,subscribe:t}=Ue(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Nt}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const s=(await a.json()).version!==qt;return s&&(e(!0),ot.v(),clearTimeout(n)),s}catch{return!1}}return{subscribe:t,check:r}}function ge(e,t,n){return e.origin!==pe||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function dn(e){}const st=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...st];const zt=new Set([...st]);[...zt];function Ft(e){return e.filter(t=>t!=null)}function Ce(e){return e instanceof Pe||e instanceof Ie?e.status:500}function Bt(e){return e instanceof Ie?e.text:"Internal Error"}let b,W,ye;const Kt=Me.toString().includes("$$")||/function \w+\(\) \{\}/.test(Me.toString());Kt?(b={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},W={current:null},ye={current:!1}):(b=new class{#e=A({});get data(){return U(this.#e)}set data(t){P(this.#e,t)}#t=A(null);get form(){return U(this.#t)}set form(t){P(this.#t,t)}#n=A(null);get error(){return U(this.#n)}set error(t){P(this.#n,t)}#r=A({});get params(){return U(this.#r)}set params(t){P(this.#r,t)}#a=A({id:null});get route(){return U(this.#a)}set route(t){P(this.#a,t)}#o=A({});get state(){return U(this.#o)}set state(t){P(this.#o,t)}#s=A(-1);get status(){return U(this.#s)}set status(t){P(this.#s,t)}#i=A(new URL("https://example.com"));get url(){return U(this.#i)}set url(t){P(this.#i,t)}},W=new class{#e=A(null);get current(){return U(this.#e)}set current(t){P(this.#e,t)}},ye=new class{#e=A(!1);get current(){return U(this.#e)}set current(t){P(this.#e,t)}},ot.v=()=>ye.current=!0);function it(e){Object.assign(b,e)}const Ye={spanContext(){return Gt},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},Gt={traceId:"",spanId:"",traceFlags:0},Mt=new Set(["icon","shortcut icon","apple-touch-icon"]),j=Ze(tt)??{},J=Ze(et)??{},C={url:Je({}),page:Je({}),navigating:Ue(null),updated:Vt()};function je(e){j[e]=q()}function Ht(e,t){let n=e+1;for(;j[n];)delete j[n],n+=1;for(n=t+1;J[n];)delete J[n],n+=1}function Y(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function lt(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(x||"/");e&&await e.update()}}function Ee(){}let Ne,Re,oe,T,xe,w;const se=[],ie=[];let L=null;function le(){L?.fork?.then(e=>e?.discard()),L=null}const ne=new Map,ct=new Set,Wt=new Set,M=new Set;let m={branch:[],error:null,url:null},ut=!1,ce=!1,Xe=!0,X=!1,K=!1,ft=!1,Z=!1,qe,y,R,I;const ue=new Set;let be;const fe=new Map;async function _n(e,t,n){globalThis.__sveltekit_1ve7xz2?.data&&globalThis.__sveltekit_1ve7xz2.data,document.URL!==location.href&&(location.href=location.href),w=e,await e.hooks.init?.(),Ne=jt(e),T=document.documentElement,xe=t,Re=e.nodes[0],oe=e.nodes[1],Re(),oe(),y=history.state?.[F],R=history.state?.[H],y||(y=R=Date.now(),history.replaceState({...history.state,[F]:y,[H]:R},""));const r=j[y];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await sn(xe,n)):(await B({type:"enter",url:$e(w.hash?un(new URL(location.href)):location.href),replace_state:!0}),a()),on()}async function Jt(e=!0,t=!0){if(await(be||=Promise.resolve()),!be)return;be=null;const n=I={},r=await ee(m.url,!0);if(le(),Z&&fe.forEach(({resource:a})=>{a.refresh?.()}),e){const a=b.state,i=r&&await Fe(r);if(!i||n!==I)return;if(i.type==="redirect")return De(new URL(i.location,m.url).href,{replaceState:!0},1,n);t||(i.props.page.state=a),it(i.props.page),m=i.state,Le(),qe.$set(i.props)}else Le();await Promise.all([...fe.values()].map(({resource:a})=>a)).catch(Ee)}function Le(){se.length=0,Z=!1}function dt(e){ie.some(t=>t?.snapshot)&&(J[e]=ie.map(t=>t?.snapshot?.capture()))}function ht(e){J[e]?.forEach((t,n)=>{ie[n]?.snapshot?.restore(t)})}function Qe(){je(y),He(tt,j),dt(R),He(et,J)}async function De(e,t,n,r){let a;t.invalidateAll&&le(),await B({type:"goto",url:$e(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Z=!0,a=[...fe.keys()]),t.invalidate&&t.invalidate.forEach(an)}}),t.invalidateAll&&re().then(re).then(()=>{fe.forEach(({resource:i},s)=>{a?.includes(s)&&i.refresh?.()})})}async function Yt(e){if(e.id!==L?.id){le();const t={};ue.add(t),L={id:e.id,token:t,promise:Fe({...e,preload:t}).then(n=>(ue.delete(t),n.type==="loaded"&&n.state.error&&le(),n)),fork:null}}return L.promise}async function ke(e){const t=(await ee(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(n=>n[1]()))}async function pt(e,t,n){m=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(b,e.props.page),qe=new w.root({target:t,props:{...e.props,stores:C,components:ie},hydrate:n,sync:!1}),await Promise.resolve(),ht(R),n){const a={from:null,to:{params:m.params,route:{id:m.route?.id??null},url:new URL(location.href),scroll:j[y]??q()},willUnload:!1,type:"enter",complete:Promise.resolve()};M.forEach(i=>i(a))}ce=!0}function de({url:e,params:t,branch:n,status:r,error:a,route:i,form:s}){let o="never";if(x&&(e.pathname===x||e.pathname===x+"/"))o="always";else for(const u of n)u?.slash!==void 0&&(o=u.slash);e.pathname=kt(e.pathname,o),e.search=e.search;const l={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:i},props:{constructors:Ft(n).map(u=>u.node.component),page:Ge(b)}};s!==void 0&&(l.props.form=s);let c={},d=!b,p=0;for(let u=0;u<Math.max(n.length,m.branch.length);u+=1){const h=n[u],v=m.branch[u];h?.data!==v?.data&&(d=!0),h&&(c={...c,...h.data},d&&(l.props[`data_${p}`]=c),p+=1)}return(!m.url||e.href!==m.url.href||m.error!==a||s!==void 0&&s!==b.form||d)&&(l.props.page={error:a,params:t,route:{id:i?.id??null},state:{},status:r,url:new URL(e),form:s??null,data:d?c:b.data}),l}async function Ve({loader:e,parent:t,url:n,params:r,route:a,server_data_node:i}){let s=null,o=!0;const l={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},c=await e();if(c.universal?.load){let d=function(...f){for(const u of f){const{href:h}=new URL(u,n);l.dependencies.add(h)}};const p={tracing:{enabled:!1,root:Ye,current:Ye},route:new Proxy(a,{get:(f,u)=>(o&&(l.route=!0),f[u])}),params:new Proxy(r,{get:(f,u)=>(o&&l.params.add(u),f[u])}),data:i?.data??null,url:Rt(n,()=>{o&&(l.url=!0)},f=>{o&&l.search_params.add(f)},w.hash),async fetch(f,u){f instanceof Request&&(u={body:f.method==="GET"||f.method==="HEAD"?void 0:await f.blob(),cache:f.cache,credentials:f.credentials,headers:[...f.headers].length>0?f?.headers:void 0,integrity:f.integrity,keepalive:f.keepalive,method:f.method,mode:f.mode,redirect:f.redirect,referrer:f.referrer,referrerPolicy:f.referrerPolicy,signal:f.signal,...u});const{resolved:h,promise:v}=gt(f,u,n);return o&&d(h.href),v},setHeaders:()=>{},depends:d,parent(){return o&&(l.parent=!0),t()},untrack(f){o=!1;try{return f()}finally{o=!0}}};s=await c.universal.load.call(null,p)??null}return{node:c,loader:e,server:i,universal:c.universal?.load?{type:"data",data:s,uses:l}:null,data:s??i?.data??null,slash:c.universal?.trailingSlash??i?.slash}}function gt(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?Pt(r,a.href,t):Ut(r,t);return{resolved:a,promise:i}}function Xt(e,t,n,r,a,i){if(Z)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const s of a.search_params)if(r.has(s))return!0;for(const s of a.params)if(i[s]!==m.params[s])return!0;for(const s of a.dependencies)if(se.some(o=>o(new URL(s))))return!0;return!1}function ze(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function Qt(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(s=>i.includes(s))&&i.every(s=>a.includes(s))&&n.delete(r)}return n}function Zt({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 Fe({id:e,invalidating:t,url:n,params:r,route:a,preload:i}){if(L?.id===e)return ue.delete(L.token),L.promise;const{errors:s,layouts:o,leaf:l}=a,c=[...o,l];s.forEach(_=>_?.().catch(()=>{})),c.forEach(_=>_?.[1]().catch(()=>{}));const d=m.url?e!==he(m.url):!1,p=m.route?a.id!==m.route.id:!1,f=Qt(m.url,n);let u=!1;const h=c.map(async(_,g)=>{if(!_)return;const S=m.branch[g];return _[1]===S?.loader&&!Xt(u,p,d,f,S.universal?.uses,r)?S:(u=!0,Ve({loader:_[1],url:n,params:r,route:a,parent:async()=>{const O={};for(let $=0;$<g;$+=1)Object.assign(O,(await h[$])?.data);return O},server_data_node:ze(_[0]?{type:"skip"}:null,_[0]?S?.server:void 0)}))});for(const _ of h)_.catch(()=>{});const v=[];for(let _=0;_<c.length;_+=1)if(c[_])try{v.push(await h[_])}catch(g){if(g instanceof Te)return{type:"redirect",location:g.location};if(ue.has(i))return Zt({error:await Q(g,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let S=Ce(g),E;if(g instanceof Pe)E=g.body;else{if(await C.updated.check())return await lt(),await Y(n);E=await Q(g,{params:r,url:n,route:{id:a.id}})}const O=await en(_,v,s);return O?de({url:n,params:r,branch:v.slice(0,O.idx).concat(O.node),status:S,error:E,route:a}):await mt(n,{id:a.id},E,S)}else v.push(void 0);return de({url:n,params:r,branch:v,status:200,error:null,route:a,form:t?void 0:null})}async function en(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 s=await Ve({loader:Re,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:ze(i)}),o={node:await oe(),loader:oe,universal:null,server:null,data:null};return de({url:n,params:a,branch:[s,o],status:e,error:t,route:null})}catch(s){if(s instanceof Te)return De(new URL(s.location,location.href),{},0);throw s}}async function tn(e){const t=e.href;if(ne.has(t))return ne.get(t);let n;try{const r=(async()=>{let a=await w.hooks.reroute({url:new URL(e),fetch:async(i,s)=>gt(i,s,e).promise})??e;if(typeof a=="string"){const i=new URL(e);w.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 ee(e,t){if(e&&!ge(e,x,w.hash)){const n=await tn(e);if(!n)return;const r=nn(n);for(const a of Ne){const i=a.exec(r);if(i)return{id:he(e),invalidating:t,route:a,params:Et(i),url:e}}}}function nn(e){return St(w.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(x.length))||"/"}function he(e){return(w.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function _t({url:e,type:t,intent:n,delta:r,event:a,scroll:i}){let s=!1;const o=Ke(m,n,e,t,i??null);r!==void 0&&(o.navigation.delta=r),a!==void 0&&(o.navigation.event=a);const l={...o.navigation,cancel:()=>{s=!0,o.reject(new Error("navigation cancelled"))}};return X||ct.forEach(c=>c(l)),s?null:o}async function B({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s={},redirect_count:o=0,nav_token:l={},accept:c=Ee,block:d=Ee,event:p}){const f=I;I=l;const u=await ee(t,!1),h=e==="enter"?Ke(m,u,t,e):_t({url:t,type:e,delta:n?.delta,intent:u,scroll:n?.scroll,event:p});if(!h){d(),I===l&&(I=f);return}const v=y,_=R;c(),X=!0,ce&&h.navigation.type!=="enter"&&C.navigating.set(W.current=h.navigation);let g=u&&await Fe(u);if(!g){if(ge(t,x,w.hash))return await Y(t,i);g=await mt(t,{id:null},await Q(new Ie(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,i)}if(t=u?.url||t,I!==l)return h.reject(new Error("navigation aborted")),!1;if(g.type==="redirect"){if(o<20){await B({type:e,url:new URL(g.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s,redirect_count:o+1,nav_token:l}),h.fulfil(void 0);return}g=await Be({status:500,error:await Q(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else g.props.page.status>=400&&await C.updated.check()&&(await lt(),await Y(t,i));if(Le(),je(v),dt(_),g.props.page.url.pathname!==t.pathname&&(t.pathname=g.props.page.url.pathname),s=n?n.state:s,!n){const k=i?0:1,te={[F]:y+=k,[H]:R+=k,[nt]:s};(i?history.replaceState:history.pushState).call(history,te,"",t),i||Ht(y,R)}const S=u&&L?.id===u.id?L.fork:null;L=null,g.props.page.state=s;let E;if(ce){const k=(await Promise.all(Array.from(Wt,D=>D(h.navigation)))).filter(D=>typeof D=="function");if(k.length>0){let D=function(){k.forEach(_e=>{M.delete(_e)})};k.push(D),k.forEach(_e=>{M.add(_e)})}m=g.state,g.props.page&&(g.props.page.url=t);const te=S&&await S;te?E=te.commit():(qe.$set(g.props),it(g.props.page),E=bt?.()),ft=!0}else await pt(g,xe,!1);const{activeElement:O}=document;await E,await re(),await re();let $=null;if(Xe){const k=n?n.scroll:a?q():null;k?scrollTo(k.x,k.y):($=t.hash&&document.getElementById(vt(t)))?$.scrollIntoView():scrollTo(0,0)}const wt=document.activeElement!==O&&document.activeElement!==document.body;!r&&!wt&&cn(t,!$),Xe=!0,g.props.page&&Object.assign(b,g.props.page),X=!1,e==="popstate"&&ht(R),h.fulfil(void 0),h.navigation.to&&(h.navigation.to.scroll=q()),M.forEach(k=>k(h.navigation)),C.navigating.set(W.current=null)}async function mt(e,t,n,r,a){return e.origin===pe&&e.pathname===location.pathname&&!ut?await Be({status:r,error:n,url:e,route:t}):await Y(e,a)}function rn(){let e,t={element:void 0,href:void 0},n;T.addEventListener("mousemove",o=>{const l=o.target;clearTimeout(e),e=setTimeout(()=>{i(l,N.hover)},20)});function r(o){o.defaultPrevented||i(o.composedPath()[0],N.tap)}T.addEventListener("mousedown",r),T.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(o=>{for(const l of o)l.isIntersecting&&(ke(new URL(l.target.href)),a.unobserve(l.target))},{threshold:0});async function i(o,l){const c=at(o,T),d=c===t.element&&c?.href===t.href&&l>=n;if(!c||d)return;const{url:p,external:f,download:u}=Se(c,x,w.hash);if(f||u)return;const h=ae(c),v=p&&he(m.url)===he(p);if(!(h.reload||v))if(l<=h.preload_data){t={element:c,href:c.href},n=N.tap;const _=await ee(p,!1);if(!_)return;Yt(_)}else l<=h.preload_code&&(t={element:c,href:c.href},n=l,ke(p))}function s(){a.disconnect();for(const o of T.querySelectorAll("a")){const{url:l,external:c,download:d}=Se(o,x,w.hash);if(c||d)continue;const p=ae(o);p.reload||(p.preload_code===N.viewport&&a.observe(o),p.preload_code===N.eager&&ke(l))}}M.add(s),s()}function Q(e,t){if(e instanceof Pe)return e.body;const n=Ce(e),r=Bt(e);return w.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function mn(e,t={}){return e=new URL($e(e)),e.origin!==pe?Promise.reject(new Error("goto: invalid URL")):De(e,t,0)}function an(e){if(typeof e=="function")se.push(e);else{const{href:t}=new URL(e,location.href);se.push(n=>n.href===t)}}function vn(){return Z=!0,Jt()}function on(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(Qe(),!X){const r=Ke(m,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};ct.forEach(i=>i(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Qe()}),navigator.connection?.saveData||rn(),T.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=at(t.composedPath()[0],T);if(!n)return;const{url:r,external:a,target:i,download:s}=Se(n,x,w.hash);if(!r)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const o=ae(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||s)return;const[c,d]=(w.hash?r.hash.replace(/^#/,""):r.href).split("#"),p=c===ve(location);if(a||o.reload&&(!p||!d)){_t({url:r,type:"link",event:t})?X=!0:t.preventDefault();return}if(d!==void 0&&p){const[,f]=m.url.href.split("#");if(f===d){if(t.preventDefault(),d===""||d==="top"&&n.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const u=n.ownerDocument.getElementById(decodeURIComponent(d));u&&(u.scrollIntoView(),u.focus())}return}if(K=!0,je(y),e(r),!o.replace_state)return;K=!1}t.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await B({type:"link",url:r,keepfocus:o.keepfocus,noscroll:o.noscroll,replace_state:o.replace_state??r.href===location.href,event:t})}),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 s=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(ge(s,x,!1))return;const o=t.target,l=ae(o);if(l.reload)return;t.preventDefault(),t.stopPropagation();const c=new FormData(o,r);s.search=new URLSearchParams(c).toString(),B({type:"form",url:s,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??s.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!Ae){if(t.state?.[F]){const n=t.state[F];if(I={},n===y)return;const r=j[n],a=t.state[nt]??{},i=new URL(t.state[Dt]??location.href),s=t.state[H],o=m.url?ve(location)===ve(m.url):!1;if(s===R&&(ft||o)){a!==b.state&&(b.state=a),e(i),j[y]=q(),r&&scrollTo(r.x,r.y),y=n;return}const c=n-y;await B({type:"popstate",url:i,popped:{state:a,scroll:r,delta:c},accept:()=>{y=n,R=s},block:()=>{history.go(-c)},nav_token:I,event:t})}else if(!K){const n=new URL(location.href);e(n),w.hash&&location.reload()}}}),addEventListener("hashchange",()=>{K&&(K=!1,history.replaceState({...history.state,[F]:++y,[H]:R},"",location.href))});for(const t of document.querySelectorAll("link"))Mt.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&C.navigating.set(W.current=null)});function e(t){m.url=b.url=t,C.page.set(Ge(b)),C.page.notify()}}async function sn(e,{status:t=200,error:n,node_ids:r,params:a,route:i,server_route:s,data:o,form:l}){ut=!0;const c=new URL(location.href);let d;({params:a={},route:i={id:null}}=await ee(c,!1)||{}),d=Ne.find(({id:u})=>u===i.id);let p,f=!0;try{const u=r.map(async(v,_)=>{const g=o[_];return g?.uses&&(g.uses=ln(g.uses)),Ve({loader:w.nodes[v],url:c,params:a,route:i,parent:async()=>{const S={};for(let E=0;E<_;E+=1)Object.assign(S,(await u[E]).data);return S},server_data_node:ze(g)})}),h=await Promise.all(u);if(d){const v=d.layouts;for(let _=0;_<v.length;_++)v[_]||h.splice(_,0,void 0)}p=de({url:c,params:a,branch:h,status:t,error:n,form:l,route:d??null})}catch(u){if(u instanceof Te){await Y(new URL(u.location,location.href));return}p=await Be({status:Ce(u),error:await Q(u,{url:c,params:a,route:i}),url:c,route:i}),e.textContent="",f=!1}p.props.page&&(p.props.page.state={}),await pt(p,e,f)}function ln(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 Ae=!1;function cn(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=vt(e);if(r&&document.getElementById(r)){const{x:i,y:s}=q();setTimeout(()=>{const o=history.state;Ae=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(o,"",e),t&&scrollTo(i,s),Ae=!1})}else{const i=document.body,s=i.getAttribute("tabindex");i.tabIndex=-1,i.focus({preventScroll:!0,focusVisible:!1}),s!==null?i.setAttribute("tabindex",s):i.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const i=[];for(let s=0;s<a.rangeCount;s+=1)i.push(a.getRangeAt(s));setTimeout(()=>{if(a.rangeCount===i.length){for(let s=0;s<a.rangeCount;s+=1){const o=i[s],l=a.getRangeAt(s);if(o.commonAncestorContainer!==l.commonAncestorContainer||o.startContainer!==l.startContainer||o.endContainer!==l.endContainer||o.startOffset!==l.startOffset||o.endOffset!==l.endOffset)return}a.removeAllRanges()}})}}}function Ke(e,t,n,r,a=null){let i,s;const o=new Promise((c,d)=>{i=c,s=d});return o.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:q()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:a},willUnload:!t,type:r,complete:o},fulfil:i,reject:s}}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 un(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function vt(e){let t;if(w.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{_n as a,mn as g,vn as i,dn as l,b as p,C as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as E,l as y,G as g,I as k,J as w,K as P,n as S,s as _,L as R,o as T}from"./8FUQuwgM.js";import{B as b}from"./CbJfRYJV.js";function C(f,c,a){var l;y&&(l=T,g());var i=new b(f);E(()=>{var n=c()??null;if(y){var r=w(l),t=r===R,h=n!==null;if(t!==h){var m=P();S(m),i.anchor=m,_(!1),i.ensure(n,n&&(e=>a(e,n))),_(!0);return}}i.ensure(n,n&&(e=>a(e,n)))},k)}const A="modulepreload",N=function(f,c){return new URL(f,c).href},p={},B=function(c,a,l){let i=Promise.resolve();if(a&&a.length>0){let m=function(e){return Promise.all(e.map(o=>Promise.resolve(o).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};const r=document.getElementsByTagName("link"),t=document.querySelector("meta[property=csp-nonce]"),h=t?.nonce||t?.getAttribute("nonce");i=m(a.map(e=>{if(e=N(e,l),e in p)return;p[e]=!0;const o=e.endsWith(".css"),u=o?'[rel="stylesheet"]':"";if(l)for(let d=r.length-1;d>=0;d--){const v=r[d];if(v.href===e&&(!o||v.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${e}"]${u}`))return;const s=document.createElement("link");if(s.rel=o?"stylesheet":A,o||(s.as="script"),s.crossOrigin="",s.href=e,h&&s.setAttribute("nonce",h),document.head.appendChild(s),o)return new Promise((d,v)=>{s.addEventListener("load",d),s.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${e}`)))})}))}function n(r){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=r,window.dispatchEvent(t),!t.defaultPrevented)throw r}return i.then(r=>{for(const t of r||[])t.status==="rejected"&&n(t.reason);return c().catch(n)})};export{B as _,C as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{O as B,f as F,g as A,e as V,w as S,a as J,t as v,c as D,r as L,b as _,d as N,h as E,i as P,j as G,k as O,l as q,D as R,m as z}from"./CLFba8FK.js";import{r as M}from"./
|
|
1
|
+
import{O as B,f as F,g as A,e as V,w as S,a as J,t as v,c as D,r as L,b as _,d as N,h as E,i as P,j as G,k as O,l as q,D as R,m as z}from"./CLFba8FK.js";import{r as M}from"./DLX3YXva.js";const b=3e4;class K extends B{constructor(n){super(),this.doc=n,this.clientID=n.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const e=A();this.getLocalState()!==null&&b/2<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const s=[];this.meta.forEach((a,c)=>{c!==this.clientID&&b<=e-a.lastUpdated&&this.states.has(c)&&s.push(c)}),s.length>0&&x(this,s,"timeout")},F(b/10)),n.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(n){const e=this.clientID,s=this.meta.get(e),a=s===void 0?0:s.clock+1,c=this.states.get(e);n===null?this.states.delete(e):this.states.set(e,n),this.meta.set(e,{clock:a,lastUpdated:A()});const l=[],u=[],r=[],p=[];n===null?p.push(e):c==null?n!=null&&l.push(e):(u.push(e),V(c,n)||r.push(e)),(l.length>0||r.length>0||p.length>0)&&this.emit("change",[{added:l,updated:r,removed:p},"local"]),this.emit("update",[{added:l,updated:u,removed:p},"local"])}setLocalStateField(n,e){const s=this.getLocalState();s!==null&&this.setLocalState({...s,[n]:e})}getStates(){return this.states}}const x=(t,n,e)=>{const s=[];for(let a=0;a<n.length;a++){const c=n[a];if(t.states.has(c)){if(t.states.delete(c),c===t.clientID){const l=t.meta.get(c);t.meta.set(c,{clock:l.clock+1,lastUpdated:A()})}s.push(c)}}s.length>0&&(t.emit("change",[{added:[],updated:[],removed:s},e]),t.emit("update",[{added:[],updated:[],removed:s},e]))},Q=(t,n,e=t.states)=>{const s=n.length,a=D();S(a,s);for(let c=0;c<s;c++){const l=n[c],u=e.get(l)||null,r=t.meta.get(l).clock;S(a,l),S(a,r),J(a,JSON.stringify(u))}return v(a)},X=(t,n,e)=>{const s=N(n),a=A(),c=[],l=[],u=[],r=[],p=L(s);for(let m=0;m<p;m++){const d=L(s);let g=L(s);const h=JSON.parse(_(s)),y=t.meta.get(d),k=t.states.get(d),o=y===void 0?0:y.clock;(o<g||o===g&&h===null&&t.states.has(d))&&(h===null?d===t.clientID&&t.getLocalState()!=null?g++:t.states.delete(d):t.states.set(d,h),t.meta.set(d,{clock:g,lastUpdated:a}),y===void 0&&h!==null?c.push(d):y!==void 0&&h===null?r.push(d):h!==null&&(V(h,k)||u.push(d),l.push(d)))}(c.length>0||u.length>0||r.length>0)&&t.emit("change",[{added:c,updated:u,removed:r},e]),(c.length>0||l.length>0||r.length>0)&&t.emit("update",[{added:c,updated:l,removed:r},e])},W=0,j=1,C=2,Z=(t,n)=>{S(t,W);const e=P(n);E(t,e)},$=(t,n,e)=>{S(t,j),E(t,q(n,e))},H=(t,n,e)=>$(n,e,O(t)),Y=(t,n,e,s)=>{try{G(n,O(t),e)}catch(a){s?.(a),console.error("Caught error while handling a Yjs update",a)}},tt=(t,n)=>{S(t,C),E(t,n)},et=Y,nt=(t,n,e,s,a)=>{const c=L(t);switch(c){case W:H(t,n,e);break;case j:Y(t,e,s,a);break;case C:et(t,e,s,a);break;default:throw new Error("Unknown message type")}return c},U=0,T=1;function st(t,n,e){const s=new TextEncoder().encode(t),a=new ArrayBuffer(2+s.length+1+e.length);return new DataView(a).setUint16(0,s.length),new Uint8Array(a,2,s.length).set(s),new Uint8Array(a)[2+s.length]=n,new Uint8Array(a,2+s.length+1).set(e),a}function at(t){if(t.byteLength<3)return null;const e=new DataView(t).getUint16(0);if(t.byteLength<2+e+1)return null;const s=new TextDecoder().decode(new Uint8Array(t,2,e)),a=new Uint8Array(t)[2+e],c=new Uint8Array(t,2+e+1);return{docName:s,msgType:a,payload:c}}function lt(t,n){const e=new R,s=e.getText("content"),a=new K(e);a.setLocalStateField("user",{name:n.name,color:n.color,colorLight:n.colorLight??n.color+"33"});let c=null,l=!1;function u(){return M.ws??null}function r(o,f){const i=u();!i||i.readyState!==WebSocket.OPEN||i.send(st(t,o,f))}function p(){const o=D();Z(o,e),r(U,v(o))}function m(o){const f=o??[e.clientID],i=Q(a,f);r(T,i)}function d(o){if(l||typeof o.data=="string")return;const f=o.data instanceof ArrayBuffer?o.data:null;if(!f)return;const i=at(f);if(!(!i||i.docName!==t))if(i.msgType===U){const I=N(i.payload),w=D();nt(I,w,e,"ws-server"),z(w)>0&&r(U,v(w))}else i.msgType===T&&X(a,i.payload,"ws-server")}function g(o,f){if(l||f==="ws-server")return;const i=D();tt(i,o),r(U,v(i))}function h({added:o,updated:f,removed:i},I){if(l||I==="ws-server")return;const w=o.concat(f,i);m(w)}function y(){if(l)return;const o=u();!o||o.readyState!==WebSocket.OPEN||(o.send(JSON.stringify({type:"collab:join",docName:t})),c&&o.removeEventListener("message",c),c=d,o.addEventListener("message",c),p(),m())}e.on("update",g),a.on("update",h),y(),M.addConnectHandler(y);function k(){if(l)return;l=!0,x(a,[e.clientID],"local"),m([e.clientID]);const o=u();o&&o.readyState===WebSocket.OPEN&&o.send(JSON.stringify({type:"collab:leave",docName:t})),c&&o&&(o.removeEventListener("message",c),c=null),e.off("update",g),a.off("update",h),a.destroy(),e.destroy()}return{ydoc:e,ytext:s,awareness:a,destroy:k}}export{lt as createCollabSession};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as J,k as fe,g as h,al as te,Y as we,X as K,am as be,_ as Ie,af as $e,an as Ae,ai as ne,ao as Ce,ap as xe,Q as Ne,l as w,n as B,p as de,G as Q,aq as Oe,ar as ee,J as ke,a0 as De,K as se,s as L,o as H,C as He,as as Re,at as N,U as pe,W as he,au as X,av as Me,aw as Pe,V as Fe,a2 as Be,m as Ue,ax as ge,ay as Ve,az as ze,I as Le,aA as Ge,aB as We,a9 as Je,aC as Ye,D as d,F as b,a7 as re,b as ie,T as qe}from"./8FUQuwgM.js";import{b as Xe,i as Ke}from"./0x0awhVy.js";import{B as Qe}from"./CbJfRYJV.js";import{i as je}from"./D8Tke-Cy.js";import{b as oe,u as ae,w as x,a as Ze}from"./EDLlAC9C.js";function xt(e,t){return t}function et(e,t,n){for(var s=[],i=t.length,a,o=t.length,c=0;c<i;c++){let T=t[c];he(T,()=>{if(a){if(a.pending.delete(T),a.done.add(T),a.pending.size===0){var p=e.outrogroups;j(ee(a.done)),p.delete(a),p.size===0&&(e.outrogroups=null)}}else o-=1},!1)}if(o===0){var u=s.length===0&&n!==null;if(u){var E=n,l=E.parentNode;Pe(l),l.append(E),e.items.clear()}j(t,!u)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function j(e,t=!0){for(var n=0;n<e.length;n++)Fe(e[n],t)}var le;function Nt(e,t,n,s,i,a=null){var o=e,c=new Map,u=(t&ge)!==0;if(u){var E=e;o=w?B(de(E)):E.appendChild(J())}w&&Q();var l=null,T=$e(()=>{var f=n();return Oe(f)?f:f==null?[]:ee(f)}),p,g=!0;function m(){r.fallback=l,tt(r,p,o,t,s),l!==null&&(p.length===0?(l.f&N)===0?pe(l):(l.f^=N,z(l,null,o)):he(l,()=>{l=null}))}var y=fe(()=>{p=h(T);var f=p.length;let C=!1;if(w){var M=ke(o)===De;M!==(f===0)&&(o=se(),B(o),L(!1),C=!0)}for(var $=new Set,k=we,P=Ie(),I=0;I<f;I+=1){w&&H.nodeType===He&&H.data===Re&&(o=H,C=!0,L(!1));var D=p[I],F=s(D,I),v=g?null:c.get(F);v?(v.v&&te(v.v,D),v.i&&te(v.i,I),P&&k.unskip_effect(v.e)):(v=nt(c,g?o:le??=J(),D,F,I,i,t,n),g||(v.e.f|=N),c.set(F,v)),$.add(F)}if(f===0&&a&&!l&&(g?l=K(()=>a(o)):(l=K(()=>a(le??=J())),l.f|=N)),f>$.size&&be(),w&&f>0&&B(se()),!g)if(P){for(const[Se,ve]of c)$.has(Se)||k.skip_effect(ve.e);k.oncommit(m),k.ondiscard(()=>{})}else m();C&&L(!0),h(T)}),r={effect:y,items:c,outrogroups:null,fallback:l};g=!1,w&&(o=H)}function U(e){for(;e!==null&&(e.f&Me)===0;)e=e.next;return e}function tt(e,t,n,s,i){var a=(s&Ve)!==0,o=t.length,c=e.items,u=U(e.effect.first),E,l=null,T,p=[],g=[],m,y,r,f;if(a)for(f=0;f<o;f+=1)m=t[f],y=i(m,f),r=c.get(y).e,(r.f&N)===0&&(r.nodes?.a?.measure(),(T??=new Set).add(r));for(f=0;f<o;f+=1){if(m=t[f],y=i(m,f),r=c.get(y).e,e.outrogroups!==null)for(const v of e.outrogroups)v.pending.delete(r),v.done.delete(r);if((r.f&N)!==0)if(r.f^=N,r===u)z(r,null,n);else{var C=l?l.next:u;r===e.effect.last&&(e.effect.last=r.prev),r.prev&&(r.prev.next=r.next),r.next&&(r.next.prev=r.prev),O(e,l,r),O(e,r,C),z(r,C,n),l=r,p=[],g=[],u=U(l.next);continue}if((r.f&X)!==0&&(pe(r),a&&(r.nodes?.a?.unfix(),(T??=new Set).delete(r))),r!==u){if(E!==void 0&&E.has(r)){if(p.length<g.length){var M=g[0],$;l=M.prev;var k=p[0],P=p[p.length-1];for($=0;$<p.length;$+=1)z(p[$],M,n);for($=0;$<g.length;$+=1)E.delete(g[$]);O(e,k.prev,P.next),O(e,l,k),O(e,P,M),u=M,l=P,f-=1,p=[],g=[]}else E.delete(r),z(r,u,n),O(e,r.prev,r.next),O(e,r,l===null?e.effect.first:l.next),O(e,l,r),l=r;continue}for(p=[],g=[];u!==null&&u!==r;)(E??=new Set).add(u),g.push(u),u=U(u.next);if(u===null)continue}(r.f&N)===0&&p.push(r),l=r,u=U(r.next)}if(e.outrogroups!==null){for(const v of e.outrogroups)v.pending.size===0&&(j(ee(v.done)),e.outrogroups?.delete(v));e.outrogroups.size===0&&(e.outrogroups=null)}if(u!==null||E!==void 0){var I=[];if(E!==void 0)for(r of E)(r.f&X)===0&&I.push(r);for(;u!==null;)(u.f&X)===0&&u!==e.fallback&&I.push(u),u=U(u.next);var D=I.length;if(D>0){var F=(s&ge)!==0&&o===0?n:null;if(a){for(f=0;f<D;f+=1)I[f].nodes?.a?.measure();for(f=0;f<D;f+=1)I[f].nodes?.a?.fix()}et(e,I,F)}}a&&Be(()=>{if(T!==void 0)for(r of T)r.nodes?.a?.apply()})}function nt(e,t,n,s,i,a,o,c){var u=(o&Ce)!==0?(o&xe)===0?Ne(n,!1,!1):ne(n):null,E=(o&Ae)!==0?ne(i):null;return{v:u,i:E,e:K(()=>(a(t,u??n,E??i,c),()=>{e.delete(s)}))}}function z(e,t,n){if(e.nodes)for(var s=e.nodes.start,i=e.nodes.end,a=t&&(t.f&N)===0?t.nodes.start:n;s!==null;){var o=Ue(s);if(a.before(s),s===i)return;s=o}}function O(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Ot(e,t,n,s,i,a){let o=w;w&&Q();var c=null;w&&H.nodeType===ze&&(c=H,Q());var u=w?H:e,E=new Qe(u,!1);fe(()=>{const l=t()||null;var T=n||l==="svg"?We:void 0;if(l===null){E.ensure(null,null);return}return E.ensure(l,p=>{if(l){if(c=w?c:Ge(l,T),Xe(c,c),s){w&&Ke(l)&&c.append(document.createComment(""));var g=w?de(c):c.appendChild(J());w&&(g===null?L(!1):B(g)),s(c,g)}Je.nodes.end=c,p.before(c)}w&&B(p)}),()=>{}},Le),Ye(()=>{}),o&&(L(!0),B(u))}function st(){let e=b(null),t=b(null),n=b(null),s=b(null),i=b("entity"),a=b(null),o=b("general");function c(m,y){h(e)&&(h(e)!==m||h(n)!==y)&&oe(h(e)).catch(()=>{})}function u(m,y,r,f){c(m,r),d(e,m,!0),d(t,y,!0),d(n,r,!0),d(s,f??null,!0)}function E(){d(i,"entity")}function l(){d(i,"graph")}function T(){d(i,"settings")}function p(m,y,r){h(n)===r&&h(e)===m?(d(e,null),d(t,null),d(n,null)):(d(e,m,!0),d(t,y,!0),d(n,r,!0)),d(s,null)}function g(){h(e)&&oe(h(e)).catch(()=>{}),d(e,null),d(t,null),d(n,null),d(s,null)}return{get selectedRepo(){return h(e)},get selectedType(){return h(t)},get selectedId(){return h(n)},get selectedSubPath(){return h(s)},get activeView(){return h(i)},get entityPath(){return h(e)&&h(t)&&h(n)?`/${h(e)}/${h(t)}/${h(n)}`:null},get hoveredEntityId(){return h(a)},set hoveredEntityId(m){d(a,m,!0)},get settingsTab(){return h(o)},set settingsTab(m){d(o,m,!0)},select:u,deselect:g,selectOnGraph:p,showEntity:E,showGraph:l,showSettings:T}}const V=st();function kt(...e){return e.filter(Boolean).join(" ")}const rt=typeof document<"u";let ue=0;class it{#e=b(re([]));get toasts(){return h(this.#e)}set toasts(t){d(this.#e,t,!0)}#t=b(re([]));get heights(){return h(this.#t)}set heights(t){d(this.#t,t,!0)}#n=t=>{const n=this.toasts.findIndex(s=>s.id===t);return n===-1?null:n};addToast=t=>{rt&&this.toasts.unshift(t)};updateToast=({id:t,data:n,type:s,message:i})=>{const a=this.toasts.findIndex(c=>c.id===t),o=this.toasts[a];this.toasts[a]={...o,...n,id:t,title:i,type:s,updated:!0}};create=t=>{const{message:n,...s}=t,i=typeof t?.id=="number"||t.id&&t.id?.length>0?t.id:ue++,a=t.dismissible!==void 0?t.dismissible:t.dismissable!==void 0?t.dismissable:!0,o=t.type===void 0?"default":t.type;return ie(()=>{this.toasts.find(u=>u.id===i)?this.updateToast({id:i,data:t,type:o,message:n,dismissible:a}):this.addToast({...s,id:i,title:n,dismissible:a,type:o})}),i};dismiss=t=>(ie(()=>{if(t===void 0){this.toasts=this.toasts.map(s=>({...s,dismiss:!0}));return}const n=this.toasts.findIndex(s=>s.id===t);this.toasts[n]&&(this.toasts[n]={...this.toasts[n],dismiss:!0})}),t);remove=t=>{if(t===void 0){this.toasts=[];return}const n=this.#n(t);if(n!==null)return this.toasts.splice(n,1),t};message=(t,n)=>this.create({...n,type:"default",message:t});error=(t,n)=>this.create({...n,type:"error",message:t});success=(t,n)=>this.create({...n,type:"success",message:t});info=(t,n)=>this.create({...n,type:"info",message:t});warning=(t,n)=>this.create({...n,type:"warning",message:t});loading=(t,n)=>this.create({...n,type:"loading",message:t});promise=(t,n)=>{if(!n)return;let s;n.loading!==void 0&&(s=this.create({...n,promise:t,type:"loading",message:typeof n.loading=="string"?n.loading:n.loading()}));const i=t instanceof Promise?t:t();let a=s!==void 0;return i.then(o=>{if(typeof o=="object"&&o&&"ok"in o&&typeof o.ok=="boolean"&&!o.ok){a=!1;const c=ot(o);this.create({id:s,type:"error",message:c})}else if(n.success!==void 0){a=!1;const c=typeof n.success=="function"?n.success(o):n.success;this.create({id:s,type:"success",message:c})}}).catch(o=>{if(n.error!==void 0){a=!1;const c=typeof n.error=="function"?n.error(o):n.error;this.create({id:s,type:"error",message:c})}}).finally(()=>{a&&(this.dismiss(s),s=void 0),n.finally?.()}),s};custom=(t,n)=>{const s=n?.id||ue++;return this.create({component:t,id:s,...n}),s};removeHeight=t=>{this.heights=this.heights.filter(n=>n.toastId!==t)};setHeight=t=>{const n=this.#n(t.toastId);if(n===null){this.heights.push(t);return}this.heights[n]=t};reset=()=>{this.toasts=[],this.heights=[]}}function ot(e){return e&&typeof e=="object"&&"status"in e?`HTTP error! Status: ${e.status}`:`Error! ${e}`}const A=new it;function at(e,t){return A.create({message:e,...t})}class Dt{#e=qe(()=>A.toasts.filter(t=>!t.dismiss));get toasts(){return h(this.#e)}}const lt=at,S=Object.assign(lt,{success:A.success,info:A.info,warning:A.warning,error:A.error,custom:A.custom,message:A.message,promise:A.promise,dismiss:A.dismiss,loading:A.loading,getActiveToasts:()=>A.toasts.filter(e=>!e.dismiss)}),ut=800;function ct(){let e=b(!1),t=b(null),n=b(null),s=null,i=null,a=!1;function o(p,g,m,y){s&&s.repo===p&&s.type===g&&s.id===m?(y.data!==void 0&&(s.payload.data=y.data),y.content!==void 0&&(s.payload.content=y.content)):s={repo:p,type:g,id:m,payload:{...y}},c()}function c(){i&&clearTimeout(i),i=setTimeout(u,ut)}async function u(){if(i=null,!a&&s){const{repo:p,type:g,id:m,payload:y}=s;s=null,a=!0,d(e,!0),d(n,null);try{if(await ae(p,g,m,y),d(t,new Date,!0),y.data?.name){const f=x.repos.find(C=>C.name===p)?.entities.find(C=>C.id===m);f&&(f.title=y.data.name)}}catch(r){d(n,r.message??"Save failed",!0);const f=r.status??r.statusCode;(!f||f>=500)&&(s={repo:p,type:g,id:m,payload:y})}finally{d(e,!1),a=!1,s&&u()}}}function E(){i&&(clearTimeout(i),i=null),s&&u()}async function l(p,g,m,y){d(e,!0),d(n,null);try{const r=await ae(p,g,m,y);return d(t,new Date,!0),r}catch(r){return d(n,r.message??"Save failed",!0),null}finally{d(e,!1)}}function T(){d(n,null),d(t,null),s=null,i&&(clearTimeout(i),i=null)}return{get saving(){return h(e)},get lastSaved(){return h(t)},get error(){return h(n)},get hasPending(){return!!(s||a)},scheduleAutoSave:o,flush:E,saveEntity:l,reset:T}}const ft=ct();let _=null,me=null,ye=null,Ee=[],Y=null,W=1e3,q=b(!1),Te=b(null);const R=new Map,G={},Z={};function ce(e,t){R.delete(e);const n=t.entities.length,s=n===1?`${e} updated ${t.entities[0]}`:`${e} updated ${n} entities`;S(s)}function dt(e){for(const[t,n]of R)n.repo===e&&(clearTimeout(n.timer),R.delete(t))}function pt(e){const t=Ze.user?.displayName;if(e.type==="sync_progress"){const n=G[e.repo];if(n){const s=e.message.trim(),i=s.match(/^Syncing from source:\s*(.+)$/i);i&&(Z[e.repo]=`Syncing ${i[1].trim()}…`);const a=Z[e.repo]??`Syncing ${e.repo}…`;S.loading(a,{id:n,description:s,duration:36e5})}return}if(e.type==="entity_change"){if(t&&e.actor===t&&e.source==="api"){x.refreshEntities(e.repo);return}if(x.refreshEntities(e.repo),V.selectedRepo===e.repo&&V.selectedType===e.entityType&&V.selectedId===e.entityId){ft.hasPending?S(`${e.actor} also saved changes to this entity`):je();return}const s=R.get(e.actor);if(s)clearTimeout(s.timer),s.entities.includes(e.entityId)||s.entities.push(e.entityId),s.timer=setTimeout(()=>ce(e.actor,s),1e4);else{const i={entities:[e.entityId],repo:e.repo,timer:setTimeout(()=>ce(e.actor,i),1e4)};R.set(e.actor,i)}return}if(e.type==="session_commit"){if(t&&e.actor===t){d(Te,e.timestamp,!0);return}const n=e.entities.length,s=n===1?`${e.actor} saved changes to ${e.entities[0]}`:`${e.actor} saved ${n} changes in ${e.repo}`;S(s),x.refreshEntities(e.repo);return}if(e.type==="sync_complete"){if(dt(e.repo),!G[e.repo]){const n=e.created+e.updated+e.deleted,s=n===0?`Sync complete · no changes in ${e.repo}`:`Sync complete · ${n} ${n===1?"entity":"entities"} from ${e.source}`;S.success(s)}x.refreshEntities(e.repo);return}if(e.type==="collection_created"){S(`${e.actor} created collection ${e.repo}`),x.refreshEntities(e.repo);return}if(e.type==="collection_deleted"){S(`${e.actor} deleted collection ${e.repo}`);return}if(e.type==="repo_sync"){S(`${e.actor} pushed to ${e.repo}`),x.refreshEntities(e.repo);return}if(e.type==="presence"){me?.(e);return}if(e.type==="online"){ye?.(e);return}if(e.type==="access_granted"||e.type==="access_revoked"){e.type==="access_revoked"&&V.selectedRepo===e.repo&&V.deselect(),x.load();return}}function _e(){if(typeof window>"u"||_&&(_.readyState===WebSocket.OPEN||_.readyState===WebSocket.CONNECTING))return;const t=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;_=new WebSocket(t),_.binaryType="arraybuffer",_.onopen=()=>{d(q,!0),W=1e3,x.refreshAll();for(const n of Ee)n()},_.onmessage=n=>{if(!(n.data instanceof ArrayBuffer))try{const s=JSON.parse(n.data);if(s?.type==="ping"){_?.send(JSON.stringify({type:"pong"}));return}const i=s;i.type&&i.type!=="toast"&&pt(i)}catch{}},_.onclose=()=>{d(q,!1),_=null,Y=setTimeout(()=>{W=Math.min(W*2,1e4),_e()},W)},_.onerror=()=>{}}function ht(){Y&&(clearTimeout(Y),Y=null),_&&(_.close(),_=null),d(q,!1);for(const[,e]of R)clearTimeout(e.timer);R.clear()}function gt(e,t=4e3){S(e,{duration:t})}function mt(e,t){const n=crypto.randomUUID();return t?.loading?S.loading(e,{id:n,duration:36e5}):S(e,{id:n}),n}function yt(e,t,n){if(n?.loading){S.loading(t,{id:e});return}/failed|error/i.test(t)?S.error(t,{id:e,duration:n?.duration??6e3}):S.success(t,{id:e,duration:n?.duration??4e3})}function Et(e){const t=crypto.randomUUID();G[e]=t,S.loading(`Syncing ${e}…`,{id:t,duration:36e5})}function Tt(e,t,n){const s=G[e];s&&(delete G[e],delete Z[e],n?S.error(t,{id:s,duration:6e3}):S.success(t,{id:s,duration:4e3}))}function _t(e){me=e}function St(e){ye=e}function vt(e){Ee.push(e)}function wt(e){_?.readyState===WebSocket.OPEN&&_.send(JSON.stringify(e))}const Ht={get connected(){return h(q)},get lastAutoSaved(){return h(Te)},get ws(){return _},connect:_e,disconnect:ht,showToast:gt,showPersistentToast:mt,updateToast:yt,startSyncToast:Et,finishSyncToast:Tt,send:wt,setPresenceHandler:_t,setOnlineHandler:St,addConnectHandler:vt};export{Dt as S,ft as a,Ot as b,kt as c,Nt as e,xt as i,V as n,Ht as r,A as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c,a as p}from"./
|
|
1
|
+
import{c,a as p}from"./0x0awhVy.js";import"./Bl1mtM70.js";import{f as i}from"./8FUQuwgM.js";import{I as l,s as m}from"./Bxlwy1pA.js";import{l as d,s as f}from"./CbJfRYJV.js";function k(t,o){const e=d(o,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M20 6 9 17l-5-5"}]];l(t,f({name:"check"},()=>e,{get iconNode(){return r},children:(a,$)=>{var s=c(),n=i(s);m(n,o,"default",{}),p(a,s)},$$slots:{default:!0}}))}export{k as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as d,u as g,r as i,a as l,b,d as m,g as p,e as h,h as v}from"./8FUQuwgM.js";function x(n=!1){const s=d,e=s.l.u;if(!e)return;let f=()=>h(s.s);if(n){let o=0,t={};const _=v(()=>{let c=!1;const a=s.s;for(const r in a)a[r]!==t[r]&&(t[r]=a[r],c=!0);return c&&o++,o});f=()=>p(_)}e.b.length&&g(()=>{u(s,f),i(e.b)}),l(()=>{const o=b(()=>e.m.map(m));return()=>{for(const t of o)typeof t=="function"&&t()}}),e.a.length&&l(()=>{u(s,f),i(e.a)})}function u(n,s){if(n.l.s)for(const e of n.l.s)p(e);s()}export{x as i};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{k as _e,I as Oe,b7 as ue,V as x,X as le,M as fe,l as U,aq as Le,b8 as Ie,b9 as ke,aC as Pe,ba as Re,bb as $e,bc as Ue,g as s,bd as Ne,be as Me,bf as D,s as re,bg as je,bh as Fe,a2 as Je,bi as Ge,bj as We,F as m,a7 as j,D as f,T as De}from"./8FUQuwgM.js";import{B as He}from"./CbJfRYJV.js";import{d as Ve,g as Be,j as Ke,k as qe,n as ze,l as Qe}from"./0x0awhVy.js";function Pt(e,t,...n){var r=new He(e);_e(()=>{const i=t()??null;r.ensure(i,i&&(c=>i(c,...n)))},Oe)}function Ye(e,t){var n=void 0,r;ue(()=>{n!==(n=t())&&(r&&(x(r),r=null),n&&(r=le(()=>{fe(()=>n(e))})))})}function ce(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ce(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Xe(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ce(e))&&(r&&(r+=" "),r+=t);return r}function Ze(e){return typeof e=="object"?Xe(e):e??""}const ne=[...`
|
|
2
|
+
\r\f \v\uFEFF`];function xe(e,t,n){var r=e==null?"":""+e;if(t&&(r=r?r+" "+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+" "+i:i;else if(r.length)for(var c=i.length,h=0;(h=r.indexOf(i,h))>=0;){var E=h+c;(h===0||ne.includes(r[h-1]))&&(E===r.length||ne.includes(r[E]))?r=(h===0?"":r.substring(0,h))+r.substring(E+1):h=E}}return r===""?null:r}function ae(e,t=!1){var n=t?" !important;":";",r="";for(var i of Object.keys(e)){var c=e[i];c!=null&&c!==""&&(r+=" "+i+": "+c+n)}return r}function X(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function et(e,t){if(t){var n="",r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var c=!1,h=0,E=!1,v=[];r&&v.push(...Object.keys(r).map(X)),i&&v.push(...Object.keys(i).map(X));var C=0,_=-1;const k=e.length;for(var w=0;w<k;w++){var d=e[w];if(E?d==="/"&&e[w-1]==="*"&&(E=!1):c?c===d&&(c=!1):d==="/"&&e[w+1]==="*"?E=!0:d==='"'||d==="'"?c=d:d==="("?h++:d===")"&&h--,!E&&c===!1&&h===0){if(d===":"&&_===-1)_=w;else if(d===";"||w===k-1){if(_!==-1){var R=X(e.substring(C,_).trim());if(!v.includes(R)){d!==";"&&w++;var S=e.substring(C,w).trim();n+=" "+S+";"}}C=w+1,_=-1}}}}return r&&(n+=ae(r)),i&&(n+=ae(i,!0)),n=n.trim(),n===""?null:n}return e==null?null:String(e)}function tt(e,t,n,r,i,c){var h=e.__className;if(U||h!==n||h===void 0){var E=xe(n,r,c);(!U||E!==e.getAttribute("class"))&&(E==null?e.removeAttribute("class"):t?e.className=E:e.setAttribute("class",E)),e.__className=n}else if(c&&i!==c)for(var v in c){var C=!!c[v];(i==null||C!==!!i[v])&&e.classList.toggle(v,C)}return c}function Z(e,t={},n,r){for(var i in n){var c=n[i];t[i]!==c&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,c,r))}}function rt(e,t,n,r){var i=e.__style;if(U||i!==t){var c=et(t,r);(!U||c!==e.getAttribute("style"))&&(c==null?e.removeAttribute("style"):e.style.cssText=c),e.__style=t}else r&&(Array.isArray(r)?(Z(e,n?.[0],r[0]),Z(e,n?.[1],r[1],"important")):Z(e,n,r));return r}function ee(e,t,n=!1){if(e.multiple){if(t==null)return;if(!Le(t))return Ie();for(var r of e.options)r.selected=t.includes(ie(r));return}for(r of e.options){var i=ie(r);if(ke(i,t)){r.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function nt(e){var t=new MutationObserver(()=>{ee(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Pe(()=>{t.disconnect()})}function ie(e){return"__value"in e?e.__value:e.value}const G=Symbol("class"),W=Symbol("style"),de=Symbol("is custom element"),pe=Symbol("is html"),at=D?"link":"LINK",it=D?"input":"INPUT",st=D?"option":"OPTION",ot=D?"select":"SELECT",ut=D?"progress":"PROGRESS";function lt(e){if(U){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var r=e.value;z(e,"value",null),e.value=r}if(e.hasAttribute("checked")){var i=e.checked;z(e,"checked",null),e.checked=i}}};e.__on_r=n,Je(n),Ge()}}function Rt(e,t){var n=te(e);n.value===(n.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!==ut)||(e.value=t??"")}function ft(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function z(e,t,n,r){var i=te(e);U&&(i[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName===at)||i[t]!==(i[t]=n)&&(t==="loading"&&(e[We]=n),n==null?e.removeAttribute(t):typeof n!="string"&&ge(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function ct(e,t,n,r,i=!1,c=!1){if(U&&i&&e.nodeName===it){var h=e,E=h.type==="checkbox"?"defaultChecked":"defaultValue";E in n||lt(h)}var v=te(e),C=v[de],_=!v[pe];let w=U&&C;w&&re(!1);var d=t||{},R=e.nodeName===st;for(var S in t)S in n||(n[S]=null);n.class?n.class=Ze(n.class):(r||n[G])&&(n.class=null),n[W]&&(n.style??=null);var k=ge(e);for(const b in n){let p=n[b];if(R&&b==="value"&&p==null){e.value=e.__value="",d[b]=p;continue}if(b==="class"){var P=e.namespaceURI==="http://www.w3.org/1999/xhtml";tt(e,P,p,r,t?.[G],n[G]),d[b]=p,d[G]=n[G];continue}if(b==="style"){rt(e,p,t?.[W],n[W]),d[b]=p,d[W]=n[W];continue}var A=d[b];if(!(p===A&&!(p===void 0&&e.hasAttribute(b)))){d[b]=p;var J=b[0]+b[1];if(J!=="$$")if(J==="on"){const L={},$="$$"+b;let T=b.slice(2);var H=Qe(T);if(Ve(T)&&(T=T.slice(0,-7),L.capture=!0),!H&&A){if(p!=null)continue;e.removeEventListener(T,d[$],L),d[$]=null}if(H)Be(T,e,p),Ke([T]);else if(p!=null){let Q=function(Y){d[b].call(this,Y)};d[$]=qe(T,e,Q,L)}}else if(b==="style")z(e,b,p);else if(b==="autofocus")je(e,!!p);else if(!C&&(b==="__value"||b==="value"&&p!=null))e.value=e.__value=p;else if(b==="selected"&&R)ft(e,p);else{var O=b;_||(O=ze(O));var V=O==="defaultValue"||O==="defaultChecked";if(p==null&&!C&&!V)if(v[b]=null,O==="value"||O==="checked"){let L=e;const $=t===void 0;if(O==="value"){let T=L.defaultValue;L.removeAttribute(O),L.defaultValue=T,L.value=L.__value=$?T:null}else{let T=L.defaultChecked;L.removeAttribute(O),L.defaultChecked=T,L.checked=$?T:!1}}else e.removeAttribute(b);else V||k.includes(O)&&(C||typeof p!="string")?(e[O]=p,O in v&&(v[O]=Fe)):typeof p!="function"&&z(e,O,p)}}}return w&&re(!0),d}function $t(e,t,n=[],r=[],i=[],c,h=!1,E=!1){Re(i,n,r,v=>{var C=void 0,_={},w=e.nodeName===ot,d=!1;if(ue(()=>{var S=t(...v.map(s)),k=ct(e,C,S,c,h,E);d&&w&&"value"in S&&ee(e,S.value);for(let A of Object.getOwnPropertySymbols(_))S[A]||x(_[A]);for(let A of Object.getOwnPropertySymbols(S)){var P=S[A];A.description===Ne&&(!C||P!==C[A])&&(_[A]&&x(_[A]),_[A]=le(()=>Ye(e,()=>P))),k[A]=P}C=k}),w){var R=e;fe(()=>{ee(R,C.value,!0),nt(R)})}d=!0})}function te(e){return e.__attributes??={[de]:e.nodeName.includes("-"),[pe]:e.namespaceURI===$e}}var se=new Map;function ge(e){var t=e.getAttribute("is")||e.nodeName,n=se.get(t);if(n)return n;se.set(t,n=[]);for(var r,i=e,c=Element.prototype;c!==i;){r=Me(i);for(var h in r)r[h].set&&n.push(h);i=Ue(i)}return n}const dt="";class he extends Error{constructor(t,n){super(n),this.status=t,this.name="ApiError"}}async function y(e,t){const n={...t?.headers};t?.body&&(n["Content-Type"]=n["Content-Type"]??"application/json");const r=await fetch(`${dt}${e}`,{...t,headers:n});if(!r.ok){const i=await r.json().catch(()=>({error:r.statusText}));throw r.status===401&&typeof window<"u"&&!e.startsWith("/api/auth/")&&window.location.pathname!=="/login"&&(window.location.href="/login"),new he(r.status,i.error??r.statusText)}return r.json()}const Ut=Object.freeze(Object.defineProperty({__proto__:null,ApiError:he,apiFetch:y},Symbol.toStringTag,{value:"Module"}));function pt(){return y("/api/workspace")}function gt(e){return y("/api/workspace",{method:"PUT",body:JSON.stringify(e)})}function Nt(){return y("/api/workspace/mcp-config")}function oe(){return y("/api/repos")}function ht(e,t,n){return y("/api/repos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,description:t,...n?{private:!0}:{}})})}function vt(e,t){return y(`/api/repos/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t})})}function bt(e){return y(`/api/repos/${encodeURIComponent(e)}`,{method:"DELETE"})}function yt(){return y("/api/apps")}function Et(e){return y(`/api/repos/${encodeURIComponent(e)}/entities?summary=true`)}function Mt(e,t,n){return y(`/api/repos/${encodeURIComponent(e)}/entities/${encodeURIComponent(t)}/${encodeURIComponent(n)}`)}function jt(e,t,n,r,i){return y(`/api/repos/${encodeURIComponent(e)}/entities`,{method:"POST",body:JSON.stringify({entityType:t,entityId:n,data:r,content:i})})}function Ft(e,t,n){return y(`/api/repos/${encodeURIComponent(e)}/entities/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,{method:"DELETE"})}function Jt(e,t,n,r){return y(`/api/repos/${encodeURIComponent(e)}/entities/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,{method:"PUT",body:JSON.stringify(r)})}function Gt(e){return y(`/api/repos/${encodeURIComponent(e)}/commit`,{method:"POST"})}function Ct(e){return e.replace(/-/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function wt(){let e=m(""),t=m(null),n=m(!1),r=m(j([]));const i={};let c=m(j([])),h=m(!1),E=m(null),v=m(j({})),C=j({}),_=j({}),w=j({}),d=m(0),R=m(null),S=m(""),k=null,P=m(0),A=m(0),J=m("alpha");async function H(){f(h,!0),f(E,null),f(P,0),f(A,0);try{const[a,o,u]=await Promise.all([oe(),yt().catch(()=>[]),pt().catch(()=>({name:""}))]);f(c,o,!0),f(e,u.name,!0),f(t,u.about??null,!0),f(n,!0),f(r,a.map(l=>({name:l.name,type:l.type,private:l.private,sync:l.sync,count:null,entities:[],loading:!1,loaded:!1})),!0),await Promise.all(s(r).map(l=>p(l.name)))}catch(a){f(E,a.message,!0)}finally{f(h,!1)}}function O(a,o,u){const l=s(r).find(g=>g.name===a);l&&(l.entities=l.entities.filter(g=>!(g.id===u&&g.entityType===o)),l.count=l.entities.length)}async function V(a){s(r).find(u=>u.name===a)&&await p(a,!0)}async function b(){f(P,0),f(A,0),await Promise.all(s(r).map(a=>p(a.name,!0)))}async function p(a,o=!1){const u=s(r).find(g=>g.name===a);if(!u||u.loading||!o&&u.loaded)return;const l=(i[a]??0)+1;i[a]=l,o||(u.loading=!0);try{const g=await Et(a);if(i[a]!==l)return;let N=0,B=0;for(const I of g)N+=I.document?.wikilinks?.length??0,B+=I.subContentCount??0;f(P,s(P)+N),f(A,s(A)+B),u.entities=g.filter(I=>!I.id.toLowerCase().startsWith("readme")).map(I=>({id:I.id,title:I.data?.name??Ct(I.id),entityType:I.entityType,repo:a,hasSubContent:!!I.hasSubContent,wikilinks:I.document?.wikilinks??[],createdAt:I.data?.created_at??null,updatedAt:I.data?.updated_at??null})).sort((I,me)=>I.title.localeCompare(me.title)),u.count=u.entities.length,u.loaded=!0}catch(g){console.error(`Failed to load entities for ${a}:`,g)}finally{u.loading=!1}}function L(a){s(v)[a]=!s(v)[a]}function $(a){return s(v)[a]??!1}function T(a,o,u){return`${a}/${o}/${u}`}function Q(a,o,u){const l=T(a,o,u),g=C[l]??!1;C[l]=!g,!g&&!_[l]?.loaded&&be(a,o,u)}function Y(a,o,u){return C[T(a,o,u)]??!1}function ve(a,o,u){return _[T(a,o,u)]??{entries:[],loading:!1,loaded:!1}}async function be(a,o,u){const l=T(a,o,u);_[l]={entries:[],loading:!1,loaded:!0}}function ye(a){const o=s(S).trim().toLowerCase();if(!o)return a;const u=[];for(const l of a){const g=l.entities.filter(N=>N.title.toLowerCase().includes(o)||N.id.toLowerCase().includes(o));g.length>0&&u.push({...l,entities:g,count:g.length})}return u}function Ee(a){if(a&&!s(S)?k={...s(v)}:!a&&s(S)&&k&&(f(v,k,!0),k=null),f(S,a,!0),a){const o=a.trim().toLowerCase();for(const u of s(r)){const l=u.entities.some(g=>g.title.toLowerCase().includes(o)||g.id.toLowerCase().includes(o));s(v)[u.name]=l}}}function Ce(a){const o=a.startsWith("type:");w[a]=!(w[a]??o)}function we(a){return w[a]??!1}function Se(a){return w[a]===!1}const Ae=De(()=>s(r).reduce((a,o)=>a+(o.count??0),0));function Te(a){return s(c).find(o=>o.entityTypes.includes(a))}return{get name(){return s(e)},get about(){return s(t)},get nameLoaded(){return s(n)},async updateWorkspace(a){await gt(a),a.name?.trim()&&f(e,a.name.trim(),!0),typeof a.about=="string"&&f(t,a.about,!0)},get repos(){return s(r)},get apps(){return s(c)},get loading(){return s(h)},get error(){return s(E)},get totalEntities(){return s(Ae)},get totalLinks(){return s(P)},get totalFiles(){return s(A)},get sortedRepos(){const a=[...s(r)].sort((o,u)=>o.name.localeCompare(u.name));return ye(a)},get filteredIds(){const a=s(S).trim().toLowerCase();if(!a)return null;const o=new Set;for(const u of s(r))for(const l of u.entities)(l.title.toLowerCase().includes(a)||l.id.toLowerCase().includes(a))&&o.add(l.id);return o},get filterQuery(){return s(S)},setFilterQuery:Ee,get sortMode(){return s(J)},set sortMode(a){f(J,a,!0)},get recentEntities(){const a=s(S).trim().toLowerCase();let o=[];for(const u of s(r))for(const l of u.entities)a&&!l.title.toLowerCase().includes(a)&&!l.id.toLowerCase().includes(a)||o.push(l);return o.sort((u,l)=>{const g=u.updatedAt??"";return(l.updatedAt??"").localeCompare(g)})},get sidebarScrollTop(){return s(d)},set sidebarScrollTop(a){f(d,a,!0)},get lastAutoExpandedFor(){return s(R)},set lastAutoExpandedFor(a){f(R,a,!0)},load:H,loadEntities:p,removeEntity:O,refreshEntities:V,refreshAll:b,toggleRepo:L,isExpanded:$,toggleEntity:Q,isEntityExpanded:Y,getEntityContents:ve,toggleFolder:Ce,isFolderExpanded:we,isFolderCollapsed:Se,getAppForEntityType:Te,async renameCollectionTo(a,o){await vt(a,o);const u=s(r).find(l=>l.name===a);u&&(u.name=o,s(v)[a]&&(s(v)[o]=!0,delete s(v)[a]))},async removeCollection(a){await bt(a),f(r,s(r).filter(o=>o.name!==a),!0),delete s(v)[a]},async addCollection(a,o,u){await ht(a,o,u);const l=await oe();f(r,l.map(g=>s(r).find(B=>B.name===g.name)??{name:g.name,type:g.type,private:g.private,count:null,entities:[],loading:!1,loaded:!1}),!0),s(v)[a]=!0,await p(a)}}}const Wt=wt();function St(){return y("/api/auth/status")}function At(){return y("/api/auth/me")}function Tt(e,t){return y("/api/auth/login",{method:"POST",body:JSON.stringify({email:e,password:t})})}function mt(){return y("/api/auth/logout",{method:"POST"})}function _t(e,t,n){return y("/api/auth/setup",{method:"POST",body:JSON.stringify({email:e,password:t,displayName:n})})}function Dt(){return y("/api/auth/users")}function Ht(e,t,n,r){return y("/api/auth/users",{method:"POST",body:JSON.stringify({email:e,password:t,displayName:n,role:r})})}function Vt(e){return y(`/api/auth/users/${e}`,{method:"DELETE"})}function Bt(e,t){return y(`/api/auth/users/${e}/password`,{method:"PATCH",body:JSON.stringify({password:t})})}let F=m(null),K=m(!1),q=m(!1),M=m(!0);const Ot={get user(){return s(F)},get authEnabled(){return s(K)},get needsSetup(){return s(q)},get loading(){return s(M)},async checkAuth(){f(M,!0);try{const e=await St();if(f(K,e.authEnabled,!0),f(q,e.userCount===0),s(q))return f(M,!1),{authenticated:!1,authEnabled:!1,needsSetup:!0};if(!e.authEnabled)return f(M,!1),{authenticated:!0,authEnabled:!1,needsSetup:!1};try{const{user:t}=await At();return f(F,t,!0),f(M,!1),{authenticated:!0,authEnabled:!0,needsSetup:!1}}catch{return f(F,null),f(M,!1),{authenticated:!1,authEnabled:!0,needsSetup:!1}}}catch{return f(M,!1),{authenticated:!0,authEnabled:!1,needsSetup:!1}}},async login(e,t){const{user:n}=await Tt(e,t);return f(F,n,!0),f(K,!0),n},async setup(e,t,n){const{user:r}=await _t(e,t,n);return f(F,r,!0),f(K,!0),f(q,!1),r},async logout(){await mt(),f(F,null)}},Kt=Object.freeze(Object.defineProperty({__proto__:null,auth:Ot},Symbol.toStringTag,{value:"Module"}));export{W as S,Ot as a,Gt as b,Xe as c,$t as d,Pt as e,Mt as f,z as g,Rt as h,rt as i,Ze as j,y as k,Dt as l,Nt as m,Vt as n,Bt as o,Ht as p,Ft as q,lt as r,tt as s,jt as t,Jt as u,Ut as v,Wt as w,Kt as x};
|