@piwitests/server 0.18.0 → 0.18.2

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 (114) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{BEB2Mv6B.js → 4TxgDGVa.js} +1 -1
  3. package/.output/public/_nuxt/{CBEM3L1q.js → 9-wVZMur.js} +1 -1
  4. package/.output/public/_nuxt/{l0QnzFNM.js → B-5GukRk.js} +1 -1
  5. package/.output/public/_nuxt/{lowCGL2S.js → B-IcwqZ2.js} +1 -1
  6. package/.output/public/_nuxt/{CmbjAoQu.js → B1G3GGhQ.js} +1 -1
  7. package/.output/public/_nuxt/{Dwp3GkV-.js → B1X__ilH.js} +1 -1
  8. package/.output/public/_nuxt/{CCsl9MOZ.js → B1zMFx24.js} +1 -1
  9. package/.output/public/_nuxt/{B6IHiVa1.js → B2oUeBbA.js} +1 -1
  10. package/.output/public/_nuxt/{BAaSmp8J.js → B4jvLMfS.js} +1 -1
  11. package/.output/public/_nuxt/{mlAADjK3.js → BBK2-Krn.js} +1 -1
  12. package/.output/public/_nuxt/{Vnfkr1pJ.js → BFP6M-20.js} +1 -1
  13. package/.output/public/_nuxt/{oFIS9u6t.js → BHpUiv6j.js} +1 -1
  14. package/.output/public/_nuxt/{Bi3i470l.js → BJtlcTrb.js} +1 -1
  15. package/.output/public/_nuxt/{BoC6qaRF.js → BLIRKrbM.js} +1 -1
  16. package/.output/public/_nuxt/{D1ttGJfs.js → BLOUs6AE.js} +1 -1
  17. package/.output/public/_nuxt/{n-QWmQgc.js → BOCwBVnz.js} +1 -1
  18. package/.output/public/_nuxt/{CTgM5Fke.js → BT6p4Pgt.js} +1 -1
  19. package/.output/public/_nuxt/{DB3ljns7.js → BUXSUkJ_.js} +1 -1
  20. package/.output/public/_nuxt/{36cXPVrY.js → BVf6Yx9V.js} +1 -1
  21. package/.output/public/_nuxt/{DOr_4nln.js → BXY_PWcx.js} +1 -1
  22. package/.output/public/_nuxt/{B6rt3IcG.js → BbS6Bwby.js} +1 -1
  23. package/.output/public/_nuxt/{Dbg8z684.js → Bd3HqPMF.js} +1 -1
  24. package/.output/public/_nuxt/{DnThe2U0.js → BeFDVhpA.js} +1 -1
  25. package/.output/public/_nuxt/{BUMZHDRC.js → BeKvLsja.js} +1 -1
  26. package/.output/public/_nuxt/{BCArQk0c.js → BeUm5UNV.js} +1 -1
  27. package/.output/public/_nuxt/{TBDx0s9p.js → BfV444H3.js} +1 -1
  28. package/.output/public/_nuxt/{D8YZvjas.js → BjCHB89N.js} +1 -1
  29. package/.output/public/_nuxt/{C9ahP7km.js → BjKamgHq.js} +1 -1
  30. package/.output/public/_nuxt/{DRE6Aqqp.js → BlA8mIS-.js} +1 -1
  31. package/.output/public/_nuxt/{BaDv5D7A.js → BlnwU1OO.js} +1 -1
  32. package/.output/public/_nuxt/{C11lmBd4.js → BoJdjCVl.js} +1 -1
  33. package/.output/public/_nuxt/{BiX7c2qU.js → BreO2PiA.js} +1 -1
  34. package/.output/public/_nuxt/{EltzgiyS.js → BvIDC_R-.js} +1 -1
  35. package/.output/public/_nuxt/{D3MWm6JP.js → By4YL7mx.js} +1 -1
  36. package/.output/public/_nuxt/{BdHdHyop.js → ByuJWADR.js} +1 -1
  37. package/.output/public/_nuxt/{KYucVFu7.js → C1dyLp_j.js} +1 -1
  38. package/.output/public/_nuxt/{CPZ5wygb.js → C8OCrfDP.js} +1 -1
  39. package/.output/public/_nuxt/{AjuKBlzz.js → C9YzQCiq.js} +1 -1
  40. package/.output/public/_nuxt/{q0DPzLKN.js → CAUgpKsF.js} +1 -1
  41. package/.output/public/_nuxt/{riEUDnED.js → CL9-VLTJ.js} +1 -1
  42. package/.output/public/_nuxt/{empGC_x-.js → CN1mJlvD.js} +1 -1
  43. package/.output/public/_nuxt/{quV6tp4n.js → CNMoZYMv.js} +1 -1
  44. package/.output/public/_nuxt/{va1mwSm9.js → CPLJeOCb.js} +1 -1
  45. package/.output/public/_nuxt/{CRpbGS75.js → CUvGJXY3.js} +1 -1
  46. package/.output/public/_nuxt/{CU3W9YrI.js → CazDIG_m.js} +1 -1
  47. package/.output/public/_nuxt/{rm7OkgDG.js → CcXaak_K.js} +1 -1
  48. package/.output/public/_nuxt/{87SGk1nu.js → CdMuck_X.js} +1 -1
  49. package/.output/public/_nuxt/{BTYiG93l.js → CfOLBbW9.js} +1 -1
  50. package/.output/public/_nuxt/{Bi9DO8jm.js → CfPSts5n.js} +1 -1
  51. package/.output/public/_nuxt/{CLdGRzLL.js → CfROFPse.js} +1 -1
  52. package/.output/public/_nuxt/Cnapl7lZ.js +1 -0
  53. package/.output/public/_nuxt/{D51_cB9D.js → Cng9gj7q.js} +1 -1
  54. package/.output/public/_nuxt/{wGpfdK6o.js → CsUoYK75.js} +1 -1
  55. package/.output/public/_nuxt/{CGq9qR-0.js → CscWZxCi.js} +1 -1
  56. package/.output/public/_nuxt/{DcfRfTaA.js → CuicKV-B.js} +1 -1
  57. package/.output/public/_nuxt/{DraETso1.js → Cyiu1VQD.js} +1 -1
  58. package/.output/public/_nuxt/{B_aSGB8S.js → D0cnIs93.js} +1 -1
  59. package/.output/public/_nuxt/{CP0vUzbd.js → D5oNv2cB.js} +1 -1
  60. package/.output/public/_nuxt/{CCw3Tx4S.js → D6PUPmRC.js} +1 -1
  61. package/.output/public/_nuxt/{ClIKZ4qY.js → DBtBvrYc.js} +1 -1
  62. package/.output/public/_nuxt/{BFjmLXYo.js → DCl2yo4g.js} +1 -1
  63. package/.output/public/_nuxt/{BVDBIVAQ.js → DD5HpaW9.js} +1 -1
  64. package/.output/public/_nuxt/{C8cz5feG.js → DHXWp5yD.js} +1 -1
  65. package/.output/public/_nuxt/{D3SYPlEB.js → DHltYerF.js} +3 -3
  66. package/.output/public/_nuxt/{C4AfzZER.js → DLXydYJb.js} +1 -1
  67. package/.output/public/_nuxt/{BJltXwHg.js → DRPSi76A.js} +1 -1
  68. package/.output/public/_nuxt/{HTQtMbWb.js → DS53kyHJ.js} +1 -1
  69. package/.output/public/_nuxt/{C7ZVzS0K.js → DWhBqv_7.js} +1 -1
  70. package/.output/public/_nuxt/{DoYgYLOd.js → DWowvnwc.js} +1 -1
  71. package/.output/public/_nuxt/{Doul3p1_.js → DXbPFI1d.js} +1 -1
  72. package/.output/public/_nuxt/{BKaU95es.js → DZ1zNBVM.js} +1 -1
  73. package/.output/public/_nuxt/{Db_-yjYg.js → DZ3Vfcpz.js} +1 -1
  74. package/.output/public/_nuxt/{BfoG8R5a.js → DZOS7Fh7.js} +1 -1
  75. package/.output/public/_nuxt/{CUDeMcEK.js → DZUgX70W.js} +1 -1
  76. package/.output/public/_nuxt/{oWY3I9uX.js → Dd0kK5WH.js} +1 -1
  77. package/.output/public/_nuxt/{wQZj69OY.js → Df7kUO0m.js} +1 -1
  78. package/.output/public/_nuxt/{ClVRQpP_.js → Dga3Av-m.js} +1 -1
  79. package/.output/public/_nuxt/{Dy4TloG3.js → DgwTpwfB.js} +1 -1
  80. package/.output/public/_nuxt/DkI145a5.js +1 -0
  81. package/.output/public/_nuxt/{C9EpbPNU.js → DoFBTaDR.js} +1 -1
  82. package/.output/public/_nuxt/{DC51KKt4.js → Dr_dI5hB.js} +1 -1
  83. package/.output/public/_nuxt/{DoFSKAvY.js → Dwws9U0D.js} +1 -1
  84. package/.output/public/_nuxt/{DaewB_zT.js → EPZOxdgq.js} +1 -1
  85. package/.output/public/_nuxt/{DVgMaBxD.js → QmMoMxLM.js} +1 -1
  86. package/.output/public/_nuxt/{Dm1_3W9g.js → R1nNqTru.js} +1 -1
  87. package/.output/public/_nuxt/{WAaPPk0g.js → S5DLdEpg.js} +1 -1
  88. package/.output/public/_nuxt/builds/latest.json +1 -1
  89. package/.output/public/_nuxt/builds/meta/7caf3cb3-d272-4dbd-bb3f-1eeb64fab5d1.json +1 -0
  90. package/.output/public/_nuxt/{BAkJhSAW.js → e7zD3uJ0.js} +1 -1
  91. package/.output/public/_nuxt/{CYIR2GbL.js → gCELhaU9.js} +1 -1
  92. package/.output/public/_nuxt/{Do6zIWQf.js → gnCL8GjZ.js} +1 -1
  93. package/.output/public/_nuxt/{BuuvTH9e.js → hH1UFE3Z.js} +1 -1
  94. package/.output/public/_nuxt/{BReNbog6.js → hgHc4teu.js} +1 -1
  95. package/.output/public/_nuxt/{uaqMzXqE.js → ipDzNHcs.js} +1 -1
  96. package/.output/public/_nuxt/{B1CB30tg.js → kS3boz40.js} +1 -1
  97. package/.output/public/_nuxt/{DIA_NAIv.js → kjYMoWWx.js} +1 -1
  98. package/.output/public/_nuxt/{BsDB_eCd.js → oFM1KLWA.js} +1 -1
  99. package/.output/public/_nuxt/qH_j2A3a.js +1 -0
  100. package/.output/public/_nuxt/{DM_YaJgJ.js → qpI-_f9Q.js} +1 -1
  101. package/.output/public/_nuxt/{CRcjGmf7.js → rTvJTef_.js} +1 -1
  102. package/.output/public/_nuxt/{Ccit_CX1.js → rsiRgrVM.js} +1 -1
  103. package/.output/public/_nuxt/{Tt5LX5Y-.js → swrbBdtB.js} +1 -1
  104. package/.output/public/_nuxt/{DCMFuzDI.js → wHnZ9OaL.js} +1 -1
  105. package/.output/public/_nuxt/{D4SFgXAf.js → xqiPI_FQ.js} +1 -1
  106. package/.output/public/sw.js +1 -1
  107. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  108. package/.output/server/chunks/nitro/nitro.mjs +745 -738
  109. package/.output/server/package.json +1 -1
  110. package/package.json +1 -1
  111. package/.output/public/_nuxt/CiPH-swI.js +0 -1
  112. package/.output/public/_nuxt/Cx65B3c3.js +0 -1
  113. package/.output/public/_nuxt/builds/meta/ed1db2e5-9865-4231-9605-4edd5272e164.json +0 -1
  114. package/.output/public/_nuxt/wgcgHmRR.js +0 -1
