studiograph 1.3.44-next.2 → 1.3.44-next.21

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.
Files changed (97) hide show
  1. package/dist/server/routes/insights-api.js +7 -1
  2. package/dist/server/routes/insights-api.js.map +1 -1
  3. package/dist/services/auth-service.d.ts +2 -0
  4. package/dist/services/auth-service.js +15 -1
  5. package/dist/services/auth-service.js.map +1 -1
  6. package/dist/services/insights.js +52 -24
  7. package/dist/services/insights.js.map +1 -1
  8. package/dist/services/sync/model-factory.d.ts +6 -3
  9. package/dist/services/sync/model-factory.js +19 -5
  10. package/dist/services/sync/model-factory.js.map +1 -1
  11. package/dist/web/_app/immutable/assets/2.usgqms6b.css +1 -0
  12. package/dist/web/_app/immutable/assets/4.B3dbj90y.css +1 -0
  13. package/dist/web/_app/immutable/assets/{7.5LBMlZdT.css → 7.D55lTQ_F.css} +1 -1
  14. package/dist/web/_app/immutable/assets/8.DKYjn_lM.css +1 -0
  15. package/dist/web/_app/immutable/assets/ViewToolbar.CnlOM0gQ.css +1 -0
  16. package/dist/web/_app/immutable/chunks/1BE_eYuA.js +1 -0
  17. package/dist/web/_app/immutable/chunks/{Sk0ODu4Y.js → B1c_qzmY.js} +1 -1
  18. package/dist/web/_app/immutable/chunks/{CFtRXHDP.js → BKHfe9E-.js} +1 -1
  19. package/dist/web/_app/immutable/chunks/{Diui_MO0.js → BN6gr1HX.js} +1 -1
  20. package/dist/web/_app/immutable/chunks/{DC9z5DEo.js → BVhp5b7F.js} +1 -1
  21. package/dist/web/_app/immutable/chunks/BZ2Q53D5.js +1 -0
  22. package/dist/web/_app/immutable/chunks/{Bs4ovbtO.js → BdNoKWAr.js} +2 -2
  23. package/dist/web/_app/immutable/chunks/BgRr0V7g.js +1 -0
  24. package/dist/web/_app/immutable/chunks/BpdrS9kL.js +1 -0
  25. package/dist/web/_app/immutable/chunks/{DQJwHeKh.js → BzjUB_Ym.js} +1 -1
  26. package/dist/web/_app/immutable/chunks/{BU2bHQbQ.js → C1S8fyYX.js} +1 -1
  27. package/dist/web/_app/immutable/chunks/{CSzKZPD4.js → C74mA5aC.js} +1 -1
  28. package/dist/web/_app/immutable/chunks/{DSh-OF2y.js → CCA2E2CK.js} +1 -1
  29. package/dist/web/_app/immutable/chunks/{DodWDTE5.js → Ca2kuiZq.js} +1 -1
  30. package/dist/web/_app/immutable/chunks/CwUXqlAx.js +1 -0
  31. package/dist/web/_app/immutable/chunks/{APIqItee.js → CwnWYvfz.js} +1 -1
  32. package/dist/web/_app/immutable/chunks/{BUcIsKRk.js → D-H9HeD_.js} +1 -1
  33. package/dist/web/_app/immutable/chunks/{DQ5NTKSo.js → D8mTIH9Y.js} +1 -1
  34. package/dist/web/_app/immutable/chunks/DD3_vCgV.js +1 -0
  35. package/dist/web/_app/immutable/chunks/{D-yNNNdf.js → DHholpIc.js} +1 -1
  36. package/dist/web/_app/immutable/chunks/{vZ2iBqLE.js → DIBaaeCL.js} +1 -1
  37. package/dist/web/_app/immutable/chunks/DLZAjAct.js +1 -0
  38. package/dist/web/_app/immutable/chunks/DO03XMS-.js +1 -0
  39. package/dist/web/_app/immutable/chunks/DYLAPjKD.js +1 -0
  40. package/dist/web/_app/immutable/chunks/DeyUjeaz.js +1 -0
  41. package/dist/web/_app/immutable/chunks/Dgs7g6Xf.js +1 -0
  42. package/dist/web/_app/immutable/chunks/{CRnhIQbv.js → DkuxRPZv.js} +1 -1
  43. package/dist/web/_app/immutable/chunks/Mtmwulo1.js +1 -0
  44. package/dist/web/_app/immutable/chunks/NuvuAeCX.js +1 -0
  45. package/dist/web/_app/immutable/chunks/csGnu8Rb.js +1 -0
  46. package/dist/web/_app/immutable/chunks/e8QVPHqJ.js +5 -0
  47. package/dist/web/_app/immutable/chunks/oz3vOf3Y.js +1 -0
  48. package/dist/web/_app/immutable/chunks/{DiWKchgv.js → pQmxOXKv.js} +1 -1
  49. package/dist/web/_app/immutable/chunks/{b0XUoOIH.js → usxM-xOh.js} +2 -2
  50. package/dist/web/_app/immutable/chunks/y7AXCX7T.js +1 -0
  51. package/dist/web/_app/immutable/chunks/{DT3KtxWU.js → yUs562n0.js} +1 -1
  52. package/dist/web/_app/immutable/entry/{app.DA5OyPOi.js → app.Ci1ytk_v.js} +2 -2
  53. package/dist/web/_app/immutable/entry/start.DNk71wbw.js +1 -0
  54. package/dist/web/_app/immutable/nodes/0.D4NmzO9T.js +2 -0
  55. package/dist/web/_app/immutable/nodes/{1.y3j9wcQE.js → 1.B49NrV3g.js} +1 -1
  56. package/dist/web/_app/immutable/nodes/{10.D03BZcr1.js → 10.OXZpT8w9.js} +1 -1
  57. package/dist/web/_app/immutable/nodes/2.DaqdIYKU.js +84 -0
  58. package/dist/web/_app/immutable/nodes/3.Q_RC4D9P.js +1 -0
  59. package/dist/web/_app/immutable/nodes/4.CIDSQYhF.js +11 -0
  60. package/dist/web/_app/immutable/nodes/{5.CipwuwB3.js → 5.U-zEu0Mw.js} +1 -1
  61. package/dist/web/_app/immutable/nodes/{6.Daxwm3Lw.js → 6.SYsyu9GD.js} +1 -1
  62. package/dist/web/_app/immutable/nodes/7.BLgQGI-C.js +2 -0
  63. package/dist/web/_app/immutable/nodes/8.67Laxdj-.js +1 -0
  64. package/dist/web/_app/immutable/nodes/{9.BuTZk7Le.js → 9.D0aRCiZD.js} +1 -1
  65. package/dist/web/_app/version.json +1 -1
  66. package/dist/web/index.html +11 -11
  67. package/package.json +1 -1
  68. package/dist/web/_app/immutable/assets/2.DNpjFx0k.css +0 -1
  69. package/dist/web/_app/immutable/assets/4.CjSyz-ka.css +0 -1
  70. package/dist/web/_app/immutable/assets/8.DfcI2i9H.css +0 -1
  71. package/dist/web/_app/immutable/assets/ViewToolbar.BX74Ki7U.css +0 -1
  72. package/dist/web/_app/immutable/chunks/0rsp5-Up.js +0 -1
  73. package/dist/web/_app/immutable/chunks/0wBGAod7.js +0 -1
  74. package/dist/web/_app/immutable/chunks/B3NI-DOv.js +0 -1
  75. package/dist/web/_app/immutable/chunks/BAAbylyg.js +0 -1
  76. package/dist/web/_app/immutable/chunks/BHue2Ock.js +0 -1
  77. package/dist/web/_app/immutable/chunks/BPXdu_FX.js +0 -1
  78. package/dist/web/_app/immutable/chunks/BgBJ0u3M.js +0 -1
  79. package/dist/web/_app/immutable/chunks/Bnl5ADsW.js +0 -1
  80. package/dist/web/_app/immutable/chunks/Bt5_mycY.js +0 -1
  81. package/dist/web/_app/immutable/chunks/By_Wtb5J.js +0 -1
  82. package/dist/web/_app/immutable/chunks/DCVmM0L5.js +0 -1
  83. package/dist/web/_app/immutable/chunks/DHtLlmE0.js +0 -1
  84. package/dist/web/_app/immutable/chunks/DQYNi3YK.js +0 -5
  85. package/dist/web/_app/immutable/chunks/DSkxw4Ss.js +0 -1
  86. package/dist/web/_app/immutable/chunks/DVx_0hnZ.js +0 -1
  87. package/dist/web/_app/immutable/chunks/KHKAD2Ng.js +0 -1
  88. package/dist/web/_app/immutable/chunks/azUmHUDT.js +0 -1
  89. package/dist/web/_app/immutable/chunks/lsAKkphT.js +0 -1
  90. package/dist/web/_app/immutable/entry/start.DTjSVtws.js +0 -1
  91. package/dist/web/_app/immutable/nodes/0.BIvpQ3Qk.js +0 -2
  92. package/dist/web/_app/immutable/nodes/2.Du0xZVQg.js +0 -84
  93. package/dist/web/_app/immutable/nodes/3.weQEi2lI.js +0 -1
  94. package/dist/web/_app/immutable/nodes/4.DJyhWznw.js +0 -11
  95. package/dist/web/_app/immutable/nodes/7.TxeJDMtw.js +0 -2
  96. package/dist/web/_app/immutable/nodes/8.DWNdmB4l.js +0 -1
  97. /package/dist/web/_app/immutable/assets/{checkbox.D6tMDJWk.css → index.D6tMDJWk.css} +0 -0
