studiograph 1.3.18 → 1.3.19
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/chunks/CIZkRAuY.js +1 -0
- package/dist/web/_app/immutable/chunks/{buWG8Dmo.js → CnKc_Tae.js} +1 -1
- package/dist/web/_app/immutable/chunks/DKIqe64p.js +64 -0
- package/dist/web/_app/immutable/chunks/{BnR489ON.js → DVuLyxG5.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DPUtMAph.js → Scb_NG-a.js} +1 -1
- package/dist/web/_app/immutable/chunks/{Co733CqR.js → glgUBDR2.js} +1 -1
- package/dist/web/_app/immutable/entry/{app.C2utD9VR.js → app.DjTkwlaQ.js} +2 -2
- package/dist/web/_app/immutable/entry/start.Bupokdng.js +1 -0
- package/dist/web/_app/immutable/nodes/{0.DuPJX0GV.js → 0.Q3C-jhjE.js} +1 -1
- package/dist/web/_app/immutable/nodes/{1.Dt07KQlA.js → 1.BPCfgPXb.js} +1 -1
- package/dist/web/_app/immutable/nodes/{2.Bnr_OdSr.js → 2.Bdsd2uts.js} +1 -1
- package/dist/web/_app/immutable/nodes/{3.BykUKLNZ.js → 3.Doh56lgy.js} +3 -3
- package/dist/web/_app/immutable/nodes/{4.0CDHy-v0.js → 4.CD5YzRYT.js} +1 -1
- package/dist/web/_app/immutable/nodes/{5.BKd9g3uI.js → 5.DN4bEWf-.js} +1 -1
- package/dist/web/_app/immutable/nodes/{6.DMZp6xfS.js → 6.BfA9chPb.js} +1 -1
- package/dist/web/_app/immutable/nodes/{7.B9Bv_Jv7.js → 7.DhU0-U33.js} +1 -1
- package/dist/web/_app/immutable/nodes/{8.CbGhzI30.js → 8.wSRycWoC.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/chunks/BeqErRmy.js +0 -1
- package/dist/web/_app/immutable/chunks/CSTvkpxy.js +0 -64
- package/dist/web/_app/immutable/entry/start.CxneN6NR.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aF as me,bx as yt,R as ze,F as A,g as U,D as P,S as re,by as bt}from"./8FUQuwgM.js";const V=[];function Ue(e,t=me){let n=null;const r=new Set;function a(o){if(yt(e,o)&&(e=o,n)){const l=!V.length;for(const c of r)c[1](),V.push(c,e);if(l){for(let c=0;c<V.length;c+=2)V[c][0](V[c+1]);V.length=0}}}function i(o){a(o(e))}function s(o,l=me){const c=[o,l];return r.add(c),r.size===1&&(n=t(a,i)||me),o(e),()=>{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:a,update:i,subscribe:s}}class Pe{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Te{constructor(t,n){this.status=t,this.location=n}}class Ie extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function kt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function St(e){return e.split("%25").map(decodeURI).join("%25")}function Et(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function we({href:e}){return e.split("#")[0]}function Rt(e,t,n,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(s,o){if(o==="get"||o==="getAll"||o==="has")return(c,...d)=>(n(c),s[o](c,...d));t();const l=Reflect.get(s,o);return typeof l=="function"?l.bind(s):l}}),enumerable:!0,configurable:!0});const i=["href","pathname","search","toString","toJSON"];r&&i.push("hash");for(const s of i)Object.defineProperty(a,s,{get(){return t(),e[s]},enumerable:!0,configurable:!0});return a}function xt(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;new TextDecoder;function Lt(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const At=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&M.delete(Oe(e)),At(e,t));const M=new Map;function Ut(e,t){const n=Oe(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...i}=JSON.parse(r.textContent);const s=r.getAttribute("data-ttl");return s&&M.set(n,{body:a,init:i,ttl:1e3*Number(s)}),r.getAttribute("data-b64")!==null&&(a=Lt(a)),Promise.resolve(new Response(a,i))}return window.fetch(e,t)}function Pt(e,t,n){if(M.size>0){const r=Oe(e,n),a=M.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(a.body,a.init);M.delete(r)}}return window.fetch(t,n)}function Oe(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${xt(...a)}"]`}return r}const Tt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function It(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${$t(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const i=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(i)return t.push({name:i[1],matcher:i[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const s=r.split(/\[(.+?)\](?!\])/);return"/"+s.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return ve(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return ve(String.fromCharCode(...l.slice(2).split("-").map(w=>parseInt(w,16))));const d=Tt.exec(l),[,p,f,u,h]=d;return t.push({name:u,matcher:h,optional:!!p,rest:!!f,chained:f?c===1&&s[0]==="":!1}),f?"([^]*?)":p?"([^/]*)?":"([^/]+?)"}return ve(l)}).join("")}).join("")}/?$`),params:t}}function Ot(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function $t(e){return e.slice(1).split("/").filter(Ot)}function Ct(e,t,n){const r={},a=e.slice(1),i=a.filter(o=>o!==void 0);let s=0;for(let o=0;o<t.length;o+=1){const l=t[o];let c=a[o-s];if(l.chained&&l.rest&&s&&(c=a.slice(o-s,o+1).filter(d=>d).join("/"),s=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||n[l.matcher](c)){r[l.name]=c;const d=t[o+1],p=a[o+1];d&&!d.rest&&d.optional&&p&&l.chained&&(s=0),!d&&!p&&Object.keys(r).length===i.length&&(s=0);continue}if(l.optional&&l.chained){s++;continue}return}if(!s)return r}function ve(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function jt({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[l,c,d]])=>{const{pattern:p,params:f}=It(o),u={id:o,exec:h=>{const w=p.exec(h);if(w)return Ct(w,f,r)},errors:[1,...d||[]].map(h=>e[h]),layouts:[0,...c||[]].map(s),leaf:i(l)};return u.errors.length=u.layouts.length=Math.max(u.errors.length,u.layouts.length),u});function i(o){const l=o<0;return l&&(o=~o),[l,e[o]]}function s(o){return o===void 0?o:[a.has(o),e[o]]}}function Ze(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function He(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const x=globalThis.__sveltekit_1pig9nf?.base??"",Nt=globalThis.__sveltekit_1pig9nf?.assets??x??"",qt="1774404347759",et="sveltekit:snapshot",tt="sveltekit:scroll",nt="sveltekit:states",Dt="sveltekit:pageurl",B="sveltekit:history",H="sveltekit:navigation",N={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},pe=location.origin;function $e(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function q(){return{x:pageXOffset,y:pageYOffset}}function F(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const We={...N,"":N.hover};function rt(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function at(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=rt(e)}}function Se(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";r.hash=`#${o}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,i=!r||!!a||ge(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),s=r?.origin===pe&&e.hasAttribute("download");return{url:r,external:i,target:a,download:s}}function ae(e){let t=null,n=null,r=null,a=null,i=null,s=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=F(o,"preload-code")),a===null&&(a=F(o,"preload-data")),t===null&&(t=F(o,"keepfocus")),n===null&&(n=F(o,"noscroll")),i===null&&(i=F(o,"reload")),s===null&&(s=F(o,"replacestate")),o=rt(o);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:We[r??"off"],preload_data:We[a??"off"],keepfocus:l(t),noscroll:l(n),reload:l(i),replace_state:l(s)}}function Je(e){const t=Ue(e);let n=!0;function r(){n=!0,t.update(s=>s)}function a(s){n=!1,t.set(s)}function i(s){let o;return t.subscribe(l=>{(o===void 0||n&&l!==o)&&s(o=l)})}return{notify:r,set:a,subscribe:i}}const ot={v:()=>{}};function Vt(){const{set:e,subscribe:t}=Ue(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Nt}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const s=(await a.json()).version!==qt;return s&&(e(!0),ot.v(),clearTimeout(n)),s}catch{return!1}}return{subscribe:t,check:r}}function ge(e,t,n){return e.origin!==pe||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function dn(e){}const st=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...st];const Ft=new Set([...st]);[...Ft];function Bt(e){return e.filter(t=>t!=null)}function Ce(e){return e instanceof Pe||e instanceof Ie?e.status:500}function Kt(e){return e instanceof Ie?e.text:"Internal Error"}let b,W,ye;const Gt=ze.toString().includes("$$")||/function \w+\(\) \{\}/.test(ze.toString());Gt?(b={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},W={current:null},ye={current:!1}):(b=new class{#e=A({});get data(){return U(this.#e)}set data(t){P(this.#e,t)}#t=A(null);get form(){return U(this.#t)}set form(t){P(this.#t,t)}#n=A(null);get error(){return U(this.#n)}set error(t){P(this.#n,t)}#r=A({});get params(){return U(this.#r)}set params(t){P(this.#r,t)}#a=A({id:null});get route(){return U(this.#a)}set route(t){P(this.#a,t)}#o=A({});get state(){return U(this.#o)}set state(t){P(this.#o,t)}#s=A(-1);get status(){return U(this.#s)}set status(t){P(this.#s,t)}#i=A(new URL("https://example.com"));get url(){return U(this.#i)}set url(t){P(this.#i,t)}},W=new class{#e=A(null);get current(){return U(this.#e)}set current(t){P(this.#e,t)}},ye=new class{#e=A(!1);get current(){return U(this.#e)}set current(t){P(this.#e,t)}},ot.v=()=>ye.current=!0);function it(e){Object.assign(b,e)}const Ye={spanContext(){return Mt},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},Mt={traceId:"",spanId:"",traceFlags:0},zt=new Set(["icon","shortcut icon","apple-touch-icon"]),j=Ze(tt)??{},J=Ze(et)??{},C={url:Je({}),page:Je({}),navigating:Ue(null),updated:Vt()};function je(e){j[e]=q()}function Ht(e,t){let n=e+1;for(;j[n];)delete j[n],n+=1;for(n=t+1;J[n];)delete J[n],n+=1}function Y(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function lt(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(x||"/");e&&await e.update()}}function Ee(){}let Ne,Re,oe,T,xe,v;const se=[],ie=[];let L=null;function le(){L?.fork?.then(e=>e?.discard()),L=null}const ne=new Map,ct=new Set,Wt=new Set,z=new Set;let m={branch:[],error:null,url:null},ut=!1,ce=!1,Xe=!0,X=!1,G=!1,ft=!1,Z=!1,qe,y,R,I;const ue=new Set;let be;const fe=new Map;async function _n(e,t,n){globalThis.__sveltekit_1pig9nf?.data&&globalThis.__sveltekit_1pig9nf.data,document.URL!==location.href&&(location.href=location.href),v=e,await e.hooks.init?.(),Ne=jt(e),T=document.documentElement,xe=t,Re=e.nodes[0],oe=e.nodes[1],Re(),oe(),y=history.state?.[B],R=history.state?.[H],y||(y=R=Date.now(),history.replaceState({...history.state,[B]:y,[H]:R},""));const r=j[y];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await sn(xe,n)):(await K({type:"enter",url:$e(v.hash?un(new URL(location.href)):location.href),replace_state:!0}),a()),on()}async function Jt(e=!0,t=!0){if(await(be||=Promise.resolve()),!be)return;be=null;const n=I={},r=await ee(m.url,!0);if(le(),Z&&fe.forEach(({resource:a})=>{a.refresh?.()}),e){const a=b.state,i=r&&await Be(r);if(!i||n!==I)return;if(i.type==="redirect")return De(new URL(i.location,m.url).href,{replaceState:!0},1,n);t||(i.props.page.state=a),it(i.props.page),m=i.state,Le(),qe.$set(i.props)}else Le();await Promise.all([...fe.values()].map(({resource:a})=>a)).catch(Ee)}function Le(){se.length=0,Z=!1}function dt(e){ie.some(t=>t?.snapshot)&&(J[e]=ie.map(t=>t?.snapshot?.capture()))}function ht(e){J[e]?.forEach((t,n)=>{ie[n]?.snapshot?.restore(t)})}function Qe(){je(y),He(tt,j),dt(R),He(et,J)}async function De(e,t,n,r){let a;t.invalidateAll&&le(),await K({type:"goto",url:$e(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Z=!0,a=[...fe.keys()]),t.invalidate&&t.invalidate.forEach(an)}}),t.invalidateAll&&re().then(re).then(()=>{fe.forEach(({resource:i},s)=>{a?.includes(s)&&i.refresh?.()})})}async function Yt(e){if(e.id!==L?.id){le();const t={};ue.add(t),L={id:e.id,token:t,promise:Be({...e,preload:t}).then(n=>(ue.delete(t),n.type==="loaded"&&n.state.error&&le(),n)),fork:null}}return L.promise}async function ke(e){const t=(await ee(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(n=>n[1]()))}async function pt(e,t,n){m=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(b,e.props.page),qe=new v.root({target:t,props:{...e.props,stores:C,components:ie},hydrate:n,sync:!1}),await Promise.resolve(),ht(R),n){const a={from:null,to:{params:m.params,route:{id:m.route?.id??null},url:new URL(location.href),scroll:j[y]??q()},willUnload:!1,type:"enter",complete:Promise.resolve()};z.forEach(i=>i(a))}ce=!0}function de({url:e,params:t,branch:n,status:r,error:a,route:i,form:s}){let o="never";if(x&&(e.pathname===x||e.pathname===x+"/"))o="always";else for(const u of n)u?.slash!==void 0&&(o=u.slash);e.pathname=kt(e.pathname,o),e.search=e.search;const l={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:i},props:{constructors:Bt(n).map(u=>u.node.component),page:Me(b)}};s!==void 0&&(l.props.form=s);let c={},d=!b,p=0;for(let u=0;u<Math.max(n.length,m.branch.length);u+=1){const h=n[u],w=m.branch[u];h?.data!==w?.data&&(d=!0),h&&(c={...c,...h.data},d&&(l.props[`data_${p}`]=c),p+=1)}return(!m.url||e.href!==m.url.href||m.error!==a||s!==void 0&&s!==b.form||d)&&(l.props.page={error:a,params:t,route:{id:i?.id??null},state:{},status:r,url:new URL(e),form:s??null,data:d?c:b.data}),l}async function Ve({loader:e,parent:t,url:n,params:r,route:a,server_data_node:i}){let s=null,o=!0;const l={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},c=await e();if(c.universal?.load){let d=function(...f){for(const u of f){const{href:h}=new URL(u,n);l.dependencies.add(h)}};const p={tracing:{enabled:!1,root:Ye,current:Ye},route:new Proxy(a,{get:(f,u)=>(o&&(l.route=!0),f[u])}),params:new Proxy(r,{get:(f,u)=>(o&&l.params.add(u),f[u])}),data:i?.data??null,url:Rt(n,()=>{o&&(l.url=!0)},f=>{o&&l.search_params.add(f)},v.hash),async fetch(f,u){f instanceof Request&&(u={body:f.method==="GET"||f.method==="HEAD"?void 0:await f.blob(),cache:f.cache,credentials:f.credentials,headers:[...f.headers].length>0?f?.headers:void 0,integrity:f.integrity,keepalive:f.keepalive,method:f.method,mode:f.mode,redirect:f.redirect,referrer:f.referrer,referrerPolicy:f.referrerPolicy,signal:f.signal,...u});const{resolved:h,promise:w}=gt(f,u,n);return o&&d(h.href),w},setHeaders:()=>{},depends:d,parent(){return o&&(l.parent=!0),t()},untrack(f){o=!1;try{return f()}finally{o=!0}}};s=await c.universal.load.call(null,p)??null}return{node:c,loader:e,server:i,universal:c.universal?.load?{type:"data",data:s,uses:l}:null,data:s??i?.data??null,slash:c.universal?.trailingSlash??i?.slash}}function gt(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const i=ce?Pt(r,a.href,t):Ut(r,t);return{resolved:a,promise:i}}function Xt(e,t,n,r,a,i){if(Z)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const s of a.search_params)if(r.has(s))return!0;for(const s of a.params)if(i[s]!==m.params[s])return!0;for(const s of a.dependencies)if(se.some(o=>o(new URL(s))))return!0;return!1}function Fe(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function Qt(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),i=t.searchParams.getAll(r);a.every(s=>i.includes(s))&&i.every(s=>a.includes(s))&&n.delete(r)}return n}function Zt({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:Me(b),constructors:[]}}}async function Be({id:e,invalidating:t,url:n,params:r,route:a,preload:i}){if(L?.id===e)return ue.delete(L.token),L.promise;const{errors:s,layouts:o,leaf:l}=a,c=[...o,l];s.forEach(_=>_?.().catch(()=>{})),c.forEach(_=>_?.[1]().catch(()=>{}));const d=m.url?e!==he(m.url):!1,p=m.route?a.id!==m.route.id:!1,f=Qt(m.url,n);let u=!1;const h=c.map(async(_,g)=>{if(!_)return;const S=m.branch[g];return _[1]===S?.loader&&!Xt(u,p,d,f,S.universal?.uses,r)?S:(u=!0,Ve({loader:_[1],url:n,params:r,route:a,parent:async()=>{const O={};for(let $=0;$<g;$+=1)Object.assign(O,(await h[$])?.data);return O},server_data_node:Fe(_[0]?{type:"skip"}:null,_[0]?S?.server:void 0)}))});for(const _ of h)_.catch(()=>{});const w=[];for(let _=0;_<c.length;_+=1)if(c[_])try{w.push(await h[_])}catch(g){if(g instanceof Te)return{type:"redirect",location:g.location};if(ue.has(i))return Zt({error:await Q(g,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let S=Ce(g),E;if(g instanceof Pe)E=g.body;else{if(await C.updated.check())return await lt(),await Y(n);E=await Q(g,{params:r,url:n,route:{id:a.id}})}const O=await en(_,w,s);return O?de({url:n,params:r,branch:w.slice(0,O.idx).concat(O.node),status:S,error:E,route:a}):await mt(n,{id:a.id},E,S)}else w.push(void 0);return de({url:n,params:r,branch:w,status:200,error:null,route:a,form:t?void 0:null})}async function en(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function Ke({status:e,error:t,url:n,route:r}){const a={};let i=null;try{const s=await Ve({loader:Re,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Fe(i)}),o={node:await oe(),loader:oe,universal:null,server:null,data:null};return de({url:n,params:a,branch:[s,o],status:e,error:t,route:null})}catch(s){if(s instanceof Te)return De(new URL(s.location,location.href),{},0);throw s}}async function tn(e){const t=e.href;if(ne.has(t))return ne.get(t);let n;try{const r=(async()=>{let a=await v.hooks.reroute({url:new URL(e),fetch:async(i,s)=>gt(i,s,e).promise})??e;if(typeof a=="string"){const i=new URL(e);v.hash?i.hash=a:i.pathname=a,a=i}return a})();ne.set(t,r),n=await r}catch{ne.delete(t);return}return n}async function ee(e,t){if(e&&!ge(e,x,v.hash)){const n=await tn(e);if(!n)return;const r=nn(n);for(const a of Ne){const i=a.exec(r);if(i)return{id:he(e),invalidating:t,route:a,params:Et(i),url:e}}}}function nn(e){return St(v.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(x.length))||"/"}function he(e){return(v.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function _t({url:e,type:t,intent:n,delta:r,event:a,scroll:i}){let s=!1;const o=Ge(m,n,e,t,i??null);r!==void 0&&(o.navigation.delta=r),a!==void 0&&(o.navigation.event=a);const l={...o.navigation,cancel:()=>{s=!0,o.reject(new Error("navigation cancelled"))}};return X||ct.forEach(c=>c(l)),s?null:o}async function K({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s={},redirect_count:o=0,nav_token:l={},accept:c=Ee,block:d=Ee,event:p}){const f=I;I=l;const u=await ee(t,!1),h=e==="enter"?Ge(m,u,t,e):_t({url:t,type:e,delta:n?.delta,intent:u,scroll:n?.scroll,event:p});if(!h){d(),I===l&&(I=f);return}const w=y,_=R;c(),X=!0,ce&&h.navigation.type!=="enter"&&C.navigating.set(W.current=h.navigation);let g=u&&await Be(u);if(!g){if(ge(t,x,v.hash))return await Y(t,i);g=await mt(t,{id:null},await Q(new Ie(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,i)}if(t=u?.url||t,I!==l)return h.reject(new Error("navigation aborted")),!1;if(g.type==="redirect"){if(o<20){await K({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 Ke({status:500,error:await Q(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else g.props.page.status>=400&&await C.updated.check()&&(await lt(),await Y(t,i));if(Le(),je(w),dt(_),g.props.page.url.pathname!==t.pathname&&(t.pathname=g.props.page.url.pathname),s=n?n.state:s,!n){const k=i?0:1,te={[B]:y+=k,[H]:R+=k,[nt]:s};(i?history.replaceState:history.pushState).call(history,te,"",t),i||Ht(y,R)}const S=u&&L?.id===u.id?L.fork:null;L=null,g.props.page.state=s;let E;if(ce){const k=(await Promise.all(Array.from(Wt,D=>D(h.navigation)))).filter(D=>typeof D=="function");if(k.length>0){let D=function(){k.forEach(_e=>{z.delete(_e)})};k.push(D),k.forEach(_e=>{z.add(_e)})}m=g.state,g.props.page&&(g.props.page.url=t);const te=S&&await S;te?E=te.commit():(qe.$set(g.props),it(g.props.page),E=bt?.()),ft=!0}else await pt(g,xe,!1);const{activeElement:O}=document;await E,await re(),await re();let $=null;if(Xe){const k=n?n.scroll:a?q():null;k?scrollTo(k.x,k.y):($=t.hash&&document.getElementById(wt(t)))?$.scrollIntoView():scrollTo(0,0)}const vt=document.activeElement!==O&&document.activeElement!==document.body;!r&&!vt&&cn(t,!$),Xe=!0,g.props.page&&Object.assign(b,g.props.page),X=!1,e==="popstate"&&ht(R),h.fulfil(void 0),h.navigation.to&&(h.navigation.to.scroll=q()),z.forEach(k=>k(h.navigation)),C.navigating.set(W.current=null)}async function mt(e,t,n,r,a){return e.origin===pe&&e.pathname===location.pathname&&!ut?await Ke({status:r,error:n,url:e,route:t}):await Y(e,a)}function rn(){let e,t={element:void 0,href:void 0},n;T.addEventListener("mousemove",o=>{const l=o.target;clearTimeout(e),e=setTimeout(()=>{i(l,N.hover)},20)});function r(o){o.defaultPrevented||i(o.composedPath()[0],N.tap)}T.addEventListener("mousedown",r),T.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(o=>{for(const l of o)l.isIntersecting&&(ke(new URL(l.target.href)),a.unobserve(l.target))},{threshold:0});async function i(o,l){const c=at(o,T),d=c===t.element&&c?.href===t.href&&l>=n;if(!c||d)return;const{url:p,external:f,download:u}=Se(c,x,v.hash);if(f||u)return;const h=ae(c),w=p&&he(m.url)===he(p);if(!(h.reload||w))if(l<=h.preload_data){t={element:c,href:c.href},n=N.tap;const _=await ee(p,!1);if(!_)return;Yt(_)}else l<=h.preload_code&&(t={element:c,href:c.href},n=l,ke(p))}function s(){a.disconnect();for(const o of T.querySelectorAll("a")){const{url:l,external:c,download:d}=Se(o,x,v.hash);if(c||d)continue;const p=ae(o);p.reload||(p.preload_code===N.viewport&&a.observe(o),p.preload_code===N.eager&&ke(l))}}z.add(s),s()}function Q(e,t){if(e instanceof Pe)return e.body;const n=Ce(e),r=Kt(e);return v.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function mn(e,t={}){return e=new URL($e(e)),e.origin!==pe?Promise.reject(new Error("goto: invalid URL")):De(e,t,0)}function an(e){if(typeof e=="function")se.push(e);else{const{href:t}=new URL(e,location.href);se.push(n=>n.href===t)}}function wn(){return Z=!0,Jt()}function on(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(Qe(),!X){const r=Ge(m,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};ct.forEach(i=>i(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Qe()}),navigator.connection?.saveData||rn(),T.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=at(t.composedPath()[0],T);if(!n)return;const{url:r,external:a,target:i,download:s}=Se(n,x,v.hash);if(!r)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const o=ae(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||s)return;const[c,d]=(v.hash?r.hash.replace(/^#/,""):r.href).split("#"),p=c===we(location);if(a||o.reload&&(!p||!d)){_t({url:r,type:"link",event:t})?X=!0:t.preventDefault();return}if(d!==void 0&&p){const[,f]=m.url.href.split("#");if(f===d){if(t.preventDefault(),d===""||d==="top"&&n.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const u=n.ownerDocument.getElementById(decodeURIComponent(d));u&&(u.scrollIntoView(),u.focus())}return}if(G=!0,je(y),e(r),!o.replace_state)return;G=!1}t.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await K({type:"link",url:r,keepfocus:o.keepfocus,noscroll:o.noscroll,replace_state:o.replace_state??r.href===location.href,event:t})}),T.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),r=t.submitter;if((r?.formTarget||n.target)==="_blank"||(r?.formMethod||n.method)!=="get")return;const s=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(ge(s,x,!1))return;const o=t.target,l=ae(o);if(l.reload)return;t.preventDefault(),t.stopPropagation();const c=new FormData(o,r);s.search=new URLSearchParams(c).toString(),K({type:"form",url:s,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??s.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!Ae){if(t.state?.[B]){const n=t.state[B];if(I={},n===y)return;const r=j[n],a=t.state[nt]??{},i=new URL(t.state[Dt]??location.href),s=t.state[H],o=m.url?we(location)===we(m.url):!1;if(s===R&&(ft||o)){a!==b.state&&(b.state=a),e(i),j[y]=q(),r&&scrollTo(r.x,r.y),y=n;return}const c=n-y;await K({type:"popstate",url:i,popped:{state:a,scroll:r,delta:c},accept:()=>{y=n,R=s},block:()=>{history.go(-c)},nav_token:I,event:t})}else if(!G){const n=new URL(location.href);e(n),v.hash&&location.reload()}}}),addEventListener("hashchange",()=>{G&&(G=!1,history.replaceState({...history.state,[B]:++y,[H]:R},"",location.href))});for(const t of document.querySelectorAll("link"))zt.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&C.navigating.set(W.current=null)});function e(t){m.url=b.url=t,C.page.set(Me(b)),C.page.notify()}}async function sn(e,{status:t=200,error:n,node_ids:r,params:a,route:i,server_route:s,data:o,form:l}){ut=!0;const c=new URL(location.href);let d;({params:a={},route:i={id:null}}=await ee(c,!1)||{}),d=Ne.find(({id:u})=>u===i.id);let p,f=!0;try{const u=r.map(async(w,_)=>{const g=o[_];return g?.uses&&(g.uses=ln(g.uses)),Ve({loader:v.nodes[w],url:c,params:a,route:i,parent:async()=>{const S={};for(let E=0;E<_;E+=1)Object.assign(S,(await u[E]).data);return S},server_data_node:Fe(g)})}),h=await Promise.all(u);if(d){const w=d.layouts;for(let _=0;_<w.length;_++)w[_]||h.splice(_,0,void 0)}p=de({url:c,params:a,branch:h,status:t,error:n,form:l,route:d??null})}catch(u){if(u instanceof Te){await Y(new URL(u.location,location.href));return}p=await Ke({status:Ce(u),error:await Q(u,{url:c,params:a,route:i}),url:c,route:i}),e.textContent="",f=!1}p.props.page&&(p.props.page.state={}),await pt(p,e,f)}function ln(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}let Ae=!1;function cn(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=wt(e);if(r&&document.getElementById(r)){const{x:i,y:s}=q();setTimeout(()=>{const o=history.state;Ae=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(o,"",e),t&&scrollTo(i,s),Ae=!1})}else{const i=document.body,s=i.getAttribute("tabindex");i.tabIndex=-1,i.focus({preventScroll:!0,focusVisible:!1}),s!==null?i.setAttribute("tabindex",s):i.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const i=[];for(let s=0;s<a.rangeCount;s+=1)i.push(a.getRangeAt(s));setTimeout(()=>{if(a.rangeCount===i.length){for(let s=0;s<a.rangeCount;s+=1){const o=i[s],l=a.getRangeAt(s);if(o.commonAncestorContainer!==l.commonAncestorContainer||o.startContainer!==l.startContainer||o.endContainer!==l.endContainer||o.startOffset!==l.startOffset||o.endOffset!==l.endOffset)return}a.removeAllRanges()}})}}}function Ge(e,t,n,r,a=null){let i,s;const o=new Promise((c,d)=>{i=c,s=d});return o.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:q()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:a},willUnload:!t,type:r,complete:o},fulfil:i,reject:s}}function Me(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function un(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function wt(e){let t;if(v.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{_n as a,mn as g,wn as i,dn as l,b as p,C as s};
|
|
@@ -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"./glgUBDR2.js";const b=3e4;class K extends B{constructor(n){super(),this.doc=n,this.clientID=n.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const e=A();this.getLocalState()!==null&&b/2<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const s=[];this.meta.forEach((a,c)=>{c!==this.clientID&&b<=e-a.lastUpdated&&this.states.has(c)&&s.push(c)}),s.length>0&&x(this,s,"timeout")},F(b/10)),n.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(n){const e=this.clientID,s=this.meta.get(e),a=s===void 0?0:s.clock+1,c=this.states.get(e);n===null?this.states.delete(e):this.states.set(e,n),this.meta.set(e,{clock:a,lastUpdated:A()});const l=[],u=[],r=[],p=[];n===null?p.push(e):c==null?n!=null&&l.push(e):(u.push(e),V(c,n)||r.push(e)),(l.length>0||r.length>0||p.length>0)&&this.emit("change",[{added:l,updated:r,removed:p},"local"]),this.emit("update",[{added:l,updated:u,removed:p},"local"])}setLocalStateField(n,e){const s=this.getLocalState();s!==null&&this.setLocalState({...s,[n]:e})}getStates(){return this.states}}const x=(t,n,e)=>{const s=[];for(let a=0;a<n.length;a++){const c=n[a];if(t.states.has(c)){if(t.states.delete(c),c===t.clientID){const l=t.meta.get(c);t.meta.set(c,{clock:l.clock+1,lastUpdated:A()})}s.push(c)}}s.length>0&&(t.emit("change",[{added:[],updated:[],removed:s},e]),t.emit("update",[{added:[],updated:[],removed:s},e]))},Q=(t,n,e=t.states)=>{const s=n.length,a=D();S(a,s);for(let c=0;c<s;c++){const l=n[c],u=e.get(l)||null,r=t.meta.get(l).clock;S(a,l),S(a,r),J(a,JSON.stringify(u))}return v(a)},X=(t,n,e)=>{const s=N(n),a=A(),c=[],l=[],u=[],r=[],p=L(s);for(let m=0;m<p;m++){const d=L(s);let g=L(s);const h=JSON.parse(_(s)),y=t.meta.get(d),k=t.states.get(d),o=y===void 0?0:y.clock;(o<g||o===g&&h===null&&t.states.has(d))&&(h===null?d===t.clientID&&t.getLocalState()!=null?g++:t.states.delete(d):t.states.set(d,h),t.meta.set(d,{clock:g,lastUpdated:a}),y===void 0&&h!==null?c.push(d):y!==void 0&&h===null?r.push(d):h!==null&&(V(h,k)||u.push(d),l.push(d)))}(c.length>0||u.length>0||r.length>0)&&t.emit("change",[{added:c,updated:u,removed:r},e]),(c.length>0||l.length>0||r.length>0)&&t.emit("update",[{added:c,updated:l,removed:r},e])},W=0,j=1,C=2,Z=(t,n)=>{S(t,W);const e=P(n);E(t,e)},$=(t,n,e)=>{S(t,j),E(t,q(n,e))},H=(t,n,e)=>$(n,e,O(t)),Y=(t,n,e,s)=>{try{G(n,O(t),e)}catch(a){s?.(a),console.error("Caught error while handling a Yjs update",a)}},tt=(t,n)=>{S(t,C),E(t,n)},et=Y,nt=(t,n,e,s,a)=>{const c=L(t);switch(c){case W:H(t,n,e);break;case j:Y(t,e,s,a);break;case C:et(t,e,s,a);break;default:throw new Error("Unknown message type")}return c},U=0,T=1;function st(t,n,e){const s=new TextEncoder().encode(t),a=new ArrayBuffer(2+s.length+1+e.length);return new DataView(a).setUint16(0,s.length),new Uint8Array(a,2,s.length).set(s),new Uint8Array(a)[2+s.length]=n,new Uint8Array(a,2+s.length+1).set(e),a}function at(t){if(t.byteLength<3)return null;const e=new DataView(t).getUint16(0);if(t.byteLength<2+e+1)return null;const s=new TextDecoder().decode(new Uint8Array(t,2,e)),a=new Uint8Array(t)[2+e],c=new Uint8Array(t,2+e+1);return{docName:s,msgType:a,payload:c}}function lt(t,n){const e=new R,s=e.getText("content"),a=new K(e);a.setLocalStateField("user",{name:n.name,color:n.color,colorLight:n.colorLight??n.color+"33"});let c=null,l=!1;function u(){return M.ws??null}function r(o,f){const i=u();!i||i.readyState!==WebSocket.OPEN||i.send(st(t,o,f))}function p(){const o=D();Z(o,e),r(U,v(o))}function m(o){const f=o??[e.clientID],i=Q(a,f);r(T,i)}function d(o){if(l||typeof o.data=="string")return;const f=o.data instanceof ArrayBuffer?o.data:null;if(!f)return;const i=at(f);if(!(!i||i.docName!==t))if(i.msgType===U){const I=N(i.payload),w=D();nt(I,w,e,"ws-server"),z(w)>0&&r(U,v(w))}else i.msgType===T&&X(a,i.payload,"ws-server")}function g(o,f){if(l||f==="ws-server")return;const i=D();tt(i,o),r(U,v(i))}function h({added:o,updated:f,removed:i},I){if(l||I==="ws-server")return;const w=o.concat(f,i);m(w)}function y(){if(l)return;const o=u();!o||o.readyState!==WebSocket.OPEN||(o.send(JSON.stringify({type:"collab:join",docName:t})),c&&o.removeEventListener("message",c),c=d,o.addEventListener("message",c),p(),m())}e.on("update",g),a.on("update",h),y(),M.addConnectHandler(y);function k(){if(l)return;l=!0,x(a,[e.clientID],"local"),m([e.clientID]);const o=u();o&&o.readyState===WebSocket.OPEN&&o.send(JSON.stringify({type:"collab:leave",docName:t})),c&&o&&(o.removeEventListener("message",c),c=null),e.off("update",g),a.off("update",h),a.destroy(),e.destroy()}return{ydoc:e,ytext:s,awareness:a,destroy:k}}export{lt as createCollabSession};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import{b as dt,c as V,a as w,f as P,j as ss,e as rs,g as gt,s as _e,t as ns}from"./0x0awhVy.js";import{A as le,l as ft,G as kt,a9 as as,bk as is,o as xt,C as ls,m as os,b6 as cs,b3 as hs,n as ps,aA as us,aB as ds,bl as gs,p as Fe,f as X,q as Tt,t as zt,v as At,x as D,w as R,z as _,y as Ie,F as ee,a7 as Ue,D as S,g as p,aj as Ve,R as fs,S as Xe,a as ks,bm as xs,T as Se}from"./8FUQuwgM.js";import{g as It,e as ms,w as bs,h as ws}from"./EDLlAC9C.js";import{l as me,s as be,p as vs,i as O,b as ys}from"./CbJfRYJV.js";import{n as E,e as Re,i as Te}from"./glgUBDR2.js";import{B as te}from"./BVmVTxxa.js";import"./Bl1mtM70.js";import{I as we,s as ve,X as $s,T as _s,a as Ss}from"./Scb_NG-a.js";import{i as Rs,g as Ts}from"./CIZkRAuY.js";function mt(r,e,s=!1,n=!1,t=!1){var i=r,a="";le(()=>{var o=as;if(a===(a=e()??"")){ft&&kt();return}if(o.nodes!==null&&(is(o.nodes.start,o.nodes.end),o.nodes=null),a!==""){if(ft){xt.data;for(var l=kt(),h=l;l!==null&&(l.nodeType!==ls||l.data!=="");)h=l,l=os(l);if(l===null)throw cs(),hs;dt(xt,h),i=ps(l);return}var c=s?ds:n?gs:void 0,u=us(s?"svg":n?"math":"template",c);u.innerHTML=a;var d=s||n?u:u.content;if(dt(Fe(d),d.lastChild),s||n)for(;Fe(d);)i.before(Fe(d));else i.before(d)}})}function bt(r,e){const s=me(e,["children","$$slots","$$events","$$legacy"]);const n=[["path",{d:"M3 5h.01"}],["path",{d:"M3 12h.01"}],["path",{d:"M3 19h.01"}],["path",{d:"M8 5h13"}],["path",{d:"M8 12h13"}],["path",{d:"M8 19h13"}]];we(r,be({name:"list"},()=>s,{get iconNode(){return n},children:(t,i)=>{var a=V(),o=X(a);ve(o,e,"default",{}),w(t,a)},$$slots:{default:!0}}))}function wt(r,e){const s=me(e,["children","$$slots","$$events","$$legacy"]);const n=[["circle",{cx:"18",cy:"5",r:"3"}],["circle",{cx:"6",cy:"12",r:"3"}],["circle",{cx:"18",cy:"19",r:"3"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49"}]];we(r,be({name:"share-2"},()=>s,{get iconNode(){return n},children:(t,i)=>{var a=V(),o=X(a);ve(o,e,"default",{}),w(t,a)},$$slots:{default:!0}}))}function zs(r,e){const s=me(e,["children","$$slots","$$events","$$legacy"]);const n=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"}]];we(r,be({name:"message-square"},()=>s,{get iconNode(){return n},children:(t,i)=>{var a=V(),o=X(a);ve(o,e,"default",{}),w(t,a)},$$slots:{default:!0}}))}var As=P('<span class="toggle-btn active svelte-r6dy5f" aria-current="page"><!><span class="toggle-label">Details</span></span>'),Is=P('<a class="toggle-btn svelte-r6dy5f"><!><span class="toggle-label">Details</span></a>'),Ps=P('<span class="toggle-btn active svelte-r6dy5f" aria-current="page"><!><span class="toggle-label">Graph</span></span>'),Cs=P('<a class="toggle-btn svelte-r6dy5f" href="/graph"><!><span class="toggle-label">Graph</span></a>'),Es=P('<div class="view-toolbar svelte-r6dy5f"><div></div> <div class="view-toggles svelte-r6dy5f"><!> <!></div> <div class="toolbar-right svelte-r6dy5f"><!> <!></div></div>');function Kr(r,e){Tt(e,!0);let s=vs(e,"activeView",3,"entity");const n=zt("chat");var t=Es(),i=D(R(t),2),a=R(i);{var o=m=>{var b=As(),C=R(b);bt(C,{size:14}),Ie(),_(b),w(m,b)},l=m=>{var b=Is(),C=R(b);bt(C,{size:14}),Ie(),_(b),le(()=>It(b,"href",E.entityPath??"/")),w(m,b)};O(a,m=>{s()==="entity"?m(o):m(l,!1)})}var h=D(a,2);{var c=m=>{var b=Ps(),C=R(b);wt(C,{size:14}),Ie(),_(b),w(m,b)},u=m=>{var b=Cs(),C=R(b);wt(C,{size:14}),Ie(),_(b),w(m,b)};O(h,m=>{s()==="graph"?m(c):m(u,!1)})}_(i);var d=D(i,2),T=R(d);{var $=m=>{var b=V(),C=X(b);ms(C,()=>e.right),w(m,b)};O(T,m=>{e.right&&m($)})}var I=D(T,2);{var se=m=>{te(m,{variant:"accent",size:"icon",class:"chat-toggle",title:"Open Agent",get onclick(){return n.toggle},children:(b,C)=>{zs(b,{size:14})},$$slots:{default:!0}})};O(I,m=>{n.open||m(se)})}_(d),_(t),w(r,t),At()}function Ls(r,e){const s=me(e,["children","$$slots","$$events","$$legacy"]);const n=[["circle",{cx:"12",cy:"12",r:"10"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1"}]];we(r,be({name:"circle-stop"},()=>s,{get iconNode(){return n},children:(t,i)=>{var a=V(),o=X(a);ve(o,e,"default",{}),w(t,a)},$$slots:{default:!0}}))}function qs(r,e){const s=me(e,["children","$$slots","$$events","$$legacy"]);const n=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z"}]];we(r,be({name:"square-pen"},()=>s,{get iconNode(){return n},children:(t,i)=>{var a=V(),o=X(a);ve(o,e,"default",{}),w(t,a)},$$slots:{default:!0}}))}function Bs(r,e){const s=me(e,["children","$$slots","$$events","$$legacy"]);const n=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 6v6l4 2"}]];we(r,be({name:"clock"},()=>s,{get iconNode(){return n},children:(t,i)=>{var a=V(),o=X(a);ve(o,e,"default",{}),w(t,a)},$$slots:{default:!0}}))}function st(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ge=st();function Pt(r){ge=r}var ue={exec:()=>null};function x(r,e=""){let s=typeof r=="string"?r:r.source,n={replace:(t,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(M.caret,"$1"),s=s.replace(t,a),n},getRegex:()=>new RegExp(s,e)};return n}var Ms=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),M={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}>`)},Ns=/^(?:[ \t]*(?:\n|$))+/,js=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ds=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ce=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Os=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,rt=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Ct=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Et=x(Ct).replace(/bull/g,rt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Zs=x(Ct).replace(/bull/g,rt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),nt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Hs=/^[^\n]+/,at=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Qs=x(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",at).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ws=x(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,rt).getRegex(),je="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",it=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Gs=x("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",it).replace("tag",je).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Lt=x(nt).replace("hr",Ce).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",je).getRegex(),Fs=x(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Lt).getRegex(),lt={blockquote:Fs,code:js,def:Qs,fences:Ds,heading:Os,hr:Ce,html:Gs,lheading:Et,list:Ws,newline:Ns,paragraph:Lt,table:ue,text:Hs},vt=x("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ce).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",je).getRegex(),Us={...lt,lheading:Zs,table:vt,paragraph:x(nt).replace("hr",Ce).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",vt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",je).getRegex()},Vs={...lt,html:x(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",it).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ue,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:x(nt).replace("hr",Ce).replace("heading",` *#{1,6} *[^
|
|
2
|
+
]`).replace("lheading",Et).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Xs=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Js=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,qt=/^( {2,}|\\)\n(?!\s*$)/,Ks=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,De=/[\p{P}\p{S}]/u,ot=/[\s\p{P}\p{S}]/u,Bt=/[^\s\p{P}\p{S}]/u,Ys=x(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ot).getRegex(),Mt=/(?!~)[\p{P}\p{S}]/u,er=/(?!~)[\s\p{P}\p{S}]/u,tr=/(?:[^\s\p{P}\p{S}]|~)/u,Nt=/(?![*_])[\p{P}\p{S}]/u,sr=/(?![*_])[\s\p{P}\p{S}]/u,rr=/(?:[^\s\p{P}\p{S}]|[*_])/u,nr=x(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ms?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),jt=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ar=x(jt,"u").replace(/punct/g,De).getRegex(),ir=x(jt,"u").replace(/punct/g,Mt).getRegex(),Dt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",lr=x(Dt,"gu").replace(/notPunctSpace/g,Bt).replace(/punctSpace/g,ot).replace(/punct/g,De).getRegex(),or=x(Dt,"gu").replace(/notPunctSpace/g,tr).replace(/punctSpace/g,er).replace(/punct/g,Mt).getRegex(),cr=x("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Bt).replace(/punctSpace/g,ot).replace(/punct/g,De).getRegex(),hr=x(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Nt).getRegex(),pr="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",ur=x(pr,"gu").replace(/notPunctSpace/g,rr).replace(/punctSpace/g,sr).replace(/punct/g,Nt).getRegex(),dr=x(/\\(punct)/,"gu").replace(/punct/g,De).getRegex(),gr=x(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),fr=x(it).replace("(?:-->|$)","-->").getRegex(),kr=x("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",fr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Be=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,xr=x(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Be).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ot=x(/^!?\[(label)\]\[(ref)\]/).replace("label",Be).replace("ref",at).getRegex(),Zt=x(/^!?\[(ref)\](?:\[\])?/).replace("ref",at).getRegex(),mr=x("reflink|nolink(?!\\()","g").replace("reflink",Ot).replace("nolink",Zt).getRegex(),yt=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ct={_backpedal:ue,anyPunctuation:dr,autolink:gr,blockSkip:nr,br:qt,code:Js,del:ue,delLDelim:ue,delRDelim:ue,emStrongLDelim:ar,emStrongRDelimAst:lr,emStrongRDelimUnd:cr,escape:Xs,link:xr,nolink:Zt,punctuation:Ys,reflink:Ot,reflinkSearch:mr,tag:kr,text:Ks,url:ue},br={...ct,link:x(/^!?\[(label)\]\((.*?)\)/).replace("label",Be).getRegex(),reflink:x(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Be).getRegex()},Je={...ct,emStrongRDelimAst:or,emStrongLDelim:ir,delLDelim:hr,delRDelim:ur,url:x(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",yt).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:x(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",yt).getRegex()},wr={...Je,br:x(qt).replace("{2,}","*").getRegex(),text:x(Je.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ee={normal:lt,gfm:Us,pedantic:Vs},ze={normal:ct,gfm:Je,breaks:wr,pedantic:br},vr={"&":"&","<":"<",">":">",'"':""","'":"'"},$t=r=>vr[r];function U(r,e){if(e){if(M.escapeTest.test(r))return r.replace(M.escapeReplace,$t)}else if(M.escapeTestNoEncode.test(r))return r.replace(M.escapeReplaceNoEncode,$t);return r}function _t(r){try{r=encodeURI(r).replace(M.percentDecode,"%")}catch{return null}return r}function St(r,e){let s=r.replace(M.findPipe,(i,a,o)=>{let l=!1,h=a;for(;--h>=0&&o[h]==="\\";)l=!l;return l?"|":" |"}),n=s.split(M.splitPipe),t=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;t<n.length;t++)n[t]=n[t].trim().replace(M.slashPipe,"|");return n}function Ae(r,e,s){let n=r.length;if(n===0)return"";let t=0;for(;t<n&&r.charAt(n-t-1)===e;)t++;return r.slice(0,n-t)}function yr(r,e){if(r.indexOf(e[1])===-1)return-1;let s=0;for(let n=0;n<r.length;n++)if(r[n]==="\\")n++;else if(r[n]===e[0])s++;else if(r[n]===e[1]&&(s--,s<0))return n;return s>0?-2:-1}function $r(r,e=0){let s=e,n="";for(let t of r)if(t===" "){let i=4-s%4;n+=" ".repeat(i),s+=i}else n+=t,s++;return n}function Rt(r,e,s,n,t){let i=e.href,a=e.title||null,o=r[1].replace(t.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:r[0].charAt(0)==="!"?"image":"link",raw:s,href:i,title:a,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function _r(r,e,s){let n=r.match(s.other.indentCodeCompensation);if(n===null)return e;let t=n[1];return e.split(`
|
|
3
|
+
`).map(i=>{let a=i.match(s.other.beginningSpace);if(a===null)return i;let[o]=a;return o.length>=t.length?i.slice(t.length):i}).join(`
|
|
4
|
+
`)}var Me=class{options;rules;lexer;constructor(r){this.options=r||ge}space(r){let e=this.rules.block.newline.exec(r);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(r){let e=this.rules.block.code.exec(r);if(e){let s=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?s:Ae(s,`
|
|
5
|
+
`)}}}fences(r){let e=this.rules.block.fences.exec(r);if(e){let s=e[0],n=_r(s,e[3]||"",this.rules);return{type:"code",raw:s,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(r){let e=this.rules.block.heading.exec(r);if(e){let s=e[2].trim();if(this.rules.other.endingHash.test(s)){let n=Ae(s,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(s=n.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(r){let e=this.rules.block.hr.exec(r);if(e)return{type:"hr",raw:Ae(e[0],`
|
|
6
|
+
`)}}blockquote(r){let e=this.rules.block.blockquote.exec(r);if(e){let s=Ae(e[0],`
|
|
7
|
+
`).split(`
|
|
8
|
+
`),n="",t="",i=[];for(;s.length>0;){let a=!1,o=[],l;for(l=0;l<s.length;l++)if(this.rules.other.blockquoteStart.test(s[l]))o.push(s[l]),a=!0;else if(!a)o.push(s[l]);else break;s=s.slice(l);let h=o.join(`
|
|
9
|
+
`),c=h.replace(this.rules.other.blockquoteSetextReplace,`
|
|
10
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
|
|
11
|
+
${h}`:h,t=t?`${t}
|
|
12
|
+
${c}`:c;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=u,s.length===0)break;let d=i.at(-1);if(d?.type==="code")break;if(d?.type==="blockquote"){let T=d,$=T.raw+`
|
|
13
|
+
`+s.join(`
|
|
14
|
+
`),I=this.blockquote($);i[i.length-1]=I,n=n.substring(0,n.length-T.raw.length)+I.raw,t=t.substring(0,t.length-T.text.length)+I.text;break}else if(d?.type==="list"){let T=d,$=T.raw+`
|
|
15
|
+
`+s.join(`
|
|
16
|
+
`),I=this.list($);i[i.length-1]=I,n=n.substring(0,n.length-d.raw.length)+I.raw,t=t.substring(0,t.length-T.raw.length)+I.raw,s=$.substring(i.at(-1).raw.length).split(`
|
|
17
|
+
`);continue}}return{type:"blockquote",raw:n,tokens:i,text:t}}}list(r){let e=this.rules.block.list.exec(r);if(e){let s=e[1].trim(),n=s.length>1,t={type:"list",raw:"",ordered:n,start:n?+s.slice(0,-1):"",loose:!1,items:[]};s=n?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=n?s:"[*+-]");let i=this.rules.other.listItemRegex(s),a=!1;for(;r;){let l=!1,h="",c="";if(!(e=i.exec(r))||this.rules.block.hr.test(r))break;h=e[0],r=r.substring(h.length);let u=$r(e[2].split(`
|
|
18
|
+
`,1)[0],e[1].length),d=r.split(`
|
|
19
|
+
`,1)[0],T=!u.trim(),$=0;if(this.options.pedantic?($=2,c=u.trimStart()):T?$=e[1].length+1:($=u.search(this.rules.other.nonSpaceChar),$=$>4?1:$,c=u.slice($),$+=e[1].length),T&&this.rules.other.blankLine.test(d)&&(h+=d+`
|
|
20
|
+
`,r=r.substring(d.length+1),l=!0),!l){let I=this.rules.other.nextBulletRegex($),se=this.rules.other.hrRegex($),m=this.rules.other.fencesBeginRegex($),b=this.rules.other.headingBeginRegex($),C=this.rules.other.htmlBeginRegex($),f=this.rules.other.blockquoteBeginRegex($);for(;r;){let z=r.split(`
|
|
21
|
+
`,1)[0],A;if(d=z,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),A=d):A=d.replace(this.rules.other.tabCharGlobal," "),m.test(d)||b.test(d)||C.test(d)||f.test(d)||I.test(d)||se.test(d))break;if(A.search(this.rules.other.nonSpaceChar)>=$||!d.trim())c+=`
|
|
22
|
+
`+A.slice($);else{if(T||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||m.test(u)||b.test(u)||se.test(u))break;c+=`
|
|
23
|
+
`+d}T=!d.trim(),h+=z+`
|
|
24
|
+
`,r=r.substring(z.length+1),u=A.slice($)}}t.loose||(a?t.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(a=!0)),t.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),t.raw+=h}let o=t.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;t.raw=t.raw.trimEnd();for(let l of t.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let h=this.rules.other.listTaskCheckbox.exec(l.raw);if(h){let c={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};l.checked=c.checked,t.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=c.raw+l.tokens[0].raw,l.tokens[0].text=c.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(c)):l.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):l.tokens.unshift(c)}}if(!t.loose){let h=l.tokens.filter(u=>u.type==="space"),c=h.length>0&&h.some(u=>this.rules.other.anyLine.test(u.raw));t.loose=c}}if(t.loose)for(let l of t.items){l.loose=!0;for(let h of l.tokens)h.type==="text"&&(h.type="paragraph")}return t}}html(r){let e=this.rules.block.html.exec(r);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(r){let e=this.rules.block.def.exec(r);if(e){let s=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",t=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:s,raw:e[0],href:n,title:t}}}table(r){let e=this.rules.block.table.exec(r);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let s=St(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),t=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
25
|
+
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(s.length===n.length){for(let a of n)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<s.length;a++)i.header.push({text:s[a],tokens:this.lexer.inline(s[a]),header:!0,align:i.align[a]});for(let a of t)i.rows.push(St(a,i.header.length).map((o,l)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:i.align[l]})));return i}}lheading(r){let e=this.rules.block.lheading.exec(r);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(r){let e=this.rules.block.paragraph.exec(r);if(e){let s=e[1].charAt(e[1].length-1)===`
|
|
26
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:s,tokens:this.lexer.inline(s)}}}text(r){let e=this.rules.block.text.exec(r);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(r){let e=this.rules.inline.escape.exec(r);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(r){let e=this.rules.inline.tag.exec(r);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(r){let e=this.rules.inline.link.exec(r);if(e){let s=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let i=Ae(s.slice(0,-1),"\\");if((s.length-i.length)%2===0)return}else{let i=yr(e[2],"()");if(i===-2)return;if(i>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let n=e[2],t="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(n);i&&(n=i[1],t=i[3])}else t=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?n=n.slice(1):n=n.slice(1,-1)),Rt(e,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:t&&t.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(r,e){let s;if((s=this.rules.inline.reflink.exec(r))||(s=this.rules.inline.nolink.exec(r))){let n=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),t=e[n.toLowerCase()];if(!t){let i=s[0].charAt(0);return{type:"text",raw:i,text:i}}return Rt(s,t,s[0],this.lexer,this.rules)}}emStrong(r,e,s=""){let n=this.rules.inline.emStrongLDelim.exec(r);if(!(!n||n[3]&&s.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!s||this.rules.inline.punctuation.exec(s))){let t=[...n[0]].length-1,i,a,o=t,l=0,h=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*r.length+t);(n=h.exec(e))!=null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(a=[...i].length,n[3]||n[4]){o+=a;continue}else if((n[5]||n[6])&&t%3&&!((t+a)%3)){l+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+l);let c=[...n[0]][0].length,u=r.slice(0,t+n.index+c+a);if(Math.min(t,a)%2){let T=u.slice(1,-1);return{type:"em",raw:u,text:T,tokens:this.lexer.inlineTokens(T)}}let d=u.slice(2,-2);return{type:"strong",raw:u,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(r){let e=this.rules.inline.code.exec(r);if(e){let s=e[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(s),t=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return n&&t&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:e[0],text:s}}}br(r){let e=this.rules.inline.br.exec(r);if(e)return{type:"br",raw:e[0]}}del(r,e,s=""){let n=this.rules.inline.delLDelim.exec(r);if(n&&(!n[1]||!s||this.rules.inline.punctuation.exec(s))){let t=[...n[0]].length-1,i,a,o=t,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*r.length+t);(n=l.exec(e))!=null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i||(a=[...i].length,a!==t))continue;if(n[3]||n[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let h=[...n[0]][0].length,c=r.slice(0,t+n.index+h+a),u=c.slice(t,-t);return{type:"del",raw:c,text:u,tokens:this.lexer.inlineTokens(u)}}}}autolink(r){let e=this.rules.inline.autolink.exec(r);if(e){let s,n;return e[2]==="@"?(s=e[1],n="mailto:"+s):(s=e[1],n=s),{type:"link",raw:e[0],text:s,href:n,tokens:[{type:"text",raw:s,text:s}]}}}url(r){let e;if(e=this.rules.inline.url.exec(r)){let s,n;if(e[2]==="@")s=e[0],n="mailto:"+s;else{let t;do t=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(t!==e[0]);s=e[0],e[1]==="www."?n="http://"+e[0]:n=e[0]}return{type:"link",raw:e[0],text:s,href:n,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(r){let e=this.rules.inline.text.exec(r);if(e){let s=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:s}}}},Q=class Ke{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ge,this.options.tokenizer=this.options.tokenizer||new Me,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let s={other:M,block:Ee.normal,inline:ze.normal};this.options.pedantic?(s.block=Ee.pedantic,s.inline=ze.pedantic):this.options.gfm&&(s.block=Ee.gfm,this.options.breaks?s.inline=ze.breaks:s.inline=ze.gfm),this.tokenizer.rules=s}static get rules(){return{block:Ee,inline:ze}}static lex(e,s){return new Ke(s).lex(e)}static lexInline(e,s){return new Ke(s).inlineTokens(e)}lex(e){e=e.replace(M.carriageReturn,`
|
|
27
|
+
`),this.blockTokens(e,this.tokens);for(let s=0;s<this.inlineQueue.length;s++){let n=this.inlineQueue[s];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,s=[],n=!1){for(this.options.pedantic&&(e=e.replace(M.tabCharGlobal," ").replace(M.spaceLine,""));e;){let t;if(this.options.extensions?.block?.some(a=>(t=a.call({lexer:this},e,s))?(e=e.substring(t.raw.length),s.push(t),!0):!1))continue;if(t=this.tokenizer.space(e)){e=e.substring(t.raw.length);let a=s.at(-1);t.raw.length===1&&a!==void 0?a.raw+=`
|
|
28
|
+
`:s.push(t);continue}if(t=this.tokenizer.code(e)){e=e.substring(t.raw.length);let a=s.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
29
|
+
`)?"":`
|
|
30
|
+
`)+t.raw,a.text+=`
|
|
31
|
+
`+t.text,this.inlineQueue.at(-1).src=a.text):s.push(t);continue}if(t=this.tokenizer.fences(e)){e=e.substring(t.raw.length),s.push(t);continue}if(t=this.tokenizer.heading(e)){e=e.substring(t.raw.length),s.push(t);continue}if(t=this.tokenizer.hr(e)){e=e.substring(t.raw.length),s.push(t);continue}if(t=this.tokenizer.blockquote(e)){e=e.substring(t.raw.length),s.push(t);continue}if(t=this.tokenizer.list(e)){e=e.substring(t.raw.length),s.push(t);continue}if(t=this.tokenizer.html(e)){e=e.substring(t.raw.length),s.push(t);continue}if(t=this.tokenizer.def(e)){e=e.substring(t.raw.length);let a=s.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
32
|
+
`)?"":`
|
|
33
|
+
`)+t.raw,a.text+=`
|
|
34
|
+
`+t.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title},s.push(t));continue}if(t=this.tokenizer.table(e)){e=e.substring(t.raw.length),s.push(t);continue}if(t=this.tokenizer.lheading(e)){e=e.substring(t.raw.length),s.push(t);continue}let i=e;if(this.options.extensions?.startBlock){let a=1/0,o=e.slice(1),l;this.options.extensions.startBlock.forEach(h=>{l=h.call({lexer:this},o),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(i=e.substring(0,a+1))}if(this.state.top&&(t=this.tokenizer.paragraph(i))){let a=s.at(-1);n&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
|
|
35
|
+
`)?"":`
|
|
36
|
+
`)+t.raw,a.text+=`
|
|
37
|
+
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):s.push(t),n=i.length!==e.length,e=e.substring(t.raw.length);continue}if(t=this.tokenizer.text(e)){e=e.substring(t.raw.length);let a=s.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
38
|
+
`)?"":`
|
|
39
|
+
`)+t.raw,a.text+=`
|
|
40
|
+
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):s.push(t);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,s}inline(e,s=[]){return this.inlineQueue.push({src:e,tokens:s}),s}inlineTokens(e,s=[]){let n=e,t=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(t=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)l.includes(t[0].slice(t[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(t=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,t.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(t=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=t[2]?t[2].length:0,n=n.slice(0,t.index+i)+"["+"a".repeat(t[0].length-i-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o="";for(;e;){a||(o=""),a=!1;let l;if(this.options.extensions?.inline?.some(c=>(l=c.call({lexer:this},e,s))?(e=e.substring(l.raw.length),s.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let c=s.at(-1);l.type==="text"&&c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):s.push(l);continue}if(l=this.tokenizer.emStrong(e,n,o)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.del(e,n,o)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),s.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),s.push(l);continue}let h=e;if(this.options.extensions?.startInline){let c=1/0,u=e.slice(1),d;this.options.extensions.startInline.forEach(T=>{d=T.call({lexer:this},u),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(h=e.substring(0,c+1))}if(l=this.tokenizer.inlineText(h)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(o=l.raw.slice(-1)),a=!0;let c=s.at(-1);c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):s.push(l);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return s}},Ne=class{options;parser;constructor(r){this.options=r||ge}space(r){return""}code({text:r,lang:e,escaped:s}){let n=(e||"").match(M.notSpaceStart)?.[0],t=r.replace(M.endingNewline,"")+`
|
|
41
|
+
`;return n?'<pre><code class="language-'+U(n)+'">'+(s?t:U(t,!0))+`</code></pre>
|
|
42
|
+
`:"<pre><code>"+(s?t:U(t,!0))+`</code></pre>
|
|
43
|
+
`}blockquote({tokens:r}){return`<blockquote>
|
|
44
|
+
${this.parser.parse(r)}</blockquote>
|
|
45
|
+
`}html({text:r}){return r}def(r){return""}heading({tokens:r,depth:e}){return`<h${e}>${this.parser.parseInline(r)}</h${e}>
|
|
46
|
+
`}hr(r){return`<hr>
|
|
47
|
+
`}list(r){let e=r.ordered,s=r.start,n="";for(let a=0;a<r.items.length;a++){let o=r.items[a];n+=this.listitem(o)}let t=e?"ol":"ul",i=e&&s!==1?' start="'+s+'"':"";return"<"+t+i+`>
|
|
48
|
+
`+n+"</"+t+`>
|
|
49
|
+
`}listitem(r){return`<li>${this.parser.parse(r.tokens)}</li>
|
|
50
|
+
`}checkbox({checked:r}){return"<input "+(r?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:r}){return`<p>${this.parser.parseInline(r)}</p>
|
|
51
|
+
`}table(r){let e="",s="";for(let t=0;t<r.header.length;t++)s+=this.tablecell(r.header[t]);e+=this.tablerow({text:s});let n="";for(let t=0;t<r.rows.length;t++){let i=r.rows[t];s="";for(let a=0;a<i.length;a++)s+=this.tablecell(i[a]);n+=this.tablerow({text:s})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
|
|
52
|
+
<thead>
|
|
53
|
+
`+e+`</thead>
|
|
54
|
+
`+n+`</table>
|
|
55
|
+
`}tablerow({text:r}){return`<tr>
|
|
56
|
+
${r}</tr>
|
|
57
|
+
`}tablecell(r){let e=this.parser.parseInline(r.tokens),s=r.header?"th":"td";return(r.align?`<${s} align="${r.align}">`:`<${s}>`)+e+`</${s}>
|
|
58
|
+
`}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${U(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:e,tokens:s}){let n=this.parser.parseInline(s),t=_t(r);if(t===null)return n;r=t;let i='<a href="'+r+'"';return e&&(i+=' title="'+U(e)+'"'),i+=">"+n+"</a>",i}image({href:r,title:e,text:s,tokens:n}){n&&(s=this.parser.parseInline(n,this.parser.textRenderer));let t=_t(r);if(t===null)return U(s);r=t;let i=`<img src="${r}" alt="${U(s)}"`;return e&&(i+=` title="${U(e)}"`),i+=">",i}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:U(r.text)}},ht=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}checkbox({raw:r}){return r}},W=class Ye{options;renderer;textRenderer;constructor(e){this.options=e||ge,this.options.renderer=this.options.renderer||new Ne,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ht}static parse(e,s){return new Ye(s).parse(e)}static parseInline(e,s){return new Ye(s).parseInline(e)}parse(e){let s="";for(let n=0;n<e.length;n++){let t=e[n];if(this.options.extensions?.renderers?.[t.type]){let a=t,o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){s+=o||"";continue}}let i=t;switch(i.type){case"space":{s+=this.renderer.space(i);break}case"hr":{s+=this.renderer.hr(i);break}case"heading":{s+=this.renderer.heading(i);break}case"code":{s+=this.renderer.code(i);break}case"table":{s+=this.renderer.table(i);break}case"blockquote":{s+=this.renderer.blockquote(i);break}case"list":{s+=this.renderer.list(i);break}case"checkbox":{s+=this.renderer.checkbox(i);break}case"html":{s+=this.renderer.html(i);break}case"def":{s+=this.renderer.def(i);break}case"paragraph":{s+=this.renderer.paragraph(i);break}case"text":{s+=this.renderer.text(i);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}parseInline(e,s=this.renderer){let n="";for(let t=0;t<e.length;t++){let i=e[t];if(this.options.extensions?.renderers?.[i.type]){let o=this.options.extensions.renderers[i.type].call({parser:this},i);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=o||"";continue}}let a=i;switch(a.type){case"escape":{n+=s.text(a);break}case"html":{n+=s.html(a);break}case"link":{n+=s.link(a);break}case"image":{n+=s.image(a);break}case"checkbox":{n+=s.checkbox(a);break}case"strong":{n+=s.strong(a);break}case"em":{n+=s.em(a);break}case"codespan":{n+=s.codespan(a);break}case"br":{n+=s.br(a);break}case"del":{n+=s.del(a);break}case"text":{n+=s.text(a);break}default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}},Pe=class{options;block;constructor(r){this.options=r||ge}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}emStrongMask(r){return r}provideLexer(){return this.block?Q.lex:Q.lexInline}provideParser(){return this.block?W.parse:W.parseInline}},Sr=class{defaults=st();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=W;Renderer=Ne;TextRenderer=ht;Lexer=Q;Tokenizer=Me;Hooks=Pe;constructor(...r){this.use(...r)}walkTokens(r,e){let s=[];for(let n of r)switch(s=s.concat(e.call(this,n)),n.type){case"table":{let t=n;for(let i of t.header)s=s.concat(this.walkTokens(i.tokens,e));for(let i of t.rows)for(let a of i)s=s.concat(this.walkTokens(a.tokens,e));break}case"list":{let t=n;s=s.concat(this.walkTokens(t.items,e));break}default:{let t=n;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach(i=>{let a=t[i].flat(1/0);s=s.concat(this.walkTokens(a,e))}):t.tokens&&(s=s.concat(this.walkTokens(t.tokens,e)))}}return s}use(...r){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return r.forEach(s=>{let n={...s};if(n.async=this.defaults.async||n.async||!1,s.extensions&&(s.extensions.forEach(t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){let i=e.renderers[t.name];i?e.renderers[t.name]=function(...a){let o=t.renderer.apply(this,a);return o===!1&&(o=i.apply(this,a)),o}:e.renderers[t.name]=t.renderer}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[t.level];i?i.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&(t.level==="block"?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:t.level==="inline"&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)}),n.extensions=e),s.renderer){let t=this.defaults.renderer||new Ne(this.defaults);for(let i in s.renderer){if(!(i in t))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let a=i,o=s.renderer[a],l=t[a];t[a]=(...h)=>{let c=o.apply(t,h);return c===!1&&(c=l.apply(t,h)),c||""}}n.renderer=t}if(s.tokenizer){let t=this.defaults.tokenizer||new Me(this.defaults);for(let i in s.tokenizer){if(!(i in t))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let a=i,o=s.tokenizer[a],l=t[a];t[a]=(...h)=>{let c=o.apply(t,h);return c===!1&&(c=l.apply(t,h)),c}}n.tokenizer=t}if(s.hooks){let t=this.defaults.hooks||new Pe;for(let i in s.hooks){if(!(i in t))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let a=i,o=s.hooks[a],l=t[a];Pe.passThroughHooks.has(i)?t[a]=h=>{if(this.defaults.async&&Pe.passThroughHooksRespectAsync.has(i))return(async()=>{let u=await o.call(t,h);return l.call(t,u)})();let c=o.call(t,h);return l.call(t,c)}:t[a]=(...h)=>{if(this.defaults.async)return(async()=>{let u=await o.apply(t,h);return u===!1&&(u=await l.apply(t,h)),u})();let c=o.apply(t,h);return c===!1&&(c=l.apply(t,h)),c}}n.hooks=t}if(s.walkTokens){let t=this.defaults.walkTokens,i=s.walkTokens;n.walkTokens=function(a){let o=[];return o.push(i.call(this,a)),t&&(o=o.concat(t.call(this,a))),o}}this.defaults={...this.defaults,...n}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,e){return Q.lex(r,e??this.defaults)}parser(r,e){return W.parse(r,e??this.defaults)}parseMarkdown(r){return(e,s)=>{let n={...s},t={...this.defaults,...n},i=this.onError(!!t.silent,!!t.async);if(this.defaults.async===!0&&n.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(t.hooks&&(t.hooks.options=t,t.hooks.block=r),t.async)return(async()=>{let a=t.hooks?await t.hooks.preprocess(e):e,o=await(t.hooks?await t.hooks.provideLexer():r?Q.lex:Q.lexInline)(a,t),l=t.hooks?await t.hooks.processAllTokens(o):o;t.walkTokens&&await Promise.all(this.walkTokens(l,t.walkTokens));let h=await(t.hooks?await t.hooks.provideParser():r?W.parse:W.parseInline)(l,t);return t.hooks?await t.hooks.postprocess(h):h})().catch(i);try{t.hooks&&(e=t.hooks.preprocess(e));let a=(t.hooks?t.hooks.provideLexer():r?Q.lex:Q.lexInline)(e,t);t.hooks&&(a=t.hooks.processAllTokens(a)),t.walkTokens&&this.walkTokens(a,t.walkTokens);let o=(t.hooks?t.hooks.provideParser():r?W.parse:W.parseInline)(a,t);return t.hooks&&(o=t.hooks.postprocess(o)),o}catch(a){return i(a)}}}onError(r,e){return s=>{if(s.message+=`
|
|
59
|
+
Please report this to https://github.com/markedjs/marked.`,r){let n="<p>An error occurred:</p><pre>"+U(s.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(s);throw s}}},de=new Sr;function v(r,e){return de.parse(r,e)}v.options=v.setOptions=function(r){return de.setOptions(r),v.defaults=de.defaults,Pt(v.defaults),v};v.getDefaults=st;v.defaults=ge;v.use=function(...r){return de.use(...r),v.defaults=de.defaults,Pt(v.defaults),v};v.walkTokens=function(r,e){return de.walkTokens(r,e)};v.parseInline=de.parseInline;v.Parser=W;v.parser=W.parse;v.Renderer=Ne;v.TextRenderer=ht;v.Lexer=Q;v.lexer=Q.lex;v.Tokenizer=Me;v.Hooks=Pe;v.parse=v;v.options;v.setOptions;v.use;v.walkTokens;v.parseInline;W.parse;Q.lex;function Rr(r,e,s){fetch("/api/chat/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r),signal:s}).then(async n=>{if(!n.ok){e({type:"error",message:`HTTP ${n.status}`});return}const t=n.body?.getReader();if(!t){e({type:"error",message:"No response body"});return}const i=new TextDecoder;let a="";for(;;){const{done:o,value:l}=await t.read();if(o)break;a+=i.decode(l,{stream:!0});const h=a.split(`
|
|
60
|
+
`);a=h.pop()??"";for(const c of h)if(c.startsWith("data: "))try{const u=JSON.parse(c.slice(6));e(u)}catch{}}}).catch(n=>{n.name!=="AbortError"&&e({type:"error",message:n.message})})}const et="sg-chat-sessions",tt="sg-chat-version",Tr=14;function pe(){try{const r=localStorage.getItem(et);if(!r)return[];if(localStorage.getItem(tt)==="2")return JSON.parse(r);const n=JSON.parse(r).map(t=>({id:crypto.randomUUID(),createdAt:t.date+"T00:00:00.000Z",updatedAt:t.date+"T00:00:00.000Z",title:t.messages.find(i=>i.role==="user")?.content.slice(0,50)||"New chat",messages:t.messages}));return localStorage.setItem(et,JSON.stringify(n)),localStorage.setItem(tt,"2"),n}catch{return[]}}function qe(r){const s=[...r].sort((n,t)=>t.updatedAt.localeCompare(n.updatedAt)).slice(0,Tr);try{localStorage.setItem(et,JSON.stringify(s)),localStorage.setItem(tt,"2")}catch{}}function Le(r,e){const s=pe(),n=e.map(({streaming:i,...a})=>a),t=s.findIndex(i=>i.id===r);t>=0&&(s[t].messages=n,s[t].updatedAt=new Date().toISOString()),qe(s)}function zr(){const e=pe().sort((f,z)=>z.updatedAt.localeCompare(f.updatedAt))[0];let s=ee(Ue(e?e.messages.map(f=>({...f,streaming:!1})):[])),n=ee(Ue(e?.id??null)),t=ee(!1),i=ee(0),a=ee(0),o=ee(null),l=null,h=ee(""),c=ee(Ue(!!e));const u=new Set(["create_entity","update_entity","delete_entity","move_entity"]);function d(){I();const f=crypto.randomUUID();S(n,f,!0),S(s,[],!0),S(c,!1)}function T(){if(p(n)&&p(c))return p(n);const f=p(n)||crypto.randomUUID();S(n,f,!0);const z=new Date().toISOString(),A=pe();return A.push({id:f,createdAt:z,updatedAt:z,title:"New chat",messages:[]}),qe(A),S(c,!0),f}function $(f){if(!f.trim()||p(t))return;S(o,null);const z=T();p(s).push({role:"user",content:f}),p(s).push({role:"agent",content:"",segments:[],streaming:!0}),S(t,!0);const A=pe(),B=A.find(k=>k.id===z);B&&B.title==="New chat"&&(B.title=f.slice(0,50),qe(A)),Le(z,p(s));let G=!1,J=null;l=new AbortController;const Oe=E.selectedSubPath?`${E.selectedRepo}/${E.selectedType}/${E.selectedId}/${E.selectedSubPath}`:E.selectedId?`${E.selectedRepo}/${E.selectedType}/${E.selectedId}`:null,re=p(s).slice(0,-2).map(k=>({role:k.role==="agent"?"assistant":k.role,content:k.content})),Ze={message:f,context:Oe??void 0,sessionId:z,history:re.length>0?re:void 0};Rr(Ze,k=>{const N=p(s)[p(s).length-1];if(!N||N.role!=="agent")return;const Z=N.segments;switch(k.type){case"token":{N.content+=k.text??"";const H=Z[Z.length-1];H&&H.type==="text"?H.content+=k.text??"":Z.push({type:"text",content:k.text??""}),N.segments=Z,Ve(a);break}case"tool_start":if(k.name){u.has(k.name)&&(G=!0);const H=Z[Z.length-1];H&&H.type==="tools"?H.names=[...H.names,k.name]:Z.push({type:"tools",names:[k.name]}),N.segments=Z,Ve(a)}break;case"mutation":G=!0,k.action==="created"&&k.repo&&k.entityType&&k.entityId&&(J={repo:k.repo,entityType:k.entityType,entityId:k.entityId}),window.StudioChrome?.emitMutation?.({action:k.action,repo:k.repo,entityType:k.entityType,entityId:k.entityId});break;case"highlight":S(o,k.entityIds&&k.entityIds.length>0?new Set(k.entityIds):null,!0);break;case"done":k.message&&!N.content&&(N.content=k.message,N.segments=[{type:"text",content:k.message}]),N.streaming=!1,S(t,!1),Le(z,p(s)),G&&(Rs().then(()=>{Ve(i)}),bs.refreshAll().then(()=>{J&&Ts(`/${J.repo}/${J.entityType}/${J.entityId}`)}));break;case"error":N.content+=`
|
|
61
|
+
|
|
62
|
+
Error: ${k.message}`,N.streaming=!1,S(t,!1),Le(z,p(s));break}},l.signal)}function I(){l?.abort(),S(t,!1);const f=p(s)[p(s).length-1];f?.streaming&&(f.streaming=!1),fetch("/api/chat/abort",{method:"POST",credentials:"include"}).catch(()=>{})}function se(){I(),S(s,[],!0),p(n)&&p(c)&&Le(p(n),p(s))}function m(f){const A=pe().filter(B=>B.id!==f);if(qe(A),p(n)===f){const B=A.sort((G,J)=>J.updatedAt.localeCompare(G.updatedAt));B.length>0?(S(n,B[0].id,!0),S(s,B[0].messages.map(G=>({...G,streaming:!1})),!0),S(c,!0)):(S(n,null),S(s,[],!0),S(c,!1))}}function b(f){const A=pe().find(B=>B.id===f);A&&(I(),S(n,A.id,!0),S(s,A.messages.map(B=>({...B,streaming:!1})),!0),S(c,!0))}function C(){return pe().sort((f,z)=>z.updatedAt.localeCompare(f.updatedAt)).map(f=>({id:f.id,title:f.title,createdAt:f.createdAt,updatedAt:f.updatedAt,preview:f.messages.find(z=>z.role==="user")?.content.slice(0,80)||"",count:f.messages.length,active:f.id===p(n)}))}return{get messages(){return p(s)},get streaming(){return p(t)},get mutationCount(){return p(i)},get scrollTick(){return p(a)},get highlightedIds(){return p(o)},get activeSessionId(){return p(n)},get draftInput(){return p(h)},set draftInput(f){S(h,f,!0)},send:$,stop:I,clear:se,newSession:d,deleteSession:m,getSessions:C,loadSession:b}}const q=zr();var Ar=P('<span class="session-title svelte-1xwj6s7"> </span>'),Ir=P('<div class="session-row svelte-1xwj6s7"><!> <!></div>'),Pr=P('<div class="session-dropdown svelte-1xwj6s7"><div class="session-list svelte-1xwj6s7"></div></div>'),Cr=P('<div class="empty-state svelte-1xwj6s7"><div class="seed-prompts svelte-1xwj6s7"></div></div>'),Er=P('<div class="user-bubble svelte-1xwj6s7"> </div>'),Lr=P('<span class="tool-call svelte-1xwj6s7"> </span>'),qr=P('<div class="tool-calls svelte-1xwj6s7"></div>'),Br=P('<div class="agent-text prose svelte-1xwj6s7"><!></div>'),Mr=P('<div class="agent-text prose svelte-1xwj6s7"><!></div>'),Nr=P('<span class="streaming-dot svelte-1xwj6s7"></span>'),jr=P('<div class="agent-content svelte-1xwj6s7"><!> <!></div>'),Dr=P('<div class="message-group svelte-1xwj6s7"><!></div>'),Or=P('<div class="context-chip svelte-1xwj6s7"> </div>'),Zr=P('<aside class="chat-panel svelte-1xwj6s7"><div class="chat-header svelte-1xwj6s7"><div class="chat-header-left svelte-1xwj6s7"><!> <!></div> <!> <!></div> <div class="chat-messages svelte-1xwj6s7"><!></div> <div class="chat-input-area svelte-1xwj6s7"><!> <div class="text-input svelte-1xwj6s7"><textarea class="input-field svelte-1xwj6s7" rows="1"></textarea> <!></div></div></aside>');function Yr(r,e){Tt(e,!0);const s=/[\p{Emoji_Presentation}\p{Extended_Pictographic}]\uFE0F?/gu,n=/^\|[\s:|-]+\|$/,t=/^[ ]{0,3}([-*_])\s*(\1\s*){2,}$/;function i(g){return g.replace(s,"").replace(/^ +/gm,y=>y.replace(/ +/," ")).split(`
|
|
63
|
+
`).map(y=>n.test(y)||t.test(y)?y:y.replace(/--/g,"—")).join(`
|
|
64
|
+
`)}const a=zt("chat");let o=Se(()=>q.draftInput);function l(g){q.draftInput=g}let h=ee(!1);const c=Se(()=>(q.activeSessionId,q.getSessions().length>0));let u,d=!0;function T(){u&&(d=u.scrollHeight-u.scrollTop-u.clientHeight<40)}const $=Se(()=>{if(E.selectedSubPath)return["Summarize this document","Extract key points","What actions are here?","What decisions were made?"];if(E.selectedId){const g=E.selectedType??"entity";return[`Summarize this ${g}`,`What's related to this ${g}?`,"What actions should I take?","What decisions were made?"]}return E.activeView==="graph"?["What are the key relationships?","Which entities are most connected?","Find gaps in my graph","What decisions have been made recently?"]:["What's in my graph?","Summarize recent meetings","Who's working on what?","What decisions have been made recently?"]});async function I(){const g=p(o).trim();g&&(l(""),d=!0,q.send(g),await Xe(),m())}function se(g){g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),I())}function m(){u&&(u.scrollTop=u.scrollHeight)}fs(()=>{Xe().then(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>m())})})}),ks(()=>{q.scrollTick,d&&m()});var b=Zr(),C=R(b),f=R(C),z=R(f);te(z,{variant:"ghost",size:"icon",class:"size-6",onclick:()=>q.newSession(),children:(g,y)=>{qs(g,{size:14})},$$slots:{default:!0}});var A=D(z,2);{var B=g=>{{let y=Se(()=>p(h)?"history-active":"");te(g,{variant:"ghost",size:"icon",get class(){return`size-6 ${p(y)??""}`},onclick:()=>S(h,!p(h)),children:(j,fe)=>{Bs(j,{size:14})},$$slots:{default:!0}})}};O(A,g=>{p(c)&&g(B)})}_(f);var G=D(f,2);te(G,{variant:"ghost",size:"icon",class:"size-6",get onclick(){return a.close},children:(g,y)=>{$s(g,{size:14})},$$slots:{default:!0}});var J=D(G,2);{var Oe=g=>{var y=Pr(),j=R(y);Re(j,21,()=>q.getSessions(),Te,(fe,L)=>{var K=Ir(),ye=R(K);{let ce=Se(()=>p(L).active?"active":"");te(ye,{variant:"ghost",get class(){return`session-item ${p(ce)??""}`},onclick:()=>{q.loadSession(p(L).id),S(h,!1)},children:(Y,ne)=>{var ae=Ar(),He=R(ae,!0);_(ae),le(()=>_e(He,p(L).title)),w(Y,ae)},$$slots:{default:!0}})}var ke=D(ye,2);te(ke,{variant:"ghost",size:"icon",class:"session-delete-btn",title:"Delete session",onclick:ce=>{ce.stopPropagation(),q.deleteSession(p(L).id)},children:(ce,Y)=>{_s(ce,{size:12})},$$slots:{default:!0}}),_(K),w(fe,K)}),_(j),_(y),w(g,y)};O(J,g=>{p(h)&&g(Oe)})}_(C);var re=D(C,2),Ze=R(re);{var k=g=>{var y=Cr(),j=R(y);Re(j,21,()=>p($),Te,(fe,L)=>{te(fe,{variant:"outline",class:"seed-prompt",onclick:()=>{d=!0,q.send(p(L)),Xe().then(()=>m())},children:(K,ye)=>{Ie();var ke=ns();le(()=>_e(ke,p(L))),w(K,ke)},$$slots:{default:!0}})}),_(j),_(y),w(g,y)},N=g=>{var y=V(),j=X(y);Re(j,17,()=>q.messages,Te,(fe,L)=>{var K=Dr(),ye=R(K);{var ke=Y=>{var ne=Er(),ae=R(ne,!0);_(ne),le(()=>_e(ae,p(L).content)),w(Y,ne)},ce=Y=>{var ne=jr(),ae=R(ne);{var He=F=>{var ie=V(),Qe=X(ie);Re(Qe,17,()=>p(L).segments,Te,(Xt,$e)=>{var ut=V(),Jt=X(ut);{var Kt=xe=>{var he=qr();Re(he,21,()=>p($e).names,Te,(We,es)=>{var Ge=Lr(),ts=R(Ge,!0);_(Ge),le(()=>_e(ts,p(es))),w(We,Ge)}),_(he),w(xe,he)},Yt=xe=>{var he=Br(),We=R(he);mt(We,()=>v.parse(i(p($e).content))),_(he),w(xe,he)};O(Jt,xe=>{p($e).type==="tools"?xe(Kt):p($e).type==="text"&&p($e).content&&xe(Yt,1)})}w(Xt,ut)}),w(F,ie)},Ft=F=>{var ie=Mr(),Qe=R(ie);mt(Qe,()=>v.parse(i(p(L).content))),_(ie),w(F,ie)};O(ae,F=>{p(L).segments&&p(L).segments.length>0?F(He):p(L).content&&F(Ft,1)})}var Ut=D(ae,2);{var Vt=F=>{var ie=Nr();w(F,ie)};O(Ut,F=>{p(L).streaming&&F(Vt)})}_(ne),w(Y,ne)};O(ye,Y=>{p(L).role==="user"?Y(ke):Y(ce,!1)})}_(K),w(fe,K)}),w(g,y)};O(Ze,g=>{q.messages.length===0?g(k):g(N,!1)})}_(re),ys(re,g=>u=g,()=>u);var Z=D(re,2),H=R(Z);{var Ht=g=>{var y=Or(),j=R(y);_(y),le(()=>_e(j,`${E.selectedType??""}/${E.selectedId??""}`)),w(g,y)};O(H,g=>{E.selectedId&&g(Ht)})}var pt=D(H,2),oe=R(pt);xs(oe);var Qt=D(oe,2);{var Wt=g=>{te(g,{variant:"ghost",size:"icon",class:"size-7 stop-btn send-btn",onclick:()=>q.stop(),children:(y,j)=>{Ls(y,{size:16})},$$slots:{default:!0}})},Gt=g=>{te(g,{variant:"ghost",size:"icon",class:"size-7 send-btn",onclick:I,children:(y,j)=>{Ss(y,{size:14})},$$slots:{default:!0}})};O(Qt,g=>{q.streaming?g(Wt):g(Gt,!1)})}_(pt),_(Z),_(b),le(()=>{It(oe,"placeholder",E.selectedId?"Ask about this entity...":"Ask about your workspace..."),ws(oe,p(o)),oe.disabled=q.streaming}),rs("scroll",re,T),gt("input",oe,g=>l(g.target.value)),gt("keydown",oe,se),w(r,b),At()}ss(["input","keydown"]);export{Yr as C,Kr as V,q as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c,a as p}from"./0x0awhVy.js";import"./Bl1mtM70.js";import{f as i}from"./8FUQuwgM.js";import{I as l,s as m}from"./
|
|
1
|
+
import{c,a as p}from"./0x0awhVy.js";import"./Bl1mtM70.js";import{f as i}from"./8FUQuwgM.js";import{I as l,s as m}from"./Scb_NG-a.js";import{l as d,s as f}from"./CbJfRYJV.js";function k(t,o){const e=d(o,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M20 6 9 17l-5-5"}]];l(t,f({name:"check"},()=>e,{get iconNode(){return r},children:(a,$)=>{var s=c(),n=i(s);m(n,o,"default",{}),p(a,s)},$$slots:{default:!0}}))}export{k as C};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./EDLlAC9C.js","./8FUQuwgM.js","./CbJfRYJV.js","./0x0awhVy.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as C,a as u,r as Va,q as xi,o as lt,p as Ft,f as T,m as Ua,u as Ha,t as Ut,s as Pe,j as ja,e as Gt,g as Or}from"./0x0awhVy.js";import{bd as qa,l as Si,G as Pi,bu as Ya,k as Ga,F as $,bv as Us,ai as Xa,g as o,D as x,aH as ir,q as Y,e as Vn,b as hr,w as R,f as b,x as F,z as k,v as G,T as _,bp as Za,a7 as Zt,br as Qa,t as Hs,bs as Ja,u as el,a as at,S as tl,aF as me,bw as nl,bt as Ci,R as Io,y as Ve,A as fe,aj as Ar,bn as Oi}from"./8FUQuwgM.js";import{B as rl,l as Le,p as S,s as re,i as z,r as Ce,b as Fo}from"./CbJfRYJV.js";import{d as Je,c as po,e as U,k as Et,j as Ro,s as ro,i as Pn,w as B,a as wt,q as js,t as ol,g as mo}from"./EDLlAC9C.js";import{c as L,_ as sl}from"./DJKRyj_1.js";import{e as It,b as il,i as Vt,r as Dt,n as st}from"./
|
|
2
|
+
import{c as C,a as u,r as Va,q as xi,o as lt,p as Ft,f as T,m as Ua,u as Ha,t as Ut,s as Pe,j as ja,e as Gt,g as Or}from"./0x0awhVy.js";import{bd as qa,l as Si,G as Pi,bu as Ya,k as Ga,F as $,bv as Us,ai as Xa,g as o,D as x,aH as ir,q as Y,e as Vn,b as hr,w as R,f as b,x as F,z as k,v as G,T as _,bp as Za,a7 as Zt,br as Qa,t as Hs,bs as Ja,u as el,a as at,S as tl,aF as me,bw as nl,bt as Ci,R as Io,y as Ve,A as fe,aj as Ar,bn as Oi}from"./8FUQuwgM.js";import{B as rl,l as Le,p as S,s as re,i as z,r as Ce,b as Fo}from"./CbJfRYJV.js";import{d as Je,c as po,e as U,k as Et,j as Ro,s as ro,i as Pn,w as B,a as wt,q as js,t as ol,g as mo}from"./EDLlAC9C.js";import{c as L,_ as sl}from"./DJKRyj_1.js";import{e as It,b as il,i as Vt,r as Dt,n as st}from"./glgUBDR2.js";import{g as un}from"./CIZkRAuY.js";import{c as vt,a as Kr,B as it,I as Br}from"./BVmVTxxa.js";import"./Bl1mtM70.js";import{i as al}from"./DxxhVGi2.js";function ll(){return Symbol(qa)}const cl=Symbol("NaN");function ul(t,e,n){Si&&Pi();var r=new rl(t),s=!Ya();Ga(()=>{var a=e();a!==a&&(a=cl),s&&a!==null&&typeof a=="object"&&(a={}),r.ensure(a,n)})}function Ue(t,e,n,r,s){Si&&Pi();var a=e.$$slots?.[n],i=!1;a===!0&&(a=e.children,i=!0),a===void 0||a(t,i?()=>r:r)}class xo extends Map{#e=new Map;#t=$(0);#n=$(0);#r=Us||-1;constructor(e){if(super(),e){for(var[n,r]of e)super.set(n,r);this.#n.v=super.size}}#o(e){return Us===this.#r?$(e):Xa(e)}has(e){var n=this.#e,r=n.get(e);if(r===void 0)if(super.has(e))r=this.#o(0),n.set(e,r);else return o(this.#t),!1;return o(r),!0}forEach(e,n){this.#s(),super.forEach(e,n)}get(e){var n=this.#e,r=n.get(e);if(r===void 0)if(super.has(e))r=this.#o(0),n.set(e,r);else{o(this.#t);return}return o(r),super.get(e)}set(e,n){var r=this.#e,s=r.get(e),a=super.get(e),i=super.set(e,n),l=this.#t;if(s===void 0)s=this.#o(0),r.set(e,s),x(this.#n,super.size),ir(l);else if(a!==n){ir(s);var c=l.reactions===null?null:new Set(l.reactions),h=c===null||!s.reactions?.every(m=>c.has(m));h&&ir(l)}return i}delete(e){var n=this.#e,r=n.get(e),s=super.delete(e);return r!==void 0&&(n.delete(e),x(r,-1)),s&&(x(this.#n,super.size),ir(this.#t)),s}clear(){if(super.size!==0){super.clear();var e=this.#e;x(this.#n,0);for(var n of e.values())x(n,-1);ir(this.#t),e.clear()}}#s(){o(this.#t);var e=this.#e;if(this.#n.v!==e.size){for(var n of super.keys())if(!e.has(n)){var r=this.#o(0);e.set(n,r)}}for([,r]of this.#e)o(r)}keys(){return o(this.#t),super.keys()}values(){return this.#s(),super.values()}entries(){return this.#s(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return o(this.#n),super.size}}var qs=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,dl=/\n/g,fl=/^\s*/,hl=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,vl=/^:\s*/,gl=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,pl=/^[;\s]*/,ml=/^\s+|\s+$/g,yl=`
|
|
3
3
|
`,Ys="/",Gs="*",Nn="",bl="comment",wl="declaration";function _l(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,r=1;function s(f){var v=f.match(dl);v&&(n+=v.length);var P=f.lastIndexOf(yl);r=~P?f.length-P:r+f.length}function a(){var f={line:n,column:r};return function(v){return v.position=new i(f),h(),v}}function i(f){this.start=f,this.end={line:n,column:r},this.source=e.source}i.prototype.content=t;function l(f){var v=new Error(e.source+":"+n+":"+r+": "+f);if(v.reason=f,v.filename=e.source,v.line=n,v.column=r,v.source=t,!e.silent)throw v}function c(f){var v=f.exec(t);if(v){var P=v[0];return s(P),t=t.slice(P.length),v}}function h(){c(fl)}function m(f){var v;for(f=f||[];v=y();)v!==!1&&f.push(v);return f}function y(){var f=a();if(!(Ys!=t.charAt(0)||Gs!=t.charAt(1))){for(var v=2;Nn!=t.charAt(v)&&(Gs!=t.charAt(v)||Ys!=t.charAt(v+1));)++v;if(v+=2,Nn===t.charAt(v-1))return l("End of comment missing");var P=t.slice(2,v-2);return r+=2,s(P),t=t.slice(v),r+=2,f({type:bl,comment:P})}}function p(){var f=a(),v=c(hl);if(v){if(y(),!c(vl))return l("property missing ':'");var P=c(gl),E=f({type:wl,property:Xs(v[0].replace(qs,Nn)),value:P?Xs(P[0].replace(qs,Nn)):Nn});return c(pl),E}}function d(){var f=[];m(f);for(var v;v=p();)v!==!1&&(f.push(v),m(f));return f}return h(),d()}function Xs(t){return t?t.replace(ml,Nn):Nn}function xl(t,e){let n=null;if(!t||typeof t!="string")return n;const r=_l(t),s=typeof e=="function";return r.forEach(a=>{if(a.type!=="declaration")return;const{property:i,value:l}=a;s?e(i,l,a):l&&(n=n||{},n[i]=l)}),n}const Sl={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const Pl=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};const Zs=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();var Cl=Va("<svg><!><!></svg>");function je(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]),r=Le(n,["name","color","size","strokeWidth","absoluteStrokeWidth","iconNode"]);Y(e,!1);let s=S(e,"name",8,void 0),a=S(e,"color",8,"currentColor"),i=S(e,"size",8,24),l=S(e,"strokeWidth",8,2),c=S(e,"absoluteStrokeWidth",8,!1),h=S(e,"iconNode",24,()=>[]);al();var m=Cl();Je(m,(d,f,v)=>({...Sl,...d,...r,width:i(),height:i(),stroke:a(),"stroke-width":f,class:v}),[()=>Pl(r)?void 0:{"aria-hidden":"true"},()=>(Vn(c()),Vn(l()),Vn(i()),hr(()=>c()?Number(l())*24/Number(i()):l())),()=>(Vn(Zs),Vn(s()),Vn(n),hr(()=>Zs("lucide-icon","lucide",s()?`lucide-${s()}`:"",n.class)))]);var y=R(m);It(y,1,h,Vt,(d,f)=>{var v=_(()=>Za(o(f),2));let P=()=>o(v)[0],E=()=>o(v)[1];var M=C(),N=b(M);il(N,P,!0,(I,X)=>{Je(I,()=>({...E()}))}),u(d,M)});var p=F(y);Ue(p,e,"default",{}),k(m),u(t,m),G()}function Ai(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m21 21-4.34-4.34"}],["circle",{cx:"11",cy:"11",r:"8"}]];je(t,re({name:"search"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function So(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];je(t,re({name:"x"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function Er(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m9 18 6-6-6-6"}]];je(t,re({name:"chevron-right"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function Tr(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m6 9 6 6 6-6"}]];je(t,re({name:"chevron-down"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function Ol(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m16 17 5-5-5-5"}],["path",{d:"M21 12H9"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}]];je(t,re({name:"log-out"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}const Al={project:"#6e6ee8",organization:"#00c2b2",person:"#f0c246",meeting:"#ff7a00",deal:"#3ecf8e",deliverable:"#ff3864",decision:"#00a8ff",dataset:"#be00ff",process:"#f5c800",deck:"#6e6ee8",doc:"#00a8ff",document:"#a855f7",note:"#94a3b8",publication:"#ec4899",reference:"#14b8a6",task:"#f97316",role:"#ff7a00","practice-area":"#8b5cf6","case-study":"#06b6d4",standard:"#ff2aa8"};function Un(t){return t?Al[t]??"#5c5c66":"#5c5c66"}const El={person:"people","practice-area":"practice-areas","case-study":"case-studies",process:"processes"};function Tl(t){return El[t]??t+"s"}function Qs(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];je(t,re({name:"plus"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function kl(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}],["circle",{cx:"12",cy:"12",r:"3"}]];je(t,re({name:"eye"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function yo(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}],["path",{d:"m2 2 20 20"}]];je(t,re({name:"eye-off"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function kr(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]];je(t,re({name:"trash-2"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function Ml(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"}],["circle",{cx:"12",cy:"12",r:"3"}]];je(t,re({name:"settings"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function Js(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}],["path",{d:"M21 3v5h-5"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}],["path",{d:"M8 16H3v5"}]];je(t,re({name:"refresh-cw"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function Mr(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"19",cy:"12",r:"1"}],["circle",{cx:"5",cy:"12",r:"1"}]];je(t,re({name:"ellipsis"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function Il(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]];je(t,re({name:"pencil"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function ei(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12 3v12"}],["path",{d:"m17 8-5-5-5 5"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}]];je(t,re({name:"upload"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function Fl(t){return typeof t=="function"}function pr(t){return t!==null&&typeof t=="object"}const Rl=["string","number","bigint","boolean"];function Po(t){return t==null||Rl.includes(typeof t)?!0:Array.isArray(t)?t.every(e=>Po(e)):typeof t=="object"?Object.getPrototypeOf(t)===Object.prototype:!1}const qn=Symbol("box"),oo=Symbol("is-writable");function A(t,e){const n=_(t);return e?{[qn]:!0,[oo]:!0,get current(){return o(n)},set current(r){e(r)}}:{[qn]:!0,get current(){return t()}}}function mr(t){return pr(t)&&qn in t}function No(t){return mr(t)&&oo in t}function Ei(t){return mr(t)?t:Fl(t)?A(t):tn(t)}function Nl(t){return Object.entries(t).reduce((e,[n,r])=>mr(r)?(No(r)?Object.defineProperty(e,n,{get(){return r.current},set(s){r.current=s}}):Object.defineProperty(e,n,{get(){return r.current}}),e):Object.assign(e,{[n]:r}),{})}function Dl(t){return No(t)?{[qn]:!0,get current(){return t.current}}:t}function tn(t){let e=$(Zt(t));return{[qn]:!0,[oo]:!0,get current(){return o(e)},set current(n){x(e,n,!0)}}}function Ln(t){let e=$(Zt(t));return{[qn]:!0,[oo]:!0,get current(){return o(e)},set current(n){x(e,n,!0)}}}Ln.from=Ei;Ln.with=A;Ln.flatten=Nl;Ln.readonly=Dl;Ln.isBox=mr;Ln.isWritableBox=No;function Ti(...t){return function(e){for(const n of t)if(n){if(e.defaultPrevented)return;typeof n=="function"?n.call(this,e):n.current?.call(this,e)}}}const zl=/\d/,$l=["-","_","/","."];function Ll(t=""){if(!zl.test(t))return t!==t.toLowerCase()}function Bl(t){const e=[];let n="",r,s;for(const a of t){const i=$l.includes(a);if(i===!0){e.push(n),n="",r=void 0;continue}const l=Ll(a);if(s===!1){if(r===!1&&l===!0){e.push(n),n=a,r=l;continue}if(r===!0&&l===!1&&n.length>1){const c=n.at(-1);e.push(n.slice(0,Math.max(0,n.length-1))),n=c+a,r=l;continue}}n+=a,r=l,s=i}return e.push(n),e}function ki(t){return t?Bl(t).map(e=>Kl(e)).join(""):""}function Wl(t){return Vl(ki(t||""))}function Kl(t){return t?t[0].toUpperCase()+t.slice(1):""}function Vl(t){return t?t[0].toLowerCase()+t.slice(1):""}function dr(t){if(!t)return{};const e={};function n(r,s){if(r.startsWith("-moz-")||r.startsWith("-webkit-")||r.startsWith("-ms-")||r.startsWith("-o-")){e[ki(r)]=s;return}if(r.startsWith("--")){e[r]=s;return}e[Wl(r)]=s}return xl(t,n),e}function Dn(...t){return(...e)=>{for(const n of t)typeof n=="function"&&n(...e)}}function Ul(t,e){const n=RegExp(t,"g");return r=>{if(typeof r!="string")throw new TypeError(`expected an argument of type string, but got ${typeof r}`);return r.match(n)?r.replace(n,e):r}}const Hl=Ul(/[A-Z]/,t=>`-${t.toLowerCase()}`);function jl(t){if(!t||typeof t!="object"||Array.isArray(t))throw new TypeError(`expected an argument of type object, but got ${typeof t}`);return Object.keys(t).map(e=>`${Hl(e)}: ${t[e]};`).join(`
|
|
4
4
|
`)}function Mi(t={}){return jl(t).replace(`
|
|
5
5
|
`," ")}const ql=["onabort","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onauxclick","onbeforeinput","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncompositionend","oncompositionstart","oncompositionupdate","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectionchange","onselectstart","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onvolumechange","onwaiting","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel"],Yl=new Set(ql);function Gl(t){return Yl.has(t)}function $e(...t){const e={...t[0]};for(let n=1;n<t.length;n++){const r=t[n];if(r){for(const s of Object.keys(r)){const a=e[s],i=r[s],l=typeof a=="function",c=typeof i=="function";if(l&&Gl(s)){const h=a,m=i;e[s]=Ti(h,m)}else if(l&&c)e[s]=Dn(a,i);else if(s==="class"){const h=Po(a),m=Po(i);h&&m?e[s]=po(a,i):h?e[s]=po(a):m&&(e[s]=po(i))}else if(s==="style"){const h=typeof a=="object",m=typeof i=="object",y=typeof a=="string",p=typeof i=="string";if(h&&m)e[s]={...a,...i};else if(h&&p){const d=dr(i);e[s]={...a,...d}}else if(y&&m){const d=dr(a);e[s]={...d,...i}}else if(y&&p){const d=dr(a),f=dr(i);e[s]={...d,...f}}else h?e[s]=a:m?e[s]=i:y?e[s]=a:p&&(e[s]=i)}else e[s]=i!==void 0?i:a}for(const s of Object.getOwnPropertySymbols(r)){const a=e[s],i=r[s];e[s]=i!==void 0?i:a}}}return typeof e.style=="object"&&(e.style=Mi(e.style).replaceAll(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as J,k as fe,g as h,al as te,Y as we,X as K,am as be,_ as Ie,af as $e,an as Ae,ai as ne,ao as Ce,ap as xe,Q as Ne,l as w,n as B,p as de,G as Q,aq as Oe,ar as ee,J as ke,a0 as De,K as se,s as L,o as H,C as He,as as Re,at as N,U as pe,W as he,au as X,av as Me,aw as Pe,V as Fe,a2 as Be,m as Ue,ax as ge,ay as Ve,az as ze,I as Le,aA as Ge,aB as We,a9 as Je,aC as Ye,D as d,F as b,a7 as re,b as ie,T as qe}from"./8FUQuwgM.js";import{b as Xe,i as Ke}from"./0x0awhVy.js";import{B as Qe}from"./CbJfRYJV.js";import{i as je}from"./BeqErRmy.js";import{b as oe,u as ae,w as x,a as Ze}from"./EDLlAC9C.js";function xt(e,t){return t}function et(e,t,n){for(var s=[],i=t.length,a,o=t.length,c=0;c<i;c++){let T=t[c];he(T,()=>{if(a){if(a.pending.delete(T),a.done.add(T),a.pending.size===0){var p=e.outrogroups;j(ee(a.done)),p.delete(a),p.size===0&&(e.outrogroups=null)}}else o-=1},!1)}if(o===0){var u=s.length===0&&n!==null;if(u){var E=n,l=E.parentNode;Pe(l),l.append(E),e.items.clear()}j(t,!u)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function j(e,t=!0){for(var n=0;n<e.length;n++)Fe(e[n],t)}var le;function Nt(e,t,n,s,i,a=null){var o=e,c=new Map,u=(t&ge)!==0;if(u){var E=e;o=w?B(de(E)):E.appendChild(J())}w&&Q();var l=null,T=$e(()=>{var f=n();return Oe(f)?f:f==null?[]:ee(f)}),p,g=!0;function m(){r.fallback=l,tt(r,p,o,t,s),l!==null&&(p.length===0?(l.f&N)===0?pe(l):(l.f^=N,z(l,null,o)):he(l,()=>{l=null}))}var y=fe(()=>{p=h(T);var f=p.length;let C=!1;if(w){var M=ke(o)===De;M!==(f===0)&&(o=se(),B(o),L(!1),C=!0)}for(var $=new Set,k=we,P=Ie(),I=0;I<f;I+=1){w&&H.nodeType===He&&H.data===Re&&(o=H,C=!0,L(!1));var D=p[I],F=s(D,I),v=g?null:c.get(F);v?(v.v&&te(v.v,D),v.i&&te(v.i,I),P&&k.unskip_effect(v.e)):(v=nt(c,g?o:le??=J(),D,F,I,i,t,n),g||(v.e.f|=N),c.set(F,v)),$.add(F)}if(f===0&&a&&!l&&(g?l=K(()=>a(o)):(l=K(()=>a(le??=J())),l.f|=N)),f>$.size&&be(),w&&f>0&&B(se()),!g)if(P){for(const[Se,ve]of c)$.has(Se)||k.skip_effect(ve.e);k.oncommit(m),k.ondiscard(()=>{})}else m();C&&L(!0),h(T)}),r={effect:y,items:c,outrogroups:null,fallback:l};g=!1,w&&(o=H)}function U(e){for(;e!==null&&(e.f&Me)===0;)e=e.next;return e}function tt(e,t,n,s,i){var a=(s&Ve)!==0,o=t.length,c=e.items,u=U(e.effect.first),E,l=null,T,p=[],g=[],m,y,r,f;if(a)for(f=0;f<o;f+=1)m=t[f],y=i(m,f),r=c.get(y).e,(r.f&N)===0&&(r.nodes?.a?.measure(),(T??=new Set).add(r));for(f=0;f<o;f+=1){if(m=t[f],y=i(m,f),r=c.get(y).e,e.outrogroups!==null)for(const v of e.outrogroups)v.pending.delete(r),v.done.delete(r);if((r.f&N)!==0)if(r.f^=N,r===u)z(r,null,n);else{var C=l?l.next:u;r===e.effect.last&&(e.effect.last=r.prev),r.prev&&(r.prev.next=r.next),r.next&&(r.next.prev=r.prev),O(e,l,r),O(e,r,C),z(r,C,n),l=r,p=[],g=[],u=U(l.next);continue}if((r.f&X)!==0&&(pe(r),a&&(r.nodes?.a?.unfix(),(T??=new Set).delete(r))),r!==u){if(E!==void 0&&E.has(r)){if(p.length<g.length){var M=g[0],$;l=M.prev;var k=p[0],P=p[p.length-1];for($=0;$<p.length;$+=1)z(p[$],M,n);for($=0;$<g.length;$+=1)E.delete(g[$]);O(e,k.prev,P.next),O(e,l,k),O(e,P,M),u=M,l=P,f-=1,p=[],g=[]}else E.delete(r),z(r,u,n),O(e,r.prev,r.next),O(e,r,l===null?e.effect.first:l.next),O(e,l,r),l=r;continue}for(p=[],g=[];u!==null&&u!==r;)(E??=new Set).add(u),g.push(u),u=U(u.next);if(u===null)continue}(r.f&N)===0&&p.push(r),l=r,u=U(r.next)}if(e.outrogroups!==null){for(const v of e.outrogroups)v.pending.size===0&&(j(ee(v.done)),e.outrogroups?.delete(v));e.outrogroups.size===0&&(e.outrogroups=null)}if(u!==null||E!==void 0){var I=[];if(E!==void 0)for(r of E)(r.f&X)===0&&I.push(r);for(;u!==null;)(u.f&X)===0&&u!==e.fallback&&I.push(u),u=U(u.next);var D=I.length;if(D>0){var F=(s&ge)!==0&&o===0?n:null;if(a){for(f=0;f<D;f+=1)I[f].nodes?.a?.measure();for(f=0;f<D;f+=1)I[f].nodes?.a?.fix()}et(e,I,F)}}a&&Be(()=>{if(T!==void 0)for(r of T)r.nodes?.a?.apply()})}function nt(e,t,n,s,i,a,o,c){var u=(o&Ce)!==0?(o&xe)===0?Ne(n,!1,!1):ne(n):null,E=(o&Ae)!==0?ne(i):null;return{v:u,i:E,e:K(()=>(a(t,u??n,E??i,c),()=>{e.delete(s)}))}}function z(e,t,n){if(e.nodes)for(var s=e.nodes.start,i=e.nodes.end,a=t&&(t.f&N)===0?t.nodes.start:n;s!==null;){var o=Ue(s);if(a.before(s),s===i)return;s=o}}function O(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Ot(e,t,n,s,i,a){let o=w;w&&Q();var c=null;w&&H.nodeType===ze&&(c=H,Q());var u=w?H:e,E=new Qe(u,!1);fe(()=>{const l=t()||null;var T=n||l==="svg"?We:void 0;if(l===null){E.ensure(null,null);return}return E.ensure(l,p=>{if(l){if(c=w?c:Ge(l,T),Xe(c,c),s){w&&Ke(l)&&c.append(document.createComment(""));var g=w?de(c):c.appendChild(J());w&&(g===null?L(!1):B(g)),s(c,g)}Je.nodes.end=c,p.before(c)}w&&B(p)}),()=>{}},Le),Ye(()=>{}),o&&(L(!0),B(u))}function st(){let e=b(null),t=b(null),n=b(null),s=b(null),i=b("entity"),a=b(null),o=b("general");function c(m,y){h(e)&&(h(e)!==m||h(n)!==y)&&oe(h(e)).catch(()=>{})}function u(m,y,r,f){c(m,r),d(e,m,!0),d(t,y,!0),d(n,r,!0),d(s,f??null,!0)}function E(){d(i,"entity")}function l(){d(i,"graph")}function T(){d(i,"settings")}function p(m,y,r){h(n)===r&&h(e)===m?(d(e,null),d(t,null),d(n,null)):(d(e,m,!0),d(t,y,!0),d(n,r,!0)),d(s,null)}function g(){h(e)&&oe(h(e)).catch(()=>{}),d(e,null),d(t,null),d(n,null),d(s,null)}return{get selectedRepo(){return h(e)},get selectedType(){return h(t)},get selectedId(){return h(n)},get selectedSubPath(){return h(s)},get activeView(){return h(i)},get entityPath(){return h(e)&&h(t)&&h(n)?`/${h(e)}/${h(t)}/${h(n)}`:null},get hoveredEntityId(){return h(a)},set hoveredEntityId(m){d(a,m,!0)},get settingsTab(){return h(o)},set settingsTab(m){d(o,m,!0)},select:u,deselect:g,selectOnGraph:p,showEntity:E,showGraph:l,showSettings:T}}const V=st();function kt(...e){return e.filter(Boolean).join(" ")}const rt=typeof document<"u";let ue=0;class it{#e=b(re([]));get toasts(){return h(this.#e)}set toasts(t){d(this.#e,t,!0)}#t=b(re([]));get heights(){return h(this.#t)}set heights(t){d(this.#t,t,!0)}#n=t=>{const n=this.toasts.findIndex(s=>s.id===t);return n===-1?null:n};addToast=t=>{rt&&this.toasts.unshift(t)};updateToast=({id:t,data:n,type:s,message:i})=>{const a=this.toasts.findIndex(c=>c.id===t),o=this.toasts[a];this.toasts[a]={...o,...n,id:t,title:i,type:s,updated:!0}};create=t=>{const{message:n,...s}=t,i=typeof t?.id=="number"||t.id&&t.id?.length>0?t.id:ue++,a=t.dismissible!==void 0?t.dismissible:t.dismissable!==void 0?t.dismissable:!0,o=t.type===void 0?"default":t.type;return ie(()=>{this.toasts.find(u=>u.id===i)?this.updateToast({id:i,data:t,type:o,message:n,dismissible:a}):this.addToast({...s,id:i,title:n,dismissible:a,type:o})}),i};dismiss=t=>(ie(()=>{if(t===void 0){this.toasts=this.toasts.map(s=>({...s,dismiss:!0}));return}const n=this.toasts.findIndex(s=>s.id===t);this.toasts[n]&&(this.toasts[n]={...this.toasts[n],dismiss:!0})}),t);remove=t=>{if(t===void 0){this.toasts=[];return}const n=this.#n(t);if(n!==null)return this.toasts.splice(n,1),t};message=(t,n)=>this.create({...n,type:"default",message:t});error=(t,n)=>this.create({...n,type:"error",message:t});success=(t,n)=>this.create({...n,type:"success",message:t});info=(t,n)=>this.create({...n,type:"info",message:t});warning=(t,n)=>this.create({...n,type:"warning",message:t});loading=(t,n)=>this.create({...n,type:"loading",message:t});promise=(t,n)=>{if(!n)return;let s;n.loading!==void 0&&(s=this.create({...n,promise:t,type:"loading",message:typeof n.loading=="string"?n.loading:n.loading()}));const i=t instanceof Promise?t:t();let a=s!==void 0;return i.then(o=>{if(typeof o=="object"&&o&&"ok"in o&&typeof o.ok=="boolean"&&!o.ok){a=!1;const c=ot(o);this.create({id:s,type:"error",message:c})}else if(n.success!==void 0){a=!1;const c=typeof n.success=="function"?n.success(o):n.success;this.create({id:s,type:"success",message:c})}}).catch(o=>{if(n.error!==void 0){a=!1;const c=typeof n.error=="function"?n.error(o):n.error;this.create({id:s,type:"error",message:c})}}).finally(()=>{a&&(this.dismiss(s),s=void 0),n.finally?.()}),s};custom=(t,n)=>{const s=n?.id||ue++;return this.create({component:t,id:s,...n}),s};removeHeight=t=>{this.heights=this.heights.filter(n=>n.toastId!==t)};setHeight=t=>{const n=this.#n(t.toastId);if(n===null){this.heights.push(t);return}this.heights[n]=t};reset=()=>{this.toasts=[],this.heights=[]}}function ot(e){return e&&typeof e=="object"&&"status"in e?`HTTP error! Status: ${e.status}`:`Error! ${e}`}const A=new it;function at(e,t){return A.create({message:e,...t})}class Dt{#e=qe(()=>A.toasts.filter(t=>!t.dismiss));get toasts(){return h(this.#e)}}const lt=at,S=Object.assign(lt,{success:A.success,info:A.info,warning:A.warning,error:A.error,custom:A.custom,message:A.message,promise:A.promise,dismiss:A.dismiss,loading:A.loading,getActiveToasts:()=>A.toasts.filter(e=>!e.dismiss)}),ut=800;function ct(){let e=b(!1),t=b(null),n=b(null),s=null,i=null,a=!1;function o(p,g,m,y){s&&s.repo===p&&s.type===g&&s.id===m?(y.data!==void 0&&(s.payload.data=y.data),y.content!==void 0&&(s.payload.content=y.content)):s={repo:p,type:g,id:m,payload:{...y}},c()}function c(){i&&clearTimeout(i),i=setTimeout(u,ut)}async function u(){if(i=null,!a&&s){const{repo:p,type:g,id:m,payload:y}=s;s=null,a=!0,d(e,!0),d(n,null);try{if(await ae(p,g,m,y),d(t,new Date,!0),y.data?.name){const f=x.repos.find(C=>C.name===p)?.entities.find(C=>C.id===m);f&&(f.title=y.data.name)}}catch(r){d(n,r.message??"Save failed",!0);const f=r.status??r.statusCode;(!f||f>=500)&&(s={repo:p,type:g,id:m,payload:y})}finally{d(e,!1),a=!1,s&&u()}}}function E(){i&&(clearTimeout(i),i=null),s&&u()}async function l(p,g,m,y){d(e,!0),d(n,null);try{const r=await ae(p,g,m,y);return d(t,new Date,!0),r}catch(r){return d(n,r.message??"Save failed",!0),null}finally{d(e,!1)}}function T(){d(n,null),d(t,null),s=null,i&&(clearTimeout(i),i=null)}return{get saving(){return h(e)},get lastSaved(){return h(t)},get error(){return h(n)},get hasPending(){return!!(s||a)},scheduleAutoSave:o,flush:E,saveEntity:l,reset:T}}const ft=ct();let _=null,me=null,ye=null,Ee=[],Y=null,W=1e3,q=b(!1),Te=b(null);const R=new Map,G={},Z={};function ce(e,t){R.delete(e);const n=t.entities.length,s=n===1?`${e} updated ${t.entities[0]}`:`${e} updated ${n} entities`;S(s)}function dt(e){for(const[t,n]of R)n.repo===e&&(clearTimeout(n.timer),R.delete(t))}function pt(e){const t=Ze.user?.displayName;if(e.type==="sync_progress"){const n=G[e.repo];if(n){const s=e.message.trim(),i=s.match(/^Syncing from source:\s*(.+)$/i);i&&(Z[e.repo]=`Syncing ${i[1].trim()}…`);const a=Z[e.repo]??`Syncing ${e.repo}…`;S.loading(a,{id:n,description:s,duration:36e5})}return}if(e.type==="entity_change"){if(t&&e.actor===t&&e.source==="api"){x.refreshEntities(e.repo);return}if(x.refreshEntities(e.repo),V.selectedRepo===e.repo&&V.selectedType===e.entityType&&V.selectedId===e.entityId){ft.hasPending?S(`${e.actor} also saved changes to this entity`):je();return}const s=R.get(e.actor);if(s)clearTimeout(s.timer),s.entities.includes(e.entityId)||s.entities.push(e.entityId),s.timer=setTimeout(()=>ce(e.actor,s),1e4);else{const i={entities:[e.entityId],repo:e.repo,timer:setTimeout(()=>ce(e.actor,i),1e4)};R.set(e.actor,i)}return}if(e.type==="session_commit"){if(t&&e.actor===t){d(Te,e.timestamp,!0);return}const n=e.entities.length,s=n===1?`${e.actor} saved changes to ${e.entities[0]}`:`${e.actor} saved ${n} changes in ${e.repo}`;S(s),x.refreshEntities(e.repo);return}if(e.type==="sync_complete"){if(dt(e.repo),!G[e.repo]){const n=e.created+e.updated+e.deleted,s=n===0?`Sync complete · no changes in ${e.repo}`:`Sync complete · ${n} ${n===1?"entity":"entities"} from ${e.source}`;S.success(s)}x.refreshEntities(e.repo);return}if(e.type==="collection_created"){S(`${e.actor} created collection ${e.repo}`),x.refreshEntities(e.repo);return}if(e.type==="collection_deleted"){S(`${e.actor} deleted collection ${e.repo}`);return}if(e.type==="repo_sync"){S(`${e.actor} pushed to ${e.repo}`),x.refreshEntities(e.repo);return}if(e.type==="presence"){me?.(e);return}if(e.type==="online"){ye?.(e);return}if(e.type==="access_granted"||e.type==="access_revoked"){e.type==="access_revoked"&&V.selectedRepo===e.repo&&V.deselect(),x.load();return}}function _e(){if(typeof window>"u"||_&&(_.readyState===WebSocket.OPEN||_.readyState===WebSocket.CONNECTING))return;const t=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;_=new WebSocket(t),_.binaryType="arraybuffer",_.onopen=()=>{d(q,!0),W=1e3,x.refreshAll();for(const n of Ee)n()},_.onmessage=n=>{if(!(n.data instanceof ArrayBuffer))try{const s=JSON.parse(n.data);if(s?.type==="ping"){_?.send(JSON.stringify({type:"pong"}));return}const i=s;i.type&&i.type!=="toast"&&pt(i)}catch{}},_.onclose=()=>{d(q,!1),_=null,Y=setTimeout(()=>{W=Math.min(W*2,1e4),_e()},W)},_.onerror=()=>{}}function ht(){Y&&(clearTimeout(Y),Y=null),_&&(_.close(),_=null),d(q,!1);for(const[,e]of R)clearTimeout(e.timer);R.clear()}function gt(e,t=4e3){S(e,{duration:t})}function mt(e,t){const n=crypto.randomUUID();return t?.loading?S.loading(e,{id:n,duration:36e5}):S(e,{id:n}),n}function yt(e,t,n){if(n?.loading){S.loading(t,{id:e});return}/failed|error/i.test(t)?S.error(t,{id:e,duration:n?.duration??6e3}):S.success(t,{id:e,duration:n?.duration??4e3})}function Et(e){const t=crypto.randomUUID();G[e]=t,S.loading(`Syncing ${e}…`,{id:t,duration:36e5})}function Tt(e,t,n){const s=G[e];s&&(delete G[e],delete Z[e],n?S.error(t,{id:s,duration:6e3}):S.success(t,{id:s,duration:4e3}))}function _t(e){me=e}function St(e){ye=e}function vt(e){Ee.push(e)}function wt(e){_?.readyState===WebSocket.OPEN&&_.send(JSON.stringify(e))}const Ht={get connected(){return h(q)},get lastAutoSaved(){return h(Te)},get ws(){return _},connect:_e,disconnect:ht,showToast:gt,showPersistentToast:mt,updateToast:yt,startSyncToast:Et,finishSyncToast:Tt,send:wt,setPresenceHandler:_t,setOnlineHandler:St,addConnectHandler:vt};export{Dt as S,ft as a,Ot as b,kt as c,Nt as e,xt as i,V as n,Ht as r,A as t};
|
|
1
|
+
import{j as J,k as fe,g as h,al as te,Y as we,X as K,am as be,_ as Ie,af as $e,an as Ae,ai as ne,ao as Ce,ap as xe,Q as Ne,l as w,n as B,p as de,G as Q,aq as Oe,ar as ee,J as ke,a0 as De,K as se,s as L,o as H,C as He,as as Re,at as N,U as pe,W as he,au as X,av as Me,aw as Pe,V as Fe,a2 as Be,m as Ue,ax as ge,ay as Ve,az as ze,I as Le,aA as Ge,aB as We,a9 as Je,aC as Ye,D as d,F as b,a7 as re,b as ie,T as qe}from"./8FUQuwgM.js";import{b as Xe,i as Ke}from"./0x0awhVy.js";import{B as Qe}from"./CbJfRYJV.js";import{i as je}from"./CIZkRAuY.js";import{b as oe,u as ae,w as x,a as Ze}from"./EDLlAC9C.js";function xt(e,t){return t}function et(e,t,n){for(var s=[],i=t.length,a,o=t.length,c=0;c<i;c++){let T=t[c];he(T,()=>{if(a){if(a.pending.delete(T),a.done.add(T),a.pending.size===0){var p=e.outrogroups;j(ee(a.done)),p.delete(a),p.size===0&&(e.outrogroups=null)}}else o-=1},!1)}if(o===0){var u=s.length===0&&n!==null;if(u){var E=n,l=E.parentNode;Pe(l),l.append(E),e.items.clear()}j(t,!u)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function j(e,t=!0){for(var n=0;n<e.length;n++)Fe(e[n],t)}var le;function Nt(e,t,n,s,i,a=null){var o=e,c=new Map,u=(t&ge)!==0;if(u){var E=e;o=w?B(de(E)):E.appendChild(J())}w&&Q();var l=null,T=$e(()=>{var f=n();return Oe(f)?f:f==null?[]:ee(f)}),p,g=!0;function m(){r.fallback=l,tt(r,p,o,t,s),l!==null&&(p.length===0?(l.f&N)===0?pe(l):(l.f^=N,z(l,null,o)):he(l,()=>{l=null}))}var y=fe(()=>{p=h(T);var f=p.length;let C=!1;if(w){var M=ke(o)===De;M!==(f===0)&&(o=se(),B(o),L(!1),C=!0)}for(var $=new Set,k=we,P=Ie(),I=0;I<f;I+=1){w&&H.nodeType===He&&H.data===Re&&(o=H,C=!0,L(!1));var D=p[I],F=s(D,I),v=g?null:c.get(F);v?(v.v&&te(v.v,D),v.i&&te(v.i,I),P&&k.unskip_effect(v.e)):(v=nt(c,g?o:le??=J(),D,F,I,i,t,n),g||(v.e.f|=N),c.set(F,v)),$.add(F)}if(f===0&&a&&!l&&(g?l=K(()=>a(o)):(l=K(()=>a(le??=J())),l.f|=N)),f>$.size&&be(),w&&f>0&&B(se()),!g)if(P){for(const[Se,ve]of c)$.has(Se)||k.skip_effect(ve.e);k.oncommit(m),k.ondiscard(()=>{})}else m();C&&L(!0),h(T)}),r={effect:y,items:c,outrogroups:null,fallback:l};g=!1,w&&(o=H)}function U(e){for(;e!==null&&(e.f&Me)===0;)e=e.next;return e}function tt(e,t,n,s,i){var a=(s&Ve)!==0,o=t.length,c=e.items,u=U(e.effect.first),E,l=null,T,p=[],g=[],m,y,r,f;if(a)for(f=0;f<o;f+=1)m=t[f],y=i(m,f),r=c.get(y).e,(r.f&N)===0&&(r.nodes?.a?.measure(),(T??=new Set).add(r));for(f=0;f<o;f+=1){if(m=t[f],y=i(m,f),r=c.get(y).e,e.outrogroups!==null)for(const v of e.outrogroups)v.pending.delete(r),v.done.delete(r);if((r.f&N)!==0)if(r.f^=N,r===u)z(r,null,n);else{var C=l?l.next:u;r===e.effect.last&&(e.effect.last=r.prev),r.prev&&(r.prev.next=r.next),r.next&&(r.next.prev=r.prev),O(e,l,r),O(e,r,C),z(r,C,n),l=r,p=[],g=[],u=U(l.next);continue}if((r.f&X)!==0&&(pe(r),a&&(r.nodes?.a?.unfix(),(T??=new Set).delete(r))),r!==u){if(E!==void 0&&E.has(r)){if(p.length<g.length){var M=g[0],$;l=M.prev;var k=p[0],P=p[p.length-1];for($=0;$<p.length;$+=1)z(p[$],M,n);for($=0;$<g.length;$+=1)E.delete(g[$]);O(e,k.prev,P.next),O(e,l,k),O(e,P,M),u=M,l=P,f-=1,p=[],g=[]}else E.delete(r),z(r,u,n),O(e,r.prev,r.next),O(e,r,l===null?e.effect.first:l.next),O(e,l,r),l=r;continue}for(p=[],g=[];u!==null&&u!==r;)(E??=new Set).add(u),g.push(u),u=U(u.next);if(u===null)continue}(r.f&N)===0&&p.push(r),l=r,u=U(r.next)}if(e.outrogroups!==null){for(const v of e.outrogroups)v.pending.size===0&&(j(ee(v.done)),e.outrogroups?.delete(v));e.outrogroups.size===0&&(e.outrogroups=null)}if(u!==null||E!==void 0){var I=[];if(E!==void 0)for(r of E)(r.f&X)===0&&I.push(r);for(;u!==null;)(u.f&X)===0&&u!==e.fallback&&I.push(u),u=U(u.next);var D=I.length;if(D>0){var F=(s&ge)!==0&&o===0?n:null;if(a){for(f=0;f<D;f+=1)I[f].nodes?.a?.measure();for(f=0;f<D;f+=1)I[f].nodes?.a?.fix()}et(e,I,F)}}a&&Be(()=>{if(T!==void 0)for(r of T)r.nodes?.a?.apply()})}function nt(e,t,n,s,i,a,o,c){var u=(o&Ce)!==0?(o&xe)===0?Ne(n,!1,!1):ne(n):null,E=(o&Ae)!==0?ne(i):null;return{v:u,i:E,e:K(()=>(a(t,u??n,E??i,c),()=>{e.delete(s)}))}}function z(e,t,n){if(e.nodes)for(var s=e.nodes.start,i=e.nodes.end,a=t&&(t.f&N)===0?t.nodes.start:n;s!==null;){var o=Ue(s);if(a.before(s),s===i)return;s=o}}function O(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Ot(e,t,n,s,i,a){let o=w;w&&Q();var c=null;w&&H.nodeType===ze&&(c=H,Q());var u=w?H:e,E=new Qe(u,!1);fe(()=>{const l=t()||null;var T=n||l==="svg"?We:void 0;if(l===null){E.ensure(null,null);return}return E.ensure(l,p=>{if(l){if(c=w?c:Ge(l,T),Xe(c,c),s){w&&Ke(l)&&c.append(document.createComment(""));var g=w?de(c):c.appendChild(J());w&&(g===null?L(!1):B(g)),s(c,g)}Je.nodes.end=c,p.before(c)}w&&B(p)}),()=>{}},Le),Ye(()=>{}),o&&(L(!0),B(u))}function st(){let e=b(null),t=b(null),n=b(null),s=b(null),i=b("entity"),a=b(null),o=b("general");function c(m,y){h(e)&&(h(e)!==m||h(n)!==y)&&oe(h(e)).catch(()=>{})}function u(m,y,r,f){c(m,r),d(e,m,!0),d(t,y,!0),d(n,r,!0),d(s,f??null,!0)}function E(){d(i,"entity")}function l(){d(i,"graph")}function T(){d(i,"settings")}function p(m,y,r){h(n)===r&&h(e)===m?(d(e,null),d(t,null),d(n,null)):(d(e,m,!0),d(t,y,!0),d(n,r,!0)),d(s,null)}function g(){h(e)&&oe(h(e)).catch(()=>{}),d(e,null),d(t,null),d(n,null),d(s,null)}return{get selectedRepo(){return h(e)},get selectedType(){return h(t)},get selectedId(){return h(n)},get selectedSubPath(){return h(s)},get activeView(){return h(i)},get entityPath(){return h(e)&&h(t)&&h(n)?`/${h(e)}/${h(t)}/${h(n)}`:null},get hoveredEntityId(){return h(a)},set hoveredEntityId(m){d(a,m,!0)},get settingsTab(){return h(o)},set settingsTab(m){d(o,m,!0)},select:u,deselect:g,selectOnGraph:p,showEntity:E,showGraph:l,showSettings:T}}const V=st();function kt(...e){return e.filter(Boolean).join(" ")}const rt=typeof document<"u";let ue=0;class it{#e=b(re([]));get toasts(){return h(this.#e)}set toasts(t){d(this.#e,t,!0)}#t=b(re([]));get heights(){return h(this.#t)}set heights(t){d(this.#t,t,!0)}#n=t=>{const n=this.toasts.findIndex(s=>s.id===t);return n===-1?null:n};addToast=t=>{rt&&this.toasts.unshift(t)};updateToast=({id:t,data:n,type:s,message:i})=>{const a=this.toasts.findIndex(c=>c.id===t),o=this.toasts[a];this.toasts[a]={...o,...n,id:t,title:i,type:s,updated:!0}};create=t=>{const{message:n,...s}=t,i=typeof t?.id=="number"||t.id&&t.id?.length>0?t.id:ue++,a=t.dismissible!==void 0?t.dismissible:t.dismissable!==void 0?t.dismissable:!0,o=t.type===void 0?"default":t.type;return ie(()=>{this.toasts.find(u=>u.id===i)?this.updateToast({id:i,data:t,type:o,message:n,dismissible:a}):this.addToast({...s,id:i,title:n,dismissible:a,type:o})}),i};dismiss=t=>(ie(()=>{if(t===void 0){this.toasts=this.toasts.map(s=>({...s,dismiss:!0}));return}const n=this.toasts.findIndex(s=>s.id===t);this.toasts[n]&&(this.toasts[n]={...this.toasts[n],dismiss:!0})}),t);remove=t=>{if(t===void 0){this.toasts=[];return}const n=this.#n(t);if(n!==null)return this.toasts.splice(n,1),t};message=(t,n)=>this.create({...n,type:"default",message:t});error=(t,n)=>this.create({...n,type:"error",message:t});success=(t,n)=>this.create({...n,type:"success",message:t});info=(t,n)=>this.create({...n,type:"info",message:t});warning=(t,n)=>this.create({...n,type:"warning",message:t});loading=(t,n)=>this.create({...n,type:"loading",message:t});promise=(t,n)=>{if(!n)return;let s;n.loading!==void 0&&(s=this.create({...n,promise:t,type:"loading",message:typeof n.loading=="string"?n.loading:n.loading()}));const i=t instanceof Promise?t:t();let a=s!==void 0;return i.then(o=>{if(typeof o=="object"&&o&&"ok"in o&&typeof o.ok=="boolean"&&!o.ok){a=!1;const c=ot(o);this.create({id:s,type:"error",message:c})}else if(n.success!==void 0){a=!1;const c=typeof n.success=="function"?n.success(o):n.success;this.create({id:s,type:"success",message:c})}}).catch(o=>{if(n.error!==void 0){a=!1;const c=typeof n.error=="function"?n.error(o):n.error;this.create({id:s,type:"error",message:c})}}).finally(()=>{a&&(this.dismiss(s),s=void 0),n.finally?.()}),s};custom=(t,n)=>{const s=n?.id||ue++;return this.create({component:t,id:s,...n}),s};removeHeight=t=>{this.heights=this.heights.filter(n=>n.toastId!==t)};setHeight=t=>{const n=this.#n(t.toastId);if(n===null){this.heights.push(t);return}this.heights[n]=t};reset=()=>{this.toasts=[],this.heights=[]}}function ot(e){return e&&typeof e=="object"&&"status"in e?`HTTP error! Status: ${e.status}`:`Error! ${e}`}const A=new it;function at(e,t){return A.create({message:e,...t})}class Dt{#e=qe(()=>A.toasts.filter(t=>!t.dismiss));get toasts(){return h(this.#e)}}const lt=at,S=Object.assign(lt,{success:A.success,info:A.info,warning:A.warning,error:A.error,custom:A.custom,message:A.message,promise:A.promise,dismiss:A.dismiss,loading:A.loading,getActiveToasts:()=>A.toasts.filter(e=>!e.dismiss)}),ut=800;function ct(){let e=b(!1),t=b(null),n=b(null),s=null,i=null,a=!1;function o(p,g,m,y){s&&s.repo===p&&s.type===g&&s.id===m?(y.data!==void 0&&(s.payload.data=y.data),y.content!==void 0&&(s.payload.content=y.content)):s={repo:p,type:g,id:m,payload:{...y}},c()}function c(){i&&clearTimeout(i),i=setTimeout(u,ut)}async function u(){if(i=null,!a&&s){const{repo:p,type:g,id:m,payload:y}=s;s=null,a=!0,d(e,!0),d(n,null);try{if(await ae(p,g,m,y),d(t,new Date,!0),y.data?.name){const f=x.repos.find(C=>C.name===p)?.entities.find(C=>C.id===m);f&&(f.title=y.data.name)}}catch(r){d(n,r.message??"Save failed",!0);const f=r.status??r.statusCode;(!f||f>=500)&&(s={repo:p,type:g,id:m,payload:y})}finally{d(e,!1),a=!1,s&&u()}}}function E(){i&&(clearTimeout(i),i=null),s&&u()}async function l(p,g,m,y){d(e,!0),d(n,null);try{const r=await ae(p,g,m,y);return d(t,new Date,!0),r}catch(r){return d(n,r.message??"Save failed",!0),null}finally{d(e,!1)}}function T(){d(n,null),d(t,null),s=null,i&&(clearTimeout(i),i=null)}return{get saving(){return h(e)},get lastSaved(){return h(t)},get error(){return h(n)},get hasPending(){return!!(s||a)},scheduleAutoSave:o,flush:E,saveEntity:l,reset:T}}const ft=ct();let _=null,me=null,ye=null,Ee=[],Y=null,W=1e3,q=b(!1),Te=b(null);const R=new Map,G={},Z={};function ce(e,t){R.delete(e);const n=t.entities.length,s=n===1?`${e} updated ${t.entities[0]}`:`${e} updated ${n} entities`;S(s)}function dt(e){for(const[t,n]of R)n.repo===e&&(clearTimeout(n.timer),R.delete(t))}function pt(e){const t=Ze.user?.displayName;if(e.type==="sync_progress"){const n=G[e.repo];if(n){const s=e.message.trim(),i=s.match(/^Syncing from source:\s*(.+)$/i);i&&(Z[e.repo]=`Syncing ${i[1].trim()}…`);const a=Z[e.repo]??`Syncing ${e.repo}…`;S.loading(a,{id:n,description:s,duration:36e5})}return}if(e.type==="entity_change"){if(t&&e.actor===t&&e.source==="api"){x.refreshEntities(e.repo);return}if(x.refreshEntities(e.repo),V.selectedRepo===e.repo&&V.selectedType===e.entityType&&V.selectedId===e.entityId){ft.hasPending?S(`${e.actor} also saved changes to this entity`):je();return}const s=R.get(e.actor);if(s)clearTimeout(s.timer),s.entities.includes(e.entityId)||s.entities.push(e.entityId),s.timer=setTimeout(()=>ce(e.actor,s),1e4);else{const i={entities:[e.entityId],repo:e.repo,timer:setTimeout(()=>ce(e.actor,i),1e4)};R.set(e.actor,i)}return}if(e.type==="session_commit"){if(t&&e.actor===t){d(Te,e.timestamp,!0);return}const n=e.entities.length,s=n===1?`${e.actor} saved changes to ${e.entities[0]}`:`${e.actor} saved ${n} changes in ${e.repo}`;S(s),x.refreshEntities(e.repo);return}if(e.type==="sync_complete"){if(dt(e.repo),!G[e.repo]){const n=e.created+e.updated+e.deleted,s=n===0?`Sync complete · no changes in ${e.repo}`:`Sync complete · ${n} ${n===1?"entity":"entities"} from ${e.source}`;S.success(s)}x.refreshEntities(e.repo);return}if(e.type==="collection_created"){S(`${e.actor} created collection ${e.repo}`),x.refreshEntities(e.repo);return}if(e.type==="collection_deleted"){S(`${e.actor} deleted collection ${e.repo}`);return}if(e.type==="repo_sync"){S(`${e.actor} pushed to ${e.repo}`),x.refreshEntities(e.repo);return}if(e.type==="presence"){me?.(e);return}if(e.type==="online"){ye?.(e);return}if(e.type==="access_granted"||e.type==="access_revoked"){e.type==="access_revoked"&&V.selectedRepo===e.repo&&V.deselect(),x.load();return}}function _e(){if(typeof window>"u"||_&&(_.readyState===WebSocket.OPEN||_.readyState===WebSocket.CONNECTING))return;const t=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;_=new WebSocket(t),_.binaryType="arraybuffer",_.onopen=()=>{d(q,!0),W=1e3,x.refreshAll();for(const n of Ee)n()},_.onmessage=n=>{if(!(n.data instanceof ArrayBuffer))try{const s=JSON.parse(n.data);if(s?.type==="ping"){_?.send(JSON.stringify({type:"pong"}));return}const i=s;i.type&&i.type!=="toast"&&pt(i)}catch{}},_.onclose=()=>{d(q,!1),_=null,Y=setTimeout(()=>{W=Math.min(W*2,1e4),_e()},W)},_.onerror=()=>{}}function ht(){Y&&(clearTimeout(Y),Y=null),_&&(_.close(),_=null),d(q,!1);for(const[,e]of R)clearTimeout(e.timer);R.clear()}function gt(e,t=4e3){S(e,{duration:t})}function mt(e,t){const n=crypto.randomUUID();return t?.loading?S.loading(e,{id:n,duration:36e5}):S(e,{id:n}),n}function yt(e,t,n){if(n?.loading){S.loading(t,{id:e});return}/failed|error/i.test(t)?S.error(t,{id:e,duration:n?.duration??6e3}):S.success(t,{id:e,duration:n?.duration??4e3})}function Et(e){const t=crypto.randomUUID();G[e]=t,S.loading(`Syncing ${e}…`,{id:t,duration:36e5})}function Tt(e,t,n){const s=G[e];s&&(delete G[e],delete Z[e],n?S.error(t,{id:s,duration:6e3}):S.success(t,{id:s,duration:4e3}))}function _t(e){me=e}function St(e){ye=e}function vt(e){Ee.push(e)}function wt(e){_?.readyState===WebSocket.OPEN&&_.send(JSON.stringify(e))}const Ht={get connected(){return h(q)},get lastAutoSaved(){return h(Te)},get ws(){return _},connect:_e,disconnect:ht,showToast:gt,showPersistentToast:mt,updateToast:yt,startSyncToast:Et,finishSyncToast:Tt,send:wt,setPresenceHandler:_t,setOnlineHandler:St,addConnectHandler:vt};export{Dt as S,ft as a,Ot as b,kt as c,Nt as e,xt as i,V as n,Ht as r,A as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.
|
|
2
|
-
import{c as b,_ as u}from"../chunks/DJKRyj_1.js";import{D as y,N as G,g as m,O as N,P as Q,Q as Y,q as B,u as H,a as J,R as K,S as U,f as E,x as W,v as X,F as p,w as Z,z as $,T as P,A as tt}from"../chunks/8FUQuwgM.js";import{h as et,m as rt,u as st,a as h,c as O,f as I,t as at,s as ot}from"../chunks/0x0awhVy.js";import{p as R,i as x,b as A}from"../chunks/CbJfRYJV.js";function nt(a){return class extends it{constructor(t){super({component:a,...t})}}}class it{#e;#t;constructor(t){var s=new Map,n=(e,r)=>{var c=Y(r,!1,!1);return s.set(e,c),c};const i=new Proxy({...t.props||{},$$events:{}},{get(e,r){return m(s.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===G?!0:(m(s.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,c){return y(s.get(r)??n(r,c),c),Reflect.set(e,r,c)}});this.#t=(t.hydrate?et:rt)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),(!t?.props?.$$host||t.sync===!1)&&N(),this.#e=i.$$events;for(const e of Object.keys(this.#t))e==="$set"||e==="$destroy"||e==="$on"||Q(this,e,{get(){return this.#t[e]},set(r){this.#t[e]=r},enumerable:!0});this.#t.$set=e=>{Object.assign(i,e)},this.#t.$destroy=()=>{st(this.#t)}}$set(t){this.#t.$set(t)}$on(t,s){this.#e[t]=this.#e[t]||[];const n=(...i)=>s.call(this,...i);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(i=>i!==n)}}$destroy(){this.#t.$destroy()}}const gt={};var ct=I('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),ut=I("<!> <!>",1);function mt(a,t){B(t,!0);let s=R(t,"components",23,()=>[]),n=R(t,"data_0",3,null),i=R(t,"data_1",3,null);H(()=>t.stores.page.set(t.page)),J(()=>{t.stores,t.page,t.constructors,s(),t.form,n(),i(),t.stores.page.notify()});let e=p(!1),r=p(!1),c=p(null);K(()=>{const o=t.stores.page.subscribe(()=>{m(e)&&(y(r,!0),U().then(()=>{y(c,document.title||"untitled page",!0)}))});return y(e,!0),o});const w=P(()=>t.constructors[1]);var D=ut(),L=E(D);{var j=o=>{const _=P(()=>t.constructors[0]);var d=O(),v=E(d);b(v,()=>m(_),(l,f)=>{A(f(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(g,dt)=>{var T=O(),M=E(T);b(M,()=>m(w),(q,z)=>{A(z(q,{get data(){return i()},get form(){return t.form},get params(){return t.page.params}}),F=>s()[1]=F,()=>s()?.[1])}),h(g,T)},$$slots:{default:!0}}),g=>s()[0]=g,()=>s()?.[0])}),h(o,d)},k=o=>{const _=P(()=>t.constructors[0]);var d=O(),v=E(d);b(v,()=>m(_),(l,f)=>{A(f(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),g=>s()[0]=g,()=>s()?.[0])}),h(o,d)};x(L,o=>{t.constructors[1]?o(j):o(k,!1)})}var C=W(L,2);{var S=o=>{var _=ct(),d=Z(_);{var v=l=>{var f=at();tt(()=>ot(f,m(c))),h(l,f)};x(d,l=>{m(r)&&l(v)})}$(_),h(o,_)};x(C,o=>{m(e)&&o(S)})}h(a,D),X()}const Et=nt(mt),yt=[()=>u(()=>import("../nodes/0.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.Q3C-jhjE.js","../chunks/DJKRyj_1.js","../chunks/8FUQuwgM.js","../chunks/CbJfRYJV.js","../chunks/0x0awhVy.js","../chunks/EDLlAC9C.js","../chunks/C7R6dA2m.js","../chunks/CIZkRAuY.js","../chunks/glgUBDR2.js","../chunks/Bl1mtM70.js","../assets/0.CupILLQs.css","../nodes/1.BPCfgPXb.js","../chunks/DxxhVGi2.js","../nodes/2.Bdsd2uts.js","../chunks/Scb_NG-a.js","../chunks/BVmVTxxa.js","../assets/AppShell.D3hRAjzT.css","../chunks/DKIqe64p.js","../assets/ChatPanel.CP-_8txt.css","../assets/2.DRHi7ABa.css","../nodes/3.Doh56lgy.js","../chunks/DVuLyxG5.js","../chunks/CqkleIqs.js","../assets/3.C-bIa9M8.css","../nodes/4.CD5YzRYT.js","../assets/4.BhKgiXd2.css","../nodes/5.DN4bEWf-.js","../assets/5.CydFyZSu.css","../nodes/6.BfA9chPb.js","../assets/6.kqeOo0OW.css","../nodes/7.DhU0-U33.js","../assets/7.CseIx7qQ.css","../nodes/8.wSRycWoC.js","../assets/8.BYpFDZHK.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as b,_ as u}from"../chunks/DJKRyj_1.js";import{D as y,N as G,g as m,O as N,P as Q,Q as Y,q as B,u as H,a as J,R as K,S as U,f as E,x as W,v as X,F as p,w as Z,z as $,T as P,A as tt}from"../chunks/8FUQuwgM.js";import{h as et,m as rt,u as st,a as h,c as O,f as I,t as at,s as ot}from"../chunks/0x0awhVy.js";import{p as R,i as x,b as A}from"../chunks/CbJfRYJV.js";function nt(a){return class extends it{constructor(t){super({component:a,...t})}}}class it{#e;#t;constructor(t){var s=new Map,n=(e,r)=>{var c=Y(r,!1,!1);return s.set(e,c),c};const i=new Proxy({...t.props||{},$$events:{}},{get(e,r){return m(s.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===G?!0:(m(s.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,c){return y(s.get(r)??n(r,c),c),Reflect.set(e,r,c)}});this.#t=(t.hydrate?et:rt)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),(!t?.props?.$$host||t.sync===!1)&&N(),this.#e=i.$$events;for(const e of Object.keys(this.#t))e==="$set"||e==="$destroy"||e==="$on"||Q(this,e,{get(){return this.#t[e]},set(r){this.#t[e]=r},enumerable:!0});this.#t.$set=e=>{Object.assign(i,e)},this.#t.$destroy=()=>{st(this.#t)}}$set(t){this.#t.$set(t)}$on(t,s){this.#e[t]=this.#e[t]||[];const n=(...i)=>s.call(this,...i);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(i=>i!==n)}}$destroy(){this.#t.$destroy()}}const gt={};var ct=I('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),ut=I("<!> <!>",1);function mt(a,t){B(t,!0);let s=R(t,"components",23,()=>[]),n=R(t,"data_0",3,null),i=R(t,"data_1",3,null);H(()=>t.stores.page.set(t.page)),J(()=>{t.stores,t.page,t.constructors,s(),t.form,n(),i(),t.stores.page.notify()});let e=p(!1),r=p(!1),c=p(null);K(()=>{const o=t.stores.page.subscribe(()=>{m(e)&&(y(r,!0),U().then(()=>{y(c,document.title||"untitled page",!0)}))});return y(e,!0),o});const w=P(()=>t.constructors[1]);var D=ut(),L=E(D);{var j=o=>{const _=P(()=>t.constructors[0]);var d=O(),v=E(d);b(v,()=>m(_),(l,f)=>{A(f(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(g,dt)=>{var T=O(),M=E(T);b(M,()=>m(w),(q,z)=>{A(z(q,{get data(){return i()},get form(){return t.form},get params(){return t.page.params}}),F=>s()[1]=F,()=>s()?.[1])}),h(g,T)},$$slots:{default:!0}}),g=>s()[0]=g,()=>s()?.[0])}),h(o,d)},k=o=>{const _=P(()=>t.constructors[0]);var d=O(),v=E(d);b(v,()=>m(_),(l,f)=>{A(f(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),g=>s()[0]=g,()=>s()?.[0])}),h(o,d)};x(L,o=>{t.constructors[1]?o(j):o(k,!1)})}var C=W(L,2);{var S=o=>{var _=ct(),d=Z(_);{var v=l=>{var f=at();tt(()=>ot(f,m(c))),h(l,f)};x(d,l=>{m(r)&&l(v)})}$(_),h(o,_)};x(C,o=>{m(e)&&o(S)})}h(a,D),X()}const Et=nt(mt),yt=[()=>u(()=>import("../nodes/0.Q3C-jhjE.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url),()=>u(()=>import("../nodes/1.BPCfgPXb.js"),__vite__mapDeps([11,4,2,9,12,7]),import.meta.url),()=>u(()=>import("../nodes/2.Bdsd2uts.js"),__vite__mapDeps([13,4,2,9,3,12,14,5,1,8,7,15,16,17,18,19]),import.meta.url),()=>u(()=>import("../nodes/3.Doh56lgy.js"),__vite__mapDeps([20,5,2,3,4,1,8,7,14,15,9,12,16,17,18,21,22,23]),import.meta.url),()=>u(()=>import("../nodes/4.CD5YzRYT.js"),__vite__mapDeps([24,5,2,3,4,14,1,8,7,15,9,12,16,25]),import.meta.url),()=>u(()=>import("../nodes/5.DN4bEWf-.js"),__vite__mapDeps([26,4,2,3,14,5,1,8,7,15,9,12,16,17,18,27]),import.meta.url),()=>u(()=>import("../nodes/6.BfA9chPb.js"),__vite__mapDeps([28,4,2,3,6,7,5,15,29]),import.meta.url),()=>u(()=>import("../nodes/7.DhU0-U33.js"),__vite__mapDeps([30,4,2,9,12,14,3,5,1,8,7,15,16,21,31]),import.meta.url),()=>u(()=>import("../nodes/8.wSRycWoC.js"),__vite__mapDeps([32,4,2,3,6,7,5,15,33]),import.meta.url)],bt=[],pt={"/":[2],"/graph":[5],"/login":[6],"/settings":[7],"/setup":[8],"/[repo]/[type]/[id]":[3],"/[repo]/[type]/[id]/edit":[4]},V={handleError:(({error:a})=>{console.error(a)}),reroute:(()=>{}),transport:{}},_t=Object.fromEntries(Object.entries(V.transport).map(([a,t])=>[a,t.decode])),Pt=Object.fromEntries(Object.entries(V.transport).map(([a,t])=>[a,t.encode])),Ot=!1,Rt=(a,t)=>_t[a](t);export{Rt as decode,_t as decoders,pt as dictionary,Pt as encoders,Ot as hash,V as hooks,gt as matchers,yt as nodes,Et as root,bt as server_loads};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as o,a as r}from"../chunks/CIZkRAuY.js";export{o as load_css,r as start};
|