@@ -1 +1 @@
1
- import{_ as F}from"./Bi3i470l.js";import{_ as O}from"./DoFSKAvY.js";import{_ as T}from"./B6IHiVa1.js";import{ax as D,d as G,L as H,a as Y,u as K,b as J,C as q,c as I,i as r,k as t,f as m,g as s,j as a,m as f,K as Q,r as _,x as W,o as i,q as v,H as M,D as X,_ as Z,v as ee,I as N,h as te}from"./D3SYPlEB.js";import{_ as ae}from"./Db_-yjYg.js";import{_ as se}from"./DB3ljns7.js";import"./BAkJhSAW.js";const oe=D("/logo-wide.svg"),ne={class:"min-h-screen flex flex-col items-center justify-center bg-elevated/50 gap-6 px-4"},le={key:1,class:"space-y-2 mb-4"},re={class:"mt-4 text-center"},ie={class:"flex items-center gap-4 text-sm text-muted"},de={href:"https://github.com/piwitests/platform",target:"_blank",rel:"noopener",class:"flex items-center gap-1.5 hover:text-default transition-colors"},ve=G({__name:"login",setup(ue){const{login:A}=H(),C=Y(),z=K(),x=J(),P=Q(),d=N({username:"",password:""}),w=_(!1),c=_(""),h=_(null),o=N({username:"",password:"",confirmPassword:"",name:""}),u=_(!1),p=_("");q(async()=>{if(P.public.demoMode){h.value=!1;return}try{const n=await $fetch("/api/auth/setup");h.value=n.needsSetup}catch{h.value=!1}});async function B(){if(!o.username||!o.password){p.value="Please choose a username and password";return}if(o.password!==o.confirmPassword){p.value="Passwords do not match";return}u.value=!0,p.value="";try{await $fetch("/api/auth/setup",{method:"POST",body:{username:o.username,password:o.password,name:o.name||void 0}}),await A(o.username,o.password),x.add({title:"Admin account created",description:"You're signed in.",color:"success"}),C.push("/")}catch(n){const e=n&&typeof n=="object"&&"data"in n?n.data?.message:void 0;p.value=e||"Failed to create the admin account",x.add({title:"Setup failed",description:p.value,color:"error"})}finally{u.value=!1}}const y=te(()=>P.public.demoMode?[]:P.public.oauthProviders||[]);q(()=>{const n=z.query.error;if(n){const e={"access-denied":"Access was denied","invalid-state":"Authentication failed (invalid state)","missing-code":"Authentication failed (missing code)","oauth-failed":"OAuth authentication failed","account-exists":"This email is already linked to a different sign-in method. Sign in with that method instead.","domain-not-allowed":"Your email domain is not allowed to sign in here.","org-not-allowed":"You are not a member of an allowed organization.","link-requires-login":"Please sign in before connecting a provider.","auth-disabled":"Authentication is not enabled","invalid-provider":"Invalid OAuth provider"};c.value=e[n]||"Authentication failed"}});async function E(){if(!d.username||!d.password){c.value="Please enter username and password";return}w.value=!0,c.value="";try{await A(d.username,d.password),x.add({title:"Login successful",color:"success"}),C.push("/")}catch(n){const e=n&&typeof n=="object"&&"data"in n?n.data?.message:void 0;c.value=e||"Invalid username or password",x.add({title:"Login failed",description:c.value,color:"error"})}finally{w.value=!1}}function S(n){window.location.href=`/api/auth/oauth/${n}/login`}return(n,e)=>{const R=F,U=O,$=T,g=X,b=ae,k=Z,V=ee,j=se,L=W;return i(),I("div",ne,[e[18]||(e[18]=r("img",{src:oe,alt:"Piwi Dashboard",class:"h-16 rounded-xl"},null,-1)),t(h)===null?(i(),m(U,{key:0,class:"w-full max-w-md"},{default:s(()=>[a(R,{text:"Loading…"})]),_:1})):t(h)?(i(),m(U,{key:1,class:"w-full max-w-md"},{header:s(()=>[...e[8]||(e[8]=[r("h1",{class:"text-xl font-semibold"},"Create the first admin account",-1),r("p",{class:"text-sm text-muted mt-1"}," Authentication is enabled and no accounts exist yet. Create the administrator account to sign in. ",-1)])]),default:s(()=>[t(p)?(i(),m($,{key:0,color:"error",title:t(p),variant:"subtle",class:"mb-4"},null,8,["title"])):v("",!0),r("form",{class:"space-y-4",onSubmit:M(B,["prevent"])},[a(b,{label:"Username",name:"username",required:""},{default:s(()=>[a(g,{modelValue:t(o).username,"onUpdate:modelValue":e[0]||(e[0]=l=>t(o).username=l),type:"text",placeholder:"Choose a username",autocomplete:"username",disabled:t(u),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),a(b,{label:"Name",name:"name"},{default:s(()=>[a(g,{modelValue:t(o).name,"onUpdate:modelValue":e[1]||(e[1]=l=>t(o).name=l),type:"text",placeholder:"Administrator (optional)",autocomplete:"name",disabled:t(u),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),a(b,{label:"Password",name:"password",required:""},{default:s(()=>[a(g,{modelValue:t(o).password,"onUpdate:modelValue":e[2]||(e[2]=l=>t(o).password=l),type:"password",placeholder:"Choose a password",autocomplete:"new-password",disabled:t(u),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),a(b,{label:"Confirm password",name:"confirmPassword",required:""},{default:s(()=>[a(g,{modelValue:t(o).confirmPassword,"onUpdate:modelValue":e[3]||(e[3]=l=>t(o).confirmPassword=l),type:"password",placeholder:"Re-enter the password",autocomplete:"new-password",disabled:t(u),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),a(k,{type:"submit",block:"",loading:t(u),disabled:t(u)},{default:s(()=>[...e[9]||(e[9]=[f(" Create admin account ",-1)])]),_:1},8,["loading","disabled"])],32)]),_:1})):(i(),m(U,{key:2,class:"w-full max-w-md"},{header:s(()=>[...e[10]||(e[10]=[r("h1",{class:"text-xl font-semibold"},"Sign in to your account",-1)])]),default:s(()=>[t(c)?(i(),m($,{key:0,color:"error",title:t(c),variant:"subtle",class:"mb-4"},null,8,["title"])):v("",!0),t(y).length>0?(i(),I("div",le,[t(y).includes("google")?(i(),m(k,{key:0,block:"",color:"neutral",variant:"outline",onClick:e[4]||(e[4]=l=>S("google"))},{leading:s(()=>[a(V,{name:"i-lucide-chrome",class:"size-5"})]),default:s(()=>[e[11]||(e[11]=f(" Sign in with Google ",-1))]),_:1})):v("",!0),t(y).includes("github")?(i(),m(k,{key:1,block:"",color:"neutral",variant:"outline",onClick:e[5]||(e[5]=l=>S("github"))},{leading:s(()=>[a(V,{name:"i-lucide-github",class:"size-5"})]),default:s(()=>[e[12]||(e[12]=f(" Sign in with GitHub ",-1))]),_:1})):v("",!0),t(y).length>0?(i(),m(j,{key:2,label:"or continue with password",class:"my-4"})):v("",!0)])):v("",!0),r("form",{class:"space-y-4",onSubmit:M(E,["prevent"])},[a(b,{label:"Username",name:"username",required:""},{default:s(()=>[a(g,{modelValue:t(d).username,"onUpdate:modelValue":e[6]||(e[6]=l=>t(d).username=l),type:"text",placeholder:"Enter your username",autocomplete:"username",disabled:t(w),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),a(b,{label:"Password",name:"password",required:""},{default:s(()=>[a(g,{modelValue:t(d).password,"onUpdate:modelValue":e[7]||(e[7]=l=>t(d).password=l),type:"password",placeholder:"Enter your password",autocomplete:"current-password",disabled:t(w),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),a(k,{type:"submit",block:"",loading:t(w),disabled:t(w)},{default:s(()=>[...e[13]||(e[13]=[f(" Login ",-1)])]),_:1},8,["loading","disabled"])],32),r("div",re,[a(L,{to:"/forgot-password",class:"text-sm text-muted hover:text-default"},{default:s(()=>[...e[14]||(e[14]=[f(" Forgot password? ",-1)])]),_:1})])]),_:1})),r("div",ie,[r("a",de,[a(V,{name:"i-lucide-github",class:"size-4"}),e[15]||(e[15]=f(" GitHub ",-1))]),e[17]||(e[17]=r("span",null,"·",-1)),a(L,{to:"/docs",class:"flex items-center gap-1.5 hover:text-default transition-colors"},{default:s(()=>[a(V,{name:"i-lucide-book-open",class:"size-4"}),e[16]||(e[16]=f(" API Docs ",-1))]),_:1})])])}}});export{ve as default};
1
+ import{_ as F}from"./BJtlcTrb.js";import{_ as O}from"./Dwws9U0D.js";import{_ as T}from"./B2oUeBbA.js";import{ax as D,d as G,L as H,a as Y,u as K,b as J,C as q,c as I,i as r,k as t,f as m,g as s,j as a,m as f,K as Q,r as _,x as W,o as i,q as v,H as M,D as X,_ as Z,v as ee,I as N,h as te}from"./DHltYerF.js";import{_ as ae}from"./DZ3Vfcpz.js";import{_ as se}from"./BUXSUkJ_.js";import"./e7zD3uJ0.js";const oe=D("/logo-wide.svg"),ne={class:"min-h-screen flex flex-col items-center justify-center bg-elevated/50 gap-6 px-4"},le={key:1,class:"space-y-2 mb-4"},re={class:"mt-4 text-center"},ie={class:"flex items-center gap-4 text-sm text-muted"},de={href:"https://github.com/piwitests/platform",target:"_blank",rel:"noopener",class:"flex items-center gap-1.5 hover:text-default transition-colors"},ve=G({__name:"login",setup(ue){const{login:A}=H(),C=Y(),z=K(),x=J(),P=Q(),d=N({username:"",password:""}),w=_(!1),c=_(""),h=_(null),o=N({username:"",password:"",confirmPassword:"",name:""}),u=_(!1),p=_("");q(async()=>{if(P.public.demoMode){h.value=!1;return}try{const n=await $fetch("/api/auth/setup");h.value=n.needsSetup}catch{h.value=!1}});async function B(){if(!o.username||!o.password){p.value="Please choose a username and password";return}if(o.password!==o.confirmPassword){p.value="Passwords do not match";return}u.value=!0,p.value="";try{await $fetch("/api/auth/setup",{method:"POST",body:{username:o.username,password:o.password,name:o.name||void 0}}),await A(o.username,o.password),x.add({title:"Admin account created",description:"You're signed in.",color:"success"}),C.push("/")}catch(n){const e=n&&typeof n=="object"&&"data"in n?n.data?.message:void 0;p.value=e||"Failed to create the admin account",x.add({title:"Setup failed",description:p.value,color:"error"})}finally{u.value=!1}}const y=te(()=>P.public.demoMode?[]:P.public.oauthProviders||[]);q(()=>{const n=z.query.error;if(n){const e={"access-denied":"Access was denied","invalid-state":"Authentication failed (invalid state)","missing-code":"Authentication failed (missing code)","oauth-failed":"OAuth authentication failed","account-exists":"This email is already linked to a different sign-in method. Sign in with that method instead.","domain-not-allowed":"Your email domain is not allowed to sign in here.","org-not-allowed":"You are not a member of an allowed organization.","link-requires-login":"Please sign in before connecting a provider.","auth-disabled":"Authentication is not enabled","invalid-provider":"Invalid OAuth provider"};c.value=e[n]||"Authentication failed"}});async function E(){if(!d.username||!d.password){c.value="Please enter username and password";return}w.value=!0,c.value="";try{await A(d.username,d.password),x.add({title:"Login successful",color:"success"}),C.push("/")}catch(n){const e=n&&typeof n=="object"&&"data"in n?n.data?.message:void 0;c.value=e||"Invalid username or password",x.add({title:"Login failed",description:c.value,color:"error"})}finally{w.value=!1}}function S(n){window.location.href=`/api/auth/oauth/${n}/login`}return(n,e)=>{const R=F,U=O,$=T,g=X,b=ae,k=Z,V=ee,j=se,L=W;return i(),I("div",ne,[e[18]||(e[18]=r("img",{src:oe,alt:"Piwi Dashboard",class:"h-16 rounded-xl"},null,-1)),t(h)===null?(i(),m(U,{key:0,class:"w-full max-w-md"},{default:s(()=>[a(R,{text:"Loading…"})]),_:1})):t(h)?(i(),m(U,{key:1,class:"w-full max-w-md"},{header:s(()=>[...e[8]||(e[8]=[r("h1",{class:"text-xl font-semibold"},"Create the first admin account",-1),r("p",{class:"text-sm text-muted mt-1"}," Authentication is enabled and no accounts exist yet. Create the administrator account to sign in. ",-1)])]),default:s(()=>[t(p)?(i(),m($,{key:0,color:"error",title:t(p),variant:"subtle",class:"mb-4"},null,8,["title"])):v("",!0),r("form",{class:"space-y-4",onSubmit:M(B,["prevent"])},[a(b,{label:"Username",name:"username",required:""},{default:s(()=>[a(g,{modelValue:t(o).username,"onUpdate:modelValue":e[0]||(e[0]=l=>t(o).username=l),type:"text",placeholder:"Choose a username",autocomplete:"username",disabled:t(u),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),a(b,{label:"Name",name:"name"},{default:s(()=>[a(g,{modelValue:t(o).name,"onUpdate:modelValue":e[1]||(e[1]=l=>t(o).name=l),type:"text",placeholder:"Administrator (optional)",autocomplete:"name",disabled:t(u),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),a(b,{label:"Password",name:"password",required:""},{default:s(()=>[a(g,{modelValue:t(o).password,"onUpdate:modelValue":e[2]||(e[2]=l=>t(o).password=l),type:"password",placeholder:"Choose a password",autocomplete:"new-password",disabled:t(u),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),a(b,{label:"Confirm password",name:"confirmPassword",required:""},{default:s(()=>[a(g,{modelValue:t(o).confirmPassword,"onUpdate:modelValue":e[3]||(e[3]=l=>t(o).confirmPassword=l),type:"password",placeholder:"Re-enter the password",autocomplete:"new-password",disabled:t(u),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),a(k,{type:"submit",block:"",loading:t(u),disabled:t(u)},{default:s(()=>[...e[9]||(e[9]=[f(" Create admin account ",-1)])]),_:1},8,["loading","disabled"])],32)]),_:1})):(i(),m(U,{key:2,class:"w-full max-w-md"},{header:s(()=>[...e[10]||(e[10]=[r("h1",{class:"text-xl font-semibold"},"Sign in to your account",-1)])]),default:s(()=>[t(c)?(i(),m($,{key:0,color:"error",title:t(c),variant:"subtle",class:"mb-4"},null,8,["title"])):v("",!0),t(y).length>0?(i(),I("div",le,[t(y).includes("google")?(i(),m(k,{key:0,block:"",color:"neutral",variant:"outline",onClick:e[4]||(e[4]=l=>S("google"))},{leading:s(()=>[a(V,{name:"i-lucide-chrome",class:"size-5"})]),default:s(()=>[e[11]||(e[11]=f(" Sign in with Google ",-1))]),_:1})):v("",!0),t(y).includes("github")?(i(),m(k,{key:1,block:"",color:"neutral",variant:"outline",onClick:e[5]||(e[5]=l=>S("github"))},{leading:s(()=>[a(V,{name:"i-lucide-github",class:"size-5"})]),default:s(()=>[e[12]||(e[12]=f(" Sign in with GitHub ",-1))]),_:1})):v("",!0),t(y).length>0?(i(),m(j,{key:2,label:"or continue with password",class:"my-4"})):v("",!0)])):v("",!0),r("form",{class:"space-y-4",onSubmit:M(E,["prevent"])},[a(b,{label:"Username",name:"username",required:""},{default:s(()=>[a(g,{modelValue:t(d).username,"onUpdate:modelValue":e[6]||(e[6]=l=>t(d).username=l),type:"text",placeholder:"Enter your username",autocomplete:"username",disabled:t(w),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),a(b,{label:"Password",name:"password",required:""},{default:s(()=>[a(g,{modelValue:t(d).password,"onUpdate:modelValue":e[7]||(e[7]=l=>t(d).password=l),type:"password",placeholder:"Enter your password",autocomplete:"current-password",disabled:t(w),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),a(k,{type:"submit",block:"",loading:t(w),disabled:t(w)},{default:s(()=>[...e[13]||(e[13]=[f(" Login ",-1)])]),_:1},8,["loading","disabled"])],32),r("div",re,[a(L,{to:"/forgot-password",class:"text-sm text-muted hover:text-default"},{default:s(()=>[...e[14]||(e[14]=[f(" Forgot password? ",-1)])]),_:1})])]),_:1})),r("div",ie,[r("a",de,[a(V,{name:"i-lucide-github",class:"size-4"}),e[15]||(e[15]=f(" GitHub ",-1))]),e[17]||(e[17]=r("span",null,"·",-1)),a(L,{to:"/docs",class:"flex items-center gap-1.5 hover:text-default transition-colors"},{default:s(()=>[a(V,{name:"i-lucide-book-open",class:"size-4"}),e[16]||(e[16]=f(" API Docs ",-1))]),_:1})])])}}});export{ve as default};
@@ -1 +1 @@
1
- import{d as v,b5 as I,az as y,b6 as F,C as g,ab as h,B as C,o as K,f as S,g as i,j as T,k as r,V as w,T as B,h as u,b7 as R,b8 as q,G as k,b9 as x}from"./D3SYPlEB.js";var _=v({__name:"RovingFocusItem",props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(d){const n=d,a=I(),f=y(),l=u(()=>n.tabStopId||f),c=u(()=>a.currentTabStopId.value===l.value),{getItems:p,CollectionItem:b}=F();g(()=>{n.focusable&&a.onFocusableItemAdd()}),h(()=>{n.focusable&&a.onFocusableItemRemove()}),C(()=>n.focusable,(e,t)=>{e!==t&&(e?a.onFocusableItemAdd():a.onFocusableItemRemove())});function m(e){if(e.key==="Tab"&&e.shiftKey){a.onItemShiftTab();return}if(e.target!==e.currentTarget)return;const t=R(e,a.orientation.value,a.dir.value);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!n.allowShiftKey&&e.shiftKey)return;e.preventDefault();let o=[...p().map(s=>s.ref).filter(s=>s.dataset.disabled!=="")];if(t==="last")o.reverse();else if(t==="prev"||t==="next"){t==="prev"&&o.reverse();const s=o.indexOf(e.currentTarget);o=a.loop.value?q(o,s+1):o.slice(s+1)}k(()=>x(o))}}return(e,t)=>(K(),S(r(b),null,{default:i(()=>[T(r(w),{tabindex:c.value?0:-1,"data-orientation":r(a).orientation.value,"data-active":e.active?"":void 0,"data-disabled":e.focusable?void 0:"",as:e.as,"as-child":e.asChild,onMousedown:t[0]||(t[0]=o=>{e.focusable?r(a).onItemFocus(l.value):o.preventDefault()}),onFocus:t[1]||(t[1]=o=>r(a).onItemFocus(l.value)),onKeydown:m},{default:i(()=>[B(e.$slots,"default")]),_:3},8,["tabindex","data-orientation","data-active","data-disabled","as","as-child"])]),_:3}))}}),j=_;export{j as R};
1
+ import{d as v,b5 as I,az as y,b6 as F,C as g,ab as h,B as C,o as K,f as S,g as i,j as T,k as r,V as w,T as B,h as u,b7 as R,b8 as q,G as k,b9 as x}from"./DHltYerF.js";var _=v({__name:"RovingFocusItem",props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(d){const n=d,a=I(),f=y(),l=u(()=>n.tabStopId||f),c=u(()=>a.currentTabStopId.value===l.value),{getItems:p,CollectionItem:b}=F();g(()=>{n.focusable&&a.onFocusableItemAdd()}),h(()=>{n.focusable&&a.onFocusableItemRemove()}),C(()=>n.focusable,(e,t)=>{e!==t&&(e?a.onFocusableItemAdd():a.onFocusableItemRemove())});function m(e){if(e.key==="Tab"&&e.shiftKey){a.onItemShiftTab();return}if(e.target!==e.currentTarget)return;const t=R(e,a.orientation.value,a.dir.value);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!n.allowShiftKey&&e.shiftKey)return;e.preventDefault();let o=[...p().map(s=>s.ref).filter(s=>s.dataset.disabled!=="")];if(t==="last")o.reverse();else if(t==="prev"||t==="next"){t==="prev"&&o.reverse();const s=o.indexOf(e.currentTarget);o=a.loop.value?q(o,s+1):o.slice(s+1)}k(()=>x(o))}}return(e,t)=>(K(),S(r(b),null,{default:i(()=>[T(r(w),{tabindex:c.value?0:-1,"data-orientation":r(a).orientation.value,"data-active":e.active?"":void 0,"data-disabled":e.focusable?void 0:"",as:e.as,"as-child":e.asChild,onMousedown:t[0]||(t[0]=o=>{e.focusable?r(a).onItemFocus(l.value):o.preventDefault()}),onFocus:t[1]||(t[1]=o=>r(a).onItemFocus(l.value)),onKeydown:m},{default:i(()=>[B(e.$slots,"default")]),_:3},8,["tabindex","data-orientation","data-active","data-disabled","as","as-child"])]),_:3}))}}),j=_;export{j as R};
@@ -1,2 +1,2 @@
1
- import{r as f,h as l}from"./D3SYPlEB.js";const d="piwi-diagnosis-notifications";function I(){const i=f("default"),s=new Set,t=f(!0);"Notification"in window&&(i.value=Notification.permission),localStorage.getItem(d)==="false"&&(t.value=!1);const n=l(()=>"Notification"in window),c=l(()=>n.value&&i.value==="granted"&&t.value);async function m(){if(!n.value)return;const e=await Notification.requestPermission();i.value=e}function g(){t.value=!t.value,localStorage.setItem(d,String(t.value))}function v(e,o){r({clusterId:o,summary:e.summary,rootCause:e.rootCause,category:e.category,confidence:e.confidence})}function r(e){if(!c.value||s.has(e.clusterId))return;const o=[e.summary||e.rootCause];e.category&&o.push(`Category: ${e.category}`),e.confidence&&o.push(`Confidence: ${e.confidence}`);const u=o.join(`
1
+ import{r as f,h as l}from"./DHltYerF.js";const d="piwi-diagnosis-notifications";function I(){const i=f("default"),s=new Set,t=f(!0);"Notification"in window&&(i.value=Notification.permission),localStorage.getItem(d)==="false"&&(t.value=!1);const n=l(()=>"Notification"in window),c=l(()=>n.value&&i.value==="granted"&&t.value);async function m(){if(!n.value)return;const e=await Notification.requestPermission();i.value=e}function g(){t.value=!t.value,localStorage.setItem(d,String(t.value))}function v(e,o){r({clusterId:o,summary:e.summary,rootCause:e.rootCause,category:e.category,confidence:e.confidence})}function r(e){if(!c.value||s.has(e.clusterId))return;const o=[e.summary||e.rootCause];e.category&&o.push(`Category: ${e.category}`),e.confidence&&o.push(`Confidence: ${e.confidence}`);const u=o.join(`
2
2
  `);if(!u)return;const a=new Notification("Piwi diagnosis complete",{body:u,tag:`diagnosis-${e.clusterId}`,icon:"/logo.svg"});a.onclick=()=>{window.focus(),a.close()},s.add(e.clusterId)}return{permission:i,supported:n,active:c,requestPermission:m,toggleEnabled:g,notify:v,notifyFromPayload:r}}export{I as u};
@@ -1 +1 @@
1
- import{_ as l}from"./empGC_x-.js";import{d as a,o as i,f as c,aa as r,g as n,T as s}from"./D3SYPlEB.js";const u=a({__name:"ChartCard",props:{title:{},subtitle:{},icon:{},iconClass:{},help:{}},setup(e){return(t,m)=>{const o=l;return i(),c(o,{title:e.title,subtitle:e.subtitle,icon:e.icon,"icon-class":e.iconClass,help:e.help},r({default:n(()=>[s(t.$slots,"default")]),_:2},[t.$slots.subtitle?{name:"subtitle",fn:n(()=>[s(t.$slots,"subtitle")]),key:"0"}:void 0,t.$slots.legend||t.$slots.actions?{name:"actions",fn:n(()=>[s(t.$slots,"legend"),s(t.$slots,"actions")]),key:"1"}:void 0]),1032,["title","subtitle","icon","icon-class","help"])}}}),C=Object.assign(u,{__name:"ChartCard"});export{C as _};
1
+ import{_ as l}from"./CN1mJlvD.js";import{d as a,o as i,f as c,aa as r,g as n,T as s}from"./DHltYerF.js";const u=a({__name:"ChartCard",props:{title:{},subtitle:{},icon:{},iconClass:{},help:{}},setup(e){return(t,m)=>{const o=l;return i(),c(o,{title:e.title,subtitle:e.subtitle,icon:e.icon,"icon-class":e.iconClass,help:e.help},r({default:n(()=>[s(t.$slots,"default")]),_:2},[t.$slots.subtitle?{name:"subtitle",fn:n(()=>[s(t.$slots,"subtitle")]),key:"0"}:void 0,t.$slots.legend||t.$slots.actions?{name:"actions",fn:n(()=>[s(t.$slots,"legend"),s(t.$slots,"actions")]),key:"1"}:void 0]),1032,["title","subtitle","icon","icon-class","help"])}}}),C=Object.assign(u,{__name:"ChartCard"});export{C as _};
@@ -1,4 +1,4 @@
1
- import{_ as me,a as pe}from"./BAaSmp8J.js";import{_ as fe,a as he}from"./87SGk1nu.js";import{_ as _e}from"./Bi3i470l.js";import{d as H,o as n,c as r,F as B,y as T,i,t as u,k as s,q as b,m as R,f as U,h as g,av as xe,I as se,r as D,j as $,_ as Y,D as oe,l as X,s as ee,g as P,p as Q,K as ae,v as ye,b as ge,aw as be,e as ve}from"./D3SYPlEB.js";import{_ as ke}from"./DM_YaJgJ.js";import{_ as $e}from"./B6IHiVa1.js";import{_ as we}from"./CCsl9MOZ.js";import{_ as Ae}from"./DnThe2U0.js";import{_ as je}from"./oFIS9u6t.js";import{e as re}from"./BUMZHDRC.js";import{_ as Ue}from"./KYucVFu7.js";import{u as Ce}from"./D3MWm6JP.js";import{u as Se}from"./CiPH-swI.js";import{u as Oe}from"./Doul3p1_.js";import"./B6rt3IcG.js";import"./Cx65B3c3.js";const qe=["get","post","put","patch","delete","head","options","trace"];function Be(e){switch(e.toLowerCase()){case"get":return"success";case"post":return"info";case"put":case"patch":return"warning";case"delete":return"error";default:return"neutral"}}function Re(e,t){return`op-${e}-${t}`.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function Te(e){const t=new Map;for(const[a,o]of Object.entries(e?.paths??{})){if(!o)continue;const c=o.parameters??[];for(const m of qe){const f=o[m];if(!f)continue;const p=f.tags?.[0]??"Other",_={path:a,method:m,operation:f,parameters:[...c,...f.parameters??[]],tag:p,anchor:Re(m,a)},A=t.get(p);A?A.push(_):t.set(p,[_])}}return[...t.entries()].map(([a,o])=>({tag:a,operations:o})).sort((a,o)=>a.tag.localeCompare(o.tag))}function ie(e,t){return Array.isArray(e.security)?e.security.length>0:Array.isArray(t?.security)&&t.security.length>0}function Pe(e){return Array.isArray(e.security)&&e.security.length===0}function N(e,t){if(!e?.$ref)return e;const a=/^#\/components\/schemas\/(.+)$/.exec(e.$ref);return a?.[1]?t?.components?.schemas?.[a[1]]??e:e}const Ve=["administrator","reporter","user"];function ne(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Le(e){const t=e["x-required-roles"];if(!t||t.length===0)return null;const a=Ve.every(o=>t.includes(o));return{roles:t,label:a?"Any signed-in user":t.map(ne).join(" or "),shortLabel:a?"Any user":t.map(o=>o==="administrator"?"Admin":ne(o)).join(" / "),elevated:!a&&!t.includes("user")}}function te(e){if(!e)return"any";if(e.$ref)return e.$ref.split("/").pop()??"object";const t=Array.isArray(e.type)?e.type.join(" | "):e.type;if(t==="array"){const a=e.items;return`array<${a?te(a):"any"}>`}return!t&&e.properties||!t&&(e.oneOf||e.anyOf||e.allOf)?"object":t??"any"}const ze={class:"space-y-2"},Ie={class:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5"},De={class:"font-mono text-primary"},Ne={class:"text-xs text-muted font-mono"},Ee={key:0,class:"text-xs text-dimmed font-mono"},Je={key:1,class:"text-xs font-medium text-error"},Me={key:0,class:"text-muted mt-0.5"},He={key:1,class:"text-xs text-dimmed mt-0.5"},We={class:"font-mono"},Fe=H({__name:"ApiSchema",props:{schema:{},spec:{default:null},depth:{default:0}},setup(e){const t=e,a=g(()=>N(t.schema,t.spec)??t.schema),o=g(()=>{const p=a.value.type==="array"?N(a.value.items,t.spec):a.value,_=p?.properties;if(!_)return[];const A=new Set(p?.required??[]);return Object.entries(_).map(([x,j])=>({name:x,required:A.has(x),schema:N(j,t.spec)??j}))}),c=g(()=>(t.depth??0)<6);function m(p){const _=p.type==="array"?N(p.items,t.spec):p;return!!(_?.properties&&Object.keys(_.properties).length>0)}function f(p){return(p.enum??[]).map(_=>JSON.stringify(_)).join(", ")}return(p,_)=>{const A=le;return n(),r("div",ze,[(n(!0),r(B,null,T(s(o),x=>(n(),r("div",{key:x.name,class:"text-sm"},[i("div",Ie,[i("code",De,u(x.name),1),i("span",Ne,u(("schemaTypeLabel"in p?p.schemaTypeLabel:s(te))(x.schema)),1),x.schema.format?(n(),r("span",Ee,"("+u(x.schema.format)+")",1)):b("",!0),x.required?(n(),r("span",Je,"required")):b("",!0)]),x.schema.description?(n(),r("p",Me,u(x.schema.description),1)):b("",!0),x.schema.enum?.length?(n(),r("p",He,[_[0]||(_[0]=R(" Allowed values: ",-1)),i("span",We,u(f(x.schema)),1)])):b("",!0),s(c)&&m(x.schema)?(n(),U(A,{key:2,schema:x.schema,spec:e.spec,depth:(e.depth??0)+1,class:"mt-1.5 border-l border-default pl-3"},null,8,["schema","spec","depth"])):b("",!0)]))),128))])}}}),le=Object.assign(Fe,{__name:"ApiSchema"});function Qe(){return{token:xe("piwi-api-token","")}}function Ge(e,t){return e.replace(/\{([^}]+)\}/g,(a,o)=>{const c=t[o];return c?encodeURIComponent(c):a})}function Ke(e){const t=new URLSearchParams;for(const[o,c]of Object.entries(e))c!==void 0&&c!==""&&t.append(o,c);const a=t.toString();return a?`?${a}`:""}function Z(e,t,a=0){const o=N(e,t);if(!o||a>6)return null;if(o.example!==void 0)return o.example;if(o.default!==void 0)return o.default;if(o.enum?.length)return o.enum[0];const c=Array.isArray(o.type)?o.type.find(m=>m!=="null"):o.type;if(c==="object"||!c&&o.properties){const m={};for(const[f,p]of Object.entries(o.properties??{}))m[f]=Z(p,t,a+1);return m}if(c==="array")return[Z(o.items,t,a+1)];switch(c){case"string":return o.format==="date-time"?"2024-01-01T00:00:00Z":o.format==="date"?"2024-01-01":o.format==="uuid"?"00000000-0000-0000-0000-000000000000":"string";case"integer":case"number":return 0;case"boolean":return!1;default:return null}}function Xe(e,t){const a=e.requestBody?.content?.["application/json"]?.schema;return a?JSON.stringify(Z(a,t),null,2):null}function Ze(e){return!!e.requestBody?.content?.["application/json"]}function K(e){return`'${e.replace(/'/g,"'\\''")}'`}function Ye({method:e,url:t,headers:a,body:o}){const c=["curl"];e.toUpperCase()!=="GET"&&c.push("-X",e.toUpperCase());for(const[m,f]of Object.entries(a))c.push("-H",K(`${m}: ${f}`));return o&&c.push("-d",K(o)),c.push(K(t)),c.join(" ")}function et({method:e,url:t,headers:a,body:o}){const c=[` method: ${JSON.stringify(e.toUpperCase())},`];return Object.keys(a).length&&c.push(` headers: ${JSON.stringify(a)},`),o&&c.push(` body: ${JSON.stringify(o)},`),`const res = await fetch(${JSON.stringify(t)}, {
1
+ import{_ as me,a as pe}from"./B4jvLMfS.js";import{_ as fe,a as he}from"./CdMuck_X.js";import{_ as _e}from"./BJtlcTrb.js";import{d as H,o as n,c as r,F as B,y as T,i,t as u,k as s,q as b,m as R,f as U,h as g,av as xe,I as se,r as D,j as $,_ as Y,D as oe,l as X,s as ee,g as P,p as Q,K as ae,v as ye,b as ge,aw as be,e as ve}from"./DHltYerF.js";import{_ as ke}from"./qpI-_f9Q.js";import{_ as $e}from"./B2oUeBbA.js";import{_ as we}from"./B1zMFx24.js";import{_ as Ae}from"./BeFDVhpA.js";import{_ as je}from"./BHpUiv6j.js";import{e as re}from"./BeKvLsja.js";import{_ as Ue}from"./C1dyLp_j.js";import{u as Ce}from"./By4YL7mx.js";import{u as Se}from"./Cnapl7lZ.js";import{u as Oe}from"./DXbPFI1d.js";import"./BbS6Bwby.js";import"./qH_j2A3a.js";const qe=["get","post","put","patch","delete","head","options","trace"];function Be(e){switch(e.toLowerCase()){case"get":return"success";case"post":return"info";case"put":case"patch":return"warning";case"delete":return"error";default:return"neutral"}}function Re(e,t){return`op-${e}-${t}`.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function Te(e){const t=new Map;for(const[a,o]of Object.entries(e?.paths??{})){if(!o)continue;const c=o.parameters??[];for(const m of qe){const f=o[m];if(!f)continue;const p=f.tags?.[0]??"Other",_={path:a,method:m,operation:f,parameters:[...c,...f.parameters??[]],tag:p,anchor:Re(m,a)},A=t.get(p);A?A.push(_):t.set(p,[_])}}return[...t.entries()].map(([a,o])=>({tag:a,operations:o})).sort((a,o)=>a.tag.localeCompare(o.tag))}function ie(e,t){return Array.isArray(e.security)?e.security.length>0:Array.isArray(t?.security)&&t.security.length>0}function Pe(e){return Array.isArray(e.security)&&e.security.length===0}function N(e,t){if(!e?.$ref)return e;const a=/^#\/components\/schemas\/(.+)$/.exec(e.$ref);return a?.[1]?t?.components?.schemas?.[a[1]]??e:e}const Ve=["administrator","reporter","user"];function ne(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Le(e){const t=e["x-required-roles"];if(!t||t.length===0)return null;const a=Ve.every(o=>t.includes(o));return{roles:t,label:a?"Any signed-in user":t.map(ne).join(" or "),shortLabel:a?"Any user":t.map(o=>o==="administrator"?"Admin":ne(o)).join(" / "),elevated:!a&&!t.includes("user")}}function te(e){if(!e)return"any";if(e.$ref)return e.$ref.split("/").pop()??"object";const t=Array.isArray(e.type)?e.type.join(" | "):e.type;if(t==="array"){const a=e.items;return`array<${a?te(a):"any"}>`}return!t&&e.properties||!t&&(e.oneOf||e.anyOf||e.allOf)?"object":t??"any"}const ze={class:"space-y-2"},Ie={class:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5"},De={class:"font-mono text-primary"},Ne={class:"text-xs text-muted font-mono"},Ee={key:0,class:"text-xs text-dimmed font-mono"},Je={key:1,class:"text-xs font-medium text-error"},Me={key:0,class:"text-muted mt-0.5"},He={key:1,class:"text-xs text-dimmed mt-0.5"},We={class:"font-mono"},Fe=H({__name:"ApiSchema",props:{schema:{},spec:{default:null},depth:{default:0}},setup(e){const t=e,a=g(()=>N(t.schema,t.spec)??t.schema),o=g(()=>{const p=a.value.type==="array"?N(a.value.items,t.spec):a.value,_=p?.properties;if(!_)return[];const A=new Set(p?.required??[]);return Object.entries(_).map(([x,j])=>({name:x,required:A.has(x),schema:N(j,t.spec)??j}))}),c=g(()=>(t.depth??0)<6);function m(p){const _=p.type==="array"?N(p.items,t.spec):p;return!!(_?.properties&&Object.keys(_.properties).length>0)}function f(p){return(p.enum??[]).map(_=>JSON.stringify(_)).join(", ")}return(p,_)=>{const A=le;return n(),r("div",ze,[(n(!0),r(B,null,T(s(o),x=>(n(),r("div",{key:x.name,class:"text-sm"},[i("div",Ie,[i("code",De,u(x.name),1),i("span",Ne,u(("schemaTypeLabel"in p?p.schemaTypeLabel:s(te))(x.schema)),1),x.schema.format?(n(),r("span",Ee,"("+u(x.schema.format)+")",1)):b("",!0),x.required?(n(),r("span",Je,"required")):b("",!0)]),x.schema.description?(n(),r("p",Me,u(x.schema.description),1)):b("",!0),x.schema.enum?.length?(n(),r("p",He,[_[0]||(_[0]=R(" Allowed values: ",-1)),i("span",We,u(f(x.schema)),1)])):b("",!0),s(c)&&m(x.schema)?(n(),U(A,{key:2,schema:x.schema,spec:e.spec,depth:(e.depth??0)+1,class:"mt-1.5 border-l border-default pl-3"},null,8,["schema","spec","depth"])):b("",!0)]))),128))])}}}),le=Object.assign(Fe,{__name:"ApiSchema"});function Qe(){return{token:xe("piwi-api-token","")}}function Ge(e,t){return e.replace(/\{([^}]+)\}/g,(a,o)=>{const c=t[o];return c?encodeURIComponent(c):a})}function Ke(e){const t=new URLSearchParams;for(const[o,c]of Object.entries(e))c!==void 0&&c!==""&&t.append(o,c);const a=t.toString();return a?`?${a}`:""}function Z(e,t,a=0){const o=N(e,t);if(!o||a>6)return null;if(o.example!==void 0)return o.example;if(o.default!==void 0)return o.default;if(o.enum?.length)return o.enum[0];const c=Array.isArray(o.type)?o.type.find(m=>m!=="null"):o.type;if(c==="object"||!c&&o.properties){const m={};for(const[f,p]of Object.entries(o.properties??{}))m[f]=Z(p,t,a+1);return m}if(c==="array")return[Z(o.items,t,a+1)];switch(c){case"string":return o.format==="date-time"?"2024-01-01T00:00:00Z":o.format==="date"?"2024-01-01":o.format==="uuid"?"00000000-0000-0000-0000-000000000000":"string";case"integer":case"number":return 0;case"boolean":return!1;default:return null}}function Xe(e,t){const a=e.requestBody?.content?.["application/json"]?.schema;return a?JSON.stringify(Z(a,t),null,2):null}function Ze(e){return!!e.requestBody?.content?.["application/json"]}function K(e){return`'${e.replace(/'/g,"'\\''")}'`}function Ye({method:e,url:t,headers:a,body:o}){const c=["curl"];e.toUpperCase()!=="GET"&&c.push("-X",e.toUpperCase());for(const[m,f]of Object.entries(a))c.push("-H",K(`${m}: ${f}`));return o&&c.push("-d",K(o)),c.push(K(t)),c.join(" ")}function et({method:e,url:t,headers:a,body:o}){const c=[` method: ${JSON.stringify(e.toUpperCase())},`];return Object.keys(a).length&&c.push(` headers: ${JSON.stringify(a)},`),o&&c.push(` body: ${JSON.stringify(o)},`),`const res = await fetch(${JSON.stringify(t)}, {
2
2
  ${c.join(`
3
3
  `)}
4
4
  });
@@ -1 +1 @@
1
- import{_ as R}from"./BAaSmp8J.js";import{_ as V}from"./Ccit_CX1.js";import{_ as O,a as q}from"./87SGk1nu.js";import{_ as z}from"./DC51KKt4.js";import{d as A,u as L,a as G,b as J,w as T,e as K,r as g,f as M,g as i,h as f,o as Q,i as l,j as r,k as o,l as W,_ as X,m as b,t as Y}from"./D3SYPlEB.js";import{o as Z,s as u,_ as tt}from"./BoC6qaRF.js";import{_ as ot}from"./DoFSKAvY.js";import{u as h}from"./Doul3p1_.js";import"./B6rt3IcG.js";import"./Db_-yjYg.js";import"./BAkJhSAW.js";import"./DnThe2U0.js";import"./C8cz5feG.js";import"./r3SBLxtE.js";import"./D3MWm6JP.js";import"./ClVRQpP_.js";import"./DaewB_zT.js";import"./Dbg8z684.js";import"./Cx65B3c3.js";import"./rm7OkgDG.js";import"./Vnfkr1pJ.js";import"./BUMZHDRC.js";const st={class:"p-4 space-y-4"},et={class:"text-sm text-gray-600 mt-1"},at={class:"font-medium"},nt={class:"flex justify-end gap-2 pt-2"},Ct=A({__name:"edit",async setup(it){let n,d;const $=L(),v=G(),j=J(),c=$.params.id,{data:e}=([n,d]=T(()=>h(`/api/projects/${c}`,"$HHkdnHL3hB")),n=await n,d(),n),{data:y,refresh:x}=([n,d]=T(()=>h("/api/tags","$DPtjOd0zOq")),n=await n,d(),n);K(f(()=>({title:`Edit ${e.value?.label||e.value?.name||"Project"} — Piwi Dashboard`})));const I=f(()=>y.value?.tags||[]),U=f(()=>!!e.value?.hasScmToken),s=g({label:e.value?.label||"",description:e.value?.description||"",diagnosisInstructions:e.value?.diagnosisInstructions||"",scmToken:""}),p=g(e.value?.tags||[]),P=Z({label:u().optional(),description:u().optional(),diagnosisInstructions:u().optional(),scmToken:u().optional()}),_=g(!1);async function C(){try{_.value=!0,await $fetch(`/api/projects/${c}`,{method:"PUT",body:{label:s.value.label||null,description:s.value.description||null,diagnosisInstructions:s.value.diagnosisInstructions||null,scmToken:s.value.scmToken||null,tagIds:p.value.map(m=>m.id)}}),j.add({title:"Project updated",description:"Project settings have been saved successfully",color:"success"}),await v.push(`/projects/${c}`)}catch(m){console.error("Error updating project:",m),j.add({title:"Error",description:"Failed to update project",color:"error"})}finally{_.value=!1}}function w(){v.push(`/projects/${c}`)}return(m,t)=>{const B=R,D=V,N=q,E=z,k=X,F=tt,H=ot,S=O;return Q(),M(S,{id:"project-edit"},{header:i(()=>[r(N,null,{leading:i(()=>[r(B),r(D,{items:[{label:"Home",icon:"i-lucide-house",to:"/"},{label:"Projects",to:"/projects"},{label:o(e)?.label||o(e)?.name||"Project",to:`/projects/${o(c)}`},{label:"Edit"}]},null,8,["items"])]),_:1})]),body:i(()=>[l("div",st,[r(H,null,{header:i(()=>[t[7]||(t[7]=l("h2",null,"Edit project settings",-1)),l("p",et,[t[6]||(t[6]=b(" Project Name: ",-1)),l("span",at,Y(o(e)?.name),1)]),t[8]||(t[8]=l("p",{class:"text-xs text-gray-500 mt-1"}," Note: The project name is used to match test results from the reporter and cannot be changed. ",-1))]),default:i(()=>[r(F,{schema:o(P),state:o(s),class:"space-y-5",onSubmit:C},{default:i(()=>[r(E,{mode:"edit","has-token":o(U),label:o(s).label,"onUpdate:label":t[0]||(t[0]=a=>o(s).label=a),description:o(s).description,"onUpdate:description":t[1]||(t[1]=a=>o(s).description=a),diagnosisInstructions:o(s).diagnosisInstructions,"onUpdate:diagnosisInstructions":t[2]||(t[2]=a=>o(s).diagnosisInstructions=a),scmToken:o(s).scmToken,"onUpdate:scmToken":t[3]||(t[3]=a=>o(s).scmToken=a),tags:o(p),"onUpdate:tags":t[4]||(t[4]=a=>W(p)?p.value=a:null),"all-tags":o(I),onTagCreated:t[5]||(t[5]=a=>o(x)())},null,8,["has-token","label","description","diagnosisInstructions","scmToken","tags","all-tags"]),l("div",nt,[r(k,{variant:"ghost",color:"neutral",onClick:w},{default:i(()=>[...t[9]||(t[9]=[b(" Cancel ",-1)])]),_:1}),r(k,{type:"submit",icon:"i-lucide-check",loading:o(_)},{default:i(()=>[...t[10]||(t[10]=[b(" Save changes ",-1)])]),_:1},8,["loading"])])]),_:1},8,["schema","state"])]),_:1})])]),_:1})}}});export{Ct as default};
1
+ import{_ as R}from"./B4jvLMfS.js";import{_ as V}from"./rsiRgrVM.js";import{_ as O,a as q}from"./CdMuck_X.js";import{_ as z}from"./Dr_dI5hB.js";import{d as A,u as L,a as G,b as J,w as T,e as K,r as g,f as M,g as i,h as f,o as Q,i as l,j as r,k as o,l as W,_ as X,m as b,t as Y}from"./DHltYerF.js";import{o as Z,s as u,_ as tt}from"./BLIRKrbM.js";import{_ as ot}from"./Dwws9U0D.js";import{u as h}from"./DXbPFI1d.js";import"./BbS6Bwby.js";import"./DZ3Vfcpz.js";import"./e7zD3uJ0.js";import"./BeFDVhpA.js";import"./DHXWp5yD.js";import"./r3SBLxtE.js";import"./By4YL7mx.js";import"./Dga3Av-m.js";import"./EPZOxdgq.js";import"./Bd3HqPMF.js";import"./qH_j2A3a.js";import"./CcXaak_K.js";import"./BFP6M-20.js";import"./BeKvLsja.js";const st={class:"p-4 space-y-4"},et={class:"text-sm text-gray-600 mt-1"},at={class:"font-medium"},nt={class:"flex justify-end gap-2 pt-2"},Ct=A({__name:"edit",async setup(it){let n,d;const $=L(),v=G(),j=J(),c=$.params.id,{data:e}=([n,d]=T(()=>h(`/api/projects/${c}`,"$HHkdnHL3hB")),n=await n,d(),n),{data:y,refresh:x}=([n,d]=T(()=>h("/api/tags","$DPtjOd0zOq")),n=await n,d(),n);K(f(()=>({title:`Edit ${e.value?.label||e.value?.name||"Project"} — Piwi Dashboard`})));const I=f(()=>y.value?.tags||[]),U=f(()=>!!e.value?.hasScmToken),s=g({label:e.value?.label||"",description:e.value?.description||"",diagnosisInstructions:e.value?.diagnosisInstructions||"",scmToken:""}),p=g(e.value?.tags||[]),P=Z({label:u().optional(),description:u().optional(),diagnosisInstructions:u().optional(),scmToken:u().optional()}),_=g(!1);async function C(){try{_.value=!0,await $fetch(`/api/projects/${c}`,{method:"PUT",body:{label:s.value.label||null,description:s.value.description||null,diagnosisInstructions:s.value.diagnosisInstructions||null,scmToken:s.value.scmToken||null,tagIds:p.value.map(m=>m.id)}}),j.add({title:"Project updated",description:"Project settings have been saved successfully",color:"success"}),await v.push(`/projects/${c}`)}catch(m){console.error("Error updating project:",m),j.add({title:"Error",description:"Failed to update project",color:"error"})}finally{_.value=!1}}function w(){v.push(`/projects/${c}`)}return(m,t)=>{const B=R,D=V,N=q,E=z,k=X,F=tt,H=ot,S=O;return Q(),M(S,{id:"project-edit"},{header:i(()=>[r(N,null,{leading:i(()=>[r(B),r(D,{items:[{label:"Home",icon:"i-lucide-house",to:"/"},{label:"Projects",to:"/projects"},{label:o(e)?.label||o(e)?.name||"Project",to:`/projects/${o(c)}`},{label:"Edit"}]},null,8,["items"])]),_:1})]),body:i(()=>[l("div",st,[r(H,null,{header:i(()=>[t[7]||(t[7]=l("h2",null,"Edit project settings",-1)),l("p",et,[t[6]||(t[6]=b(" Project Name: ",-1)),l("span",at,Y(o(e)?.name),1)]),t[8]||(t[8]=l("p",{class:"text-xs text-gray-500 mt-1"}," Note: The project name is used to match test results from the reporter and cannot be changed. ",-1))]),default:i(()=>[r(F,{schema:o(P),state:o(s),class:"space-y-5",onSubmit:C},{default:i(()=>[r(E,{mode:"edit","has-token":o(U),label:o(s).label,"onUpdate:label":t[0]||(t[0]=a=>o(s).label=a),description:o(s).description,"onUpdate:description":t[1]||(t[1]=a=>o(s).description=a),diagnosisInstructions:o(s).diagnosisInstructions,"onUpdate:diagnosisInstructions":t[2]||(t[2]=a=>o(s).diagnosisInstructions=a),scmToken:o(s).scmToken,"onUpdate:scmToken":t[3]||(t[3]=a=>o(s).scmToken=a),tags:o(p),"onUpdate:tags":t[4]||(t[4]=a=>W(p)?p.value=a:null),"all-tags":o(I),onTagCreated:t[5]||(t[5]=a=>o(x)())},null,8,["has-token","label","description","diagnosisInstructions","scmToken","tags","all-tags"]),l("div",nt,[r(k,{variant:"ghost",color:"neutral",onClick:w},{default:i(()=>[...t[9]||(t[9]=[b(" Cancel ",-1)])]),_:1}),r(k,{type:"submit",icon:"i-lucide-check",loading:o(_)},{default:i(()=>[...t[10]||(t[10]=[b(" Save changes ",-1)])]),_:1},8,["loading"])])]),_:1},8,["schema","state"])]),_:1})])]),_:1})}}});export{Ct as default};
@@ -1,4 +1,4 @@
1
- import{x as U,y as g,z as q,A as Q,B as Z,D as ee,E as J,X as te,C as ne,c as E,d as ae,i as re,e as se,F as $,j as ie,G as R,f as Y,g as X,k as oe,r as O,n as P,s as T,l as W,H as z,I,J as le,K as ce,p as ue,t as he,P as de,v as ye}from"./BEB2Mv6B.js";import{d as fe,am as pe,C as ve,G as ge,ab as me,B as V,o as ke,c as xe,h as be,r as Se}from"./D3SYPlEB.js";function Ae(p,n,e){var r=null,s=g(!0),l=null,o=q,c=null,m=U(a);p=typeof p=="function"?p:p===void 0?Q:g(+p),n=typeof n=="function"?n:n===void 0?g(0):g(+n),e=typeof e=="function"?e:e===void 0?Z:g(+e);function a(t){var u,x,h,d=(t=ee(t)).length,f,v=!1,b,i=new Array(d),y=new Array(d);for(l==null&&(c=o(b=m())),u=0;u<=d;++u){if(!(u<d&&s(f=t[u],u,t))===v)if(v=!v)x=u,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),h=u-1;h>=x;--h)c.point(i[h],y[h]);c.lineEnd(),c.areaEnd()}v&&(i[u]=+p(f,u,t),y[u]=+n(f,u,t),c.point(r?+r(f,u,t):i[u],e?+e(f,u,t):y[u]))}if(b)return c=null,b+""||null}function k(){return J().defined(s).curve(o).context(l)}return a.x=function(t){return arguments.length?(p=typeof t=="function"?t:g(+t),r=null,a):p},a.x0=function(t){return arguments.length?(p=typeof t=="function"?t:g(+t),a):p},a.x1=function(t){return arguments.length?(r=t==null?null:typeof t=="function"?t:g(+t),a):r},a.y=function(t){return arguments.length?(n=typeof t=="function"?t:g(+t),e=null,a):n},a.y0=function(t){return arguments.length?(n=typeof t=="function"?t:g(+t),a):n},a.y1=function(t){return arguments.length?(e=t==null?null:typeof t=="function"?t:g(+t),a):e},a.lineX0=a.lineY0=function(){return k().x(p).y(n)},a.lineY1=function(){return k().x(p).y(e)},a.lineX1=function(){return k().x(r).y(n)},a.defined=function(t){return arguments.length?(s=typeof t=="function"?t:g(!!t),a):s},a.curve=function(t){return arguments.length?(o=t,l!=null&&(c=o(l)),a):o},a.context=function(t){return arguments.length?(t==null?l=c=null:c=o(l=t),a):l},a}const De=Object.assign(Object.assign({},te),{color:void 0,curveType:ne.MonotoneX,baseline:()=>0,opacity:1,cursor:null,line:!1,lineColor:void 0,lineWidth:2,lineDashArray:void 0,minHeight1Px:!1,minHeight:void 0,stackMinHeight:!1}),K=E`
1
+ import{x as U,y as g,z as q,A as Q,B as Z,D as ee,E as J,X as te,C as ne,c as E,d as ae,i as re,e as se,F as $,j as ie,G as R,f as Y,g as X,k as oe,r as O,n as P,s as T,l as W,H as z,I,J as le,K as ce,p as ue,t as he,P as de,v as ye}from"./4TxgDGVa.js";import{d as fe,am as pe,C as ve,G as ge,ab as me,B as V,o as ke,c as xe,h as be,r as Se}from"./DHltYerF.js";function Ae(p,n,e){var r=null,s=g(!0),l=null,o=q,c=null,m=U(a);p=typeof p=="function"?p:p===void 0?Q:g(+p),n=typeof n=="function"?n:n===void 0?g(0):g(+n),e=typeof e=="function"?e:e===void 0?Z:g(+e);function a(t){var u,x,h,d=(t=ee(t)).length,f,v=!1,b,i=new Array(d),y=new Array(d);for(l==null&&(c=o(b=m())),u=0;u<=d;++u){if(!(u<d&&s(f=t[u],u,t))===v)if(v=!v)x=u,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),h=u-1;h>=x;--h)c.point(i[h],y[h]);c.lineEnd(),c.areaEnd()}v&&(i[u]=+p(f,u,t),y[u]=+n(f,u,t),c.point(r?+r(f,u,t):i[u],e?+e(f,u,t):y[u]))}if(b)return c=null,b+""||null}function k(){return J().defined(s).curve(o).context(l)}return a.x=function(t){return arguments.length?(p=typeof t=="function"?t:g(+t),r=null,a):p},a.x0=function(t){return arguments.length?(p=typeof t=="function"?t:g(+t),a):p},a.x1=function(t){return arguments.length?(r=t==null?null:typeof t=="function"?t:g(+t),a):r},a.y=function(t){return arguments.length?(n=typeof t=="function"?t:g(+t),e=null,a):n},a.y0=function(t){return arguments.length?(n=typeof t=="function"?t:g(+t),a):n},a.y1=function(t){return arguments.length?(e=t==null?null:typeof t=="function"?t:g(+t),a):e},a.lineX0=a.lineY0=function(){return k().x(p).y(n)},a.lineY1=function(){return k().x(p).y(e)},a.lineX1=function(){return k().x(r).y(n)},a.defined=function(t){return arguments.length?(s=typeof t=="function"?t:g(!!t),a):s},a.curve=function(t){return arguments.length?(o=t,l!=null&&(c=o(l)),a):o},a.context=function(t){return arguments.length?(t==null?l=c=null:c=o(l=t),a):l},a}const De=Object.assign(Object.assign({},te),{color:void 0,curveType:ne.MonotoneX,baseline:()=>0,opacity:1,cursor:null,line:!1,lineColor:void 0,lineWidth:2,lineDashArray:void 0,minHeight1Px:!1,minHeight:void 0,stackMinHeight:!1}),K=E`
2
2
  label: area-component;
3
3
  `,Ce=re`
4
4
  :root {
@@ -1 +1 @@
1
- import{u as b}from"./B6rt3IcG.js";import{h as j,bR as m}from"./D3SYPlEB.js";const g="piwi-browser-notify";function a(){return{projects:{}}}function y(e){try{const n=JSON.parse(e);if(typeof n!="object"||n===null)return a();const c={};if(n.projects&&typeof n.projects=="object")for(const[i,r]of Object.entries(n.projects)){const u=Number(i);Number.isNaN(u)||r&&typeof r=="object"&&Array.isArray(r.events)&&(c[u]={events:r.events.filter(f=>typeof f=="string")})}return{projects:c}}catch{return a()}}const h=m(!0);let l=null,p=null;function S(){p||h.run(()=>{l=b(g,{default:()=>"",maxAge:3600*24*365,sameSite:"lax",path:"/",secure:location.protocol==="https:",encode:e=>encodeURIComponent(e),decode:e=>decodeURIComponent(e)}),p=j({get:()=>{const e=l.value;return e?y(e):a()},set:e=>{l.value=JSON.stringify(e)}})})}function O(){S();const e=p;function n(t){return e.value.projects[t]??{events:[]}}function c(t,o){if(o.length===0){const s={...e.value};delete s.projects[t],e.value=s}else e.value={...e.value,projects:{...e.value.projects,[t]:{events:o}}}}function i(t,o){const s=n(t).events,v=s.includes(o)?s.filter(d=>d!==o):[...s,o];c(t,v)}function r(t){return n(t).events.length>0}function u(t,o){return n(t).events.includes(o)}function f(){return Object.values(e.value.projects).some(t=>t.events.length>0)}return{getProject:n,setEvents:c,toggleEvent:i,isSubscribed:r,isEventSubscribed:u,hasAnySubscription:f,stored:e}}export{O as u};
1
+ import{u as b}from"./BbS6Bwby.js";import{h as j,bR as m}from"./DHltYerF.js";const g="piwi-browser-notify";function a(){return{projects:{}}}function y(e){try{const n=JSON.parse(e);if(typeof n!="object"||n===null)return a();const c={};if(n.projects&&typeof n.projects=="object")for(const[i,r]of Object.entries(n.projects)){const u=Number(i);Number.isNaN(u)||r&&typeof r=="object"&&Array.isArray(r.events)&&(c[u]={events:r.events.filter(f=>typeof f=="string")})}return{projects:c}}catch{return a()}}const h=m(!0);let l=null,p=null;function S(){p||h.run(()=>{l=b(g,{default:()=>"",maxAge:3600*24*365,sameSite:"lax",path:"/",secure:location.protocol==="https:",encode:e=>encodeURIComponent(e),decode:e=>decodeURIComponent(e)}),p=j({get:()=>{const e=l.value;return e?y(e):a()},set:e=>{l.value=JSON.stringify(e)}})})}function O(){S();const e=p;function n(t){return e.value.projects[t]??{events:[]}}function c(t,o){if(o.length===0){const s={...e.value};delete s.projects[t],e.value=s}else e.value={...e.value,projects:{...e.value.projects,[t]:{events:o}}}}function i(t,o){const s=n(t).events,v=s.includes(o)?s.filter(d=>d!==o):[...s,o];c(t,v)}function r(t){return n(t).events.length>0}function u(t,o){return n(t).events.includes(o)}function f(){return Object.values(e.value.projects).some(t=>t.events.length>0)}return{getProject:n,setEvents:c,toggleEvent:i,isSubscribed:r,isEventSubscribed:u,hasAnySubscription:f,stored:e}}export{O as u};
@@ -0,0 +1 @@
1
+ import{h as e,a9 as r,bV as t}from"./DHltYerF.js";function a(o){return e(()=>r(o)?!!t(o)?.closest("form"):!0)}export{a as u};
@@ -1 +1 @@
1
- import{d as n,o as s,c as o,j as c,v as r,i as l,t as i,T as d,p as m}from"./D3SYPlEB.js";const _={class:"text-sm text-red-500"},p=n({__name:"ErrorState",props:{text:{},icon:{default:"i-lucide-circle-alert"},padded:{type:Boolean,default:!0}},setup(e){return(t,u)=>{const a=r;return s(),o("div",{role:"alert",class:m(["flex flex-col items-center justify-center gap-2 text-center",e.padded&&"p-4"])},[c(a,{name:e.icon,class:"size-5 text-red-400"},null,8,["name"]),l("p",_,i(e.text),1),d(t.$slots,"action")],2)}}}),f=Object.assign(p,{__name:"ErrorState"});export{f as _};
1
+ import{d as n,o as s,c as o,j as c,v as r,i as l,t as i,T as d,p as m}from"./DHltYerF.js";const _={class:"text-sm text-red-500"},p=n({__name:"ErrorState",props:{text:{},icon:{default:"i-lucide-circle-alert"},padded:{type:Boolean,default:!0}},setup(e){return(t,u)=>{const a=r;return s(),o("div",{role:"alert",class:m(["flex flex-col items-center justify-center gap-2 text-center",e.padded&&"p-4"])},[c(a,{name:e.icon,class:"size-5 text-red-400"},null,8,["name"]),l("p",_,i(e.text),1),d(t.$slots,"action")],2)}}}),f=Object.assign(p,{__name:"ErrorState"});export{f as _};
@@ -1 +1 @@
1
- import{_ as m}from"./DRE6Aqqp.js";import{d,o as t,c as r,O as l,i as n,j as s,t as a,s as x,g as k,m as u,q as o}from"./D3SYPlEB.js";const g={class:"p-2 text-sm text-gray-900 dark:text-gray-100 space-y-1"},_={class:"text-xs text-muted"},y={key:0,class:"text-xs"},h={key:1,class:"text-xs text-muted"},p=d({__name:"ChartMarkerTooltip",props:{marker:{},pos:{}},setup(e){return(f,v)=>{const c=m,i=x;return e.marker?(t(),r("div",{key:0,class:"fixed z-50 pointer-events-none bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 max-w-[260px]",style:l({left:`${e.pos.x}px`,top:`${e.pos.y}px`})},[n("div",g,[s(c,{marker:e.marker},null,8,["marker"]),n("div",_,a(new Date(e.marker.occurredAt).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})),1),e.marker.environment?(t(),r("div",y,[s(i,{color:"neutral",variant:"subtle",size:"xs"},{default:k(()=>[u(a(e.marker.environment),1)]),_:1})])):o("",!0),e.marker.description?(t(),r("p",h,a(e.marker.description),1)):o("",!0)])],4)):o("",!0)}}}),B=Object.assign(p,{__name:"ChartMarkerTooltip"});export{B as _};
1
+ import{_ as m}from"./BlA8mIS-.js";import{d,o as t,c as r,O as l,i as n,j as s,t as a,s as x,g as k,m as u,q as o}from"./DHltYerF.js";const g={class:"p-2 text-sm text-gray-900 dark:text-gray-100 space-y-1"},_={class:"text-xs text-muted"},y={key:0,class:"text-xs"},h={key:1,class:"text-xs text-muted"},p=d({__name:"ChartMarkerTooltip",props:{marker:{},pos:{}},setup(e){return(f,v)=>{const c=m,i=x;return e.marker?(t(),r("div",{key:0,class:"fixed z-50 pointer-events-none bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 max-w-[260px]",style:l({left:`${e.pos.x}px`,top:`${e.pos.y}px`})},[n("div",g,[s(c,{marker:e.marker},null,8,["marker"]),n("div",_,a(new Date(e.marker.occurredAt).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})),1),e.marker.environment?(t(),r("div",y,[s(i,{color:"neutral",variant:"subtle",size:"xs"},{default:k(()=>[u(a(e.marker.environment),1)]),_:1})])):o("",!0),e.marker.description?(t(),r("p",h,a(e.marker.description),1)):o("",!0)])],4)):o("",!0)}}}),B=Object.assign(p,{__name:"ChartMarkerTooltip"});export{B as _};
@@ -1 +1 @@
1
- import{a as B}from"./BAaSmp8J.js";import{d as $,o,c as w,j as m,aa as x,y as N,g as d,T as _,Z as y,$ as S,i as u,k as s,f as p,_ as U,q as h,m as V,t as z,F as C,h as c,ao as P,v as j}from"./D3SYPlEB.js";const q={class:"flex min-w-0 items-center gap-1 sm:hidden"},D={class:"truncate text-sm font-medium"},F=$({__name:"BreadcrumbNav",props:{items:{}},setup(t){const n=t,a=c(()=>n.items[n.items.length-1]),i=c(()=>n.items.slice(0,-1).map(e=>({label:typeof e.label=="string"?e.label:String(e.label??""),icon:e.icon,to:e.to}))),r=c(()=>i.value.length>0);return(e,I)=>{const f=B,g=U,b=P,v=j;return o(),w(C,null,[m(f,{items:t.items,class:"hidden min-w-0 sm:flex"},x({_:2},[N(e.$slots,(T,l)=>({name:l,fn:d(k=>[_(e.$slots,l,y(S(k??{})))])}))]),1032,["items"]),u("div",q,[s(r)?(o(),p(b,{key:0,items:s(i),content:{align:"start",collisionPadding:12}},{default:d(()=>[m(g,{icon:t.items[0]?.icon||"i-lucide-ellipsis","trailing-icon":"i-lucide-chevron-down",color:"neutral",variant:"ghost",size:"sm",square:"","aria-label":"Show navigation path",class:"shrink-0"},null,8,["icon"])]),_:1},8,["items"])):h("",!0),s(r)?(o(),p(v,{key:1,name:"i-lucide-chevron-right",class:"size-4 shrink-0 text-muted"})):h("",!0),u("span",D,[_(e.$slots,s(a)?.slot||"current",{item:s(a)},()=>[V(z(s(a)?.label),1)])])])],64)}}}),L=Object.assign(F,{__name:"BreadcrumbNav"});export{L as _};
1
+ import{a as B}from"./B4jvLMfS.js";import{d as $,o,c as w,j as m,aa as x,y as N,g as d,T as _,Z as y,$ as S,i as u,k as s,f as p,_ as U,q as h,m as V,t as z,F as C,h as c,ao as P,v as j}from"./DHltYerF.js";const q={class:"flex min-w-0 items-center gap-1 sm:hidden"},D={class:"truncate text-sm font-medium"},F=$({__name:"BreadcrumbNav",props:{items:{}},setup(t){const n=t,a=c(()=>n.items[n.items.length-1]),i=c(()=>n.items.slice(0,-1).map(e=>({label:typeof e.label=="string"?e.label:String(e.label??""),icon:e.icon,to:e.to}))),r=c(()=>i.value.length>0);return(e,I)=>{const f=B,g=U,b=P,v=j;return o(),w(C,null,[m(f,{items:t.items,class:"hidden min-w-0 sm:flex"},x({_:2},[N(e.$slots,(T,l)=>({name:l,fn:d(k=>[_(e.$slots,l,y(S(k??{})))])}))]),1032,["items"]),u("div",q,[s(r)?(o(),p(b,{key:0,items:s(i),content:{align:"start",collisionPadding:12}},{default:d(()=>[m(g,{icon:t.items[0]?.icon||"i-lucide-ellipsis","trailing-icon":"i-lucide-chevron-down",color:"neutral",variant:"ghost",size:"sm",square:"","aria-label":"Show navigation path",class:"shrink-0"},null,8,["icon"])]),_:1},8,["items"])):h("",!0),s(r)?(o(),p(v,{key:1,name:"i-lucide-chevron-right",class:"size-4 shrink-0 text-muted"})):h("",!0),u("span",D,[_(e.$slots,s(a)?.slot||"current",{item:s(a)},()=>[V(z(s(a)?.label),1)])])])],64)}}}),L=Object.assign(F,{__name:"BreadcrumbNav"});export{L as _};
@@ -1 +1 @@
1
- import{d as S,o as v,c as h,k as t,F as J,i as x,p as V,T as E,m as l,t as K,j as n,v as A,f as L,g as a,_ as T,q,l as F,h as y,r as U,G as M,E as R}from"./D3SYPlEB.js";import{_ as G}from"./DB3ljns7.js";import{u as H}from"./wQZj69OY.js";import{u as Q}from"./D3MWm6JP.js";function W(i){let o=i,u=null,j=null;const k=i.lastIndexOf(":");if(k>0){const m=i.slice(k+1);if(/^\d+$/.test(m)){const c=i.slice(0,k),b=c.lastIndexOf(":");if(b>0){const g=c.slice(b+1);/^\d+$/.test(g)?(j=parseInt(m,10),u=parseInt(g,10),o=c.slice(0,b)):(u=parseInt(m,10),o=c)}else u=parseInt(m,10),o=c}}return{filePath:o,line:u,column:j}}const X={class:"group/ide inline-flex items-center gap-1 min-w-0 max-w-full align-middle"},Y=["title","aria-label"],Z={type:"button",class:"shrink-0 inline-flex items-center rounded p-0.5 text-muted cursor-pointer transition-colors hover:bg-elevated/60 hover:text-default","aria-label":"Choose how to open in IDE",title:"Choose how to open"},ee={class:"w-56 p-1 space-y-0.5"},te=S({__name:"OpenInIdeLink",props:{filePath:{},line:{default:null},column:{default:null},location:{},projectKey:{},projectName:{},mono:{type:Boolean,default:!0}},setup(i){const o=i,{openInIde:u,openInVscode:j,openViaJetbrainsUrl:k,openViaJetbrainsHttp:m,resolveAbsPath:c,openSettings:b}=H(),{copy:g}=Q(),P=y(()=>o.filePath?{filePath:o.filePath,line:o.line??null,column:o.column??null}:o.location?W(o.location):{filePath:"",line:null,column:null}),f=y(()=>P.value.filePath),w=y(()=>P.value.line),I=y(()=>w.value?`${f.value}:${w.value}`:f.value),O=y(()=>c(f.value,o.projectKey)),r=y(()=>({filePath:f.value,line:w.value,column:P.value.column,projectKey:o.projectKey??null,projectName:o.projectName??null})),C=U(!1),N=U(!1);function _(){N.value=!0,M(()=>{C.value=!0})}function p($){C.value=!1,$()}return($,e)=>{const z=A,d=T,B=G,D=R;return v(),h("span",X,[t(f)?(v(),h(J,{key:0},[x("button",{type:"button",class:"inline-flex items-center gap-1 min-w-0 max-w-full cursor-pointer text-left",title:`Open ${t(I)} in IDE`,"aria-label":`Open ${t(I)} in IDE`,onClick:e[0]||(e[0]=s=>t(u)(t(r)))},[x("span",{class:V([i.mono?"font-mono":"","truncate underline decoration-dashed decoration-1 underline-offset-2 decoration-gray-400/70 dark:decoration-gray-500/70 transition-colors group-hover/ide:decoration-current"])},[E($.$slots,"default",{},()=>[l(K(t(I)),1)])],2),n(z,{name:"i-lucide-external-link",class:"size-3 shrink-0 opacity-0 transition-opacity group-hover/ide:opacity-100"})],8,Y),t(N)?(v(),L(D,{key:1,open:t(C),"onUpdate:open":e[8]||(e[8]=s=>F(C)?C.value=s:null)},{content:a(()=>[x("div",ee,[e[16]||(e[16]=x("p",{class:"text-xs font-medium text-muted px-2 pt-1 pb-1"},"Open in IDE",-1)),n(d,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-wand-sparkles",onClick:e[1]||(e[1]=s=>p(()=>t(u)({...t(r),method:"auto"})))},{default:a(()=>[...e[9]||(e[9]=[l(" Auto (try all) ",-1)])]),_:1}),n(d,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-code",onClick:e[2]||(e[2]=s=>p(()=>t(j)(t(r))))},{default:a(()=>[...e[10]||(e[10]=[l(" Open in VS Code ",-1)])]),_:1}),n(d,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-square-code",onClick:e[3]||(e[3]=s=>p(()=>t(k)(t(r))))},{default:a(()=>[...e[11]||(e[11]=[l(" JetBrains (URL) ",-1)])]),_:1}),n(d,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-server",onClick:e[4]||(e[4]=s=>p(()=>t(m)(t(r))))},{default:a(()=>[...e[12]||(e[12]=[l(" JetBrains (local server) ",-1)])]),_:1}),n(B,{class:"my-1"}),n(d,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-clipboard",onClick:e[5]||(e[5]=s=>p(()=>t(g)(t(f),{toast:"Path copied"})))},{default:a(()=>[...e[13]||(e[13]=[l(" Copy path ",-1)])]),_:1}),t(O)?(v(),L(d,{key:0,block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-clipboard-check",onClick:e[6]||(e[6]=s=>p(()=>t(g)(t(O),{toast:"Absolute path copied"})))},{default:a(()=>[...e[14]||(e[14]=[l(" Copy absolute path ",-1)])]),_:1})):q("",!0),n(B,{class:"my-1"}),n(d,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-settings",onClick:e[7]||(e[7]=s=>p(()=>t(b)({projectKey:t(r).projectKey?String(t(r).projectKey):null,projectName:t(r).projectName})))},{default:a(()=>[...e[15]||(e[15]=[l(" Configure… ",-1)])]),_:1})])]),default:a(()=>[x("button",Z,[n(z,{name:"i-lucide-chevron-down",class:"size-3.5"})])]),_:1},8,["open"])):(v(),h("button",{key:0,type:"button",class:"shrink-0 inline-flex items-center rounded p-0.5 text-muted cursor-pointer transition-opacity hover:bg-elevated/60 hover:text-default opacity-100 sm:opacity-0 sm:group-hover/ide:opacity-100 focus-visible:opacity-100","aria-label":"Choose how to open in IDE",title:"Choose how to open",onClick:_},[n(z,{name:"i-lucide-chevron-down",class:"size-3.5"})]))],64)):(v(),h("span",{key:1,class:V([i.mono?"font-mono":"","truncate"])},[E($.$slots,"default",{},()=>[l(K(t(I)),1)])],2))])}}}),ae=Object.assign(te,{__name:"OpenInIdeLink"});export{ae as _};
1
+ import{d as S,o as v,c as h,k as t,F as J,i as x,p as V,T as E,m as l,t as K,j as n,v as A,f as L,g as a,_ as T,q,l as F,h as y,r as U,G as M,E as R}from"./DHltYerF.js";import{_ as G}from"./BUXSUkJ_.js";import{u as H}from"./Df7kUO0m.js";import{u as Q}from"./By4YL7mx.js";function W(i){let o=i,u=null,j=null;const k=i.lastIndexOf(":");if(k>0){const m=i.slice(k+1);if(/^\d+$/.test(m)){const c=i.slice(0,k),b=c.lastIndexOf(":");if(b>0){const g=c.slice(b+1);/^\d+$/.test(g)?(j=parseInt(m,10),u=parseInt(g,10),o=c.slice(0,b)):(u=parseInt(m,10),o=c)}else u=parseInt(m,10),o=c}}return{filePath:o,line:u,column:j}}const X={class:"group/ide inline-flex items-center gap-1 min-w-0 max-w-full align-middle"},Y=["title","aria-label"],Z={type:"button",class:"shrink-0 inline-flex items-center rounded p-0.5 text-muted cursor-pointer transition-colors hover:bg-elevated/60 hover:text-default","aria-label":"Choose how to open in IDE",title:"Choose how to open"},ee={class:"w-56 p-1 space-y-0.5"},te=S({__name:"OpenInIdeLink",props:{filePath:{},line:{default:null},column:{default:null},location:{},projectKey:{},projectName:{},mono:{type:Boolean,default:!0}},setup(i){const o=i,{openInIde:u,openInVscode:j,openViaJetbrainsUrl:k,openViaJetbrainsHttp:m,resolveAbsPath:c,openSettings:b}=H(),{copy:g}=Q(),P=y(()=>o.filePath?{filePath:o.filePath,line:o.line??null,column:o.column??null}:o.location?W(o.location):{filePath:"",line:null,column:null}),f=y(()=>P.value.filePath),w=y(()=>P.value.line),I=y(()=>w.value?`${f.value}:${w.value}`:f.value),O=y(()=>c(f.value,o.projectKey)),r=y(()=>({filePath:f.value,line:w.value,column:P.value.column,projectKey:o.projectKey??null,projectName:o.projectName??null})),C=U(!1),N=U(!1);function _(){N.value=!0,M(()=>{C.value=!0})}function p($){C.value=!1,$()}return($,e)=>{const z=A,d=T,B=G,D=R;return v(),h("span",X,[t(f)?(v(),h(J,{key:0},[x("button",{type:"button",class:"inline-flex items-center gap-1 min-w-0 max-w-full cursor-pointer text-left",title:`Open ${t(I)} in IDE`,"aria-label":`Open ${t(I)} in IDE`,onClick:e[0]||(e[0]=s=>t(u)(t(r)))},[x("span",{class:V([i.mono?"font-mono":"","truncate underline decoration-dashed decoration-1 underline-offset-2 decoration-gray-400/70 dark:decoration-gray-500/70 transition-colors group-hover/ide:decoration-current"])},[E($.$slots,"default",{},()=>[l(K(t(I)),1)])],2),n(z,{name:"i-lucide-external-link",class:"size-3 shrink-0 opacity-0 transition-opacity group-hover/ide:opacity-100"})],8,Y),t(N)?(v(),L(D,{key:1,open:t(C),"onUpdate:open":e[8]||(e[8]=s=>F(C)?C.value=s:null)},{content:a(()=>[x("div",ee,[e[16]||(e[16]=x("p",{class:"text-xs font-medium text-muted px-2 pt-1 pb-1"},"Open in IDE",-1)),n(d,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-wand-sparkles",onClick:e[1]||(e[1]=s=>p(()=>t(u)({...t(r),method:"auto"})))},{default:a(()=>[...e[9]||(e[9]=[l(" Auto (try all) ",-1)])]),_:1}),n(d,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-code",onClick:e[2]||(e[2]=s=>p(()=>t(j)(t(r))))},{default:a(()=>[...e[10]||(e[10]=[l(" Open in VS Code ",-1)])]),_:1}),n(d,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-square-code",onClick:e[3]||(e[3]=s=>p(()=>t(k)(t(r))))},{default:a(()=>[...e[11]||(e[11]=[l(" JetBrains (URL) ",-1)])]),_:1}),n(d,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-server",onClick:e[4]||(e[4]=s=>p(()=>t(m)(t(r))))},{default:a(()=>[...e[12]||(e[12]=[l(" JetBrains (local server) ",-1)])]),_:1}),n(B,{class:"my-1"}),n(d,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-clipboard",onClick:e[5]||(e[5]=s=>p(()=>t(g)(t(f),{toast:"Path copied"})))},{default:a(()=>[...e[13]||(e[13]=[l(" Copy path ",-1)])]),_:1}),t(O)?(v(),L(d,{key:0,block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-clipboard-check",onClick:e[6]||(e[6]=s=>p(()=>t(g)(t(O),{toast:"Absolute path copied"})))},{default:a(()=>[...e[14]||(e[14]=[l(" Copy absolute path ",-1)])]),_:1})):q("",!0),n(B,{class:"my-1"}),n(d,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-settings",onClick:e[7]||(e[7]=s=>p(()=>t(b)({projectKey:t(r).projectKey?String(t(r).projectKey):null,projectName:t(r).projectName})))},{default:a(()=>[...e[15]||(e[15]=[l(" Configure… ",-1)])]),_:1})])]),default:a(()=>[x("button",Z,[n(z,{name:"i-lucide-chevron-down",class:"size-3.5"})])]),_:1},8,["open"])):(v(),h("button",{key:0,type:"button",class:"shrink-0 inline-flex items-center rounded p-0.5 text-muted cursor-pointer transition-opacity hover:bg-elevated/60 hover:text-default opacity-100 sm:opacity-0 sm:group-hover/ide:opacity-100 focus-visible:opacity-100","aria-label":"Choose how to open in IDE",title:"Choose how to open",onClick:_},[n(z,{name:"i-lucide-chevron-down",class:"size-3.5"})]))],64)):(v(),h("span",{key:1,class:V([i.mono?"font-mono":"","truncate"])},[E($.$slots,"default",{},()=>[l(K(t(I)),1)])],2))])}}}),ae=Object.assign(te,{__name:"OpenInIdeLink"});export{ae as _};
@@ -1 +1 @@
1
- import{d as T,o as r,c as x,j as p,k as a,v as U,t as E,q as b,i as k,f as _,g as y,m as L,_ as j,h as w,s as N,r as h,B as O,F as D,y as S,H as Z,D as R,l as C,E as H}from"./D3SYPlEB.js";import{u as M}from"./D3MWm6JP.js";const G=[{provider:"jira",tests:[/^https:\/\/([^./]+)\.atlassian\.net\/browse\//i,/^https:\/\/[^/]+\/jira\/software\/c\/projects\//i,/^https:\/\/[^/]+\/.+\/browse\//i],keyExtract:/\/([A-Z][A-Z0-9_]+-\d+)(?:\?|$|#)/i},{provider:"github-issue",tests:[/^https:\/\/github\.com\/[^/]+\/[^/]+\/issues\//i],keyExtract:/\/issues\/(\d+)/},{provider:"github-pr",tests:[/^https:\/\/github\.com\/[^/]+\/[^/]+\/pull\//i],keyExtract:/\/pull\/(\d+)/},{provider:"gitlab-issue",tests:[/^https:\/\/(gitlab\.[^/]+|[^/]+\.gitlab\.io)\/[^/]+\/[^/]+\/-\/issues\//i],keyExtract:/\/issues\/(\d+)/},{provider:"gitlab-mr",tests:[/^https:\/\/(gitlab\.[^/]+|[^/]+\.gitlab\.io)\/[^/]+\/[^/]+\/-\/merge_requests\//i],keyExtract:/\/merge_requests\/(\d+)/},{provider:"bitbucket",tests:[/^https:\/\/bitbucket\.org\/[^/]+\/[^/]+\/pull-requests\//i],keyExtract:/\/pull-requests\/(\d+)/},{provider:"confluence",tests:[/^https:\/\/([^./]+)\.atlassian\.net\/wiki\//i]},{provider:"slack",tests:[/^https:\/\/[^/]+\.slack\.com\//i]},{provider:"linear",tests:[/^https:\/\/linear\.app\//i],keyExtract:/\/([A-Za-z]+-\d+)(?:\/|\?|$|#)/},{provider:"notion",tests:[/^https:\/\/(www\.)?notion\.so\//i]}];function J(t){for(const c of G)if(c.tests.some(e=>e.test(t)))return c.provider;return"generic"}function B(t){return{jira:"i-simple-icons-jira","github-issue":"i-simple-icons-github","github-pr":"i-simple-icons-github","gitlab-issue":"i-simple-icons-gitlab","gitlab-mr":"i-simple-icons-gitlab",bitbucket:"i-simple-icons-bitbucket",confluence:"i-simple-icons-confluence",slack:"i-simple-icons-slack",linear:"i-simple-icons-linear",notion:"i-simple-icons-notion",generic:"i-lucide-link"}[t]}const K={class:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 group hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors"},Q={key:0,class:"font-mono text-primary font-medium"},W=["title"],X=T({__name:"LinkChip",props:{link:{},removable:{type:Boolean}},emits:["remove"],setup(t,{emit:c}){const e=t,v=c,g=w(()=>e.link.title||e.link.key||e.link.url.replace(/^https?:\/\//,"").slice(0,50)),o=w(()=>B(e.link.provider));return(s,l)=>{const d=U,f=N,m=j;return r(),x("span",K,[p(d,{name:a(o),class:"w-3.5 h-3.5 shrink-0"},null,8,["name"]),t.link.key?(r(),x("span",Q,E(t.link.key),1)):b("",!0),k("span",{class:"max-w-48 truncate",title:t.link.title||t.link.url},E(a(g)),9,W),t.link.statusText?(r(),_(f,{key:1,color:t.link.statusColor||"neutral",variant:"subtle",size:"xs"},{default:y(()=>[L(E(t.link.statusText),1)]),_:1},8,["color"])):b("",!0),p(m,{to:t.link.url,target:"_blank",size:"xs",variant:"ghost",color:"neutral",icon:"i-lucide-external-link",class:"opacity-0 group-hover:opacity-100 transition-opacity -my-1"},null,8,["to"]),t.removable?(r(),_(m,{key:2,size:"xs",variant:"ghost",color:"error",icon:"i-lucide-x",class:"opacity-0 group-hover:opacity-100 transition-opacity -my-1",onClick:l[0]||(l[0]=I=>v("remove",t.link.id))})):b("",!0)])}}}),Y=Object.assign(X,{__name:"LinkChip"}),tt={class:"flex flex-wrap items-center gap-1.5"},et={class:"relative"},it={class:"flex justify-end gap-2"},st=T({__name:"EntityLinks",props:{entityType:{},entityId:{},links:{}},emits:["updated"],setup(t,{emit:c}){const e=t,v=c,{copy:g}=M(),o=h(e.links??[]),s=h(""),l=h(!1),d=h(!1),f=w(()=>{try{return s.value?J(s.value):null}catch{return null}}),m=w(()=>f.value?B(f.value):null);async function I(){const n=await $fetch("/api/links",{params:{entityType:e.entityType,entityId:e.entityId}});o.value=n.links}async function z(){if(!(!s.value||d.value)){d.value=!0;try{const n=await $fetch("/api/links",{method:"POST",body:{entityType:e.entityType,entityId:e.entityId,url:s.value}});o.value.push(n.link),s.value="",l.value=!1,v("updated")}catch(n){g(n?.data?.message||"Failed to add link",{toast:!0})}finally{d.value=!1}}}async function V(n){try{await $fetch(`/api/links/${n}`,{method:"DELETE"}),o.value=o.value.filter(i=>i.id!==n),v("updated")}catch{g("Failed to remove link",{toast:!0})}}return O(()=>[e.entityType,e.entityId],()=>{e.links?o.value=e.links:I()},{immediate:!0}),(n,i)=>{const A=Y,$=j,P=R,q=U,F=H;return r(),x("div",tt,[(r(!0),x(D,null,S(a(o),u=>(r(),_(A,{key:u.id,link:u,removable:"",onRemove:V},null,8,["link"]))),128)),p(F,{open:a(l),"onUpdate:open":i[2]||(i[2]=u=>C(l)?l.value=u:null)},{content:y(()=>[k("form",{class:"p-3 space-y-3 min-w-72",onSubmit:Z(z,["prevent"])},[i[5]||(i[5]=k("p",{class:"text-sm font-medium"},"Add link",-1)),k("div",et,[p(P,{modelValue:a(s),"onUpdate:modelValue":i[0]||(i[0]=u=>C(s)?s.value=u:null),placeholder:"https://...",size:"sm",class:"w-full",autofocus:""},null,8,["modelValue"]),a(m)?(r(),_(q,{key:0,name:a(m),class:"absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"},null,8,["name"])):b("",!0)]),k("div",it,[p($,{size:"xs",variant:"ghost",color:"neutral",onClick:i[1]||(i[1]=u=>l.value=!1)},{default:y(()=>[...i[3]||(i[3]=[L(" Cancel ",-1)])]),_:1}),p($,{size:"xs",color:"primary",type:"submit",loading:a(d),disabled:!a(s).trim()},{default:y(()=>[...i[4]||(i[4]=[L(" Add ",-1)])]),_:1},8,["loading","disabled"])])],32)]),default:y(()=>[p($,{size:"xs",variant:"ghost",color:"neutral",icon:"i-lucide-plus",class:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",title:"Add link"})]),_:1},8,["open"])])}}}),ot=Object.assign(st,{__name:"EntityLinks"});export{ot as _};
1
+ import{d as T,o as r,c as x,j as p,k as a,v as U,t as E,q as b,i as k,f as _,g as y,m as L,_ as j,h as w,s as N,r as h,B as O,F as D,y as S,H as Z,D as R,l as C,E as H}from"./DHltYerF.js";import{u as M}from"./By4YL7mx.js";const G=[{provider:"jira",tests:[/^https:\/\/([^./]+)\.atlassian\.net\/browse\//i,/^https:\/\/[^/]+\/jira\/software\/c\/projects\//i,/^https:\/\/[^/]+\/.+\/browse\//i],keyExtract:/\/([A-Z][A-Z0-9_]+-\d+)(?:\?|$|#)/i},{provider:"github-issue",tests:[/^https:\/\/github\.com\/[^/]+\/[^/]+\/issues\//i],keyExtract:/\/issues\/(\d+)/},{provider:"github-pr",tests:[/^https:\/\/github\.com\/[^/]+\/[^/]+\/pull\//i],keyExtract:/\/pull\/(\d+)/},{provider:"gitlab-issue",tests:[/^https:\/\/(gitlab\.[^/]+|[^/]+\.gitlab\.io)\/[^/]+\/[^/]+\/-\/issues\//i],keyExtract:/\/issues\/(\d+)/},{provider:"gitlab-mr",tests:[/^https:\/\/(gitlab\.[^/]+|[^/]+\.gitlab\.io)\/[^/]+\/[^/]+\/-\/merge_requests\//i],keyExtract:/\/merge_requests\/(\d+)/},{provider:"bitbucket",tests:[/^https:\/\/bitbucket\.org\/[^/]+\/[^/]+\/pull-requests\//i],keyExtract:/\/pull-requests\/(\d+)/},{provider:"confluence",tests:[/^https:\/\/([^./]+)\.atlassian\.net\/wiki\//i]},{provider:"slack",tests:[/^https:\/\/[^/]+\.slack\.com\//i]},{provider:"linear",tests:[/^https:\/\/linear\.app\//i],keyExtract:/\/([A-Za-z]+-\d+)(?:\/|\?|$|#)/},{provider:"notion",tests:[/^https:\/\/(www\.)?notion\.so\//i]}];function J(t){for(const c of G)if(c.tests.some(e=>e.test(t)))return c.provider;return"generic"}function B(t){return{jira:"i-simple-icons-jira","github-issue":"i-simple-icons-github","github-pr":"i-simple-icons-github","gitlab-issue":"i-simple-icons-gitlab","gitlab-mr":"i-simple-icons-gitlab",bitbucket:"i-simple-icons-bitbucket",confluence:"i-simple-icons-confluence",slack:"i-simple-icons-slack",linear:"i-simple-icons-linear",notion:"i-simple-icons-notion",generic:"i-lucide-link"}[t]}const K={class:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 group hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors"},Q={key:0,class:"font-mono text-primary font-medium"},W=["title"],X=T({__name:"LinkChip",props:{link:{},removable:{type:Boolean}},emits:["remove"],setup(t,{emit:c}){const e=t,v=c,g=w(()=>e.link.title||e.link.key||e.link.url.replace(/^https?:\/\//,"").slice(0,50)),o=w(()=>B(e.link.provider));return(s,l)=>{const d=U,f=N,m=j;return r(),x("span",K,[p(d,{name:a(o),class:"w-3.5 h-3.5 shrink-0"},null,8,["name"]),t.link.key?(r(),x("span",Q,E(t.link.key),1)):b("",!0),k("span",{class:"max-w-48 truncate",title:t.link.title||t.link.url},E(a(g)),9,W),t.link.statusText?(r(),_(f,{key:1,color:t.link.statusColor||"neutral",variant:"subtle",size:"xs"},{default:y(()=>[L(E(t.link.statusText),1)]),_:1},8,["color"])):b("",!0),p(m,{to:t.link.url,target:"_blank",size:"xs",variant:"ghost",color:"neutral",icon:"i-lucide-external-link",class:"opacity-0 group-hover:opacity-100 transition-opacity -my-1"},null,8,["to"]),t.removable?(r(),_(m,{key:2,size:"xs",variant:"ghost",color:"error",icon:"i-lucide-x",class:"opacity-0 group-hover:opacity-100 transition-opacity -my-1",onClick:l[0]||(l[0]=I=>v("remove",t.link.id))})):b("",!0)])}}}),Y=Object.assign(X,{__name:"LinkChip"}),tt={class:"flex flex-wrap items-center gap-1.5"},et={class:"relative"},it={class:"flex justify-end gap-2"},st=T({__name:"EntityLinks",props:{entityType:{},entityId:{},links:{}},emits:["updated"],setup(t,{emit:c}){const e=t,v=c,{copy:g}=M(),o=h(e.links??[]),s=h(""),l=h(!1),d=h(!1),f=w(()=>{try{return s.value?J(s.value):null}catch{return null}}),m=w(()=>f.value?B(f.value):null);async function I(){const n=await $fetch("/api/links",{params:{entityType:e.entityType,entityId:e.entityId}});o.value=n.links}async function z(){if(!(!s.value||d.value)){d.value=!0;try{const n=await $fetch("/api/links",{method:"POST",body:{entityType:e.entityType,entityId:e.entityId,url:s.value}});o.value.push(n.link),s.value="",l.value=!1,v("updated")}catch(n){g(n?.data?.message||"Failed to add link",{toast:!0})}finally{d.value=!1}}}async function V(n){try{await $fetch(`/api/links/${n}`,{method:"DELETE"}),o.value=o.value.filter(i=>i.id!==n),v("updated")}catch{g("Failed to remove link",{toast:!0})}}return O(()=>[e.entityType,e.entityId],()=>{e.links?o.value=e.links:I()},{immediate:!0}),(n,i)=>{const A=Y,$=j,P=R,q=U,F=H;return r(),x("div",tt,[(r(!0),x(D,null,S(a(o),u=>(r(),_(A,{key:u.id,link:u,removable:"",onRemove:V},null,8,["link"]))),128)),p(F,{open:a(l),"onUpdate:open":i[2]||(i[2]=u=>C(l)?l.value=u:null)},{content:y(()=>[k("form",{class:"p-3 space-y-3 min-w-72",onSubmit:Z(z,["prevent"])},[i[5]||(i[5]=k("p",{class:"text-sm font-medium"},"Add link",-1)),k("div",et,[p(P,{modelValue:a(s),"onUpdate:modelValue":i[0]||(i[0]=u=>C(s)?s.value=u:null),placeholder:"https://...",size:"sm",class:"w-full",autofocus:""},null,8,["modelValue"]),a(m)?(r(),_(q,{key:0,name:a(m),class:"absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"},null,8,["name"])):b("",!0)]),k("div",it,[p($,{size:"xs",variant:"ghost",color:"neutral",onClick:i[1]||(i[1]=u=>l.value=!1)},{default:y(()=>[...i[3]||(i[3]=[L(" Cancel ",-1)])]),_:1}),p($,{size:"xs",color:"primary",type:"submit",loading:a(d),disabled:!a(s).trim()},{default:y(()=>[...i[4]||(i[4]=[L(" Add ",-1)])]),_:1},8,["loading","disabled"])])],32)]),default:y(()=>[p($,{size:"xs",variant:"ghost",color:"neutral",icon:"i-lucide-plus",class:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",title:"Add link"})]),_:1},8,["open"])])}}}),ot=Object.assign(st,{__name:"EntityLinks"});export{ot as _};
@@ -1 +1 @@
1
- import{Y as G,d as K,S as L,X as J,aq as T,o as i,c as I,f,g as v,T as C,k as e,U as _,Q as W,H as Z,ae as D,V as $,q as x,F as ee,h as m,a$ as E,aM as P,j as R,aB as ae,a0 as re,a1 as te,a3 as se,a4 as le,a5 as ie,aN as oe,aO as ne,i as de,p as c,v as j,m as N,t as M,a6 as ue}from"./D3SYPlEB.js";import{i as O}from"./va1mwSm9.js";import{u as ce}from"./Cx65B3c3.js";import{u as pe}from"./wgcgHmRR.js";import{V as fe}from"./rm7OkgDG.js";import{R as ve}from"./Do6zIWQf.js";import{L as U}from"./BAkJhSAW.js";const[be]=G("CheckboxGroupRoot");function A(o){return o==="indeterminate"}function H(o){return A(o)?"indeterminate":o?"checked":"unchecked"}const[me,he]=G("CheckboxRoot");var ge=K({inheritAttrs:!1,__name:"CheckboxRoot",props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},value:{type:null,required:!1,default:"on"},id:{type:String,required:!1},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue"],setup(o,{emit:h}){const r=o,l=h,{forwardRef:g,currentElement:a}=L(),s=be(null),d=J(r,"modelValue",l,{defaultValue:r.defaultValue??r.falseValue,passive:r.modelValue===void 0}),p=m(()=>s?.disabled.value||r.disabled),q=m(()=>P(d.value,r.trueValue)),u=m(()=>E(s?.modelValue.value)?d.value==="indeterminate"?"indeterminate":q.value:O(s.modelValue.value,r.value));function z(){if(E(s?.modelValue.value))d.value==="indeterminate"?d.value=r.trueValue:d.value=q.value?r.falseValue:r.trueValue;else{const t=[...s.modelValue.value||[]];if(O(t,r.value)){const y=t.findIndex(B=>P(B,r.value));t.splice(y,1)}else t.push(r.value);s.modelValue.value=t}}const F=ce(a),k=pe(),S=T(),V=m(()=>{if(!S["aria-label"])return r.id&&a.value?document.querySelector(`[for="${r.id}"]`)?.innerText:void 0});return he({disabled:p,state:u}),(t,y)=>(i(),I(ee,null,[(i(),f(D(e(s)?.rovingFocus.value?e(ve):e($)),_({...t.$attrs,...e(k)},{id:t.id,ref:e(g),role:"checkbox","as-child":t.asChild,as:t.as,type:t.as==="button"?"button":void 0,"aria-checked":e(A)(u.value)?"mixed":u.value,"aria-required":t.required,"aria-label":t.$attrs["aria-label"]||V.value,"data-state":e(H)(u.value),"data-disabled":p.value?"":void 0,disabled:p.value,focusable:e(s)?.rovingFocus.value?!p.value:void 0,onKeydown:W(Z(()=>{},["prevent"]),["enter"]),onClick:z}),{default:v(()=>[C(t.$slots,"default",{modelValue:e(d),state:u.value})]),_:3},16,["id","as-child","as","type","aria-checked","aria-required","aria-label","data-state","data-disabled","disabled","focusable","onKeydown"])),e(F)&&t.name&&!e(s)?(i(),f(e(fe),_({key:0,type:"checkbox",checked:!!u.value,name:t.name,value:t.value,disabled:p.value,required:t.required},e(k)),null,16,["checked","name","value","disabled","required"])):x("v-if",!0)],64))}}),ye=ge,qe=K({__name:"CheckboxIndicator",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(o){const{forwardRef:h}=L(),r=me();return(l,g)=>(i(),f(e(ae),{present:l.forceMount||e(A)(e(r).state.value)||e(r).state.value===!0},{default:v(()=>[R(e($),_({ref:e(h),"data-state":e(H)(e(r).state.value),"data-disabled":e(r).disabled.value?"":void 0,style:{pointerEvents:"none"},"as-child":l.asChild,as:l.as},l.$attrs),{default:v(()=>[C(l.$slots,"default")]),_:3},16,["data-state","data-disabled","as-child","as"])]),_:3},8,["present"]))}}),ke=qe;const Ve={slots:{root:"relative flex items-start",container:"flex items-center",base:"rounded-sm ring ring-inset ring-accented overflow-hidden focus-visible:outline-3",indicator:"flex items-center justify-center size-full text-inverted",icon:"shrink-0 size-full",wrapper:"w-full",label:"block font-medium text-default",description:"text-muted"},variants:{color:{primary:{base:"outline-primary/25 focus-visible:ring-primary",indicator:"bg-primary"},secondary:{base:"outline-secondary/25 focus-visible:ring-secondary",indicator:"bg-secondary"},success:{base:"outline-success/25 focus-visible:ring-success",indicator:"bg-success"},info:{base:"outline-info/25 focus-visible:ring-info",indicator:"bg-info"},warning:{base:"outline-warning/25 focus-visible:ring-warning",indicator:"bg-warning"},error:{base:"outline-error/25 focus-visible:ring-error",indicator:"bg-error"},neutral:{base:"outline-inverted/25 focus-visible:ring-inverted",indicator:"bg-inverted"}},variant:{list:{root:""},card:{root:"border border-muted rounded-lg"}},indicator:{start:{root:"flex-row",wrapper:"ms-2"},end:{root:"flex-row-reverse",wrapper:"me-2"},hidden:{base:"sr-only",wrapper:"text-center"}},size:{xs:{base:"size-3",container:"h-4",wrapper:"text-xs"},sm:{base:"size-3.5",container:"h-4",wrapper:"text-xs"},md:{base:"size-4",container:"h-5",wrapper:"text-sm"},lg:{base:"size-4.5",container:"h-5",wrapper:"text-sm"},xl:{base:"size-5",container:"h-6",wrapper:"text-base"}},required:{true:{label:"after:content-['*'] after:ms-0.5 after:text-error"}},disabled:{true:{root:"opacity-75",base:"cursor-not-allowed",label:"cursor-not-allowed",description:"cursor-not-allowed"}},highlight:{true:""},checked:{true:""}},compoundVariants:[{size:"xs",variant:"card",class:{root:"p-2.5"}},{size:"sm",variant:"card",class:{root:"p-3"}},{size:"md",variant:"card",class:{root:"p-3.5"}},{size:"lg",variant:"card",class:{root:"p-4"}},{size:"xl",variant:"card",class:{root:"p-4.5"}},{color:"primary",variant:"card",class:{root:"has-data-[state=checked]:border-primary"}},{color:"secondary",variant:"card",class:{root:"has-data-[state=checked]:border-secondary"}},{color:"success",variant:"card",class:{root:"has-data-[state=checked]:border-success"}},{color:"info",variant:"card",class:{root:"has-data-[state=checked]:border-info"}},{color:"warning",variant:"card",class:{root:"has-data-[state=checked]:border-warning"}},{color:"error",variant:"card",class:{root:"has-data-[state=checked]:border-error"}},{color:"neutral",variant:"card",class:{root:"has-data-[state=checked]:border-inverted"}},{variant:"card",disabled:!0,class:{root:"cursor-not-allowed"}},{color:"primary",highlight:!0,class:{base:"ring-primary"}},{color:"secondary",highlight:!0,class:{base:"ring-secondary"}},{color:"success",highlight:!0,class:{base:"ring-success"}},{color:"info",highlight:!0,class:{base:"ring-info"}},{color:"warning",highlight:!0,class:{base:"ring-warning"}},{color:"error",highlight:!0,class:{base:"ring-error"}},{color:"neutral",highlight:!0,class:{base:"ring-inverted"}}],defaultVariants:{size:"md",color:"primary",variant:"list",indicator:"start"}},Be=Object.assign({inheritAttrs:!1},{__name:"UCheckbox",props:{as:{type:null,required:!1},label:{type:String,required:!1},description:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},indicator:{type:null,required:!1},highlight:{type:Boolean,required:!1},icon:{type:null,required:!1},indeterminateIcon:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},disabled:{type:Boolean,required:!1},required:{type:Boolean,required:!1},name:{type:String,required:!1},value:{type:null,required:!1},id:{type:String,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1},trueValue:{type:null,required:!1},falseValue:{type:null,required:!1}},emits:["change","update:modelValue"],setup(o,{emit:h}){const r=o,l=re(),g=h,a=te("checkbox",r),s=se(),d=le(ie(a,"required","value","defaultValue","modelValue","trueValue","falseValue"),g),{id:p,emitFormChange:q,emitFormInput:u,size:z,color:F,highlight:k,name:S,disabled:V,ariaAttrs:t}=oe(r),y=p.value??ne(),B=T(),Q=m(()=>{const{"data-state":b,...w}=B;return w}),n=m(()=>ue({extend:Ve,...s.ui?.checkbox||{}})({size:z.value??a.size,color:F.value??a.color,variant:a.variant,indicator:a.indicator,highlight:k.value??a.highlight,required:a.required,disabled:V.value}));function X(b){const w=new Event("change",{target:{value:b}});g("change",w),q(),u()}return(b,w)=>(i(),f(e($),{as:!e(a).variant||e(a).variant==="list"?e(a).as:e(U),"data-slot":b.$attrs["data-slot"]??"root",class:c(n.value.root({class:[e(a).ui?.root,e(a).class]}))},{default:v(()=>[de("div",{"data-slot":"container",class:c(n.value.container({class:e(a).ui?.container}))},[R(e(ye),_({id:e(y)},{...e(d),...Q.value,...e(t)},{name:e(S),disabled:e(V),"data-slot":"base",class:n.value.base({class:e(a).ui?.base}),"onUpdate:modelValue":X}),{default:v(({state:Y})=>[R(e(ke),{"data-slot":"indicator",class:c(n.value.indicator({class:e(a).ui?.indicator}))},{default:v(()=>[Y==="indeterminate"?(i(),f(j,{key:0,name:e(a).indeterminateIcon||e(s).ui.icons.minus,"data-slot":"icon",class:c(n.value.icon({class:e(a).ui?.icon}))},null,8,["name","class"])):(i(),f(j,{key:1,name:e(a).icon||e(s).ui.icons.check,"data-slot":"icon",class:c(n.value.icon({class:e(a).ui?.icon}))},null,8,["name","class"]))]),_:2},1032,["class"])]),_:1},16,["id","name","disabled","class"])],2),e(a).label||l.label||e(a).description||l.description?(i(),I("div",{key:0,"data-slot":"wrapper",class:c(n.value.wrapper({class:e(a).ui?.wrapper}))},[e(a).label||l.label?(i(),f(D(!e(a).variant||e(a).variant==="list"?e(U):"p"),{key:0,for:e(y),"data-slot":"label",class:c(n.value.label({class:e(a).ui?.label}))},{default:v(()=>[C(b.$slots,"label",{label:e(a).label},()=>[N(M(e(a).label),1)])]),_:3},8,["for","class"])):x("",!0),e(a).description||l.description?(i(),I("p",{key:1,"data-slot":"description",class:c(n.value.description({class:e(a).ui?.description}))},[C(b.$slots,"description",{description:e(a).description},()=>[N(M(e(a).description),1)])],2)):x("",!0)],2)):x("",!0)]),_:3},8,["as","data-slot","class"]))}});export{Be as _};
1
+ import{Y as G,d as K,S as L,X as J,aq as T,o as i,c as I,f,g as v,T as C,k as e,U as _,Q as W,H as Z,ae as D,V as $,q as x,F as ee,h as m,a$ as E,aM as P,j as R,aB as ae,a0 as re,a1 as te,a3 as se,a4 as le,a5 as ie,aN as oe,aO as ne,i as de,p as c,v as j,m as N,t as M,a6 as ue}from"./DHltYerF.js";import{i as O}from"./CPLJeOCb.js";import{u as ce}from"./qH_j2A3a.js";import{u as pe}from"./DkI145a5.js";import{V as fe}from"./CcXaak_K.js";import{R as ve}from"./gnCL8GjZ.js";import{L as U}from"./e7zD3uJ0.js";const[be]=G("CheckboxGroupRoot");function A(o){return o==="indeterminate"}function H(o){return A(o)?"indeterminate":o?"checked":"unchecked"}const[me,he]=G("CheckboxRoot");var ge=K({inheritAttrs:!1,__name:"CheckboxRoot",props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},value:{type:null,required:!1,default:"on"},id:{type:String,required:!1},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue"],setup(o,{emit:h}){const r=o,l=h,{forwardRef:g,currentElement:a}=L(),s=be(null),d=J(r,"modelValue",l,{defaultValue:r.defaultValue??r.falseValue,passive:r.modelValue===void 0}),p=m(()=>s?.disabled.value||r.disabled),q=m(()=>P(d.value,r.trueValue)),u=m(()=>E(s?.modelValue.value)?d.value==="indeterminate"?"indeterminate":q.value:O(s.modelValue.value,r.value));function z(){if(E(s?.modelValue.value))d.value==="indeterminate"?d.value=r.trueValue:d.value=q.value?r.falseValue:r.trueValue;else{const t=[...s.modelValue.value||[]];if(O(t,r.value)){const y=t.findIndex(B=>P(B,r.value));t.splice(y,1)}else t.push(r.value);s.modelValue.value=t}}const F=ce(a),k=pe(),S=T(),V=m(()=>{if(!S["aria-label"])return r.id&&a.value?document.querySelector(`[for="${r.id}"]`)?.innerText:void 0});return he({disabled:p,state:u}),(t,y)=>(i(),I(ee,null,[(i(),f(D(e(s)?.rovingFocus.value?e(ve):e($)),_({...t.$attrs,...e(k)},{id:t.id,ref:e(g),role:"checkbox","as-child":t.asChild,as:t.as,type:t.as==="button"?"button":void 0,"aria-checked":e(A)(u.value)?"mixed":u.value,"aria-required":t.required,"aria-label":t.$attrs["aria-label"]||V.value,"data-state":e(H)(u.value),"data-disabled":p.value?"":void 0,disabled:p.value,focusable:e(s)?.rovingFocus.value?!p.value:void 0,onKeydown:W(Z(()=>{},["prevent"]),["enter"]),onClick:z}),{default:v(()=>[C(t.$slots,"default",{modelValue:e(d),state:u.value})]),_:3},16,["id","as-child","as","type","aria-checked","aria-required","aria-label","data-state","data-disabled","disabled","focusable","onKeydown"])),e(F)&&t.name&&!e(s)?(i(),f(e(fe),_({key:0,type:"checkbox",checked:!!u.value,name:t.name,value:t.value,disabled:p.value,required:t.required},e(k)),null,16,["checked","name","value","disabled","required"])):x("v-if",!0)],64))}}),ye=ge,qe=K({__name:"CheckboxIndicator",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(o){const{forwardRef:h}=L(),r=me();return(l,g)=>(i(),f(e(ae),{present:l.forceMount||e(A)(e(r).state.value)||e(r).state.value===!0},{default:v(()=>[R(e($),_({ref:e(h),"data-state":e(H)(e(r).state.value),"data-disabled":e(r).disabled.value?"":void 0,style:{pointerEvents:"none"},"as-child":l.asChild,as:l.as},l.$attrs),{default:v(()=>[C(l.$slots,"default")]),_:3},16,["data-state","data-disabled","as-child","as"])]),_:3},8,["present"]))}}),ke=qe;const Ve={slots:{root:"relative flex items-start",container:"flex items-center",base:"rounded-sm ring ring-inset ring-accented overflow-hidden focus-visible:outline-3",indicator:"flex items-center justify-center size-full text-inverted",icon:"shrink-0 size-full",wrapper:"w-full",label:"block font-medium text-default",description:"text-muted"},variants:{color:{primary:{base:"outline-primary/25 focus-visible:ring-primary",indicator:"bg-primary"},secondary:{base:"outline-secondary/25 focus-visible:ring-secondary",indicator:"bg-secondary"},success:{base:"outline-success/25 focus-visible:ring-success",indicator:"bg-success"},info:{base:"outline-info/25 focus-visible:ring-info",indicator:"bg-info"},warning:{base:"outline-warning/25 focus-visible:ring-warning",indicator:"bg-warning"},error:{base:"outline-error/25 focus-visible:ring-error",indicator:"bg-error"},neutral:{base:"outline-inverted/25 focus-visible:ring-inverted",indicator:"bg-inverted"}},variant:{list:{root:""},card:{root:"border border-muted rounded-lg"}},indicator:{start:{root:"flex-row",wrapper:"ms-2"},end:{root:"flex-row-reverse",wrapper:"me-2"},hidden:{base:"sr-only",wrapper:"text-center"}},size:{xs:{base:"size-3",container:"h-4",wrapper:"text-xs"},sm:{base:"size-3.5",container:"h-4",wrapper:"text-xs"},md:{base:"size-4",container:"h-5",wrapper:"text-sm"},lg:{base:"size-4.5",container:"h-5",wrapper:"text-sm"},xl:{base:"size-5",container:"h-6",wrapper:"text-base"}},required:{true:{label:"after:content-['*'] after:ms-0.5 after:text-error"}},disabled:{true:{root:"opacity-75",base:"cursor-not-allowed",label:"cursor-not-allowed",description:"cursor-not-allowed"}},highlight:{true:""},checked:{true:""}},compoundVariants:[{size:"xs",variant:"card",class:{root:"p-2.5"}},{size:"sm",variant:"card",class:{root:"p-3"}},{size:"md",variant:"card",class:{root:"p-3.5"}},{size:"lg",variant:"card",class:{root:"p-4"}},{size:"xl",variant:"card",class:{root:"p-4.5"}},{color:"primary",variant:"card",class:{root:"has-data-[state=checked]:border-primary"}},{color:"secondary",variant:"card",class:{root:"has-data-[state=checked]:border-secondary"}},{color:"success",variant:"card",class:{root:"has-data-[state=checked]:border-success"}},{color:"info",variant:"card",class:{root:"has-data-[state=checked]:border-info"}},{color:"warning",variant:"card",class:{root:"has-data-[state=checked]:border-warning"}},{color:"error",variant:"card",class:{root:"has-data-[state=checked]:border-error"}},{color:"neutral",variant:"card",class:{root:"has-data-[state=checked]:border-inverted"}},{variant:"card",disabled:!0,class:{root:"cursor-not-allowed"}},{color:"primary",highlight:!0,class:{base:"ring-primary"}},{color:"secondary",highlight:!0,class:{base:"ring-secondary"}},{color:"success",highlight:!0,class:{base:"ring-success"}},{color:"info",highlight:!0,class:{base:"ring-info"}},{color:"warning",highlight:!0,class:{base:"ring-warning"}},{color:"error",highlight:!0,class:{base:"ring-error"}},{color:"neutral",highlight:!0,class:{base:"ring-inverted"}}],defaultVariants:{size:"md",color:"primary",variant:"list",indicator:"start"}},Be=Object.assign({inheritAttrs:!1},{__name:"UCheckbox",props:{as:{type:null,required:!1},label:{type:String,required:!1},description:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},indicator:{type:null,required:!1},highlight:{type:Boolean,required:!1},icon:{type:null,required:!1},indeterminateIcon:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},disabled:{type:Boolean,required:!1},required:{type:Boolean,required:!1},name:{type:String,required:!1},value:{type:null,required:!1},id:{type:String,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1},trueValue:{type:null,required:!1},falseValue:{type:null,required:!1}},emits:["change","update:modelValue"],setup(o,{emit:h}){const r=o,l=re(),g=h,a=te("checkbox",r),s=se(),d=le(ie(a,"required","value","defaultValue","modelValue","trueValue","falseValue"),g),{id:p,emitFormChange:q,emitFormInput:u,size:z,color:F,highlight:k,name:S,disabled:V,ariaAttrs:t}=oe(r),y=p.value??ne(),B=T(),Q=m(()=>{const{"data-state":b,...w}=B;return w}),n=m(()=>ue({extend:Ve,...s.ui?.checkbox||{}})({size:z.value??a.size,color:F.value??a.color,variant:a.variant,indicator:a.indicator,highlight:k.value??a.highlight,required:a.required,disabled:V.value}));function X(b){const w=new Event("change",{target:{value:b}});g("change",w),q(),u()}return(b,w)=>(i(),f(e($),{as:!e(a).variant||e(a).variant==="list"?e(a).as:e(U),"data-slot":b.$attrs["data-slot"]??"root",class:c(n.value.root({class:[e(a).ui?.root,e(a).class]}))},{default:v(()=>[de("div",{"data-slot":"container",class:c(n.value.container({class:e(a).ui?.container}))},[R(e(ye),_({id:e(y)},{...e(d),...Q.value,...e(t)},{name:e(S),disabled:e(V),"data-slot":"base",class:n.value.base({class:e(a).ui?.base}),"onUpdate:modelValue":X}),{default:v(({state:Y})=>[R(e(ke),{"data-slot":"indicator",class:c(n.value.indicator({class:e(a).ui?.indicator}))},{default:v(()=>[Y==="indeterminate"?(i(),f(j,{key:0,name:e(a).indeterminateIcon||e(s).ui.icons.minus,"data-slot":"icon",class:c(n.value.icon({class:e(a).ui?.icon}))},null,8,["name","class"])):(i(),f(j,{key:1,name:e(a).icon||e(s).ui.icons.check,"data-slot":"icon",class:c(n.value.icon({class:e(a).ui?.icon}))},null,8,["name","class"]))]),_:2},1032,["class"])]),_:1},16,["id","name","disabled","class"])],2),e(a).label||l.label||e(a).description||l.description?(i(),I("div",{key:0,"data-slot":"wrapper",class:c(n.value.wrapper({class:e(a).ui?.wrapper}))},[e(a).label||l.label?(i(),f(D(!e(a).variant||e(a).variant==="list"?e(U):"p"),{key:0,for:e(y),"data-slot":"label",class:c(n.value.label({class:e(a).ui?.label}))},{default:v(()=>[C(b.$slots,"label",{label:e(a).label},()=>[N(M(e(a).label),1)])]),_:3},8,["for","class"])):x("",!0),e(a).description||l.description?(i(),I("p",{key:1,"data-slot":"description",class:c(n.value.description({class:e(a).ui?.description}))},[C(b.$slots,"description",{description:e(a).description},()=>[N(M(e(a).description),1)])],2)):x("",!0)],2)):x("",!0)]),_:3},8,["as","data-slot","class"]))}});export{Be as _};
@@ -1 +1 @@
1
- if(!self.define){let e,s={};const t=(t,n)=>(t=new URL(t+".js",n).href,s[t]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=t,e.onload=s,document.head.appendChild(e)}else e=t,importScripts(t),s()}).then(()=>{let e=s[t];if(!e)throw new Error(`Module ${t} didn’t register its module`);return e}));self.define=(n,i)=>{const o=e||("document"in self?document.currentScript.src:"")||location.href;if(s[o])return;let r={};const l=e=>t(e,o),u={module:{uri:o},exports:r,require:l};s[o]=Promise.all(n.map(e=>u[e]||l(e))).then(e=>(i(...e),r))}}define(["./workbox-2fbc6a65"],function(e){"use strict";self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),e.precacheAndRoute([{url:"_nuxt/builds/latest.json",revision:"857804097086da97471ebfb70f2929de"},{url:"_nuxt/builds/meta/ed1db2e5-9865-4231-9605-4edd5272e164.json",revision:null},{url:"manifest.webmanifest",revision:"7b171c7b5f0009e184f26413d5e92b5f"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/")))});
1
+ if(!self.define){let e,s={};const t=(t,n)=>(t=new URL(t+".js",n).href,s[t]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=t,e.onload=s,document.head.appendChild(e)}else e=t,importScripts(t),s()}).then(()=>{let e=s[t];if(!e)throw new Error(`Module ${t} didn’t register its module`);return e}));self.define=(n,i)=>{const o=e||("document"in self?document.currentScript.src:"")||location.href;if(s[o])return;let r={};const l=e=>t(e,o),u={module:{uri:o},exports:r,require:l};s[o]=Promise.all(n.map(e=>u[e]||l(e))).then(e=>(i(...e),r))}}define(["./workbox-2fbc6a65"],function(e){"use strict";self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),e.precacheAndRoute([{url:"_nuxt/builds/latest.json",revision:"a5a4bae97d64c0d6236e2f0acaa4507e"},{url:"_nuxt/builds/meta/7caf3cb3-d272-4dbd-bb3f-1eeb64fab5d1.json",revision:null},{url:"manifest.webmanifest",revision:"7b171c7b5f0009e184f26413d5e92b5f"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/")))});