@@ -1 +1 @@
1
- import{g as H,a as w,t as J,s as $,b as I}from"../chunks/b0XUoOIH.js";import{p as K,t as q,b as M,ac as O,s as r,g as a,e as o,a3 as l,c as t,a4 as Q,ad as R,r as s,n as A}from"../chunks/DSh-OF2y.js";import{i as T}from"../chunks/DT3KtxWU.js";import{h as V}from"../chunks/B3NI-DOv.js";import{g as W}from"../chunks/BAAbylyg.js";import{a as B}from"../chunks/Sk0ODu4Y.js";import{w as X}from"../chunks/DSkxw4Ss.js";import{B as Z}from"../chunks/DQ5NTKSo.js";import{I as S}from"../chunks/APIqItee.js";var ee=I('<p class="error-msg svelte-g40i6i"> </p>'),ae=I('<div class="setup-page svelte-g40i6i"><div class="setup-card svelte-g40i6i"><div class="logo svelte-g40i6i"><div class="logo-icon svelte-g40i6i"> </div> <span class="logo-text svelte-g40i6i"> </span></div> <p class="subtitle svelte-g40i6i">Create your admin account to get started.</p> <form class="svelte-g40i6i"><label class="field svelte-g40i6i"><span class="field-label svelte-g40i6i">Name</span> <!></label> <label class="field svelte-g40i6i"><span class="field-label svelte-g40i6i">Email</span> <!></label> <label class="field svelte-g40i6i"><span class="field-label svelte-g40i6i">Password</span> <!> <span class="field-hint svelte-g40i6i">At least 8 characters</span></label> <!> <!></form></div></div>');function ve(P,D){K(D,!0);const n=Q(()=>B.workspaceName||"Studiograph");let u=o(""),v=o(""),d=o(""),p=o(""),c=o(!1);async function E(e){e.preventDefault(),r(p,""),r(c,!0);try{await B.setup(a(u),a(v),a(d)||void 0),X.load(),W("/")}catch(i){r(p,i.message||"Setup failed",!0)}finally{r(c,!1)}}var m=ae();V("g40i6i",e=>{O(()=>{R.title=`Setup — ${a(n)??""}`})});var k=t(m),f=t(k),g=t(f),L=t(g,!0);s(g);var C=l(g,2),U=t(C,!0);s(C),s(f);var b=l(f,4),_=t(b),Y=l(t(_),2);S(Y,{type:"text",placeholder:"Your name",autocomplete:"name",autofocus:!0,class:"field-input",get value(){return a(d)},set value(e){r(d,e,!0)}}),s(_);var h=l(_,2),j=l(t(h),2);S(j,{type:"email",required:!0,autocomplete:"email",class:"field-input",get value(){return a(u)},set value(e){r(u,e,!0)}}),s(h);var x=l(h,2),z=l(t(x),2);S(z,{type:"password",required:!0,minlength:8,autocomplete:"new-password",class:"field-input",get value(){return a(v)},set value(e){r(v,e,!0)}}),A(2),s(x);var N=l(x,2);{var F=e=>{var i=ee(),y=t(i,!0);s(i),q(()=>$(y,a(p))),w(e,i)};T(N,e=>{a(p)&&e(F)})}var G=l(N,2);Z(G,{variant:"accent",type:"submit",class:"submit-btn",get disabled(){return a(c)},children:(e,i)=>{A();var y=J("Create account");w(e,y)},$$slots:{default:!0}}),s(b),s(k),s(m),q(e=>{$(L,e),$(U,a(n))},[()=>a(n).charAt(0).toUpperCase()]),H("submit",b,E),w(P,m),M()}export{ve as component};
1
+ import{g as H,a as w,t as J,s as $,b as I}from"../chunks/usxM-xOh.js";import{p as K,t as q,b as M,ac as O,s as r,g as a,e as o,a3 as l,c as t,a4 as Q,ad as R,r as s,n as A}from"../chunks/CCA2E2CK.js";import{i as T}from"../chunks/yUs562n0.js";import{h as V}from"../chunks/DD3_vCgV.js";import{g as W}from"../chunks/csGnu8Rb.js";import{a as B}from"../chunks/B1c_qzmY.js";import{w as X}from"../chunks/BgRr0V7g.js";import{B as Z}from"../chunks/D8mTIH9Y.js";import{I as S}from"../chunks/CwnWYvfz.js";var ee=I('<p class="error-msg svelte-g40i6i"> </p>'),ae=I('<div class="setup-page svelte-g40i6i"><div class="setup-card svelte-g40i6i"><div class="logo svelte-g40i6i"><div class="logo-icon svelte-g40i6i"> </div> <span class="logo-text svelte-g40i6i"> </span></div> <p class="subtitle svelte-g40i6i">Create your admin account to get started.</p> <form class="svelte-g40i6i"><label class="field svelte-g40i6i"><span class="field-label svelte-g40i6i">Name</span> <!></label> <label class="field svelte-g40i6i"><span class="field-label svelte-g40i6i">Email</span> <!></label> <label class="field svelte-g40i6i"><span class="field-label svelte-g40i6i">Password</span> <!> <span class="field-hint svelte-g40i6i">At least 8 characters</span></label> <!> <!></form></div></div>');function ve(P,D){K(D,!0);const n=Q(()=>B.workspaceName||"Studiograph");let u=o(""),v=o(""),d=o(""),p=o(""),c=o(!1);async function E(e){e.preventDefault(),r(p,""),r(c,!0);try{await B.setup(a(u),a(v),a(d)||void 0),X.load(),W("/")}catch(i){r(p,i.message||"Setup failed",!0)}finally{r(c,!1)}}var m=ae();V("g40i6i",e=>{O(()=>{R.title=`Setup — ${a(n)??""}`})});var k=t(m),f=t(k),g=t(f),L=t(g,!0);s(g);var C=l(g,2),U=t(C,!0);s(C),s(f);var b=l(f,4),_=t(b),Y=l(t(_),2);S(Y,{type:"text",placeholder:"Your name",autocomplete:"name",autofocus:!0,class:"field-input",get value(){return a(d)},set value(e){r(d,e,!0)}}),s(_);var h=l(_,2),j=l(t(h),2);S(j,{type:"email",required:!0,autocomplete:"email",class:"field-input",get value(){return a(u)},set value(e){r(u,e,!0)}}),s(h);var x=l(h,2),z=l(t(x),2);S(z,{type:"password",required:!0,minlength:8,autocomplete:"new-password",class:"field-input",get value(){return a(v)},set value(e){r(v,e,!0)}}),A(2),s(x);var N=l(x,2);{var F=e=>{var i=ee(),y=t(i,!0);s(i),q(()=>$(y,a(p))),w(e,i)};T(N,e=>{a(p)&&e(F)})}var G=l(N,2);Z(G,{variant:"accent",type:"submit",class:"submit-btn",get disabled(){return a(c)},children:(e,i)=>{A();var y=J("Create account");w(e,y)},$$slots:{default:!0}}),s(b),s(k),s(m),q(e=>{$(L,e),$(U,a(n))},[()=>a(n).charAt(0).toUpperCase()]),H("submit",b,E),w(P,m),M()}export{ve as component};
@@ -0,0 +1,84 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/BN6gr1HX.js","../chunks/usxM-xOh.js","../chunks/CCA2E2CK.js","../chunks/yUs562n0.js","../chunks/DHholpIc.js","../chunks/D-H9HeD_.js","../chunks/BpdrS9kL.js","../chunks/DkuxRPZv.js","../chunks/BKHfe9E-.js","../chunks/BdNoKWAr.js","../chunks/PPVm8Dsz.js","../chunks/csGnu8Rb.js","../chunks/BgRr0V7g.js","../chunks/B1c_qzmY.js","../chunks/BVhp5b7F.js","../chunks/NuvuAeCX.js","../chunks/DIBaaeCL.js","../assets/Toaster.rN8r_Hzv.css"])))=>i.map(i=>d[i]);
2
+ import{q as mn,a as u,s as B,f as ne,p as $s,c as W,b as $,t as qt,d as Ln,g as Tt,e as kr}from"../chunks/usxM-xOh.js";import{t as C,j as _n,q as bn,an as ha,bu as va,x as kn,C as fa,X as ga,bp as ma,bm as _a,k as ba,be as ka,br as $a,bv as wa,o as As,p as _e,l as te,s as b,d as D,g as t,a as Xe,c as m,n as Q,r as f,b as be,m as re,a0 as x,ae as Pt,a4 as z,e as me,a2 as Vr,f as ws,a3 as w,a1 as Os,aD as Fs,ax as as,aE as Ms,bs as xa,bw as Vn}from"../chunks/CCA2E2CK.js";import{a as He,s as tr,c as br,b as Wr,d as ya}from"../chunks/DkuxRPZv.js";import{i as T,b as Hs}from"../chunks/yUs562n0.js";import{_ as Es}from"../chunks/PPVm8Dsz.js";import{e as tt,i as ct}from"../chunks/BpdrS9kL.js";import{c as V}from"../chunks/NuvuAeCX.js";import{s as Pr,a as za}from"../chunks/BKHfe9E-.js";import{g as cr}from"../chunks/csGnu8Rb.js";import{i as Je}from"../chunks/DIBaaeCL.js";import{l as se,p as M,r as Mr,s as Zs}from"../chunks/DHholpIc.js";import{C as Xr,A as is}from"../chunks/Dgs7g6Xf.js";import{a as ls,C as Sa}from"../chunks/BZ2Q53D5.js";import{w as R,k as $n,l as Ta,t as Pa}from"../chunks/BgRr0V7g.js";import{n as Ce}from"../chunks/BVhp5b7F.js";import{a as mt}from"../chunks/B1c_qzmY.js";import{e as Rr,p as Ra}from"../chunks/CdeYcEuU.js";import{S as wn,A as Ca}from"../chunks/C74mA5aC.js";import{j as Aa,T as Qr,k as Ma}from"../chunks/1BE_eYuA.js";import{R as xn}from"../chunks/DLZAjAct.js";import{D as js,a as Bn,b as On,c as Ea,e as qs,d as Ia,E as Fn,C as Da}from"../chunks/oz3vOf3Y.js";import{C as os,T as Ha,a as cs,P as ds,b as us,I as Gt,R as ps,p as Is,S as yn,c as zn,d as Sn,e as Tn}from"../chunks/DeyUjeaz.js";import{r as Xt}from"../chunks/BdNoKWAr.js";import{c as Jr,B as Me}from"../chunks/D8mTIH9Y.js";import{f as xs,am as La,h as _t,m as ys,C as Va,a as Ns,b as Zn,w as Ba,S as Oa,E as Fa,ai as Za,c as ja,an as Pn,ak as qa,d as Na,p as Ua,ao as Ka}from"../chunks/e8QVPHqJ.js";import{I as fs}from"../chunks/CwnWYvfz.js";import{A as jn,a as Ya}from"../chunks/pQmxOXKv.js";import{chatStore as gt}from"../chunks/C1S8fyYX.js";function Rn(n,e,r=!1,a=!1,s=!1){var o=n,l="";C(()=>{var d=ha;if(l===(l=e()??"")){_n&&bn();return}if(d.nodes!==null&&(va(d.nodes.start,d.nodes.end),d.nodes=null),l!==""){if(_n){kn.data;for(var i=bn(),k=i;i!==null&&(i.nodeType!==fa||i.data!=="");)k=i,i=ga(i);if(i===null)throw ma(),_a;mn(kn,k),o=ba(i);return}var _=r?$a:a?wa:void 0,v=ka(r?"svg":a?"math":"template",_);v.innerHTML=l;var h=r||a?v:v.content;if(mn(As(h),h.lastChild),r||a)for(;As(h);)o.before(As(h));else o.before(h)}})}var Wa=ne("<title> </title>"),Qa=ne('<svg><!><path d="M29,27.5859l-7.5521-7.5521a11.0177,11.0177,0,1,0-1.4141,1.4141L27.5859,29ZM4,13a9,9,0,1,1,9,9A9.01,9.01,0,0,1,4,13Z"></path></svg>');function qn(n,e){const r=se(e,["children","$$slots","$$events","$$legacy"]),a=se(r,["size","title"]);_e(e,!1);const s=re(),o=re();let l=M(e,"size",8,16),d=M(e,"title",8,void 0);te(()=>(D(r),D(d())),()=>{b(s,r["aria-label"]||r["aria-labelledby"]||d())}),te(()=>(t(s),D(r)),()=>{b(o,{"aria-hidden":t(s)?void 0:!0,role:t(s)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),Xe(),Je();var i=Qa();He(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:l(),height:l(),...t(o),...a}));var k=m(i);{var _=v=>{var h=Wa(),y=m(h,!0);f(h),C(()=>B(y,d())),u(v,h)};T(k,v=>{d()&&v(_)})}Q(),f(i),u(n,i),be()}var Ga=ne("<title> </title>"),Xa=ne('<svg><!><path d="M6,30H18a2.0023,2.0023,0,0,0,2-2V25H18v3H6V4H18V7h2V4a2.0023,2.0023,0,0,0-2-2H6A2.0023,2.0023,0,0,0,4,4V28A2.0023,2.0023,0,0,0,6,30Z"></path><path d="M20.586 20.586 24.172 17 10 17 10 15 24.172 15 20.586 11.414 22 10 28 16 22 22 20.586 20.586z"></path></svg>');function Ja(n,e){const r=se(e,["children","$$slots","$$events","$$legacy"]),a=se(r,["size","title"]);_e(e,!1);const s=re(),o=re();let l=M(e,"size",8,16),d=M(e,"title",8,void 0);te(()=>(D(r),D(d())),()=>{b(s,r["aria-label"]||r["aria-labelledby"]||d())}),te(()=>(t(s),D(r)),()=>{b(o,{"aria-hidden":t(s)?void 0:!0,role:t(s)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),Xe(),Je();var i=Xa();He(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:l(),height:l(),...t(o),...a}));var k=m(i);{var _=v=>{var h=Ga(),y=m(h,!0);f(h),C(()=>B(y,d())),u(v,h)};T(k,v=>{d()&&v(_)})}Q(2),f(i),u(n,i),be()}var ei=ne("<title> </title>"),ti=ne('<svg><!><path d="M27.4,14.7l-6.1-6.1C21,8.2,20.5,8,20,8h-8c-1.1,0-2,0.9-2,2v18c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V16.1 C28,15.6,27.8,15.1,27.4,14.7z M20,10l5.9,6H20V10z M12,28V10h6v6c0,1.1,0.9,2,2,2h6l0,10H12z"></path><path d="M6,18H4V4c0-1.1,0.9-2,2-2h14v2H6V18z"></path></svg>');function ri(n,e){const r=se(e,["children","$$slots","$$events","$$legacy"]),a=se(r,["size","title"]);_e(e,!1);const s=re(),o=re();let l=M(e,"size",8,16),d=M(e,"title",8,void 0);te(()=>(D(r),D(d())),()=>{b(s,r["aria-label"]||r["aria-labelledby"]||d())}),te(()=>(t(s),D(r)),()=>{b(o,{"aria-hidden":t(s)?void 0:!0,role:t(s)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),Xe(),Je();var i=ti();He(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:l(),height:l(),...t(o),...a}));var k=m(i);{var _=v=>{var h=ei(),y=m(h,!0);f(h),C(()=>B(y,d())),u(v,h)};T(k,v=>{d()&&v(_)})}Q(2),f(i),u(n,i),be()}var si=ne("<title> </title>"),ni=ne('<svg><!><path d="M30.94,15.66A16.69,16.69,0,0,0,16,5,16.69,16.69,0,0,0,1.06,15.66a1,1,0,0,0,0,.68A16.69,16.69,0,0,0,16,27,16.69,16.69,0,0,0,30.94,16.34,1,1,0,0,0,30.94,15.66ZM16,25c-5.3,0-10.9-3.93-12.93-9C5.1,10.93,10.7,7,16,7s10.9,3.93,12.93,9C26.9,21.07,21.3,25,16,25Z"></path><path d="M16,10a6,6,0,1,0,6,6A6,6,0,0,0,16,10Zm0,10a4,4,0,1,1,4-4A4,4,0,0,1,16,20Z"></path></svg>');function ai(n,e){const r=se(e,["children","$$slots","$$events","$$legacy"]),a=se(r,["size","title"]);_e(e,!1);const s=re(),o=re();let l=M(e,"size",8,16),d=M(e,"title",8,void 0);te(()=>(D(r),D(d())),()=>{b(s,r["aria-label"]||r["aria-labelledby"]||d())}),te(()=>(t(s),D(r)),()=>{b(o,{"aria-hidden":t(s)?void 0:!0,role:t(s)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),Xe(),Je();var i=ni();He(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:l(),height:l(),...t(o),...a}));var k=m(i);{var _=v=>{var h=si(),y=m(h,!0);f(h),C(()=>B(y,d())),u(v,h)};T(k,v=>{d()&&v(_)})}Q(2),f(i),u(n,i),be()}var ii=ne("<title> </title>"),li=ne('<svg><!><path d="M5.24,22.51l1.43-1.42A14.06,14.06,0,0,1,3.07,16C5.1,10.93,10.7,7,16,7a12.38,12.38,0,0,1,4,.72l1.55-1.56A14.72,14.72,0,0,0,16,5,16.69,16.69,0,0,0,1.06,15.66a1,1,0,0,0,0,.68A16,16,0,0,0,5.24,22.51Z"></path><path d="M12,15.73a4,4,0,0,1,3.7-3.7l1.81-1.82a6,6,0,0,0-7.33,7.33Z"></path><path d="M30.94,15.66A16.4,16.4,0,0,0,25.2,8.22L30,3.41,28.59,2,2,28.59,3.41,30l5.1-5.1A15.29,15.29,0,0,0,16,27,16.69,16.69,0,0,0,30.94,16.34,1,1,0,0,0,30.94,15.66ZM20,16a4,4,0,0,1-6,3.44L19.44,14A4,4,0,0,1,20,16Zm-4,9a13.05,13.05,0,0,1-6-1.58l2.54-2.54a6,6,0,0,0,8.35-8.35l2.87-2.87A14.54,14.54,0,0,1,28.93,16C26.9,21.07,21.3,25,16,25Z"></path></svg>');function Ds(n,e){const r=se(e,["children","$$slots","$$events","$$legacy"]),a=se(r,["size","title"]);_e(e,!1);const s=re(),o=re();let l=M(e,"size",8,16),d=M(e,"title",8,void 0);te(()=>(D(r),D(d())),()=>{b(s,r["aria-label"]||r["aria-labelledby"]||d())}),te(()=>(t(s),D(r)),()=>{b(o,{"aria-hidden":t(s)?void 0:!0,role:t(s)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),Xe(),Je();var i=li();He(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:l(),height:l(),...t(o),...a}));var k=m(i);{var _=v=>{var h=ii(),y=m(h,!0);f(h),C(()=>B(y,d())),u(v,h)};T(k,v=>{d()&&v(_)})}Q(3),f(i),u(n,i),be()}var oi=ne("<title> </title>"),ci=ne('<svg><!><circle cx="8" cy="16" r="2"></circle><circle cx="16" cy="16" r="2"></circle><circle cx="24" cy="16" r="2"></circle></svg>');function hs(n,e){const r=se(e,["children","$$slots","$$events","$$legacy"]),a=se(r,["size","title"]);_e(e,!1);const s=re(),o=re();let l=M(e,"size",8,16),d=M(e,"title",8,void 0);te(()=>(D(r),D(d())),()=>{b(s,r["aria-label"]||r["aria-labelledby"]||d())}),te(()=>(t(s),D(r)),()=>{b(o,{"aria-hidden":t(s)?void 0:!0,role:t(s)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),Xe(),Je();var i=ci();He(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:l(),height:l(),...t(o),...a}));var k=m(i);{var _=v=>{var h=oi(),y=m(h,!0);f(h),C(()=>B(y,d())),u(v,h)};T(k,v=>{d()&&v(_)})}Q(3),f(i),u(n,i),be()}var di=ne("<title> </title>"),ui=ne('<svg><!><path d="M6 18 7.41 19.41 15 11.83 15 30 17 30 17 11.83 24.59 19.41 26 18 16 8 6 18z"></path><path d="M6,8V4H26V8h2V4a2,2,0,0,0-2-2H6A2,2,0,0,0,4,4V8Z"></path></svg>');function Cn(n,e){const r=se(e,["children","$$slots","$$events","$$legacy"]),a=se(r,["size","title"]);_e(e,!1);const s=re(),o=re();let l=M(e,"size",8,16),d=M(e,"title",8,void 0);te(()=>(D(r),D(d())),()=>{b(s,r["aria-label"]||r["aria-labelledby"]||d())}),te(()=>(t(s),D(r)),()=>{b(o,{"aria-hidden":t(s)?void 0:!0,role:t(s)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),Xe(),Je();var i=ui();He(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:l(),height:l(),...t(o),...a}));var k=m(i);{var _=v=>{var h=di(),y=m(h,!0);f(h),C(()=>B(y,d())),u(v,h)};T(k,v=>{d()&&v(_)})}Q(2),f(i),u(n,i),be()}var pi=$("<button><!></button>");function hi(n,e){const r=$s();_e(e,!0);let a=M(e,"id",19,()=>xs(r)),s=M(e,"ref",15,null),o=M(e,"disabled",3,!1),l=Mr(e,["$$slots","$$events","$$legacy","children","child","id","ref","disabled"]);const d=La.create({variant:_t(()=>"close"),id:_t(()=>a()),ref:_t(()=>s(),y=>s(y)),disabled:_t(()=>!!o())}),i=z(()=>ys(l,d.props));var k=W(),_=x(k);{var v=y=>{var H=W(),L=x(H);tr(L,()=>e.child,()=>({props:t(i)})),u(y,H)},h=y=>{var H=pi();He(H,()=>({...t(i)}));var L=m(H);tr(L,()=>e.children??Pt),f(H),u(y,H)};T(_,y=>{e.child?y(v):y(h,!1)})}u(n,k),be()}const gs=Na({component:"tabs",parts:["root","list","trigger","content"]}),Us=new Va("Tabs.Root");class Ks{static create(e){return Us.set(new Ks(e))}opts;attachment;rovingFocusGroup;#t=me(ws([]));get triggerIds(){return t(this.#t)}set triggerIds(e){b(this.#t,e,!0)}valueToTriggerId=new Pn;valueToContentId=new Pn;constructor(e){this.opts=e,this.attachment=Ns(e.ref),this.rovingFocusGroup=new qa({candidateAttr:gs.trigger,rootNode:this.opts.ref,loop:this.opts.loop,orientation:this.opts.orientation})}registerTrigger(e,r){return this.triggerIds.push(e),this.valueToTriggerId.set(r,e),()=>{this.triggerIds=this.triggerIds.filter(a=>a!==e),this.valueToTriggerId.delete(r)}}registerContent(e,r){return this.valueToContentId.set(r,e),()=>{this.valueToContentId.delete(r)}}setValue(e){this.opts.value.current=e}#e=z(()=>({id:this.opts.id.current,"data-orientation":this.opts.orientation.current,[gs.root]:"",...this.attachment}));get props(){return t(this.#e)}set props(e){b(this.#e,e)}}class Ys{static create(e){return new Ys(e,Us.get())}opts;root;attachment;#t=z(()=>this.root.opts.disabled.current);constructor(e,r){this.opts=e,this.root=r,this.attachment=Ns(e.ref)}#e=z(()=>({id:this.opts.id.current,role:"tablist","aria-orientation":this.root.opts.orientation.current,"data-orientation":this.root.opts.orientation.current,[gs.list]:"","data-disabled":Zn(t(this.#t)),...this.attachment}));get props(){return t(this.#e)}set props(e){b(this.#e,e)}}class Ws{static create(e){return new Ws(e,Us.get())}opts;root;attachment;#t=me(0);#e=z(()=>this.root.opts.value.current===this.opts.value.current);#r=z(()=>this.opts.disabled.current||this.root.opts.disabled.current);#a=z(()=>this.root.valueToContentId.get(this.opts.value.current));constructor(e,r){this.opts=e,this.root=r,this.attachment=Ns(e.ref),Ba([()=>this.opts.id.current,()=>this.opts.value.current],([a,s])=>this.root.registerTrigger(a,s)),Vr(()=>{this.root.triggerIds.length,t(this.#e)||!this.root.opts.value.current?b(this.#t,0):b(this.#t,-1)}),this.onfocus=this.onfocus.bind(this),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}#s(){this.root.opts.value.current!==this.opts.value.current&&this.root.setValue(this.opts.value.current)}onfocus(e){this.root.opts.activationMode.current!=="automatic"||t(this.#r)||this.#s()}onclick(e){t(this.#r)||this.#s()}onkeydown(e){if(!t(this.#r)){if(e.key===Oa||e.key===Fa){e.preventDefault(),this.#s();return}this.root.rovingFocusGroup.handleKeydown(this.opts.ref.current,e)}}#n=z(()=>({id:this.opts.id.current,role:"tab","data-state":vi(t(this.#e)),"data-value":this.opts.value.current,"data-orientation":this.root.opts.orientation.current,"data-disabled":Zn(t(this.#r)),"aria-selected":ja(t(this.#e)),"aria-controls":t(this.#a),[gs.trigger]:"",disabled:Za(t(this.#r)),tabindex:t(this.#t),onclick:this.onclick,onfocus:this.onfocus,onkeydown:this.onkeydown,...this.attachment}));get props(){return t(this.#n)}set props(e){b(this.#n,e)}}function vi(n){return n?"active":"inactive"}var fi=$("<div><!></div>");function gi(n,e){const r=$s();_e(e,!0);let a=M(e,"id",19,()=>xs(r)),s=M(e,"ref",15,null),o=M(e,"value",15,""),l=M(e,"onValueChange",3,Ua),d=M(e,"orientation",3,"horizontal"),i=M(e,"loop",3,!0),k=M(e,"activationMode",3,"automatic"),_=M(e,"disabled",3,!1),v=Mr(e,["$$slots","$$events","$$legacy","id","ref","value","onValueChange","orientation","loop","activationMode","disabled","children","child"]);const h=Ks.create({id:_t(()=>a()),value:_t(()=>o(),Ie=>{o(Ie),l()(Ie)}),orientation:_t(()=>d()),loop:_t(()=>i()),activationMode:_t(()=>k()),disabled:_t(()=>_()),ref:_t(()=>s(),Ie=>s(Ie))}),y=z(()=>ys(v,h.props));var H=W(),L=x(H);{var Fe=Ie=>{var rt=W(),Ke=x(rt);tr(Ke,()=>e.child,()=>({props:t(y)})),u(Ie,rt)},le=Ie=>{var rt=fi();He(rt,()=>({...t(y)}));var Ke=m(rt);tr(Ke,()=>e.children??Pt),f(rt),u(Ie,rt)};T(L,Ie=>{e.child?Ie(Fe):Ie(le,!1)})}u(n,H),be()}var mi=$("<div><!></div>");function _i(n,e){const r=$s();_e(e,!0);let a=M(e,"id",19,()=>xs(r)),s=M(e,"ref",15,null),o=Mr(e,["$$slots","$$events","$$legacy","child","children","id","ref"]);const l=Ys.create({id:_t(()=>a()),ref:_t(()=>s(),h=>s(h))}),d=z(()=>ys(o,l.props));var i=W(),k=x(i);{var _=h=>{var y=W(),H=x(y);tr(H,()=>e.child,()=>({props:t(d)})),u(h,y)},v=h=>{var y=mi();He(y,()=>({...t(d)}));var H=m(y);tr(H,()=>e.children??Pt),f(y),u(h,y)};T(k,h=>{e.child?h(_):h(v,!1)})}u(n,i),be()}var bi=$("<button><!></button>");function ki(n,e){const r=$s();_e(e,!0);let a=M(e,"disabled",3,!1),s=M(e,"id",19,()=>xs(r)),o=M(e,"type",3,"button"),l=M(e,"ref",15,null),d=Mr(e,["$$slots","$$events","$$legacy","child","children","disabled","id","type","value","ref"]);const i=Ws.create({id:_t(()=>s()),disabled:_t(()=>a()??!1),value:_t(()=>e.value),ref:_t(()=>l(),H=>l(H))}),k=z(()=>ys(d,i.props,{type:o()}));var _=W(),v=x(_);{var h=H=>{var L=W(),Fe=x(L);tr(Fe,()=>e.child,()=>({props:t(k)})),u(H,L)},y=H=>{var L=bi();He(L,()=>({...t(k)}));var Fe=m(L);tr(Fe,()=>e.children??Pt),f(L),u(H,L)};T(v,H=>{e.child?H(h):H(y,!1)})}u(n,_),be()}var $i=ne("<title> </title>"),wi=ne('<svg><!><path d="M18 22 19.414 20.586 23 24.172 23 4 25 4 25 24.172 28.586 20.586 30 22 24 28 18 22z"></path><path d="M2 18H16V20H2z"></path><path d="M6 12H16V14H6z"></path><path d="M10 6H16V8H10z"></path></svg>');function xi(n,e){const r=se(e,["children","$$slots","$$events","$$legacy"]),a=se(r,["size","title"]);_e(e,!1);const s=re(),o=re();let l=M(e,"size",8,16),d=M(e,"title",8,void 0);te(()=>(D(r),D(d())),()=>{b(s,r["aria-label"]||r["aria-labelledby"]||d())}),te(()=>(t(s),D(r)),()=>{b(o,{"aria-hidden":t(s)?void 0:!0,role:t(s)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),Xe(),Je();var i=wi();He(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:l(),height:l(),...t(o),...a}));var k=m(i);{var _=v=>{var h=$i(),y=m(h,!0);f(h),C(()=>B(y,d())),u(v,h)};T(k,v=>{d()&&v(_)})}Q(4),f(i),u(n,i),be()}var yi=ne("<title> </title>"),zi=ne('<svg><!><path d="M18 22 19.414 20.586 23 24.172 23 4 25 4 25 24.172 28.586 20.586 30 22 24 28 18 22z"></path><path d="M2 6H16V8H2z"></path><path d="M6 12H16V14H6z"></path><path d="M10 18H16V20H10z"></path></svg>');function Si(n,e){const r=se(e,["children","$$slots","$$events","$$legacy"]),a=se(r,["size","title"]);_e(e,!1);const s=re(),o=re();let l=M(e,"size",8,16),d=M(e,"title",8,void 0);te(()=>(D(r),D(d())),()=>{b(s,r["aria-label"]||r["aria-labelledby"]||d())}),te(()=>(t(s),D(r)),()=>{b(o,{"aria-hidden":t(s)?void 0:!0,role:t(s)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),Xe(),Je();var i=zi();He(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:l(),height:l(),...t(o),...a}));var k=m(i);{var _=v=>{var h=yi(),y=m(h,!0);f(h),C(()=>B(y,d())),u(v,h)};T(k,v=>{d()&&v(_)})}Q(4),f(i),u(n,i),be()}var Ti=ne("<title> </title>"),Pi=ne('<svg><!><path d="M30,30H28V25a5.0057,5.0057,0,0,0-5-5V18a7.0078,7.0078,0,0,1,7,7Z"></path><path d="M22,30H20V25a5.0059,5.0059,0,0,0-5-5H9a5.0059,5.0059,0,0,0-5,5v5H2V25a7.0082,7.0082,0,0,1,7-7h6a7.0082,7.0082,0,0,1,7,7Z"></path><path d="M20,2V4a5,5,0,0,1,0,10v2A7,7,0,0,0,20,2Z"></path><path d="M12,4A5,5,0,1,1,7,9a5,5,0,0,1,5-5m0-2a7,7,0,1,0,7,7A7,7,0,0,0,12,2Z"></path></svg>');function Ri(n,e){const r=se(e,["children","$$slots","$$events","$$legacy"]),a=se(r,["size","title"]);_e(e,!1);const s=re(),o=re();let l=M(e,"size",8,16),d=M(e,"title",8,void 0);te(()=>(D(r),D(d())),()=>{b(s,r["aria-label"]||r["aria-labelledby"]||d())}),te(()=>(t(s),D(r)),()=>{b(o,{"aria-hidden":t(s)?void 0:!0,role:t(s)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),Xe(),Je();var i=Pi();He(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:l(),height:l(),...t(o),...a}));var k=m(i);{var _=v=>{var h=Ti(),y=m(h,!0);f(h),C(()=>B(y,d())),u(v,h)};T(k,v=>{d()&&v(_)})}Q(4),f(i),u(n,i),be()}var Ci=ne("<title> </title>"),Ai=ne('<svg><!><path d="M28,8H20.8284L17.4143,4.5859A2,2,0,0,0,16,4H4A2,2,0,0,0,2,6V26a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10A2,2,0,0,0,28,8ZM8,26V14h8v6.17l-2.59-2.58L12,19l5,5,5-5-1.41-1.41L18,20.17V14a2.0025,2.0025,0,0,0-2-2H8a2.0025,2.0025,0,0,0-2,2V26H4V6H16l4,4h8v2H22v2h6V26Z"></path></svg>');function Mi(n,e){const r=se(e,["children","$$slots","$$events","$$legacy"]),a=se(r,["size","title"]);_e(e,!1);const s=re(),o=re();let l=M(e,"size",8,16),d=M(e,"title",8,void 0);te(()=>(D(r),D(d())),()=>{b(s,r["aria-label"]||r["aria-labelledby"]||d())}),te(()=>(t(s),D(r)),()=>{b(o,{"aria-hidden":t(s)?void 0:!0,role:t(s)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),Xe(),Je();var i=Ai();He(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:l(),height:l(),...t(o),...a}));var k=m(i);{var _=v=>{var h=Ci(),y=m(h,!0);f(h),C(()=>B(y,d())),u(v,h)};T(k,v=>{d()&&v(_)})}Q(),f(i),u(n,i),be()}var Ei=ne("<title> </title>"),Ii=ne('<svg><!><path d="M15 12H17V30H15z"></path><path d="M11.33,18.22a7,7,0,0,1,0-10.44l1.34,1.49a5,5,0,0,0,0,7.46Z"></path><path d="M20.67,18.22l-1.34-1.49a5,5,0,0,0,0-7.46l1.34-1.49a7,7,0,0,1,0,10.44Z"></path><path d="M8.4,21.8a11,11,0,0,1,0-17.6L9.6,5.8a9,9,0,0,0,0,14.4Z"></path><path d="M23.6,21.8l-1.2-1.6a9,9,0,0,0,0-14.4l1.2-1.6a11,11,0,0,1,0,17.6Z"></path></svg>');function Di(n,e){const r=se(e,["children","$$slots","$$events","$$legacy"]),a=se(r,["size","title"]);_e(e,!1);const s=re(),o=re();let l=M(e,"size",8,16),d=M(e,"title",8,void 0);te(()=>(D(r),D(d())),()=>{b(s,r["aria-label"]||r["aria-labelledby"]||d())}),te(()=>(t(s),D(r)),()=>{b(o,{"aria-hidden":t(s)?void 0:!0,role:t(s)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),Xe(),Je();var i=Ii();He(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:l(),height:l(),...t(o),...a}));var k=m(i);{var _=v=>{var h=Ei(),y=m(h,!0);f(h),C(()=>B(y,d())),u(v,h)};T(k,v=>{d()&&v(_)})}Q(5),f(i),u(n,i),be()}var Hi=ne("<title> </title>"),Li=ne('<svg><!><path d="M22,8H21V2H19V8H13V2H11V8H10a2,2,0,0,0-2,2v6a8.0073,8.0073,0,0,0,7,7.9307V30h2V23.9307A8.0073,8.0073,0,0,0,24,16V10A2,2,0,0,0,22,8Z"></path></svg>');function Vi(n,e){const r=se(e,["children","$$slots","$$events","$$legacy"]),a=se(r,["size","title"]);_e(e,!1);const s=re(),o=re();let l=M(e,"size",8,16),d=M(e,"title",8,void 0);te(()=>(D(r),D(d())),()=>{b(s,r["aria-label"]||r["aria-labelledby"]||d())}),te(()=>(t(s),D(r)),()=>{b(o,{"aria-hidden":t(s)?void 0:!0,role:t(s)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),Xe(),Je();var i=Li();He(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:l(),height:l(),...t(o),...a}));var k=m(i);{var _=v=>{var h=Hi(),y=m(h,!0);f(h),C(()=>B(y,d())),u(v,h)};T(k,v=>{d()&&v(_)})}Q(),f(i),u(n,i),be()}var Bi=ne("<title> </title>"),Oi=ne('<svg><!><path d="M17 22 17 14 13 14 13 16 15 16 15 22 12 22 12 24 20 24 20 22 17 22z"></path><path d="M16,8a1.5,1.5,0,1,0,1.5,1.5A1.5,1.5,0,0,0,16,8Z"></path><path d="M16,30A14,14,0,1,1,30,16,14,14,0,0,1,16,30ZM16,4A12,12,0,1,0,28,16,12,12,0,0,0,16,4Z"></path></svg>');function Fi(n,e){const r=se(e,["children","$$slots","$$events","$$legacy"]),a=se(r,["size","title"]);_e(e,!1);const s=re(),o=re();let l=M(e,"size",8,16),d=M(e,"title",8,void 0);te(()=>(D(r),D(d())),()=>{b(s,r["aria-label"]||r["aria-labelledby"]||d())}),te(()=>(t(s),D(r)),()=>{b(o,{"aria-hidden":t(s)?void 0:!0,role:t(s)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),Xe(),Je();var i=Oi();He(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:l(),height:l(),...t(o),...a}));var k=m(i);{var _=v=>{var h=Bi(),y=m(h,!0);f(h),C(()=>B(y,d())),u(v,h)};T(k,v=>{d()&&v(_)})}Q(3),f(i),u(n,i),be()}var Zi=ne("<title> </title>"),ji=ne('<svg><!><path d="M25.7,9.3l-7-7C18.5,2.1,18.3,2,18,2H8C6.9,2,6,2.9,6,4v24c0,1.1,0.9,2,2,2h16c1.1,0,2-0.9,2-2V10C26,9.7,25.9,9.5,25.7,9.3 z M18,4.4l5.6,5.6H18V4.4z M24,28H8V4h8v6c0,1.1,0.9,2,2,2h6V28z"></path><path d="M10 22H22V24H10z"></path><path d="M10 16H22V18H10z"></path></svg>');function qi(n,e){const r=se(e,["children","$$slots","$$events","$$legacy"]),a=se(r,["size","title"]);_e(e,!1);const s=re(),o=re();let l=M(e,"size",8,16),d=M(e,"title",8,void 0);te(()=>(D(r),D(d())),()=>{b(s,r["aria-label"]||r["aria-labelledby"]||d())}),te(()=>(t(s),D(r)),()=>{b(o,{"aria-hidden":t(s)?void 0:!0,role:t(s)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),Xe(),Je();var i=ji();He(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:l(),height:l(),...t(o),...a}));var k=m(i);{var _=v=>{var h=Zi(),y=m(h,!0);f(h),C(()=>B(y,d())),u(v,h)};T(k,v=>{d()&&v(_)})}Q(3),f(i),u(n,i),be()}var Ni=ne("<title> </title>"),Ui=ne('<svg><!><path d="M8 18H12V20H8z"></path><path d="M14 18H18V20H14z"></path><path d="M8 14H12V16H8z"></path><path d="M14 22H18V24H14z"></path><path d="M20 14H24V16H20z"></path><path d="M20 22H24V24H20z"></path><path d="M27,3H5A2.0025,2.0025,0,0,0,3,5V27a2.0025,2.0025,0,0,0,2,2H27a2.0025,2.0025,0,0,0,2-2V5A2.0025,2.0025,0,0,0,27,3Zm0,2,0,4H5V5ZM5,27V11H27l0,16Z"></path></svg>');function Ki(n,e){const r=se(e,["children","$$slots","$$events","$$legacy"]),a=se(r,["size","title"]);_e(e,!1);const s=re(),o=re();let l=M(e,"size",8,16),d=M(e,"title",8,void 0);te(()=>(D(r),D(d())),()=>{b(s,r["aria-label"]||r["aria-labelledby"]||d())}),te(()=>(t(s),D(r)),()=>{b(o,{"aria-hidden":t(s)?void 0:!0,role:t(s)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),Xe(),Je();var i=Ui();He(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:l(),height:l(),...t(o),...a}));var k=m(i);{var _=v=>{var h=Ni(),y=m(h,!0);f(h),C(()=>B(y,d())),u(v,h)};T(k,v=>{d()&&v(_)})}Q(7),f(i),u(n,i),be()}function Yi(n,e){_e(e,!0);let r=M(e,"ref",15,null),a=M(e,"value",15,""),s=Mr(e,["$$slots","$$events","$$legacy","ref","value","class"]);var o=W(),l=x(o);{let d=z(()=>Jr("flex flex-col gap-2",e.class));V(l,()=>gi,(i,k)=>{k(i,Zs({"data-slot":"tabs",get class(){return t(d)}},()=>s,{get ref(){return r()},set ref(_){r(_)},get value(){return a()},set value(_){a(_)}}))})}u(n,o),be()}function Wi(n,e){_e(e,!0);let r=M(e,"ref",15,null),a=Mr(e,["$$slots","$$events","$$legacy","ref","class","orientation"]);var s=W(),o=x(s);{let l=z(()=>Jr(e.orientation==="vertical"?"flex flex-col w-full":"inline-flex h-9 w-fit items-center justify-center rounded-lg bg-[var(--color-bg-surface)] p-[3px]",e.class));V(o,()=>_i,(d,i)=>{i(d,Zs({"data-slot":"tabs-list",get class(){return t(l)}},()=>a,{get ref(){return r()},set ref(k){r(k)}}))})}u(n,s),be()}function Lr(n,e){_e(e,!0);let r=M(e,"ref",15,null),a=Mr(e,["$$slots","$$events","$$legacy","ref","class","orientation"]);var s=W(),o=x(s);{let l=z(()=>Jr("inline-flex items-center text-[14px] font-normal whitespace-nowrap transition-[color,background] duration-150 cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e.orientation==="vertical"?"justify-start w-full h-8 gap-[11px] pl-[19px] pr-3 text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-hover)] hover:text-[var(--color-text-primary)] data-[state=active]:bg-[var(--color-bg-hover)] data-[state=active]:text-[var(--color-text-primary)] data-[state=active]:font-medium":"justify-center flex-1 gap-2 rounded-md border border-transparent px-2 py-1 text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)] data-[state=active]:bg-[var(--color-bg-hover)] data-[state=active]:text-[var(--color-text-primary)] data-[state=active]:shadow-sm",e.class));V(o,()=>ki,(d,i)=>{i(d,Zs({"data-slot":"tabs-trigger",get class(){return t(l)}},()=>a,{get ref(){return r()},set ref(k){r(k)}}))})}u(n,s),be()}function Qi(n,e){_e(e,!0);var r=W(),a=x(r);{let s=z(()=>Jr("dialog-description",e.class));V(a,()=>Ka,(o,l)=>{l(o,{get class(){return t(s)},children:(d,i)=>{var k=W(),_=x(k);tr(_,()=>e.children),u(d,k)},$$slots:{default:!0}})})}u(n,r),be()}function Gi(n,e){_e(e,!0);var r=W(),a=x(r);{let s=z(()=>Jr("dialog-close-btn",e.class));V(a,()=>hi,(o,l)=>{l(o,{get class(){return t(s)},children:(d,i)=>{Xr(d,{size:16})},$$slots:{default:!0}})})}u(n,r),be()}var Xi=$("<!> <!>",1),Ji=$('<span class="type-dot svelte-ak7t5k"></span> <div class="type-info svelte-ak7t5k"><span class="type-name svelte-ak7t5k"> </span> <span class="type-desc svelte-ak7t5k"> </span></div>',1),el=$('<div class="type-section svelte-ak7t5k"><div class="type-section-label svelte-ak7t5k"> </div> <div class="type-grid svelte-ak7t5k"></div></div>'),tl=$("<!> <!>",1);function rl(n,e){_e(e,!0);let r=M(e,"open",15),a=M(e,"appEntityTypes",19,()=>[]);const s={deck:"Presentation slides",doc:"Professional documents",project:"Client engagements and initiatives",meeting:"Conversations and check-ins",decision:"Choices made and their rationale",task:"Action items and to-dos",deliverable:"Outputs and work products",note:"Freeform thinking and scratch",process:"Repeatable methods and workflows",standard:"Guidelines and best practices","case-study":"Past work and lessons learned",document:"Long-form structured content",dataset:"Structured data and tables",reference:"Articles, tools, and resources",publication:"Published works and reports",person:"People you work with",organization:"Companies and institutions",role:"Job functions and responsibilities","practice-area":"Disciplines and specialties",deal:"Opportunities and proposals"},o=[{group:"Project",types:["project","meeting","decision","task","deliverable","note"]},{group:"Knowledge",types:["process","standard","case-study","document","dataset","reference","publication"]},{group:"Business",types:["person","organization","role","practice-area","deal"]}],l=z(()=>a().length>0?[{group:"Apps",types:a()},...o]:o);function d(_){return _.replace(/-/g," ").replace(/\b\w/g,v=>v.toUpperCase())}var i=W(),k=x(i);V(k,()=>qs,(_,v)=>{v(_,{onOpenChange:h=>{h||e.oncancel()},get open(){return r()},set open(h){r(h)},children:(h,y)=>{var H=W(),L=x(H);V(L,()=>js,(Fe,le)=>{le(Fe,{size:"lg",children:(Ie,rt)=>{var Ke=tl(),Et=x(Ke);V(Et,()=>Bn,(Nt,et)=>{et(Nt,{children:(xt,It)=>{var yt=Xi(),Ot=x(yt);V(Ot,()=>On,(Ye,We)=>{We(Ye,{children:(dt,vt)=>{Q();var Ee=qt("New Entity");u(dt,Ee)},$$slots:{default:!0}})});var ur=w(Ot,2);V(ur,()=>Gi,(Ye,We)=>{We(Ye,{})}),u(xt,yt)},$$slots:{default:!0}})});var wt=w(Et,2);V(wt,()=>Ea,(Nt,et)=>{et(Nt,{class:"entity-body",children:(xt,It)=>{var yt=W(),Ot=x(yt);tt(Ot,17,()=>t(l),ct,(ur,Ye)=>{var We=el(),dt=m(We),vt=m(dt,!0);f(dt);var Ee=w(dt,2);tt(Ee,21,()=>t(Ye).types,ct,(Ut,Ct)=>{Me(Ut,{variant:"outline",class:"type-card",type:"button",onclick:()=>e.onselect(t(Ct)),children:(Ft,pr)=>{var $r=Ji(),Dt=x($r);let bt;var wr=w(Dt,2),rr=m(wr),zt=m(rr,!0);f(rr);var xr=w(rr,2),hr=m(xr,!0);f(xr),f(wr),C((vr,P)=>{bt=br(Dt,"",bt,vr),B(zt,P),B(hr,s[t(Ct)])},[()=>({background:Rr(t(Ct))}),()=>d(t(Ct))]),u(Ft,$r)},$$slots:{default:!0}})}),f(Ee),f(We),C(()=>B(vt,t(Ye).group)),u(ur,We)}),u(xt,yt)},$$slots:{default:!0}})}),u(Ie,Ke)},$$slots:{default:!0}})}),u(h,H)},$$slots:{default:!0}})}),u(n,i),be()}var sl=$("<span><!></span>"),nl=$('<span class="item-count svelte-6dohdz"> </span>'),al=$('<!> <span class="row-label svelte-6dohdz"> </span> <!>',1),il=$('<div class="indent-group svelte-6dohdz"><!></div>'),ll=$("<!> <!>",1),ol=$("<span><!></span>"),cl=$('<span class="entity-type-dot svelte-6dohdz"></span>'),dl=$('<mark class="filter-match svelte-6dohdz"> </mark>'),ul=$('<span class="presence-avatar svelte-6dohdz"> </span>'),pl=$('<span class="presence-stack svelte-6dohdz"></span>'),hl=$('<!> <!> <span class="row-label svelte-6dohdz"><!></span> <!>',1),vl=$("<!> Move to...",1),fl=$("<!> <!>",1),gl=$("<!> Copy to...",1),ml=$("<!> <!>",1),_l=$("<!> <!> <!>",1),bl=$("<!> Delete",1),kl=$("<!> <!>",1),$l=$("<!> <!>",1),wl=$('<div class="loading-row svelte-6dohdz">Loading...</div>'),xl=$('<div class="indent-group svelte-6dohdz"><!></div>'),yl=$('<div class="entity-row-wrapper svelte-6dohdz"><!> <!></div> <!>',1),zl=$('<span class="repo-type-icon svelte-6dohdz"><!></span>'),Sl=$('<span class="repo-name svelte-6dohdz"> </span>'),Tl=$('<span class="item-count svelte-6dohdz"> </span>'),Pl=$('<span class="presence-avatar svelte-6dohdz"> </span>'),Rl=$('<span class="presence-stack svelte-6dohdz"></span>'),Cl=$("<span><!></span> <!> <!> <!> <!>",1),Al=$("<!> New Entity",1),Ml=$("<!> ",1),El=$("<!> Import Files",1),Il=$("<!> Rename",1),Dl=$("<!> Delete",1),Hl=$("<!> <!> <!> <!> <!>",1),Ll=$("<!> <!>",1),Vl=$('<div class="loading-row svelte-6dohdz">Loading...</div>'),Bl=$('<span class="presence-avatar svelte-6dohdz"> </span>'),Ol=$('<span class="presence-stack svelte-6dohdz"></span>'),Fl=$('<span><!></span> <span class="row-label svelte-6dohdz"> </span> <span class="item-count svelte-6dohdz"> </span> <!>',1),Zl=$("<!> ",1),jl=$("<!> ",1),ql=$("<!> <!> <!>",1),Nl=$("<!> <!>",1),Ul=$('<div class="indent-group svelte-6dohdz"><!></div>'),Kl=$('<div class="type-header-wrapper svelte-6dohdz"><!> <!></div> <!>',1),Yl=$('<span class="row-chevron svelte-6dohdz"><!></span> <span class="row-label svelte-6dohdz">New Note</span>',1),Wl=$("<!> <!>",1),Ql=$('<div class="indent-group svelte-6dohdz"><!></div>'),Gl=$('<div class="tree-group svelte-6dohdz"><div><!> <!></div> <!></div>'),Xl=$('<div class="workspace-icon svelte-6dohdz"> </div> <span class="workspace-name svelte-6dohdz"> </span>',1),Jl=$('<!> <span class="svelte-6dohdz">Preferences</span>',1),eo=$('<!> <span class="svelte-6dohdz">Connectors</span>',1),to=$('<!> <span class="svelte-6dohdz">Workspace</span>',1),ro=$('<!> <span class="svelte-6dohdz">Team</span>',1),so=$('<!> <span class="svelte-6dohdz">Permissions</span>',1),no=$('<!> <span class="svelte-6dohdz">Sync Sources</span>',1),ao=$("<!> <!> <!> <!>",1),io=$("<!> <!> <!>",1),lo=$('<div class="settings-nav svelte-6dohdz"><!></div>'),oo=$('<mark class="filter-match svelte-6dohdz"> </mark>'),co=$('<span class="recent-time svelte-6dohdz"> </span>'),uo=$('<span class="entity-type-dot svelte-6dohdz"></span> <span class="row-label svelte-6dohdz"><!></span> <!>',1),po=$("<!> Delete",1),ho=$("<!> <!>",1),vo=$('<div class="entity-row-wrapper svelte-6dohdz"><!> <!></div>'),fo=$('<div class="no-results svelte-6dohdz">No matching entities</div>'),go=$("<!> <!>",1),mo=$('<div class="no-results svelte-6dohdz">No matching entities</div>'),_o=$("<!> <!>",1),bo=$('<div class="new-collection-row svelte-6dohdz"><!> <!> <!></div>'),ko=$('<span class="row-chevron svelte-6dohdz"><!></span> <span class="repo-name svelte-6dohdz">New Collection</span>',1),$o=$('<div class="filter-bar svelte-6dohdz"><span class="filter-icon svelte-6dohdz"><!></span> <!> <!> <!></div> <nav class="tree svelte-6dohdz"><!> <!> <!></nav>',1),wo=$('<div class="sidebar-footer svelte-6dohdz"><span class="user-email svelte-6dohdz"> </span> <!></div>'),xo=$("<!> <!>",1),yo=$('<div class="import-file-row svelte-6dohdz"><span class="import-file-icon svelte-6dohdz"><!></span> <div class="import-file-info svelte-6dohdz"><span class="import-file-name svelte-6dohdz"> </span> <span class="import-file-size svelte-6dohdz"> </span></div> <button class="import-file-remove svelte-6dohdz"><!></button></div>'),zo=$('<div class="import-file-list svelte-6dohdz"></div>'),So=$('<!> <p class="svelte-6dohdz">Drag files here or <button class="file-picker-link svelte-6dohdz">browse</button></p>',1),To=$('<p class="import-hint svelte-6dohdz">Drop more files or <button class="file-picker-link file-picker-link-sm svelte-6dohdz">browse</button></p>'),Po=$("<!> <!>",1),Ro=$('<!> <div class="import-modal-body svelte-6dohdz"><!> <div><!></div> <input id="import-file-input" type="file" multiple="" accept=".md,.txt,.csv" style="display:none" class="svelte-6dohdz"/></div> <!>',1),Co=$('<aside class="sidebar svelte-6dohdz"><div class="sidebar-header svelte-6dohdz"><!> <div class="header-actions svelte-6dohdz"><!> <!></div></div> <!> <!></aside> <!> <!> <!> <!> <!> <!>',1);function Ao(n,e){_e(e,!0);const r=(c,p=Pt,g=Pt,S=Pt,q=Pt,F=Pt,O=Pt)=>{var je=W(),ae=x(je);tt(ae,17,p,ct,(St,st)=>{const pt=z(()=>F()?`${F()}/${t(st).name}`:t(st).name),ht=z(()=>`${g()}/${S()}/${q()}/${t(pt)}`),ye=z(()=>t(st).type==="directory"),qe=z(()=>R.isFolderExpanded(t(ht))),Oe=z(()=>!t(ye)&&t(Ze)===q()&&t(Zt)===t(pt));var Ne=ll(),ue=x(Ne);{let J=z(()=>t(Oe)?"selected":""),ee=z(()=>t(Ir)===t(ht)?"focused":""),E=z(()=>`padding-left: ${Dr(O(),t(ye))}`);Me(ue,{variant:"ghost",get class(){return`tree-row ${t(J)??""} ${t(ee)??""}`},get"data-tree-key"(){return t(ht)},get style(){return t(E)},onclick:()=>{t(ye)?R.toggleFolder(t(ht)):cr(`/${g()}/${S()}/${q()}/${t(pt)}`)},children:(I,ce)=>{var Z=al(),A=x(Z);{var N=G=>{var j=sl();let ge;var Se=m(j);ls(Se,{size:14}),f(j),C(()=>ge=Pr(j,1,"row-chevron svelte-6dohdz",null,ge,{open:t(qe)})),u(G,j)};T(A,G=>{t(ye)&&G(N)})}var pe=w(A,2),X=m(pe,!0);f(pe);var Y=w(pe,2);{var ve=G=>{var j=nl(),ge=m(j,!0);f(j),C(()=>B(ge,t(st).count)),u(G,j)};T(Y,G=>{t(ye)&&t(st).count!=null&&G(ve)})}C(()=>B(X,t(st).name)),u(I,Z)},$$slots:{default:!0}})}var ze=w(ue,2);{var oe=J=>{var ee=il();let E;var I=m(ee);r(I,()=>t(st).children,g,S,q,()=>t(pt),()=>O()+1),f(ee),C(ce=>E=br(ee,"",E,ce),[()=>({"--guide-left":ns(O())})]),u(J,ee)};T(ze,J=>{t(ye)&&t(qe)&&t(st).children&&t(st).children.length>0&&J(oe)})}u(St,Ne)}),u(c,je)},a=(c,p=Pt,g=Pt,S=Pt,q=Pt)=>{var F=W(),O=x(F);tt(O,17,p,je=>je.id,(je,ae)=>{const St=z(()=>t(ae).id===t(Ze)&&g()===t(Qe)&&!t(Zt)),st=z(()=>t(ae).hasSubContent&&R.isEntityExpanded(g(),t(ae).entityType,t(ae).id)),pt=z(()=>t(ae).hasSubContent?R.getEntityContents(g(),t(ae).entityType,t(ae).id):null),ht=z(()=>`entity:${g()}/${t(ae).entityType}/${t(ae).id}`),ye=z(()=>Is.getPresence(g(),t(ae).entityType,t(ae).id,mt.user?String(mt.user.id):void 0));var qe=yl(),Oe=x(qe);Wr(Oe,"draggable",!0);var Ne=m(Oe);{let J=z(()=>t(St)?"selected":""),ee=z(()=>t(Ir)===t(ht)?"focused":""),E=z(()=>`padding-left: ${Dr(S(),t(ae).hasSubContent)}${t(St)?`; --active-color: ${Rr(t(ae).entityType)}`:""}`);Me(Ne,{variant:"ghost",get class(){return`tree-row ${t(J)??""} ${t(ee)??""}`},get"data-tree-key"(){return t(ht)},get style(){return t(E)},onclick:()=>Zr(t(ae),g()),children:(I,ce)=>{var Z=hl(),A=x(Z);{var N=de=>{var he=ol();let Te;var Ge=m(he);ls(Ge,{size:14}),f(he),C(()=>Te=Pr(he,1,"row-chevron svelte-6dohdz",null,Te,{open:t(st)})),u(de,he)};T(A,de=>{t(ae).hasSubContent&&de(N)})}var pe=w(A,2);{var X=de=>{var he=cl();let Te;C(Ge=>Te=br(he,"",Te,Ge),[()=>({background:Rr(t(ae).entityType)})]),u(de,he)};T(pe,de=>{q()&&de(X)})}var Y=w(pe,2),ve=m(Y);{var G=de=>{var he=W(),Te=x(he);tt(Te,17,()=>ss(t(ae).title),ct,(Ge,Ue)=>{var De=W(),U=x(De);{var ie=Pe=>{var fe=dl(),we=m(fe,!0);f(fe),C(()=>B(we,t(Ue).text)),u(Pe,fe)},$e=Pe=>{var fe=qt();C(()=>B(fe,t(Ue).text)),u(Pe,fe)};T(U,Pe=>{t(Ue).match?Pe(ie):Pe($e,!1)})}u(Ge,De)}),u(de,he)},j=de=>{var he=qt();C(()=>B(he,t(ae).title)),u(de,he)};T(ve,de=>{t(Kt)?de(G):de(j,!1)})}f(Y);var ge=w(Y,2);{var Se=de=>{var he=pl();tt(he,21,()=>t(ye).slice(0,3),ct,(Te,Ge)=>{var Ue=ul(),De=m(Ue,!0);f(Ue),C(U=>B(De,U),[()=>t(Ge).name[0].toUpperCase()]),u(Te,Ue)}),f(he),C(Te=>Wr(he,"title",Te),[()=>t(ye).map(Te=>Te.name).join(", ")]),u(de,he)};T(ge,de=>{t(ye).length>0&&de(Se)})}u(I,Z)},$$slots:{default:!0}})}var ue=w(Ne,2);V(ue,()=>ps,(J,ee)=>{ee(J,{onOpenChange:E=>{b(k,E?t(ht):null,!0)},children:(E,I)=>{var ce=$l(),Z=x(ce);{let N=z(()=>t(k)===t(ht)?"menu-open":"");V(Z,()=>cs,(pe,X)=>{X(pe,{get class(){return`entity-actions-btn ${t(N)??""}`},onclick:Y=>Y.stopPropagation(),children:(Y,ve)=>{hs(Y,{size:12})},$$slots:{default:!0}})})}var A=w(Z,2);V(A,()=>ds,(N,pe)=>{pe(N,{children:(X,Y)=>{var ve=W(),G=x(ve);V(G,()=>us,(j,ge)=>{ge(j,{class:"repo-actions-menu",sideOffset:12,align:"start",children:(Se,de)=>{var he=kl(),Te=x(he);{var Ge=U=>{var ie=_l(),$e=x(ie);V($e,()=>zn,(we,nt)=>{nt(we,{children:(lt,at)=>{var ft=fl(),Be=x(ft);V(Be,()=>Sn,($t,Vt)=>{Vt($t,{class:"repo-menu-item",children:(Bt,ir)=>{var ot=vl(),Qt=x(ot);Ca(Qt,{size:12}),Q(),u(Bt,ot)},$$slots:{default:!0}})});var it=w(Be,2);V(it,()=>Tn,($t,Vt)=>{Vt($t,{class:"repo-actions-menu",children:(Bt,ir)=>{var ot=W(),Qt=x(ot);tt(Qt,17,()=>R.repos.filter(jt=>jt.name!==g()),ct,(jt,lr)=>{var or=W(),Hr=x(or);V(Hr,()=>Gt,(qr,mr)=>{mr(qr,{class:"repo-menu-item",onSelect:()=>pr(g(),t(ae),t(lr).name,"move"),children:(_r,Sr)=>{Q();var Tr=qt();C(()=>B(Tr,t(lr).displayName)),u(_r,Tr)},$$slots:{default:!0}})}),u(jt,or)}),u(Bt,ot)},$$slots:{default:!0}})}),u(lt,ft)},$$slots:{default:!0}})});var Pe=w($e,2);V(Pe,()=>zn,(we,nt)=>{nt(we,{children:(lt,at)=>{var ft=ml(),Be=x(ft);V(Be,()=>Sn,($t,Vt)=>{Vt($t,{class:"repo-menu-item",children:(Bt,ir)=>{var ot=gl(),Qt=x(ot);ri(Qt,{size:12}),Q(),u(Bt,ot)},$$slots:{default:!0}})});var it=w(Be,2);V(it,()=>Tn,($t,Vt)=>{Vt($t,{class:"repo-actions-menu",children:(Bt,ir)=>{var ot=W(),Qt=x(ot);tt(Qt,17,()=>R.repos.filter(jt=>jt.name!==g()),ct,(jt,lr)=>{var or=W(),Hr=x(or);V(Hr,()=>Gt,(qr,mr)=>{mr(qr,{class:"repo-menu-item",onSelect:()=>pr(g(),t(ae),t(lr).name,"copy"),children:(_r,Sr)=>{Q();var Tr=qt();C(()=>B(Tr,t(lr).displayName)),u(_r,Tr)},$$slots:{default:!0}})}),u(jt,or)}),u(Bt,ot)},$$slots:{default:!0}})}),u(lt,ft)},$$slots:{default:!0}})});var fe=w(Pe,2);V(fe,()=>yn,(we,nt)=>{nt(we,{class:"ip-menu-sep"})}),u(U,ie)},Ue=z(()=>R.repos.filter(U=>U.name!==g()).length>0);T(Te,U=>{t(Ue)&&U(Ge)})}var De=w(Te,2);V(De,()=>Gt,(U,ie)=>{ie(U,{class:"repo-menu-item repo-menu-item-danger",onSelect:$e=>Ie(g(),t(ae),$e),children:($e,Pe)=>{var fe=bl(),we=x(fe);Qr(we,{size:12}),Q(),u($e,fe)},$$slots:{default:!0}})}),u(Se,he)},$$slots:{default:!0}})}),u(X,ve)},$$slots:{default:!0}})}),u(E,ce)},$$slots:{default:!0}})}),f(Oe);var ze=w(Oe,2);{var oe=J=>{var ee=W(),E=x(ee);{var I=Z=>{var A=wl();let N;C(pe=>N=br(A,"",N,pe),[()=>({"padding-left":Dr(S()+1,!1)})]),u(Z,A)},ce=Z=>{var A=xl();let N;var pe=m(A);r(pe,()=>t(pt).entries,g,()=>t(ae).entityType,()=>t(ae).id,()=>"",()=>S()+1),f(A),C(X=>N=br(A,"",N,X),[()=>({"--guide-left":ns(S())})]),u(Z,A)};T(E,Z=>{t(pt).loading?Z(I):t(pt).entries.length>0&&Z(ce,1)})}u(J,ee)};T(ze,J=>{t(st)&&t(pt)&&J(oe)})}Tt("dragstart",Oe,J=>$r(J,g(),t(ae))),Tt("dragend",Oe,Dt),Tt("mouseenter",Oe,()=>{Ce.hoveredEntityId=t(ae).id}),Tt("mouseleave",Oe,()=>{Ce.hoveredEntityId=null}),u(je,qe)}),u(c,F)},s=(c,p=Pt)=>{const g=z(()=>t(Yt)?.repo===p().name),S=z(()=>`repo:${p().name}`),q=z(()=>Is.getRepoPresence(p().name,mt.user?String(mt.user.id):void 0));var F=Gl(),O=m(F),je=m(O);{let ye=z(()=>t(g)?"repo-active":""),qe=z(()=>t(Ir)===t(S)?"focused":""),Oe=z(()=>t(g)&&t(Yt)?.color?`--active-color: ${t(Yt).color}`:void 0);Me(je,{variant:"ghost",get class(){return`repo-row ${t(ye)??""} ${t(qe)??""}`},get"data-tree-key"(){return t(S)},get style(){return t(Oe)},onclick:()=>ar(p().name),children:(Ne,ue)=>{var ze=Cl(),oe=x(ze);let J;var ee=m(oe);ls(ee,{size:14}),f(oe);var E=w(oe,2);{var I=G=>{var j=zl(),ge=m(j);Ds(ge,{size:12}),f(j),u(G,j)};T(E,G=>{p().private&&G(I)})}var ce=w(E,2);{var Z=G=>{fs(G,{class:"repo-rename-input",type:"text",onkeydown:ur,onblur:Ot,onclick:j=>j.stopPropagation(),get ref(){return t(It)},set ref(j){b(It,j,!0)},get value(){return t(xt)},set value(j){b(xt,j,!0)}})},A=G=>{var j=Sl(),ge=m(j,!0);f(j),C(()=>B(ge,p().displayName)),kr("dblclick",j,Se=>{t(Ye)&&p().type!=="private"&&yt(p().name,Se)}),u(G,j)};T(ce,G=>{t(et)===p().name?G(Z):G(A,!1)})}var N=w(ce,2);{var pe=G=>{var j=Tl(),ge=m(j,!0);f(j),C(()=>B(ge,p().count)),u(G,j)};T(N,G=>{p().count!=null&&t(et)!==p().name&&G(pe)})}var X=w(N,2);{var Y=G=>{var j=Rl();tt(j,21,()=>t(q).slice(0,3),ct,(ge,Se)=>{var de=Pl(),he=m(de,!0);f(de),C(Te=>B(he,Te),[()=>t(Se).name[0].toUpperCase()]),u(ge,de)}),f(j),C(ge=>Wr(j,"title",ge),[()=>t(q).map(ge=>ge.name).join(", ")]),u(G,j)},ve=z(()=>!R.isExpanded(p().name)&&t(q).length>0);T(X,G=>{t(ve)&&G(Y)})}C(G=>J=Pr(oe,1,"row-chevron svelte-6dohdz",null,J,G),[()=>({open:R.isExpanded(p().name)})]),u(Ne,ze)},$$slots:{default:!0}})}var ae=w(je,2);{var St=ye=>{var qe=W(),Oe=x(qe);V(Oe,()=>ps,(Ne,ue)=>{ue(Ne,{onOpenChange:ze=>{b(d,ze?p().name:null,!0)},children:(ze,oe)=>{var J=Ll(),ee=x(J);{let I=z(()=>t(d)===p().name?"menu-open":"");V(ee,()=>cs,(ce,Z)=>{Z(ce,{get class(){return`repo-actions-btn ${t(I)??""}`},onclick:A=>A.stopPropagation(),children:(A,N)=>{hs(A,{size:12})},$$slots:{default:!0}})})}var E=w(ee,2);V(E,()=>ds,(I,ce)=>{ce(I,{children:(Z,A)=>{var N=W(),pe=x(N);V(pe,()=>us,(X,Y)=>{Y(X,{class:"repo-actions-menu",sideOffset:12,align:"start",children:(ve,G)=>{var j=Hl(),ge=x(j);V(ge,()=>Gt,(U,ie)=>{ie(U,{class:"repo-menu-item",onSelect:()=>{b(l,p().name,!0)},children:($e,Pe)=>{var fe=Al(),we=x(fe);is(we,{size:12}),Q(),u($e,fe)},$$slots:{default:!0}})});var Se=w(ge,2);{var de=U=>{var ie=W(),$e=x(ie);{let Pe=z(()=>!!t(L));V($e,()=>Gt,(fe,we)=>{we(fe,{class:"repo-menu-item",get disabled(){return t(Pe)},onSelect:()=>Fe(p().name),children:(nt,lt)=>{var at=Ml(),ft=x(at);{let it=z(()=>t(L)===p().name?"animate-spin":"");xn(ft,{size:12,get class(){return t(it)}})}var Be=w(ft);C(()=>B(Be,` ${t(L)===p().name?"Syncing...":"Sync"}`)),u(nt,at)},$$slots:{default:!0}})})}u(U,ie)};T(Se,U=>{p().sync&&p().sync.length>0&&U(de)})}var he=w(Se,2);V(he,()=>Gt,(U,ie)=>{ie(U,{class:"repo-menu-item",onSelect:()=>{b(vt,p().name,!0),b(Ee,[],!0)},children:($e,Pe)=>{var fe=El(),we=x(fe);Cn(we,{size:12}),Q(),u($e,fe)},$$slots:{default:!0}})});var Te=w(he,2);{var Ge=U=>{var ie=W(),$e=x(ie);V($e,()=>Gt,(Pe,fe)=>{fe(Pe,{class:"repo-menu-item",onSelect:we=>yt(p().name,we),children:(we,nt)=>{var lt=Il(),at=x(lt);Fn(at,{size:12}),Q(),u(we,lt)},$$slots:{default:!0}})}),u(U,ie)};T(Te,U=>{t(Ye)&&p().type!=="private"&&U(Ge)})}var Ue=w(Te,2);{var De=U=>{var ie=W(),$e=x(ie);V($e,()=>Gt,(Pe,fe)=>{fe(Pe,{class:"repo-menu-item repo-menu-item-danger",onSelect:we=>y(p().name,we),children:(we,nt)=>{var lt=Dl(),at=x(lt);Qr(at,{size:12}),Q(),u(we,lt)},$$slots:{default:!0}})}),u(U,ie)};T(Ue,U=>{t(Ye)&&U(De)})}u(ve,j)},$$slots:{default:!0}})}),u(Z,N)},$$slots:{default:!0}})}),u(ze,J)},$$slots:{default:!0}})}),u(ye,qe)};T(ae,ye=>{t(et)!==p().name&&(t(Ye)||p().sync&&p().sync.length>0)&&ye(St)})}f(O);var st=w(O,2);{var pt=ye=>{var qe=Ql();let Oe;var Ne=m(qe);{var ue=oe=>{var J=Vl();let ee;C(E=>ee=br(J,"",ee,E),[()=>({"padding-left":Dr(1,!1)})]),u(oe,J)},ze=oe=>{var J=Wl(),ee=x(J);{var E=A=>{var N=W(),pe=x(N);tt(pe,17,()=>na(p().entities),ct,(X,Y)=>{const ve=z(()=>`type:${p().name}/${t(Y).type}`),G=z(()=>!R.isFolderCollapsed(t(ve))),j=z(()=>p().name===t(Qe)&&t(Y).entities.some(De=>De.id===t(Ze)));var ge=Kl(),Se=x(ge),de=m(Se);{let De=z(()=>t(j)?"type-active":""),U=z(()=>`padding-left: ${Dr(1,!0)}; border-left-color: ${t(j)?Rr(t(Y).type):"transparent"}`);Me(de,{variant:"ghost",get class(){return`tree-row type-header-row ${t(De)??""}`},get style(){return t(U)},get"data-tree-key"(){return t(ve)},onclick:()=>R.toggleFolder(t(ve)),children:(ie,$e)=>{const Pe=z(()=>Is.getPresenceByPrefix(`${p().name}/${t(Y).type}/`,mt.user?String(mt.user.id):void 0));var fe=Fl(),we=x(fe);let nt;var lt=m(we);ls(lt,{size:14}),f(we);var at=w(we,2),ft=m(at,!0);f(at);var Be=w(at,2),it=m(Be,!0);f(Be);var $t=w(Be,2);{var Vt=Bt=>{var ir=Ol();tt(ir,21,()=>t(Pe).slice(0,3),ct,(ot,Qt)=>{var jt=Bl(),lr=m(jt,!0);f(jt),C(or=>B(lr,or),[()=>t(Qt).name[0].toUpperCase()]),u(ot,jt)}),f(ir),C(ot=>Wr(ir,"title",ot),[()=>t(Pe).map(ot=>ot.name).join(", ")]),u(Bt,ir)};T($t,Bt=>{!t(G)&&t(Pe).length>0&&Bt(Vt)})}C(()=>{nt=Pr(we,1,"row-chevron svelte-6dohdz",null,nt,{open:t(G)}),B(ft,t(Y).label),B(it,t(Y).entities.length)}),u(ie,fe)},$$slots:{default:!0}})}var he=w(de,2);{var Te=De=>{var U=W(),ie=x(U);V(ie,()=>ps,($e,Pe)=>{Pe($e,{onOpenChange:fe=>{b(i,fe?t(ve):null,!0)},children:(fe,we)=>{var nt=Nl(),lt=x(nt);{let ft=z(()=>t(i)===t(ve)?"menu-open":"");V(lt,()=>cs,(Be,it)=>{it(Be,{get class(){return`type-actions-btn ${t(ft)??""}`},onclick:$t=>$t.stopPropagation(),children:($t,Vt)=>{hs($t,{size:12})},$$slots:{default:!0}})})}var at=w(lt,2);V(at,()=>ds,(ft,Be)=>{Be(ft,{children:(it,$t)=>{var Vt=W(),Bt=x(Vt);V(Bt,()=>us,(ir,ot)=>{ot(ir,{class:"repo-actions-menu",sideOffset:12,align:"start",children:(Qt,jt)=>{var lr=ql(),or=x(lr);V(or,()=>Gt,(mr,_r)=>{_r(mr,{class:"repo-menu-item",onSelect:()=>Fr(p().name,t(Y).type),children:(Sr,Tr)=>{var Nr=Zl(),Ur=x(Nr);is(Ur,{size:12});var Rs=w(Ur);C(Cs=>B(Rs,` New ${Cs??""}`),[()=>zr(t(Y).type)]),u(Sr,Nr)},$$slots:{default:!0}})});var Hr=w(or,2);V(Hr,()=>yn,(mr,_r)=>{_r(mr,{class:"ip-menu-sep"})});var qr=w(Hr,2);V(qr,()=>Gt,(mr,_r)=>{_r(mr,{class:"repo-menu-item repo-menu-item-danger",onSelect:Sr=>wt(p().name,t(Y).type,t(Y).label,t(Y).entities.length,Sr),children:(Sr,Tr)=>{var Nr=jl(),Ur=x(Nr);Qr(Ur,{size:12});var Rs=w(Ur);C(Cs=>B(Rs,` Delete all ${Cs??""}`),[()=>t(Y).label.toLowerCase()]),u(Sr,Nr)},$$slots:{default:!0}})}),u(Qt,lr)},$$slots:{default:!0}})}),u(it,Vt)},$$slots:{default:!0}})}),u(fe,nt)},$$slots:{default:!0}})}),u(De,U)};T(he,De=>{t(Ye)&&De(Te)})}f(Se);var Ge=w(Se,2);{var Ue=De=>{var U=Ul();let ie;var $e=m(U);a($e,()=>t(Y).entities,()=>p().name,()=>2,()=>!1),f(U),C(Pe=>ie=br(U,"",ie,Pe),[()=>({"--guide-left":ns(1)})]),u(De,U)};T(Ge,De=>{t(G)&&De(Ue)})}u(X,ge)}),u(A,N)},I=z(()=>sa(p().entities)),ce=A=>{a(A,()=>p().entities,()=>p().name,()=>1,()=>!1)};T(ee,A=>{t(I)?A(E):A(ce,!1)})}var Z=w(ee,2);{let A=z(()=>`padding-left: ${Dr(1,!0)}`);Me(Z,{variant:"ghost",class:"tree-row new-entity-row",get style(){return t(A)},onclick:N=>{N.stopPropagation(),Fr(p().name,"note")},children:(N,pe)=>{var X=Yl(),Y=x(X),ve=m(Y);is(ve,{size:14}),f(Y),Q(2),u(N,X)},$$slots:{default:!0}})}u(oe,J)};T(Ne,oe=>{p().loading?oe(ue):oe(ze,!1)})}f(qe),C(oe=>Oe=br(qe,"",Oe,oe),[()=>({"--guide-left":ns(0)})]),u(ye,qe)},ht=z(()=>R.isExpanded(p().name));T(st,ye=>{t(ht)&&ye(pt)})}f(F),C(()=>Pr(O,1,`repo-row-wrapper ${t(dt)===p().name?"drop-target":""}`,"svelte-6dohdz")),Tt("dragover",O,ye=>bt(ye,p().name)),Tt("dragleave",O,wr),Tt("drop",O,ye=>rr(ye,p().name)),u(c,F)},o=Os("chat");let l=me(null),d=me(null),i=me(null),k=me(null);async function _(){Xt.startSyncToast("workspace");try{const{workspaceResults:c=[]}=await Aa();let p=0,g=0;const S=[];for(const q of c)for(const F of q.targets??[])p+=(F.created??0)+(F.derived??0),g+=F.skipped??0,S.push(...F.errors??[]);if(p>0){const q=new Set(c.flatMap(F=>(F.targets??[]).filter(O=>(O.created??0)+(O.derived??0)>0).map(O=>O.repo)));await Promise.all([...q].map(F=>R.refreshEntities(F)))}S.length>0?Xt.finishSyncToast("workspace",`Sync failed: ${S[0]}`,!0):p>0?Xt.finishSyncToast("workspace",`Synced ${p} new entities`,!1):Xt.finishSyncToast("workspace",`No new entities (${g} already synced)`,!1)}catch(c){console.error("Sync failed:",c),Xt.finishSyncToast("workspace",`Sync failed: ${c.message}`,!0)}}let v=me(!1),h=me(null);function y(c,p){p.stopPropagation(),b(h,c,!0)}async function H(){if(!t(h))return;const c=t(h);b(h,null);try{await R.removeCollection(c)}catch(p){console.error("Failed to delete collection:",p.message)}}let L=me(null);async function Fe(c){if(!t(L)){b(L,c,!0),Xt.startSyncToast(c);try{const p=await Ma(c),S=(p.collectionResults??p.results??[]).reduce((q,F)=>q+(F.created??0)+(F.skipped??0),0);Xt.finishSyncToast(c,`Synced ${S} entities in ${c}`,!1),R.refreshEntities(c)}catch(p){Xt.finishSyncToast(c,`Sync failed: ${p.message}`,!0)}finally{b(L,null)}}}let le=me(null);function Ie(c,p,g){g.stopPropagation(),b(le,{repo:c,type:p.entityType,id:p.id,title:p.title},!0)}async function rt(){if(!t(le))return;const{repo:c,type:p,id:g}=t(le);b(le,null),R.removeEntity(c,p,g),Ce.selectedRepo===c&&Ce.selectedId===g&&cr("/");try{await $n(c,p,g)}catch(S){console.error("Failed to delete entity:",S.message),await R.refreshEntities(c)}}let Ke=me(null),Et=me(!1);function wt(c,p,g,S,q){q.stopPropagation(),b(Ke,{repo:c,type:p,label:g,count:S},!0)}async function Nt(){if(!t(Ke)||t(Et))return;const{repo:c,type:p}=t(Ke),g=R.repos.find(O=>O.name===c)?.entities.filter(O=>O.entityType===p)??[];b(Et,!0),b(Ke,null),Ce.selectedRepo===c&&g.some(O=>O.id===Ce.selectedId)&&cr("/");const S=g.length;for(const O of g)try{await $n(c,O.entityType,O.id)}catch{}await R.refreshEntities(c);const q=R.repos.find(O=>O.name===c)?.entities.filter(O=>O.entityType===p).length??0,F=S-q;Xt.showToast(`Deleted ${F} ${F===1?"entity":"entities"}`),b(Et,!1)}let et=me(null),xt=me(""),It=me(null);function yt(c,p){p.stopPropagation(),b(et,c,!0);const g=R.repos.find(S=>S.name===c);b(xt,g?.displayName??c,!0),setTimeout(()=>t(It)?.select(),0)}async function Ot(){if(!t(et))return;const c=t(et),p=t(xt).trim(),g=p.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");if(b(et,null),!(!g||g===c))try{await R.renameCollectionTo(c,g,p)}catch(S){console.error("Failed to rename collection:",S.message)}}function ur(c){c.key==="Enter"?(c.preventDefault(),Ot()):c.key==="Escape"&&b(et,null)}const Ye=z(()=>!mt.loading&&(!mt.authEnabled||mt.user?.role==="admin"));let We=me(!1),dt=me(null),vt=me(null),Ee=me(ws([])),Ut=me(!1);const Ct=[".md",".txt",".csv"];let Ft=me(null);async function pr(c,p,g,S){try{const q=await Pa(c,p.entityType,p.id,g,S);S==="move"&&Ce.selectedRepo===c&&Ce.selectedId===p.id&&cr(q.newUrl,{invalidateAll:!0}),await R.load();const{toast:F}=await Es(async()=>{const{toast:O}=await import("../chunks/BN6gr1HX.js");return{toast:O}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url);F.success(S==="move"?`Moved "${p.title}" to ${R.repos.find(O=>O.name===g)?.displayName??g}`:`Copied "${p.title}" to ${R.repos.find(O=>O.name===g)?.displayName??g}`)}catch(q){const{toast:F}=await Es(async()=>{const{toast:O}=await import("../chunks/BN6gr1HX.js");return{toast:O}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url);F.error(q.message??`Failed to ${S} entity`)}}function $r(c,p,g){c.dataTransfer&&(c.dataTransfer.effectAllowed="move",c.dataTransfer.setData("application/x-studiograph-entity",JSON.stringify({repo:p,entityType:g.entityType,entityId:g.id,title:g.title})),b(Ft,{repo:p,entityType:g.entityType,entityId:g.id,title:g.title},!0))}function Dt(){b(Ft,null)}function bt(c,p){if(c.preventDefault(),!!c.dataTransfer){if(c.dataTransfer.types.includes("application/x-studiograph-entity")){if(t(Ft)&&t(Ft).repo===p)return;c.dataTransfer.dropEffect="move",b(dt,p,!0);return}t(Ye)&&(c.dataTransfer.dropEffect="copy",b(dt,p,!0))}}function wr(c){const p=c.relatedTarget;p&&c.currentTarget?.contains(p)||b(dt,null)}async function rr(c,p){c.preventDefault(),b(dt,null);const g=c.dataTransfer?.getData("application/x-studiograph-entity");if(g){try{const{repo:q,entityType:F,entityId:O,title:je}=JSON.parse(g);if(q===p)return;await pr(q,{id:O,entityType:F,title:je},p,"move")}catch{}b(Ft,null);return}if(!t(Ye)||!c.dataTransfer?.files.length)return;const S=await zt(c.dataTransfer.files);S.length!==0&&await xr(p,S)}async function zt(c){const p=[];for(const g of Array.from(c)){const S="."+g.name.split(".").pop()?.toLowerCase();if(!Ct.includes(S))continue;const q=await g.text();p.push({filename:g.name,content:q})}return p}async function xr(c,p){if(p.length!==0){b(Ut,!0);try{const{apiFetch:g}=await Es(async()=>{const{apiFetch:q}=await import("../chunks/BKHfe9E-.js").then(F=>F.d);return{apiFetch:q}},__vite__mapDeps([8,2]),import.meta.url),S=await g(`/api/repos/${encodeURIComponent(c)}/import`,{method:"POST",body:JSON.stringify({files:p})});await R.refreshEntities(c),console.log(`Imported ${S.imported} file(s) into ${c}`,S)}catch(g){console.error("Import failed:",g.message)}finally{b(Ut,!1),b(vt,null),b(Ee,[],!0)}}}async function hr(c){if(c.preventDefault(),!c.dataTransfer?.files.length)return;const p=await zt(c.dataTransfer.files);b(Ee,[...t(Ee),...p],!0)}async function vr(c){const p=c.target;if(!p.files?.length)return;const g=await zt(p.files);b(Ee,[...t(Ee),...g],!0),p.value=""}let P=me(""),K=me(!1),ke=me(null),Le=me(!1);async function Re(){const c=t(P).trim(),p=c.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");if(p){b(Le,!0);try{await R.addCollection(p,c,void 0,t(K)||void 0),b(We,!1),b(P,""),b(K,!1)}catch{b(Le,!1),await new Promise(S=>requestAnimationFrame(S)),t(ke)?.classList.remove("shake"),t(ke)?.offsetWidth,t(ke)?.classList.add("shake"),t(ke)?.focus();return}finally{b(Le,!1)}}}function kt(c){c.key==="Enter"?(c.preventDefault(),Re()):c.key==="Escape"&&(b(We,!1),b(P,""),b(K,!1))}const Qe=z(()=>Ce.selectedRepo),Ze=z(()=>Ce.selectedId),Zt=z(()=>Ce.selectedSubPath),Kt=z(()=>R.filterQuery);let Ht=me(null);function Lt(c){const p=c.target.value;R.setFilterQuery(p)}function fr(){R.setFilterQuery(""),t(Ht)&&(t(Ht).value="")}function ts(c,p,g,S,q,F){for(const O of c){const je=q?`${q}/${O.name}`:O.name,ae=`${p}/${g}/${S}/${je}`;O.type==="directory"?(F.push({key:ae,kind:"content-dir",repo:p,folderKey:ae}),R.isFolderExpanded(ae)&&O.children?.length&&ts(O.children,p,g,S,je,F)):F.push({key:ae,kind:"content-file",repo:p,gotoPath:`/${p}/${g}/${S}/${je}`})}}const sr=z(()=>{const c=[],p=R.sortedRepos;for(const g of p)if(c.push({key:`repo:${g.name}`,kind:"repo",repo:g.name}),R.isExpanded(g.name)&&!g.loading){for(const S of g.entities)if(c.push({key:`entity:${g.name}/${S.entityType}/${S.id}`,kind:"entity",repo:g.name,entity:S}),S.hasSubContent&&R.isEntityExpanded(g.name,S.entityType,S.id)){const F=R.getEntityContents(g.name,S.entityType,S.id);!F.loading&&F.entries.length>0&&ts(F.entries,g.name,S.entityType,S.id,"",c)}}return c});let Ve=me(-1);const Ir=z(()=>t(Ve)>=0&&t(Ve)<t(sr).length?t(sr)[t(Ve)].key:null);let rs="";Vr(()=>{const c=R.filterQuery;c!==rs&&(rs=c,b(Ve,-1))});function ut(){requestAnimationFrame(()=>{if(!t(Mt)||t(Ve)<0)return;const c=t(sr)[t(Ve)]?.key;if(!c)return;const p=t(Mt).querySelector(`[data-tree-key="${CSS.escape(c)}"]`);p&&p.scrollIntoView({block:"nearest"})})}function At(){if(t(Ve)<0)return;const c=t(sr)[t(Ve)];if(c)switch(c.kind){case"repo":R.toggleRepo(c.repo);break;case"entity":c.entity&&Zr(c.entity,c.repo);break;case"content-dir":c.folderKey&&R.toggleFolder(c.folderKey);break;case"content-file":c.gotoPath&&cr(c.gotoPath);break}}function nr(){if(t(Ve)<0)return;const c=t(sr)[t(Ve)];c&&(c.kind==="repo"&&!R.isExpanded(c.repo)?R.toggleRepo(c.repo):c.kind==="entity"&&c.entity?.hasSubContent&&!R.isEntityExpanded(c.repo,c.entity.entityType,c.entity.id)?R.toggleEntity(c.repo,c.entity.entityType,c.entity.id):c.kind==="content-dir"&&c.folderKey&&!R.isFolderExpanded(c.folderKey)?R.toggleFolder(c.folderKey):t(Ve)<t(sr).length-1&&(as(Ve),ut()))}function Br(){if(t(Ve)<0)return;const c=t(sr)[t(Ve)];c&&(c.kind==="repo"&&R.isExpanded(c.repo)?R.toggleRepo(c.repo):c.kind==="entity"&&c.entity?.hasSubContent&&R.isEntityExpanded(c.repo,c.entity.entityType,c.entity.id)?R.toggleEntity(c.repo,c.entity.entityType,c.entity.id):c.kind==="content-dir"&&c.folderKey&&R.isFolderExpanded(c.folderKey)?R.toggleFolder(c.folderKey):t(Ve)>0&&(as(Ve,-1),ut()))}function gr(c){if(c.key==="Escape"){fr(),t(Ht)?.blur(),b(Ve,-1);return}if(c.key==="ArrowDown"){c.preventDefault(),t(Ve)<t(sr).length-1&&as(Ve),ut();return}if(c.key==="ArrowUp"){c.preventDefault(),t(Ve)>0?as(Ve,-1):t(Ve)===0&&b(Ve,-1),ut();return}if(c.key==="Enter"){c.preventDefault(),At();return}if(c.key==="ArrowRight"){c.preventDefault(),nr();return}if(c.key==="ArrowLeft"){c.preventDefault(),Br();return}}const Yt=z(()=>{if(!t(Ze)||!t(Qe))return null;const c=R.repos.find(g=>g.name===t(Qe));if(!c)return null;const p=c.entities.find(g=>g.id===t(Ze));return p?{repo:c.name,entityType:p.entityType,color:Rr(p.entityType)}:null});Vr(()=>{const c=t(Qe)&&t(Ze)?`${t(Qe)}/${t(Ze)}`:null;c&&c!==R.lastAutoExpandedFor&&t(Yt)&&(R.lastAutoExpandedFor=c,R.isExpanded(t(Yt).repo)||R.toggleRepo(t(Yt).repo))});let Mt=me(void 0);Fs(()=>{t(Mt)&&R.sidebarScrollTop>0&&(t(Mt).scrollTop=R.sidebarScrollTop)});function Or(){t(Mt)&&(R.sidebarScrollTop=t(Mt).scrollTop)}function ar(c){R.toggleRepo(c)}function yr(c,p,g){cr(`/${c}/${p}/${g}`)}let Wt=me(!1);function zr(c){return c.replace(/-/g," ").replace(/\b\w/g,p=>p.toUpperCase())}async function Fr(c,p){if(!t(Wt)){b(Wt,!0);try{const g=`${p}-${Date.now()}`,S=`Untitled ${zr(p)}`,q=new Date().toISOString(),F=q.split("T")[0],O=p==="deck"?`<!-- slide: cover -->
3
+ <!-- theme: light -->
4
+
5
+ # ${S}
6
+ ## Subtitle
7
+
8
+ ---
9
+
10
+ <!-- slide: end -->
11
+ `:p==="doc"?`## Cover Letter
12
+
13
+ Dear [Contact Name],
14
+
15
+ [Body text]
16
+
17
+ Sincerely,
18
+
19
+ [Your Name]
20
+
21
+ ## Project Overview
22
+
23
+ [Project overview text]
24
+ `:"";await Ta(c,p,g,{entity_type:p,entity_id:g,name:S,date:F,created_at:q,updated_at:q,created_by:"web",updated_by:"web"},O),await R.refreshEntities(c),cr(`/${c}/${p}/${g}?new=1`)}catch(g){console.error("Failed to create entity:",g)}finally{b(Wt,!1)}}}function Zr(c,p){const g=c.id===t(Ze)&&p===t(Qe)&&!t(Zt);o.mode==="full"&&o.collapse(),Ce.activeView==="graph"?Ce.selectOnGraph(p,c.entityType,c.id):g?(Ce.deselect(),cr("/")):(yr(p,c.entityType,c.id),c.hasSubContent&&R.toggleEntity(p,c.entityType,c.id))}function jr(c){if(!c)return"";const p=Date.now()-new Date(c).getTime(),g=Math.floor(p/6e4);if(g<1)return"now";if(g<60)return`${g}m`;const S=Math.floor(g/60);if(S<24)return`${S}h`;const q=Math.floor(S/24);return q<30?`${q}d`:`${Math.floor(q/30)}mo`}function ss(c){const p=t(Kt).trim().toLowerCase();if(!p)return[{text:c,match:!1}];const g=c.toLowerCase().indexOf(p);if(g===-1)return[{text:c,match:!1}];const S=[];return g>0&&S.push({text:c.slice(0,g),match:!1}),S.push({text:c.slice(g,g+p.length),match:!0}),g+p.length<c.length&&S.push({text:c.slice(g+p.length),match:!1}),S}function sa(c){const p=new Map;for(const S of c)p.set(S.entityType,(p.get(S.entityType)??0)+1);let g=0;for(const S of p.values())S>=2&&g++;return g>=2}function na(c){const p=new Map;for(const g of c){const S=p.get(g.entityType)??[];S.push(g),p.set(g.entityType,S)}return Array.from(p.entries()).map(([g,S])=>({type:g,label:zr(Ra(g)),entities:S})).sort((g,S)=>g.label.localeCompare(S.label))}const an=30;function Dr(c,p){return`${(p?20:50)+c*an}px`}function ns(c){return`${30+c*an}px`}var ln=Co(),Ts=x(ln),Ps=m(Ts),on=m(Ps);{var aa=c=>{Me(c,{variant:"ghost",class:"home-btn",title:"Home",onclick:()=>{Ce.deselect(),Ce.activeView!=="graph"&&cr("/")},children:(p,g)=>{var S=Xl(),q=x(S),F=m(q,!0);f(q);var O=w(q,2),je=m(O,!0);f(O),C(ae=>{B(F,ae),B(je,R.name||"Studiograph")},[()=>(R.name||"Studiograph")[0].toUpperCase()]),u(p,S)},$$slots:{default:!0}})};T(on,c=>{R.nameLoaded&&c(aa)})}var cn=w(on,2),dn=m(cn);{var ia=c=>{Me(c,{variant:"ghost",size:"icon",class:"settings-btn",title:"Sync workspace",onclick:_,children:(p,g)=>{xn(p,{size:14})},$$slots:{default:!0}})};T(dn,c=>{t(Ye)&&c(ia)})}var la=w(dn,2);{let c=z(()=>t(Ye)?"Workspace Settings":"Connectors");Me(la,{variant:"ghost",size:"icon",class:"settings-btn",get title(){return t(c)},href:"/settings",children:(p,g)=>{wn(p,{size:14})},$$slots:{default:!0}})}f(cn),f(Ps);var un=w(Ps,2);{var oa=c=>{var p=lo(),g=m(p);V(g,()=>Yi,(S,q)=>{q(S,{get value(){return Ce.settingsTab},onValueChange:F=>{Ce.settingsTab=F},class:"flex-1",children:(F,O)=>{const je=z(()=>mt.user?.role==="admin"||!mt.authEnabled);var ae=W(),St=x(ae);V(St,()=>Wi,(st,pt)=>{pt(st,{orientation:"vertical",children:(ht,ye)=>{var qe=io(),Oe=x(qe);V(Oe,()=>Lr,(oe,J)=>{J(oe,{value:"preferences",orientation:"vertical",children:(ee,E)=>{var I=Jl(),ce=x(I);wn(ce,{size:14}),Q(2),u(ee,I)},$$slots:{default:!0}})});var Ne=w(Oe,2);V(Ne,()=>Lr,(oe,J)=>{J(oe,{value:"connectors",orientation:"vertical",children:(ee,E)=>{var I=eo(),ce=x(I);Vi(ce,{size:14}),Q(2),u(ee,I)},$$slots:{default:!0}})});var ue=w(Ne,2);{var ze=oe=>{var J=ao(),ee=x(J);V(ee,()=>Lr,(Z,A)=>{A(Z,{value:"general",orientation:"vertical",children:(N,pe)=>{var X=to(),Y=x(X);Fi(Y,{size:14}),Q(2),u(N,X)},$$slots:{default:!0}})});var E=w(ee,2);V(E,()=>Lr,(Z,A)=>{A(Z,{value:"users",orientation:"vertical",children:(N,pe)=>{var X=ro(),Y=x(X);Ri(Y,{size:14}),Q(2),u(N,X)},$$slots:{default:!0}})});var I=w(E,2);V(I,()=>Lr,(Z,A)=>{A(Z,{value:"collections",orientation:"vertical",children:(N,pe)=>{var X=so(),Y=x(X);Mi(Y,{size:14}),Q(2),u(N,X)},$$slots:{default:!0}})});var ce=w(I,2);V(ce,()=>Lr,(Z,A)=>{A(Z,{value:"sources",orientation:"vertical",children:(N,pe)=>{var X=no(),Y=x(X);Di(Y,{size:14}),Q(2),u(N,X)},$$slots:{default:!0}})}),u(oe,J)};T(ue,oe=>{t(je)&&oe(ze)})}u(ht,qe)},$$slots:{default:!0}})}),u(F,ae)},$$slots:{default:!0}})}),f(p),u(c,p)},ca=c=>{var p=$o(),g=x(p),S=m(g),q=m(S);qn(q,{size:14}),f(S);var F=w(S,2);fs(F,{class:"filter-input",type:"text",placeholder:"Search",oninput:Lt,onkeydown:gr,get ref(){return t(Ht)},set ref(ue){b(Ht,ue,!0)}});var O=w(F,2);{var je=ue=>{Me(ue,{variant:"ghost",size:"icon",class:"filter-clear",onclick:fr,title:"Clear filter",children:(ze,oe)=>{Xr(ze,{size:13})},$$slots:{default:!0}})};T(O,ue=>{t(Kt)&&ue(je)})}var ae=w(O,2);{let ue=z(()=>R.sortMode==="recent"?"active":""),ze=z(()=>R.sortMode==="alpha"?"Sort by recent":"Sort alphabetically");Me(ae,{variant:"ghost",size:"icon",get class(){return`sort-toggle ${t(ue)??""}`},get title(){return t(ze)},onclick:()=>{R.sortMode=R.sortMode==="alpha"?"recent":"alpha"},children:(oe,J)=>{var ee=W(),E=x(ee);{var I=Z=>{Si(Z,{size:14})},ce=Z=>{xi(Z,{size:14})};T(E,Z=>{R.sortMode==="alpha"?Z(I):Z(ce,!1)})}u(oe,ee)},$$slots:{default:!0}})}f(g);var St=w(g,2),st=m(St);{var pt=ue=>{var ze=go(),oe=x(ze);tt(oe,17,()=>R.recentEntities,E=>`${E.repo}/${E.entityType}/${E.id}`,(E,I)=>{const ce=z(()=>t(I).id===t(Ze)&&t(I).repo===t(Qe)&&!t(Zt)),Z=z(()=>`entity:${t(I).repo}/${t(I).entityType}/${t(I).id}`);var A=vo(),N=m(A);{let X=z(()=>t(ce)?"selected":""),Y=z(()=>t(Ir)===t(Z)?"focused":""),ve=z(()=>`padding-left: 27px${t(ce)?`; --active-color: ${Rr(t(I).entityType)}`:""}`);Me(N,{variant:"ghost",get class(){return`tree-row ${t(X)??""} ${t(Y)??""}`},get"data-tree-key"(){return t(Z)},get style(){return t(ve)},onclick:()=>Zr(t(I),t(I).repo),children:(G,j)=>{var ge=uo(),Se=x(ge);let de;var he=w(Se,2),Te=m(he);{var Ge=ie=>{var $e=W(),Pe=x($e);tt(Pe,17,()=>ss(t(I).title),ct,(fe,we)=>{var nt=W(),lt=x(nt);{var at=Be=>{var it=oo(),$t=m(it,!0);f(it),C(()=>B($t,t(we).text)),u(Be,it)},ft=Be=>{var it=qt();C(()=>B(it,t(we).text)),u(Be,it)};T(lt,Be=>{t(we).match?Be(at):Be(ft,!1)})}u(fe,nt)}),u(ie,$e)},Ue=ie=>{var $e=qt();C(()=>B($e,t(I).title)),u(ie,$e)};T(Te,ie=>{t(Kt)?ie(Ge):ie(Ue,!1)})}f(he);var De=w(he,2);{var U=ie=>{var $e=co(),Pe=m($e,!0);f($e),C(fe=>B(Pe,fe),[()=>jr(t(I).updatedAt)]),u(ie,$e)};T(De,ie=>{t(I).updatedAt&&ie(U)})}C(ie=>de=br(Se,"",de,ie),[()=>({background:Rr(t(I).entityType)})]),u(G,ge)},$$slots:{default:!0}})}var pe=w(N,2);V(pe,()=>ps,(X,Y)=>{Y(X,{onOpenChange:ve=>{b(k,ve?t(Z):null,!0)},children:(ve,G)=>{var j=ho(),ge=x(j);{let de=z(()=>t(k)===t(Z)?"menu-open":"");V(ge,()=>cs,(he,Te)=>{Te(he,{get class(){return`entity-actions-btn ${t(de)??""}`},onclick:Ge=>Ge.stopPropagation(),children:(Ge,Ue)=>{hs(Ge,{size:12})},$$slots:{default:!0}})})}var Se=w(ge,2);V(Se,()=>ds,(de,he)=>{he(de,{children:(Te,Ge)=>{var Ue=W(),De=x(Ue);V(De,()=>us,(U,ie)=>{ie(U,{class:"repo-actions-menu",sideOffset:12,align:"start",children:($e,Pe)=>{var fe=W(),we=x(fe);V(we,()=>Gt,(nt,lt)=>{lt(nt,{class:"repo-menu-item repo-menu-item-danger",onSelect:at=>Ie(t(I).repo,t(I),at),children:(at,ft)=>{var Be=po(),it=x(Be);Qr(it,{size:12}),Q(),u(at,Be)},$$slots:{default:!0}})}),u($e,fe)},$$slots:{default:!0}})}),u(Te,Ue)},$$slots:{default:!0}})}),u(ve,j)},$$slots:{default:!0}})}),f(A),Tt("mouseenter",A,()=>{Ce.hoveredEntityId=t(I).id}),Tt("mouseleave",A,()=>{Ce.hoveredEntityId=null}),u(E,A)});var J=w(oe,2);{var ee=E=>{var I=fo();u(E,I)};T(J,E=>{t(Kt)&&R.recentEntities.length===0&&E(ee)})}u(ue,ze)},ht=ue=>{var ze=_o(),oe=x(ze);tt(oe,17,()=>R.sortedRepos,ct,(E,I)=>{s(E,()=>t(I))});var J=w(oe,2);{var ee=E=>{var I=mo();u(E,I)};T(J,E=>{t(Kt)&&R.sortedRepos.length===0&&E(ee)})}u(ue,ze)};T(st,ue=>{R.sortMode==="recent"?ue(pt):ue(ht,!1)})}var ye=w(st,2);{var qe=ue=>{var ze=bo(),oe=m(ze);fs(oe,{class:"new-collection-input",type:"text",placeholder:"New Collection",onkeydown:kt,onblur:()=>{!t(P).trim()&&!t(K)&&b(We,!1)},get disabled(){return t(Le)},get ref(){return t(ke)},set ref(A){b(ke,A,!0)},get value(){return t(P)},set value(A){b(P,A,!0)}});var J=w(oe,2);{var ee=A=>{Me(A,{variant:"ghost",size:"icon",class:"new-collection-clear",title:"Clear",onclick:()=>{b(P,""),b(K,!1),b(We,!1)},onmousedown:N=>N.preventDefault(),children:(N,pe)=>{Xr(N,{size:13})},$$slots:{default:!0}})},E=z(()=>t(P).trim());T(J,A=>{t(E)&&A(ee)})}var I=w(J,2);{var ce=A=>{{let N=z(()=>t(K)?"active":""),pe=z(()=>t(K)?"Private (local-only)":"Make private");Me(A,{variant:"ghost",size:"icon",get class(){return`private-toggle ${t(N)??""}`},get title(){return t(pe)},onclick:()=>{b(K,!t(K))},onmousedown:X=>X.preventDefault(),children:(X,Y)=>{var ve=W(),G=x(ve);{var j=Se=>{Ds(Se,{size:13})},ge=Se=>{ai(Se,{size:13})};T(G,Se=>{t(K)?Se(j):Se(ge,!1)})}u(X,ve)},$$slots:{default:!0}})}},Z=A=>{Ds(A,{size:13,class:"private-indicator"})};T(I,A=>{t(Ye)?A(ce):A(Z,!1)})}f(ze),u(ue,ze)};T(ye,ue=>{t(We)&&ue(qe)})}var Oe=w(ye,2);{var Ne=ue=>{Me(ue,{variant:"ghost",class:"repo-row new-collection-btn",onclick:()=>{b(We,!0),t(Ye)||b(K,!0),setTimeout(()=>t(ke)?.focus(),0)},title:"New collection",children:(ze,oe)=>{var J=ko(),ee=x(J),E=m(ee);is(E,{size:14}),f(ee),Q(2),u(ze,J)},$$slots:{default:!0}})};T(Oe,ue=>{t(We)||ue(Ne)})}f(St),Hs(St,ue=>b(Mt,ue),()=>t(Mt)),Tt("scroll",St,Or),u(c,p)};T(un,c=>{Ce.activeView==="settings"?c(oa):c(ca,!1)})}var da=w(un,2);{var ua=c=>{var p=wo(),g=m(p),S=m(g,!0);f(g);var q=w(g,2);Me(q,{variant:"ghost",size:"icon",class:"footer-icon-btn",title:"Sign out",onclick:()=>{b(v,!0)},children:(F,O)=>{Ja(F,{size:14})},$$slots:{default:!0}}),f(p),C(()=>B(S,mt.user.email)),u(c,p)};T(da,c=>{mt.authEnabled&&mt.user&&c(ua)})}f(Ts);var pn=w(Ts,2);{let c=z(()=>t(h)!==null),p=z(()=>`Delete "${t(h)}" and all its entities? This cannot be undone.`);os(pn,{get open(){return t(c)},title:"Delete Collection",get message(){return t(p)},confirmLabel:"Delete",destructive:!0,onconfirm:H,oncancel:()=>{b(h,null)}})}var hn=w(pn,2);{let c=z(()=>t(le)!==null),p=z(()=>`Delete "${t(le)?.title}"? This cannot be undone.`);os(hn,{get open(){return t(c)},title:"Delete Entity",get message(){return t(p)},confirmLabel:"Delete",destructive:!0,onconfirm:rt,oncancel:()=>{b(le,null)}})}var vn=w(hn,2);{let c=z(()=>t(Ke)!==null),p=z(()=>t(Ke)?.label),g=z(()=>`Delete all ${t(Ke)?.count} ${t(Ke)?.label?.toLowerCase()} in this collection? This cannot be undone.`);os(vn,{get open(){return t(c)},get title(){return`Delete All ${t(p)??""}`},get message(){return t(g)},confirmLabel:"Delete All",destructive:!0,onconfirm:Nt,oncancel:()=>{b(Ke,null)}})}var fn=w(vn,2);os(fn,{get open(){return t(v)},title:"Sign Out",message:"Are you sure you want to sign out?",confirmLabel:"Sign Out",destructive:!0,onconfirm:async()=>{b(v,!1),await mt.logout(),window.location.href="/login"},oncancel:()=>{b(v,!1)}});var gn=w(fn,2);{let c=z(()=>t(l)!==null),p=z(()=>t(l)??""),g=z(()=>R.apps.flatMap(S=>S.entityTypes));rl(gn,{get open(){return t(c)},get collection(){return t(p)},get appEntityTypes(){return t(g)},onselect:S=>{t(l)&&Fr(t(l),S)},oncancel:()=>{b(l,null)}})}var pa=w(gn,2);{let c=z(()=>!!t(vt));V(pa,()=>qs,(p,g)=>{g(p,{get open(){return t(c)},onOpenChange:S=>{S||(b(vt,null),b(Ee,[],!0))},children:(S,q)=>{var F=W(),O=x(F);V(O,()=>js,(je,ae)=>{ae(je,{class:"import-modal",children:(St,st)=>{var pt=Ro(),ht=x(pt);V(ht,()=>Bn,(E,I)=>{I(E,{children:(ce,Z)=>{var A=xo(),N=x(A);V(N,()=>On,(X,Y)=>{Y(X,{children:(ve,G)=>{Q();var j=qt();C(()=>B(j,`Import files into ${t(vt)??""}`)),u(ve,j)},$$slots:{default:!0}})});var pe=w(N,2);V(pe,()=>Qi,(X,Y)=>{Y(X,{children:(ve,G)=>{Q();var j=qt("Supports .md, .txt, and .csv files.");u(ve,j)},$$slots:{default:!0}})}),u(ce,A)},$$slots:{default:!0}})});var ye=w(ht,2),qe=m(ye);{var Oe=E=>{var I=zo();tt(I,21,()=>t(Ee),ct,(ce,Z,A)=>{var N=yo(),pe=m(N),X=m(pe);{var Y=U=>{Ki(U,{size:16})},ve=z(()=>t(Z).filename.endsWith(".csv")),G=U=>{Ha(U,{size:16})},j=z(()=>t(Z).filename.endsWith(".txt")),ge=U=>{qi(U,{size:16})};T(X,U=>{t(ve)?U(Y):t(j)?U(G,1):U(ge,!1)})}f(pe);var Se=w(pe,2),de=m(Se),he=m(de,!0);f(de);var Te=w(de,2),Ge=m(Te,!0);f(Te),f(Se);var Ue=w(Se,2),De=m(Ue);Xr(De,{size:14}),f(Ue),f(N),C(U=>{B(he,t(Z).filename),B(Ge,U)},[()=>t(Z).content.length<1024?`${t(Z).content.length} B`:`${(t(Z).content.length/1024).toFixed(1)} KB`]),kr("click",Ue,()=>{b(Ee,t(Ee).filter((U,ie)=>ie!==A),!0)}),u(ce,N)}),f(I),u(E,I)};T(qe,E=>{t(Ee).length>0&&E(Oe)})}var Ne=w(qe,2),ue=m(Ne);{var ze=E=>{var I=So(),ce=x(I);Cn(ce,{size:24,style:"opacity: 0.4"});var Z=w(ce,2),A=w(m(Z));f(Z),kr("click",A,()=>document.getElementById("import-file-input")?.click()),u(E,I)},oe=E=>{var I=To(),ce=w(m(I));f(I),kr("click",ce,()=>document.getElementById("import-file-input")?.click()),u(E,I)};T(ue,E=>{t(Ee).length===0?E(ze):E(oe,!1)})}f(Ne);var J=w(Ne,2);f(ye);var ee=w(ye,2);V(ee,()=>Ia,(E,I)=>{I(E,{children:(ce,Z)=>{var A=Po(),N=x(A);Me(N,{variant:"ghost",onclick:()=>{b(vt,null),b(Ee,[],!0)},children:(X,Y)=>{Q();var ve=qt("Cancel");u(X,ve)},$$slots:{default:!0}});var pe=w(N,2);{let X=z(()=>t(Ee).length===0||t(Ut));Me(pe,{get disabled(){return t(X)},onclick:()=>t(vt)&&xr(t(vt),t(Ee)),children:(Y,ve)=>{Q();var G=qt();C(()=>B(G,t(Ut)?"Importing...":`Import ${t(Ee).length} file${t(Ee).length!==1?"s":""}`)),u(Y,G)},$$slots:{default:!0}})}u(ce,A)},$$slots:{default:!0}})}),C(()=>Pr(Ne,1,`import-drop-zone ${t(Ee).length>0?"import-drop-zone-compact":""}`,"svelte-6dohdz")),Tt("dragover",Ne,E=>{E.preventDefault(),E.dataTransfer&&(E.dataTransfer.dropEffect="copy")}),Tt("drop",Ne,hr),kr("change",J,vr),u(St,pt)},$$slots:{default:!0}})}),u(S,F)},$$slots:{default:!0}})})}u(n,ln),be()}Ln(["dblclick","click","change"]);var Mo=ne("<title> </title>"),Eo=ne('<svg><!><path stroke-width="0" d="m2,6v20c0,1.1045.8955,2,2,2h24c1.1045,0,2-.8955,2-2V6c0-1.1045-.8955-2-2-2H4c-1.1045,0-2,.8955-2,2Zm20,0h6v20h-6V6Zm-18,0h16v9h-10.1699s3.5798-3.5898,3.5798-3.5898l-1.4099-1.4102-6,6,6,6,1.4099-1.4102-3.5798-3.5898h10.1699v9H4V6Z"></path></svg>');function Io(n,e){const r=se(e,["children","$$slots","$$events","$$legacy"]),a=se(r,["size","title"]);_e(e,!1);const s=re(),o=re();let l=M(e,"size",8,16),d=M(e,"title",8,void 0);te(()=>(D(r),D(d())),()=>{b(s,r["aria-label"]||r["aria-labelledby"]||d())}),te(()=>(t(s),D(r)),()=>{b(o,{"aria-hidden":t(s)?void 0:!0,role:t(s)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),Xe(),Je();var i=Eo();He(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:l(),height:l(),...t(o),...a}));var k=m(i);{var _=v=>{var h=Mo(),y=m(h,!0);f(h),C(()=>B(y,d())),u(v,h)};T(k,v=>{d()&&v(_)})}Q(),f(i),u(n,i),be()}var Do=ne("<title> </title>"),Ho=ne('<svg><!><path stroke-width="0" d="m2,6v20c0,1.1045.8955,2,2,2h24c1.1045,0,2-.8955,2-2V6c0-1.1045-.8955-2-2-2H4c-1.1045,0-2,.8955-2,2Zm20,0h6v20h-6V6Zm-18,0h16v20H4v-9h10.1699s-3.5801,3.5898-3.5801,3.5898l1.4102,1.4102,6-6-6-6-1.4102,1.4102,3.5801,3.5898H4V6Z"></path></svg>');function Lo(n,e){const r=se(e,["children","$$slots","$$events","$$legacy"]),a=se(r,["size","title"]);_e(e,!1);const s=re(),o=re();let l=M(e,"size",8,16),d=M(e,"title",8,void 0);te(()=>(D(r),D(d())),()=>{b(s,r["aria-label"]||r["aria-labelledby"]||d())}),te(()=>(t(s),D(r)),()=>{b(o,{"aria-hidden":t(s)?void 0:!0,role:t(s)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),Xe(),Je();var i=Ho();He(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:l(),height:l(),...t(o),...a}));var k=m(i);{var _=v=>{var h=Do(),y=m(h,!0);f(h),C(()=>B(y,d())),u(v,h)};T(k,v=>{d()&&v(_)})}Q(),f(i),u(n,i),be()}var Vo=ne("<title> </title>"),Bo=ne('<svg><!><path d="M13 21 26.17 21 23.59 23.59 25 25 30 20 25 15 23.59 16.41 26.17 19 13 19 13 21z"></path><path d="M22,14V10a1,1,0,0,0-.29-.71l-7-7A1,1,0,0,0,14,2H4A2,2,0,0,0,2,4V28a2,2,0,0,0,2,2H20a2,2,0,0,0,2-2V26H20v2H4V4h8v6a2,2,0,0,0,2,2h6v2Zm-8-4V4.41L19.59,10Z"></path></svg>');function Oo(n,e){const r=se(e,["children","$$slots","$$events","$$legacy"]),a=se(r,["size","title"]);_e(e,!1);const s=re(),o=re();let l=M(e,"size",8,16),d=M(e,"title",8,void 0);te(()=>(D(r),D(d())),()=>{b(s,r["aria-label"]||r["aria-labelledby"]||d())}),te(()=>(t(s),D(r)),()=>{b(o,{"aria-hidden":t(s)?void 0:!0,role:t(s)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),Xe(),Je();var i=Bo();He(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:l(),height:l(),...t(o),...a}));var k=m(i);{var _=v=>{var h=Vo(),y=m(h,!0);f(h),C(()=>B(y,d())),u(v,h)};T(k,v=>{d()&&v(_)})}Q(2),f(i),u(n,i),be()}var Fo=ne("<title> </title>"),Zo=ne('<svg><!><path d="M24,6H8A2,2,0,0,0,6,8V24a2,2,0,0,0,2,2H24a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2Z"></path></svg>');function jo(n,e){const r=se(e,["children","$$slots","$$events","$$legacy"]),a=se(r,["size","title"]);_e(e,!1);const s=re(),o=re();let l=M(e,"size",8,16),d=M(e,"title",8,void 0);te(()=>(D(r),D(d())),()=>{b(s,r["aria-label"]||r["aria-labelledby"]||d())}),te(()=>(t(s),D(r)),()=>{b(o,{"aria-hidden":t(s)?void 0:!0,role:t(s)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),Xe(),Je();var i=Zo();He(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:l(),height:l(),...t(o),...a}));var k=m(i);{var _=v=>{var h=Fo(),y=m(h,!0);f(h),C(()=>B(y,d())),u(v,h)};T(k,v=>{d()&&v(_)})}Q(),f(i),u(n,i),be()}var qo=ne("<title> </title>"),No=ne('<svg><!><path d="M16,30A14,14,0,1,1,30,16,14,14,0,0,1,16,30ZM16,4A12,12,0,1,0,28,16,12,12,0,0,0,16,4Z"></path><path d="M20.59 22 15 16.41 15 7 17 7 17 15.58 22 20.59 20.59 22z"></path></svg>');function Uo(n,e){const r=se(e,["children","$$slots","$$events","$$legacy"]),a=se(r,["size","title"]);_e(e,!1);const s=re(),o=re();let l=M(e,"size",8,16),d=M(e,"title",8,void 0);te(()=>(D(r),D(d())),()=>{b(s,r["aria-label"]||r["aria-labelledby"]||d())}),te(()=>(t(s),D(r)),()=>{b(o,{"aria-hidden":t(s)?void 0:!0,role:t(s)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),Xe(),Je();var i=No();He(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:l(),height:l(),...t(o),...a}));var k=m(i);{var _=v=>{var h=qo(),y=m(h,!0);f(h),C(()=>B(y,d())),u(v,h)};T(k,v=>{d()&&v(_)})}Q(2),f(i),u(n,i),be()}function Qs(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Er=Qs();function Nn(n){Er=n}var Cr={exec:()=>null};function xe(n,e=""){let r=typeof n=="string"?n:n.source,a={replace:(s,o)=>{let l=typeof o=="string"?o:o.source;return l=l.replace(Rt.caret,"$1"),r=r.replace(s,l),a},getRegex:()=>new RegExp(r,e)};return a}var Ko=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Rt={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:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}>`)},Yo=/^(?:[ \t]*(?:\n|$))+/,Wo=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Qo=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,es=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Go=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Gs=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Un=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Kn=xe(Un).replace(/bull/g,Gs).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(),Xo=xe(Un).replace(/bull/g,Gs).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(),Xs=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Jo=/^[^\n]+/,Js=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ec=xe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Js).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),tc=xe(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Gs).getRegex(),zs="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",en=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,rc=xe("^ {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",en).replace("tag",zs).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Yn=xe(Xs).replace("hr",es).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",zs).getRegex(),sc=xe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Yn).getRegex(),tn={blockquote:sc,code:Wo,def:ec,fences:Qo,heading:Go,hr:es,html:rc,lheading:Kn,list:tc,newline:Yo,paragraph:Yn,table:Cr,text:Jo},An=xe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",es).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",zs).getRegex(),nc={...tn,lheading:Xo,table:An,paragraph:xe(Xs).replace("hr",es).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",An).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",zs).getRegex()},ac={...tn,html:xe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",en).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:Cr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:xe(Xs).replace("hr",es).replace("heading",` *#{1,6} *[^
25
+ ]`).replace("lheading",Kn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ic=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,lc=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Wn=/^( {2,}|\\)\n(?!\s*$)/,oc=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ss=/[\p{P}\p{S}]/u,rn=/[\s\p{P}\p{S}]/u,Qn=/[^\s\p{P}\p{S}]/u,cc=xe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,rn).getRegex(),Gn=/(?!~)[\p{P}\p{S}]/u,dc=/(?!~)[\s\p{P}\p{S}]/u,uc=/(?:[^\s\p{P}\p{S}]|~)/u,Xn=/(?![*_])[\p{P}\p{S}]/u,pc=/(?![*_])[\s\p{P}\p{S}]/u,hc=/(?:[^\s\p{P}\p{S}]|[*_])/u,vc=xe(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ko?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Jn=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,fc=xe(Jn,"u").replace(/punct/g,Ss).getRegex(),gc=xe(Jn,"u").replace(/punct/g,Gn).getRegex(),ea="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",mc=xe(ea,"gu").replace(/notPunctSpace/g,Qn).replace(/punctSpace/g,rn).replace(/punct/g,Ss).getRegex(),_c=xe(ea,"gu").replace(/notPunctSpace/g,uc).replace(/punctSpace/g,dc).replace(/punct/g,Gn).getRegex(),bc=xe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Qn).replace(/punctSpace/g,rn).replace(/punct/g,Ss).getRegex(),kc=xe(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Xn).getRegex(),$c="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",wc=xe($c,"gu").replace(/notPunctSpace/g,hc).replace(/punctSpace/g,pc).replace(/punct/g,Xn).getRegex(),xc=xe(/\\(punct)/,"gu").replace(/punct/g,Ss).getRegex(),yc=xe(/^<(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(),zc=xe(en).replace("(?:-->|$)","-->").getRegex(),Sc=xe("^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",zc).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ms=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Tc=xe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ms).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ta=xe(/^!?\[(label)\]\[(ref)\]/).replace("label",ms).replace("ref",Js).getRegex(),ra=xe(/^!?\[(ref)\](?:\[\])?/).replace("ref",Js).getRegex(),Pc=xe("reflink|nolink(?!\\()","g").replace("reflink",ta).replace("nolink",ra).getRegex(),Mn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,sn={_backpedal:Cr,anyPunctuation:xc,autolink:yc,blockSkip:vc,br:Wn,code:lc,del:Cr,delLDelim:Cr,delRDelim:Cr,emStrongLDelim:fc,emStrongRDelimAst:mc,emStrongRDelimUnd:bc,escape:ic,link:Tc,nolink:ra,punctuation:cc,reflink:ta,reflinkSearch:Pc,tag:Sc,text:oc,url:Cr},Rc={...sn,link:xe(/^!?\[(label)\]\((.*?)\)/).replace("label",ms).getRegex(),reflink:xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ms).getRegex()},Ls={...sn,emStrongRDelimAst:_c,emStrongLDelim:gc,delLDelim:kc,delRDelim:wc,url:xe(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Mn).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:xe(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Mn).getRegex()},Cc={...Ls,br:xe(Wn).replace("{2,}","*").getRegex(),text:xe(Ls.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},vs={normal:tn,gfm:nc,pedantic:ac},Kr={normal:sn,gfm:Ls,breaks:Cc,pedantic:Rc},Ac={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},En=n=>Ac[n];function dr(n,e){if(e){if(Rt.escapeTest.test(n))return n.replace(Rt.escapeReplace,En)}else if(Rt.escapeTestNoEncode.test(n))return n.replace(Rt.escapeReplaceNoEncode,En);return n}function In(n){try{n=encodeURI(n).replace(Rt.percentDecode,"%")}catch{return null}return n}function Dn(n,e){let r=n.replace(Rt.findPipe,(o,l,d)=>{let i=!1,k=l;for(;--k>=0&&d[k]==="\\";)i=!i;return i?"|":" |"}),a=r.split(Rt.splitPipe),s=0;if(a[0].trim()||a.shift(),a.length>0&&!a.at(-1)?.trim()&&a.pop(),e)if(a.length>e)a.splice(e);else for(;a.length<e;)a.push("");for(;s<a.length;s++)a[s]=a[s].trim().replace(Rt.slashPipe,"|");return a}function Yr(n,e,r){let a=n.length;if(a===0)return"";let s=0;for(;s<a&&n.charAt(a-s-1)===e;)s++;return n.slice(0,a-s)}function Mc(n,e){if(n.indexOf(e[1])===-1)return-1;let r=0;for(let a=0;a<n.length;a++)if(n[a]==="\\")a++;else if(n[a]===e[0])r++;else if(n[a]===e[1]&&(r--,r<0))return a;return r>0?-2:-1}function Ec(n,e=0){let r=e,a="";for(let s of n)if(s===" "){let o=4-r%4;a+=" ".repeat(o),r+=o}else a+=s,r++;return a}function Hn(n,e,r,a,s){let o=e.href,l=e.title||null,d=n[1].replace(s.other.outputLinkReplace,"$1");a.state.inLink=!0;let i={type:n[0].charAt(0)==="!"?"image":"link",raw:r,href:o,title:l,text:d,tokens:a.inlineTokens(d)};return a.state.inLink=!1,i}function Ic(n,e,r){let a=n.match(r.other.indentCodeCompensation);if(a===null)return e;let s=a[1];return e.split(`
26
+ `).map(o=>{let l=o.match(r.other.beginningSpace);if(l===null)return o;let[d]=l;return d.length>=s.length?o.slice(s.length):o}).join(`
27
+ `)}var _s=class{options;rules;lexer;constructor(n){this.options=n||Er}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Yr(r,`
28
+ `)}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let r=e[0],a=Ic(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:a}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let a=Yr(r,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(r=a.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:Yr(e[0],`
29
+ `)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let r=Yr(e[0],`
30
+ `).split(`
31
+ `),a="",s="",o=[];for(;r.length>0;){let l=!1,d=[],i;for(i=0;i<r.length;i++)if(this.rules.other.blockquoteStart.test(r[i]))d.push(r[i]),l=!0;else if(!l)d.push(r[i]);else break;r=r.slice(i);let k=d.join(`
32
+ `),_=k.replace(this.rules.other.blockquoteSetextReplace,`
33
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");a=a?`${a}
34
+ ${k}`:k,s=s?`${s}
35
+ ${_}`:_;let v=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(_,o,!0),this.lexer.state.top=v,r.length===0)break;let h=o.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){let y=h,H=y.raw+`
36
+ `+r.join(`
37
+ `),L=this.blockquote(H);o[o.length-1]=L,a=a.substring(0,a.length-y.raw.length)+L.raw,s=s.substring(0,s.length-y.text.length)+L.text;break}else if(h?.type==="list"){let y=h,H=y.raw+`
38
+ `+r.join(`
39
+ `),L=this.list(H);o[o.length-1]=L,a=a.substring(0,a.length-h.raw.length)+L.raw,s=s.substring(0,s.length-y.raw.length)+L.raw,r=H.substring(o.at(-1).raw.length).split(`
40
+ `);continue}}return{type:"blockquote",raw:a,tokens:o,text:s}}}list(n){let e=this.rules.block.list.exec(n);if(e){let r=e[1].trim(),a=r.length>1,s={type:"list",raw:"",ordered:a,start:a?+r.slice(0,-1):"",loose:!1,items:[]};r=a?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=a?r:"[*+-]");let o=this.rules.other.listItemRegex(r),l=!1;for(;n;){let i=!1,k="",_="";if(!(e=o.exec(n))||this.rules.block.hr.test(n))break;k=e[0],n=n.substring(k.length);let v=Ec(e[2].split(`
41
+ `,1)[0],e[1].length),h=n.split(`
42
+ `,1)[0],y=!v.trim(),H=0;if(this.options.pedantic?(H=2,_=v.trimStart()):y?H=e[1].length+1:(H=v.search(this.rules.other.nonSpaceChar),H=H>4?1:H,_=v.slice(H),H+=e[1].length),y&&this.rules.other.blankLine.test(h)&&(k+=h+`
43
+ `,n=n.substring(h.length+1),i=!0),!i){let L=this.rules.other.nextBulletRegex(H),Fe=this.rules.other.hrRegex(H),le=this.rules.other.fencesBeginRegex(H),Ie=this.rules.other.headingBeginRegex(H),rt=this.rules.other.htmlBeginRegex(H),Ke=this.rules.other.blockquoteBeginRegex(H);for(;n;){let Et=n.split(`
44
+ `,1)[0],wt;if(h=Et,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),wt=h):wt=h.replace(this.rules.other.tabCharGlobal," "),le.test(h)||Ie.test(h)||rt.test(h)||Ke.test(h)||L.test(h)||Fe.test(h))break;if(wt.search(this.rules.other.nonSpaceChar)>=H||!h.trim())_+=`
45
+ `+wt.slice(H);else{if(y||v.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||le.test(v)||Ie.test(v)||Fe.test(v))break;_+=`
46
+ `+h}y=!h.trim(),k+=Et+`
47
+ `,n=n.substring(Et.length+1),v=wt.slice(H)}}s.loose||(l?s.loose=!0:this.rules.other.doubleBlankLine.test(k)&&(l=!0)),s.items.push({type:"list_item",raw:k,task:!!this.options.gfm&&this.rules.other.listIsTask.test(_),loose:!1,text:_,tokens:[]}),s.raw+=k}let d=s.items.at(-1);if(d)d.raw=d.raw.trimEnd(),d.text=d.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let i of s.items){if(this.lexer.state.top=!1,i.tokens=this.lexer.blockTokens(i.text,[]),i.task){if(i.text=i.text.replace(this.rules.other.listReplaceTask,""),i.tokens[0]?.type==="text"||i.tokens[0]?.type==="paragraph"){i.tokens[0].raw=i.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),i.tokens[0].text=i.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let _=this.lexer.inlineQueue.length-1;_>=0;_--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[_].src)){this.lexer.inlineQueue[_].src=this.lexer.inlineQueue[_].src.replace(this.rules.other.listReplaceTask,"");break}}let k=this.rules.other.listTaskCheckbox.exec(i.raw);if(k){let _={type:"checkbox",raw:k[0]+" ",checked:k[0]!=="[ ]"};i.checked=_.checked,s.loose?i.tokens[0]&&["paragraph","text"].includes(i.tokens[0].type)&&"tokens"in i.tokens[0]&&i.tokens[0].tokens?(i.tokens[0].raw=_.raw+i.tokens[0].raw,i.tokens[0].text=_.raw+i.tokens[0].text,i.tokens[0].tokens.unshift(_)):i.tokens.unshift({type:"paragraph",raw:_.raw,text:_.raw,tokens:[_]}):i.tokens.unshift(_)}}if(!s.loose){let k=i.tokens.filter(v=>v.type==="space"),_=k.length>0&&k.some(v=>this.rules.other.anyLine.test(v.raw));s.loose=_}}if(s.loose)for(let i of s.items){i.loose=!0;for(let k of i.tokens)k.type==="text"&&(k.type="paragraph")}return s}}html(n){let e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){let e=this.rules.block.def.exec(n);if(e){let r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),a=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:e[0],href:a,title:s}}}table(n){let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=Dn(e[1]),a=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
48
+ `):[],o={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===a.length){for(let l of a)this.rules.other.tableAlignRight.test(l)?o.align.push("right"):this.rules.other.tableAlignCenter.test(l)?o.align.push("center"):this.rules.other.tableAlignLeft.test(l)?o.align.push("left"):o.align.push(null);for(let l=0;l<r.length;l++)o.header.push({text:r[l],tokens:this.lexer.inline(r[l]),header:!0,align:o.align[l]});for(let l of s)o.rows.push(Dn(l,o.header.length).map((d,i)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:o.align[i]})));return o}}lheading(n){let e=this.rules.block.lheading.exec(n);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(n){let e=this.rules.block.paragraph.exec(n);if(e){let r=e[1].charAt(e[1].length-1)===`
49
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);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(n){let e=this.rules.inline.link.exec(n);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let o=Yr(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{let o=Mc(e[2],"()");if(o===-2)return;if(o>-1){let l=(e[0].indexOf("!")===0?5:4)+e[1].length+o;e[2]=e[2].substring(0,o),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let a=e[2],s="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(a);o&&(a=o[1],s=o[3])}else s=e[3]?e[3].slice(1,-1):"";return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?a=a.slice(1):a=a.slice(1,-1)),Hn(e,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let r;if((r=this.rules.inline.reflink.exec(n))||(r=this.rules.inline.nolink.exec(n))){let a=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[a.toLowerCase()];if(!s){let o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return Hn(r,s,r[0],this.lexer,this.rules)}}emStrong(n,e,r=""){let a=this.rules.inline.emStrongLDelim.exec(n);if(!(!a||a[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(a[1]||a[2])||!r||this.rules.inline.punctuation.exec(r))){let s=[...a[0]].length-1,o,l,d=s,i=0,k=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(k.lastIndex=0,e=e.slice(-1*n.length+s);(a=k.exec(e))!=null;){if(o=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!o)continue;if(l=[...o].length,a[3]||a[4]){d+=l;continue}else if((a[5]||a[6])&&s%3&&!((s+l)%3)){i+=l;continue}if(d-=l,d>0)continue;l=Math.min(l,l+d+i);let _=[...a[0]][0].length,v=n.slice(0,s+a.index+_+l);if(Math.min(s,l)%2){let y=v.slice(1,-1);return{type:"em",raw:v,text:y,tokens:this.lexer.inlineTokens(y)}}let h=v.slice(2,-2);return{type:"strong",raw:v,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),a=this.rules.other.nonSpaceChar.test(r),s=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return a&&s&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n,e,r=""){let a=this.rules.inline.delLDelim.exec(n);if(a&&(!a[1]||!r||this.rules.inline.punctuation.exec(r))){let s=[...a[0]].length-1,o,l,d=s,i=this.rules.inline.delRDelim;for(i.lastIndex=0,e=e.slice(-1*n.length+s);(a=i.exec(e))!=null;){if(o=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!o||(l=[...o].length,l!==s))continue;if(a[3]||a[4]){d+=l;continue}if(d-=l,d>0)continue;l=Math.min(l,l+d);let k=[...a[0]][0].length,_=n.slice(0,s+a.index+k+l),v=_.slice(s,-s);return{type:"del",raw:_,text:v,tokens:this.lexer.inlineTokens(v)}}}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let r,a;return e[2]==="@"?(r=e[1],a="mailto:"+r):(r=e[1],a=r),{type:"link",raw:e[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}url(n){let e;if(e=this.rules.inline.url.exec(n)){let r,a;if(e[2]==="@")r=e[0],a="mailto:"+r;else{let s;do s=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(s!==e[0]);r=e[0],e[1]==="www."?a="http://"+e[0]:a=e[0]}return{type:"link",raw:e[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},Jt=class Vs{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Er,this.options.tokenizer=this.options.tokenizer||new _s,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 r={other:Rt,block:vs.normal,inline:Kr.normal};this.options.pedantic?(r.block=vs.pedantic,r.inline=Kr.pedantic):this.options.gfm&&(r.block=vs.gfm,this.options.breaks?r.inline=Kr.breaks:r.inline=Kr.gfm),this.tokenizer.rules=r}static get rules(){return{block:vs,inline:Kr}}static lex(e,r){return new Vs(r).lex(e)}static lexInline(e,r){return new Vs(r).inlineTokens(e)}lex(e){e=e.replace(Rt.carriageReturn,`
50
+ `),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let a=this.inlineQueue[r];this.inlineTokens(a.src,a.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],a=!1){for(this.options.pedantic&&(e=e.replace(Rt.tabCharGlobal," ").replace(Rt.spaceLine,""));e;){let s;if(this.options.extensions?.block?.some(l=>(s=l.call({lexer:this},e,r))?(e=e.substring(s.raw.length),r.push(s),!0):!1))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);let l=r.at(-1);s.raw.length===1&&l!==void 0?l.raw+=`
51
+ `:r.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);let l=r.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
52
+ `)?"":`
53
+ `)+s.raw,l.text+=`
54
+ `+s.text,this.inlineQueue.at(-1).src=l.text):r.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length);let l=r.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
55
+ `)?"":`
56
+ `)+s.raw,l.text+=`
57
+ `+s.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},r.push(s));continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),r.push(s);continue}let o=e;if(this.options.extensions?.startBlock){let l=1/0,d=e.slice(1),i;this.options.extensions.startBlock.forEach(k=>{i=k.call({lexer:this},d),typeof i=="number"&&i>=0&&(l=Math.min(l,i))}),l<1/0&&l>=0&&(o=e.substring(0,l+1))}if(this.state.top&&(s=this.tokenizer.paragraph(o))){let l=r.at(-1);a&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(`
58
+ `)?"":`
59
+ `)+s.raw,l.text+=`
60
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(s),a=o.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);let l=r.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
61
+ `)?"":`
62
+ `)+s.raw,l.text+=`
63
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(s);continue}if(e){let l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){let a=e,s=null;if(this.tokens.links){let i=Object.keys(this.tokens.links);if(i.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)i.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,s.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)o=s[2]?s[2].length:0,a=a.slice(0,s.index+o)+"["+"a".repeat(s[0].length-o-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=this.options.hooks?.emStrongMask?.call({lexer:this},a)??a;let l=!1,d="";for(;e;){l||(d=""),l=!1;let i;if(this.options.extensions?.inline?.some(_=>(i=_.call({lexer:this},e,r))?(e=e.substring(i.raw.length),r.push(i),!0):!1))continue;if(i=this.tokenizer.escape(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.tag(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.link(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(i.raw.length);let _=r.at(-1);i.type==="text"&&_?.type==="text"?(_.raw+=i.raw,_.text+=i.text):r.push(i);continue}if(i=this.tokenizer.emStrong(e,a,d)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.codespan(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.br(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.del(e,a,d)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.autolink(e)){e=e.substring(i.raw.length),r.push(i);continue}if(!this.state.inLink&&(i=this.tokenizer.url(e))){e=e.substring(i.raw.length),r.push(i);continue}let k=e;if(this.options.extensions?.startInline){let _=1/0,v=e.slice(1),h;this.options.extensions.startInline.forEach(y=>{h=y.call({lexer:this},v),typeof h=="number"&&h>=0&&(_=Math.min(_,h))}),_<1/0&&_>=0&&(k=e.substring(0,_+1))}if(i=this.tokenizer.inlineText(k)){e=e.substring(i.raw.length),i.raw.slice(-1)!=="_"&&(d=i.raw.slice(-1)),l=!0;let _=r.at(-1);_?.type==="text"?(_.raw+=i.raw,_.text+=i.text):r.push(i);continue}if(e){let _="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(_);break}else throw new Error(_)}}return r}},bs=class{options;parser;constructor(n){this.options=n||Er}space(n){return""}code({text:n,lang:e,escaped:r}){let a=(e||"").match(Rt.notSpaceStart)?.[0],s=n.replace(Rt.endingNewline,"")+`
64
+ `;return a?'<pre><code class="language-'+dr(a)+'">'+(r?s:dr(s,!0))+`</code></pre>
65
+ `:"<pre><code>"+(r?s:dr(s,!0))+`</code></pre>
66
+ `}blockquote({tokens:n}){return`<blockquote>
67
+ ${this.parser.parse(n)}</blockquote>
68
+ `}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>
69
+ `}hr(n){return`<hr>
70
+ `}list(n){let e=n.ordered,r=n.start,a="";for(let l=0;l<n.items.length;l++){let d=n.items[l];a+=this.listitem(d)}let s=e?"ol":"ul",o=e&&r!==1?' start="'+r+'"':"";return"<"+s+o+`>
71
+ `+a+"</"+s+`>
72
+ `}listitem(n){return`<li>${this.parser.parse(n.tokens)}</li>
73
+ `}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
74
+ `}table(n){let e="",r="";for(let s=0;s<n.header.length;s++)r+=this.tablecell(n.header[s]);e+=this.tablerow({text:r});let a="";for(let s=0;s<n.rows.length;s++){let o=n.rows[s];r="";for(let l=0;l<o.length;l++)r+=this.tablecell(o[l]);a+=this.tablerow({text:r})}return a&&(a=`<tbody>${a}</tbody>`),`<table>
75
+ <thead>
76
+ `+e+`</thead>
77
+ `+a+`</table>
78
+ `}tablerow({text:n}){return`<tr>
79
+ ${n}</tr>
80
+ `}tablecell(n){let e=this.parser.parseInline(n.tokens),r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+e+`</${r}>
81
+ `}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${dr(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:r}){let a=this.parser.parseInline(r),s=In(n);if(s===null)return a;n=s;let o='<a href="'+n+'"';return e&&(o+=' title="'+dr(e)+'"'),o+=">"+a+"</a>",o}image({href:n,title:e,text:r,tokens:a}){a&&(r=this.parser.parseInline(a,this.parser.textRenderer));let s=In(n);if(s===null)return dr(r);n=s;let o=`<img src="${n}" alt="${dr(r)}"`;return e&&(o+=` title="${dr(e)}"`),o+=">",o}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:dr(n.text)}},nn=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},er=class Bs{options;renderer;textRenderer;constructor(e){this.options=e||Er,this.options.renderer=this.options.renderer||new bs,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new nn}static parse(e,r){return new Bs(r).parse(e)}static parseInline(e,r){return new Bs(r).parseInline(e)}parse(e){let r="";for(let a=0;a<e.length;a++){let s=e[a];if(this.options.extensions?.renderers?.[s.type]){let l=s,d=this.options.extensions.renderers[l.type].call({parser:this},l);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){r+=d||"";continue}}let o=s;switch(o.type){case"space":{r+=this.renderer.space(o);break}case"hr":{r+=this.renderer.hr(o);break}case"heading":{r+=this.renderer.heading(o);break}case"code":{r+=this.renderer.code(o);break}case"table":{r+=this.renderer.table(o);break}case"blockquote":{r+=this.renderer.blockquote(o);break}case"list":{r+=this.renderer.list(o);break}case"checkbox":{r+=this.renderer.checkbox(o);break}case"html":{r+=this.renderer.html(o);break}case"def":{r+=this.renderer.def(o);break}case"paragraph":{r+=this.renderer.paragraph(o);break}case"text":{r+=this.renderer.text(o);break}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}parseInline(e,r=this.renderer){let a="";for(let s=0;s<e.length;s++){let o=e[s];if(this.options.extensions?.renderers?.[o.type]){let d=this.options.extensions.renderers[o.type].call({parser:this},o);if(d!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){a+=d||"";continue}}let l=o;switch(l.type){case"escape":{a+=r.text(l);break}case"html":{a+=r.html(l);break}case"link":{a+=r.link(l);break}case"image":{a+=r.image(l);break}case"checkbox":{a+=r.checkbox(l);break}case"strong":{a+=r.strong(l);break}case"em":{a+=r.em(l);break}case"codespan":{a+=r.codespan(l);break}case"br":{a+=r.br(l);break}case"del":{a+=r.del(l);break}case"text":{a+=r.text(l);break}default:{let d='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return a}},Gr=class{options;block;constructor(n){this.options=n||Er}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?Jt.lex:Jt.lexInline}provideParser(){return this.block?er.parse:er.parseInline}},Dc=class{defaults=Qs();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=er;Renderer=bs;TextRenderer=nn;Lexer=Jt;Tokenizer=_s;Hooks=Gr;constructor(...n){this.use(...n)}walkTokens(n,e){let r=[];for(let a of n)switch(r=r.concat(e.call(this,a)),a.type){case"table":{let s=a;for(let o of s.header)r=r.concat(this.walkTokens(o.tokens,e));for(let o of s.rows)for(let l of o)r=r.concat(this.walkTokens(l.tokens,e));break}case"list":{let s=a;r=r.concat(this.walkTokens(s.items,e));break}default:{let s=a;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(o=>{let l=s[o].flat(1/0);r=r.concat(this.walkTokens(l,e))}):s.tokens&&(r=r.concat(this.walkTokens(s.tokens,e)))}}return r}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(r=>{let a={...r};if(a.async=this.defaults.async||a.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let o=e.renderers[s.name];o?e.renderers[s.name]=function(...l){let d=s.renderer.apply(this,l);return d===!1&&(d=o.apply(this,l)),d}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=e[s.level];o?o.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),a.extensions=e),r.renderer){let s=this.defaults.renderer||new bs(this.defaults);for(let o in r.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let l=o,d=r.renderer[l],i=s[l];s[l]=(...k)=>{let _=d.apply(s,k);return _===!1&&(_=i.apply(s,k)),_||""}}a.renderer=s}if(r.tokenizer){let s=this.defaults.tokenizer||new _s(this.defaults);for(let o in r.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let l=o,d=r.tokenizer[l],i=s[l];s[l]=(...k)=>{let _=d.apply(s,k);return _===!1&&(_=i.apply(s,k)),_}}a.tokenizer=s}if(r.hooks){let s=this.defaults.hooks||new Gr;for(let o in r.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let l=o,d=r.hooks[l],i=s[l];Gr.passThroughHooks.has(o)?s[l]=k=>{if(this.defaults.async&&Gr.passThroughHooksRespectAsync.has(o))return(async()=>{let v=await d.call(s,k);return i.call(s,v)})();let _=d.call(s,k);return i.call(s,_)}:s[l]=(...k)=>{if(this.defaults.async)return(async()=>{let v=await d.apply(s,k);return v===!1&&(v=await i.apply(s,k)),v})();let _=d.apply(s,k);return _===!1&&(_=i.apply(s,k)),_}}a.hooks=s}if(r.walkTokens){let s=this.defaults.walkTokens,o=r.walkTokens;a.walkTokens=function(l){let d=[];return d.push(o.call(this,l)),s&&(d=d.concat(s.call(this,l))),d}}this.defaults={...this.defaults,...a}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return Jt.lex(n,e??this.defaults)}parser(n,e){return er.parse(n,e??this.defaults)}parseMarkdown(n){return(e,r)=>{let a={...r},s={...this.defaults,...a},o=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&a.async===!1)return o(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 o(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=n),s.async)return(async()=>{let l=s.hooks?await s.hooks.preprocess(e):e,d=await(s.hooks?await s.hooks.provideLexer():n?Jt.lex:Jt.lexInline)(l,s),i=s.hooks?await s.hooks.processAllTokens(d):d;s.walkTokens&&await Promise.all(this.walkTokens(i,s.walkTokens));let k=await(s.hooks?await s.hooks.provideParser():n?er.parse:er.parseInline)(i,s);return s.hooks?await s.hooks.postprocess(k):k})().catch(o);try{s.hooks&&(e=s.hooks.preprocess(e));let l=(s.hooks?s.hooks.provideLexer():n?Jt.lex:Jt.lexInline)(e,s);s.hooks&&(l=s.hooks.processAllTokens(l)),s.walkTokens&&this.walkTokens(l,s.walkTokens);let d=(s.hooks?s.hooks.provideParser():n?er.parse:er.parseInline)(l,s);return s.hooks&&(d=s.hooks.postprocess(d)),d}catch(l){return o(l)}}}onError(n,e){return r=>{if(r.message+=`
82
+ Please report this to https://github.com/markedjs/marked.`,n){let a="<p>An error occurred:</p><pre>"+dr(r.message+"",!0)+"</pre>";return e?Promise.resolve(a):a}if(e)return Promise.reject(r);throw r}}},Ar=new Dc;function Ae(n,e){return Ar.parse(n,e)}Ae.options=Ae.setOptions=function(n){return Ar.setOptions(n),Ae.defaults=Ar.defaults,Nn(Ae.defaults),Ae};Ae.getDefaults=Qs;Ae.defaults=Er;Ae.use=function(...n){return Ar.use(...n),Ae.defaults=Ar.defaults,Nn(Ae.defaults),Ae};Ae.walkTokens=function(n,e){return Ar.walkTokens(n,e)};Ae.parseInline=Ar.parseInline;Ae.Parser=er;Ae.parser=er.parse;Ae.Renderer=bs;Ae.TextRenderer=nn;Ae.Lexer=Jt;Ae.lexer=Jt.lex;Ae.Tokenizer=_s;Ae.Hooks=Gr;Ae.parse=Ae;Ae.options;Ae.setOptions;Ae.use;Ae.walkTokens;Ae.parseInline;er.parse;Jt.lex;var Hc=$('<span class="session-title svelte-1xwj6s7"> </span>'),Lc=$('<div class="session-row svelte-1xwj6s7"><!> <!></div>'),Vc=$('<div class="session-dropdown svelte-1xwj6s7"><div class="session-list svelte-1xwj6s7"></div></div>'),Bc=$('<div class="empty-state svelte-1xwj6s7"><div class="seed-prompts svelte-1xwj6s7"></div></div>'),Oc=$('<div class="user-bubble svelte-1xwj6s7"> </div>'),Fc=$('<span class="tool-call svelte-1xwj6s7"> </span>'),Zc=$('<div class="tool-calls svelte-1xwj6s7"></div>'),jc=$('<div class="agent-text prose svelte-1xwj6s7"><!></div>'),qc=$('<div class="agent-text prose svelte-1xwj6s7"><!></div>'),Nc=$('<span class="streaming-dot svelte-1xwj6s7"></span>'),Uc=$('<div class="msg-actions svelte-1xwj6s7"><button class="copy-btn svelte-1xwj6s7" title="Copy"><!></button> <button class="copy-btn svelte-1xwj6s7" title="Export as Markdown"><!></button></div>'),Kc=$('<div class="agent-content svelte-1xwj6s7"><!> <!></div>'),Yc=$('<div class="message-group svelte-1xwj6s7"><!></div>'),Wc=$('<div class="context-chip svelte-1xwj6s7"> </div>'),Qc=$('<aside><div class="chat-header svelte-1xwj6s7"><div class="chat-header-left svelte-1xwj6s7"><!> <!></div> <div class="chat-header-right 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 Gc(n,e){_e(e,!0);const r=/[\p{Emoji_Presentation}\p{Extended_Pictographic}]\uFE0F?/gu,a=/^\|[\s:|-]+\|$/,s=/^[ ]{0,3}([-*_])\s*(\1\s*){2,}$/;function o(P){return P.replace(r,"").replace(/^ +/gm,K=>K.replace(/ +/," ")).split(`
83
+ `).map(K=>a.test(K)||s.test(K)?K:K.replace(/--/g,"—")).join(`
84
+ `)}const l={connector_list:["Listing connectors","Listing connectors"],connector_call:["Calling connector","Calling connectors"],create_entity:["Creating entity","Creating entities"],get_entity:["Reading entity","Reading entities"],update_entity:["Updating entity","Updating entities"],delete_entity:["Deleting entity","Deleting entities"],rename_entity:["Renaming entity","Renaming entities"],move_entity:["Moving entity","Moving entities"],import_file:["Importing file","Importing files"],search_entities:["Searching entities","Searching entities"],list_entities:["Listing entities","Listing entities"],get_related:["Finding related entities","Finding related entities"],get_backlinks:["Finding backlinks","Finding backlinks"],validate_wikilinks:["Validating links","Validating links"],get_workspace_summary:["Reading workspace","Reading workspace"],list_repos:["Listing collections","Listing collections"],create_collection:["Creating collection","Creating collections"],query_dataset:["Querying dataset","Querying datasets"],append_rows:["Appending rows","Appending rows"],get_entity_schema:["Reading schema","Reading schemas"],lint_entities:["Linting entities","Linting entities"],find_orphans:["Finding orphans","Finding orphans"],highlight_entities:["Highlighting entities","Highlighting entities"],sync_collection:["Syncing collection","Syncing collections"],sync_workspace:["Syncing workspace","Syncing workspace"],sync_refresh:["Refreshing from source","Refreshing from source"],sync_status:["Checking sync status","Checking sync status"],sync_list_sources:["Listing sources","Listing sources"],sync_setup_source:["Setting up source","Setting up sources"],sync_remove_source:["Removing source","Removing sources"],sync_inspect_connector:["Inspecting connector","Inspecting connectors"],sync_sample_data:["Sampling data","Sampling data"],workspace_commit:["Committing changes","Committing changes"],workspace_reset:["Resetting workspace","Resetting workspace"],workspace_reindex:["Reindexing","Reindexing"],workspace_status:["Checking status","Checking status"],workspace_review:["Reviewing changes","Reviewing changes"],workspace_push:["Pushing changes","Pushing changes"],workspace_pull:["Pulling changes","Pulling changes"],permission_list_users:["Listing users","Listing users"],permission_create_user:["Creating user","Creating users"],permission_delete_user:["Deleting user","Deleting users"],permission_grant_access:["Granting access","Granting access"],permission_revoke_access:["Revoking access","Revoking access"],permission_list_collection_access:["Listing access","Listing access"],read_file:["Reading file","Reading files"],list_directory:["Listing directory","Listing directories"],write_file:["Writing file","Writing files"],load_skill:["Loading skill","Loading skills"],app_install:["Installing app","Installing apps"],app_list:["Listing apps","Listing apps"],deploy_railway:["Deploying","Deploying"],redeploy_railway:["Redeploying","Redeploying"]};function d(P){const K=new Map;for(const ke of P)K.set(ke,(K.get(ke)??0)+1);return[...K.entries()].map(([ke,Le])=>{const Re=l[ke];return Re?{label:Le>1?Re[1]:Re[0],count:Le}:{label:ke.replace(/_/g," ").replace(/\b\w/g,Qe=>Qe.toUpperCase()),count:Le}})}let i=me(null);function k(P,K){navigator.clipboard.writeText(K),b(i,P,!0),setTimeout(()=>{t(i)===P&&b(i,null)},2e3)}function _(P){const K=new Blob([P],{type:"text/markdown"}),ke=URL.createObjectURL(K),Le=document.createElement("a");Le.href=ke,Le.download="response.md",Le.click(),URL.revokeObjectURL(ke)}const v=Os("chat");function h(){if(!le){v.mode==="full"?v.collapse():v.expand();return}const P=le.scrollHeight>le.clientHeight?le.scrollTop/(le.scrollHeight-le.clientHeight):1;v.mode==="full"?v.collapse():v.expand(),requestAnimationFrame(()=>{le&&(le.scrollTop=P*(le.scrollHeight-le.clientHeight))})}let y=z(()=>gt.draftInput);function H(P){gt.draftInput=P}let L=me(!1);const Fe=z(()=>(gt.activeSessionId,gt.getSessions().length>0));let le,Ie,rt=!0;function Ke(){le&&(rt=le.scrollHeight-le.scrollTop-le.clientHeight<40)}const Et=z(()=>{if(Ce.selectedSubPath)return["Summarize this document","Extract key points","What actions are here?","What decisions were made?"];if(Ce.selectedId){const P=Ce.selectedType??"entity";return[`Summarize this ${P}`,`What's related to this ${P}?`,"What actions should I take?","What decisions were made?"]}return Ce.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 wt(){const P=t(y).trim();!P||gt.streaming||(H(""),rt=!0,gt.send(P),await Ms(),et())}function Nt(P){P.key==="Enter"&&!P.shiftKey&&(P.preventDefault(),wt())}function et(){le&&(le.scrollTop=le.scrollHeight)}Fs(()=>{Ms().then(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>et())})})}),Vr(()=>{gt.scrollTick,rt&&et()}),Vr(()=>{gt.forceScroll,rt=!0,et()});var xt=Qc(),It=m(xt),yt=m(It),Ot=m(yt);Me(Ot,{variant:"ghost",size:"icon",class:"size-6",onclick:()=>gt.newSession(),children:(P,K)=>{Fn(P,{size:14})},$$slots:{default:!0}});var ur=w(Ot,2);{var Ye=P=>{{let K=z(()=>t(L)?"history-active":"");Me(P,{variant:"ghost",size:"icon",get class(){return`size-6 ${t(K)??""}`},onclick:()=>b(L,!t(L)),children:(ke,Le)=>{Uo(ke,{size:14})},$$slots:{default:!0}})}};T(ur,P=>{t(Fe)&&P(Ye)})}f(yt);var We=w(yt,2),dt=m(We);{let P=z(()=>v.mode==="full"?"Collapse to panel":"Expand to full width");Me(dt,{variant:"ghost",size:"icon",class:"size-6",get title(){return t(P)},onclick:h,children:(K,ke)=>{var Le=W(),Re=x(Le);{var kt=Ze=>{Lo(Ze,{size:14})},Qe=Ze=>{Io(Ze,{size:14})};T(Re,Ze=>{v.mode==="full"?Ze(kt):Ze(Qe,!1)})}u(K,Le)},$$slots:{default:!0}})}var vt=w(dt,2);Me(vt,{variant:"ghost",size:"icon",class:"size-6",get onclick(){return v.close},children:(P,K)=>{Xr(P,{size:14})},$$slots:{default:!0}}),f(We);var Ee=w(We,2);{var Ut=P=>{var K=Vc(),ke=m(K);tt(ke,21,()=>gt.getSessions(),ct,(Le,Re)=>{var kt=Lc(),Qe=m(kt);{let Zt=z(()=>t(Re).active?"active":"");Me(Qe,{variant:"ghost",get class(){return`session-item ${t(Zt)??""}`},onclick:()=>{gt.loadSession(t(Re).id),b(L,!1)},children:(Kt,Ht)=>{var Lt=Hc(),fr=m(Lt,!0);f(Lt),C(()=>B(fr,t(Re).title)),u(Kt,Lt)},$$slots:{default:!0}})}var Ze=w(Qe,2);Me(Ze,{variant:"ghost",size:"icon",class:"session-delete-btn",title:"Delete session",onclick:Zt=>{Zt.stopPropagation(),gt.deleteSession(t(Re).id)},children:(Zt,Kt)=>{Qr(Zt,{size:12})},$$slots:{default:!0}}),f(kt),u(Le,kt)}),f(ke),f(K),u(P,K)};T(Ee,P=>{t(L)&&P(Ut)})}f(It);var Ct=w(It,2),Ft=m(Ct);{var pr=P=>{var K=Bc(),ke=m(K);tt(ke,21,()=>t(Et),ct,(Le,Re)=>{Me(Le,{variant:"outline",class:"seed-prompt",onclick:()=>{rt=!0,gt.send(t(Re)),Ms().then(()=>et())},children:(kt,Qe)=>{Q();var Ze=qt();C(()=>B(Ze,t(Re))),u(kt,Ze)},$$slots:{default:!0}})}),f(ke),f(K),u(P,K)},$r=P=>{var K=W(),ke=x(K);tt(ke,17,()=>gt.messages,ct,(Le,Re,kt)=>{var Qe=Yc(),Ze=m(Qe);{var Zt=Ht=>{var Lt=Oc(),fr=m(Lt,!0);f(Lt),C(()=>B(fr,t(Re).content)),u(Ht,Lt)},Kt=Ht=>{var Lt=Kc(),fr=m(Lt);{var ts=ut=>{var At=W(),nr=x(At);tt(nr,17,()=>t(Re).segments,ct,(Br,gr)=>{var Yt=W(),Mt=x(Yt);{var Or=yr=>{var Wt=Zc();tt(Wt,21,()=>d(t(gr).names),ct,(zr,Fr)=>{let Zr=()=>t(Fr).label;var jr=Fc(),ss=m(jr,!0);f(jr),C(()=>B(ss,Zr())),u(zr,jr)}),f(Wt),u(yr,Wt)},ar=yr=>{var Wt=jc(),zr=m(Wt);Rn(zr,()=>Ae.parse(o(t(gr).content))),f(Wt),u(yr,Wt)};T(Mt,yr=>{t(gr).type==="tools"?yr(Or):t(gr).type==="text"&&t(gr).content&&yr(ar,1)})}u(Br,Yt)}),u(ut,At)},sr=ut=>{var At=qc(),nr=m(At);Rn(nr,()=>Ae.parse(o(t(Re).content))),f(At),u(ut,At)};T(fr,ut=>{t(Re).segments&&t(Re).segments.length>0?ut(ts):t(Re).content&&ut(sr,1)})}var Ve=w(fr,2);{var Ir=ut=>{var At=Nc();u(ut,At)},rs=ut=>{var At=Uc(),nr=m(At),Br=m(nr);{var gr=ar=>{Sa(ar,{size:12})},Yt=ar=>{Da(ar,{size:12})};T(Br,ar=>{t(i)===kt?ar(gr):ar(Yt,!1)})}f(nr);var Mt=w(nr,2),Or=m(Mt);Oo(Or,{size:12}),f(Mt),f(At),kr("click",nr,()=>k(kt,t(Re).content)),kr("click",Mt,()=>_(t(Re).content)),u(ut,At)};T(Ve,ut=>{t(Re).streaming?ut(Ir):t(Re).content&&ut(rs,1)})}f(Lt),u(Ht,Lt)};T(Ze,Ht=>{t(Re).role==="user"?Ht(Zt):Ht(Kt,!1)})}f(Qe),u(Le,Qe)}),u(P,K)};T(Ft,P=>{gt.messages.length===0?P(pr):P($r,!1)})}f(Ct),Hs(Ct,P=>le=P,()=>le);var Dt=w(Ct,2),bt=m(Dt);{var wr=P=>{var K=Wc(),ke=m(K);f(K),C(()=>B(ke,`${Ce.selectedType??""}/${Ce.selectedId??""}`)),u(P,K)};T(bt,P=>{Ce.selectedId&&P(wr)})}var rr=w(bt,2),zt=m(rr);xa(zt),Hs(zt,P=>Ie=P,()=>Ie);var xr=w(zt,2);{var hr=P=>{Me(P,{variant:"ghost",size:"icon",class:"size-7 stop-btn send-btn",onclick:()=>gt.stop(),children:(K,ke)=>{jo(K,{size:16})},$$slots:{default:!0}})},vr=P=>{{let K=z(()=>t(y).trim()?"send-active":"");Me(P,{variant:"ghost",size:"icon",get class(){return`size-7 send-btn ${t(K)??""}`},onclick:wt,children:(ke,Le)=>{jn(ke,{size:14})},$$slots:{default:!0}})}};T(xr,P=>{gt.streaming?P(hr):P(vr,!1)})}f(rr),f(Dt),f(xt),C(()=>{Pr(xt,1,`chat-panel ${v.mode==="full"?"chat-full":""}`,"svelte-1xwj6s7"),Wr(zt,"placeholder",Ce.selectedId?"Ask about this entity...":"Ask about your workspace..."),ya(zt,t(y))}),Tt("scroll",Ct,Ke),kr("input",zt,P=>H(P.target.value)),kr("keydown",zt,Nt),u(n,xt),be()}Ln(["click","input","keydown"]);var Xc=ne("<title> </title>"),Jc=ne('<svg><!><path d="m22,8v2c2.2061,0,4,1.7944,4,4s-1.7939,4-4,4h-12v-5l-6,6,6,6v-5h12c3.3086,0,6-2.6914,6-6s-2.6914-6-6-6Z"></path></svg>');function ed(n,e){const r=se(e,["children","$$slots","$$events","$$legacy"]),a=se(r,["size","title"]);_e(e,!1);const s=re(),o=re();let l=M(e,"size",8,16),d=M(e,"title",8,void 0);te(()=>(D(r),D(d())),()=>{b(s,r["aria-label"]||r["aria-labelledby"]||d())}),te(()=>(t(s),D(r)),()=>{b(o,{"aria-hidden":t(s)?void 0:!0,role:t(s)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),Xe(),Je();var i=Jc();He(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:l(),height:l(),...t(o),...a}));var k=m(i);{var _=v=>{var h=Xc(),y=m(h,!0);f(h),C(()=>B(y,d())),u(v,h)};T(k,v=>{d()&&v(_)})}Q(),f(i),u(n,i),be()}function td(n){const e=new URLSearchParams;return n.q&&e.set("q",n.q),n.type&&e.set("type",n.type),n.tags&&e.set("tags",n.tags),n.repos&&e.set("repos",n.repos),za(`/api/search?${e.toString()}`)}var rd=$('<div class="empty-results svelte-1xems06">No results found</div>'),sd=$('<div class="result-body svelte-1xems06"><div class="result-title-row svelte-1xems06"><span class="result-title svelte-1xems06"> </span> <span class="entity-tag svelte-1xems06"> </span></div> <div class="result-meta svelte-1xems06"><span class="result-path"> </span></div></div>'),nd=$('<div class="search-header svelte-1xems06"><!> <!> <kbd class="esc-badge svelte-1xems06">esc</kbd></div> <div class="results-list svelte-1xems06"><!> <!></div> <div class="search-footer svelte-1xems06"><div class="shortcut-group svelte-1xems06"><kbd class="shortcut-key svelte-1xems06"><!></kbd> <kbd class="shortcut-key svelte-1xems06"><!></kbd> <span class="shortcut-label svelte-1xems06">Navigate</span></div> <div class="shortcut-group svelte-1xems06"><kbd class="shortcut-key svelte-1xems06"><!></kbd> <span class="shortcut-label svelte-1xems06">Open</span></div></div>',1);function ad(n,e){_e(e,!0);let r=M(e,"open",15),a=me(""),s=me(ws([])),o=me(0),l=null;function d(h){const y=h.target;if(b(a,y.value,!0),b(o,0),l&&clearTimeout(l),!t(a).trim()){b(s,[],!0);return}l=setTimeout(async()=>{try{b(s,await td({q:t(a)}),!0)}catch{b(s,[],!0)}},200)}function i(h){if(h.key==="Escape")e.onclose();else if(h.key==="ArrowDown")h.preventDefault(),b(o,Math.min(t(o)+1,t(s).length-1),!0);else if(h.key==="ArrowUp")h.preventDefault(),b(o,Math.max(t(o)-1,0),!0);else if(h.key==="Enter"){h.preventDefault();const y=t(s)[t(o)];y&&k(y)}}function k(h){const y=h.repoName??"";y&&cr(`/${y}/${h.entityType}/${h.id}`),e.onclose()}var _=W();Tt("keydown",Vn,h=>{(h.metaKey||h.ctrlKey)&&h.key==="k"&&(h.preventDefault(),r()&&e.onclose())});var v=x(_);V(v,()=>qs,(h,y)=>{y(h,{onOpenChange:H=>{H||e.onclose()},get open(){return r()},set open(H){r(H)},children:(H,L)=>{var Fe=W(),le=x(Fe);V(le,()=>js,(Ie,rt)=>{rt(Ie,{size:"lg",children:(Ke,Et)=>{var wt=nd(),Nt=x(wt),et=m(Nt);qn(et,{size:16});var xt=w(et,2);fs(xt,{type:"text",class:"search-input",placeholder:"Search entities...",get value(){return t(a)},oninput:d,onkeydown:i,autofocus:!0}),Q(2),f(Nt);var It=w(Nt,2),yt=m(It);{var Ot=Dt=>{var bt=rd();u(Dt,bt)},ur=z(()=>t(s).length===0&&t(a).trim());T(yt,Dt=>{t(ur)&&Dt(Ot)})}var Ye=w(yt,2);tt(Ye,17,()=>t(s),ct,(Dt,bt,wr)=>{{let rr=z(()=>wr===t(o)?"selected":"");Me(Dt,{variant:"ghost",get class(){return`result-row ${t(rr)??""}`},onclick:()=>k(t(bt)),children:(zt,xr)=>{var hr=sd(),vr=m(hr),P=m(vr),K=m(P,!0);f(P);var ke=w(P,2),Le=m(ke,!0);f(ke),f(vr);var Re=w(vr,2),kt=m(Re),Qe=m(kt,!0);f(kt),f(Re),f(hr),C(()=>{B(K,t(bt).data?.name??t(bt).data?.title??t(bt).id),B(Le,t(bt).entityType),B(Qe,t(bt).id)}),u(zt,hr)},$$slots:{default:!0}})}}),f(It);var We=w(It,2),dt=m(We),vt=m(dt),Ee=m(vt);jn(Ee,{size:10}),f(vt);var Ut=w(vt,2),Ct=m(Ut);Ya(Ct,{size:10}),f(Ut),Q(2),f(dt);var Ft=w(dt,2),pr=m(Ft),$r=m(pr);ed($r,{size:10}),f(pr),Q(2),f(Ft),f(We),u(Ke,wt)},$$slots:{default:!0}})}),u(H,Fe)},$$slots:{default:!0}})}),u(n,_),be()}function id(){let n=me(ws({}));function e(s){s.action==="join"?t(n)[s.user.id]=s.user:delete t(n)[s.user.id]}function r(){b(n,{},!0)}const a=z(()=>Object.values(t(n)));return{handleOnlineEvent:e,reset:r,get allOnline(){return t(a)}}}const ks=id();Xt.setOnlineHandler(n=>ks.handleOnlineEvent(n));Xt.addConnectHandler(()=>ks.reset());var ld=$('<main class="main-content svelte-vr1z90"><!></main>'),od=$('<div class="app-frame svelte-vr1z90"><div class="app-body svelte-vr1z90"><!> <!> <!></div> <div id="sg-chrome-footer"></div></div> <!>',1);function cd(n,e){_e(e,!0);const r=Os("chat"),a=z(()=>!Ce.hideSidebar);let s=me(!1);Fs(()=>{const L=window.StudioChrome;L&&L.mountFooter()}),Vr(()=>{const L=mt.user?String(mt.user.id):void 0,Fe=L?ks.allOnline.filter(Ie=>Ie.id!==L):ks.allOnline,le=window.StudioChrome;le?.setCollaborators&&le.setCollaborators(Fe)});var o=od();Tt("keydown",Vn,L=>{(L.metaKey||L.ctrlKey)&&L.key==="k"&&(L.preventDefault(),b(s,!t(s)))});var l=x(o),d=m(l),i=m(d);{var k=L=>{Ao(L,{})};T(i,L=>{t(a)&&L(k)})}var _=w(i,2);{var v=L=>{var Fe=ld(),le=m(Fe);tr(le,()=>e.children),f(Fe),u(L,Fe)};T(_,L=>{r.mode!=="full"&&L(v)})}var h=w(_,2);{var y=L=>{Gc(L,{})};T(h,L=>{r.open&&L(y)})}f(d),Q(2),f(l);var H=w(l,2);ad(H,{get open(){return t(s)},onclose:()=>{b(s,!1)}}),u(n,o),be()}function Vd(n,e){cd(n,{children:(r,a)=>{var s=W(),o=x(s);tr(o,()=>e.children),u(r,s)},$$slots:{default:!0}})}export{Vd as component};
@@ -0,0 +1 @@
1
+ import{d as we,a as i,b as o,s as k,e as T}from"../chunks/usxM-xOh.js";import{p as xe,a1 as ze,a2 as Be,a0 as K,b as Ae,a3 as u,c as a,g as r,r as e,a4 as I,t as C,s as Re,n as P,e as Se}from"../chunks/CCA2E2CK.js";import{i as w}from"../chunks/yUs562n0.js";import{e as j,i as N}from"../chunks/BpdrS9kL.js";import{r as Ce}from"../chunks/DkuxRPZv.js";import{b as We,B as X}from"../chunks/D8mTIH9Y.js";import{g as Z}from"../chunks/csGnu8Rb.js";import{V as Ee}from"../chunks/Mtmwulo1.js";import{w as U}from"../chunks/BgRr0V7g.js";import{n as Le}from"../chunks/BVhp5b7F.js";import{insightsStore as s}from"../chunks/CwUXqlAx.js";import{R as q}from"../chunks/DLZAjAct.js";import{S as Te,A as $e}from"../chunks/C74mA5aC.js";var Ie=o('<h2 class="svelte-h7bcrl"> </h2>'),Pe=o('<div class="home-center svelte-h7bcrl"><!></div>'),Ge=o('<button class="suggestion-chip svelte-h7bcrl"> </button>'),Me=o(`<div class="home-center onboarding svelte-h7bcrl"><h2 class="svelte-h7bcrl">What matters most to you?</h2> <p class="onboarding-subtitle svelte-h7bcrl">Tell us what you'd like to see on your home screen, and we'll generate personalized insights from your knowledge graph.</p> <div class="suggestions svelte-h7bcrl"></div> <div class="custom-brief svelte-h7bcrl"><input class="brief-input svelte-h7bcrl" type="text" placeholder="Or describe your own focus..."/> <!></div></div>`),Oe=o('<div class="home-center svelte-h7bcrl"><div class="generating svelte-h7bcrl"><!> <p>Analyzing your knowledge graph...</p></div></div>'),Ve=o('<span class="insights-meta svelte-h7bcrl"> </span>'),je=o("<!> Refresh",1),Ne=o('<button class="action-btn svelte-h7bcrl"> </button>'),Ue=o('<button class="entity-chip svelte-h7bcrl"> </button>'),qe=o('<div class="insight-entities svelte-h7bcrl"></div>'),De=o('<div class="insight-card svelte-h7bcrl"><div class="insight-top svelte-h7bcrl"><span class="pattern-tag svelte-h7bcrl"> </span></div> <h3 class="insight-headline svelte-h7bcrl"> </h3> <p class="insight-detail svelte-h7bcrl"> </p> <!> <!></div>'),Fe=o('<div class="insights-grid svelte-h7bcrl"></div>'),He=o("<p>Failed to generate insights. Check your AI provider configuration.</p>"),Qe=o('<div class="generating svelte-h7bcrl"><!> <p>Analyzing your knowledge graph...</p></div>'),Ye=o("<p>No insights yet. Click Refresh to generate them.</p>"),Je=o('<div class="no-insights svelte-h7bcrl"><!></div>'),Ke=o('<div class="home-insights svelte-h7bcrl"><div class="insights-header svelte-h7bcrl"><div class="insights-title svelte-h7bcrl"><h2 class="svelte-h7bcrl">Your Briefing</h2> <!></div> <div class="insights-actions svelte-h7bcrl"><button class="edit-focus-link svelte-h7bcrl"><!> Edit focus</button> <!></div></div> <!></div>'),Xe=o('<!> <div class="home svelte-h7bcrl"><!></div>',1);function ht(ee,te){xe(te,!0);const ae=ze("chat");Le.showEntity(),Be(()=>{U.nameLoaded&&!s.loaded&&s.load()});const re=I(()=>s.briefLoaded&&s.homeBrief.length>0),D=I(()=>s.insights.length>0),se=["What's at risk across my projects","Which clients need attention","What's due this week for my team","Pipeline and deal progress","What's new since I last checked in","Help me stay on top of decisions and tasks"];let W=Se("");async function ie(t){s.saveBrief(t),await s.generate()}async function F(){r(W).trim()&&(s.saveBrief(r(W).trim()),await s.generate())}function oe(){s.generate()}function ne(t){switch(t){case"risk":return"Risk";case"relationship":return"Relationship";case"opportunity":return"Opportunity";case"quality":return"Graph Quality";case"trend":return"Trend"}}function le(t){if(!t)return"";const n=Date.now()-new Date(t).getTime(),l=Math.floor(n/6e4);if(l<1)return"just now";if(l<60)return`${l}m ago`;const v=Math.floor(l/60);return v<24?`${v}h ago`:`${Math.floor(v/24)}d ago`}function ve(t){Z(`/${t.repo}/${t.type}/${t.id}`)}var H=Xe(),Q=K(H);Ee(Q,{activeView:"entity"});var Y=u(Q,2),ce=a(Y);{var de=t=>{var n=Pe(),l=a(n);{var v=f=>{var x=Ie(),A=a(x);e(x),C(()=>k(A,`Welcome to ${(U.name||"Studiograph")??""}`)),i(f,x)};w(l,f=>{U.nameLoaded&&f(v)})}e(n),i(t,n)},he=t=>{var n=Me(),l=u(a(n),4);j(l,21,()=>se,N,(g,S)=>{var z=Ge(),G=a(z,!0);e(z),C(()=>k(G,r(S))),T("click",z,()=>ie(r(S))),i(g,z)}),e(l);var v=u(l,2),f=a(v);Ce(f);var x=u(f,2);{var A=g=>{X(g,{onclick:F,children:(S,z)=>{$e(S,{size:14})},$$slots:{default:!0}})},R=I(()=>r(W).trim());w(x,g=>{r(R)&&g(A)})}e(v),e(n),T("keydown",f,g=>g.key==="Enter"&&F()),We(f,()=>r(W),g=>Re(W,g)),i(t,n)},pe=t=>{var n=Oe(),l=a(n),v=a(l);q(v,{size:20,class:"animate-spin"}),P(2),e(l),e(n),i(t,n)},ue=t=>{var n=Ke(),l=a(n),v=a(l),f=u(a(v),2);{var x=d=>{var h=Ve(),b=a(h);e(h),C(c=>k(b,`Updated ${c??""}`),[()=>le(s.generatedAt)]),i(d,h)};w(f,d=>{s.generatedAt&&d(x)})}e(v);var A=u(v,2),R=a(A),g=a(R);Te(g,{size:12}),P(),e(R);var S=u(R,2);X(S,{variant:"ghost",size:"sm",onclick:oe,get disabled(){return s.loading},children:(d,h)=>{var b=je(),c=K(b);{let B=I(()=>s.loading?"animate-spin":"");q(c,{size:14,get class(){return r(B)}})}P(),i(d,b)},$$slots:{default:!0}}),e(A),e(l);var z=u(l,2);{var G=d=>{var h=Fe();j(h,21,()=>s.insights,N,(b,c)=>{var B=De(),E=a(B),p=a(E),_=a(p,!0);e(p),e(E);var L=u(E,2),ge=a(L,!0);e(L);var M=u(L,2),_e=a(M,!0);e(M);var J=u(M,2);{var me=m=>{var y=Ne(),O=a(y,!0);e(y),C(()=>k(O,r(c).actions[0])),T("click",y,()=>ae.sendPrompt(r(c).actions[0])),i(m,y)};w(J,m=>{r(c).actions?.[0]&&m(me)})}var be=u(J,2);{var ye=m=>{var y=qe();j(y,21,()=>r(c).entities,N,(O,V)=>{var $=Ue(),ke=a($,!0);e($),C(()=>k(ke,r(V).name||r(V).id)),T("click",$,()=>ve(r(V))),i(O,$)}),e(y),i(m,y)};w(be,m=>{r(c).entities.length>0&&m(ye)})}e(B),C(m=>{k(_,m),k(ge,r(c).headline),k(_e,r(c).detail)},[()=>ne(r(c).pattern)]),i(b,B)}),e(h),i(d,h)},fe=d=>{var h=Je(),b=a(h);{var c=p=>{var _=He();i(p,_)},B=p=>{var _=Qe(),L=a(_);q(L,{size:20,class:"animate-spin"}),P(2),e(_),i(p,_)},E=p=>{var _=Ye();i(p,_)};w(b,p=>{s.error?p(c):s.loading?p(B,1):p(E,!1)})}e(h),i(d,h)};w(z,d=>{r(D)?d(G):d(fe,!1)})}e(n),T("click",R,()=>Z("/settings?tab=preferences")),i(t,n)};w(ce,t=>{s.briefLoaded?r(re)?s.loading&&!r(D)?t(pe,2):t(ue,!1):t(he,1):t(de)})}e(Y),i(ee,H),Ae()}we(["click","keydown"]);export{ht as component};