import{s as Ye,e as l,k as v,t as n,c as s,a as c,A as Et,o as f,b as i,d,f as e,i as We,g as t,C as rt,u as xt,D as Xe,h as b,n as je,F as Ge,j as Ce,p as Je,q as Ke,N as Qe}from"../chunks/scheduler.DB3Sqaa-.js";import{S as $e,i as ta}from"../chunks/index.CidI1d1E.js";import{t as Fe}from"../chunks/Toaster.svelte_svelte_type_style_lang.C-7zrEBl.js";import{g as De}from"../chunks/entry.JtQ7vg2d.js";import{p as Ze}from"../chunks/index.DPWiq6NR.js";import{u as ea,g as aa}from"../chunks/index.j65IixI3.js";import{p as la}from"../chunks/stores.m3IJIQGn.js";function Re(a){let m,p=``;return{c(){m=l("div"),m.innerHTML=p,this.h()},l(_){m=s(_,"DIV",{class:!0,"data-svelte-h":!0}),Et(m)!=="svelte-qf5fty"&&(m.innerHTML=p),this.h()},h(){e(m,"class","ml-1.5 self-center")},m(_,j){We(_,m,j)},d(_){_&&d(m)}}}function sa(a){let m,p,_,j='',F,S,M=a[4].t("Back")+"",D,x,h,A,N,Z=a[4].t("Title")+"",J,ot,nt,K,u,B,Xt,V,R,it=a[4].t("Command")+"",It,Gt,Jt,U,W,Ve="/",Kt,C,Qt,k,dt=a[4].t("Only")+"",At,$t,Q,ut=a[4].t("alphanumeric characters and hyphens")+"",Ct,te,ct=a[4].t("are allowed - Activate this command by typing")+"",Dt,ee,H,ae,Vt,le,se,pt=a[4].t("to chat input.")+"",Pt,re,O,$,Y,mt=a[4].t("Prompt Content")+"",Tt,oe,ne,P,vt,I,St,ie,g,de,ft=a[4].t("Format your variables using square brackets like this:")+"",Mt,ue,z,ce,ht=a[4].t("variable")+"",Nt,pe,me,gt=a[4].t("Make sure to enclose them with")+"",Bt,ve,X,Pe="'['",fe,_t=a[4].t("and")+"",qt,he,G,Te="']'",ge,_e,q,bt=a[4].t("Utilize")+"",Ut,tt,Se=" {{CLIPBOARD}}",be,ye,yt=a[4].t("variable to have them replaced with clipboard content.")+"",Ht,ke,et,E,at,kt=a[4].t("Save & Update")+"",Ot,we,zt,xe,Me,y=a[0]&&Re();return{c(){m=l("div"),p=l("button"),_=l("div"),_.innerHTML=j,F=v(),S=l("div"),D=n(M),x=v(),h=l("form"),A=l("div"),N=l("div"),J=n(Z),ot=n("*"),nt=v(),K=l("div"),u=l("input"),Xt=v(),V=l("div"),R=l("div"),It=n(it),Gt=n("*"),Jt=v(),U=l("div"),W=l("div"),W.textContent=Ve,Kt=v(),C=l("input"),Qt=v(),k=l("div"),At=n(dt),$t=v(),Q=l("span"),Ct=n(ut),te=v(),Dt=n(ct),ee=n(' "'),H=l("span"),ae=n("/"),Vt=n(a[2]),le=v(),se=n(`"
`),Pt=n(pt),re=v(),O=l("div"),$=l("div"),Y=l("div"),Tt=n(mt),oe=n("*"),ne=v(),P=l("div"),vt=l("div"),I=l("textarea"),ie=v(),g=l("div"),de=n("ⓘ "),Mt=n(ft),ue=n(" "),z=l("span"),ce=n("["),Nt=n(ht),pe=n("]"),me=n(`.
`),Bt=n(gt),ve=v(),X=l("span"),X.textContent=Pe,fe=v(),qt=n(_t),he=v(),G=l("span"),G.textContent=Te,ge=n("."),_e=v(),q=l("div"),Ut=n(bt),tt=l("span"),be=n(Se),ye=v(),Ht=n(yt),ke=v(),et=l("div"),E=l("button"),at=l("div"),Ot=n(kt),we=v(),y&&y.c(),this.h()},l(r){m=s(r,"DIV",{class:!0});var o=c(m);p=s(o,"BUTTON",{class:!0});var Lt=c(p);_=s(Lt,"DIV",{class:!0,"data-svelte-h":!0}),Et(_)!=="svelte-1klo87r"&&(_.innerHTML=j),F=f(Lt),S=s(Lt,"DIV",{class:!0});var Ne=c(S);D=i(Ne,M),Ne.forEach(d),Lt.forEach(d),x=f(o),h=s(o,"FORM",{class:!0});var L=c(h);A=s(L,"DIV",{class:!0});var jt=c(A);N=s(jt,"DIV",{class:!0});var Ee=c(N);J=i(Ee,Z),ot=i(Ee,"*"),Ee.forEach(d),nt=f(jt),K=s(jt,"DIV",{});var Be=c(K);u=s(Be,"INPUT",{class:!0,placeholder:!0}),Be.forEach(d),jt.forEach(d),Xt=f(L),V=s(L,"DIV",{class:!0});var lt=c(V);R=s(lt,"DIV",{class:!0});var Ie=c(R);It=i(Ie,it),Gt=i(Ie,"*"),Ie.forEach(d),Jt=f(lt),U=s(lt,"DIV",{class:!0});var Ft=c(U);W=s(Ft,"DIV",{class:!0,"data-svelte-h":!0}),Et(W)!=="svelte-hteuxn"&&(W.textContent=Ve),Kt=f(Ft),C=s(Ft,"INPUT",{class:!0,placeholder:!0}),Ft.forEach(d),Qt=f(lt),k=s(lt,"DIV",{class:!0});var T=c(k);At=i(T,dt),$t=f(T),Q=s(T,"SPAN",{class:!0});var qe=c(Q);Ct=i(qe,ut),qe.forEach(d),te=f(T),Dt=i(T,ct),ee=i(T,' "'),H=s(T,"SPAN",{class:!0});var Zt=c(H);ae=i(Zt,"/"),Vt=i(Zt,a[2]),le=f(Zt),Zt.forEach(d),se=i(T,`"
`),Pt=i(T,pt),T.forEach(d),lt.forEach(d),re=f(L),O=s(L,"DIV",{class:!0});var Rt=c(O);$=s(Rt,"DIV",{class:!0});var Ue=c($);Y=s(Ue,"DIV",{class:!0});var Ae=c(Y);Tt=i(Ae,mt),oe=i(Ae,"*"),Ae.forEach(d),Ue.forEach(d),ne=f(Rt),P=s(Rt,"DIV",{class:!0});var st=c(P);vt=s(st,"DIV",{});var He=c(vt);I=s(He,"TEXTAREA",{class:!0,placeholder:!0,rows:!0}),c(I).forEach(d),He.forEach(d),ie=f(st),g=s(st,"DIV",{class:!0});var w=c(g);de=i(w,"ⓘ "),Mt=i(w,ft),ue=i(w," "),z=s(w,"SPAN",{class:!0});var Wt=c(z);ce=i(Wt,"["),Nt=i(Wt,ht),pe=i(Wt,"]"),Wt.forEach(d),me=i(w,`.
`),Bt=i(w,gt),ve=f(w),X=s(w,"SPAN",{class:!0,"data-svelte-h":!0}),Et(X)!=="svelte-w4chb6"&&(X.textContent=Pe),fe=f(w),qt=i(w,_t),he=f(w),G=s(w,"SPAN",{class:!0,"data-svelte-h":!0}),Et(G)!=="svelte-589oqk"&&(G.textContent=Te),ge=i(w,"."),w.forEach(d),_e=f(st),q=s(st,"DIV",{class:!0});var wt=c(q);Ut=i(wt,bt),tt=s(wt,"SPAN",{class:!0});var Oe=c(tt);be=i(Oe,Se),Oe.forEach(d),ye=f(wt),Ht=i(wt,yt),wt.forEach(d),st.forEach(d),Rt.forEach(d),ke=f(L),et=s(L,"DIV",{class:!0});var ze=c(et);E=s(ze,"BUTTON",{class:!0,type:!0});var Yt=c(E);at=s(Yt,"DIV",{class:!0});var Le=c(at);Ot=i(Le,kt),Le.forEach(d),we=f(Yt),y&&y.l(Yt),Yt.forEach(d),ze.forEach(d),L.forEach(d),o.forEach(d),this.h()},h(){e(_,"class","self-center"),e(S,"class","self-center font-medium text-sm"),e(p,"class","flex space-x-1"),e(N,"class","text-sm font-semibold mb-2"),e(u,"class","px-3 py-1.5 text-sm w-full bg-transparent border dark:border-gray-600 outline-none rounded-lg"),e(u,"placeholder",B=a[4].t("Add a short title for this prompt")),u.required=!0,e(A,"class","my-2"),e(R,"class","text-sm font-semibold mb-2"),e(W,"class","bg-gray-200 dark:bg-gray-600 font-semibold px-3 py-1 border border-r-0 dark:border-gray-600 rounded-l-lg"),e(C,"class","px-3 py-1.5 text-sm w-full bg-transparent border disabled:text-gray-500 dark:border-gray-600 outline-none rounded-r-lg"),e(C,"placeholder","short-summary"),C.disabled=!0,C.required=!0,e(U,"class","flex items-center mb-1"),e(Q,"class","text-gray-600 dark:text-gray-300 font-medium"),e(H,"class","text-gray-600 dark:text-gray-300 font-medium"),e(k,"class","text-xs text-gray-400 dark:text-gray-500"),e(V,"class","my-2"),e(Y,"class","self-center text-sm font-semibold"),e($,"class","flex w-full justify-between"),e(I,"class","px-3 py-1.5 text-sm w-full bg-transparent border dark:border-gray-600 outline-none rounded-lg"),e(I,"placeholder",St=a[4].t("Write a summary in 50 words that summarizes [topic or keyword].")),e(I,"rows","6"),I.required=!0,e(z,"class","text-gray-600 dark:text-gray-300 font-medium"),e(X,"class","text-gray-600 dark:text-gray-300 font-medium"),e(G,"class","text-gray-600 dark:text-gray-300 font-medium"),e(g,"class","text-xs text-gray-400 dark:text-gray-500"),e(tt,"class","text-gray-600 dark:text-gray-300 font-medium"),e(q,"class","text-xs text-gray-400 dark:text-gray-500"),e(P,"class","mt-2"),e(O,"class","my-2"),e(at,"class","self-center font-medium"),e(E,"class",zt="text-sm px-3 py-2 transition rounded-xl "+(a[0]?" cursor-not-allowed bg-gray-100 dark:bg-gray-800":" bg-gray-50 hover:bg-gray-100 dark:bg-gray-700 dark:hover:bg-gray-800")+" flex"),e(E,"type","submit"),E.disabled=a[0],e(et,"class","my-2 flex justify-end"),e(h,"class","flex flex-col max-w-2xl mx-auto mt-4 mb-10"),e(m,"class","w-full max-h-full")},m(r,o){We(r,m,o),t(m,p),t(p,_),t(p,F),t(p,S),t(S,D),t(m,x),t(m,h),t(h,A),t(A,N),t(N,J),t(N,ot),t(A,nt),t(A,K),t(K,u),rt(u,a[1]),t(h,Xt),t(h,V),t(V,R),t(R,It),t(R,Gt),t(V,Jt),t(V,U),t(U,W),t(U,Kt),t(U,C),rt(C,a[2]),t(V,Qt),t(V,k),t(k,At),t(k,$t),t(k,Q),t(Q,Ct),t(k,te),t(k,Dt),t(k,ee),t(k,H),t(H,ae),t(H,Vt),t(H,le),t(k,se),t(k,Pt),t(h,re),t(h,O),t(O,$),t($,Y),t(Y,Tt),t(Y,oe),t(O,ne),t(O,P),t(P,vt),t(vt,I),rt(I,a[3]),t(P,ie),t(P,g),t(g,de),t(g,Mt),t(g,ue),t(g,z),t(z,ce),t(z,Nt),t(z,pe),t(g,me),t(g,Bt),t(g,ve),t(g,X),t(g,fe),t(g,qt),t(g,he),t(g,G),t(g,ge),t(P,_e),t(P,q),t(q,Ut),t(q,tt),t(tt,be),t(q,ye),t(q,Ht),t(h,ke),t(h,et),t(et,E),t(E,at),t(at,Ot),t(E,we),y&&y.m(E,null),xe||(Me=[xt(p,"click",a[7]),xt(u,"input",a[8]),xt(C,"input",a[9]),xt(I,"input",a[10]),xt(h,"submit",Xe(a[11]))],xe=!0)},p(r,[o]){o&16&&M!==(M=r[4].t("Back")+"")&&b(D,M),o&16&&Z!==(Z=r[4].t("Title")+"")&&b(J,Z),o&16&&B!==(B=r[4].t("Add a short title for this prompt"))&&e(u,"placeholder",B),o&2&&u.value!==r[1]&&rt(u,r[1]),o&16&&it!==(it=r[4].t("Command")+"")&&b(It,it),o&4&&C.value!==r[2]&&rt(C,r[2]),o&16&&dt!==(dt=r[4].t("Only")+"")&&b(At,dt),o&16&&ut!==(ut=r[4].t("alphanumeric characters and hyphens")+"")&&b(Ct,ut),o&16&&ct!==(ct=r[4].t("are allowed - Activate this command by typing")+"")&&b(Dt,ct),o&4&&b(Vt,r[2]),o&16&&pt!==(pt=r[4].t("to chat input.")+"")&&b(Pt,pt),o&16&&mt!==(mt=r[4].t("Prompt Content")+"")&&b(Tt,mt),o&16&&St!==(St=r[4].t("Write a summary in 50 words that summarizes [topic or keyword]."))&&e(I,"placeholder",St),o&8&&rt(I,r[3]),o&16&&ft!==(ft=r[4].t("Format your variables using square brackets like this:")+"")&&b(Mt,ft),o&16&&ht!==(ht=r[4].t("variable")+"")&&b(Nt,ht),o&16&>!==(gt=r[4].t("Make sure to enclose them with")+"")&&b(Bt,gt),o&16&&_t!==(_t=r[4].t("and")+"")&&b(qt,_t),o&16&&bt!==(bt=r[4].t("Utilize")+"")&&b(Ut,bt),o&16&&yt!==(yt=r[4].t("variable to have them replaced with clipboard content.")+"")&&b(Ht,yt),o&16&&kt!==(kt=r[4].t("Save & Update")+"")&&b(Ot,kt),r[0]?y||(y=Re(),y.c(),y.m(E,null)):y&&(y.d(1),y=null),o&1&&zt!==(zt="text-sm px-3 py-2 transition rounded-xl "+(r[0]?" cursor-not-allowed bg-gray-100 dark:bg-gray-800":" bg-gray-50 hover:bg-gray-100 dark:bg-gray-700 dark:hover:bg-gray-800")+" flex")&&e(E,"class",zt),o&1&&(E.disabled=r[0])},i:je,o:je,d(r){r&&d(m),y&&y.d(),xe=!1,Ge(Me)}}}function ra(a,m,p){let _,j,F;Ce(a,Ze,u=>p(12,_=u)),Ce(a,la,u=>p(13,j=u));const S=Je("i18n");Ce(a,S,u=>p(4,F=u));let M=!1,D="",x="",h="";const A=async()=>{p(0,M=!0),N(x)?await ea(localStorage.token,x,D,h).catch(B=>(Fe.error(B),null))&&(await Ze.set(await aa(localStorage.token)),await De("/workspace/prompts")):Fe.error(F.t("Only alphanumeric characters and hyphens are allowed in the command string.")),p(0,M=!1)},N=u=>/^[a-zA-Z0-9-]+$/.test(u);Ke(async()=>{if(p(2,x=j.url.searchParams.get("command")),x){const u=_.filter(B=>B.command===x).at(0);u?(console.log(u),console.log(u.command),p(1,D=u.title),await Qe(),p(2,x=u.command.slice(1)),p(3,h=u.content)):De("/workspace/prompts")}else De("/workspace/prompts")});const Z=()=>{history.back()};function J(){D=this.value,p(1,D)}function ot(){x=this.value,p(2,x)}function nt(){h=this.value,p(3,h)}return[M,D,x,h,F,S,A,Z,J,ot,nt,()=>{A()}]}class ma extends $e{constructor(m){super(),ta(this,m,ra,sa,Ye,{})}}export{ma as component};
//# sourceMappingURL=21.CdXkpw_K.js.map