studiograph 1.3.44-next.26 → 1.3.44-next.27
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/web/_app/immutable/assets/3.BSINoyT3.css +1 -0
- package/dist/web/_app/immutable/chunks/{BIMJw85l.js → BavZAyDT.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CwMXbQhn.js → CN0DHWaX.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BUgeKOdN.js → CyUdgNXe.js} +1 -1
- package/dist/web/_app/immutable/chunks/{B2XK80j4.js → DZJ5BafN.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CVhaIh-p.js → DaWi1ebU.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BqtdCvqG.js → Drutqki6.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CBj5WBAa.js → DwTqyPxc.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CEFISSHj.js → cFDqWC5X.js} +1 -1
- package/dist/web/_app/immutable/chunks/{7fw7Fdvz.js → cY-2OjCB.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CdE0nDdx.js → n6qkQj9g.js} +1 -1
- package/dist/web/_app/immutable/entry/{app.DMECd5Kt.js → app.CZCIr_JY.js} +2 -2
- package/dist/web/_app/immutable/entry/start.DVmQTmGS.js +1 -0
- package/dist/web/_app/immutable/nodes/{0.Dg9SBatP.js → 0.DTA_J3BM.js} +2 -2
- package/dist/web/_app/immutable/nodes/{1.B6uuAfGp.js → 1.D3mcjTsA.js} +1 -1
- package/dist/web/_app/immutable/nodes/{10.TuAqJYwO.js → 10.BKqcciPo.js} +1 -1
- package/dist/web/_app/immutable/nodes/{2.D38VRrAi.js → 2.Bc0NHQ5o.js} +2 -2
- package/dist/web/_app/immutable/nodes/3.DsapFssT.js +1 -0
- package/dist/web/_app/immutable/nodes/{4.BgnsmzSe.js → 4.BdOvOhz4.js} +4 -4
- package/dist/web/_app/immutable/nodes/{5.DVt5txAr.js → 5.Dvj93HLp.js} +1 -1
- package/dist/web/_app/immutable/nodes/{6.HiY2oOCt.js → 6.Bf7NW_lP.js} +1 -1
- package/dist/web/_app/immutable/nodes/{7.C7XF_19e.js → 7.BJL4EYZ3.js} +1 -1
- package/dist/web/_app/immutable/nodes/{8.ByazYxU_.js → 8.rc90hvL0.js} +1 -1
- package/dist/web/_app/immutable/nodes/{9.4WdR4_BV.js → 9.DGGLW03d.js} +1 -1
- package/dist/web/_app/version.json +1 -1
- package/dist/web/index.html +6 -6
- package/package.json +1 -1
- package/dist/web/_app/immutable/assets/3.C94c_ZP-.css +0 -1
- package/dist/web/_app/immutable/entry/start.CMO7v4mE.js +0 -1
- package/dist/web/_app/immutable/nodes/3.0l3L8YJI.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.chat-input-wrap.svelte-1anss1t{width:100%;max-width:640px}.chat-input-box.svelte-1anss1t{display:flex;align-items:center;gap:8px;border-radius:8px;border:1px solid var(--color-border);background:transparent;padding:6px 6px 6px 16px;transition:border-color .15s;cursor:text}.chat-input-box.svelte-1anss1t:focus-within{border-color:var(--color-accent)}.chat-textarea.svelte-1anss1t{flex:1;min-height:24px;max-height:160px;padding:0;border:none;background:transparent;color:var(--color-text-primary);font-family:inherit;font-size:15px;line-height:1.5;resize:none;outline:none;box-sizing:border-box}.chat-textarea.svelte-1anss1t::placeholder{color:var(--color-text-tertiary)}.send-btn.svelte-1anss1t{display:flex;align-items:center;justify-content:center;width:32px;height:32px;flex-shrink:0;border:none;border-radius:8px;background:var(--color-text-tertiary);color:var(--color-bg);cursor:not-allowed;transition:background .15s}.send-btn.active.svelte-1anss1t{background:var(--color-accent);color:#fff;cursor:pointer}.send-btn.active.svelte-1anss1t:hover{background:var(--color-accent-hover)}.home.svelte-h7bcrl{flex:1;display:flex;flex-direction:column;min-height:0;overflow-y:auto}.hero.svelte-h7bcrl{display:flex;flex-direction:column;align-items:center;gap:24px;padding:48px 24px 32px}.hero.centered.svelte-h7bcrl{flex:1;justify-content:center}.workspace-name.svelte-h7bcrl{font-size:42px;font-weight:300;color:var(--color-text-primary);letter-spacing:-.02em;line-height:1.1;text-align:center;margin:0}.suggestions-hint.svelte-h7bcrl{font-size:15px;color:var(--color-text-tertiary);text-align:center;margin:0}.suggestions.svelte-h7bcrl{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;max-width:640px}.suggestion-chip.svelte-h7bcrl{padding:6px 14px;border:1px solid var(--color-border);border-radius:9999px;background:var(--color-bg-surface);color:var(--color-text-secondary);font-family:inherit;font-size:13px;cursor:pointer;transition:border-color .15s,color .15s}.suggestion-chip.svelte-h7bcrl:hover{border-color:var(--color-accent);color:var(--color-text-primary)}.loading-state.svelte-h7bcrl{display:flex;align-items:center;justify-content:center;gap:10px;padding:48px 24px;color:var(--color-text-tertiary);font-size:14px}.animate-spin{animation:svelte-h7bcrl-spin 1s linear infinite}@keyframes svelte-h7bcrl-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.insights-section.svelte-h7bcrl{padding:0 24px 24px;max-width:1080px;margin:0 auto;width:100%;box-sizing:border-box}.insights-header.svelte-h7bcrl{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}.insights-title.svelte-h7bcrl{display:flex;align-items:baseline;gap:10px}.insights-meta.svelte-h7bcrl{font-size:12px;color:var(--color-text-tertiary)}.insights-actions.svelte-h7bcrl{display:flex;align-items:center;gap:8px}.edit-focus-link.svelte-h7bcrl{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-family:inherit;color:var(--color-text-tertiary);background:none;border:none;cursor:pointer;padding:4px 8px;border-radius:4px}.edit-focus-link.svelte-h7bcrl:hover{color:var(--color-text-secondary);background:var(--color-bg-hover)}.insights-grid.svelte-h7bcrl{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px}.insight-card.svelte-h7bcrl{padding:16px;border:1px solid var(--color-border);border-radius:8px;background:var(--color-bg)}.insight-top.svelte-h7bcrl{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.pattern-tag.svelte-h7bcrl{font-size:11px;font-weight:500;text-transform:uppercase;letter-spacing:.05em;color:var(--color-text-tertiary)}.insight-headline.svelte-h7bcrl{font-size:14px;font-weight:600;color:var(--color-text-primary);margin:0 0 6px;line-height:1.3}.insight-detail.svelte-h7bcrl{font-size:13px;color:var(--color-text-secondary);line-height:1.5;margin:0 0 8px}.action-btn.svelte-h7bcrl{display:flex;align-items:flex-start;padding:6px 8px;margin-bottom:8px;font-family:inherit;font-size:13px;font-weight:500;color:var(--color-accent);background:transparent;border:1px solid var(--color-border);border-radius:6px;cursor:pointer;text-align:left;line-height:1.3;transition:border-color .15s}.action-btn.svelte-h7bcrl:hover{border-color:var(--color-accent)}.insight-entities.svelte-h7bcrl{display:flex;flex-wrap:wrap;gap:4px}.entity-chip.svelte-h7bcrl{padding:2px 8px;font-size:12px;font-family:inherit;color:var(--color-text-secondary);background:var(--color-bg-surface);border:1px solid var(--color-border);border-radius:4px;cursor:pointer}.entity-chip.svelte-h7bcrl:hover{border-color:var(--color-accent);color:var(--color-text-primary)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as i,f as y,g as r,s as n}from"./DwMoyB6r.js";import{g as l}from"./
|
|
1
|
+
import{e as i,f as y,g as r,s as n}from"./DwMoyB6r.js";import{g as l}from"./Drutqki6.js";import{d as v,u as V,c as F,f as h}from"./C88BjBh_.js";const d={selectedType:null,groupBy:null,sortKey:"name",sortAsc:!0,filters:{text:{},enum:{},date:{}}};function x(){let a=i(y([])),o=i(null),c=i(!1);async function w(){try{n(a,await h(),!0),n(c,!0)}catch(e){console.error("Failed to load views:",e)}}async function f(e,t="list"){const s=t==="calendar"?{...d,calendar:{dateField:"due_date",year:new Date().getFullYear(),month:new Date().getMonth()+1}}:d,u=await F(e,s,t);return n(a,[...r(a),u],!0),u}async function g(e,t){await V(e,t),n(a,r(a).map(s=>s.id===e?{...s,...t}:s),!0)}async function m(e){if(await v(e),n(a,r(a).filter(t=>t.id!==e),!0),r(o)===e){const t=r(a)[0];t?(n(o,t.id,!0),l(`/views/${t.id}`,{replaceState:!0})):(n(o,null),l("/",{replaceState:!0}))}}function p(e){n(o,e,!0)}return{get views(){return r(a)},get activeViewId(){return r(o)},get loaded(){return r(c)},load:w,create:f,update:g,remove:m,setActive:p}}const D=x();export{D as v};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CD64r3Gf.js","./DwMoyB6r.js","./C88BjBh_.js","./koVwyjnn.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as Y}from"./PPVm8Dsz.js";import{aY as G,aC as A,aX as X,e as S,f as P,g,s as c,a4 as D,ab as q}from"./DwMoyB6r.js";import{i as z}from"./
|
|
2
|
+
import{_ as Y}from"./PPVm8Dsz.js";import{aY as G,aC as A,aX as X,e as S,f as P,g,s as c,a4 as D,ab as q}from"./DwMoyB6r.js";import{i as z}from"./Drutqki6.js";import{i as H,w as h}from"./C88BjBh_.js";import{a as K}from"./hE0jymgn.js";import{n as $}from"./DiQyiOFg.js";import{l as Q,o as N}from"./S3zzfNyy.js";function At(...t){return t.filter(Boolean).join(" ")}const Z=typeof document<"u",v=typeof window<"u"?window:void 0;function tt(t){let e=t.activeElement;for(;e?.shadowRoot;){const s=e.shadowRoot.activeElement;if(s===e)break;e=s}return e}class et{#e;#t;constructor(e={}){const{window:s=v,document:i=s?.document}=e;s!==void 0&&(this.#e=i,this.#t=Q(n=>{const r=N(s,"focusin",n),o=N(s,"focusout",n);return()=>{r(),o()}}))}get current(){return this.#t?.(),this.#e?tt(this.#e):null}}new et;class st{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return G(this.#t)}get(){const e=A(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const s=A(this.#t);return s===void 0?e:s}set(e){return X(this.#t,e)}}const it=new st("<Toaster/>");let U=0;class nt{#e=S(P([]));get toasts(){return g(this.#e)}set toasts(e){c(this.#e,e,!0)}#t=S(P([]));get heights(){return g(this.#t)}set heights(e){c(this.#t,e,!0)}#s=e=>{const s=this.toasts.findIndex(i=>i.id===e);return s===-1?null:s};addToast=e=>{Z&&this.toasts.unshift(e)};updateToast=({id:e,data:s,type:i,message:n})=>{const r=this.toasts.findIndex(f=>f.id===e),o=this.toasts[r];this.toasts[r]={...o,...s,id:e,title:n,type:i,updated:!0}};create=e=>{const{message:s,...i}=e,n=typeof e?.id=="number"||e.id&&e.id?.length>0?e.id:U++,r=e.dismissible!==void 0?e.dismissible:e.dismissable!==void 0?e.dismissable:!0,o=e.type===void 0?"default":e.type;return D(()=>{this.toasts.find(E=>E.id===n)?this.updateToast({id:n,data:e,type:o,message:s,dismissible:r}):this.addToast({...i,id:n,title:s,dismissible:r,type:o})}),n};dismiss=e=>(D(()=>{if(e===void 0){this.toasts=this.toasts.map(i=>({...i,dismiss:!0}));return}const s=this.toasts.findIndex(i=>i.id===e);this.toasts[s]&&(this.toasts[s]={...this.toasts[s],dismiss:!0})}),e);remove=e=>{if(e===void 0){this.toasts=[];return}const s=this.#s(e);if(s!==null)return this.toasts.splice(s,1),e};message=(e,s)=>this.create({...s,type:"default",message:e});error=(e,s)=>this.create({...s,type:"error",message:e});success=(e,s)=>this.create({...s,type:"success",message:e});info=(e,s)=>this.create({...s,type:"info",message:e});warning=(e,s)=>this.create({...s,type:"warning",message:e});loading=(e,s)=>this.create({...s,type:"loading",message:e});promise=(e,s)=>{if(!s)return;let i;s.loading!==void 0&&(i=this.create({...s,promise:e,type:"loading",message:typeof s.loading=="string"?s.loading:s.loading()}));const n=e instanceof Promise?e:e();let r=i!==void 0;return n.then(o=>{if(typeof o=="object"&&o&&"ok"in o&&typeof o.ok=="boolean"&&!o.ok){r=!1;const f=rt(o);this.create({id:i,type:"error",message:f})}else if(s.success!==void 0){r=!1;const f=typeof s.success=="function"?s.success(o):s.success;this.create({id:i,type:"success",message:f})}}).catch(o=>{if(s.error!==void 0){r=!1;const f=typeof s.error=="function"?s.error(o):s.error;this.create({id:i,type:"error",message:f})}}).finally(()=>{r&&(this.dismiss(i),i=void 0),s.finally?.()}),i};custom=(e,s)=>{const i=s?.id||U++;return this.create({component:e,id:i,...s}),i};removeHeight=e=>{this.heights=this.heights.filter(s=>s.toastId!==e)};setHeight=e=>{const s=this.#s(e.toastId);if(s===null){this.heights.push(e);return}this.heights[s]=e};reset=()=>{this.toasts=[],this.heights=[]}}function rt(t){return t&&typeof t=="object"&&"status"in t?`HTTP error! Status: ${t.status}`:`Error! ${t}`}const d=new nt;function ot(t,e){return d.create({message:t,...e})}class Pt{#e=q(()=>d.toasts.filter(e=>!e.dismiss));get toasts(){return g(this.#e)}}function Dt(){return it.get()}const ct=ot,u=Object.assign(ct,{success:d.success,info:d.info,warning:d.warning,error:d.error,custom:d.custom,message:d.message,promise:d.promise,dismiss:d.dismiss,loading:d.loading,getActiveToasts:()=>d.toasts.filter(t=>!t.dismiss)}),at=800;function ut(){let t=S(!1),e=S(null),s=S(null),i=null,n=null,r=!1;function o(p,w,m,l){i&&i.repo===p&&i.type===w&&i.id===m?(l.data!==void 0&&(i.payload.data=l.data),l.content!==void 0&&(i.payload.content=l.content)):i={repo:p,type:w,id:m,payload:{...l}},f()}function f(){n&&clearTimeout(n),n=setTimeout(E,at)}async function E(){if(n=null,!r&&i){const{repo:p,type:w,id:m,payload:l}=i;i=null,r=!0,c(t,!0),c(s,null);try{if(await H(p,w,m,l),c(e,new Date,!0),l.data?.name){const b=h.repos.find(C=>C.name===p)?.entities.find(C=>C.id===m);b&&(b.title=l.data.name)}}catch(y){c(s,y.message??"Save failed",!0);const b=y.status??y.statusCode;(!b||b>=500)&&(i={repo:p,type:w,id:m,payload:l})}finally{c(t,!1),r=!1,i&&E()}}}function J(){n&&(clearTimeout(n),n=null),i&&E()}async function L(p,w,m,l){c(t,!0),c(s,null);try{const y=await H(p,w,m,l);return c(e,new Date,!0),y}catch(y){return c(s,y.message??"Save failed",!0),null}finally{c(t,!1)}}function V(){c(s,null),c(e,null),i=null,n&&(clearTimeout(n),n=null)}return{get saving(){return g(t)},get lastSaved(){return g(e)},get error(){return g(s)},get hasPending(){return!!(i||r)},scheduleAutoSave:o,flush:J,saveEntity:L,reset:V}}const lt=ut();let a=null,B=null,R=null,F=[],I=null,_=1e3,k=S(!1),W=S(null);const T=new Map,x={},O={};function j(t,e){T.delete(t);const s=e.entities.length,i=s===1?`${t} updated ${e.entities[0]}`:`${t} updated ${s} entities`;u(i)}function dt(t){for(const[e,s]of T)s.repo===t&&(clearTimeout(s.timer),T.delete(e))}function ft(t){const e=K.user?.displayName;if(t.type==="sync_progress"){const s=x[t.repo];if(s){const i=t.message.trim(),n=i.match(/^Syncing from source:\s*(.+)$/i);n&&(O[t.repo]=`Syncing ${n[1].trim()}…`);const r=O[t.repo]??`Syncing ${t.repo}…`;u.loading(r,{id:s,description:i,duration:36e5})}return}if(t.type==="entity_change"){if(e&&t.actor===e&&t.source==="api"){h.refreshEntities(t.repo);return}if(h.refreshEntities(t.repo),$.selectedRepo===t.repo&&$.selectedType===t.entityType&&$.selectedId===t.entityId){lt.hasPending?u(`${t.actor} also saved changes to this entity`):z();return}const i=T.get(t.actor);if(i)clearTimeout(i.timer),i.entities.includes(t.entityId)||i.entities.push(t.entityId),i.timer=setTimeout(()=>j(t.actor,i),1e4);else{const n={entities:[t.entityId],repo:t.repo,timer:setTimeout(()=>j(t.actor,n),1e4)};T.set(t.actor,n)}return}if(t.type==="session_commit"){if(e&&t.actor===e){c(W,t.timestamp,!0);return}const s=t.entities.length,i=s===1?`${t.actor} saved changes to ${t.entities[0]}`:`${t.actor} saved ${s} changes in ${t.repo}`;u(i),h.refreshEntities(t.repo);return}if(t.type==="sync_complete"){if(dt(t.repo),!x[t.repo]){const s=t.created+t.updated+t.deleted,i=s===0?`Sync complete · no changes in ${t.repo}`:`Sync complete · ${s} ${s===1?"entity":"entities"} from ${t.source}`;u.success(i)}h.refreshEntities(t.repo);return}if(t.type==="collection_created"){u(`${t.actor} created collection ${t.repo}`),h.refreshEntities(t.repo);return}if(t.type==="collection_deleted"){u(`${t.actor} deleted collection ${t.repo}`);return}if(t.type==="repo_sync"){u(`${t.actor} pushed to ${t.repo}`),h.refreshEntities(t.repo);return}if(t.type==="presence"){B?.(t);return}if(t.type==="online"){R?.(t);return}if(t.type==="insights_updated"){Y(()=>import("./CD64r3Gf.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(s=>s.insightsStore.load());return}if(t.type==="access_granted"||t.type==="access_revoked"){t.type==="access_revoked"&&$.selectedRepo===t.repo&&$.deselect(),h.load();return}}function M(){if(typeof window>"u"||a&&(a.readyState===WebSocket.OPEN||a.readyState===WebSocket.CONNECTING))return;const e=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;a=new WebSocket(e),a.binaryType="arraybuffer",a.onopen=()=>{c(k,!0),_=1e3,h.refreshAll();for(const s of F)s()},a.onmessage=s=>{if(!(s.data instanceof ArrayBuffer))try{const i=JSON.parse(s.data);if(i?.type==="ping"){a?.send(JSON.stringify({type:"pong"}));return}const n=i;n.type&&n.type!=="toast"&&ft(n)}catch{}},a.onclose=()=>{c(k,!1),a=null,I=setTimeout(()=>{_=Math.min(_*2,1e4),M()},_)},a.onerror=()=>{}}function ht(){I&&(clearTimeout(I),I=null),a&&(a.close(),a=null),c(k,!1);for(const[,t]of T)clearTimeout(t.timer);T.clear()}function pt(t,e=4e3){u(t,{duration:e})}function mt(t,e){const s=crypto.randomUUID();return e?.loading?u.loading(t,{id:s,duration:36e5}):u(t,{id:s}),s}function yt(t,e,s){if(s?.loading){u.loading(e,{id:t});return}/failed|error/i.test(e)?u.error(e,{id:t,duration:s?.duration??6e3}):u.success(e,{id:t,duration:s?.duration??4e3})}function gt(t){const e=crypto.randomUUID();x[t]=e,u.loading(`Syncing ${t}…`,{id:e,duration:36e5})}function wt(t,e,s){const i=x[t];i&&(delete x[t],delete O[t],s?u.error(e,{id:i,duration:6e3}):u.success(e,{id:i,duration:4e3}))}function St(t){B=t}function Tt(t){R=t}function Et(t){F.push(t)}function bt(t){a?.readyState===WebSocket.OPEN&&a.send(JSON.stringify(t))}const Ht={get connected(){return g(k)},get lastAutoSaved(){return g(W)},get ws(){return a},connect:M,disconnect:ht,showToast:pt,showPersistentToast:mt,updateToast:yt,startSyncToast:gt,finishSyncToast:wt,send:bt,setPresenceHandler:St,setOnlineHandler:Tt,addConnectHandler:Et};export{Pt as S,d as a,At as c,lt as e,Ht as r,it as s,u as t,Dt as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m,a,f as l}from"./S3zzfNyy.js";import{a0 as w}from"./DwMoyB6r.js";import{i as n}from"./DVe5EzgB.js";import{p as d}from"./DLfZVgnp.js";import{L as b,T as k}from"./
|
|
1
|
+
import{c as m,a,f as l}from"./S3zzfNyy.js";import{a0 as w}from"./DwMoyB6r.js";import{i as n}from"./DVe5EzgB.js";import{p as d}from"./DLfZVgnp.js";import{L as b,T as k}from"./DZJ5BafN.js";import{t as y}from"./CN0DHWaX.js";import{u as S}from"./CN0DHWaX.js";var u=l('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>'),x=l('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>'),_=l('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>'),z=l('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');function H(s,v){const t=d(v,"type",3,"success");var e=m(),c=w(e);{var i=o=>{var r=u();a(o,r)},p=o=>{var r=x();a(o,r)},h=o=>{var r=_();a(o,r)},g=o=>{var r=z();a(o,r)},f=o=>{};n(c,o=>{t()==="success"?o(i):t()==="error"?o(p,1):t()==="info"?o(h,2):t()==="warning"?o(g,3):o(f,!1)})}a(s,e)}export{H as Icon,b as Loader,k as Toaster,y as toast,S as useSonner};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b as G,o as ye,g as Ct,e as Me,c as b,d as Ee,t as he,s as Yt,f as Ft}from"./S3zzfNyy.js";import{p as fe,c as J,r as Y,t as K,b as ve,e as A,f as we,a3 as ht,s as r,g as e,a4 as Xt,aE as xe,aa as Lt,ab as l,ad as lt,a0 as h}from"./DwMoyB6r.js";import{i as B,b as Ie}from"./DVe5EzgB.js";import{e as ue}from"./BnuoIjma.js";import{s as y,c as le,b as p,a as Pe,S as Ae}from"./BYqzpKy3.js";import{p as T,s as ce,r as Ce}from"./DLfZVgnp.js";import{a as O,c as it,s as Le,S as He}from"./CwMXbQhn.js";import{c as Tt}from"./BdfrxCf_.js";import{c as st,s as rt}from"./koVwyjnn.js";import"./CkRzikAP.js";const Oe=Array(12).fill(0);var ke=G('<div class="sonner-loading-bar"></div>'),Ne=G('<div><div class="sonner-spinner"></div></div>');function Re(_,t){fe(t,!0);var C=Ne(),k=J(C);ue(k,23,()=>Oe,($,tt)=>`spinner-bar-${tt}`,($,tt)=>{var ct=ke();a($,ct)}),Y(k),Y(C),K($=>{rt(C,1,$),y(C,"data-visible",t.visible)},[()=>st(["sonner-loading-wrapper",t.class].filter(Boolean).join(" "))]),a(_,C),ve()}function Zt(_){return _.label!==void 0}function Fe(){let _=A(we(typeof document<"u"?document.hidden:!1));return ht(()=>ye(document,"visibilitychange",()=>{r(_,document.hidden,!0)})),{get current(){return e(_)}}}const be=4e3,ze=14,We=45,Ue=200,Ve=.05,je={toast:"",title:"",description:"",loader:"",closeButton:"",cancelButton:"",actionButton:"",action:"",warning:"",error:"",success:"",default:"",info:"",loading:""};function Ke(_){const[t,C]=_.split("-"),k=[];return t&&k.push(t),C&&k.push(C),k}function _e(_){return 1/(1.5+Math.abs(_)/20)}var Ye=G("<div><!></div>"),Ze=G('<button data-close-button=""><!></button>'),Ge=G('<div data-icon=""><!> <!></div>'),Xe=G('<div data-description=""><!></div>'),Qe=G('<button data-button="" data-cancel=""> </button>'),qe=G('<button data-button=""> </button>'),Je=G('<!> <div data-content=""><div data-title=""><!></div> <!></div> <!> <!>',1),pe=G('<li aria-atomic="true" data-sonner-toast=""><!> <!></li>');function $e(_,t){fe(t,!0);const C=s=>{var c=b(),v=h(c);{var w=g=>{var L=Ye(),It=J(L);p(It,()=>t.loadingIcon),Y(L),K(Rt=>{rt(L,1,Rt),y(L,"data-visible",e(S)==="loading")},[()=>st(it(e(j)?.loader,t.toast?.classes?.loader,"sonner-loader"))]),a(g,L)},x=g=>{{let L=l(()=>it(e(j)?.loader,t.toast.classes?.loader)),It=l(()=>e(S)==="loading");Re(g,{get class(){return e(L)},get visible(){return e(It)}})}};B(v,g=>{t.loadingIcon?g(w):g(x,!1)})}a(s,c)};let k=T(t,"cancelButtonStyle",3,""),$=T(t,"actionButtonStyle",3,""),tt=T(t,"descriptionClass",3,""),ct=T(t,"unstyled",3,!1),Bt=T(t,"defaultRichColors",3,!1);const St={...je};let V=A(!1),N=A(!1),Dt=A(!1),Ht=A(!1),Ot=A(!1),W=A(0),dt=A(0),Mt=t.toast.duration||t.duration||be,Z=A(void 0),et=A(null),kt=A(null);const Qt=l(()=>t.index===0),qt=l(()=>t.index+1<=t.visibleToasts),S=l(()=>t.toast.type),U=l(()=>t.toast.dismissible!==void 0?t.toast.dismissible!==!1:t.toast.dismissable!==!1),Et=l(()=>t.toast.class||""),yt=l(()=>t.toast.descriptionClass||""),ut=l(()=>O.heights.findIndex(s=>s.toastId===t.toast.id)||0),ft=l(()=>t.toast.closeButton??t.closeButton),wt=l(()=>t.toast.duration??t.duration??be);let bt=null;const zt=l(()=>t.position.split("-")),Jt=l(()=>O.heights.reduce((s,c,v)=>v>=e(ut)?s:s+c.height,0)),pt=Fe(),$t=l(()=>t.toast.invert||t.invert),Nt=l(()=>e(S)==="loading"),j=l(()=>({...St,...t.classes})),te=l(()=>t.toast.title),ee=l(()=>t.toast.description);let vt=A(0),Wt=A(0);const Pt=l(()=>Math.round(e(ut)*ze+e(Jt)));ht(()=>{e(te),e(ee);let s;t.expanded||t.expandByDefault?s=1:s=1-t.index*Ve;const c=Xt(()=>e(Z));if(c===void 0)return;c.style.setProperty("height","auto");const v=c.offsetHeight,w=c.getBoundingClientRect().height,x=Math.round(w/s+Number.EPSILON&100)/100;c.style.removeProperty("height");let g;Math.abs(x-v)<1?g=x:g=v,r(dt,g,!0),O.setHeight({toastId:t.toast.id,height:g})});function n(){r(N,!0),r(W,e(Pt),!0),O.removeHeight(t.toast.id),setTimeout(()=>{O.remove(t.toast.id)},Ue)}let M;const nt=l(()=>t.toast.promise&&e(S)==="loading"||t.toast.duration===Number.POSITIVE_INFINITY);function at(){r(vt,new Date().getTime(),!0),M=setTimeout(()=>{t.toast.onAutoClose?.(t.toast),n()},Mt)}function xt(){if(e(Wt)<e(vt)){const s=new Date().getTime()-e(vt);Mt=Mt-s}r(Wt,new Date().getTime(),!0)}ht(()=>{t.toast.updated&&(clearTimeout(M),Mt=e(wt),at())}),ht(()=>(e(nt)||(t.expanded||t.interacting||t.pauseWhenPageIsHidden&&pt.current?xt():at()),()=>clearTimeout(M))),xe(()=>{r(V,!0);const s=e(Z)?.getBoundingClientRect().height;return r(dt,s,!0),O.setHeight({toastId:t.toast.id,height:s}),()=>{O.removeHeight(t.toast.id)}}),ht(()=>{t.toast.delete&&Xt(()=>{n(),t.toast.onDismiss?.(t.toast)})});const ne=s=>{if(e(Nt))return;r(W,e(Pt),!0);const c=s.target;c.setPointerCapture(s.pointerId),c.tagName!=="BUTTON"&&(r(Dt,!0),bt={x:s.clientX,y:s.clientY})},me=()=>{if(e(Ht)||!e(U))return;bt=null;const s=Number(e(Z)?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),c=Number(e(Z)?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),v=new Date().getTime()-0,w=e(et)==="x"?s:c,x=Math.abs(w)/v;if(Math.abs(w)>=We||x>.11){r(W,e(Pt),!0),t.toast.onDismiss?.(t.toast),e(et)==="x"?r(kt,s>0?"right":"left",!0):r(kt,c>0?"down":"up",!0),n(),r(Ht,!0);return}else e(Z)?.style.setProperty("--swipe-amount-x","0px"),e(Z)?.style.setProperty("--swipe-amount-y","0px");r(Ot,!1),r(Dt,!1),r(et,null)},Ut=s=>{if(!bt||!e(U)||(window.getSelection()?.toString().length??-1)>0)return;const v=s.clientY-bt.y,w=s.clientX-bt.x,x=t.swipeDirections??Ke(t.position);!e(et)&&(Math.abs(w)>1||Math.abs(v)>1)&&r(et,Math.abs(w)>Math.abs(v)?"x":"y",!0);let g={x:0,y:0};if(e(et)==="y"){if(x.includes("top")||x.includes("bottom"))if(x.includes("top")&&v<0||x.includes("bottom")&&v>0)g.y=v;else{const L=v*_e(v);g.y=Math.abs(L)<Math.abs(v)?L:v}}else if(e(et)==="x"&&(x.includes("left")||x.includes("right")))if(x.includes("left")&&w<0||x.includes("right")&&w>0)g.x=w;else{const L=w*_e(w);g.x=Math.abs(L)<Math.abs(w)?L:w}(Math.abs(g.x)>0||Math.abs(g.y)>0)&&r(Ot,!0),e(Z)?.style.setProperty("--swipe-amount-x",`${g.x}px`),e(Z)?.style.setProperty("--swipe-amount-y",`${g.y}px`)},ot=()=>{r(Dt,!1),r(et,null),bt=null},mt=l(()=>t.toast.icon?t.toast.icon:e(S)==="success"?t.successIcon:e(S)==="error"?t.errorIcon:e(S)==="warning"?t.warningIcon:e(S)==="info"?t.infoIcon:e(S)==="loading"?t.loadingIcon:null);var i=pe();y(i,"tabindex",0);let At;var Vt=J(i);{var ge=s=>{var c=Ze(),v=J(c);p(v,()=>t.closeIcon??lt),Y(c),K(w=>{y(c,"aria-label",t.closeButtonAriaLabel),y(c,"data-disabled",e(Nt)),rt(c,1,w)},[()=>st(it(e(j)?.closeButton,t.toast?.classes?.closeButton))]),Ct("click",c,()=>{e(Nt)||!e(U)||(n(),t.toast.onDismiss?.(t.toast))}),a(s,c)};B(Vt,s=>{e(ft)&&!t.toast.component&&e(S)!=="loading"&&t.closeIcon!==null&&s(ge)})}var ae=Lt(Vt,2);{var oe=s=>{const c=l(()=>t.toast.component);var v=b(),w=h(v);Tt(w,()=>e(c),(x,g)=>{g(x,ce(()=>t.toast.componentProps,{closeToast:n}))}),a(s,v)},ie=s=>{var c=Je(),v=h(c);{var w=u=>{var m=Ge(),o=J(m);{var I=d=>{var f=b(),z=h(f);{var E=_t=>{var Kt=b(),re=h(Kt);Tt(re,()=>t.toast.icon,(H,F)=>{F(H,{})}),a(_t,Kt)},q=_t=>{C(_t)};B(z,_t=>{t.toast.icon?_t(E):_t(q,!1)})}a(d,f)};B(o,d=>{(t.toast.promise||e(S)==="loading")&&d(I)})}var P=Lt(o,2);{var D=d=>{var f=b(),z=h(f);{var E=H=>{var F=b(),gt=h(F);Tt(gt,()=>t.toast.icon,(Se,De)=>{De(Se,{})}),a(H,F)},q=H=>{var F=b(),gt=h(F);p(gt,()=>t.successIcon??lt),a(H,F)},_t=H=>{var F=b(),gt=h(F);p(gt,()=>t.errorIcon??lt),a(H,F)},Kt=H=>{var F=b(),gt=h(F);p(gt,()=>t.warningIcon??lt),a(H,F)},re=H=>{var F=b(),gt=h(F);p(gt,()=>t.infoIcon??lt),a(H,F)};B(z,H=>{t.toast.icon?H(E):e(S)==="success"?H(q,1):e(S)==="error"?H(_t,2):e(S)==="warning"?H(Kt,3):e(S)==="info"&&H(re,4)})}a(d,f)};B(P,d=>{t.toast.type!=="loading"&&d(D)})}Y(m),K(d=>rt(m,1,d),[()=>st(it(e(j)?.icon,t.toast?.classes?.icon))]),a(u,m)};B(v,u=>{(e(S)||t.toast.icon||t.toast.promise)&&t.toast.icon!==null&&(e(mt)!==null||t.toast.icon)&&u(w)})}var x=Lt(v,2),g=J(x),L=J(g);{var It=u=>{var m=b(),o=h(m);{var I=D=>{const d=l(()=>t.toast.title);var f=b(),z=h(f);Tt(z,()=>e(d),(E,q)=>{q(E,ce(()=>t.toast.componentProps))}),a(D,f)},P=D=>{var d=he();K(()=>Yt(d,t.toast.title)),a(D,d)};B(o,D=>{typeof t.toast.title!="string"?D(I):D(P,!1)})}a(u,m)};B(L,u=>{t.toast.title&&u(It)})}Y(g);var Rt=Lt(g,2);{var se=u=>{var m=Xe(),o=J(m);{var I=D=>{const d=l(()=>t.toast.description);var f=b(),z=h(f);Tt(z,()=>e(d),(E,q)=>{q(E,ce(()=>t.toast.componentProps))}),a(D,f)},P=D=>{var d=he();K(()=>Yt(d,t.toast.description)),a(D,d)};B(o,D=>{typeof t.toast.description!="string"?D(I):D(P,!1)})}Y(m),K(D=>rt(m,1,D),[()=>st(it(tt(),e(yt),e(j)?.description,t.toast.classes?.description))]),a(u,m)};B(Rt,u=>{t.toast.description&&u(se)})}Y(x);var jt=Lt(x,2);{var X=u=>{var m=b(),o=h(m);{var I=d=>{var f=b(),z=h(f);Tt(z,()=>t.toast.cancel,(E,q)=>{q(E,{})}),a(d,f)},P=d=>{var f=Qe(),z=J(f,!0);Y(f),K(E=>{le(f,t.toast.cancelButtonStyle??k()),rt(f,1,E),Yt(z,t.toast.cancel.label)},[()=>st(it(e(j)?.cancelButton,t.toast?.classes?.cancelButton))]),Ct("click",f,E=>{Zt(t.toast.cancel)&&e(U)&&(t.toast.cancel?.onClick?.(E),n())}),a(d,f)},D=l(()=>Zt(t.toast.cancel));B(o,d=>{typeof t.toast.cancel=="function"?d(I):e(D)&&d(P,1)})}a(u,m)};B(jt,u=>{t.toast.cancel&&u(X)})}var R=Lt(jt,2);{var Q=u=>{var m=b(),o=h(m);{var I=d=>{var f=b(),z=h(f);Tt(z,()=>t.toast.action,(E,q)=>{q(E,{})}),a(d,f)},P=d=>{var f=qe(),z=J(f,!0);Y(f),K(E=>{le(f,t.toast.actionButtonStyle??$()),rt(f,1,E),Yt(z,t.toast.action.label)},[()=>st(it(e(j)?.actionButton,t.toast?.classes?.actionButton))]),Ct("click",f,E=>{Zt(t.toast.action)&&(t.toast.action?.onClick(E),!E.defaultPrevented&&n())}),a(d,f)},D=l(()=>Zt(t.toast.action));B(o,d=>{typeof t.toast.action=="function"?d(I):e(D)&&d(P,1)})}a(u,m)};B(R,u=>{t.toast.action&&u(Q)})}K((u,m)=>{rt(x,1,u),rt(g,1,m)},[()=>st(it(e(j)?.content,t.toast?.classes?.content)),()=>st(it(e(j)?.title,t.toast?.classes?.title))]),a(s,c)};B(ae,s=>{t.toast.component?s(oe):s(ie,!1)})}Y(i),Ie(i,s=>r(Z,s),()=>e(Z)),K((s,c,v)=>{rt(i,1,s),y(i,"aria-live",t.toast.important?"assertive":"polite"),y(i,"data-rich-colors",t.toast.richColors??Bt()),y(i,"data-styled",!(t.toast.component||t.toast.unstyled||ct())),y(i,"data-mounted",e(V)),y(i,"data-promise",c),y(i,"data-swiped",e(Ot)),y(i,"data-removed",e(N)),y(i,"data-visible",e(qt)),y(i,"data-y-position",e(zt)[0]),y(i,"data-x-position",e(zt)[1]),y(i,"data-index",t.index),y(i,"data-front",e(Qt)),y(i,"data-swiping",e(Dt)),y(i,"data-dismissible",e(U)),y(i,"data-type",e(S)),y(i,"data-invert",e($t)),y(i,"data-swipe-out",e(Ht)),y(i,"data-swipe-direction",e(kt)),y(i,"data-expanded",v),At=le(i,`${t.style} ${t.toast.style}`,At,{"--index":t.index,"--toasts-before":t.index,"--z-index":O.toasts.length-t.index,"--offset":`${e(N)?e(W):e(Pt)}px`,"--initial-height":t.expandByDefault?"auto":`${e(dt)}px`})},[()=>st(it(t.class,e(Et),e(j)?.toast,t.toast?.classes?.toast,e(j)?.[e(S)],t.toast?.classes?.[e(S)])),()=>!!t.toast.promise,()=>!!(t.expanded||t.expandByDefault&&e(V))]),Ct("pointermove",i,Ut),Ct("pointerup",i,me),Ct("pointerdown",i,ne),Me("dragend",i,ot),a(_,i),ve()}Ee(["pointermove","pointerup","pointerdown","click"]);var tn=Ft('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-success-icon=""><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>');function en(_){var t=tn();a(_,t)}var nn=Ft('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-error-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>');function an(_){var t=nn();a(_,t)}var on=Ft('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" data-sonner-warning-icon="" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');function sn(_){var t=on();a(_,t)}var rn=Ft('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-info-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>');function ln(_){var t=rn();a(_,t)}var cn=Ft('<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-sonner-close-icon=""><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>');function dn(_){var t=cn();a(_,t)}const un=3,Te="24px",Be="16px",fn=4e3,vn=356,mn=14,de="dark",Gt="light";function gn(_,t){const C={};return[_,t].forEach((k,$)=>{const tt=$===1,ct=tt?"--mobile-offset":"--offset",Bt=tt?Be:Te;function St(V){["top","right","bottom","left"].forEach(N=>{C[`${ct}-${N}`]=typeof V=="number"?`${V}px`:V})}typeof k=="number"||typeof k=="string"?St(k):typeof k=="object"?["top","right","bottom","left"].forEach(V=>{const N=k[V];N===void 0?C[`${ct}-${V}`]=Bt:C[`${ct}-${V}`]=typeof N=="number"?`${N}px`:N}):St(Bt)}),C}var hn=G("<ol></ol>"),bn=G('<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-nbs0zk"><!></section>');function En(_,t){fe(t,!0);function C(n){return n!=="system"?n:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?de:Gt}let k=T(t,"invert",3,!1),$=T(t,"position",3,"bottom-right"),tt=T(t,"hotkey",19,()=>["altKey","KeyT"]),ct=T(t,"expand",3,!1),Bt=T(t,"closeButton",3,!1),St=T(t,"offset",3,Te),V=T(t,"mobileOffset",3,Be),N=T(t,"theme",3,"light"),Dt=T(t,"richColors",3,!1),Ht=T(t,"duration",3,fn),Ot=T(t,"visibleToasts",3,un),W=T(t,"toastOptions",19,()=>({})),dt=T(t,"dir",7,"auto"),Mt=T(t,"gap",3,mn),Z=T(t,"pauseWhenPageIsHidden",3,!1),et=T(t,"containerAriaLabel",3,"Notifications"),kt=T(t,"closeButtonAriaLabel",3,"Close toast"),Qt=Ce(t,["$$slots","$$events","$$legacy","invert","position","hotkey","expand","closeButton","offset","mobileOffset","theme","richColors","duration","visibleToasts","toastOptions","dir","gap","pauseWhenPageIsHidden","loadingIcon","successIcon","errorIcon","warningIcon","closeIcon","infoIcon","containerAriaLabel","class","closeButtonAriaLabel","onblur","onfocus","onmouseenter","onmousemove","onmouseleave","ondragend","onpointerdown","onpointerup"]);function qt(){if(dt()!=="auto")return dt();if(typeof window>"u"||typeof document>"u")return"ltr";const n=document.documentElement.getAttribute("dir");return n==="auto"||!n?(Xt(()=>dt(window.getComputedStyle(document.documentElement).direction??"ltr")),dt()):(Xt(()=>dt(n)),n)}const S=l(()=>Array.from(new Set([$(),...O.toasts.filter(n=>n.position).map(n=>n.position)].filter(Boolean))));let U=A(!1),Et=A(!1),yt=A(we(C(N()))),ut=A(void 0),ft=A(null),wt=A(!1);const bt=l(()=>tt().join("+").replace(/Key/g,"").replace(/Digit/g,""));ht(()=>{O.toasts.length<=1&&r(U,!1)}),ht(()=>{const n=O.toasts.filter(M=>M.dismiss&&!M.delete);if(n.length>0){const M=O.toasts.map(nt=>n.find(xt=>xt.id===nt.id)?{...nt,delete:!0}:nt);O.toasts=M}}),ht(()=>()=>{e(ut)&&e(ft)&&(e(ft).focus({preventScroll:!0}),r(ft,null),r(wt,!1))}),xe(()=>(O.reset(),ye(document,"keydown",M=>{tt().every(at=>M[at]||M.code===at)&&(r(U,!0),e(ut)?.focus()),M.code==="Escape"&&(document.activeElement===e(ut)||e(ut)?.contains(document.activeElement))&&r(U,!1)}))),ht(()=>{if(N()!=="system"&&r(yt,N()),typeof window<"u"){N()==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?r(yt,de):r(yt,Gt));const n=window.matchMedia("(prefers-color-scheme: dark)"),M=({matches:nt})=>{N()==="system"&&r(yt,nt?de:Gt,!0)};"addEventListener"in n?n.addEventListener("change",M):n.addListener(M)}});const zt=n=>{t.onblur?.(n),e(wt)&&!n.currentTarget.contains(n.relatedTarget)&&(r(wt,!1),e(ft)&&(e(ft).focus({preventScroll:!0}),r(ft,null)))},Jt=n=>{t.onfocus?.(n),!(n.target instanceof HTMLElement&&n.target.dataset.dismissible==="false")&&(e(wt)||(r(wt,!0),r(ft,n.relatedTarget,!0)))},pt=n=>{t.onpointerdown?.(n),!(n.target instanceof HTMLElement&&n.target.dataset.dismissible==="false")&&r(Et,!0)},$t=n=>{t.onmouseenter?.(n),r(U,!0)},Nt=n=>{t.onmouseleave?.(n),e(Et)||r(U,!1)},j=n=>{t.onmousemove?.(n),r(U,!0)},te=n=>{t.ondragend?.(n),r(U,!1)},ee=n=>{t.onpointerup?.(n),r(Et,!1)};Le.set(new He);var vt=bn();y(vt,"tabindex",-1);var Wt=J(vt);{var Pt=n=>{var M=b(),nt=h(M);ue(nt,18,()=>e(S),at=>at,(at,xt,ne,me)=>{const Ut=l(()=>{const[i,At]=xt.split("-");return{y:i,x:At}}),ot=l(()=>gn(St(),V()));var mt=hn();Pe(mt,i=>({tabindex:-1,dir:i,class:t.class,"data-sonner-toaster":!0,"data-sonner-theme":e(yt),"data-y-position":e(Ut).y,"data-x-position":e(Ut).x,style:t.style,onblur:zt,onfocus:Jt,onmouseenter:$t,onmousemove:j,onmouseleave:Nt,ondragend:te,onpointerdown:pt,onpointerup:ee,...Qt,[Ae]:{"--front-toast-height":`${O.heights[0]?.height}px`,"--width":`${vn}px`,"--gap":`${Mt()}px`,"--offset-top":e(ot)["--offset-top"],"--offset-right":e(ot)["--offset-right"],"--offset-bottom":e(ot)["--offset-bottom"],"--offset-left":e(ot)["--offset-left"],"--mobile-offset-top":e(ot)["--mobile-offset-top"],"--mobile-offset-right":e(ot)["--mobile-offset-right"],"--mobile-offset-bottom":e(ot)["--mobile-offset-bottom"],"--mobile-offset-left":e(ot)["--mobile-offset-left"]}}),[qt],void 0,void 0,"svelte-nbs0zk"),ue(mt,23,()=>O.toasts.filter(i=>!i.position&&e(ne)===0||i.position===xt),i=>i.id,(i,At,Vt,ge)=>{{const ae=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.successIcon??lt),a(o,I)},m=o=>{en(o)};B(Q,o=>{t.successIcon?o(u):t.successIcon!==null&&o(m,1)})}a(X,R)},oe=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.errorIcon??lt),a(o,I)},m=o=>{an(o)};B(Q,o=>{t.errorIcon?o(u):t.errorIcon!==null&&o(m,1)})}a(X,R)},ie=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.warningIcon??lt),a(o,I)},m=o=>{sn(o)};B(Q,o=>{t.warningIcon?o(u):t.warningIcon!==null&&o(m,1)})}a(X,R)},s=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.infoIcon??lt),a(o,I)},m=o=>{ln(o)};B(Q,o=>{t.infoIcon?o(u):t.infoIcon!==null&&o(m,1)})}a(X,R)},c=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.closeIcon??lt),a(o,I)},m=o=>{dn(o)};B(Q,o=>{t.closeIcon?o(u):t.closeIcon!==null&&o(m,1)})}a(X,R)};let v=l(()=>W()?.duration??Ht()),w=l(()=>W()?.class??""),x=l(()=>W()?.descriptionClass||""),g=l(()=>W()?.style??""),L=l(()=>W().classes||{}),It=l(()=>W().unstyled??!1),Rt=l(()=>W()?.cancelButtonStyle??""),se=l(()=>W()?.actionButtonStyle??""),jt=l(()=>W()?.closeButtonAriaLabel??kt());$e(i,{get index(){return e(Vt)},get toast(){return e(At)},get defaultRichColors(){return Dt()},get duration(){return e(v)},get class(){return e(w)},get descriptionClass(){return e(x)},get invert(){return k()},get visibleToasts(){return Ot()},get closeButton(){return Bt()},get interacting(){return e(Et)},get position(){return xt},get style(){return e(g)},get classes(){return e(L)},get unstyled(){return e(It)},get cancelButtonStyle(){return e(Rt)},get actionButtonStyle(){return e(se)},get closeButtonAriaLabel(){return e(jt)},get expandByDefault(){return ct()},get expanded(){return e(U)},get pauseWhenPageIsHidden(){return Z()},get loadingIcon(){return t.loadingIcon},successIcon:ae,errorIcon:oe,warningIcon:ie,infoIcon:s,closeIcon:c,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),Y(mt),Ie(mt,i=>r(ut,i),()=>e(ut)),K(()=>mt.dir=mt.dir),a(at,mt)}),a(n,M)};B(Wt,n=>{O.toasts.length>0&&n(Pt)})}Y(vt),K(()=>y(vt,"aria-label",`${et()??""} ${e(bt)??""}`)),a(_,vt),ve()}export{Re as L,En as T};
|
|
1
|
+
import{a,b as G,o as ye,g as Ct,e as Me,c as b,d as Ee,t as he,s as Yt,f as Ft}from"./S3zzfNyy.js";import{p as fe,c as J,r as Y,t as K,b as ve,e as A,f as we,a3 as ht,s as r,g as e,a4 as Xt,aE as xe,aa as Lt,ab as l,ad as lt,a0 as h}from"./DwMoyB6r.js";import{i as B,b as Ie}from"./DVe5EzgB.js";import{e as ue}from"./BnuoIjma.js";import{s as y,c as le,b as p,a as Pe,S as Ae}from"./BYqzpKy3.js";import{p as T,s as ce,r as Ce}from"./DLfZVgnp.js";import{a as O,c as it,s as Le,S as He}from"./CN0DHWaX.js";import{c as Tt}from"./BdfrxCf_.js";import{c as st,s as rt}from"./koVwyjnn.js";import"./CkRzikAP.js";const Oe=Array(12).fill(0);var ke=G('<div class="sonner-loading-bar"></div>'),Ne=G('<div><div class="sonner-spinner"></div></div>');function Re(_,t){fe(t,!0);var C=Ne(),k=J(C);ue(k,23,()=>Oe,($,tt)=>`spinner-bar-${tt}`,($,tt)=>{var ct=ke();a($,ct)}),Y(k),Y(C),K($=>{rt(C,1,$),y(C,"data-visible",t.visible)},[()=>st(["sonner-loading-wrapper",t.class].filter(Boolean).join(" "))]),a(_,C),ve()}function Zt(_){return _.label!==void 0}function Fe(){let _=A(we(typeof document<"u"?document.hidden:!1));return ht(()=>ye(document,"visibilitychange",()=>{r(_,document.hidden,!0)})),{get current(){return e(_)}}}const be=4e3,ze=14,We=45,Ue=200,Ve=.05,je={toast:"",title:"",description:"",loader:"",closeButton:"",cancelButton:"",actionButton:"",action:"",warning:"",error:"",success:"",default:"",info:"",loading:""};function Ke(_){const[t,C]=_.split("-"),k=[];return t&&k.push(t),C&&k.push(C),k}function _e(_){return 1/(1.5+Math.abs(_)/20)}var Ye=G("<div><!></div>"),Ze=G('<button data-close-button=""><!></button>'),Ge=G('<div data-icon=""><!> <!></div>'),Xe=G('<div data-description=""><!></div>'),Qe=G('<button data-button="" data-cancel=""> </button>'),qe=G('<button data-button=""> </button>'),Je=G('<!> <div data-content=""><div data-title=""><!></div> <!></div> <!> <!>',1),pe=G('<li aria-atomic="true" data-sonner-toast=""><!> <!></li>');function $e(_,t){fe(t,!0);const C=s=>{var c=b(),v=h(c);{var w=g=>{var L=Ye(),It=J(L);p(It,()=>t.loadingIcon),Y(L),K(Rt=>{rt(L,1,Rt),y(L,"data-visible",e(S)==="loading")},[()=>st(it(e(j)?.loader,t.toast?.classes?.loader,"sonner-loader"))]),a(g,L)},x=g=>{{let L=l(()=>it(e(j)?.loader,t.toast.classes?.loader)),It=l(()=>e(S)==="loading");Re(g,{get class(){return e(L)},get visible(){return e(It)}})}};B(v,g=>{t.loadingIcon?g(w):g(x,!1)})}a(s,c)};let k=T(t,"cancelButtonStyle",3,""),$=T(t,"actionButtonStyle",3,""),tt=T(t,"descriptionClass",3,""),ct=T(t,"unstyled",3,!1),Bt=T(t,"defaultRichColors",3,!1);const St={...je};let V=A(!1),N=A(!1),Dt=A(!1),Ht=A(!1),Ot=A(!1),W=A(0),dt=A(0),Mt=t.toast.duration||t.duration||be,Z=A(void 0),et=A(null),kt=A(null);const Qt=l(()=>t.index===0),qt=l(()=>t.index+1<=t.visibleToasts),S=l(()=>t.toast.type),U=l(()=>t.toast.dismissible!==void 0?t.toast.dismissible!==!1:t.toast.dismissable!==!1),Et=l(()=>t.toast.class||""),yt=l(()=>t.toast.descriptionClass||""),ut=l(()=>O.heights.findIndex(s=>s.toastId===t.toast.id)||0),ft=l(()=>t.toast.closeButton??t.closeButton),wt=l(()=>t.toast.duration??t.duration??be);let bt=null;const zt=l(()=>t.position.split("-")),Jt=l(()=>O.heights.reduce((s,c,v)=>v>=e(ut)?s:s+c.height,0)),pt=Fe(),$t=l(()=>t.toast.invert||t.invert),Nt=l(()=>e(S)==="loading"),j=l(()=>({...St,...t.classes})),te=l(()=>t.toast.title),ee=l(()=>t.toast.description);let vt=A(0),Wt=A(0);const Pt=l(()=>Math.round(e(ut)*ze+e(Jt)));ht(()=>{e(te),e(ee);let s;t.expanded||t.expandByDefault?s=1:s=1-t.index*Ve;const c=Xt(()=>e(Z));if(c===void 0)return;c.style.setProperty("height","auto");const v=c.offsetHeight,w=c.getBoundingClientRect().height,x=Math.round(w/s+Number.EPSILON&100)/100;c.style.removeProperty("height");let g;Math.abs(x-v)<1?g=x:g=v,r(dt,g,!0),O.setHeight({toastId:t.toast.id,height:g})});function n(){r(N,!0),r(W,e(Pt),!0),O.removeHeight(t.toast.id),setTimeout(()=>{O.remove(t.toast.id)},Ue)}let M;const nt=l(()=>t.toast.promise&&e(S)==="loading"||t.toast.duration===Number.POSITIVE_INFINITY);function at(){r(vt,new Date().getTime(),!0),M=setTimeout(()=>{t.toast.onAutoClose?.(t.toast),n()},Mt)}function xt(){if(e(Wt)<e(vt)){const s=new Date().getTime()-e(vt);Mt=Mt-s}r(Wt,new Date().getTime(),!0)}ht(()=>{t.toast.updated&&(clearTimeout(M),Mt=e(wt),at())}),ht(()=>(e(nt)||(t.expanded||t.interacting||t.pauseWhenPageIsHidden&&pt.current?xt():at()),()=>clearTimeout(M))),xe(()=>{r(V,!0);const s=e(Z)?.getBoundingClientRect().height;return r(dt,s,!0),O.setHeight({toastId:t.toast.id,height:s}),()=>{O.removeHeight(t.toast.id)}}),ht(()=>{t.toast.delete&&Xt(()=>{n(),t.toast.onDismiss?.(t.toast)})});const ne=s=>{if(e(Nt))return;r(W,e(Pt),!0);const c=s.target;c.setPointerCapture(s.pointerId),c.tagName!=="BUTTON"&&(r(Dt,!0),bt={x:s.clientX,y:s.clientY})},me=()=>{if(e(Ht)||!e(U))return;bt=null;const s=Number(e(Z)?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),c=Number(e(Z)?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),v=new Date().getTime()-0,w=e(et)==="x"?s:c,x=Math.abs(w)/v;if(Math.abs(w)>=We||x>.11){r(W,e(Pt),!0),t.toast.onDismiss?.(t.toast),e(et)==="x"?r(kt,s>0?"right":"left",!0):r(kt,c>0?"down":"up",!0),n(),r(Ht,!0);return}else e(Z)?.style.setProperty("--swipe-amount-x","0px"),e(Z)?.style.setProperty("--swipe-amount-y","0px");r(Ot,!1),r(Dt,!1),r(et,null)},Ut=s=>{if(!bt||!e(U)||(window.getSelection()?.toString().length??-1)>0)return;const v=s.clientY-bt.y,w=s.clientX-bt.x,x=t.swipeDirections??Ke(t.position);!e(et)&&(Math.abs(w)>1||Math.abs(v)>1)&&r(et,Math.abs(w)>Math.abs(v)?"x":"y",!0);let g={x:0,y:0};if(e(et)==="y"){if(x.includes("top")||x.includes("bottom"))if(x.includes("top")&&v<0||x.includes("bottom")&&v>0)g.y=v;else{const L=v*_e(v);g.y=Math.abs(L)<Math.abs(v)?L:v}}else if(e(et)==="x"&&(x.includes("left")||x.includes("right")))if(x.includes("left")&&w<0||x.includes("right")&&w>0)g.x=w;else{const L=w*_e(w);g.x=Math.abs(L)<Math.abs(w)?L:w}(Math.abs(g.x)>0||Math.abs(g.y)>0)&&r(Ot,!0),e(Z)?.style.setProperty("--swipe-amount-x",`${g.x}px`),e(Z)?.style.setProperty("--swipe-amount-y",`${g.y}px`)},ot=()=>{r(Dt,!1),r(et,null),bt=null},mt=l(()=>t.toast.icon?t.toast.icon:e(S)==="success"?t.successIcon:e(S)==="error"?t.errorIcon:e(S)==="warning"?t.warningIcon:e(S)==="info"?t.infoIcon:e(S)==="loading"?t.loadingIcon:null);var i=pe();y(i,"tabindex",0);let At;var Vt=J(i);{var ge=s=>{var c=Ze(),v=J(c);p(v,()=>t.closeIcon??lt),Y(c),K(w=>{y(c,"aria-label",t.closeButtonAriaLabel),y(c,"data-disabled",e(Nt)),rt(c,1,w)},[()=>st(it(e(j)?.closeButton,t.toast?.classes?.closeButton))]),Ct("click",c,()=>{e(Nt)||!e(U)||(n(),t.toast.onDismiss?.(t.toast))}),a(s,c)};B(Vt,s=>{e(ft)&&!t.toast.component&&e(S)!=="loading"&&t.closeIcon!==null&&s(ge)})}var ae=Lt(Vt,2);{var oe=s=>{const c=l(()=>t.toast.component);var v=b(),w=h(v);Tt(w,()=>e(c),(x,g)=>{g(x,ce(()=>t.toast.componentProps,{closeToast:n}))}),a(s,v)},ie=s=>{var c=Je(),v=h(c);{var w=u=>{var m=Ge(),o=J(m);{var I=d=>{var f=b(),z=h(f);{var E=_t=>{var Kt=b(),re=h(Kt);Tt(re,()=>t.toast.icon,(H,F)=>{F(H,{})}),a(_t,Kt)},q=_t=>{C(_t)};B(z,_t=>{t.toast.icon?_t(E):_t(q,!1)})}a(d,f)};B(o,d=>{(t.toast.promise||e(S)==="loading")&&d(I)})}var P=Lt(o,2);{var D=d=>{var f=b(),z=h(f);{var E=H=>{var F=b(),gt=h(F);Tt(gt,()=>t.toast.icon,(Se,De)=>{De(Se,{})}),a(H,F)},q=H=>{var F=b(),gt=h(F);p(gt,()=>t.successIcon??lt),a(H,F)},_t=H=>{var F=b(),gt=h(F);p(gt,()=>t.errorIcon??lt),a(H,F)},Kt=H=>{var F=b(),gt=h(F);p(gt,()=>t.warningIcon??lt),a(H,F)},re=H=>{var F=b(),gt=h(F);p(gt,()=>t.infoIcon??lt),a(H,F)};B(z,H=>{t.toast.icon?H(E):e(S)==="success"?H(q,1):e(S)==="error"?H(_t,2):e(S)==="warning"?H(Kt,3):e(S)==="info"&&H(re,4)})}a(d,f)};B(P,d=>{t.toast.type!=="loading"&&d(D)})}Y(m),K(d=>rt(m,1,d),[()=>st(it(e(j)?.icon,t.toast?.classes?.icon))]),a(u,m)};B(v,u=>{(e(S)||t.toast.icon||t.toast.promise)&&t.toast.icon!==null&&(e(mt)!==null||t.toast.icon)&&u(w)})}var x=Lt(v,2),g=J(x),L=J(g);{var It=u=>{var m=b(),o=h(m);{var I=D=>{const d=l(()=>t.toast.title);var f=b(),z=h(f);Tt(z,()=>e(d),(E,q)=>{q(E,ce(()=>t.toast.componentProps))}),a(D,f)},P=D=>{var d=he();K(()=>Yt(d,t.toast.title)),a(D,d)};B(o,D=>{typeof t.toast.title!="string"?D(I):D(P,!1)})}a(u,m)};B(L,u=>{t.toast.title&&u(It)})}Y(g);var Rt=Lt(g,2);{var se=u=>{var m=Xe(),o=J(m);{var I=D=>{const d=l(()=>t.toast.description);var f=b(),z=h(f);Tt(z,()=>e(d),(E,q)=>{q(E,ce(()=>t.toast.componentProps))}),a(D,f)},P=D=>{var d=he();K(()=>Yt(d,t.toast.description)),a(D,d)};B(o,D=>{typeof t.toast.description!="string"?D(I):D(P,!1)})}Y(m),K(D=>rt(m,1,D),[()=>st(it(tt(),e(yt),e(j)?.description,t.toast.classes?.description))]),a(u,m)};B(Rt,u=>{t.toast.description&&u(se)})}Y(x);var jt=Lt(x,2);{var X=u=>{var m=b(),o=h(m);{var I=d=>{var f=b(),z=h(f);Tt(z,()=>t.toast.cancel,(E,q)=>{q(E,{})}),a(d,f)},P=d=>{var f=Qe(),z=J(f,!0);Y(f),K(E=>{le(f,t.toast.cancelButtonStyle??k()),rt(f,1,E),Yt(z,t.toast.cancel.label)},[()=>st(it(e(j)?.cancelButton,t.toast?.classes?.cancelButton))]),Ct("click",f,E=>{Zt(t.toast.cancel)&&e(U)&&(t.toast.cancel?.onClick?.(E),n())}),a(d,f)},D=l(()=>Zt(t.toast.cancel));B(o,d=>{typeof t.toast.cancel=="function"?d(I):e(D)&&d(P,1)})}a(u,m)};B(jt,u=>{t.toast.cancel&&u(X)})}var R=Lt(jt,2);{var Q=u=>{var m=b(),o=h(m);{var I=d=>{var f=b(),z=h(f);Tt(z,()=>t.toast.action,(E,q)=>{q(E,{})}),a(d,f)},P=d=>{var f=qe(),z=J(f,!0);Y(f),K(E=>{le(f,t.toast.actionButtonStyle??$()),rt(f,1,E),Yt(z,t.toast.action.label)},[()=>st(it(e(j)?.actionButton,t.toast?.classes?.actionButton))]),Ct("click",f,E=>{Zt(t.toast.action)&&(t.toast.action?.onClick(E),!E.defaultPrevented&&n())}),a(d,f)},D=l(()=>Zt(t.toast.action));B(o,d=>{typeof t.toast.action=="function"?d(I):e(D)&&d(P,1)})}a(u,m)};B(R,u=>{t.toast.action&&u(Q)})}K((u,m)=>{rt(x,1,u),rt(g,1,m)},[()=>st(it(e(j)?.content,t.toast?.classes?.content)),()=>st(it(e(j)?.title,t.toast?.classes?.title))]),a(s,c)};B(ae,s=>{t.toast.component?s(oe):s(ie,!1)})}Y(i),Ie(i,s=>r(Z,s),()=>e(Z)),K((s,c,v)=>{rt(i,1,s),y(i,"aria-live",t.toast.important?"assertive":"polite"),y(i,"data-rich-colors",t.toast.richColors??Bt()),y(i,"data-styled",!(t.toast.component||t.toast.unstyled||ct())),y(i,"data-mounted",e(V)),y(i,"data-promise",c),y(i,"data-swiped",e(Ot)),y(i,"data-removed",e(N)),y(i,"data-visible",e(qt)),y(i,"data-y-position",e(zt)[0]),y(i,"data-x-position",e(zt)[1]),y(i,"data-index",t.index),y(i,"data-front",e(Qt)),y(i,"data-swiping",e(Dt)),y(i,"data-dismissible",e(U)),y(i,"data-type",e(S)),y(i,"data-invert",e($t)),y(i,"data-swipe-out",e(Ht)),y(i,"data-swipe-direction",e(kt)),y(i,"data-expanded",v),At=le(i,`${t.style} ${t.toast.style}`,At,{"--index":t.index,"--toasts-before":t.index,"--z-index":O.toasts.length-t.index,"--offset":`${e(N)?e(W):e(Pt)}px`,"--initial-height":t.expandByDefault?"auto":`${e(dt)}px`})},[()=>st(it(t.class,e(Et),e(j)?.toast,t.toast?.classes?.toast,e(j)?.[e(S)],t.toast?.classes?.[e(S)])),()=>!!t.toast.promise,()=>!!(t.expanded||t.expandByDefault&&e(V))]),Ct("pointermove",i,Ut),Ct("pointerup",i,me),Ct("pointerdown",i,ne),Me("dragend",i,ot),a(_,i),ve()}Ee(["pointermove","pointerup","pointerdown","click"]);var tn=Ft('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-success-icon=""><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>');function en(_){var t=tn();a(_,t)}var nn=Ft('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-error-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>');function an(_){var t=nn();a(_,t)}var on=Ft('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" data-sonner-warning-icon="" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');function sn(_){var t=on();a(_,t)}var rn=Ft('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-info-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>');function ln(_){var t=rn();a(_,t)}var cn=Ft('<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-sonner-close-icon=""><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>');function dn(_){var t=cn();a(_,t)}const un=3,Te="24px",Be="16px",fn=4e3,vn=356,mn=14,de="dark",Gt="light";function gn(_,t){const C={};return[_,t].forEach((k,$)=>{const tt=$===1,ct=tt?"--mobile-offset":"--offset",Bt=tt?Be:Te;function St(V){["top","right","bottom","left"].forEach(N=>{C[`${ct}-${N}`]=typeof V=="number"?`${V}px`:V})}typeof k=="number"||typeof k=="string"?St(k):typeof k=="object"?["top","right","bottom","left"].forEach(V=>{const N=k[V];N===void 0?C[`${ct}-${V}`]=Bt:C[`${ct}-${V}`]=typeof N=="number"?`${N}px`:N}):St(Bt)}),C}var hn=G("<ol></ol>"),bn=G('<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-nbs0zk"><!></section>');function En(_,t){fe(t,!0);function C(n){return n!=="system"?n:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?de:Gt}let k=T(t,"invert",3,!1),$=T(t,"position",3,"bottom-right"),tt=T(t,"hotkey",19,()=>["altKey","KeyT"]),ct=T(t,"expand",3,!1),Bt=T(t,"closeButton",3,!1),St=T(t,"offset",3,Te),V=T(t,"mobileOffset",3,Be),N=T(t,"theme",3,"light"),Dt=T(t,"richColors",3,!1),Ht=T(t,"duration",3,fn),Ot=T(t,"visibleToasts",3,un),W=T(t,"toastOptions",19,()=>({})),dt=T(t,"dir",7,"auto"),Mt=T(t,"gap",3,mn),Z=T(t,"pauseWhenPageIsHidden",3,!1),et=T(t,"containerAriaLabel",3,"Notifications"),kt=T(t,"closeButtonAriaLabel",3,"Close toast"),Qt=Ce(t,["$$slots","$$events","$$legacy","invert","position","hotkey","expand","closeButton","offset","mobileOffset","theme","richColors","duration","visibleToasts","toastOptions","dir","gap","pauseWhenPageIsHidden","loadingIcon","successIcon","errorIcon","warningIcon","closeIcon","infoIcon","containerAriaLabel","class","closeButtonAriaLabel","onblur","onfocus","onmouseenter","onmousemove","onmouseleave","ondragend","onpointerdown","onpointerup"]);function qt(){if(dt()!=="auto")return dt();if(typeof window>"u"||typeof document>"u")return"ltr";const n=document.documentElement.getAttribute("dir");return n==="auto"||!n?(Xt(()=>dt(window.getComputedStyle(document.documentElement).direction??"ltr")),dt()):(Xt(()=>dt(n)),n)}const S=l(()=>Array.from(new Set([$(),...O.toasts.filter(n=>n.position).map(n=>n.position)].filter(Boolean))));let U=A(!1),Et=A(!1),yt=A(we(C(N()))),ut=A(void 0),ft=A(null),wt=A(!1);const bt=l(()=>tt().join("+").replace(/Key/g,"").replace(/Digit/g,""));ht(()=>{O.toasts.length<=1&&r(U,!1)}),ht(()=>{const n=O.toasts.filter(M=>M.dismiss&&!M.delete);if(n.length>0){const M=O.toasts.map(nt=>n.find(xt=>xt.id===nt.id)?{...nt,delete:!0}:nt);O.toasts=M}}),ht(()=>()=>{e(ut)&&e(ft)&&(e(ft).focus({preventScroll:!0}),r(ft,null),r(wt,!1))}),xe(()=>(O.reset(),ye(document,"keydown",M=>{tt().every(at=>M[at]||M.code===at)&&(r(U,!0),e(ut)?.focus()),M.code==="Escape"&&(document.activeElement===e(ut)||e(ut)?.contains(document.activeElement))&&r(U,!1)}))),ht(()=>{if(N()!=="system"&&r(yt,N()),typeof window<"u"){N()==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?r(yt,de):r(yt,Gt));const n=window.matchMedia("(prefers-color-scheme: dark)"),M=({matches:nt})=>{N()==="system"&&r(yt,nt?de:Gt,!0)};"addEventListener"in n?n.addEventListener("change",M):n.addListener(M)}});const zt=n=>{t.onblur?.(n),e(wt)&&!n.currentTarget.contains(n.relatedTarget)&&(r(wt,!1),e(ft)&&(e(ft).focus({preventScroll:!0}),r(ft,null)))},Jt=n=>{t.onfocus?.(n),!(n.target instanceof HTMLElement&&n.target.dataset.dismissible==="false")&&(e(wt)||(r(wt,!0),r(ft,n.relatedTarget,!0)))},pt=n=>{t.onpointerdown?.(n),!(n.target instanceof HTMLElement&&n.target.dataset.dismissible==="false")&&r(Et,!0)},$t=n=>{t.onmouseenter?.(n),r(U,!0)},Nt=n=>{t.onmouseleave?.(n),e(Et)||r(U,!1)},j=n=>{t.onmousemove?.(n),r(U,!0)},te=n=>{t.ondragend?.(n),r(U,!1)},ee=n=>{t.onpointerup?.(n),r(Et,!1)};Le.set(new He);var vt=bn();y(vt,"tabindex",-1);var Wt=J(vt);{var Pt=n=>{var M=b(),nt=h(M);ue(nt,18,()=>e(S),at=>at,(at,xt,ne,me)=>{const Ut=l(()=>{const[i,At]=xt.split("-");return{y:i,x:At}}),ot=l(()=>gn(St(),V()));var mt=hn();Pe(mt,i=>({tabindex:-1,dir:i,class:t.class,"data-sonner-toaster":!0,"data-sonner-theme":e(yt),"data-y-position":e(Ut).y,"data-x-position":e(Ut).x,style:t.style,onblur:zt,onfocus:Jt,onmouseenter:$t,onmousemove:j,onmouseleave:Nt,ondragend:te,onpointerdown:pt,onpointerup:ee,...Qt,[Ae]:{"--front-toast-height":`${O.heights[0]?.height}px`,"--width":`${vn}px`,"--gap":`${Mt()}px`,"--offset-top":e(ot)["--offset-top"],"--offset-right":e(ot)["--offset-right"],"--offset-bottom":e(ot)["--offset-bottom"],"--offset-left":e(ot)["--offset-left"],"--mobile-offset-top":e(ot)["--mobile-offset-top"],"--mobile-offset-right":e(ot)["--mobile-offset-right"],"--mobile-offset-bottom":e(ot)["--mobile-offset-bottom"],"--mobile-offset-left":e(ot)["--mobile-offset-left"]}}),[qt],void 0,void 0,"svelte-nbs0zk"),ue(mt,23,()=>O.toasts.filter(i=>!i.position&&e(ne)===0||i.position===xt),i=>i.id,(i,At,Vt,ge)=>{{const ae=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.successIcon??lt),a(o,I)},m=o=>{en(o)};B(Q,o=>{t.successIcon?o(u):t.successIcon!==null&&o(m,1)})}a(X,R)},oe=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.errorIcon??lt),a(o,I)},m=o=>{an(o)};B(Q,o=>{t.errorIcon?o(u):t.errorIcon!==null&&o(m,1)})}a(X,R)},ie=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.warningIcon??lt),a(o,I)},m=o=>{sn(o)};B(Q,o=>{t.warningIcon?o(u):t.warningIcon!==null&&o(m,1)})}a(X,R)},s=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.infoIcon??lt),a(o,I)},m=o=>{ln(o)};B(Q,o=>{t.infoIcon?o(u):t.infoIcon!==null&&o(m,1)})}a(X,R)},c=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.closeIcon??lt),a(o,I)},m=o=>{dn(o)};B(Q,o=>{t.closeIcon?o(u):t.closeIcon!==null&&o(m,1)})}a(X,R)};let v=l(()=>W()?.duration??Ht()),w=l(()=>W()?.class??""),x=l(()=>W()?.descriptionClass||""),g=l(()=>W()?.style??""),L=l(()=>W().classes||{}),It=l(()=>W().unstyled??!1),Rt=l(()=>W()?.cancelButtonStyle??""),se=l(()=>W()?.actionButtonStyle??""),jt=l(()=>W()?.closeButtonAriaLabel??kt());$e(i,{get index(){return e(Vt)},get toast(){return e(At)},get defaultRichColors(){return Dt()},get duration(){return e(v)},get class(){return e(w)},get descriptionClass(){return e(x)},get invert(){return k()},get visibleToasts(){return Ot()},get closeButton(){return Bt()},get interacting(){return e(Et)},get position(){return xt},get style(){return e(g)},get classes(){return e(L)},get unstyled(){return e(It)},get cancelButtonStyle(){return e(Rt)},get actionButtonStyle(){return e(se)},get closeButtonAriaLabel(){return e(jt)},get expandByDefault(){return ct()},get expanded(){return e(U)},get pauseWhenPageIsHidden(){return Z()},get loadingIcon(){return t.loadingIcon},successIcon:ae,errorIcon:oe,warningIcon:ie,infoIcon:s,closeIcon:c,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),Y(mt),Ie(mt,i=>r(ut,i),()=>e(ut)),K(()=>mt.dir=mt.dir),a(at,mt)}),a(n,M)};B(Wt,n=>{O.toasts.length>0&&n(Pt)})}Y(vt),K(()=>y(vt,"aria-label",`${et()??""} ${e(bt)??""}`)),a(_,vt),ve()}export{Re as L,En as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as St,p as le,c as j,a as u,b as I,s as Ht,f as Ot,d as fe,g as L,t as Nt,e as ve}from"./S3zzfNyy.js";import{e as F,s as c,g as o,ab as T,p as _t,a0 as A,b as yt,c as g,ad as Kt,r as _,l as At,d as et,a as Gt,n as U,m as Mt,t as dt,aC as me,a3 as be,aa as z}from"./DwMoyB6r.js";import{b as ut,a as ct,r as ge,s as _e}from"./BYqzpKy3.js";import{i as S,b as ye}from"./DVe5EzgB.js";import{e as Ce}from"./BnuoIjma.js";import{c as X}from"./BdfrxCf_.js";import{s as Wt}from"./koVwyjnn.js";import{b as we,B as Pe}from"./ClyoIkBa.js";import{p as f,s as ee,r as he,l as Vt}from"./DLfZVgnp.js";import{g as oe}from"./BqtdCvqG.js";import{i as Ut}from"./CkRzikAP.js";import{A as xe,C as re}from"./BEQ3s_NB.js";import{n as tt}from"./DiQyiOFg.js";import{v as $t}from"./BIMJw85l.js";import{w as He}from"./C88BjBh_.js";import{w as Zt,j as Ae,k as gt,C as Me,a as de,D as Ve,l as Yt,E as Oe,S as ke,n as ue,c as Te,o as De,P as ne,h as D,d as Ie,f as ce,p as xt,q as ze,r as Fe,m as Bt,s as se,F as Ee,t as Se,A as Ne,u as We,v as $e,x as Be,y as Ke,z as Ye,B as Le,G as Xe}from"./CDl-NinU.js";function ie(v,t){const[e,s]=v;let n=!1;const r=t.length;for(let d=0,i=r-1;d<r;i=d++){const[p,P]=t[d]??[0,0],[y,a]=t[i]??[0,0];P>=s!=a>=s&&e<=(y-p)*(s-P)/(a-P)+p&&(n=!n)}return n}function ae(v,t){return v[0]>=t.left&&v[0]<=t.right&&v[1]>=t.top&&v[1]<=t.bottom}function je(v,t){const e=v.left+v.width/2,s=v.top+v.height/2,n=t.left+t.width/2,r=t.top+t.height/2,d=n-e,i=r-s;return Math.abs(d)>Math.abs(i)?d>0?"right":"left":i>0?"bottom":"top"}class qe{#t;#n;#o=null;#e=null;#s=null;#a(){this.#s!==null&&(cancelAnimationFrame(this.#s),this.#s=null)}#h(){this.#a(),this.#s=requestAnimationFrame(()=>{this.#s=null,!(!this.#o||!this.#e)&&(this.#r(),this.#t.onPointerExit())})}constructor(t){this.#t=t,this.#n=t.buffer??1,Zt([t.triggerNode,t.contentNode,t.enabled],([e,s,n])=>{if(!e||!s||!n){this.#r();return}const r=Ae(e),d=a=>{this.#i([a.clientX,a.clientY],e,s)},i=a=>{const l=a.relatedTarget;if(gt(l)&&s.contains(l))return;const x=this.#t.ignoredTargets?.()??[];if(!(gt(l)&&x.some(H=>H===l||H.contains(l)))){if(gt(l)&&!e.contains(l)&&!s.contains(l)&&!l.contains(s)){this.#r(),this.#t.onPointerExit();return}this.#o=[a.clientX,a.clientY],this.#e="content",this.#h()}},p=()=>{this.#r()},P=()=>{this.#r()},y=a=>{const l=a.relatedTarget;gt(l)&&e.contains(l)||(this.#o=[a.clientX,a.clientY],this.#e="trigger",this.#h())};return[St(r,"pointermove",d),St(e,"pointerleave",i),St(e,"pointerenter",p),St(s,"pointerenter",P),St(s,"pointerleave",y)].reduce((a,l)=>()=>{a(),l()},()=>{})})}#i(t,e,s){if(!this.#o||!this.#e)return;this.#a();const n=e.getBoundingClientRect(),r=s.getBoundingClientRect();if(this.#e==="content"&&ae(t,r)){this.#r();return}if(this.#e==="trigger"&&ae(t,n)){this.#r();return}const d=je(n,r),i=this.#l(n,r,d);if(i&&ie(t,i))return;const p=this.#e==="content"?r:n,P=this.#d(this.#o,p,d,this.#e);ie(t,P)||(this.#r(),this.#t.onPointerExit())}#r(){this.#o=null,this.#e=null,this.#a()}#l(t,e,s){const n=this.#n;switch(s){case"top":return[[Math.min(t.left,e.left)-n,t.top],[Math.min(t.left,e.left)-n,e.bottom],[Math.max(t.right,e.right)+n,e.bottom],[Math.max(t.right,e.right)+n,t.top]];case"bottom":return[[Math.min(t.left,e.left)-n,t.bottom],[Math.min(t.left,e.left)-n,e.top],[Math.max(t.right,e.right)+n,e.top],[Math.max(t.right,e.right)+n,t.bottom]];case"left":return[[t.left,Math.min(t.top,e.top)-n],[e.right,Math.min(t.top,e.top)-n],[e.right,Math.max(t.bottom,e.bottom)+n],[t.left,Math.max(t.bottom,e.bottom)+n]];case"right":return[[t.right,Math.min(t.top,e.top)-n],[e.left,Math.min(t.top,e.top)-n],[e.left,Math.max(t.bottom,e.bottom)+n],[t.right,Math.max(t.bottom,e.bottom)+n]]}}#d(t,e,s,n){const r=this.#n*4,[d,i]=t;switch(n==="trigger"?this.#u(s):s){case"top":return[[d-r,i+r],[d+r,i+r],[e.right+r,e.bottom],[e.right+r,e.top],[e.left-r,e.top],[e.left-r,e.bottom]];case"bottom":return[[d-r,i-r],[d+r,i-r],[e.right+r,e.top],[e.right+r,e.bottom],[e.left-r,e.bottom],[e.left-r,e.top]];case"left":return[[d+r,i-r],[d+r,i+r],[e.right,e.bottom+r],[e.left,e.bottom+r],[e.left,e.top-r],[e.right,e.top-r]];case"right":return[[d-r,i-r],[d-r,i+r],[e.left,e.bottom+r],[e.right,e.bottom+r],[e.right,e.top-r],[e.left,e.top-r]]}}#u(t){switch(t){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}}}const qt=Ie({component:"popover",parts:["root","trigger","content","close","overlay"]}),Jt=new Me("Popover.Root");class Qt{static create(t){return Jt.set(new Qt(t))}opts;#t=F(null);get contentNode(){return o(this.#t)}set contentNode(t){c(this.#t,t,!0)}contentPresence;#n=F(null);get triggerNode(){return o(this.#n)}set triggerNode(t){c(this.#n,t,!0)}#o=F(null);get overlayNode(){return o(this.#o)}set overlayNode(t){c(this.#o,t,!0)}overlayPresence;#e=F(!1);get openedViaHover(){return o(this.#e)}set openedViaHover(t){c(this.#e,t,!0)}#s=F(!1);get hasInteractedWithContent(){return o(this.#s)}set hasInteractedWithContent(t){c(this.#s,t,!0)}#a=F(!1);get hoverCooldown(){return o(this.#a)}set hoverCooldown(t){c(this.#a,t,!0)}#h=F(0);get closeDelay(){return o(this.#h)}set closeDelay(t){c(this.#h,t,!0)}#i=null;#r=null;constructor(t){this.opts=t,this.contentPresence=new ne({ref:D(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new ne({ref:D(()=>this.overlayNode),open:this.opts.open}),Zt(()=>this.opts.open.current,e=>{e||(this.openedViaHover=!1,this.hasInteractedWithContent=!1,this.#l())})}setDomContext(t){this.#r=t}#l(){this.#i!==null&&this.#r&&(this.#r.clearTimeout(this.#i),this.#i=null)}toggleOpen(){this.#l(),this.opts.open.current=!this.opts.open.current}handleClose(){this.#l(),this.opts.open.current&&(this.opts.open.current=!1)}handleHoverOpen(){this.#l(),!this.opts.open.current&&(this.openedViaHover=!0,this.opts.open.current=!0)}handleHoverClose(){this.opts.open.current&&this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1)}handleDelayedHoverClose(){this.opts.open.current&&(!this.openedViaHover||this.hasInteractedWithContent||(this.#l(),this.closeDelay<=0?this.opts.open.current=!1:this.#r&&(this.#i=this.#r.setTimeout(()=>{this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1),this.#i=null},this.closeDelay))))}cancelDelayedClose(){this.#l()}markInteraction(){this.hasInteractedWithContent=!0,this.#l()}}class Rt{static create(t){return new Rt(t,Jt.get())}opts;root;attachment;domContext;#t=null;#n=null;#o=F(!1);constructor(t,e){this.opts=t,this.root=e,this.attachment=de(this.opts.ref,s=>this.root.triggerNode=s),this.domContext=new Ve(t.ref),this.root.setDomContext(this.domContext),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),Zt(()=>this.opts.closeDelay.current,s=>{this.root.closeDelay=s})}#e(){this.#t!==null&&(this.domContext.clearTimeout(this.#t),this.#t=null)}#s(){this.#n!==null&&(this.domContext.clearTimeout(this.#n),this.#n=null)}#a(){this.#e(),this.#s()}onpointerenter(t){if(this.opts.disabled.current||!this.opts.openOnHover.current||Yt(t)||(c(this.#o,!0),this.#s(),this.root.cancelDelayedClose(),this.root.opts.open.current||this.root.hoverCooldown))return;const e=this.opts.openDelay.current;e<=0?this.root.handleHoverOpen():this.#t=this.domContext.setTimeout(()=>{this.root.handleHoverOpen(),this.#t=null},e)}onpointerleave(t){this.opts.disabled.current||this.opts.openOnHover.current&&(Yt(t)||(c(this.#o,!1),this.#e(),this.root.hoverCooldown=!1))}onclick(t){if(!this.opts.disabled.current&&t.button===0){if(this.#a(),o(this.#o)&&this.root.opts.open.current&&this.root.openedViaHover){this.root.openedViaHover=!1,this.root.hasInteractedWithContent=!0;return}o(this.#o)&&this.opts.openOnHover.current&&this.root.opts.open.current&&(this.root.hoverCooldown=!0),this.root.hoverCooldown&&!this.root.opts.open.current&&(this.root.hoverCooldown=!1),this.root.toggleOpen()}}onkeydown(t){this.opts.disabled.current||(t.key===Oe||t.key===ke)&&(t.preventDefault(),this.#a(),this.root.toggleOpen())}#h(){if(this.root.opts.open.current&&this.root.contentNode?.id)return this.root.contentNode?.id}#i=T(()=>({id:this.opts.id.current,"aria-haspopup":"dialog","aria-expanded":Te(this.root.opts.open.current),"data-state":ue(this.root.opts.open.current),"aria-controls":this.#h(),[qt.trigger]:"",disabled:this.opts.disabled.current,onkeydown:this.onkeydown,onclick:this.onclick,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return o(this.#i)}set props(t){c(this.#i,t)}}class te{static create(t){return new te(t,Jt.get())}opts;root;attachment;constructor(t,e){this.opts=t,this.root=e,this.attachment=de(this.opts.ref,s=>this.root.contentNode=s),this.onpointerdown=this.onpointerdown.bind(this),this.onfocusin=this.onfocusin.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),new qe({triggerNode:()=>this.root.triggerNode,contentNode:()=>this.root.contentNode,enabled:()=>this.root.opts.open.current&&this.root.openedViaHover&&!this.root.hasInteractedWithContent,onPointerExit:()=>{this.root.handleDelayedHoverClose()}})}onpointerdown(t){this.root.markInteraction()}onfocusin(t){const e=t.target;gt(e)&&De(e)&&this.root.markInteraction()}onpointerenter(t){Yt(t)||this.root.cancelDelayedClose()}onpointerleave(t){Yt(t)}onInteractOutside=t=>{if(this.opts.onInteractOutside.current(t),t.defaultPrevented||!gt(t.target))return;const e=t.target.closest(qt.selector("trigger"));if(!(e&&e===this.root.triggerNode)){if(this.opts.customAnchor.current){if(gt(this.opts.customAnchor.current)){if(this.opts.customAnchor.current.contains(t.target))return}else if(typeof this.opts.customAnchor.current=="string"){const s=document.querySelector(this.opts.customAnchor.current);if(s&&s.contains(t.target))return}}this.root.handleClose()}};onEscapeKeydown=t=>{this.opts.onEscapeKeydown.current(t),!t.defaultPrevented&&this.root.handleClose()};get shouldRender(){return this.root.contentPresence.shouldRender}get shouldTrapFocus(){return!(this.root.openedViaHover&&!this.root.hasInteractedWithContent)}#t=T(()=>({open:this.root.opts.open.current}));get snippetProps(){return o(this.#t)}set snippetProps(t){c(this.#t,t)}#n=T(()=>({id:this.opts.id.current,tabindex:-1,"data-state":ue(this.root.opts.open.current),[qt.content]:"",style:{pointerEvents:"auto",contain:"layout style"},onpointerdown:this.onpointerdown,onfocusin:this.onfocusin,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return o(this.#n)}set props(t){c(this.#n,t)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown}}var Ge=I("<div><div><!></div></div>"),Ue=I("<div><div><!></div></div>");function Ze(v,t){const e=le();_t(t,!0);let s=f(t,"ref",15,null),n=f(t,"id",19,()=>ce(e)),r=f(t,"forceMount",3,!1),d=f(t,"onOpenAutoFocus",3,xt),i=f(t,"onCloseAutoFocus",3,xt),p=f(t,"onEscapeKeydown",3,xt),P=f(t,"onInteractOutside",3,xt),y=f(t,"trapFocus",3,!0),a=f(t,"preventScroll",3,!1),l=f(t,"customAnchor",3,null),x=he(t,["$$slots","$$events","$$legacy","child","children","ref","id","forceMount","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","customAnchor","style"]);const H=te.create({id:D(()=>n()),ref:D(()=>s(),O=>s(O)),onInteractOutside:D(()=>P()),onEscapeKeydown:D(()=>p()),customAnchor:D(()=>l())}),ot=T(()=>Bt(x,H.props)),Ct=T(()=>y()&&H.shouldTrapFocus);function wt(O){H.shouldTrapFocus||O.preventDefault(),d()(O)}var N=j(),q=A(N);{var B=O=>{ze(O,ee(()=>o(ot),()=>H.popperProps,{get ref(){return H.opts.ref},get enabled(){return H.root.opts.open.current},get id(){return n()},get trapFocus(){return o(Ct)},get preventScroll(){return a()},loop:!0,forceMount:!0,get customAnchor(){return l()},onOpenAutoFocus:wt,get onCloseAutoFocus(){return i()},get shouldRender(){return H.shouldRender},popper:(pt,nt)=>{let ft=()=>nt?.().props,st=()=>nt?.().wrapperProps;const it=T(()=>Bt(ft(),{style:se("popover")},{style:t.style}));var at=j(),Tt=A(at);{var Dt=V=>{var M=j(),E=A(M);{let Z=T(()=>({props:o(it),wrapperProps:st(),...H.snippetProps}));ut(E,()=>t.child,()=>o(Z))}u(V,M)},Pt=V=>{var M=Ge();ct(M,()=>({...st()}));var E=g(M);ct(E,()=>({...o(it)}));var Z=g(E);ut(Z,()=>t.children??Kt),_(E),_(M),u(V,M)};S(Tt,V=>{t.child?V(Dt):V(Pt,!1)})}u(pt,at)},$$slots:{popper:!0}}))},rt=O=>{Fe(O,ee(()=>o(ot),()=>H.popperProps,{get ref(){return H.opts.ref},get open(){return H.root.opts.open.current},get id(){return n()},get trapFocus(){return o(Ct)},get preventScroll(){return a()},loop:!0,forceMount:!1,get customAnchor(){return l()},onOpenAutoFocus:wt,get onCloseAutoFocus(){return i()},get shouldRender(){return H.shouldRender},popper:(pt,nt)=>{let ft=()=>nt?.().props,st=()=>nt?.().wrapperProps;const it=T(()=>Bt(ft(),{style:se("popover")},{style:t.style}));var at=j(),Tt=A(at);{var Dt=V=>{var M=j(),E=A(M);{let Z=T(()=>({props:o(it),wrapperProps:st(),...H.snippetProps}));ut(E,()=>t.child,()=>o(Z))}u(V,M)},Pt=V=>{var M=Ue();ct(M,()=>({...st()}));var E=g(M);ct(E,()=>({...o(it)}));var Z=g(E);ut(Z,()=>t.children??Kt),_(E),_(M),u(V,M)};S(Tt,V=>{t.child?V(Dt):V(Pt,!1)})}u(pt,at)},$$slots:{popper:!0}}))};S(q,O=>{r()?O(B):r()||O(rt,1)})}u(v,N),yt()}var Je=I("<button><!></button>");function Qe(v,t){const e=le();_t(t,!0);let s=f(t,"id",19,()=>ce(e)),n=f(t,"ref",15,null),r=f(t,"type",3,"button"),d=f(t,"disabled",3,!1),i=f(t,"openOnHover",3,!1),p=f(t,"openDelay",3,700),P=f(t,"closeDelay",3,300),y=he(t,["$$slots","$$events","$$legacy","children","child","id","ref","type","disabled","openOnHover","openDelay","closeDelay"]);const a=Rt.create({id:D(()=>s()),ref:D(()=>n(),x=>n(x)),disabled:D(()=>!!d()),openOnHover:D(()=>i()),openDelay:D(()=>p()),closeDelay:D(()=>P())}),l=T(()=>Bt(y,a.props,{type:r()}));Ee(v,{get id(){return s()},get ref(){return a.opts.ref},children:(x,H)=>{var ot=j(),Ct=A(ot);{var wt=q=>{var B=j(),rt=A(B);ut(rt,()=>t.child,()=>({props:o(l)})),u(q,B)},N=q=>{var B=Je();ct(B,()=>({...o(l)}));var rt=g(B);ut(rt,()=>t.children??Kt),_(B),u(q,B)};S(Ct,q=>{t.child?q(wt):q(N,!1)})}u(x,ot)},$$slots:{default:!0}}),yt()}function Re(v,t){_t(t,!0);let e=f(t,"open",15,!1),s=f(t,"onOpenChange",3,xt),n=f(t,"onOpenChangeComplete",3,xt);Qt.create({open:D(()=>e(),r=>{e(r),s()(r)}),onOpenChangeComplete:D(()=>n())}),Se(v,{children:(r,d)=>{var i=j(),p=A(i);ut(p,()=>t.children??Kt),u(r,i)},$$slots:{default:!0}}),yt()}var to=Ot("<title> </title>"),eo=Ot('<svg><!><path d="M17.74,30,16,29l4-7h6a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2H6A2,2,0,0,0,4,8V20a2,2,0,0,0,2,2h9v2H6a4,4,0,0,1-4-4V8A4,4,0,0,1,6,4H26a4,4,0,0,1,4,4V20a4,4,0,0,1-4,4H21.16Z"></path><path d="M8 10H24V12H8z"></path><path d="M8 16H18V18H8z"></path></svg>');function oo(v,t){const e=Vt(t,["children","$$slots","$$events","$$legacy"]),s=Vt(e,["size","title"]);_t(t,!1);const n=Mt(),r=Mt();let d=f(t,"size",8,16),i=f(t,"title",8,void 0);At(()=>(et(e),et(i())),()=>{c(n,e["aria-label"]||e["aria-labelledby"]||i())}),At(()=>(o(n),et(e)),()=>{c(r,{"aria-hidden":o(n)?void 0:!0,role:o(n)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),Gt(),Ut();var p=eo();ct(p,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:d(),height:d(),...o(r),...s}));var P=g(p);{var y=a=>{var l=to(),x=g(l,!0);_(l),dt(()=>Ht(x,i())),u(a,l)};S(P,a=>{i()&&a(y)})}U(3),_(p),u(v,p),yt()}var ro=Ot("<title> </title>"),no=Ot('<svg><!><path d="M10 6H28V8H10z"></path><path d="M10 24H28V26H10z"></path><path d="M10 15H28V17H10z"></path><path d="M4 15H6V17H4z"></path><path d="M4 6H6V8H4z"></path><path d="M4 24H6V26H4z"></path></svg>');function so(v,t){const e=Vt(t,["children","$$slots","$$events","$$legacy"]),s=Vt(e,["size","title"]);_t(t,!1);const n=Mt(),r=Mt();let d=f(t,"size",8,16),i=f(t,"title",8,void 0);At(()=>(et(e),et(i())),()=>{c(n,e["aria-label"]||e["aria-labelledby"]||i())}),At(()=>(o(n),et(e)),()=>{c(r,{"aria-hidden":o(n)?void 0:!0,role:o(n)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),Gt(),Ut();var p=no();ct(p,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:d(),height:d(),...o(r),...s}));var P=g(p);{var y=a=>{var l=ro(),x=g(l,!0);_(l),dt(()=>Ht(x,i())),u(a,l)};S(P,a=>{i()&&a(y)})}U(6),_(p),u(v,p),yt()}var io=Ot("<title> </title>"),ao=Ot('<svg><!><path d="M26,4h-4V2h-2v2h-8V2h-2v2H6C4.9,4,4,4.9,4,6v20c0,1.1,0.9,2,2,2h20c1.1,0,2-0.9,2-2V6C28,4.9,27.1,4,26,4z M26,26H6V12h20 V26z M26,10H6V6h4v2h2V6h8v2h2V6h4V10z"></path></svg>');function lo(v,t){const e=Vt(t,["children","$$slots","$$events","$$legacy"]),s=Vt(e,["size","title"]);_t(t,!1);const n=Mt(),r=Mt();let d=f(t,"size",8,16),i=f(t,"title",8,void 0);At(()=>(et(e),et(i())),()=>{c(n,e["aria-label"]||e["aria-labelledby"]||i())}),At(()=>(o(n),et(e)),()=>{c(r,{"aria-hidden":o(n)?void 0:!0,role:o(n)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),Gt(),Ut();var p=ao();ct(p,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:d(),height:d(),...o(r),...s}));var P=g(p);{var y=a=>{var l=io(),x=g(l,!0);_(l),dt(()=>Ht(x,i())),u(a,l)};S(P,a=>{i()&&a(y)})}U(),_(p),u(v,p),yt()}const ho=Re,uo=Qe,co=Ze;var po=I('<div class="tab active svelte-r6dy5f"><input class="tab-rename-input svelte-r6dy5f"/></div>'),fo=I('<span class="tab-close svelte-r6dy5f" title="Close"><!></span>'),vo=I('<button><span class="tab-label svelte-r6dy5f"> </span> <!></button>'),mo=I('<span class="tab-close svelte-r6dy5f" title="Close"><!></span>'),bo=I('<button><span class="tab-label svelte-r6dy5f"> </span> <!></button>'),go=I("<!> <span>New View</span>",1),_o=I('<button class="add-view-option svelte-r6dy5f"><!> List</button> <button class="add-view-option svelte-r6dy5f"><!> Calendar</button>',1),yo=I("<!> <!>",1),Co=I("<!> <!>",1),wo=I("<!> <!>",1),Po=I("<!> <!>",1),xo=I('<div class="tab-bar svelte-r6dy5f"><div class="tabs-scroll svelte-r6dy5f"><button><span class="tab-label svelte-r6dy5f">Home</span></button> <button><span class="tab-label svelte-r6dy5f">Graph</span></button> <!> <!> <!></div> <div class="bar-right svelte-r6dy5f"><!> <!></div></div> <!>',1);function Bo(v,t){_t(t,!0);let e=f(t,"activeView",3,"entity");const s=me("chat");function n(h){oe(h,{noScroll:!0})}const r=T(()=>tt.selectedId!==null),d=T(()=>{if(!tt.selectedRepo||!tt.selectedId)return"";for(const h of He.repos){if(h.name!==tt.selectedRepo)continue;const m=h.entities.find(C=>C.id===tt.selectedId);if(m)return m.title}return tt.selectedId.replace(/-/g," ").replace(/\b\w/g,h=>h.toUpperCase())});function i(){tt.deselect(),n("/")}let p=F(!1);async function P(h){c(p,!1);const m=h==="calendar"?"Calendar":"List",C=await $t.create(m,h);oe(`/views/${C.id}`)}let y=F(null),a=F(""),l=F(null),x=F(!1);function H(h){c(x,!1),c(y,h.id,!0),c(a,h.name,!0)}be(()=>{o(y)&&o(l)&&(o(l).focus(),o(l).select(),setTimeout(()=>{c(x,!0)},50))});function ot(){o(x)&&(o(y)&&o(a).trim()&&$t.update(o(y),{name:o(a).trim()}),c(y,null),c(x,!1))}function Ct(){c(y,null),c(x,!1)}function wt(h){h.key==="Enter"&&(h.preventDefault(),c(x,!0),ot()),h.key==="Escape"&&(h.preventDefault(),Ct())}let N=F(null);function q(h,m){h.stopPropagation(),c(N,m,!0)}async function B(){o(N)&&(await $t.remove(o(N).id),c(N,null))}var rt=xo(),O=A(rt),kt=g(O),pt=g(kt);let nt;var ft=z(pt,2);let st;var it=z(ft,2);Ce(it,17,()=>$t.views,h=>h.id,(h,m)=>{var C=j(),J=A(C);{var Q=W=>{var k=po(),b=g(k);ge(b),ye(b,w=>c(l,w),()=>o(l)),_(k),dt(w=>_e(b,"size",w),[()=>Math.max(o(a).length,1)]),L("keydown",b,wt),L("input",b,w=>{c(a,w.currentTarget.value,!0)}),ve("blur",b,ot),we(b,()=>o(a),w=>c(a,w)),u(W,k)},R=W=>{const k=T(()=>e()==="view"&&tt.activeViewId===o(m).id);var b=vo();let w;var lt=g(b),$=g(lt,!0);_(lt);var K=z(lt,2);{var It=Y=>{var G=fo(),zt=g(G);re(zt,{size:12}),_(G),L("click",G,Lt=>q(Lt,o(m))),u(Y,G)};S(K,Y=>{o(k)&&Y(It)})}_(b),dt(()=>{w=Wt(b,1,"tab svelte-r6dy5f",null,w,{"tab-permanent":!o(k),active:o(k)}),Ht($,o(m).name)}),L("click",b,()=>n(`/views/${o(m).id}`)),L("dblclick",b,()=>H(o(m))),u(W,b)};S(J,W=>{o(y)===o(m).id?W(Q):W(R,!1)})}u(h,C)});var at=z(it,2);{var Tt=h=>{const m=T(()=>e()==="entity"&&o(r));var C=bo();let J;var Q=g(C),R=g(Q,!0);_(Q);var W=z(Q,2);{var k=b=>{var w=mo(),lt=g(w);re(lt,{size:12}),_(w),L("click",w,$=>{$.stopPropagation(),i()}),u(b,w)};S(W,b=>{o(m)&&b(k)})}_(C),dt(()=>{J=Wt(C,1,"tab svelte-r6dy5f",null,J,{"tab-permanent":!o(m),active:o(m)}),Ht(R,o(d))}),L("click",C,()=>n(tt.entityPath??"/")),u(h,C)};S(at,h=>{o(r)&&h(Tt)})}var Dt=z(at,2);X(Dt,()=>ho,(h,m)=>{m(h,{get open(){return o(p)},set open(C){c(p,C,!0)},children:(C,J)=>{var Q=yo(),R=A(Q);X(R,()=>uo,(k,b)=>{b(k,{class:"new-view-btn",title:"New view",children:(w,lt)=>{var $=go(),K=A($);xe(K,{size:16}),U(2),u(w,$)},$$slots:{default:!0}})});var W=z(R,2);X(W,()=>co,(k,b)=>{b(k,{class:"add-view-menu",sideOffset:4,align:"start",children:(w,lt)=>{var $=_o(),K=A($),It=g(K);so(It,{size:14}),U(),_(K);var Y=z(K,2),G=g(Y);lo(G,{size:14}),U(),_(Y),L("click",K,()=>P("list")),L("click",Y,()=>P("calendar")),u(w,$)},$$slots:{default:!0}})}),u(C,Q)},$$slots:{default:!0}})}),_(kt);var Pt=z(kt,2),V=g(Pt);{var M=h=>{var m=j(),C=A(m);ut(C,()=>t.right),u(h,m)};S(V,h=>{t.right&&h(M)})}var E=z(V,2);{var Z=h=>{Pe(h,{variant:"accent",size:"icon",class:"chat-toggle",title:"Open Agent",get onclick(){return s.toggle},children:(m,C)=>{oo(m,{size:14})},$$slots:{default:!0}})};S(E,h=>{s.open||h(Z)})}_(Pt),_(O);var pe=z(O,2);{let h=T(()=>!!o(N));X(pe,()=>Xe,(m,C)=>{C(m,{get open(){return o(h)},onOpenChange:J=>{J||c(N,null)},children:(J,Q)=>{var R=j(),W=A(R);X(W,()=>Ne,(k,b)=>{b(k,{children:(w,lt)=>{var $=Po(),K=A($);X(K,()=>We,(Y,G)=>{G(Y,{children:(zt,Lt)=>{var Ft=Co(),Et=A(Ft);X(Et,()=>$e,(vt,mt)=>{mt(vt,{children:(bt,jt)=>{U();var ht=Nt("Delete view?");u(bt,ht)},$$slots:{default:!0}})});var Xt=z(Et,2);X(Xt,()=>Be,(vt,mt)=>{mt(vt,{children:(bt,jt)=>{U();var ht=Nt();dt(()=>Ht(ht,`The view "${o(N)?.name??""}" will be permanently deleted.`)),u(bt,ht)},$$slots:{default:!0}})}),u(zt,Ft)},$$slots:{default:!0}})});var It=z(K,2);X(It,()=>Ke,(Y,G)=>{G(Y,{children:(zt,Lt)=>{var Ft=wo(),Et=A(Ft);X(Et,()=>Ye,(vt,mt)=>{mt(vt,{children:(bt,jt)=>{U();var ht=Nt("Cancel");u(bt,ht)},$$slots:{default:!0}})});var Xt=z(Et,2);X(Xt,()=>Le,(vt,mt)=>{mt(vt,{onclick:B,children:(bt,jt)=>{U();var ht=Nt("Delete");u(bt,ht)},$$slots:{default:!0}})}),u(zt,Ft)},$$slots:{default:!0}})}),u(w,$)},$$slots:{default:!0}})}),u(J,R)},$$slots:{default:!0}})})}dt(()=>{nt=Wt(pt,1,"tab tab-permanent svelte-r6dy5f",null,nt,{active:e()==="home"}),st=Wt(ft,1,"tab tab-permanent svelte-r6dy5f",null,st,{active:e()==="graph"})}),L("click",pt,()=>n("/")),L("click",ft,()=>e()!=="graph"&&n("/graph")),u(v,rt),yt()}fe(["click","keydown","input","dblclick"]);export{co as C,ho as R,uo as T,Bo as V,lo as a};
|
|
1
|
+
import{o as St,p as le,c as j,a as u,b as I,s as Ht,f as Ot,d as fe,g as L,t as Nt,e as ve}from"./S3zzfNyy.js";import{e as F,s as c,g as o,ab as T,p as _t,a0 as A,b as yt,c as g,ad as Kt,r as _,l as At,d as et,a as Gt,n as U,m as Mt,t as dt,aC as me,a3 as be,aa as z}from"./DwMoyB6r.js";import{b as ut,a as ct,r as ge,s as _e}from"./BYqzpKy3.js";import{i as S,b as ye}from"./DVe5EzgB.js";import{e as Ce}from"./BnuoIjma.js";import{c as X}from"./BdfrxCf_.js";import{s as Wt}from"./koVwyjnn.js";import{b as we,B as Pe}from"./ClyoIkBa.js";import{p as f,s as ee,r as he,l as Vt}from"./DLfZVgnp.js";import{g as oe}from"./Drutqki6.js";import{i as Ut}from"./CkRzikAP.js";import{A as xe,C as re}from"./BEQ3s_NB.js";import{n as tt}from"./DiQyiOFg.js";import{v as $t}from"./BavZAyDT.js";import{w as He}from"./C88BjBh_.js";import{w as Zt,j as Ae,k as gt,C as Me,a as de,D as Ve,l as Yt,E as Oe,S as ke,n as ue,c as Te,o as De,P as ne,h as D,d as Ie,f as ce,p as xt,q as ze,r as Fe,m as Bt,s as se,F as Ee,t as Se,A as Ne,u as We,v as $e,x as Be,y as Ke,z as Ye,B as Le,G as Xe}from"./CDl-NinU.js";function ie(v,t){const[e,s]=v;let n=!1;const r=t.length;for(let d=0,i=r-1;d<r;i=d++){const[p,P]=t[d]??[0,0],[y,a]=t[i]??[0,0];P>=s!=a>=s&&e<=(y-p)*(s-P)/(a-P)+p&&(n=!n)}return n}function ae(v,t){return v[0]>=t.left&&v[0]<=t.right&&v[1]>=t.top&&v[1]<=t.bottom}function je(v,t){const e=v.left+v.width/2,s=v.top+v.height/2,n=t.left+t.width/2,r=t.top+t.height/2,d=n-e,i=r-s;return Math.abs(d)>Math.abs(i)?d>0?"right":"left":i>0?"bottom":"top"}class qe{#t;#n;#o=null;#e=null;#s=null;#a(){this.#s!==null&&(cancelAnimationFrame(this.#s),this.#s=null)}#h(){this.#a(),this.#s=requestAnimationFrame(()=>{this.#s=null,!(!this.#o||!this.#e)&&(this.#r(),this.#t.onPointerExit())})}constructor(t){this.#t=t,this.#n=t.buffer??1,Zt([t.triggerNode,t.contentNode,t.enabled],([e,s,n])=>{if(!e||!s||!n){this.#r();return}const r=Ae(e),d=a=>{this.#i([a.clientX,a.clientY],e,s)},i=a=>{const l=a.relatedTarget;if(gt(l)&&s.contains(l))return;const x=this.#t.ignoredTargets?.()??[];if(!(gt(l)&&x.some(H=>H===l||H.contains(l)))){if(gt(l)&&!e.contains(l)&&!s.contains(l)&&!l.contains(s)){this.#r(),this.#t.onPointerExit();return}this.#o=[a.clientX,a.clientY],this.#e="content",this.#h()}},p=()=>{this.#r()},P=()=>{this.#r()},y=a=>{const l=a.relatedTarget;gt(l)&&e.contains(l)||(this.#o=[a.clientX,a.clientY],this.#e="trigger",this.#h())};return[St(r,"pointermove",d),St(e,"pointerleave",i),St(e,"pointerenter",p),St(s,"pointerenter",P),St(s,"pointerleave",y)].reduce((a,l)=>()=>{a(),l()},()=>{})})}#i(t,e,s){if(!this.#o||!this.#e)return;this.#a();const n=e.getBoundingClientRect(),r=s.getBoundingClientRect();if(this.#e==="content"&&ae(t,r)){this.#r();return}if(this.#e==="trigger"&&ae(t,n)){this.#r();return}const d=je(n,r),i=this.#l(n,r,d);if(i&&ie(t,i))return;const p=this.#e==="content"?r:n,P=this.#d(this.#o,p,d,this.#e);ie(t,P)||(this.#r(),this.#t.onPointerExit())}#r(){this.#o=null,this.#e=null,this.#a()}#l(t,e,s){const n=this.#n;switch(s){case"top":return[[Math.min(t.left,e.left)-n,t.top],[Math.min(t.left,e.left)-n,e.bottom],[Math.max(t.right,e.right)+n,e.bottom],[Math.max(t.right,e.right)+n,t.top]];case"bottom":return[[Math.min(t.left,e.left)-n,t.bottom],[Math.min(t.left,e.left)-n,e.top],[Math.max(t.right,e.right)+n,e.top],[Math.max(t.right,e.right)+n,t.bottom]];case"left":return[[t.left,Math.min(t.top,e.top)-n],[e.right,Math.min(t.top,e.top)-n],[e.right,Math.max(t.bottom,e.bottom)+n],[t.left,Math.max(t.bottom,e.bottom)+n]];case"right":return[[t.right,Math.min(t.top,e.top)-n],[e.left,Math.min(t.top,e.top)-n],[e.left,Math.max(t.bottom,e.bottom)+n],[t.right,Math.max(t.bottom,e.bottom)+n]]}}#d(t,e,s,n){const r=this.#n*4,[d,i]=t;switch(n==="trigger"?this.#u(s):s){case"top":return[[d-r,i+r],[d+r,i+r],[e.right+r,e.bottom],[e.right+r,e.top],[e.left-r,e.top],[e.left-r,e.bottom]];case"bottom":return[[d-r,i-r],[d+r,i-r],[e.right+r,e.top],[e.right+r,e.bottom],[e.left-r,e.bottom],[e.left-r,e.top]];case"left":return[[d+r,i-r],[d+r,i+r],[e.right,e.bottom+r],[e.left,e.bottom+r],[e.left,e.top-r],[e.right,e.top-r]];case"right":return[[d-r,i-r],[d-r,i+r],[e.left,e.bottom+r],[e.right,e.bottom+r],[e.right,e.top-r],[e.left,e.top-r]]}}#u(t){switch(t){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}}}const qt=Ie({component:"popover",parts:["root","trigger","content","close","overlay"]}),Jt=new Me("Popover.Root");class Qt{static create(t){return Jt.set(new Qt(t))}opts;#t=F(null);get contentNode(){return o(this.#t)}set contentNode(t){c(this.#t,t,!0)}contentPresence;#n=F(null);get triggerNode(){return o(this.#n)}set triggerNode(t){c(this.#n,t,!0)}#o=F(null);get overlayNode(){return o(this.#o)}set overlayNode(t){c(this.#o,t,!0)}overlayPresence;#e=F(!1);get openedViaHover(){return o(this.#e)}set openedViaHover(t){c(this.#e,t,!0)}#s=F(!1);get hasInteractedWithContent(){return o(this.#s)}set hasInteractedWithContent(t){c(this.#s,t,!0)}#a=F(!1);get hoverCooldown(){return o(this.#a)}set hoverCooldown(t){c(this.#a,t,!0)}#h=F(0);get closeDelay(){return o(this.#h)}set closeDelay(t){c(this.#h,t,!0)}#i=null;#r=null;constructor(t){this.opts=t,this.contentPresence=new ne({ref:D(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new ne({ref:D(()=>this.overlayNode),open:this.opts.open}),Zt(()=>this.opts.open.current,e=>{e||(this.openedViaHover=!1,this.hasInteractedWithContent=!1,this.#l())})}setDomContext(t){this.#r=t}#l(){this.#i!==null&&this.#r&&(this.#r.clearTimeout(this.#i),this.#i=null)}toggleOpen(){this.#l(),this.opts.open.current=!this.opts.open.current}handleClose(){this.#l(),this.opts.open.current&&(this.opts.open.current=!1)}handleHoverOpen(){this.#l(),!this.opts.open.current&&(this.openedViaHover=!0,this.opts.open.current=!0)}handleHoverClose(){this.opts.open.current&&this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1)}handleDelayedHoverClose(){this.opts.open.current&&(!this.openedViaHover||this.hasInteractedWithContent||(this.#l(),this.closeDelay<=0?this.opts.open.current=!1:this.#r&&(this.#i=this.#r.setTimeout(()=>{this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1),this.#i=null},this.closeDelay))))}cancelDelayedClose(){this.#l()}markInteraction(){this.hasInteractedWithContent=!0,this.#l()}}class Rt{static create(t){return new Rt(t,Jt.get())}opts;root;attachment;domContext;#t=null;#n=null;#o=F(!1);constructor(t,e){this.opts=t,this.root=e,this.attachment=de(this.opts.ref,s=>this.root.triggerNode=s),this.domContext=new Ve(t.ref),this.root.setDomContext(this.domContext),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),Zt(()=>this.opts.closeDelay.current,s=>{this.root.closeDelay=s})}#e(){this.#t!==null&&(this.domContext.clearTimeout(this.#t),this.#t=null)}#s(){this.#n!==null&&(this.domContext.clearTimeout(this.#n),this.#n=null)}#a(){this.#e(),this.#s()}onpointerenter(t){if(this.opts.disabled.current||!this.opts.openOnHover.current||Yt(t)||(c(this.#o,!0),this.#s(),this.root.cancelDelayedClose(),this.root.opts.open.current||this.root.hoverCooldown))return;const e=this.opts.openDelay.current;e<=0?this.root.handleHoverOpen():this.#t=this.domContext.setTimeout(()=>{this.root.handleHoverOpen(),this.#t=null},e)}onpointerleave(t){this.opts.disabled.current||this.opts.openOnHover.current&&(Yt(t)||(c(this.#o,!1),this.#e(),this.root.hoverCooldown=!1))}onclick(t){if(!this.opts.disabled.current&&t.button===0){if(this.#a(),o(this.#o)&&this.root.opts.open.current&&this.root.openedViaHover){this.root.openedViaHover=!1,this.root.hasInteractedWithContent=!0;return}o(this.#o)&&this.opts.openOnHover.current&&this.root.opts.open.current&&(this.root.hoverCooldown=!0),this.root.hoverCooldown&&!this.root.opts.open.current&&(this.root.hoverCooldown=!1),this.root.toggleOpen()}}onkeydown(t){this.opts.disabled.current||(t.key===Oe||t.key===ke)&&(t.preventDefault(),this.#a(),this.root.toggleOpen())}#h(){if(this.root.opts.open.current&&this.root.contentNode?.id)return this.root.contentNode?.id}#i=T(()=>({id:this.opts.id.current,"aria-haspopup":"dialog","aria-expanded":Te(this.root.opts.open.current),"data-state":ue(this.root.opts.open.current),"aria-controls":this.#h(),[qt.trigger]:"",disabled:this.opts.disabled.current,onkeydown:this.onkeydown,onclick:this.onclick,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return o(this.#i)}set props(t){c(this.#i,t)}}class te{static create(t){return new te(t,Jt.get())}opts;root;attachment;constructor(t,e){this.opts=t,this.root=e,this.attachment=de(this.opts.ref,s=>this.root.contentNode=s),this.onpointerdown=this.onpointerdown.bind(this),this.onfocusin=this.onfocusin.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),new qe({triggerNode:()=>this.root.triggerNode,contentNode:()=>this.root.contentNode,enabled:()=>this.root.opts.open.current&&this.root.openedViaHover&&!this.root.hasInteractedWithContent,onPointerExit:()=>{this.root.handleDelayedHoverClose()}})}onpointerdown(t){this.root.markInteraction()}onfocusin(t){const e=t.target;gt(e)&&De(e)&&this.root.markInteraction()}onpointerenter(t){Yt(t)||this.root.cancelDelayedClose()}onpointerleave(t){Yt(t)}onInteractOutside=t=>{if(this.opts.onInteractOutside.current(t),t.defaultPrevented||!gt(t.target))return;const e=t.target.closest(qt.selector("trigger"));if(!(e&&e===this.root.triggerNode)){if(this.opts.customAnchor.current){if(gt(this.opts.customAnchor.current)){if(this.opts.customAnchor.current.contains(t.target))return}else if(typeof this.opts.customAnchor.current=="string"){const s=document.querySelector(this.opts.customAnchor.current);if(s&&s.contains(t.target))return}}this.root.handleClose()}};onEscapeKeydown=t=>{this.opts.onEscapeKeydown.current(t),!t.defaultPrevented&&this.root.handleClose()};get shouldRender(){return this.root.contentPresence.shouldRender}get shouldTrapFocus(){return!(this.root.openedViaHover&&!this.root.hasInteractedWithContent)}#t=T(()=>({open:this.root.opts.open.current}));get snippetProps(){return o(this.#t)}set snippetProps(t){c(this.#t,t)}#n=T(()=>({id:this.opts.id.current,tabindex:-1,"data-state":ue(this.root.opts.open.current),[qt.content]:"",style:{pointerEvents:"auto",contain:"layout style"},onpointerdown:this.onpointerdown,onfocusin:this.onfocusin,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return o(this.#n)}set props(t){c(this.#n,t)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown}}var Ge=I("<div><div><!></div></div>"),Ue=I("<div><div><!></div></div>");function Ze(v,t){const e=le();_t(t,!0);let s=f(t,"ref",15,null),n=f(t,"id",19,()=>ce(e)),r=f(t,"forceMount",3,!1),d=f(t,"onOpenAutoFocus",3,xt),i=f(t,"onCloseAutoFocus",3,xt),p=f(t,"onEscapeKeydown",3,xt),P=f(t,"onInteractOutside",3,xt),y=f(t,"trapFocus",3,!0),a=f(t,"preventScroll",3,!1),l=f(t,"customAnchor",3,null),x=he(t,["$$slots","$$events","$$legacy","child","children","ref","id","forceMount","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","customAnchor","style"]);const H=te.create({id:D(()=>n()),ref:D(()=>s(),O=>s(O)),onInteractOutside:D(()=>P()),onEscapeKeydown:D(()=>p()),customAnchor:D(()=>l())}),ot=T(()=>Bt(x,H.props)),Ct=T(()=>y()&&H.shouldTrapFocus);function wt(O){H.shouldTrapFocus||O.preventDefault(),d()(O)}var N=j(),q=A(N);{var B=O=>{ze(O,ee(()=>o(ot),()=>H.popperProps,{get ref(){return H.opts.ref},get enabled(){return H.root.opts.open.current},get id(){return n()},get trapFocus(){return o(Ct)},get preventScroll(){return a()},loop:!0,forceMount:!0,get customAnchor(){return l()},onOpenAutoFocus:wt,get onCloseAutoFocus(){return i()},get shouldRender(){return H.shouldRender},popper:(pt,nt)=>{let ft=()=>nt?.().props,st=()=>nt?.().wrapperProps;const it=T(()=>Bt(ft(),{style:se("popover")},{style:t.style}));var at=j(),Tt=A(at);{var Dt=V=>{var M=j(),E=A(M);{let Z=T(()=>({props:o(it),wrapperProps:st(),...H.snippetProps}));ut(E,()=>t.child,()=>o(Z))}u(V,M)},Pt=V=>{var M=Ge();ct(M,()=>({...st()}));var E=g(M);ct(E,()=>({...o(it)}));var Z=g(E);ut(Z,()=>t.children??Kt),_(E),_(M),u(V,M)};S(Tt,V=>{t.child?V(Dt):V(Pt,!1)})}u(pt,at)},$$slots:{popper:!0}}))},rt=O=>{Fe(O,ee(()=>o(ot),()=>H.popperProps,{get ref(){return H.opts.ref},get open(){return H.root.opts.open.current},get id(){return n()},get trapFocus(){return o(Ct)},get preventScroll(){return a()},loop:!0,forceMount:!1,get customAnchor(){return l()},onOpenAutoFocus:wt,get onCloseAutoFocus(){return i()},get shouldRender(){return H.shouldRender},popper:(pt,nt)=>{let ft=()=>nt?.().props,st=()=>nt?.().wrapperProps;const it=T(()=>Bt(ft(),{style:se("popover")},{style:t.style}));var at=j(),Tt=A(at);{var Dt=V=>{var M=j(),E=A(M);{let Z=T(()=>({props:o(it),wrapperProps:st(),...H.snippetProps}));ut(E,()=>t.child,()=>o(Z))}u(V,M)},Pt=V=>{var M=Ue();ct(M,()=>({...st()}));var E=g(M);ct(E,()=>({...o(it)}));var Z=g(E);ut(Z,()=>t.children??Kt),_(E),_(M),u(V,M)};S(Tt,V=>{t.child?V(Dt):V(Pt,!1)})}u(pt,at)},$$slots:{popper:!0}}))};S(q,O=>{r()?O(B):r()||O(rt,1)})}u(v,N),yt()}var Je=I("<button><!></button>");function Qe(v,t){const e=le();_t(t,!0);let s=f(t,"id",19,()=>ce(e)),n=f(t,"ref",15,null),r=f(t,"type",3,"button"),d=f(t,"disabled",3,!1),i=f(t,"openOnHover",3,!1),p=f(t,"openDelay",3,700),P=f(t,"closeDelay",3,300),y=he(t,["$$slots","$$events","$$legacy","children","child","id","ref","type","disabled","openOnHover","openDelay","closeDelay"]);const a=Rt.create({id:D(()=>s()),ref:D(()=>n(),x=>n(x)),disabled:D(()=>!!d()),openOnHover:D(()=>i()),openDelay:D(()=>p()),closeDelay:D(()=>P())}),l=T(()=>Bt(y,a.props,{type:r()}));Ee(v,{get id(){return s()},get ref(){return a.opts.ref},children:(x,H)=>{var ot=j(),Ct=A(ot);{var wt=q=>{var B=j(),rt=A(B);ut(rt,()=>t.child,()=>({props:o(l)})),u(q,B)},N=q=>{var B=Je();ct(B,()=>({...o(l)}));var rt=g(B);ut(rt,()=>t.children??Kt),_(B),u(q,B)};S(Ct,q=>{t.child?q(wt):q(N,!1)})}u(x,ot)},$$slots:{default:!0}}),yt()}function Re(v,t){_t(t,!0);let e=f(t,"open",15,!1),s=f(t,"onOpenChange",3,xt),n=f(t,"onOpenChangeComplete",3,xt);Qt.create({open:D(()=>e(),r=>{e(r),s()(r)}),onOpenChangeComplete:D(()=>n())}),Se(v,{children:(r,d)=>{var i=j(),p=A(i);ut(p,()=>t.children??Kt),u(r,i)},$$slots:{default:!0}}),yt()}var to=Ot("<title> </title>"),eo=Ot('<svg><!><path d="M17.74,30,16,29l4-7h6a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2H6A2,2,0,0,0,4,8V20a2,2,0,0,0,2,2h9v2H6a4,4,0,0,1-4-4V8A4,4,0,0,1,6,4H26a4,4,0,0,1,4,4V20a4,4,0,0,1-4,4H21.16Z"></path><path d="M8 10H24V12H8z"></path><path d="M8 16H18V18H8z"></path></svg>');function oo(v,t){const e=Vt(t,["children","$$slots","$$events","$$legacy"]),s=Vt(e,["size","title"]);_t(t,!1);const n=Mt(),r=Mt();let d=f(t,"size",8,16),i=f(t,"title",8,void 0);At(()=>(et(e),et(i())),()=>{c(n,e["aria-label"]||e["aria-labelledby"]||i())}),At(()=>(o(n),et(e)),()=>{c(r,{"aria-hidden":o(n)?void 0:!0,role:o(n)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),Gt(),Ut();var p=eo();ct(p,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:d(),height:d(),...o(r),...s}));var P=g(p);{var y=a=>{var l=to(),x=g(l,!0);_(l),dt(()=>Ht(x,i())),u(a,l)};S(P,a=>{i()&&a(y)})}U(3),_(p),u(v,p),yt()}var ro=Ot("<title> </title>"),no=Ot('<svg><!><path d="M10 6H28V8H10z"></path><path d="M10 24H28V26H10z"></path><path d="M10 15H28V17H10z"></path><path d="M4 15H6V17H4z"></path><path d="M4 6H6V8H4z"></path><path d="M4 24H6V26H4z"></path></svg>');function so(v,t){const e=Vt(t,["children","$$slots","$$events","$$legacy"]),s=Vt(e,["size","title"]);_t(t,!1);const n=Mt(),r=Mt();let d=f(t,"size",8,16),i=f(t,"title",8,void 0);At(()=>(et(e),et(i())),()=>{c(n,e["aria-label"]||e["aria-labelledby"]||i())}),At(()=>(o(n),et(e)),()=>{c(r,{"aria-hidden":o(n)?void 0:!0,role:o(n)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),Gt(),Ut();var p=no();ct(p,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:d(),height:d(),...o(r),...s}));var P=g(p);{var y=a=>{var l=ro(),x=g(l,!0);_(l),dt(()=>Ht(x,i())),u(a,l)};S(P,a=>{i()&&a(y)})}U(6),_(p),u(v,p),yt()}var io=Ot("<title> </title>"),ao=Ot('<svg><!><path d="M26,4h-4V2h-2v2h-8V2h-2v2H6C4.9,4,4,4.9,4,6v20c0,1.1,0.9,2,2,2h20c1.1,0,2-0.9,2-2V6C28,4.9,27.1,4,26,4z M26,26H6V12h20 V26z M26,10H6V6h4v2h2V6h8v2h2V6h4V10z"></path></svg>');function lo(v,t){const e=Vt(t,["children","$$slots","$$events","$$legacy"]),s=Vt(e,["size","title"]);_t(t,!1);const n=Mt(),r=Mt();let d=f(t,"size",8,16),i=f(t,"title",8,void 0);At(()=>(et(e),et(i())),()=>{c(n,e["aria-label"]||e["aria-labelledby"]||i())}),At(()=>(o(n),et(e)),()=>{c(r,{"aria-hidden":o(n)?void 0:!0,role:o(n)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),Gt(),Ut();var p=ao();ct(p,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:d(),height:d(),...o(r),...s}));var P=g(p);{var y=a=>{var l=io(),x=g(l,!0);_(l),dt(()=>Ht(x,i())),u(a,l)};S(P,a=>{i()&&a(y)})}U(),_(p),u(v,p),yt()}const ho=Re,uo=Qe,co=Ze;var po=I('<div class="tab active svelte-r6dy5f"><input class="tab-rename-input svelte-r6dy5f"/></div>'),fo=I('<span class="tab-close svelte-r6dy5f" title="Close"><!></span>'),vo=I('<button><span class="tab-label svelte-r6dy5f"> </span> <!></button>'),mo=I('<span class="tab-close svelte-r6dy5f" title="Close"><!></span>'),bo=I('<button><span class="tab-label svelte-r6dy5f"> </span> <!></button>'),go=I("<!> <span>New View</span>",1),_o=I('<button class="add-view-option svelte-r6dy5f"><!> List</button> <button class="add-view-option svelte-r6dy5f"><!> Calendar</button>',1),yo=I("<!> <!>",1),Co=I("<!> <!>",1),wo=I("<!> <!>",1),Po=I("<!> <!>",1),xo=I('<div class="tab-bar svelte-r6dy5f"><div class="tabs-scroll svelte-r6dy5f"><button><span class="tab-label svelte-r6dy5f">Home</span></button> <button><span class="tab-label svelte-r6dy5f">Graph</span></button> <!> <!> <!></div> <div class="bar-right svelte-r6dy5f"><!> <!></div></div> <!>',1);function Bo(v,t){_t(t,!0);let e=f(t,"activeView",3,"entity");const s=me("chat");function n(h){oe(h,{noScroll:!0})}const r=T(()=>tt.selectedId!==null),d=T(()=>{if(!tt.selectedRepo||!tt.selectedId)return"";for(const h of He.repos){if(h.name!==tt.selectedRepo)continue;const m=h.entities.find(C=>C.id===tt.selectedId);if(m)return m.title}return tt.selectedId.replace(/-/g," ").replace(/\b\w/g,h=>h.toUpperCase())});function i(){tt.deselect(),n("/")}let p=F(!1);async function P(h){c(p,!1);const m=h==="calendar"?"Calendar":"List",C=await $t.create(m,h);oe(`/views/${C.id}`)}let y=F(null),a=F(""),l=F(null),x=F(!1);function H(h){c(x,!1),c(y,h.id,!0),c(a,h.name,!0)}be(()=>{o(y)&&o(l)&&(o(l).focus(),o(l).select(),setTimeout(()=>{c(x,!0)},50))});function ot(){o(x)&&(o(y)&&o(a).trim()&&$t.update(o(y),{name:o(a).trim()}),c(y,null),c(x,!1))}function Ct(){c(y,null),c(x,!1)}function wt(h){h.key==="Enter"&&(h.preventDefault(),c(x,!0),ot()),h.key==="Escape"&&(h.preventDefault(),Ct())}let N=F(null);function q(h,m){h.stopPropagation(),c(N,m,!0)}async function B(){o(N)&&(await $t.remove(o(N).id),c(N,null))}var rt=xo(),O=A(rt),kt=g(O),pt=g(kt);let nt;var ft=z(pt,2);let st;var it=z(ft,2);Ce(it,17,()=>$t.views,h=>h.id,(h,m)=>{var C=j(),J=A(C);{var Q=W=>{var k=po(),b=g(k);ge(b),ye(b,w=>c(l,w),()=>o(l)),_(k),dt(w=>_e(b,"size",w),[()=>Math.max(o(a).length,1)]),L("keydown",b,wt),L("input",b,w=>{c(a,w.currentTarget.value,!0)}),ve("blur",b,ot),we(b,()=>o(a),w=>c(a,w)),u(W,k)},R=W=>{const k=T(()=>e()==="view"&&tt.activeViewId===o(m).id);var b=vo();let w;var lt=g(b),$=g(lt,!0);_(lt);var K=z(lt,2);{var It=Y=>{var G=fo(),zt=g(G);re(zt,{size:12}),_(G),L("click",G,Lt=>q(Lt,o(m))),u(Y,G)};S(K,Y=>{o(k)&&Y(It)})}_(b),dt(()=>{w=Wt(b,1,"tab svelte-r6dy5f",null,w,{"tab-permanent":!o(k),active:o(k)}),Ht($,o(m).name)}),L("click",b,()=>n(`/views/${o(m).id}`)),L("dblclick",b,()=>H(o(m))),u(W,b)};S(J,W=>{o(y)===o(m).id?W(Q):W(R,!1)})}u(h,C)});var at=z(it,2);{var Tt=h=>{const m=T(()=>e()==="entity"&&o(r));var C=bo();let J;var Q=g(C),R=g(Q,!0);_(Q);var W=z(Q,2);{var k=b=>{var w=mo(),lt=g(w);re(lt,{size:12}),_(w),L("click",w,$=>{$.stopPropagation(),i()}),u(b,w)};S(W,b=>{o(m)&&b(k)})}_(C),dt(()=>{J=Wt(C,1,"tab svelte-r6dy5f",null,J,{"tab-permanent":!o(m),active:o(m)}),Ht(R,o(d))}),L("click",C,()=>n(tt.entityPath??"/")),u(h,C)};S(at,h=>{o(r)&&h(Tt)})}var Dt=z(at,2);X(Dt,()=>ho,(h,m)=>{m(h,{get open(){return o(p)},set open(C){c(p,C,!0)},children:(C,J)=>{var Q=yo(),R=A(Q);X(R,()=>uo,(k,b)=>{b(k,{class:"new-view-btn",title:"New view",children:(w,lt)=>{var $=go(),K=A($);xe(K,{size:16}),U(2),u(w,$)},$$slots:{default:!0}})});var W=z(R,2);X(W,()=>co,(k,b)=>{b(k,{class:"add-view-menu",sideOffset:4,align:"start",children:(w,lt)=>{var $=_o(),K=A($),It=g(K);so(It,{size:14}),U(),_(K);var Y=z(K,2),G=g(Y);lo(G,{size:14}),U(),_(Y),L("click",K,()=>P("list")),L("click",Y,()=>P("calendar")),u(w,$)},$$slots:{default:!0}})}),u(C,Q)},$$slots:{default:!0}})}),_(kt);var Pt=z(kt,2),V=g(Pt);{var M=h=>{var m=j(),C=A(m);ut(C,()=>t.right),u(h,m)};S(V,h=>{t.right&&h(M)})}var E=z(V,2);{var Z=h=>{Pe(h,{variant:"accent",size:"icon",class:"chat-toggle",title:"Open Agent",get onclick(){return s.toggle},children:(m,C)=>{oo(m,{size:14})},$$slots:{default:!0}})};S(E,h=>{s.open||h(Z)})}_(Pt),_(O);var pe=z(O,2);{let h=T(()=>!!o(N));X(pe,()=>Xe,(m,C)=>{C(m,{get open(){return o(h)},onOpenChange:J=>{J||c(N,null)},children:(J,Q)=>{var R=j(),W=A(R);X(W,()=>Ne,(k,b)=>{b(k,{children:(w,lt)=>{var $=Po(),K=A($);X(K,()=>We,(Y,G)=>{G(Y,{children:(zt,Lt)=>{var Ft=Co(),Et=A(Ft);X(Et,()=>$e,(vt,mt)=>{mt(vt,{children:(bt,jt)=>{U();var ht=Nt("Delete view?");u(bt,ht)},$$slots:{default:!0}})});var Xt=z(Et,2);X(Xt,()=>Be,(vt,mt)=>{mt(vt,{children:(bt,jt)=>{U();var ht=Nt();dt(()=>Ht(ht,`The view "${o(N)?.name??""}" will be permanently deleted.`)),u(bt,ht)},$$slots:{default:!0}})}),u(zt,Ft)},$$slots:{default:!0}})});var It=z(K,2);X(It,()=>Ke,(Y,G)=>{G(Y,{children:(zt,Lt)=>{var Ft=wo(),Et=A(Ft);X(Et,()=>Ye,(vt,mt)=>{mt(vt,{children:(bt,jt)=>{U();var ht=Nt("Cancel");u(bt,ht)},$$slots:{default:!0}})});var Xt=z(Et,2);X(Xt,()=>Le,(vt,mt)=>{mt(vt,{onclick:B,children:(bt,jt)=>{U();var ht=Nt("Delete");u(bt,ht)},$$slots:{default:!0}})}),u(zt,Ft)},$$slots:{default:!0}})}),u(w,$)},$$slots:{default:!0}})}),u(J,R)},$$slots:{default:!0}})})}dt(()=>{nt=Wt(pt,1,"tab tab-permanent svelte-r6dy5f",null,nt,{active:e()==="home"}),st=Wt(ft,1,"tab tab-permanent svelte-r6dy5f",null,st,{active:e()==="graph"})}),L("click",pt,()=>n("/")),L("click",ft,()=>e()!=="graph"&&n("/graph")),u(v,rt),yt()}fe(["click","keydown","input","dblclick"]);export{co as C,ho as R,uo as T,Bo as V,lo as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bB as Le,aE as Ge,e as A,g as U,s as P,aF as ne,bC as wt}from"./DwMoyB6r.js";class Ae{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Ue{constructor(t,n){this.status=t,this.location=n}}class Pe extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function vt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function yt(e){return e.split("%25").map(decodeURI).join("%25")}function bt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function me({href:e}){return e.split("#")[0]}function kt(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 Et(...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 St(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 Rt=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&G.delete(Te(e)),Rt(e,t));const G=new Map;function xt(e,t){const n=Te(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=St(a)),Promise.resolve(new Response(a,i))}return window.fetch(e,t)}function Lt(e,t,n){if(G.size>0){const r=Te(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 Te(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="${Et(...a)}"]`}return r}const At=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Ut(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${Tt(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 _e(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return _e(String.fromCharCode(...l.slice(2).split("-").map(w=>parseInt(w,16))));const d=At.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 _e(l)}).join("")}).join("")}/?$`),params:t}}function Pt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Tt(e){return e.slice(1).split("/").filter(Pt)}function It(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 _e(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ot({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}=Ut(o),u={id:o,exec:h=>{const w=p.exec(h);if(w)return It(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 Xe(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function Me(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const x=globalThis.__sveltekit_1j82w3i?.base??"",Ct=globalThis.__sveltekit_1j82w3i?.assets??x??"",$t="1774935473265",Qe="sveltekit:snapshot",Ze="sveltekit:scroll",et="sveltekit:states",jt="sveltekit:pageurl",B="sveltekit:history",H="sveltekit:navigation",N={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},he=location.origin;function Ie(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 D(){return{x:pageXOffset,y:pageYOffset}}function V(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const He={...N,"":N.hover};function tt(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function nt(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=tt(e)}}function be(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||pe(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),s=r?.origin===he&&e.hasAttribute("download");return{url:r,external:i,target:a,download:s}}function re(e){let t=null,n=null,r=null,a=null,i=null,s=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=V(o,"preload-code")),a===null&&(a=V(o,"preload-data")),t===null&&(t=V(o,"keepfocus")),n===null&&(n=V(o,"noscroll")),i===null&&(i=V(o,"reload")),s===null&&(s=V(o,"replacestate")),o=tt(o);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:He[r??"off"],preload_data:He[a??"off"],keepfocus:l(t),noscroll:l(n),reload:l(i),replace_state:l(s)}}function We(e){const t=Le(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 rt={v:()=>{}};function Nt(){const{set:e,subscribe:t}=Le(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Ct}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const s=(await a.json()).version!==$t;return s&&(e(!0),rt.v(),clearTimeout(n)),s}catch{return!1}}return{subscribe:t,check:r}}function pe(e,t,n){return e.origin!==he||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function cn(e){}const at=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...at];const Dt=new Set([...at]);[...Dt];function qt(e){return e.filter(t=>t!=null)}function Oe(e){return e instanceof Ae||e instanceof Pe?e.status:500}function Vt(e){return e instanceof Pe?e.text:"Internal Error"}let b,W,we;const Bt=Ge.toString().includes("$$")||/function \w+\(\) \{\}/.test(Ge.toString());Bt?(b={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},W={current:null},we={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)}},we=new class{#e=A(!1);get current(){return U(this.#e)}set current(t){P(this.#e,t)}},rt.v=()=>we.current=!0);function ot(e){Object.assign(b,e)}const Je={spanContext(){return Ft},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}},Ft={traceId:"",spanId:"",traceFlags:0},Kt=new Set(["icon","shortcut icon","apple-touch-icon"]),j=Xe(Ze)??{},J=Xe(Qe)??{},$={url:We({}),page:We({}),navigating:Le(null),updated:Nt()};function Ce(e){j[e]=D()}function Gt(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 st(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(x||"/");e&&await e.update()}}function ke(){}let $e,Ee,ae,T,Se,v;const oe=[],se=[];let L=null;function ie(){L?.fork?.then(e=>e?.discard()),L=null}const te=new Map,it=new Set,Mt=new Set,M=new Set;let _={branch:[],error:null,url:null},lt=!1,le=!1,Ye=!0,z=!1,K=!1,ct=!1,Q=!1,je,y,R,I;const ce=new Set;let ve;const ue=new Map;async function hn(e,t,n){globalThis.__sveltekit_1j82w3i?.data&&globalThis.__sveltekit_1j82w3i.data,document.URL!==location.href&&(location.href=location.href),v=e,await e.hooks.init?.(),$e=Ot(e),T=document.documentElement,Se=t,Ee=e.nodes[0],ae=e.nodes[1],Ee(),ae(),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 rn(Se,n)):(await F({type:"enter",url:Ie(v.hash?sn(new URL(location.href)):location.href),replace_state:!0}),a()),nn()}async function Ht(e=!0,t=!0){if(await(ve||=Promise.resolve()),!ve)return;ve=null;const n=I={},r=await Z(_.url,!0);if(ie(),Q&&ue.forEach(({resource:a})=>{a.refresh?.()}),e){const a=b.state,i=r&&await Ve(r);if(!i||n!==I)return;if(i.type==="redirect")return Ne(new URL(i.location,_.url).href,{replaceState:!0},1,n);t||(i.props.page.state=a),ot(i.props.page),_=i.state,Re(),je.$set(i.props)}else Re();await Promise.all([...ue.values()].map(({resource:a})=>a)).catch(ke)}function Re(){oe.length=0,Q=!1}function ut(e){se.some(t=>t?.snapshot)&&(J[e]=se.map(t=>t?.snapshot?.capture()))}function ft(e){J[e]?.forEach((t,n)=>{se[n]?.snapshot?.restore(t)})}function ze(){Ce(y),Me(Ze,j),ut(R),Me(Qe,J)}async function Ne(e,t,n,r){let a;t.invalidateAll&&ie(),await F({type:"goto",url:Ie(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Q=!0,a=[...ue.keys()]),t.invalidate&&t.invalidate.forEach(tn)}}),t.invalidateAll&&ne().then(ne).then(()=>{ue.forEach(({resource:i},s)=>{a?.includes(s)&&i.refresh?.()})})}async function Wt(e){if(e.id!==L?.id){ie();const t={};ce.add(t),L={id:e.id,token:t,promise:Ve({...e,preload:t}).then(n=>(ce.delete(t),n.type==="loaded"&&n.state.error&&ie(),n)),fork:null}}return L.promise}async function ye(e){const t=(await Z(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(n=>n[1]()))}async function dt(e,t,n){_=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(b,e.props.page),je=new v.root({target:t,props:{...e.props,stores:$,components:se},hydrate:n,sync:!1}),await Promise.resolve(),ft(R),n){const a={from:null,to:{params:_.params,route:{id:_.route?.id??null},url:new URL(location.href),scroll:j[y]??D()},willUnload:!1,type:"enter",complete:Promise.resolve()};M.forEach(i=>i(a))}le=!0}function fe({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=vt(e.pathname,o),e.search=e.search;const l={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:i},props:{constructors:qt(n).map(u=>u.node.component),page:Ke(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 De({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:Je,current:Je},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:kt(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}=ht(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 ht(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=le?Lt(r,a.href,t):xt(r,t);return{resolved:a,promise:i}}function Jt(e,t,n,r,a,i){if(Q)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(oe.some(o=>o(new URL(s))))return!0;return!1}function qe(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function Yt(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:Ke(b),constructors:[]}}}async function Ve({id:e,invalidating:t,url:n,params:r,route:a,preload:i}){if(L?.id===e)return ce.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!==de(_.url):!1,p=_.route?a.id!==_.route.id:!1,f=Yt(_.url,n);let u=!1;const h=c.map(async(m,g)=>{if(!m)return;const E=_.branch[g];return m[1]===E?.loader&&!Jt(u,p,d,f,E.universal?.uses,r)?E:(u=!0,De({loader:m[1],url:n,params:r,route:a,parent:async()=>{const O={};for(let C=0;C<g;C+=1)Object.assign(O,(await h[C])?.data);return O},server_data_node:qe(m[0]?{type:"skip"}:null,m[0]?E?.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 Ue)return{type:"redirect",location:g.location};if(ce.has(i))return zt({error:await X(g,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let E=Oe(g),S;if(g instanceof Ae)S=g.body;else{if(await $.updated.check())return await st(),await Y(n);S=await X(g,{params:r,url:n,route:{id:a.id}})}const O=await Xt(m,w,s);return O?fe({url:n,params:r,branch:w.slice(0,O.idx).concat(O.node),status:E,error:S,route:a}):await gt(n,{id:a.id},S,E)}else w.push(void 0);return fe({url:n,params:r,branch:w,status:200,error:null,route:a,form:t?void 0:null})}async function Xt(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 De({loader:Ee,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:qe(i)}),o={node:await ae(),loader:ae,universal:null,server:null,data:null};return fe({url:n,params:a,branch:[s,o],status:e,error:t,route:null})}catch(s){if(s instanceof Ue)return Ne(new URL(s.location,location.href),{},0);throw s}}async function Qt(e){const t=e.href;if(te.has(t))return te.get(t);let n;try{const r=(async()=>{let a=await v.hooks.reroute({url:new URL(e),fetch:async(i,s)=>ht(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})();te.set(t,r),n=await r}catch{te.delete(t);return}return n}async function Z(e,t){if(e&&!pe(e,x,v.hash)){const n=await Qt(e);if(!n)return;const r=Zt(n);for(const a of $e){const i=a.exec(r);if(i)return{id:de(e),invalidating:t,route:a,params:bt(i),url:e}}}}function Zt(e){return yt(v.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(x.length))||"/"}function de(e){return(v.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function pt({url:e,type:t,intent:n,delta:r,event:a,scroll:i}){let s=!1;const o=Fe(_,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 z||it.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=ke,block:d=ke,event:p}){const f=I;I=l;const u=await Z(t,!1),h=e==="enter"?Fe(_,u,t,e):pt({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(),z=!0,le&&h.navigation.type!=="enter"&&$.navigating.set(W.current=h.navigation);let g=u&&await Ve(u);if(!g){if(pe(t,x,v.hash))return await Y(t,i);g=await gt(t,{id:null},await X(new Pe(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 Be({status:500,error:await X(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else g.props.page.status>=400&&await $.updated.check()&&(await st(),await Y(t,i));if(Re(),Ce(w),ut(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,ee={[B]:y+=k,[H]:R+=k,[et]:s};(i?history.replaceState:history.pushState).call(history,ee,"",t),i||Gt(y,R)}const E=u&&L?.id===u.id?L.fork:null;L=null,g.props.page.state=s;let S;if(le){const k=(await Promise.all(Array.from(Mt,q=>q(h.navigation)))).filter(q=>typeof q=="function");if(k.length>0){let q=function(){k.forEach(ge=>{M.delete(ge)})};k.push(q),k.forEach(ge=>{M.add(ge)})}_=g.state,g.props.page&&(g.props.page.url=t);const ee=E&&await E;ee?S=ee.commit():(je.$set(g.props),ot(g.props.page),S=wt?.()),ct=!0}else await dt(g,Se,!1);const{activeElement:O}=document;await S,await ne(),await ne();let C=null;if(Ye){const k=n?n.scroll:a?D():null;k?scrollTo(k.x,k.y):(C=t.hash&&document.getElementById(mt(t)))?C.scrollIntoView():scrollTo(0,0)}const _t=document.activeElement!==O&&document.activeElement!==document.body;!r&&!_t&&on(t,!C),Ye=!0,g.props.page&&Object.assign(b,g.props.page),z=!1,e==="popstate"&&ft(R),h.fulfil(void 0),h.navigation.to&&(h.navigation.to.scroll=D()),M.forEach(k=>k(h.navigation)),$.navigating.set(W.current=null)}async function gt(e,t,n,r,a){return e.origin===he&&e.pathname===location.pathname&&!lt?await Be({status:r,error:n,url:e,route:t}):await Y(e,a)}function en(){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&&(ye(new URL(l.target.href)),a.unobserve(l.target))},{threshold:0});async function i(o,l){const c=nt(o,T),d=c===t.element&&c?.href===t.href&&l>=n;if(!c||d)return;const{url:p,external:f,download:u}=be(c,x,v.hash);if(f||u)return;const h=re(c),w=p&&de(_.url)===de(p);if(!(h.reload||w))if(l<=h.preload_data){t={element:c,href:c.href},n=N.tap;const m=await Z(p,!1);if(!m)return;Wt(m)}else l<=h.preload_code&&(t={element:c,href:c.href},n=l,ye(p))}function s(){a.disconnect();for(const o of T.querySelectorAll("a")){const{url:l,external:c,download:d}=be(o,x,v.hash);if(c||d)continue;const p=re(o);p.reload||(p.preload_code===N.viewport&&a.observe(o),p.preload_code===N.eager&&ye(l))}}M.add(s),s()}function X(e,t){if(e instanceof Ae)return e.body;const n=Oe(e),r=Vt(e);return v.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function pn(e,t={}){return e=new URL(Ie(e)),e.origin!==he?Promise.reject(new Error("goto: invalid URL")):Ne(e,t,0)}function tn(e){if(typeof e=="function")oe.push(e);else{const{href:t}=new URL(e,location.href);oe.push(n=>n.href===t)}}function gn(){return Q=!0,Ht()}function nn(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(ze(),!z){const r=Fe(_,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};it.forEach(i=>i(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&ze()}),navigator.connection?.saveData||en(),T.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=nt(t.composedPath()[0],T);if(!n)return;const{url:r,external:a,target:i,download:s}=be(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=re(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===me(location);if(a||o.reload&&(!p||!d)){pt({url:r,type:"link",event:t})?z=!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(K=!0,Ce(y),e(r),!o.replace_state)return;K=!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(pe(s,x,!1))return;const o=t.target,l=re(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(!xe){if(t.state?.[B]){const n=t.state[B];if(I={},n===y)return;const r=j[n],a=t.state[et]??{},i=new URL(t.state[jt]??location.href),s=t.state[H],o=_.url?me(location)===me(_.url):!1;if(s===R&&(ct||o)){a!==b.state&&(b.state=a),e(i),j[y]=D(),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(!K){const n=new URL(location.href);e(n),v.hash&&location.reload()}}}),addEventListener("hashchange",()=>{K&&(K=!1,history.replaceState({...history.state,[B]:++y,[H]:R},"",location.href))});for(const t of document.querySelectorAll("link"))Kt.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&$.navigating.set(W.current=null)});function e(t){_.url=b.url=t,$.page.set(Ke(b)),$.page.notify()}}async function rn(e,{status:t=200,error:n,node_ids:r,params:a,route:i,server_route:s,data:o,form:l}){lt=!0;const c=new URL(location.href);let d;({params:a={},route:i={id:null}}=await Z(c,!1)||{}),d=$e.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=an(g.uses)),De({loader:v.nodes[w],url:c,params:a,route:i,parent:async()=>{const E={};for(let S=0;S<m;S+=1)Object.assign(E,(await u[S]).data);return E},server_data_node:qe(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=fe({url:c,params:a,branch:h,status:t,error:n,form:l,route:d??null})}catch(u){if(u instanceof Ue){await Y(new URL(u.location,location.href));return}p=await Be({status:Oe(u),error:await X(u,{url:c,params:a,route:i}),url:c,route:i}),e.textContent="",f=!1}p.props.page&&(p.props.page.state={}),await dt(p,e,f)}function an(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}let xe=!1;function on(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=mt(e);if(r&&document.getElementById(r)){const{x:i,y:s}=D();setTimeout(()=>{const o=history.state;xe=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(o,"",e),t&&scrollTo(i,s),xe=!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 Fe(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:D()},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 Ke(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 sn(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function mt(e){let t;if(v.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{hn as a,pn as g,gn as i,cn as l,b as p,$ as s};
|
|
1
|
+
import{bB as Le,aE as Ge,e as A,g as U,s as P,aF as ne,bC as vt}from"./DwMoyB6r.js";class Ae{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Ue{constructor(t,n){this.status=t,this.location=n}}class Pe extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function wt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function yt(e){return e.split("%25").map(decodeURI).join("%25")}function bt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function me({href:e}){return e.split("#")[0]}function kt(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 Et(...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 St(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 Rt=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&G.delete(Te(e)),Rt(e,t));const G=new Map;function xt(e,t){const n=Te(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=St(a)),Promise.resolve(new Response(a,i))}return window.fetch(e,t)}function Lt(e,t,n){if(G.size>0){const r=Te(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 Te(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="${Et(...a)}"]`}return r}const At=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Ut(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${Tt(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 _e(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return _e(String.fromCharCode(...l.slice(2).split("-").map(v=>parseInt(v,16))));const d=At.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 _e(l)}).join("")}).join("")}/?$`),params:t}}function Pt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Tt(e){return e.slice(1).split("/").filter(Pt)}function It(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 _e(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ot({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}=Ut(o),u={id:o,exec:h=>{const v=p.exec(h);if(v)return It(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 Xe(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function Me(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const x=globalThis.__sveltekit_192nf1t?.base??"",Ct=globalThis.__sveltekit_192nf1t?.assets??x??"",$t="1774935861045",Qe="sveltekit:snapshot",Ze="sveltekit:scroll",et="sveltekit:states",jt="sveltekit:pageurl",B="sveltekit:history",H="sveltekit:navigation",N={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},he=location.origin;function Ie(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 D(){return{x:pageXOffset,y:pageYOffset}}function V(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const He={...N,"":N.hover};function tt(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function nt(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=tt(e)}}function be(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||pe(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),s=r?.origin===he&&e.hasAttribute("download");return{url:r,external:i,target:a,download:s}}function re(e){let t=null,n=null,r=null,a=null,i=null,s=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=V(o,"preload-code")),a===null&&(a=V(o,"preload-data")),t===null&&(t=V(o,"keepfocus")),n===null&&(n=V(o,"noscroll")),i===null&&(i=V(o,"reload")),s===null&&(s=V(o,"replacestate")),o=tt(o);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:He[r??"off"],preload_data:He[a??"off"],keepfocus:l(t),noscroll:l(n),reload:l(i),replace_state:l(s)}}function We(e){const t=Le(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 rt={v:()=>{}};function Nt(){const{set:e,subscribe:t}=Le(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Ct}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const s=(await a.json()).version!==$t;return s&&(e(!0),rt.v(),clearTimeout(n)),s}catch{return!1}}return{subscribe:t,check:r}}function pe(e,t,n){return e.origin!==he||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function cn(e){}const at=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...at];const Dt=new Set([...at]);[...Dt];function qt(e){return e.filter(t=>t!=null)}function Oe(e){return e instanceof Ae||e instanceof Pe?e.status:500}function Vt(e){return e instanceof Pe?e.text:"Internal Error"}let b,W,ve;const Bt=Ge.toString().includes("$$")||/function \w+\(\) \{\}/.test(Ge.toString());Bt?(b={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},W={current:null},ve={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)}},ve=new class{#e=A(!1);get current(){return U(this.#e)}set current(t){P(this.#e,t)}},rt.v=()=>ve.current=!0);function ot(e){Object.assign(b,e)}const Je={spanContext(){return Ft},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}},Ft={traceId:"",spanId:"",traceFlags:0},Kt=new Set(["icon","shortcut icon","apple-touch-icon"]),j=Xe(Ze)??{},J=Xe(Qe)??{},$={url:We({}),page:We({}),navigating:Le(null),updated:Nt()};function Ce(e){j[e]=D()}function Gt(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 st(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(x||"/");e&&await e.update()}}function ke(){}let $e,Ee,ae,T,Se,w;const oe=[],se=[];let L=null;function ie(){L?.fork?.then(e=>e?.discard()),L=null}const te=new Map,it=new Set,Mt=new Set,M=new Set;let _={branch:[],error:null,url:null},lt=!1,le=!1,Ye=!0,z=!1,K=!1,ct=!1,Q=!1,je,y,R,I;const ce=new Set;let we;const ue=new Map;async function hn(e,t,n){globalThis.__sveltekit_192nf1t?.data&&globalThis.__sveltekit_192nf1t.data,document.URL!==location.href&&(location.href=location.href),w=e,await e.hooks.init?.(),$e=Ot(e),T=document.documentElement,Se=t,Ee=e.nodes[0],ae=e.nodes[1],Ee(),ae(),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 rn(Se,n)):(await F({type:"enter",url:Ie(w.hash?sn(new URL(location.href)):location.href),replace_state:!0}),a()),nn()}async function Ht(e=!0,t=!0){if(await(we||=Promise.resolve()),!we)return;we=null;const n=I={},r=await Z(_.url,!0);if(ie(),Q&&ue.forEach(({resource:a})=>{a.refresh?.()}),e){const a=b.state,i=r&&await Ve(r);if(!i||n!==I)return;if(i.type==="redirect")return Ne(new URL(i.location,_.url).href,{replaceState:!0},1,n);t||(i.props.page.state=a),ot(i.props.page),_=i.state,Re(),je.$set(i.props)}else Re();await Promise.all([...ue.values()].map(({resource:a})=>a)).catch(ke)}function Re(){oe.length=0,Q=!1}function ut(e){se.some(t=>t?.snapshot)&&(J[e]=se.map(t=>t?.snapshot?.capture()))}function ft(e){J[e]?.forEach((t,n)=>{se[n]?.snapshot?.restore(t)})}function ze(){Ce(y),Me(Ze,j),ut(R),Me(Qe,J)}async function Ne(e,t,n,r){let a;t.invalidateAll&&ie(),await F({type:"goto",url:Ie(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Q=!0,a=[...ue.keys()]),t.invalidate&&t.invalidate.forEach(tn)}}),t.invalidateAll&&ne().then(ne).then(()=>{ue.forEach(({resource:i},s)=>{a?.includes(s)&&i.refresh?.()})})}async function Wt(e){if(e.id!==L?.id){ie();const t={};ce.add(t),L={id:e.id,token:t,promise:Ve({...e,preload:t}).then(n=>(ce.delete(t),n.type==="loaded"&&n.state.error&&ie(),n)),fork:null}}return L.promise}async function ye(e){const t=(await Z(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(n=>n[1]()))}async function dt(e,t,n){_=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(b,e.props.page),je=new w.root({target:t,props:{...e.props,stores:$,components:se},hydrate:n,sync:!1}),await Promise.resolve(),ft(R),n){const a={from:null,to:{params:_.params,route:{id:_.route?.id??null},url:new URL(location.href),scroll:j[y]??D()},willUnload:!1,type:"enter",complete:Promise.resolve()};M.forEach(i=>i(a))}le=!0}function fe({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=wt(e.pathname,o),e.search=e.search;const l={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:i},props:{constructors:qt(n).map(u=>u.node.component),page:Ke(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],v=_.branch[u];h?.data!==v?.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 De({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:Je,current:Je},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:kt(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}=ht(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 ht(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=le?Lt(r,a.href,t):xt(r,t);return{resolved:a,promise:i}}function Jt(e,t,n,r,a,i){if(Q)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(oe.some(o=>o(new URL(s))))return!0;return!1}function qe(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function Yt(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:Ke(b),constructors:[]}}}async function Ve({id:e,invalidating:t,url:n,params:r,route:a,preload:i}){if(L?.id===e)return ce.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!==de(_.url):!1,p=_.route?a.id!==_.route.id:!1,f=Yt(_.url,n);let u=!1;const h=c.map(async(m,g)=>{if(!m)return;const E=_.branch[g];return m[1]===E?.loader&&!Jt(u,p,d,f,E.universal?.uses,r)?E:(u=!0,De({loader:m[1],url:n,params:r,route:a,parent:async()=>{const O={};for(let C=0;C<g;C+=1)Object.assign(O,(await h[C])?.data);return O},server_data_node:qe(m[0]?{type:"skip"}:null,m[0]?E?.server:void 0)}))});for(const m of h)m.catch(()=>{});const v=[];for(let m=0;m<c.length;m+=1)if(c[m])try{v.push(await h[m])}catch(g){if(g instanceof Ue)return{type:"redirect",location:g.location};if(ce.has(i))return zt({error:await X(g,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let E=Oe(g),S;if(g instanceof Ae)S=g.body;else{if(await $.updated.check())return await st(),await Y(n);S=await X(g,{params:r,url:n,route:{id:a.id}})}const O=await Xt(m,v,s);return O?fe({url:n,params:r,branch:v.slice(0,O.idx).concat(O.node),status:E,error:S,route:a}):await gt(n,{id:a.id},S,E)}else v.push(void 0);return fe({url:n,params:r,branch:v,status:200,error:null,route:a,form:t?void 0:null})}async function Xt(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 De({loader:Ee,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:qe(i)}),o={node:await ae(),loader:ae,universal:null,server:null,data:null};return fe({url:n,params:a,branch:[s,o],status:e,error:t,route:null})}catch(s){if(s instanceof Ue)return Ne(new URL(s.location,location.href),{},0);throw s}}async function Qt(e){const t=e.href;if(te.has(t))return te.get(t);let n;try{const r=(async()=>{let a=await w.hooks.reroute({url:new URL(e),fetch:async(i,s)=>ht(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})();te.set(t,r),n=await r}catch{te.delete(t);return}return n}async function Z(e,t){if(e&&!pe(e,x,w.hash)){const n=await Qt(e);if(!n)return;const r=Zt(n);for(const a of $e){const i=a.exec(r);if(i)return{id:de(e),invalidating:t,route:a,params:bt(i),url:e}}}}function Zt(e){return yt(w.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(x.length))||"/"}function de(e){return(w.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function pt({url:e,type:t,intent:n,delta:r,event:a,scroll:i}){let s=!1;const o=Fe(_,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 z||it.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=ke,block:d=ke,event:p}){const f=I;I=l;const u=await Z(t,!1),h=e==="enter"?Fe(_,u,t,e):pt({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,m=R;c(),z=!0,le&&h.navigation.type!=="enter"&&$.navigating.set(W.current=h.navigation);let g=u&&await Ve(u);if(!g){if(pe(t,x,w.hash))return await Y(t,i);g=await gt(t,{id:null},await X(new Pe(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 Be({status:500,error:await X(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else g.props.page.status>=400&&await $.updated.check()&&(await st(),await Y(t,i));if(Re(),Ce(v),ut(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,ee={[B]:y+=k,[H]:R+=k,[et]:s};(i?history.replaceState:history.pushState).call(history,ee,"",t),i||Gt(y,R)}const E=u&&L?.id===u.id?L.fork:null;L=null,g.props.page.state=s;let S;if(le){const k=(await Promise.all(Array.from(Mt,q=>q(h.navigation)))).filter(q=>typeof q=="function");if(k.length>0){let q=function(){k.forEach(ge=>{M.delete(ge)})};k.push(q),k.forEach(ge=>{M.add(ge)})}_=g.state,g.props.page&&(g.props.page.url=t);const ee=E&&await E;ee?S=ee.commit():(je.$set(g.props),ot(g.props.page),S=vt?.()),ct=!0}else await dt(g,Se,!1);const{activeElement:O}=document;await S,await ne(),await ne();let C=null;if(Ye){const k=n?n.scroll:a?D():null;k?scrollTo(k.x,k.y):(C=t.hash&&document.getElementById(mt(t)))?C.scrollIntoView():scrollTo(0,0)}const _t=document.activeElement!==O&&document.activeElement!==document.body;!r&&!_t&&on(t,!C),Ye=!0,g.props.page&&Object.assign(b,g.props.page),z=!1,e==="popstate"&&ft(R),h.fulfil(void 0),h.navigation.to&&(h.navigation.to.scroll=D()),M.forEach(k=>k(h.navigation)),$.navigating.set(W.current=null)}async function gt(e,t,n,r,a){return e.origin===he&&e.pathname===location.pathname&&!lt?await Be({status:r,error:n,url:e,route:t}):await Y(e,a)}function en(){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&&(ye(new URL(l.target.href)),a.unobserve(l.target))},{threshold:0});async function i(o,l){const c=nt(o,T),d=c===t.element&&c?.href===t.href&&l>=n;if(!c||d)return;const{url:p,external:f,download:u}=be(c,x,w.hash);if(f||u)return;const h=re(c),v=p&&de(_.url)===de(p);if(!(h.reload||v))if(l<=h.preload_data){t={element:c,href:c.href},n=N.tap;const m=await Z(p,!1);if(!m)return;Wt(m)}else l<=h.preload_code&&(t={element:c,href:c.href},n=l,ye(p))}function s(){a.disconnect();for(const o of T.querySelectorAll("a")){const{url:l,external:c,download:d}=be(o,x,w.hash);if(c||d)continue;const p=re(o);p.reload||(p.preload_code===N.viewport&&a.observe(o),p.preload_code===N.eager&&ye(l))}}M.add(s),s()}function X(e,t){if(e instanceof Ae)return e.body;const n=Oe(e),r=Vt(e);return w.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function pn(e,t={}){return e=new URL(Ie(e)),e.origin!==he?Promise.reject(new Error("goto: invalid URL")):Ne(e,t,0)}function tn(e){if(typeof e=="function")oe.push(e);else{const{href:t}=new URL(e,location.href);oe.push(n=>n.href===t)}}function gn(){return Q=!0,Ht()}function nn(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(ze(),!z){const r=Fe(_,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};it.forEach(i=>i(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&ze()}),navigator.connection?.saveData||en(),T.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=nt(t.composedPath()[0],T);if(!n)return;const{url:r,external:a,target:i,download:s}=be(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=re(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===me(location);if(a||o.reload&&(!p||!d)){pt({url:r,type:"link",event:t})?z=!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(K=!0,Ce(y),e(r),!o.replace_state)return;K=!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(pe(s,x,!1))return;const o=t.target,l=re(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(!xe){if(t.state?.[B]){const n=t.state[B];if(I={},n===y)return;const r=j[n],a=t.state[et]??{},i=new URL(t.state[jt]??location.href),s=t.state[H],o=_.url?me(location)===me(_.url):!1;if(s===R&&(ct||o)){a!==b.state&&(b.state=a),e(i),j[y]=D(),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(!K){const n=new URL(location.href);e(n),w.hash&&location.reload()}}}),addEventListener("hashchange",()=>{K&&(K=!1,history.replaceState({...history.state,[B]:++y,[H]:R},"",location.href))});for(const t of document.querySelectorAll("link"))Kt.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&$.navigating.set(W.current=null)});function e(t){_.url=b.url=t,$.page.set(Ke(b)),$.page.notify()}}async function rn(e,{status:t=200,error:n,node_ids:r,params:a,route:i,server_route:s,data:o,form:l}){lt=!0;const c=new URL(location.href);let d;({params:a={},route:i={id:null}}=await Z(c,!1)||{}),d=$e.find(({id:u})=>u===i.id);let p,f=!0;try{const u=r.map(async(v,m)=>{const g=o[m];return g?.uses&&(g.uses=an(g.uses)),De({loader:w.nodes[v],url:c,params:a,route:i,parent:async()=>{const E={};for(let S=0;S<m;S+=1)Object.assign(E,(await u[S]).data);return E},server_data_node:qe(g)})}),h=await Promise.all(u);if(d){const v=d.layouts;for(let m=0;m<v.length;m++)v[m]||h.splice(m,0,void 0)}p=fe({url:c,params:a,branch:h,status:t,error:n,form:l,route:d??null})}catch(u){if(u instanceof Ue){await Y(new URL(u.location,location.href));return}p=await Be({status:Oe(u),error:await X(u,{url:c,params:a,route:i}),url:c,route:i}),e.textContent="",f=!1}p.props.page&&(p.props.page.state={}),await dt(p,e,f)}function an(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}let xe=!1;function on(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=mt(e);if(r&&document.getElementById(r)){const{x:i,y:s}=D();setTimeout(()=>{const o=history.state;xe=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(o,"",e),t&&scrollTo(i,s),xe=!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 Fe(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:D()},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 Ke(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 sn(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function mt(e){let t;if(w.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{hn as a,pn as g,gn as i,cn as l,b as p,$ as s};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as h,f as U,s as a,g as t,av as x}from"./DwMoyB6r.js";import{i as L,g as V}from"./
|
|
1
|
+
import{e as h,f as U,s as a,g as t,av as x}from"./DwMoyB6r.js";import{i as L,g as V}from"./Drutqki6.js";import{n as y}from"./DiQyiOFg.js";import{w as W}from"./C88BjBh_.js";function X(g,c,o){fetch("/api/chat/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g),signal:o}).then(async n=>{if(!n.ok){c({type:"error",message:`HTTP ${n.status}`});return}const r=n.body?.getReader();if(!r){c({type:"error",message:"No response body"});return}const p=new TextDecoder;let m="";for(;;){const{done:k,value:O}=await r.read();if(k)break;m+=p.decode(O,{stream:!0});const A=m.split(`
|
|
2
2
|
`);m=A.pop()??"";for(const C of A)if(C.startsWith("data: "))try{const f=JSON.parse(C.slice(6));c(f)}catch{}}}).catch(n=>{n.name!=="AbortError"&&c({type:"error",message:n.message})})}const D="sg-chat-sessions",J="sg-chat-version",z=14;function b(){try{const g=localStorage.getItem(D);if(!g)return[];if(localStorage.getItem(J)==="2")return JSON.parse(g);const n=JSON.parse(g).map(r=>({id:crypto.randomUUID(),createdAt:r.date+"T00:00:00.000Z",updatedAt:r.date+"T00:00:00.000Z",title:r.messages.find(p=>p.role==="user")?.content.slice(0,50)||"New chat",messages:r.messages}));return localStorage.setItem(D,JSON.stringify(n)),localStorage.setItem(J,"2"),n}catch{return[]}}function _(g){const o=[...g].sort((n,r)=>r.updatedAt.localeCompare(n.updatedAt)).slice(0,z);try{localStorage.setItem(D,JSON.stringify(o)),localStorage.setItem(J,"2")}catch{}}function N(g,c){const o=b(),n=c.map(({streaming:p,...m})=>m),r=o.findIndex(p=>p.id===g);r>=0&&(o[r].messages=n,o[r].updatedAt=new Date().toISOString()),_(o)}function B(){const c=b().sort((e,i)=>i.updatedAt.localeCompare(e.updatedAt))[0];let o=h(U(c?c.messages.map(e=>({...e,streaming:!1})):[])),n=h(U(c?.id??null)),r=h(!1),p=h(0),m=h(0),k=h(0),O=h(null),A=null,C=h(""),f=h(U(!!c));const R=new Set(["create_entity","update_entity","delete_entity","move_entity"]);function M(){$();const e=crypto.randomUUID();a(n,e,!0),a(o,[],!0),a(f,!1)}function E(){if(t(n)&&t(f))return t(n);const e=t(n)||crypto.randomUUID();a(n,e,!0);const i=new Date().toISOString(),d=b();return d.push({id:e,createdAt:i,updatedAt:i,title:"New chat",messages:[]}),_(d),a(f,!0),e}function K(e){if(!e.trim()||t(r))return;a(O,null);const i=E();t(o).push({role:"user",content:e}),t(o).push({role:"agent",content:"",segments:[],streaming:!0}),a(r,!0);const d=b(),l=d.find(s=>s.id===i);l&&l.title==="New chat"&&(l.title=e.slice(0,50),_(d)),N(i,t(o));let T=!1,w=null;A=new AbortController;const G=y.selectedSubPath?`${y.selectedRepo}/${y.selectedType}/${y.selectedId}/${y.selectedSubPath}`:y.selectedId?`${y.selectedRepo}/${y.selectedType}/${y.selectedId}`:null,P=t(o).slice(0,-2).map(s=>({role:s.role==="agent"?"assistant":s.role,content:s.content})),H={message:e,context:G??void 0,sessionId:i,history:P.length>0?P:void 0};X(H,s=>{if(!t(r))return;const u=t(o)[t(o).length-1];if(!u||u.role!=="agent")return;const S=u.segments;switch(s.type){case"token":{u.content+=s.text??"";const I=S[S.length-1];I&&I.type==="text"?I.content+=s.text??"":S.push({type:"text",content:s.text??""}),u.segments=S,x(m);break}case"tool_start":if(s.name){R.has(s.name)&&(T=!0);const I=S[S.length-1];I&&I.type==="tools"?I.names=[...I.names,s.name]:S.push({type:"tools",names:[s.name]}),u.segments=S,x(m)}break;case"mutation":T=!0,s.action==="created"&&s.repo&&s.entityType&&s.entityId&&(w={repo:s.repo,entityType:s.entityType,entityId:s.entityId}),window.StudioChrome?.emitMutation?.({action:s.action,repo:s.repo,entityType:s.entityType,entityId:s.entityId});break;case"highlight":a(O,s.entityIds&&s.entityIds.length>0?new Set(s.entityIds):null,!0);break;case"done":s.message&&!u.content&&(u.content=s.message,u.segments=[{type:"text",content:s.message}]),u.streaming=!1,a(r,!1),N(i,t(o)),T&&(L().then(()=>{x(p)}),W.refreshAll().then(()=>{w&&V(`/${w.repo}/${w.entityType}/${w.entityId}`)}));break;case"error":u.content+=`
|
|
3
3
|
|
|
4
4
|
Error: ${s.message}`,u.streaming=!1,a(r,!1),N(i,t(o));break}},A.signal)}function $(){if(!t(r))return;fetch("/api/chat/abort",{method:"POST",credentials:"include"}).catch(()=>{}),A?.abort(),A=null,a(r,!1);const e=t(o)[t(o).length-1];e?.streaming&&(e.streaming=!1,t(n)&&N(t(n),t(o)))}function Y(){$(),a(o,[],!0),t(n)&&t(f)&&N(t(n),t(o))}function Z(e){const d=b().filter(l=>l.id!==e);if(_(d),t(n)===e){const l=d.sort((T,w)=>w.updatedAt.localeCompare(T.updatedAt));l.length>0?(a(n,l[0].id,!0),a(o,l[0].messages.map(T=>({...T,streaming:!1})),!0),a(f,!0)):(a(n,null),a(o,[],!0),a(f,!1))}}function j(e){const d=b().find(l=>l.id===e);d&&($(),a(n,d.id,!0),a(o,d.messages.map(l=>({...l,streaming:!1})),!0),a(f,!0))}function q(){return b().sort((e,i)=>i.updatedAt.localeCompare(e.updatedAt)).map(e=>({id:e.id,title:e.title,createdAt:e.createdAt,updatedAt:e.updatedAt,preview:e.messages.find(i=>i.role==="user")?.content.slice(0,80)||"",count:e.messages.length,active:e.id===t(n)}))}return{get messages(){return t(o)},get streaming(){return t(r)},get mutationCount(){return t(p)},get scrollTick(){return t(m)},get forceScroll(){return t(k)},triggerScroll(){x(k)},get highlightedIds(){return t(O)},get activeSessionId(){return t(n)},get draftInput(){return t(C)},set draftInput(e){a(C,e,!0)},send:K,stop:$,clear:Y,newSession:M,deleteSession:Z,getSessions:q,loadSession:j}}const te=B();export{te as chatStore};
|
|
@@ -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"./CN0DHWaX.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as A}from"./
|
|
1
|
+
import{s as A}from"./Drutqki6.js";import{a as f,s as M,f as x}from"./S3zzfNyy.js";import{i as k}from"./CkRzikAP.js";import{p as B,l as u,s as b,d as p,g as o,a as C,c as g,n as N,r as m,b as P,m as _,t as R}from"./DwMoyB6r.js";import{i as S}from"./DVe5EzgB.js";import{a as Y}from"./BYqzpKy3.js";import{l as v,p as h}from"./DLfZVgnp.js";const j=()=>{const e=A;return{page:{subscribe:e.page.subscribe},navigating:{subscribe:e.navigating.subscribe},updated:e.updated}},L={subscribe(e){return j().page.subscribe(e)}};var q=x("<title> </title>"),D=x('<svg><!><path d="M17 15 17 8 15 8 15 15 8 15 8 17 15 17 15 24 17 24 17 17 24 17 24 15z"></path></svg>');function O(e,s){const t=v(s,["children","$$slots","$$events","$$legacy"]),w=v(t,["size","title"]);B(s,!1);const a=_(),c=_();let d=h(s,"size",8,16),r=h(s,"title",8,void 0);u(()=>(p(t),p(r())),()=>{b(a,t["aria-label"]||t["aria-labelledby"]||r())}),u(()=>(o(a),p(t)),()=>{b(c,{"aria-hidden":o(a)?void 0:!0,role:o(a)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),C(),k();var i=D();Y(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:d(),height:d(),...o(c),...w}));var y=g(i);{var z=n=>{var l=q(),$=g(l,!0);m(l),R(()=>M($,r())),f(n,l)};S(y,n=>{r()&&n(z)})}N(),m(i),f(e,i),P()}export{O as A,L as p};
|