@piwitests/server 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{DqnyWaSQ.js → -9tk1FrT.js} +1 -1
- package/.output/public/_nuxt/26ll_vBr.js +1 -0
- package/.output/public/_nuxt/{BR9H8k-L.js → 3QTorEhJ.js} +1 -1
- package/.output/public/_nuxt/{CgoAUz76.js → 3QTvYrZp.js} +1 -1
- package/.output/public/_nuxt/{l0gdGdar.js → 73aPL7Ir.js} +1 -1
- package/.output/public/_nuxt/{N3pCB6-m.js → 8jZmK2De.js} +1 -1
- package/.output/public/_nuxt/{B33X4zrC.js → 8xyZSRSO.js} +1 -1
- package/.output/public/_nuxt/{B3NbDoBP.js → 99tAfVF5.js} +1 -1
- package/.output/public/_nuxt/{ze9-Ill2.js → B1CUXGbl.js} +1 -1
- package/.output/public/_nuxt/{CQeMb57w.js → B6hPf4UR.js} +1 -1
- package/.output/public/_nuxt/{DL20rwkA.js → B6w76fJT.js} +1 -1
- package/.output/public/_nuxt/{Bvfmwzgw.js → BDcIWTTq.js} +1 -1
- package/.output/public/_nuxt/{DgYM3eyi.js → BE8ykmwr.js} +1 -1
- package/.output/public/_nuxt/{BY4oA2IH.js → BEsJE07U.js} +1 -1
- package/.output/public/_nuxt/{oNq5pd3r.js → BGZQONfm.js} +1 -1
- package/.output/public/_nuxt/{BZekCf_x.js → BRdhP5lm.js} +1 -1
- package/.output/public/_nuxt/{Br2K9yi_.js → BU6xjw05.js} +1 -1
- package/.output/public/_nuxt/{DjZKuUMz.js → BWFY2RuU.js} +1 -1
- package/.output/public/_nuxt/{CCRRqXez.js → B_QIrc7l.js} +1 -1
- package/.output/public/_nuxt/{BQrSEuzu.js → Ba4_ydKG.js} +1 -1
- package/.output/public/_nuxt/{Dz55UR7w.js → BcLXUmKT.js} +1 -1
- package/.output/public/_nuxt/{nCjfWTGm.js → BciovqwK.js} +1 -1
- package/.output/public/_nuxt/{JCFZINev.js → BgDEjrcz.js} +1 -1
- package/.output/public/_nuxt/{DCpmQ47_.js → BoRJdCd4.js} +1 -1
- package/.output/public/_nuxt/{C8RBRg7I.js → Bpha13F_.js} +1 -1
- package/.output/public/_nuxt/{BdFEUAlx.js → Bq0PQfQY.js} +1 -1
- package/.output/public/_nuxt/{BPKwYP2Q.js → BrT_Sys2.js} +2 -2
- package/.output/public/_nuxt/{CTdvGdc2.js → Bua_L6p4.js} +1 -1
- package/.output/public/_nuxt/{BIksQZfR.js → BwKwWgQe.js} +1 -1
- package/.output/public/_nuxt/{d5ZB3uxF.js → BxRsAYRS.js} +1 -1
- package/.output/public/_nuxt/{mGJLLqyN.js → ByoIgYX_.js} +1 -1
- package/.output/public/_nuxt/{CSYJwpXG.js → C7nwFokE.js} +1 -1
- package/.output/public/_nuxt/CEuVRSr0.js +3 -0
- package/.output/public/_nuxt/{2xvsvjLO.js → CHHqhAsw.js} +1 -1
- package/.output/public/_nuxt/{DhA17dqR.js → CHIbdzqp.js} +1 -1
- package/.output/public/_nuxt/{IFqRT_xJ.js → CMB-NkFa.js} +1 -1
- package/.output/public/_nuxt/{mfzslNx_.js → CNULGfLp.js} +1 -1
- package/.output/public/_nuxt/{CKB_doYB.js → COVRAesU.js} +1 -1
- package/.output/public/_nuxt/{Bzl2H_vl.js → CSAmL8XJ.js} +1 -1
- package/.output/public/_nuxt/{bAfTAihV.js → CWmQcueG.js} +1 -1
- package/.output/public/_nuxt/{BBdfPriC.js → CYuWAvXE.js} +1 -1
- package/.output/public/_nuxt/CbuWynGG.js +1 -0
- package/.output/public/_nuxt/{e1zUTrBb.js → Ce3tBrN7.js} +1 -1
- package/.output/public/_nuxt/{BGYbnqA7.js → Cf4h8qty.js} +1 -1
- package/.output/public/_nuxt/{Kc7La4sL.js → Cl96oI21.js} +1 -1
- package/.output/public/_nuxt/{DdbrJwT-.js → ClJkng9p.js} +1 -1
- package/.output/public/_nuxt/{B7yG1G_l.js → CoKEjZX7.js} +1 -1
- package/.output/public/_nuxt/CvtYJHkY.js +1 -0
- package/.output/public/_nuxt/{DszOHBMG.js → CxLN5Tmq.js} +1 -1
- package/.output/public/_nuxt/{B3sNtVnf.js → Cz2HhsB6.js} +1 -1
- package/.output/public/_nuxt/{C38aZbFJ.js → D0-HTQTD.js} +1 -1
- package/.output/public/_nuxt/{D2jhe9JK.js → D13ybpY3.js} +1 -1
- package/.output/public/_nuxt/{k-z_VVTK.js → D7P0ML0H.js} +1 -1
- package/.output/public/_nuxt/{BV83yObd.js → D811X8KM.js} +1 -1
- package/.output/public/_nuxt/DATh_1DQ.js +1 -0
- package/.output/public/_nuxt/{1AB111xL.js → DAeYmPfX.js} +1 -1
- package/.output/public/_nuxt/DCffDvxl.js +1 -0
- package/.output/public/_nuxt/DDPptydi.js +2 -0
- package/.output/public/_nuxt/{BpNqHxg2.js → DFM2jv9I.js} +1 -1
- package/.output/public/_nuxt/{BuZOa2M3.js → DJHNEqb7.js} +1 -1
- package/.output/public/_nuxt/{CMYQpoOI.js → DPSOtRoz.js} +1 -1
- package/.output/public/_nuxt/{BkDfdHFm.js → DRTxhZBV.js} +1 -1
- package/.output/public/_nuxt/{B2lYFco4.js → DS9yGVFL.js} +1 -1
- package/.output/public/_nuxt/{DfcAIbcX.js → DT5rhzhJ.js} +1 -1
- package/.output/public/_nuxt/{BpceIssd.js → DTH2lteW.js} +1 -1
- package/.output/public/_nuxt/DUe6xuKQ.js +1 -0
- package/.output/public/_nuxt/{DcCNnjKl.js → D_A6axXa.js} +1 -1
- package/.output/public/_nuxt/D_TbJDHY.js +1 -0
- package/.output/public/_nuxt/{DIkLLyR6.js → Df3QtbpW.js} +1 -1
- package/.output/public/_nuxt/{Dzz9_Z0u.js → DjRhouSr.js} +1 -1
- package/.output/public/_nuxt/{CuYYdFBL.js → Dn6cGVYB.js} +1 -1
- package/.output/public/_nuxt/{CoHGrO41.js → DpJrGwCr.js} +2 -2
- package/.output/public/_nuxt/DqsMiUoW.js +2 -0
- package/.output/public/_nuxt/{D33On6AX.js → Ds2Y3oms.js} +1 -1
- package/.output/public/_nuxt/Ds4Lb1vi.js +7 -0
- package/.output/public/_nuxt/{DuMv-ugy.js → DtXREpk_.js} +1 -1
- package/.output/public/_nuxt/{BRKa6EQR.js → DvC5Adg1.js} +1 -1
- package/.output/public/_nuxt/{BVW5qIDP.js → DvXvJzFP.js} +1 -1
- package/.output/public/_nuxt/{BIf1R_fu.js → Dvc1aWpA.js} +1 -1
- package/.output/public/_nuxt/{-KQO1A4C.js → DwZiG9xH.js} +1 -1
- package/.output/public/_nuxt/Dx1oCMgy.js +47 -0
- package/.output/public/_nuxt/{CpO-ABDW.js → DxQq_L07.js} +1 -1
- package/.output/public/_nuxt/{BoRFLTAO.js → Dym66h3p.js} +1 -1
- package/.output/public/_nuxt/{ABGJk0pu.js → Dz3Wbekz.js} +1 -1
- package/.output/public/_nuxt/{qzAP_nm7.js → HCK35QD8.js} +1 -1
- package/.output/public/_nuxt/{DuBBqqbF.js → L6HlmmEa.js} +1 -1
- package/.output/public/_nuxt/{BS0gKVuF.js → PxPbRVF-.js} +1 -1
- package/.output/public/_nuxt/{DbeHHTk-.js → QFMx1VKs.js} +1 -1
- package/.output/public/_nuxt/{C3r_Sv1p.js → Sgf5OLhm.js} +1 -1
- package/.output/public/_nuxt/US3YSX4T.js +1 -0
- package/.output/public/_nuxt/{xUrLy-Zn.js → Wfk1m0ni.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/05a2dd95-d1c1-4e3a-8625-ac6bfea83837.json +1 -0
- package/.output/public/_nuxt/{B43OGXzV.js → cBj9fai9.js} +1 -1
- package/.output/public/_nuxt/{BpIsBP5g.js → csqspBeX.js} +1 -1
- package/.output/public/_nuxt/entry.BaIGwMjT.css +1 -0
- package/.output/public/_nuxt/{CJFqA_QW.js → jlBi8Byu.js} +1 -1
- package/.output/public/_nuxt/{D4VpoHDP.js → lCkcEykv.js} +1 -1
- package/.output/public/_nuxt/{DOuoR2Pk.js → qYFZH4Z8.js} +1 -1
- package/.output/public/_nuxt/{uKeO2H7F.js → r9WApUfF.js} +1 -1
- package/.output/public/_nuxt/{DRtTLQri.js → rw7Hdll3.js} +1 -1
- package/.output/public/_nuxt/{C1K3r_fc.js → sMFaPAAR.js} +1 -1
- package/.output/public/_nuxt/{DAWn6Z7h.js → vzXhOO8R.js} +1 -1
- package/.output/public/_nuxt/{DJS3Bf50.js → yZ4LuI9d.js} +1 -1
- package/.output/public/_nuxt/{iwD5atI2.js → z7PmsnBG.js} +1 -1
- package/.output/public/_nuxt/{Bb64FEFL.js → za5M7BGh.js} +1 -1
- package/.output/public/sw.js +1 -1
- package/.output/server/chunks/build/{Checkbox-7ZiMz60w.mjs → Checkbox-cVOSIY93.mjs} +2 -2
- package/.output/server/chunks/build/Checkbox-cVOSIY93.mjs.map +1 -0
- package/.output/server/chunks/build/{CiEnvCard-DNxBVvx4.mjs → CiEnvCard-DXPOhdSG.mjs} +2 -2
- package/.output/server/chunks/build/CiEnvCard-DXPOhdSG.mjs.map +1 -0
- package/.output/server/chunks/build/DataLocationCard-D6xSOrme.mjs +102 -0
- package/.output/server/chunks/build/DataLocationCard-D6xSOrme.mjs.map +1 -0
- package/.output/server/chunks/build/DesktopMcpCard-B4JuUTKj.mjs +122 -0
- package/.output/server/chunks/build/DesktopMcpCard-B4JuUTKj.mjs.map +1 -0
- package/.output/server/chunks/build/{ProjectTestCasesTable-9418EI8J.mjs → ProjectTestCasesTable-9Ia825h8.mjs} +2 -2
- package/.output/server/chunks/build/ProjectTestCasesTable-9Ia825h8.mjs.map +1 -0
- package/.output/server/chunks/build/{Select-COwTIQlV.mjs → Select-ppPz926C.mjs} +3 -2
- package/.output/server/chunks/build/Select-ppPz926C.mjs.map +1 -0
- package/.output/server/chunks/build/{SelectMenu-BkyAHFCM.mjs → SelectMenu-799c_Ils.mjs} +2 -2
- package/.output/server/chunks/build/{SelectMenu-BkyAHFCM.mjs.map → SelectMenu-799c_Ils.mjs.map} +1 -1
- package/.output/server/chunks/build/{Switch-htSKgC38.mjs → Switch-xQQ3_ME1.mjs} +2 -2
- package/.output/server/chunks/build/Switch-xQQ3_ME1.mjs.map +1 -0
- package/.output/server/chunks/build/{_id_-CnwAyvvS.mjs → _id_-B2yirIuA.mjs} +5 -4
- package/.output/server/chunks/build/{_id_-CnwAyvvS.mjs.map → _id_-B2yirIuA.mjs.map} +1 -1
- package/.output/server/chunks/build/{_id_-BDqvTM9D.mjs → _id_-B4V5fop6.mjs} +5 -4
- package/.output/server/chunks/build/{_id_-BDqvTM9D.mjs.map → _id_-B4V5fop6.mjs.map} +1 -1
- package/.output/server/chunks/build/{_id_-Dy67M9Dj.mjs → _id_-bWcP2xFl.mjs} +8 -7
- package/.output/server/chunks/build/{_id_-Dy67M9Dj.mjs.map → _id_-bWcP2xFl.mjs.map} +1 -1
- package/.output/server/chunks/build/about-TuEZ9n1Q.mjs +625 -0
- package/.output/server/chunks/build/about-TuEZ9n1Q.mjs.map +1 -0
- package/.output/server/chunks/build/{ai-V3YOh3yx.mjs → ai-7jdaPOmj.mjs} +6 -5
- package/.output/server/chunks/build/{ai-V3YOh3yx.mjs.map → ai-7jdaPOmj.mjs.map} +1 -1
- package/.output/server/chunks/build/{analytics-BBlAEmj5.mjs → analytics-B276WPeU.mjs} +7 -6
- package/.output/server/chunks/build/{analytics-BBlAEmj5.mjs.map → analytics-B276WPeU.mjs.map} +1 -1
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/{default-BfMirIgG.mjs → default-BSzdkM_L.mjs} +9 -7
- package/.output/server/chunks/build/default-BSzdkM_L.mjs.map +1 -0
- package/.output/server/chunks/build/{docs-DtNcJCyb.mjs → docs-EXhN3sqC.mjs} +4 -3
- package/.output/server/chunks/build/{docs-DtNcJCyb.mjs.map → docs-EXhN3sqC.mjs.map} +1 -1
- package/.output/server/chunks/build/{edit-Dsf11mL5.mjs → edit-C9Z7oZeu.mjs} +5 -4
- package/.output/server/chunks/build/edit-C9Z7oZeu.mjs.map +1 -0
- package/.output/server/chunks/build/handleAndDispatchCustomEvent-Bk_AVSSo.mjs +13 -0
- package/.output/server/chunks/build/handleAndDispatchCustomEvent-Bk_AVSSo.mjs.map +1 -0
- package/.output/server/chunks/build/{index-DzEgjHlB.mjs → index-BK9PTRpd.mjs} +24 -8
- package/.output/server/chunks/build/{index-DzEgjHlB.mjs.map → index-BK9PTRpd.mjs.map} +1 -1
- package/.output/server/chunks/build/{index-BgpEKTSq.mjs → index-DVUtBexc.mjs} +9 -8
- package/.output/server/chunks/build/{index-BgpEKTSq.mjs.map → index-DVUtBexc.mjs.map} +1 -1
- package/.output/server/chunks/build/{mcp-CXwa3xU3.mjs → mcp-CQ-21rwc.mjs} +132 -25
- package/.output/server/chunks/build/mcp-CQ-21rwc.mjs.map +1 -0
- package/.output/server/chunks/build/{notifications-hJj8tbAT.mjs → notifications-Dzm9c0u_.mjs} +4 -3
- package/.output/server/chunks/build/notifications-Dzm9c0u_.mjs.map +1 -0
- package/.output/server/chunks/build/server.mjs +17 -17
- package/.output/server/chunks/build/{settings-metadata-Cp0dx0vm.mjs → settings-metadata-B0wo5R-W.mjs} +3 -1
- package/.output/server/chunks/build/settings-metadata-B0wo5R-W.mjs.map +1 -0
- package/.output/server/chunks/build/{settings-Ci_7EXYQ.mjs → settings-pNyPBXVa.mjs} +4 -3
- package/.output/server/chunks/build/settings-pNyPBXVa.mjs.map +1 -0
- package/.output/server/chunks/build/{storage-CM-Pd-9E.mjs → storage-XelzuyPy.mjs} +16 -182
- package/.output/server/chunks/build/storage-XelzuyPy.mjs.map +1 -0
- package/.output/server/chunks/build/{test-cases-DkGQB027.mjs → test-cases-pmOxi-AN.mjs} +5 -4
- package/.output/server/chunks/build/test-cases-pmOxi-AN.mjs.map +1 -0
- package/.output/server/chunks/build/useFormControl-BLpq1s4O.mjs +9 -0
- package/.output/server/chunks/build/useFormControl-BLpq1s4O.mjs.map +1 -0
- package/.output/server/chunks/build/useIsDesktop-BS13spVj.mjs +9 -0
- package/.output/server/chunks/build/useIsDesktop-BS13spVj.mjs.map +1 -0
- package/.output/server/chunks/build/{useSettingsNav-D2knPCqF.mjs → useSettingsNav-NjI2seBy.mjs} +5 -3
- package/.output/server/chunks/build/useSettingsNav-NjI2seBy.mjs.map +1 -0
- package/.output/server/chunks/build/{virtualizer-0-UBy7xl.mjs → virtualizer-ZaqK4guJ.mjs} +3 -2
- package/.output/server/chunks/build/virtualizer-ZaqK4guJ.mjs.map +1 -0
- package/.output/server/chunks/build/{wasted-time-L4kBV5Nh.mjs → wasted-time-CguAF9zc.mjs} +2 -2
- package/.output/server/chunks/build/wasted-time-CguAF9zc.mjs.map +1 -0
- package/.output/server/chunks/nitro/nitro.mjs +703 -681
- package/.output/server/package.json +1 -1
- package/package.json +1 -1
- package/.output/public/_nuxt/B6Jp7fpa.js +0 -46
- package/.output/public/_nuxt/BP_SWi7S.js +0 -1
- package/.output/public/_nuxt/Bf62wdzp.js +0 -1
- package/.output/public/_nuxt/C219JuBV.js +0 -1
- package/.output/public/_nuxt/CX1dcT4v.js +0 -1
- package/.output/public/_nuxt/CdME81ij.js +0 -2
- package/.output/public/_nuxt/Dsk4Ic18.js +0 -7
- package/.output/public/_nuxt/HoKG9cc2.js +0 -1
- package/.output/public/_nuxt/WctJXszi.js +0 -3
- package/.output/public/_nuxt/builds/meta/5182c9fb-56a6-4df2-9685-4020a08ce7a5.json +0 -1
- package/.output/public/_nuxt/entry.BsmKRJzR.css +0 -1
- package/.output/public/_nuxt/jIF87ALb.js +0 -1
- package/.output/server/chunks/build/Checkbox-7ZiMz60w.mjs.map +0 -1
- package/.output/server/chunks/build/CiEnvCard-DNxBVvx4.mjs.map +0 -1
- package/.output/server/chunks/build/ProjectTestCasesTable-9418EI8J.mjs.map +0 -1
- package/.output/server/chunks/build/Select-COwTIQlV.mjs.map +0 -1
- package/.output/server/chunks/build/Switch-htSKgC38.mjs.map +0 -1
- package/.output/server/chunks/build/about-FB9PYAHK.mjs +0 -313
- package/.output/server/chunks/build/about-FB9PYAHK.mjs.map +0 -1
- package/.output/server/chunks/build/default-BfMirIgG.mjs.map +0 -1
- package/.output/server/chunks/build/edit-Dsf11mL5.mjs.map +0 -1
- package/.output/server/chunks/build/mcp-CXwa3xU3.mjs.map +0 -1
- package/.output/server/chunks/build/notifications-hJj8tbAT.mjs.map +0 -1
- package/.output/server/chunks/build/settings-Ci_7EXYQ.mjs.map +0 -1
- package/.output/server/chunks/build/settings-metadata-Cp0dx0vm.mjs.map +0 -1
- package/.output/server/chunks/build/storage-CM-Pd-9E.mjs.map +0 -1
- package/.output/server/chunks/build/test-cases-DkGQB027.mjs.map +0 -1
- package/.output/server/chunks/build/useFormControl-DFTjniPG.mjs +0 -19
- package/.output/server/chunks/build/useFormControl-DFTjniPG.mjs.map +0 -1
- package/.output/server/chunks/build/useSettingsNav-D2knPCqF.mjs.map +0 -1
- package/.output/server/chunks/build/virtualizer-0-UBy7xl.mjs.map +0 -1
- package/.output/server/chunks/build/wasted-time-L4kBV5Nh.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a1 as Jt,a3 as Lt,aN as xt,aO as Mt,am as Ue,aP as Fe,aQ as Je,C as Le,G as Wt,ab as Vt,r as ee,I as we,h as te,aR as ce,o as Bt,f as Kt,g as qt,T as Gt,H as Ht,p as Xt,k as q,ae as Yt,aS as Qt,a6 as en,J as G,aT as tn,aU as nn,aV as rn,aW as on}from"./BPKwYP2Q.js";function sn(e){return"schema"in e&&typeof e.coercer=="function"&&typeof e.validator=="function"&&typeof e.refiner=="function"}function an(e){return"~standard"in e}async function cn(e,t){const n=await t["~standard"].validate(e);return n.issues?{errors:n.issues?.map(r=>({name:r.path?.map(o=>typeof o=="object"?o.key:o).join(".")||"",message:r.message}))||[],result:null}:{errors:null,result:n.value}}async function un(e,t){const[n,r]=t.validate(e);return n?{errors:n.failures().map(i=>({message:i.message,name:i.path.join(".")})),result:null}:{errors:null,result:r}}function fn(e,t){if(an(t))return cn(e,t);if(sn(t))return un(e,t);throw new Error("Form validation failed: Unsupported form schema")}function ln(e,t){return t?t.split(".").reduce((r,o)=>r?.[o],e):e}function dn(e,t,n){if(!t)return Object.assign(e,n);if(!e)return e;const r=t.split(".");let o=e;for(let s=0;s<r.length-1;s++){const a=r[s];(o[a]===void 0||o[a]===null)&&(s+1<r.length&&!Number.isNaN(Number(r[s+1]))?o[a]=[]:o[a]={}),o=o[a]}const i=r[r.length-1];return o[i]=n,e}class re extends Error{formId;errors;constructor(t,n){super("Form validation exception"),this.formId=t,this.errors=n,Object.setPrototypeOf(this,re.prototype)}}const pn={base:""},Ui={__name:"UForm",props:{id:{type:[String,Number],required:!1},schema:{type:null,required:!1},state:{type:null,required:!1},validate:{type:Function,required:!1},validateOn:{type:Array,required:!1,default(){return["input","blur","change"]}},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},validateOnInputDelay:{type:Number,required:!1,default:300},transform:{type:null,required:!1,default:()=>!0},nested:{type:Boolean,required:!1},loadingAuto:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:Object,required:!1},onSubmit:{type:Function,required:!1}},emits:["submit","error"],setup(e,{expose:t,emit:n}){const r=e,o=n,i=Jt("form",r),s=Lt(),a=te(()=>en({extend:pn,...s.ui?.form||{}})),c=i.id??xt(),f=Mt("formRef"),d=Qt(`form-${c}`),g=i.nested===!0&&Ue(Fe,void 0),_=i.nested===!0?Ue(Je,void 0):void 0,h=te(()=>_?.value?i.name?ln(_.value,i.name):_.value:i.state);G(Fe,d),G(Je,h);const v=ee(new Map);Le(async()=>{g&&(await Wt(),g.emit({type:"attach",validate:J,formId:c,name:i.name,api:De}))}),Vt(()=>{d.reset(),g&&g.emit({type:"detach",formId:c})}),Le(async()=>{d.on(async l=>{l.type==="attach"?v.value.set(l.formId,{validate:l.validate,name:l.name,api:l.api}):l.type==="detach"?v.value.delete(l.formId):i.validateOn?.includes(l.type)&&!U.value&&(l.type!=="input"?await J({name:l.name,silent:!0,nested:!1}):(l.eager||j.has(l.name))&&await J({name:l.name,silent:!0,nested:!1})),l.type==="blur"&&j.add(l.name),(l.type==="change"||l.type==="input"||l.type==="blur"||l.type==="focus")&&ie.add(l.name),(l.type==="change"||l.type==="input")&&F.add(l.name)})});const S=ee([]);G(tn,S);const k=ee({});G(nn,k);const F=we(new Set),ie=we(new Set),j=we(new Set);function z(l){return l.map(p=>({...p,id:p?.name?k.value[p.name]?.id:void 0}))}const Z=ee(null);async function ae(){let l=i.validate?await i.validate(h.value)??[]:[];if(i.schema){const{errors:p,result:y}=await fn(h.value,i.schema);p?l=l.concat(p):Z.value=y}return z(l)}async function J(l={silent:!1,nested:!1,transform:!1}){const p=l.name&&!Array.isArray(l.name)?[l.name]:l.name;let y=[],O=[];if(!p&&l.nested){const L=Array.from(v.value.values()).map(N=>jt(N,l)),C=await Promise.all(L);O=C.filter(N=>N.error).flatMap(N=>N.error.errors.map(Ft=>At(Ft,N.name))),y=C.filter(N=>N.output!==void 0)}const K=[...await ae(),...O];if(p?S.value=Dt(K,p):S.value=K,S.value?.length){if(l.silent)return!1;throw new re(c,S.value)}return l.transform?(y.forEach(L=>{L.name?dn(Z.value,L.name,L.output):Object.assign(Z.value,L.output)}),Z.value??h.value):h.value}const U=ee(!1);G(rn,ce(U));async function je(l){U.value=!!i.loadingAuto;const p=l;try{p.data=await J({nested:!0,transform:i.transform}),await i.onSubmit?.(p),F.clear()}catch(y){if(!(y instanceof re))throw y;const O={...p,errors:y.errors};o("error",O)}finally{U.value=!1}}const Ae=te(()=>i.disabled||U.value);G(on,te(()=>({disabled:Ae.value,validateOnInputDelay:i.validateOnInputDelay})));async function jt(l,p){try{const y=await l.validate({...p,silent:!1});return{name:l.name,output:y}}catch(y){if(!(y instanceof re))throw y;return{name:l.name,error:y}}}function At(l,p){return!p||!l.name?l:{...l,name:p+"."+l.name}}function Rt(l,p){const y=p+".",O=l?.name?.startsWith(y)?l.name.substring(y.length):l.name;return{...l,name:O}}function Ct(l,p){return p?l.filter(y=>y?.name?.startsWith(p+".")).map(y=>Rt(y,p)):l}function Re(l){return l.api.getErrors().map(p=>l.name?{...p,name:l.name+"."+p.name}:p)}function Ce(l,p){return!l||!p?!0:l instanceof RegExp?l.test(p):p===l||typeof l=="string"&&l.startsWith(p+".")}function Nt(l,p){if(!l||l instanceof RegExp)return l;if(p!==l)return typeof l=="string"&&l.startsWith(p+".")?l.substring(p.length+1):l}function Dt(l,p){const y=new Set(p),O=p.map(C=>k.value?.[C]?.pattern).filter(Boolean),R=C=>C.name?y.has(C.name)?!0:O.some(N=>N.test(C.name)):!1,K=S.value.filter(C=>!R(C)),L=l.filter(R);return[...K,...L]}function Ut(l,p){return l.filter(y=>p instanceof RegExp?!(y.name&&p.test(y.name)):!y.name||y.name!==p)}function Ne(l){return!l.name||!!k.value[l.name]}const De={validate:J,errors:S,setErrors(l,p){const y=z(l.filter(Ne)),O=[];for(const R of v.value.values())if(Ce(p,R.name)){const K=Ct(l,R.name);R.api.setErrors(K,Nt(p,R.name||"")),O.push(...Re(R))}if(p){const R=Ut(S.value,p);S.value=[...R,...y,...O]}else S.value=[...y,...O]},async submit(){f.value instanceof HTMLFormElement&&f.value.reportValidity()===!1||await je(new Event("submit"))},getErrors(l){return l?S.value.filter(p=>l instanceof RegExp?p.name&&l.test(p.name):p.name===l):S.value},clear(l){const p=l?S.value.filter(O=>Ne(O)&&(l instanceof RegExp?!(O.name&&l.test(O.name)):O.name!==l)):[],y=[];for(const O of v.value.values())Ce(l,O.name)&&O.api.clear(),y.push(...Re(O));S.value=[...p,...y]},disabled:Ae,loading:U,dirty:te(()=>!!F.size),dirtyFields:ce(F),blurredFields:ce(j),touchedFields:ce(ie)};return t(De),(l,p)=>(Bt(),Kt(Yt(q(g)?"div":"form"),{id:q(c),ref_key:"formRef",ref:f,name:q(g)?void 0:q(i).name,method:"post",class:Xt(a.value({class:[q(i).ui?.base,q(i).class]})),onSubmit:Ht(je,["prevent"])},{default:qt(()=>[Gt(l.$slots,"default",{errors:S.value,loading:U.value})]),_:3},40,["id","name","class"]))}};var xe;function u(e,t,n){function r(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const f=s.prototype,d=Object.keys(f);for(let g=0;g<d.length;g++){const _=d[g];_ in a||(a[_]=f[_].bind(a))}}const o=n?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(a){var c;const f=n?.Parent?new i:this;r(f,a),(c=f._zod).deferred??(c.deferred=[]);for(const d of f._zod.deferred)d();return f}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class X extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ct extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(xe=globalThis).__zod_globalConfig??(xe.__zod_globalConfig={});const $e=globalThis.__zod_globalConfig;function W(e){return $e}function ut(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function ze(e,t){return typeof t=="bigint"?t.toString():t}function Ze(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Se(e){return e==null}function Oe(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Me=Symbol("evaluating");function w(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Me)return r===void 0&&(r=Me,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function B(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function x(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function We(e){return JSON.stringify(e)}function hn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ft="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function de(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const mn=Ze(()=>{if($e.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function oe(e){if(de(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(de(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function lt(e){return oe(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const _n=new Set(["string","number","symbol"]);function Y(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function M(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function m(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function gn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function vn(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i=x(e._zod.def,{get shape(){const s={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(s[a]=n.shape[a])}return B(this,"shape",s),s},checks:[]});return M(e,i)}function yn(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=x(e._zod.def,{get shape(){const s={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete s[a]}return B(this,"shape",s),s},checks:[]});return M(e,i)}function wn(e,t){if(!oe(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const i=e._zod.def.shape;for(const s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=x(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return B(this,"shape",i),i}});return M(e,o)}function zn(e,t){if(!oe(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=x(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return B(this,"shape",r),r}});return M(e,n)}function bn(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=x(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return B(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return M(e,n)}function kn(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const s=x(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(n)for(const f in n){if(!(f in a))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(c[f]=e?new e({type:"optional",innerType:a[f]}):a[f])}else for(const f in a)c[f]=e?new e({type:"optional",innerType:a[f]}):a[f];return B(this,"shape",c),c},checks:[]});return M(t,s)}function $n(e,t,n){const r=x(t._zod.def,{get shape(){const o=t._zod.def.shape,i={...o};if(n)for(const s in n){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(i[s]=new e({type:"nonoptional",innerType:o[s]}))}else for(const s in o)i[s]=new e({type:"nonoptional",innerType:o[s]});return B(this,"shape",i),i}});return M(t,r)}function H(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Zn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function dt(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function ue(e){return typeof e=="string"?e:e?.message}function V(e,t,n){const r=e.message?e.message:ue(e.inst?._zod.def?.error?.(e))??ue(t?.error?.(e))??ue(n.customError?.(e))??ue(n.localeError?.(e))??"Invalid input",{inst:o,continue:i,input:s,...a}=e;return a.path??(a.path=[]),a.message=r,t?.reportInput&&(a.input=s),a}function Ee(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function se(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const pt=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ze,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ht=u("$ZodError",pt),mt=u("$ZodError",pt,{Parent:Error});function Sn(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function On(e,t=n=>n.message){const n={_errors:[]},r=(o,i=[])=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>r({issues:a},[...i,...s.path]));else if(s.code==="invalid_key")r({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")r({issues:s.issues},[...i,...s.path]);else{const a=[...i,...s.path];if(a.length===0)n._errors.push(t(s));else{let c=n,f=0;for(;f<a.length;){const d=a[f];f===a.length-1?(c[d]=c[d]||{_errors:[]},c[d]._errors.push(t(s))):c[d]=c[d]||{_errors:[]},c=c[d],f++}}}};return r(e),n}const Pe=e=>(t,n,r,o)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new X;if(s.issues.length){const a=new(o?.Err??e)(s.issues.map(c=>V(c,i,W())));throw ft(a,o?.callee),a}return s.value},Ie=e=>async(t,n,r,o)=>{const i=r?{...r,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new(o?.Err??e)(s.issues.map(c=>V(c,i,W())));throw ft(a,o?.callee),a}return s.value},_e=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new X;return i.issues.length?{success:!1,error:new(e??ht)(i.issues.map(s=>V(s,o,W())))}:{success:!0,data:i.value}},En=_e(mt),ge=e=>async(t,n,r)=>{const o=r?{...r,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>V(s,o,W())))}:{success:!0,data:i.value}},Pn=ge(mt),In=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Pe(e)(t,n,o)},Tn=e=>(t,n,r)=>Pe(e)(t,n,r),jn=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Ie(e)(t,n,o)},An=e=>async(t,n,r)=>Ie(e)(t,n,r),Rn=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return _e(e)(t,n,o)},Cn=e=>(t,n,r)=>_e(e)(t,n,r),Nn=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return ge(e)(t,n,o)},Dn=e=>async(t,n,r)=>ge(e)(t,n,r),Un=/^[cC][0-9a-z]{6,}$/,Fn=/^[0-9a-z]+$/,Jn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ln=/^[0-9a-vA-V]{20}$/,xn=/^[A-Za-z0-9]{27}$/,Mn=/^[a-zA-Z0-9_-]{21}$/,Wn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Vn=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ve=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Bn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Kn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function qn(){return new RegExp(Kn,"u")}const Gn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Hn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Xn=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Yn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Qn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,_t=/^[A-Za-z0-9_-]*$/,er=/^https?$/,tr=/^\+[1-9]\d{6,14}$/,gt="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",nr=new RegExp(`^${gt}$`);function vt(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function rr(e){return new RegExp(`^${vt(e)}$`)}function or(e){const t=vt({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${gt}T(?:${r})$`)}const sr=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},ir=/^[^A-Z]*$/,ar=/^[^a-z]*$/,D=u("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),cr=u("$ZodCheckMaxLength",(e,t)=>{var n;D.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Se(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const s=Ee(o);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ur=u("$ZodCheckMinLength",(e,t)=>{var n;D.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Se(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const s=Ee(o);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),fr=u("$ZodCheckLengthEquals",(e,t)=>{var n;D.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Se(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,i=o.length;if(i===t.length)return;const s=Ee(o),a=i>t.length;r.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),ve=u("$ZodCheckStringFormat",(e,t)=>{var n,r;D.init(e,t),e._zod.onattach.push(o=>{const i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),lr=u("$ZodCheckRegex",(e,t)=>{ve.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),dr=u("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ir),ve.init(e,t)}),pr=u("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ar),ve.init(e,t)}),hr=u("$ZodCheckIncludes",(e,t)=>{D.init(e,t);const n=Y(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),mr=u("$ZodCheckStartsWith",(e,t)=>{D.init(e,t);const n=new RegExp(`^${Y(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),_r=u("$ZodCheckEndsWith",(e,t)=>{D.init(e,t);const n=new RegExp(`.*${Y(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),gr=u("$ZodCheckOverwrite",(e,t)=>{D.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class vr{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
1
|
+
import{a1 as Jt,a3 as Lt,aN as xt,aO as Mt,am as Ue,aP as Fe,aQ as Je,C as Le,G as Wt,ab as Vt,r as ee,I as we,h as te,aR as ce,o as Bt,f as Kt,g as qt,T as Gt,H as Ht,p as Xt,k as q,ae as Yt,aS as Qt,a6 as en,J as G,aT as tn,aU as nn,aV as rn,aW as on}from"./BrT_Sys2.js";function sn(e){return"schema"in e&&typeof e.coercer=="function"&&typeof e.validator=="function"&&typeof e.refiner=="function"}function an(e){return"~standard"in e}async function cn(e,t){const n=await t["~standard"].validate(e);return n.issues?{errors:n.issues?.map(r=>({name:r.path?.map(o=>typeof o=="object"?o.key:o).join(".")||"",message:r.message}))||[],result:null}:{errors:null,result:n.value}}async function un(e,t){const[n,r]=t.validate(e);return n?{errors:n.failures().map(i=>({message:i.message,name:i.path.join(".")})),result:null}:{errors:null,result:r}}function fn(e,t){if(an(t))return cn(e,t);if(sn(t))return un(e,t);throw new Error("Form validation failed: Unsupported form schema")}function ln(e,t){return t?t.split(".").reduce((r,o)=>r?.[o],e):e}function dn(e,t,n){if(!t)return Object.assign(e,n);if(!e)return e;const r=t.split(".");let o=e;for(let s=0;s<r.length-1;s++){const a=r[s];(o[a]===void 0||o[a]===null)&&(s+1<r.length&&!Number.isNaN(Number(r[s+1]))?o[a]=[]:o[a]={}),o=o[a]}const i=r[r.length-1];return o[i]=n,e}class re extends Error{formId;errors;constructor(t,n){super("Form validation exception"),this.formId=t,this.errors=n,Object.setPrototypeOf(this,re.prototype)}}const pn={base:""},Ui={__name:"UForm",props:{id:{type:[String,Number],required:!1},schema:{type:null,required:!1},state:{type:null,required:!1},validate:{type:Function,required:!1},validateOn:{type:Array,required:!1,default(){return["input","blur","change"]}},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},validateOnInputDelay:{type:Number,required:!1,default:300},transform:{type:null,required:!1,default:()=>!0},nested:{type:Boolean,required:!1},loadingAuto:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:Object,required:!1},onSubmit:{type:Function,required:!1}},emits:["submit","error"],setup(e,{expose:t,emit:n}){const r=e,o=n,i=Jt("form",r),s=Lt(),a=te(()=>en({extend:pn,...s.ui?.form||{}})),c=i.id??xt(),f=Mt("formRef"),d=Qt(`form-${c}`),g=i.nested===!0&&Ue(Fe,void 0),_=i.nested===!0?Ue(Je,void 0):void 0,h=te(()=>_?.value?i.name?ln(_.value,i.name):_.value:i.state);G(Fe,d),G(Je,h);const v=ee(new Map);Le(async()=>{g&&(await Wt(),g.emit({type:"attach",validate:J,formId:c,name:i.name,api:De}))}),Vt(()=>{d.reset(),g&&g.emit({type:"detach",formId:c})}),Le(async()=>{d.on(async l=>{l.type==="attach"?v.value.set(l.formId,{validate:l.validate,name:l.name,api:l.api}):l.type==="detach"?v.value.delete(l.formId):i.validateOn?.includes(l.type)&&!U.value&&(l.type!=="input"?await J({name:l.name,silent:!0,nested:!1}):(l.eager||j.has(l.name))&&await J({name:l.name,silent:!0,nested:!1})),l.type==="blur"&&j.add(l.name),(l.type==="change"||l.type==="input"||l.type==="blur"||l.type==="focus")&&ie.add(l.name),(l.type==="change"||l.type==="input")&&F.add(l.name)})});const S=ee([]);G(tn,S);const k=ee({});G(nn,k);const F=we(new Set),ie=we(new Set),j=we(new Set);function z(l){return l.map(p=>({...p,id:p?.name?k.value[p.name]?.id:void 0}))}const Z=ee(null);async function ae(){let l=i.validate?await i.validate(h.value)??[]:[];if(i.schema){const{errors:p,result:y}=await fn(h.value,i.schema);p?l=l.concat(p):Z.value=y}return z(l)}async function J(l={silent:!1,nested:!1,transform:!1}){const p=l.name&&!Array.isArray(l.name)?[l.name]:l.name;let y=[],O=[];if(!p&&l.nested){const L=Array.from(v.value.values()).map(N=>jt(N,l)),C=await Promise.all(L);O=C.filter(N=>N.error).flatMap(N=>N.error.errors.map(Ft=>At(Ft,N.name))),y=C.filter(N=>N.output!==void 0)}const K=[...await ae(),...O];if(p?S.value=Dt(K,p):S.value=K,S.value?.length){if(l.silent)return!1;throw new re(c,S.value)}return l.transform?(y.forEach(L=>{L.name?dn(Z.value,L.name,L.output):Object.assign(Z.value,L.output)}),Z.value??h.value):h.value}const U=ee(!1);G(rn,ce(U));async function je(l){U.value=!!i.loadingAuto;const p=l;try{p.data=await J({nested:!0,transform:i.transform}),await i.onSubmit?.(p),F.clear()}catch(y){if(!(y instanceof re))throw y;const O={...p,errors:y.errors};o("error",O)}finally{U.value=!1}}const Ae=te(()=>i.disabled||U.value);G(on,te(()=>({disabled:Ae.value,validateOnInputDelay:i.validateOnInputDelay})));async function jt(l,p){try{const y=await l.validate({...p,silent:!1});return{name:l.name,output:y}}catch(y){if(!(y instanceof re))throw y;return{name:l.name,error:y}}}function At(l,p){return!p||!l.name?l:{...l,name:p+"."+l.name}}function Rt(l,p){const y=p+".",O=l?.name?.startsWith(y)?l.name.substring(y.length):l.name;return{...l,name:O}}function Ct(l,p){return p?l.filter(y=>y?.name?.startsWith(p+".")).map(y=>Rt(y,p)):l}function Re(l){return l.api.getErrors().map(p=>l.name?{...p,name:l.name+"."+p.name}:p)}function Ce(l,p){return!l||!p?!0:l instanceof RegExp?l.test(p):p===l||typeof l=="string"&&l.startsWith(p+".")}function Nt(l,p){if(!l||l instanceof RegExp)return l;if(p!==l)return typeof l=="string"&&l.startsWith(p+".")?l.substring(p.length+1):l}function Dt(l,p){const y=new Set(p),O=p.map(C=>k.value?.[C]?.pattern).filter(Boolean),R=C=>C.name?y.has(C.name)?!0:O.some(N=>N.test(C.name)):!1,K=S.value.filter(C=>!R(C)),L=l.filter(R);return[...K,...L]}function Ut(l,p){return l.filter(y=>p instanceof RegExp?!(y.name&&p.test(y.name)):!y.name||y.name!==p)}function Ne(l){return!l.name||!!k.value[l.name]}const De={validate:J,errors:S,setErrors(l,p){const y=z(l.filter(Ne)),O=[];for(const R of v.value.values())if(Ce(p,R.name)){const K=Ct(l,R.name);R.api.setErrors(K,Nt(p,R.name||"")),O.push(...Re(R))}if(p){const R=Ut(S.value,p);S.value=[...R,...y,...O]}else S.value=[...y,...O]},async submit(){f.value instanceof HTMLFormElement&&f.value.reportValidity()===!1||await je(new Event("submit"))},getErrors(l){return l?S.value.filter(p=>l instanceof RegExp?p.name&&l.test(p.name):p.name===l):S.value},clear(l){const p=l?S.value.filter(O=>Ne(O)&&(l instanceof RegExp?!(O.name&&l.test(O.name)):O.name!==l)):[],y=[];for(const O of v.value.values())Ce(l,O.name)&&O.api.clear(),y.push(...Re(O));S.value=[...p,...y]},disabled:Ae,loading:U,dirty:te(()=>!!F.size),dirtyFields:ce(F),blurredFields:ce(j),touchedFields:ce(ie)};return t(De),(l,p)=>(Bt(),Kt(Yt(q(g)?"div":"form"),{id:q(c),ref_key:"formRef",ref:f,name:q(g)?void 0:q(i).name,method:"post",class:Xt(a.value({class:[q(i).ui?.base,q(i).class]})),onSubmit:Ht(je,["prevent"])},{default:qt(()=>[Gt(l.$slots,"default",{errors:S.value,loading:U.value})]),_:3},40,["id","name","class"]))}};var xe;function u(e,t,n){function r(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const f=s.prototype,d=Object.keys(f);for(let g=0;g<d.length;g++){const _=d[g];_ in a||(a[_]=f[_].bind(a))}}const o=n?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(a){var c;const f=n?.Parent?new i:this;r(f,a),(c=f._zod).deferred??(c.deferred=[]);for(const d of f._zod.deferred)d();return f}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class X extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ct extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(xe=globalThis).__zod_globalConfig??(xe.__zod_globalConfig={});const $e=globalThis.__zod_globalConfig;function W(e){return $e}function ut(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function ze(e,t){return typeof t=="bigint"?t.toString():t}function Ze(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Se(e){return e==null}function Oe(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Me=Symbol("evaluating");function w(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Me)return r===void 0&&(r=Me,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function B(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function x(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function We(e){return JSON.stringify(e)}function hn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ft="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function de(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const mn=Ze(()=>{if($e.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function oe(e){if(de(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(de(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function lt(e){return oe(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const _n=new Set(["string","number","symbol"]);function Y(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function M(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function m(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function gn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function vn(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i=x(e._zod.def,{get shape(){const s={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(s[a]=n.shape[a])}return B(this,"shape",s),s},checks:[]});return M(e,i)}function yn(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=x(e._zod.def,{get shape(){const s={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete s[a]}return B(this,"shape",s),s},checks:[]});return M(e,i)}function wn(e,t){if(!oe(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const i=e._zod.def.shape;for(const s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=x(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return B(this,"shape",i),i}});return M(e,o)}function zn(e,t){if(!oe(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=x(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return B(this,"shape",r),r}});return M(e,n)}function bn(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=x(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return B(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return M(e,n)}function kn(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const s=x(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(n)for(const f in n){if(!(f in a))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(c[f]=e?new e({type:"optional",innerType:a[f]}):a[f])}else for(const f in a)c[f]=e?new e({type:"optional",innerType:a[f]}):a[f];return B(this,"shape",c),c},checks:[]});return M(t,s)}function $n(e,t,n){const r=x(t._zod.def,{get shape(){const o=t._zod.def.shape,i={...o};if(n)for(const s in n){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(i[s]=new e({type:"nonoptional",innerType:o[s]}))}else for(const s in o)i[s]=new e({type:"nonoptional",innerType:o[s]});return B(this,"shape",i),i}});return M(t,r)}function H(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Zn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function dt(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function ue(e){return typeof e=="string"?e:e?.message}function V(e,t,n){const r=e.message?e.message:ue(e.inst?._zod.def?.error?.(e))??ue(t?.error?.(e))??ue(n.customError?.(e))??ue(n.localeError?.(e))??"Invalid input",{inst:o,continue:i,input:s,...a}=e;return a.path??(a.path=[]),a.message=r,t?.reportInput&&(a.input=s),a}function Ee(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function se(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const pt=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ze,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ht=u("$ZodError",pt),mt=u("$ZodError",pt,{Parent:Error});function Sn(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function On(e,t=n=>n.message){const n={_errors:[]},r=(o,i=[])=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>r({issues:a},[...i,...s.path]));else if(s.code==="invalid_key")r({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")r({issues:s.issues},[...i,...s.path]);else{const a=[...i,...s.path];if(a.length===0)n._errors.push(t(s));else{let c=n,f=0;for(;f<a.length;){const d=a[f];f===a.length-1?(c[d]=c[d]||{_errors:[]},c[d]._errors.push(t(s))):c[d]=c[d]||{_errors:[]},c=c[d],f++}}}};return r(e),n}const Pe=e=>(t,n,r,o)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new X;if(s.issues.length){const a=new(o?.Err??e)(s.issues.map(c=>V(c,i,W())));throw ft(a,o?.callee),a}return s.value},Ie=e=>async(t,n,r,o)=>{const i=r?{...r,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new(o?.Err??e)(s.issues.map(c=>V(c,i,W())));throw ft(a,o?.callee),a}return s.value},_e=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new X;return i.issues.length?{success:!1,error:new(e??ht)(i.issues.map(s=>V(s,o,W())))}:{success:!0,data:i.value}},En=_e(mt),ge=e=>async(t,n,r)=>{const o=r?{...r,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>V(s,o,W())))}:{success:!0,data:i.value}},Pn=ge(mt),In=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Pe(e)(t,n,o)},Tn=e=>(t,n,r)=>Pe(e)(t,n,r),jn=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Ie(e)(t,n,o)},An=e=>async(t,n,r)=>Ie(e)(t,n,r),Rn=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return _e(e)(t,n,o)},Cn=e=>(t,n,r)=>_e(e)(t,n,r),Nn=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return ge(e)(t,n,o)},Dn=e=>async(t,n,r)=>ge(e)(t,n,r),Un=/^[cC][0-9a-z]{6,}$/,Fn=/^[0-9a-z]+$/,Jn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ln=/^[0-9a-vA-V]{20}$/,xn=/^[A-Za-z0-9]{27}$/,Mn=/^[a-zA-Z0-9_-]{21}$/,Wn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Vn=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ve=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Bn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Kn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function qn(){return new RegExp(Kn,"u")}const Gn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Hn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Xn=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Yn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Qn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,_t=/^[A-Za-z0-9_-]*$/,er=/^https?$/,tr=/^\+[1-9]\d{6,14}$/,gt="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",nr=new RegExp(`^${gt}$`);function vt(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function rr(e){return new RegExp(`^${vt(e)}$`)}function or(e){const t=vt({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${gt}T(?:${r})$`)}const sr=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},ir=/^[^A-Z]*$/,ar=/^[^a-z]*$/,D=u("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),cr=u("$ZodCheckMaxLength",(e,t)=>{var n;D.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Se(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const s=Ee(o);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ur=u("$ZodCheckMinLength",(e,t)=>{var n;D.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Se(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const s=Ee(o);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),fr=u("$ZodCheckLengthEquals",(e,t)=>{var n;D.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Se(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,i=o.length;if(i===t.length)return;const s=Ee(o),a=i>t.length;r.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),ve=u("$ZodCheckStringFormat",(e,t)=>{var n,r;D.init(e,t),e._zod.onattach.push(o=>{const i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),lr=u("$ZodCheckRegex",(e,t)=>{ve.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),dr=u("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ir),ve.init(e,t)}),pr=u("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ar),ve.init(e,t)}),hr=u("$ZodCheckIncludes",(e,t)=>{D.init(e,t);const n=Y(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),mr=u("$ZodCheckStartsWith",(e,t)=>{D.init(e,t);const n=new RegExp(`^${Y(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),_r=u("$ZodCheckEndsWith",(e,t)=>{D.init(e,t);const n=new RegExp(`.*${Y(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),gr=u("$ZodCheckOverwrite",(e,t)=>{D.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class vr{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
2
2
|
`).filter(s=>s),o=Math.min(...r.map(s=>s.length-s.trimStart().length)),i=r.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(const s of i)this.content.push(s)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...n,o.join(`
|
|
3
3
|
`))}}const yr={major:4,minor:4,patch:3},E=u("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=yr;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const i of o._zod.onattach)i(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(s,a,c)=>{let f=H(s),d;for(const g of a){if(g._zod.def.when){if(Zn(s)||!g._zod.def.when(s))continue}else if(f)continue;const _=s.issues.length,h=g._zod.check(s);if(h instanceof Promise&&c?.async===!1)throw new X;if(d||h instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await h,s.issues.length!==_&&(f||(f=H(s,_)))});else{if(s.issues.length===_)continue;f||(f=H(s,_))}}return d?d.then(()=>s):s},i=(s,a,c)=>{if(H(s))return s.aborted=!0,s;const f=o(a,r,c);if(f instanceof Promise){if(c.async===!1)throw new X;return f.then(d=>e._zod.parse(d,c))}return e._zod.parse(f,c)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if(a.direction==="backward"){const f=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return f instanceof Promise?f.then(d=>i(d,s,a)):i(f,s,a)}const c=e._zod.parse(s,a);if(c instanceof Promise){if(a.async===!1)throw new X;return c.then(f=>o(f,r,a))}return o(c,r,a)}}w(e,"~standard",()=>({validate:o=>{try{const i=En(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Pn(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),Te=u("$ZodString",(e,t)=>{E.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??sr(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),b=u("$ZodStringFormat",(e,t)=>{ve.init(e,t),Te.init(e,t)}),wr=u("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Vn),b.init(e,t)}),zr=u("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ve(r))}else t.pattern??(t.pattern=Ve());b.init(e,t)}),br=u("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Bn),b.init(e,t)}),kr=u("$ZodURL",(e,t)=>{b.init(e,t),e._zod.check=n=>{try{const r=n.value.trim();if(!t.normalize&&t.protocol?.source===er.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}const o=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),$r=u("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=qn()),b.init(e,t)}),Zr=u("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Mn),b.init(e,t)}),Sr=u("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Un),b.init(e,t)}),Or=u("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Fn),b.init(e,t)}),Er=u("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Jn),b.init(e,t)}),Pr=u("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Ln),b.init(e,t)}),Ir=u("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=xn),b.init(e,t)}),Tr=u("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=or(t)),b.init(e,t)}),jr=u("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=nr),b.init(e,t)}),Ar=u("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=rr(t)),b.init(e,t)}),Rr=u("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Wn),b.init(e,t)}),Cr=u("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Gn),b.init(e,t),e._zod.bag.format="ipv4"}),Nr=u("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Hn),b.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Dr=u("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Xn),b.init(e,t)}),Ur=u("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Yn),b.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[o,i]=r;if(!i)throw new Error;const s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function yt(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Fr=u("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Qn),b.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{yt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Jr(e){if(!_t.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return yt(n)}const Lr=u("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=_t),b.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Jr(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),xr=u("$ZodE164",(e,t)=>{t.pattern??(t.pattern=tr),b.init(e,t)});function Mr(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const Wr=u("$ZodJWT",(e,t)=>{b.init(e,t),e._zod.check=n=>{Mr(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Vr=u("$ZodUnknown",(e,t)=>{E.init(e,t),e._zod.parse=n=>n}),Br=u("$ZodNever",(e,t)=>{E.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Be(e,t,n){e.issues.length&&t.issues.push(...dt(n,e.issues)),t.value[n]=e.value}const Kr=u("$ZodArray",(e,t)=>{E.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let s=0;s<o.length;s++){const a=o[s],c=t.element._zod.run({value:a,issues:[]},r);c instanceof Promise?i.push(c.then(f=>Be(f,n,s))):Be(c,n,s)}return i.length?Promise.all(i).then(()=>n):n}});function pe(e,t,n,r,o,i){const s=n in r;if(e.issues.length){if(o&&i&&!s)return;t.issues.push(...dt(n,e.issues))}if(!s&&!o){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?s&&(t.value[n]=void 0):t.value[n]=e.value}function wt(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=gn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function zt(e,t,n,r,o,i){const s=[],a=o.keySet,c=o.catchall._zod,f=c.def.type,d=c.optin==="optional",g=c.optout==="optional";for(const _ in t){if(_==="__proto__"||a.has(_))continue;if(f==="never"){s.push(_);continue}const h=c.run({value:t[_],issues:[]},r);h instanceof Promise?e.push(h.then(v=>pe(v,n,_,t,d,g))):pe(h,n,_,t,d,g)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const qr=u("$ZodObject",(e,t)=>{if(E.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}const r=Ze(()=>wt(t));w(e._zod,"propValues",()=>{const a=t.shape,c={};for(const f in a){const d=a[f]._zod;if(d.values){c[f]??(c[f]=new Set);for(const g of d.values)c[f].add(g)}}return c});const o=de,i=t.catchall;let s;e._zod.parse=(a,c)=>{s??(s=r.value);const f=a.value;if(!o(f))return a.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),a;a.value={};const d=[],g=s.shape;for(const _ of s.keys){const h=g[_],v=h._zod.optin==="optional",S=h._zod.optout==="optional",k=h._zod.run({value:f[_],issues:[]},c);k instanceof Promise?d.push(k.then(F=>pe(F,a,_,f,v,S))):pe(k,a,_,f,v,S)}return i?zt(d,f,a,c,r.value,e):d.length?Promise.all(d).then(()=>a):a}}),Gr=u("$ZodObjectJIT",(e,t)=>{qr.init(e,t);const n=e._zod.parse,r=Ze(()=>wt(t)),o=_=>{const h=new vr(["shape","payload","ctx"]),v=r.value,S=j=>{const z=We(j);return`shape[${z}]._zod.run({ value: input[${z}], issues: [] }, ctx)`};h.write("const input = payload.value;");const k=Object.create(null);let F=0;for(const j of v.keys)k[j]=`key_${F++}`;h.write("const newResult = {};");for(const j of v.keys){const z=k[j],Z=We(j),ae=_[j],J=ae?._zod?.optin==="optional",U=ae?._zod?.optout==="optional";h.write(`const ${z} = ${S(j)};`),J&&U?h.write(`
|
|
4
4
|
if (${z}.issues.length) {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import{_ as ke,a as Re}from"./BDcIWTTq.js";import{d as Q,o as r,c as d,f as y,g as u,i as e,j as l,v as X,p as F,t as c,l as se,k as n,q as f,m,h as g,_ as Z,x as oe,F as A,y as L,r as J,C as we,s as $e,K as Ce,e as Te,aa as Fe}from"./BrT_Sys2.js";import{_ as je}from"./Sgf5OLhm.js";import{_ as Se}from"./Cf4h8qty.js";import{_ as Pe,a as ze}from"./CMB-NkFa.js";import{_ as Ie}from"./COVRAesU.js";import{_ as Ue}from"./73aPL7Ir.js";import{_ as Ne}from"./BU6xjw05.js";import{_ as Ve}from"./DvXvJzFP.js";import{_ as Ae}from"./Ba4_ydKG.js";import{_ as ie}from"./D13ybpY3.js";import{_ as De}from"./DJHNEqb7.js";import{_ as Ee}from"./Wfk1m0ni.js";import{_ as le}from"./CHIbdzqp.js";import{f as ne,h as ue,B as M,e as Oe}from"./D7P0ML0H.js";import{a as Be,d as Le,_ as We}from"./B6hPf4UR.js";import{_ as He}from"./DpJrGwCr.js";import{_ as de}from"./CoKEjZX7.js";import{u as Me}from"./DUe6xuKQ.js";import{u as re}from"./Dvc1aWpA.js";import{u as Ke}from"./Bpha13F_.js";import{u as Ge}from"./z7PmsnBG.js";import"./DxQq_L07.js";import"./26ll_vBr.js";import"./ByoIgYX_.js";import"./BxRsAYRS.js";import"./vzXhOO8R.js";import"./DATh_1DQ.js";import"./D0-HTQTD.js";import"./rw7Hdll3.js";import"./r3SBLxtE.js";import"./DtXREpk_.js";const Ye={class:"flex items-center gap-3 flex-wrap"},qe={class:"flex items-center gap-1.5"},Je={key:0,class:"text-gray-500"},Qe={key:1},Xe={key:2},Ze={class:"flex items-center gap-1.5 cursor-pointer select-none text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 transition-colors"},et=Q({__name:"HomeFilters",props:{modelValue:{},availableEnvironments:{}},emits:["update:modelValue"],setup(D,{emit:$}){const C=D,v=$,I=g({get:()=>C.modelValue.environments,set:S=>v("update:modelValue",{...C.modelValue,environments:S})}),R=g({get:()=>C.modelValue.fullRunsOnly,set:S=>v("update:modelValue",{...C.modelValue,fullRunsOnly:S})}),U=g(()=>C.modelValue.environments.length>0||!C.modelValue.fullRunsOnly);function N(){v("update:modelValue",{environments:[],fullRunsOnly:!0})}return(S,_)=>{const E=X,o=je,x=Se,h=Z;return r(),d("div",Ye,[D.availableEnvironments.length>0?(r(),y(o,{key:0,modelValue:n(I),"onUpdate:modelValue":_[0]||(_[0]=t=>se(I)?I.value=t:null),items:D.availableEnvironments,multiple:"",placeholder:"All environments",size:"sm",class:"min-w-[160px]"},{default:u(({modelValue:t})=>[e("div",qe,[l(E,{name:"i-lucide-server",class:F(["size-3.5 shrink-0",t.length?"text-primary":"text-gray-400"])},null,8,["class"]),t.length?t.length===1?(r(),d("span",Qe,c(t[0]),1)):(r(),d("span",Xe,c(t.length)+" environments",1)):(r(),d("span",Je,"All environments"))])]),_:1},8,["modelValue","items"])):f("",!0),e("label",Ze,[l(x,{modelValue:n(R),"onUpdate:modelValue":_[1]||(_[1]=t=>se(R)?R.value=t:null),size:"sm"},null,8,["modelValue"]),_[2]||(_[2]=m(" Full runs only ",-1))]),n(U)?(r(),y(h,{key:1,variant:"ghost",size:"sm",color:"neutral",icon:"i-lucide-x",onClick:N},{default:u(()=>[..._[3]||(_[3]=[m(" Reset ",-1)])]),_:1})):f("",!0)])}}}),tt=Object.assign(et,{__name:"HomeFilters"}),st={class:"hidden md:block overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0"},nt={key:0,class:"flex flex-wrap gap-1 mt-0.5"},rt={class:"w-40"},at={key:1,class:"text-gray-400 text-sm"},ot={class:"text-xs text-gray-500 dark:text-gray-400"},it={key:0},lt={key:1,class:"text-gray-400 text-sm"},ut={key:0,class:"tabular-nums text-sm text-gray-600 dark:text-gray-400"},dt={key:1,class:"text-gray-400"},ct={class:"space-y-2 md:hidden"},mt={class:"flex items-start justify-between gap-2"},pt={key:0,class:"flex flex-wrap gap-1"},gt={class:"flex items-center justify-between gap-2 text-xs"},ft={class:"text-gray-500 dark:text-gray-400 truncate"},yt={key:1,class:"text-gray-400"},xt={key:2,class:"shrink-0 tabular-nums text-gray-500 dark:text-gray-400"},_t=Q({__name:"ProjectTrendTable",props:{projects:{},limit:{default:10}},setup(D){const $=D,C={failing:0,flaky:1,passing:2,unknown:3},v=J(!1),I=g(()=>$.projects.length>$.limit),R=g(()=>{const o=[...$.projects].sort((x,h)=>{const t=C[x.tendency]-C[h.tendency];if(t!==0)return t;const T=x.latestFullRun?new Date(x.latestFullRun.startTime).getTime():0;return(h.latestFullRun?new Date(h.latestFullRun.startTime).getTime():0)-T});return v.value?o:o.slice(0,$.limit)});function U(o){return o>=90?"text-green-600 dark:text-green-400":o>=50?"text-yellow-600 dark:text-yellow-400":"text-red-600 dark:text-red-400"}function N(o){switch(o){case"failing":return"text-red-700 dark:text-red-400 bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-800";case"flaky":return"text-amber-700 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20 border-amber-200 dark:border-amber-800";case"passing":return"text-green-700 dark:text-green-400 bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800";default:return"text-gray-500 dark:text-gray-400 bg-gray-50 dark:bg-gray-800 border-gray-200 dark:border-gray-700"}}function S(o){return o==="unknown"?"Unknown":o.charAt(0).toUpperCase()+o.slice(1)}function _(o){switch(o){case"failing":return"i-lucide-trending-down";case"flaky":return"i-lucide-shuffle";case"passing":return"i-lucide-trending-up";default:return"i-lucide-minus"}}const E=[{accessorKey:"name",header:"Project"},{id:"recentRuns",header:"Last 20 runs"},{accessorKey:"tendency",header:"Tendency"},{id:"passRate",header:"Pass rate"},{id:"latestRun",header:"Latest run"},{id:"tests",header:"Tests"}];return(o,x)=>{const h=Z,t=oe,T=Ve,b=Ae,V=X,P=ie,j=De,W=Ee,K=le;return r(),y(K,{icon:"i-lucide-layout-dashboard",title:"Project health",help:"home.project-health"},{actions:u(()=>[n(I)&&!n(v)?(r(),y(h,{key:0,variant:"ghost",size:"sm","trailing-icon":"i-lucide-chevron-down",onClick:x[0]||(x[0]=s=>v.value=!0)},{default:u(()=>[m(" Show all "+c($.projects.length),1)]),_:1})):n(v)?(r(),y(h,{key:1,variant:"ghost",size:"sm","trailing-icon":"i-lucide-chevron-up",onClick:x[1]||(x[1]=s=>v.value=!1)},{default:u(()=>[...x[2]||(x[2]=[m(" Show less ",-1)])]),_:1})):f("",!0),l(h,{to:"/projects",variant:"outline",size:"sm"},{default:u(()=>[...x[3]||(x[3]=[m("View all",-1)])]),_:1})]),default:u(()=>[e("div",st,[l(j,{data:n(R),columns:E,ui:{base:"min-w-[700px]",td:"py-3",th:"py-3 text-xs uppercase tracking-wide"}},{"name-cell":u(({row:s})=>[l(t,{to:`/projects/${s.original.id}`,class:"font-medium text-primary hover:underline truncate block max-w-[200px]"},{default:u(()=>[m(c(s.original.label||s.original.name),1)]),_:2},1032,["to"]),s.original.tags.length>0?(r(),d("div",nt,[(r(!0),d(A,null,L(s.original.tags,k=>(r(),y(T,{key:k.id,text:k.text,color:k.color},null,8,["text","color"]))),128))])):f("",!0)]),"recentRuns-cell":u(({row:s})=>[e("div",rt,[l(b,{runs:s.original.recentRuns,height:28},null,8,["runs"])])]),"tendency-cell":u(({row:s})=>[e("span",{class:F(["inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium border whitespace-nowrap",N(s.original.tendency)])},[l(V,{name:_(s.original.tendency),class:"size-3 shrink-0"},null,8,["name"]),m(" "+c(S(s.original.tendency)),1)],2)]),"passRate-cell":u(({row:s})=>[s.original.latestFullRun?(r(),d("span",{key:0,class:F(["font-semibold tabular-nums text-sm",U(("passRate"in o?o.passRate:n(M))(s.original.latestFullRun))])},c(("passRate"in o?o.passRate:n(M))(s.original.latestFullRun))+"% ",3)):(r(),d("span",at,"—"))]),"latestRun-cell":u(({row:s})=>[s.original.latestFullRun?(r(),y(t,{key:0,to:`/test-runs/${s.original.latestFullRun.id}`,class:"flex items-center gap-2 min-w-[140px] hover:opacity-80 transition-opacity"},{default:u(()=>[l(P,{status:s.original.latestFullRun.status},null,8,["status"]),e("div",ot,[e("div",null,c(("formatRelativeTime"in o?o.formatRelativeTime:n(ne))(s.original.latestFullRun.startTime)),1),s.original.latestFullRun.duration?(r(),d("div",it,c(("formatDuration"in o?o.formatDuration:n(ue))(s.original.latestFullRun.duration)),1)):f("",!0)])]),_:2},1032,["to"])):(r(),d("span",lt,"No full runs"))]),"tests-cell":u(({row:s})=>[s.original.latestFullRun?(r(),d("span",ut,c(s.original.latestFullRun.passedTests)+"/"+c(s.original.latestFullRun.totalTests),1)):(r(),d("span",dt,"—"))]),_:1},8,["data"])]),e("div",ct,[(r(!0),d(A,null,L(n(R),s=>(r(),d("div",{key:s.id,class:"rounded-lg border border-default p-3 space-y-2"},[e("div",mt,[l(t,{to:`/projects/${s.id}`,class:"font-medium text-primary hover:underline truncate"},{default:u(()=>[m(c(s.label||s.name),1)]),_:2},1032,["to"]),e("span",{class:F(["inline-flex shrink-0 items-center gap-1 rounded border px-1.5 py-0.5 text-xs font-medium whitespace-nowrap",N(s.tendency)])},[l(V,{name:_(s.tendency),class:"size-3 shrink-0"},null,8,["name"]),m(" "+c(S(s.tendency)),1)],2)]),s.tags.length>0?(r(),d("div",pt,[(r(!0),d(A,null,L(s.tags,k=>(r(),y(T,{key:k.id,text:k.text,color:k.color},null,8,["text","color"]))),128))])):f("",!0),l(b,{runs:s.recentRuns,height:24},null,8,["runs"]),e("div",gt,[s.latestFullRun?(r(),y(t,{key:0,to:`/test-runs/${s.latestFullRun.id}`,class:"flex items-center gap-1.5 min-w-0 hover:opacity-80"},{default:u(()=>[l(P,{status:s.latestFullRun.status},null,8,["status"]),e("span",ft,c(("formatRelativeTime"in o?o.formatRelativeTime:n(ne))(s.latestFullRun.startTime)),1)]),_:2},1032,["to"])):(r(),d("span",yt,"No full runs")),s.latestFullRun?(r(),d("span",xt,[e("span",{class:F(["font-semibold",U(("passRate"in o?o.passRate:n(M))(s.latestFullRun))])},c(("passRate"in o?o.passRate:n(M))(s.latestFullRun))+"% ",3),m(" · "+c(s.latestFullRun.passedTests)+"/"+c(s.latestFullRun.totalTests),1)])):f("",!0)])]))),128))]),n(R).length===0?(r(),y(W,{key:0,text:"No projects yet",padded:!1,class:"py-8"})):f("",!0)]),_:1})}}}),ht=Object.assign(_t,{__name:"ProjectTrendTable"}),vt={class:"flex items-center gap-3"},bt={class:"p-2 bg-primary/10 rounded-lg shrink-0"},kt={class:"text-xl font-semibold inline-flex items-center gap-1"},Rt={class:"text-sm text-gray-500 dark:text-gray-400"},wt={class:"flex flex-col items-center shrink-0"},$t={key:1},Ct={key:0,class:"w-px flex-1 mt-2 min-h-6 bg-gray-200 dark:bg-gray-700"},Tt={class:"flex-1 pb-6"},Ft={class:"flex items-center gap-2 mb-1"},jt={class:"font-medium"},St={class:"text-sm text-gray-600 dark:text-gray-400 mb-3"},Pt={class:"border-t border-gray-200 dark:border-gray-700 pt-4 mt-2"},zt={key:0,class:"mt-4 space-y-6"},It={class:"text-sm text-gray-600 dark:text-gray-400 mb-3"},Ut={class:"flex items-center justify-between text-sm text-gray-500 dark:text-gray-400"},Nt=`// tests/fixtures.ts
|
|
2
|
+
import { test as base, expect } from '@playwright/test'
|
|
3
|
+
import { piwiFixtures } from '@piwitests/reporter'
|
|
4
|
+
|
|
5
|
+
export const test = base.extend(piwiFixtures)
|
|
6
|
+
export { expect }`,Vt=`// your test file
|
|
7
|
+
import { test, expect } from './fixtures'
|
|
8
|
+
|
|
9
|
+
test('homepage loads', async ({ page }) => {
|
|
10
|
+
await page.goto('/')
|
|
11
|
+
// network requests, web vitals, console errors, and ARIA snapshots
|
|
12
|
+
// are captured automatically and appear in the dashboard
|
|
13
|
+
})`,At=`// tests/fixtures.ts
|
|
14
|
+
import { test as base } from '@playwright/test'
|
|
15
|
+
import { extendPiwiFixtures } from '@piwitests/reporter'
|
|
16
|
+
|
|
17
|
+
export const test = extendPiwiFixtures(base)
|
|
18
|
+
export { expect } from '@playwright/test'`,Dt=Q({__name:"GetStartedWizard",setup(D){const $=Ce(),C=g(()=>!!$.public.authEnabled),v=Me(),{data:I}=re("/api/desktop/reporter-config",{immediate:v,default:()=>null},"$1biRnknxaz"),R=J("http://localhost:3000");we(()=>{R.value=window.location.origin});const U=g(()=>v&&I.value?`
|
|
19
|
+
apiKey: '${I.value.token}',`:C.value?`
|
|
20
|
+
apiKey: process.env.PIWI_API_KEY,`:""),N=g(()=>`import { defineConfig } from '@playwright/test'
|
|
21
|
+
|
|
22
|
+
export default defineConfig({
|
|
23
|
+
reporter: [
|
|
24
|
+
['list'],
|
|
25
|
+
['@piwitests/reporter', {
|
|
26
|
+
serverUrl: '${R.value}',
|
|
27
|
+
projectName: 'my-project',${U.value}
|
|
28
|
+
}],
|
|
29
|
+
],
|
|
30
|
+
use: {
|
|
31
|
+
trace: 'retain-on-failure',
|
|
32
|
+
},
|
|
33
|
+
})`),S=g(()=>`import { defineConfig } from '@playwright/test'
|
|
34
|
+
import PiwiDashboard from '@piwitests/reporter'
|
|
35
|
+
|
|
36
|
+
export default PiwiDashboard.wrapConfig(
|
|
37
|
+
defineConfig({
|
|
38
|
+
// your existing config
|
|
39
|
+
use: {
|
|
40
|
+
trace: 'retain-on-failure',
|
|
41
|
+
},
|
|
42
|
+
}),
|
|
43
|
+
{
|
|
44
|
+
serverUrl: '${R.value}',
|
|
45
|
+
projectName: 'my-project',${U.value}
|
|
46
|
+
},
|
|
47
|
+
)`),_=g(()=>{const h=[{title:"Start the dashboard",description:"You're already here — the dashboard is running.",done:!0},{title:"Install the reporter",description:"Add the Piwi reporter to your Playwright project.",code:"npm install --save-dev @piwitests/reporter",lang:"bash"}];return C.value&&h.push({title:"Create an API key",description:"Authentication is enabled on this instance, so the reporter needs a key to submit results. Create one, then set it as PIWI_API_KEY in your CI secrets (used by the snippet below).",action:"create-api-key"}),h.push({title:"Configure Playwright",description:v?"Add the reporter to your playwright.config.ts. The apiKey below is this app's local access token.":"Add the reporter to your playwright.config.ts.",code:N.value,lang:"typescript"},{title:"Run your tests",description:"Results appear in the dashboard automatically. The project is created on first submit.",code:"npx playwright test",lang:"bash"}),h.map((t,T)=>({id:T+1,...t}))}),E=["zero","one","two","three","four","five","six"],o=g(()=>E[_.value.length]??String(_.value.length)),x=J(!1);return(h,t)=>{const T=X,b=We,V=$e,P=Z,j=He,W=Be,K=de;return r(),y(K,null,{header:u(()=>[e("div",vt,[e("div",bt,[l(T,{name:"i-lucide-rocket",class:"size-5 text-primary"})]),e("div",null,[e("h2",kt,[t[1]||(t[1]=m(" Get started in 60 seconds ",-1)),l(b,{topic:"home.get-started"})]),e("p",Rt,"Send your first test run in "+c(n(o))+" steps",1)])])]),footer:u(()=>[e("div",Ut,[e("span",null,[t[18]||(t[18]=m("Need more options? See the ",-1)),l(W,{to:"reporter","no-icon":"",class:"text-primary hover:underline"},{default:u(()=>[...t[17]||(t[17]=[m("full reporter docs",-1)])]),_:1}),t[19]||(t[19]=m(".",-1))]),l(P,{to:n(Le)("demo/"),target:"_blank",variant:"ghost",size:"sm",color:"neutral","trailing-icon":"i-lucide-external-link"},{default:u(()=>[...t[20]||(t[20]=[m(" View demo with sample data ",-1)])]),_:1},8,["to"])])]),default:u(()=>[e("div",null,[(r(!0),d(A,null,L(n(_),(s,k)=>(r(),d("div",{key:s.id,class:"flex gap-4"},[e("div",wt,[e("div",{class:F(["flex size-8 items-center justify-center rounded-full text-sm font-semibold",s.done?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-primary/10 text-primary"])},[s.done?(r(),y(T,{key:0,name:"i-lucide-check",class:"size-4"})):(r(),d("span",$t,c(s.id),1))],2),k<n(_).length-1?(r(),d("div",Ct)):f("",!0)]),e("div",Tt,[e("div",Ft,[e("h3",jt,c(s.title),1),s.done?(r(),y(V,{key:0,color:"success",variant:"subtle",size:"xs"},{default:u(()=>[...t[2]||(t[2]=[m("Done",-1)])]),_:1})):f("",!0)]),e("p",St,c(s.description),1),s.action==="create-api-key"?(r(),y(P,{key:0,to:"/settings/users",icon:"i-lucide-key-round",size:"sm",variant:"soft"},{default:u(()=>[...t[3]||(t[3]=[m(" Create an API key ",-1)])]),_:1})):f("",!0),s.code?(r(),y(j,{key:1,code:s.code,lang:s.lang},null,8,["code","lang"])):f("",!0)])]))),128)),e("div",Pt,[e("button",{class:"flex items-center gap-2 text-sm font-medium text-gray-600 dark:text-gray-300 hover:text-primary dark:hover:text-primary transition-colors w-full text-left",onClick:t[0]||(t[0]=s=>x.value=!n(x))},[l(T,{name:"i-lucide-chevron-right",class:F(["size-4 transition-transform duration-200",n(x)?"rotate-90":""])},null,8,["class"]),t[4]||(t[4]=m(" Go further — simpler config & capture fixtures ",-1))]),n(x)?(r(),d("div",zt,[e("div",null,[t[5]||(t[5]=e("h4",{class:"font-medium text-sm mb-1"},[m(" Simpler config with "),e("code",{class:"text-primary text-xs"},"wrapConfig")],-1)),t[6]||(t[6]=e("p",{class:"text-sm text-gray-600 dark:text-gray-400 mb-3"},[m(" Instead of manually adding the reporter array entry, "),e("code",{class:"text-xs bg-gray-100 dark:bg-gray-800 px-1 py-0.5 rounded"},"wrapConfig"),m(" auto-injects the reporter and chains the global setup in one call. It also registers the run on the dashboard "),e("em",null,"before"),m(" your "),e("code",{class:"text-xs bg-gray-100 dark:bg-gray-800 px-1 py-0.5 rounded"},"globalSetup"),m(" runs, so the dashboard shows an initializing state during setup. ")],-1)),l(j,{code:n(S),lang:"typescript"},null,8,["code"])]),e("div",null,[t[14]||(t[14]=e("h4",{class:"font-medium text-sm mb-1"},[m(" Capture fixtures — network, Web Vitals, console & locator healing with "),e("code",{class:"text-primary text-xs"},"piwiFixtures")],-1)),e("p",It,[t[8]||(t[8]=m(" Extend your Playwright ",-1)),t[9]||(t[9]=e("code",{class:"text-xs bg-gray-100 dark:bg-gray-800 px-1 py-0.5 rounded"},"test",-1)),t[10]||(t[10]=m(" with ",-1)),t[11]||(t[11]=e("code",{class:"text-xs bg-gray-100 dark:bg-gray-800 px-1 py-0.5 rounded"},"piwiFixtures",-1)),t[12]||(t[12]=m(" to automatically capture network timing, browser Web Vitals, console errors, ARIA snapshots on failure, and the locator snapshots that power locator healing. See the ",-1)),l(W,{to:"capture-fixtures","no-icon":"",class:"text-primary hover:underline"},{default:u(()=>[...t[7]||(t[7]=[m("capture fixtures guide",-1)])]),_:1}),t[13]||(t[13]=m(". ",-1))]),t[15]||(t[15]=e("p",{class:"text-xs font-semibold uppercase tracking-wide text-gray-400 dark:text-gray-500 mb-2"}," Option A — extend your existing fixtures ",-1)),l(j,{code:Nt,lang:"typescript",class:"mb-3"}),l(j,{code:Vt,lang:"typescript",class:"mb-4"}),t[16]||(t[16]=e("p",{class:"text-xs font-semibold uppercase tracking-wide text-gray-400 dark:text-gray-500 mb-2"}," Option B — one-line extend ",-1)),l(j,{code:At,lang:"typescript"})])])):f("",!0)])])]),_:1})}}}),Et=Object.assign(Dt,{__name:"GetStartedWizard"}),Ot={key:0,class:"p-6"},Bt={key:1,class:"p-6 space-y-8","aria-busy":"true"},Lt={class:"grid grid-cols-1 xl:grid-cols-3 gap-6 items-start"},Wt={class:"xl:col-span-2 space-y-3"},Ht={class:"space-y-3"},Mt={key:2,class:"p-6 space-y-8"},Kt={key:1,class:"flex flex-wrap items-center gap-x-8 gap-y-3 text-sm border border-gray-200 dark:border-gray-700 rounded-xl px-6 py-4 bg-gray-50 dark:bg-gray-900/50"},Gt={class:"flex items-center gap-1.5"},Yt={class:"font-semibold tabular-nums"},qt={class:"flex items-center gap-1.5"},Jt={class:"flex items-center gap-1.5"},Qt={key:0,class:"flex items-center gap-1.5"},Xt={class:"font-semibold tabular-nums"},Zt={class:"flex items-center gap-1.5"},es={class:"font-semibold tabular-nums"},ts={key:2,class:"grid grid-cols-1 xl:grid-cols-3 gap-6 items-start"},ss={class:"xl:col-span-2"},ns={class:"divide-y divide-gray-100 dark:divide-gray-800 text-sm"},rs={class:"flex-1 min-w-0"},as={class:"font-medium truncate"},os={class:"text-xs text-gray-400"},is={class:"text-right tabular-nums shrink-0"},ls={key:0,class:"text-xs text-gray-400"},us={key:3,class:"text-center py-12 text-gray-500 dark:text-gray-400"},ds={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4"},cs={class:"flex flex-col gap-3 h-full"},ms={class:"p-2 bg-primary/10 rounded-lg w-fit"},ps={class:"text-xs font-semibold uppercase tracking-wide text-primary mb-1"},gs={class:"font-semibold mb-1"},fs={class:"text-sm text-gray-600 dark:text-gray-400"},ae=6,Ys=Q({__name:"index",setup(D){Te({title:"Piwi Dashboard"});const{data:$,error:C,refresh:v,status:I}=re("/api/projects/overview",{lazy:!0,default:()=>[]},"$cnA6-rHww6"),{data:R,error:U,refresh:N}=re("/api/test-runs/recent",{lazy:!0},"$LEgADC56ri");Ke(()=>Promise.all([v(),N()]));const S=g(()=>I.value==="pending"&&!$.value?.length),_=g(()=>C.value||U.value);function E(){v(),N()}const o=Ge("piwi-home-filters",{default:()=>({environments:[],fullRunsOnly:!0}),encode:i=>JSON.stringify(i),decode:i=>{try{return i?JSON.parse(i):{environments:[],fullRunsOnly:!0}}catch{return{environments:[],fullRunsOnly:!0}}}}),x=g(()=>{const i=new Set;for(const a of R.value??[])a.environment&&i.add(a.environment);for(const a of $.value??[])for(const w of a.recentRuns)w.environment&&i.add(w.environment);return[...i].sort()});function h(i){return o.value.environments.length===0?!0:!!i&&o.value.environments.includes(i)}const t=g(()=>{let i=R.value??[];return o.value.fullRunsOnly&&(i=i.filter(a=>a.isFullRun)),o.value.environments.length>0&&(i=i.filter(a=>h(a.environment))),i}),T=g(()=>{let i=$.value??[];return o.value.environments.length>0&&(i=i.map(a=>({...a,recentRuns:a.recentRuns.filter(w=>h(w.environment))})).filter(a=>a.recentRuns.length>0)),i}),b=g(()=>{const i=T.value,a=i.length,w=i.filter(z=>z.tendency==="failing").length,H=i.filter(z=>z.tendency==="flaky").length;let O=0,G=0;for(const z of i)z.latestFullRun&&(O+=z.latestFullRun.passedTests,G+=z.latestFullRun.totalTests);const Y=G>0?Math.round(O/G*100):null,te=Date.now()-1440*60*1e3,B=t.value.filter(z=>new Date(z.startTime).getTime()>te).length;return{totalProjects:a,failingNow:w,flakyNow:H,avgPassRate:Y,runs24h:B}}),V=new Set(["running","initialising","finalizing"]),P=J(!1),j=g(()=>[...t.value].sort((a,w)=>{const H=V.has(a.status)?0:1,O=V.has(w.status)?0:1;return H!==O?H-O:new Date(w.startTime).getTime()-new Date(a.startTime).getTime()})),W=g(()=>P.value?j.value:j.value.slice(0,ae)),K=g(()=>j.value.length>ae),s=g(()=>t.value.length>0),k=g(()=>($.value?.length??0)>0),ee=g(()=>o.value.fullRunsOnly?(R.value??[]).filter(w=>h(w.environment)).filter(w=>!w.isFullRun).length:0);function ce(){o.value={...o.value,fullRunsOnly:!1}}function me(i){const a=M(i);return a>=90?"text-green-600 dark:text-green-400":a>=50?"text-yellow-600 dark:text-yellow-400":"text-red-600 dark:text-red-400"}function pe(i){return V.has(i)?"border-l-blue-400":i==="passed"?"border-l-green-500":i==="failed"||i==="timedout"||i==="interrupted"?"border-l-red-500":"border-l-gray-300 dark:border-l-gray-600"}const ge=[{icon:"i-lucide-radio",tagline:"Watch your CI run live",title:"Live streaming",description:"Follow test execution in real time. Investigate failures while the suite is still running — no waiting for the CI job to finish."},{icon:"i-lucide-layers",tagline:"10 failures, 2 root causes",title:"Failure clustering",description:"Tests sharing the same error are grouped automatically. Triage one cluster instead of scrolling through unrelated failures."},{icon:"i-lucide-brain-circuit",tagline:"Diagnosis grounded in your code",title:"AI diagnosis",description:"AI analyzes failure clusters using your actual SCM diff, trace files, and run history — not a generic prompt."},{icon:"i-lucide-archive",tagline:"Every run, forever",title:"Permanent test intelligence",description:"Test results, traces, and HTML reports stored permanently. Compare runs, track flakiness trends, and never lose a CI result again."}];return(i,a)=>{const w=ke,H=Re,O=tt,G=ze,Y=Z,te=Ie,B=Ue,z=Ne,q=X,fe=ht,ye=ie,xe=oe,_e=le,he=Et,ve=de,be=Pe;return r(),y(be,{id:"home"},{header:u(()=>[l(G,null,Fe({leading:u(()=>[l(w),l(H,{items:[{label:"Home",icon:"i-lucide-house",to:"/"}]})]),_:2},[n(k)?{name:"trailing",fn:u(()=>[l(O,{modelValue:n(o),"onUpdate:modelValue":a[0]||(a[0]=p=>se(o)?o.value=p:null),"available-environments":n(x)},null,8,["modelValue","available-environments"])]),key:"0"}:void 0]),1024)]),body:u(()=>[n(_)?(r(),d("div",Ot,[l(te,{text:`Couldn't load the dashboard: ${n(Oe)(n(_))}`},{action:u(()=>[l(Y,{size:"sm",color:"neutral",variant:"outline",icon:"i-lucide-refresh-cw",onClick:E},{default:u(()=>[...a[3]||(a[3]=[m(" Retry ",-1)])]),_:1})]),_:1},8,["text"])])):n(S)?(r(),d("div",Bt,[a[4]||(a[4]=e("span",{class:"sr-only",role:"status"},"Loading dashboard…",-1)),l(B,{class:"h-14 w-full rounded-xl"}),e("div",Lt,[e("div",Wt,[l(B,{class:"h-7 w-40"}),l(B,{class:"h-72 w-full rounded-lg"})]),e("div",Ht,[l(B,{class:"h-7 w-32"}),(r(),d(A,null,L(5,p=>l(B,{key:p,class:"h-12 w-full rounded-lg"})),64))])])])):(r(),d("div",Mt,[n(ee)>0?(r(),y(z,{key:0,icon:"i-lucide-info",color:"primary",variant:"subtle",title:n(ee)===1?"1 partial run is hidden":`${n(ee)} partial runs are hidden`,description:"The “Full runs only” filter hides runs that only cover part of the suite (e.g. a single spec or --grep).",actions:[{label:"Show them",color:"primary",variant:"solid",size:"xs",onClick:ce}]},null,8,["title","actions"])):f("",!0),n(k)?(r(),d("div",Kt,[e("div",Gt,[l(q,{name:"i-lucide-folder",class:"size-4 text-primary shrink-0"}),e("span",Yt,c(n(b).totalProjects),1),a[5]||(a[5]=e("span",{class:"text-gray-500"},"projects",-1))]),e("div",qt,[e("div",{class:F(["w-2 h-2 rounded-full shrink-0",n(b).failingNow>0?"bg-red-500":"bg-green-500"])},null,2),e("span",{class:F(["font-semibold tabular-nums",n(b).failingNow>0?"text-red-600 dark:text-red-400":""])},c(n(b).failingNow),3),a[6]||(a[6]=e("span",{class:"text-gray-500"},"failing now",-1))]),e("div",Jt,[e("div",{class:F(["w-2 h-2 rounded-full shrink-0",n(b).flakyNow>0?"bg-amber-400":"bg-gray-300 dark:bg-gray-600"])},null,2),e("span",{class:F(["font-semibold tabular-nums",n(b).flakyNow>0?"text-amber-600 dark:text-amber-400":""])},c(n(b).flakyNow),3),a[7]||(a[7]=e("span",{class:"text-gray-500"},"flaky",-1))]),n(b).avgPassRate!==null?(r(),d("div",Qt,[l(q,{name:"i-lucide-check-circle",class:"size-4 text-green-500 shrink-0"}),e("span",Xt,c(n(b).avgPassRate)+"%",1),a[8]||(a[8]=e("span",{class:"text-gray-500"},"avg pass rate",-1))])):f("",!0),e("div",Zt,[l(q,{name:"i-lucide-play-circle",class:"size-4 text-primary shrink-0"}),e("span",es,c(n(b).runs24h),1),a[9]||(a[9]=e("span",{class:"text-gray-500"},"runs today",-1))])])):f("",!0),n(k)||n(s)?(r(),d("div",ts,[e("div",ss,[n(k)?(r(),y(fe,{key:0,projects:n(T)},null,8,["projects"])):f("",!0)]),n(s)?(r(),y(_e,{key:0,icon:"i-lucide-activity",title:"Recent activity"},{actions:u(()=>[n(K)&&!n(P)?(r(),y(Y,{key:0,variant:"ghost",size:"sm","trailing-icon":"i-lucide-chevron-down",onClick:a[1]||(a[1]=p=>P.value=!0)},{default:u(()=>[m(" Show all "+c(n(j).length),1)]),_:1})):n(P)?(r(),y(Y,{key:1,variant:"ghost",size:"sm","trailing-icon":"i-lucide-chevron-up",onClick:a[2]||(a[2]=p=>P.value=!1)},{default:u(()=>[...a[10]||(a[10]=[m(" Show less ",-1)])]),_:1})):f("",!0)]),default:u(()=>[e("div",ns,[(r(!0),d(A,null,L(n(W),p=>(r(),y(xe,{key:p.id,to:`/test-runs/${p.id}`,class:F(["flex items-center gap-3 py-3 pl-3 border-l-2 hover:bg-gray-50 dark:hover:bg-gray-800/60 rounded-r transition-colors",pe(p.status)])},{default:u(()=>[l(ye,{status:p.status},null,8,["status"]),e("div",rs,[e("div",as,c(p.projectLabel||p.projectName),1),e("div",os,"Run #"+c(p.id)+" · "+c(("formatRelativeTime"in i?i.formatRelativeTime:n(ne))(p.startTime)),1)]),e("div",is,[e("div",{class:F(me(p))},c(("passRate"in i?i.passRate:n(M))(p))+"%",3),p.duration?(r(),d("div",ls,c(("formatDuration"in i?i.formatDuration:n(ue))(p.duration)),1)):f("",!0)])]),_:2},1032,["to","class"]))),128))])]),_:1})):f("",!0)])):f("",!0),n(k)&&!n(s)&&n(T).length===0?(r(),d("div",us,[l(q,{name:"i-lucide-filter-x",class:"size-8 mx-auto mb-2 opacity-40"}),a[11]||(a[11]=e("p",null,"No runs match the current filters.",-1))])):f("",!0),n(k)?f("",!0):(r(),d(A,{key:4},[l(he),e("div",ds,[(r(),d(A,null,L(ge,p=>l(ve,{key:p.title,class:"flex flex-col"},{default:u(()=>[e("div",cs,[e("div",ms,[l(q,{name:p.icon,class:"size-5 text-primary"},null,8,["name"])]),e("div",null,[e("p",ps,c(p.tagline),1),e("h3",gs,c(p.title),1),e("p",fs,c(p.description),1)])])]),_:2},1024)),64))])],64))]))]),_:1})}}});export{Ys as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aL as Z,Y as ee,d as B,W as Ie,b5 as W,bW as Se,ax as Le,X as fe,B as qe,o as w,f as q,g as K,T as D,k as n,q as pe,G as O,V as P,ba as ve,r as S,bb as Q,b6 as Ke,bT as Ve,bS as me,j as he,Q as z,H as ge,c6 as Te,C as He,ab as Be,h as H,bo as Re,ay as ye,U as te,S as be,bp as De,aJ as Pe,a0 as Ne,c7 as Me,c8 as Oe,bi as ze,c9 as $e,c as re,F as ue,y as We,ae as Ge,O as Ue,ca as je,aF as Ye}from"./BPKwYP2Q.js";import{u as Xe}from"./jIF87ALb.js";import{V as Je}from"./mGJLLqyN.js";import{u as Qe}from"./d5ZB3uxF.js";function $(o,a,i){const t=o.findIndex(v=>Z(v,a)),p=o.findIndex(v=>Z(v,i));if(t===-1||p===-1)return[];const[d,g]=[t,p].sort((v,m)=>v-m);return o.slice(d,g+1)}function Ze(){return{ALT:"Alt",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",BACKSPACE:"Backspace",CAPS_LOCK:"CapsLock",CONTROL:"Control",DELETE:"Delete",END:"End",ENTER:"Enter",ESCAPE:"Escape",F1:"F1",F10:"F10",F11:"F11",F12:"F12",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",HOME:"Home",META:"Meta",PAGE_DOWN:"PageDown",PAGE_UP:"PageUp",SHIFT:"Shift",SPACE:" ",TAB:"Tab",CTRL:"Control",ASTERISK:"*",SPACE_CODE:"Space"}}function de(o){return o?.querySelector("[data-state=checked]")}function et(o,a,i){return o===void 0?!1:Array.isArray(o)?o.some(t=>L(t,a,i)):L(o,a,i)}function L(o,a,i){return o===void 0||a===void 0?!1:typeof o=="string"?o===a:typeof i=="function"?i(o,a):typeof i=="string"?o?.[i]===a?.[i]:Z(o,a)}const[G,tt]=ee("ListboxRoot");var at=B({__name:"ListboxRoot",props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},multiple:{type:Boolean,required:!1},orientation:{type:String,required:!1,default:"vertical"},dir:{type:String,required:!1},disabled:{type:Boolean,required:!1},selectionBehavior:{type:String,required:!1,default:"toggle"},highlightOnHover:{type:Boolean,required:!1},by:{type:[String,Function],required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","highlight","entryFocus","leave"],setup(o,{expose:a,emit:i}){const t=o,p=i,{multiple:d,highlightOnHover:g,orientation:v,disabled:m,selectionBehavior:k,dir:E}=Ie(t),{getItems:x}=W({isProvider:!0}),{handleTypeaheadSearch:l}=Se(),{primitiveElement:u,currentElement:c}=ve(),r=Ze(),_=Le(E),h=Xe(c),A=S(),V=S(!1),T=S(!0),y=fe(t,"modelValue",p,{defaultValue:t.defaultValue??(d.value?[]:void 0),passive:t.modelValue===void 0,deep:!0});function xe(e){if(V.value=!0,t.multiple){const s=Array.isArray(y.value)?[...y.value]:[],f=s.findIndex(b=>L(b,e,t.by));t.selectionBehavior==="toggle"?(f===-1?s.push(e):s.splice(f,1),y.value=s):(y.value=[e],A.value=e)}else t.selectionBehavior==="toggle"&&L(y.value,e,t.by)?y.value=void 0:y.value=e;setTimeout(()=>{V.value=!1},1)}const C=S(null),U=S(null),R=S(!1),j=S(!1),ae=Q(),Y=Q(),ie=Q();function X(){return x().map(e=>e.ref).filter(e=>e.dataset.disabled!=="")}function I(e,s=!0,f){if(!e)return;C.value=e,(f??T.value)&&C.value.focus(),s&&C.value.scrollIntoView({block:"nearest"});const b=x().find(F=>F.ref===e);p("highlight",b)}function _e(e){if(R.value)ie.trigger(e);else{const s=x().find(f=>L(f.value,e,t.by));s&&(C.value=s.ref,I(s.ref))}}function Ce(e){if(C.value&&C.value.isConnected){if(e.ctrlKey||e.metaKey||e.altKey)return;e.preventDefault(),e.stopPropagation(),j.value||C.value.click()}}function Ee(e){if(T.value){if(V.value=!0,R.value)Y.trigger(e);else{const s=e.altKey||e.ctrlKey||e.metaKey;if(s&&e.key==="a"&&d.value){const f=x(),b=f.map(N=>N.value);y.value=[...b],e.preventDefault();const F=f.at(-1);F&&I(F.ref)}else if(!s){const f=l(e.key,x());f&&I(f)}}setTimeout(()=>{V.value=!1},1)}}function Fe(){j.value=!0}function ke(){O(()=>{j.value=!1})}function ne(){O(()=>{const e=new KeyboardEvent("keydown",{key:"PageUp"});oe(e)})}function J(e){const s=C.value;s?.isConnected&&(U.value=s),C.value=null,p("leave",e)}function Ae(e){const s=new CustomEvent("listbox.entryFocus",{bubbles:!1,cancelable:!0});if(e.currentTarget?.dispatchEvent(s),p("entryFocus",s),!s.defaultPrevented)if(U.value)I(U.value);else{const f=X()?.[0];I(f)}}function oe(e){const s=Ke(e,v.value,_.value);if(!s)return;let f=X();if(C.value){if(s==="last")f.reverse();else if(s==="prev"||s==="next"){s==="prev"&&f.reverse();const b=f.indexOf(C.value);f=f.slice(b+1)}we(e,f[0])}if(f.length){const b=!C.value&&s==="prev"?f.length-1:0;I(f[b])}if(R.value)return Y.trigger(e)}function we(e,s){if(!(R.value||t.selectionBehavior!=="replace"||!d.value||!Array.isArray(y.value)||(e.altKey||e.ctrlKey||e.metaKey)&&!e.shiftKey)&&e.shiftKey){const b=x().filter(M=>M.ref.dataset.disabled!=="");let F=b.find(M=>M.ref===s)?.value;if(e.key===r.END?F=b.at(-1)?.value:e.key===r.HOME&&(F=b[0]?.value),!F||!A.value)return;const N=$(b.map(M=>M.value),A.value,F);y.value=N}}async function le(e,s=!0){if(Ve)if(await O(),R.value)ae.trigger({event:e,scroll:s});else{const f=X(),b=f.find(N=>N.dataset.state==="checked"),F=s?void 0:!1;b?I(b,s,F):f.length&&I(f[0],s,F)}}let se=!1;return qe(y,()=>{if(!V.value){const e=se;se=!0,O(()=>{le(void 0,e)})}},{immediate:!0,deep:!0}),a({highlightedElement:C,highlightItem:_e,highlightFirstItem:ne,highlightSelected:le,getItems:x}),tt({modelValue:y,onValueChange:xe,multiple:d,orientation:v,dir:_,disabled:m,highlightOnHover:g,highlightedElement:C,isVirtual:R,virtualFocusHook:ae,virtualKeydownHook:Y,virtualHighlightHook:ie,by:t.by,firstValue:A,selectionBehavior:k,focusable:T,onLeave:J,onEnter:Ae,changeHighlight:I,onKeydownEnter:Ce,onKeydownNavigation:oe,onKeydownTypeAhead:Ee,onCompositionStart:Fe,onCompositionEnd:ke,highlightFirstItem:ne}),(e,s)=>(w(),q(n(P),{ref_key:"primitiveElement",ref:u,as:e.as,"as-child":e.asChild,dir:n(_),"data-disabled":n(m)?"":void 0,onPointerleave:J,onFocusout:s[0]||(s[0]=async f=>{const b=f.relatedTarget||f.target;await O(),C.value&&n(c)&&!n(c).contains(b)&&J(f)})},{default:K(()=>[D(e.$slots,"default",{modelValue:n(y)}),n(h)&&e.name?(w(),q(n(Je),{key:0,name:e.name,value:n(y),disabled:n(m),required:e.required},null,8,["name","value","disabled","required"])):pe("v-if",!0)]),_:3},8,["as","as-child","dir","data-disabled"]))}}),yt=at,it=B({__name:"ListboxContent",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(o){const{CollectionSlot:a}=W(),i=G(),t=me(!1,10);return(p,d)=>(w(),q(n(a),null,{default:K(()=>[he(n(P),{role:"listbox",as:p.as,"as-child":p.asChild,tabindex:n(i).focusable.value?n(i).highlightedElement.value?"-1":"0":"-1","aria-orientation":n(i).orientation.value,"aria-multiselectable":!!n(i).multiple.value,"data-orientation":n(i).orientation.value,onMousedown:d[0]||(d[0]=ge(g=>t.value=!0,["left"])),onFocus:d[1]||(d[1]=g=>{n(t)||n(i).onEnter(g)}),onKeydown:[d[2]||(d[2]=z(g=>{n(i).orientation.value==="vertical"&&(g.key==="ArrowLeft"||g.key==="ArrowRight")||n(i).orientation.value==="horizontal"&&(g.key==="ArrowUp"||g.key==="ArrowDown")||(g.preventDefault(),n(i).focusable.value&&n(i).onKeydownNavigation(g))},["down","up","left","right","home","end"])),z(n(i).onKeydownEnter,["enter"]),n(i).onKeydownTypeAhead]},{default:K(()=>[D(p.$slots,"default")]),_:3},8,["as","as-child","tabindex","aria-orientation","aria-multiselectable","data-orientation","onKeydown"])]),_:3}))}}),bt=it,nt=B({__name:"ListboxFilter",props:{modelValue:{type:String,required:!1},autoFocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"input"}},emits:["update:modelValue"],setup(o,{emit:a}){const i=o,p=fe(i,"modelValue",a,{defaultValue:"",passive:i.modelValue===void 0}),d=G(),{primitiveElement:g,currentElement:v}=ve(),m=H(()=>i.disabled||d.disabled.value||!1),k=S();Te(()=>k.value=d.highlightedElement.value?.id),He(()=>{d.focusable.value=!1,setTimeout(()=>{i.autoFocus&&v.value?.focus()},1)}),Be(()=>{d.focusable.value=!0});const{isComposing:E,handleCompositionStart:x,handleCompositionEnd:l}=Re(h=>{p.value=h.target.value,d.onCompositionEnd(),d.highlightFirstItem()});function u(){d.onCompositionStart(),x()}function c(h){E.value||(p.value=h.target.value,d.highlightFirstItem())}function r(h){E.value||(h.preventDefault(),d.onKeydownNavigation(h))}function _(h){E.value||d.onKeydownEnter(h)}return(h,A)=>(w(),q(n(P),{ref_key:"primitiveElement",ref:g,as:h.as,"as-child":h.asChild,value:n(p),disabled:m.value?"":void 0,"data-disabled":m.value?"":void 0,"aria-disabled":m.value??void 0,"aria-activedescendant":k.value,type:"text",onKeydown:[z(r,["down","up","home","end"]),z(_,["enter"])],onInput:c,onCompositionstart:u,onCompositionend:n(l)},{default:K(()=>[D(h.$slots,"default",{modelValue:n(p)})]),_:3},8,["as","as-child","value","disabled","data-disabled","aria-disabled","aria-activedescendant","onCompositionend"]))}}),xt=nt;const[_t,ot]=ee("ListboxGroup");var lt=B({__name:"ListboxGroup",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(o){const a=o,i=ye(void 0,"reka-listbox-group");return ot({id:i}),(t,p)=>(w(),q(n(P),te({role:"group"},a,{"aria-labelledby":n(i)}),{default:K(()=>[D(t.$slots,"default")]),_:3},16,["aria-labelledby"]))}}),Ct=lt;const st="listbox.select",[rt,ut]=ee("ListboxItem");var dt=B({__name:"ListboxItem",props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},emits:["select"],setup(o,{emit:a}){const i=o,t=a,p=ye(void 0,"reka-listbox-item"),{CollectionItem:d}=W(),{forwardRef:g,currentElement:v}=be(),m=G(),k=H(()=>v.value!=null&&v.value===m.highlightedElement.value),E=H(()=>et(m.modelValue.value,i.value,m.by)),x=H(()=>m.disabled.value||i.disabled);async function l(c){t("select",c),!c?.defaultPrevented&&!x.value&&c&&(m.onValueChange(i.value),m.changeHighlight(v.value))}function u(c){const r={originalEvent:c,value:i.value};Pe(st,l,r)}return ut({isSelected:E}),(c,r)=>(w(),q(n(d),{value:c.value},{default:K(()=>[De([k.value,E.value,x.value,n(m).focusable.value],()=>he(n(P),te({id:n(p)},c.$attrs,{ref:n(g),role:"option",tabindex:n(m).focusable.value?k.value?"0":"-1":-1,"aria-selected":E.value,as:c.as,"as-child":c.asChild,disabled:x.value?"":void 0,"data-disabled":x.value?"":void 0,"data-highlighted":k.value?"":void 0,"data-state":E.value?"checked":"unchecked",onClick:u,onKeydown:z(ge(u,["prevent"]),["space"]),onPointermove:r[0]||(r[0]=()=>{n(m).highlightedElement.value!==n(v)&&n(m).highlightOnHover.value&&n(m).changeHighlight(n(v),!1,!1)})}),{default:K(()=>[D(c.$slots,"default")]),_:3},16,["id","tabindex","aria-selected","as","as-child","disabled","data-disabled","data-highlighted","data-state","onKeydown"]),r,1)]),_:3},8,["value"]))}}),Et=dt,ct=B({__name:"ListboxItemIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(o){const a=o;be();const i=rt();return(t,p)=>n(i).isSelected.value?(w(),q(n(P),te({key:0,"aria-hidden":"true"},a),{default:K(()=>[D(t.$slots,"default")]),_:3},16)):pe("v-if",!0)}}),Ft=ct,ft=B({__name:"ListboxVirtualizer",props:{options:{type:Array,required:!0},overscan:{type:Number,required:!1},estimateSize:{type:[Number,Function],required:!1},textContent:{type:Function,required:!1}},setup(o){const a=o,i=Ne(),t=G(),p=Me(),{getItems:d}=W();t.isVirtual.value=!0;const g=H(()=>{const l=p.value;if(l){const u=window.getComputedStyle(l);return{start:Number.parseFloat(u.paddingBlockStart||u.paddingTop),end:Number.parseFloat(u.paddingBlockEnd||u.paddingBottom)}}else return{start:0,end:0}}),v=Qe({get scrollPaddingStart(){return g.value.start},get scrollPaddingEnd(){return g.value.end},get count(){return a.options.length},get horizontal(){return t.orientation.value==="horizontal"},estimateSize(l){return typeof a.estimateSize=="function"?a.estimateSize(l):a.estimateSize??28},getScrollElement(){return p.value},overscan:a.overscan??12}),m=H(()=>v.value.getVirtualItems().map(l=>{const u=i.default({option:a.options[l.index],virtualizer:v.value,virtualItem:l})[0],c=u.type===ue&&Array.isArray(u.children)?u.children.find(r=>typeof r.type!="symbol"):u;return{item:l,is:je(c,{key:`${l.key}`,"data-index":l.index,"aria-setsize":a.options.length,"aria-posinset":l.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${l.start}px)`,overflowAnchor:"none"}})}}));t.virtualFocusHook.on(({event:l,scroll:u})=>{const c=a.options.findIndex(r=>Array.isArray(t.modelValue.value)?L(r,t.modelValue.value[0],t.by):L(r,t.modelValue.value,t.by));c!==-1?(l?.preventDefault(),v.value.scrollToIndex(c,{align:"start"}),requestAnimationFrame(()=>{const r=de(p.value);r&&(t.changeHighlight(r,u,u?void 0:!1),l&&r?.focus())})):u?t.highlightFirstItem():requestAnimationFrame(()=>{const r=d().find(_=>_.ref.dataset.disabled!=="")?.ref;r&&t.changeHighlight(r,!1,!1)})}),t.virtualHighlightHook.on(l=>{const u=a.options.findIndex(c=>L(c,l,t.by));v.value.scrollToIndex(u,{align:"start"}),requestAnimationFrame(()=>{const c=de(p.value);c&&t.changeHighlight(c)})});const k=me("",1e3),E=H(()=>{const l=u=>a.textContent?a.textContent(u):u?.toString().toLowerCase();return a.options.map((u,c)=>({index:c,textContent:l(u)}))});function x(l,u){if(!t.firstValue?.value||!t.multiple.value||!Array.isArray(t.modelValue.value))return;const r=d().filter(h=>h.ref.dataset.disabled!=="").find(h=>h.ref===t.highlightedElement.value)?.value;if(!r)return;let _=null;switch(u){case"prev":case"next":{_=$(a.options,t.firstValue.value,r);break}case"first":{_=$(a.options,t.firstValue.value,a.options?.[0]);break}case"last":{_=$(a.options,t.firstValue.value,a.options.at(-1));break}}t.modelValue.value=_}return t.virtualKeydownHook.on(l=>{const u=l.altKey||l.ctrlKey||l.metaKey;if(l.key==="Tab"&&!u)return;let r=Oe[l.key];if(u&&l.key==="a"&&t.multiple.value?(l.preventDefault(),t.modelValue.value=[...a.options],r="last"):l.shiftKey&&r&&x(l,r),["first","last"].includes(r)){l.preventDefault();const _=r==="first"?0:a.options.length-1;v.value.scrollToIndex(_),requestAnimationFrame(()=>{const h=d(),A=r==="first"?h[0]:h.at(-1);A&&t.changeHighlight(A.ref)})}else if(!r&&!u){k.value+=l.key;const _=Number(ze()?.getAttribute("data-index")),h=E.value[_].textContent,A=E.value.map(y=>y.textContent??""),V=$e(A,k.value,h),T=E.value.find(y=>y.textContent===V);T&&(v.value.scrollToIndex(T.index,{align:"start"}),requestAnimationFrame(()=>{const y=p.value.querySelector(`[data-index="${T.index}"]`);y instanceof HTMLElement&&t.changeHighlight(y)}))}}),(l,u)=>(w(),re("div",{"data-reka-virtualizer":"",style:Ue({position:"relative",width:"100%",height:`${n(v).getTotalSize()}px`})},[(w(!0),re(ue,null,We(m.value,({is:c,item:r})=>(w(),q(Ge(c),{key:r.index}))),128))],4))}}),kt=ft;function pt(o,a){if(typeof o!="object"||o===null)return!1;const i=Ye(o,a);return i!=null&&i!==""}function ce(o,a){return a?{xs:44,sm:48,md:52,lg:56,xl:60}[o]:{xs:24,sm:28,md:32,lg:36,xl:40}[o]}function At(o,a,i,t){const p=ce(a,!0),d=ce(a,!1);return t?()=>p:i?g=>pt(o[g],i)?p:d:()=>d}export{yt as L,bt as a,Ct as b,xt as c,Et as d,Ft as e,kt as f,At as g,_t as h,G as i};
|
|
1
|
+
import{aL as Z,Y as ee,d as B,W as Ie,b5 as W,bW as Se,ax as Le,X as fe,B as qe,o as w,f as q,g as K,T as D,k as n,q as pe,G as O,V as P,ba as ve,r as S,bb as Q,b6 as Ke,bT as Ve,bS as me,j as he,Q as z,H as ge,c6 as Te,C as He,ab as Be,h as H,bo as Re,ay as ye,U as te,S as be,bp as De,aJ as Pe,a0 as Ne,c7 as Me,c8 as Oe,bi as ze,c9 as $e,c as re,F as ue,y as We,ae as Ge,O as Ue,ca as je,aF as Ye}from"./BrT_Sys2.js";import{u as Xe}from"./26ll_vBr.js";import{V as Je}from"./ByoIgYX_.js";import{u as Qe}from"./BxRsAYRS.js";function $(o,a,i){const t=o.findIndex(v=>Z(v,a)),p=o.findIndex(v=>Z(v,i));if(t===-1||p===-1)return[];const[d,g]=[t,p].sort((v,m)=>v-m);return o.slice(d,g+1)}function Ze(){return{ALT:"Alt",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",BACKSPACE:"Backspace",CAPS_LOCK:"CapsLock",CONTROL:"Control",DELETE:"Delete",END:"End",ENTER:"Enter",ESCAPE:"Escape",F1:"F1",F10:"F10",F11:"F11",F12:"F12",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",HOME:"Home",META:"Meta",PAGE_DOWN:"PageDown",PAGE_UP:"PageUp",SHIFT:"Shift",SPACE:" ",TAB:"Tab",CTRL:"Control",ASTERISK:"*",SPACE_CODE:"Space"}}function de(o){return o?.querySelector("[data-state=checked]")}function et(o,a,i){return o===void 0?!1:Array.isArray(o)?o.some(t=>L(t,a,i)):L(o,a,i)}function L(o,a,i){return o===void 0||a===void 0?!1:typeof o=="string"?o===a:typeof i=="function"?i(o,a):typeof i=="string"?o?.[i]===a?.[i]:Z(o,a)}const[G,tt]=ee("ListboxRoot");var at=B({__name:"ListboxRoot",props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},multiple:{type:Boolean,required:!1},orientation:{type:String,required:!1,default:"vertical"},dir:{type:String,required:!1},disabled:{type:Boolean,required:!1},selectionBehavior:{type:String,required:!1,default:"toggle"},highlightOnHover:{type:Boolean,required:!1},by:{type:[String,Function],required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","highlight","entryFocus","leave"],setup(o,{expose:a,emit:i}){const t=o,p=i,{multiple:d,highlightOnHover:g,orientation:v,disabled:m,selectionBehavior:k,dir:E}=Ie(t),{getItems:x}=W({isProvider:!0}),{handleTypeaheadSearch:l}=Se(),{primitiveElement:u,currentElement:c}=ve(),r=Ze(),_=Le(E),h=Xe(c),A=S(),V=S(!1),T=S(!0),y=fe(t,"modelValue",p,{defaultValue:t.defaultValue??(d.value?[]:void 0),passive:t.modelValue===void 0,deep:!0});function xe(e){if(V.value=!0,t.multiple){const s=Array.isArray(y.value)?[...y.value]:[],f=s.findIndex(b=>L(b,e,t.by));t.selectionBehavior==="toggle"?(f===-1?s.push(e):s.splice(f,1),y.value=s):(y.value=[e],A.value=e)}else t.selectionBehavior==="toggle"&&L(y.value,e,t.by)?y.value=void 0:y.value=e;setTimeout(()=>{V.value=!1},1)}const C=S(null),U=S(null),R=S(!1),j=S(!1),ae=Q(),Y=Q(),ie=Q();function X(){return x().map(e=>e.ref).filter(e=>e.dataset.disabled!=="")}function I(e,s=!0,f){if(!e)return;C.value=e,(f??T.value)&&C.value.focus(),s&&C.value.scrollIntoView({block:"nearest"});const b=x().find(F=>F.ref===e);p("highlight",b)}function _e(e){if(R.value)ie.trigger(e);else{const s=x().find(f=>L(f.value,e,t.by));s&&(C.value=s.ref,I(s.ref))}}function Ce(e){if(C.value&&C.value.isConnected){if(e.ctrlKey||e.metaKey||e.altKey)return;e.preventDefault(),e.stopPropagation(),j.value||C.value.click()}}function Ee(e){if(T.value){if(V.value=!0,R.value)Y.trigger(e);else{const s=e.altKey||e.ctrlKey||e.metaKey;if(s&&e.key==="a"&&d.value){const f=x(),b=f.map(N=>N.value);y.value=[...b],e.preventDefault();const F=f.at(-1);F&&I(F.ref)}else if(!s){const f=l(e.key,x());f&&I(f)}}setTimeout(()=>{V.value=!1},1)}}function Fe(){j.value=!0}function ke(){O(()=>{j.value=!1})}function ne(){O(()=>{const e=new KeyboardEvent("keydown",{key:"PageUp"});oe(e)})}function J(e){const s=C.value;s?.isConnected&&(U.value=s),C.value=null,p("leave",e)}function Ae(e){const s=new CustomEvent("listbox.entryFocus",{bubbles:!1,cancelable:!0});if(e.currentTarget?.dispatchEvent(s),p("entryFocus",s),!s.defaultPrevented)if(U.value)I(U.value);else{const f=X()?.[0];I(f)}}function oe(e){const s=Ke(e,v.value,_.value);if(!s)return;let f=X();if(C.value){if(s==="last")f.reverse();else if(s==="prev"||s==="next"){s==="prev"&&f.reverse();const b=f.indexOf(C.value);f=f.slice(b+1)}we(e,f[0])}if(f.length){const b=!C.value&&s==="prev"?f.length-1:0;I(f[b])}if(R.value)return Y.trigger(e)}function we(e,s){if(!(R.value||t.selectionBehavior!=="replace"||!d.value||!Array.isArray(y.value)||(e.altKey||e.ctrlKey||e.metaKey)&&!e.shiftKey)&&e.shiftKey){const b=x().filter(M=>M.ref.dataset.disabled!=="");let F=b.find(M=>M.ref===s)?.value;if(e.key===r.END?F=b.at(-1)?.value:e.key===r.HOME&&(F=b[0]?.value),!F||!A.value)return;const N=$(b.map(M=>M.value),A.value,F);y.value=N}}async function le(e,s=!0){if(Ve)if(await O(),R.value)ae.trigger({event:e,scroll:s});else{const f=X(),b=f.find(N=>N.dataset.state==="checked"),F=s?void 0:!1;b?I(b,s,F):f.length&&I(f[0],s,F)}}let se=!1;return qe(y,()=>{if(!V.value){const e=se;se=!0,O(()=>{le(void 0,e)})}},{immediate:!0,deep:!0}),a({highlightedElement:C,highlightItem:_e,highlightFirstItem:ne,highlightSelected:le,getItems:x}),tt({modelValue:y,onValueChange:xe,multiple:d,orientation:v,dir:_,disabled:m,highlightOnHover:g,highlightedElement:C,isVirtual:R,virtualFocusHook:ae,virtualKeydownHook:Y,virtualHighlightHook:ie,by:t.by,firstValue:A,selectionBehavior:k,focusable:T,onLeave:J,onEnter:Ae,changeHighlight:I,onKeydownEnter:Ce,onKeydownNavigation:oe,onKeydownTypeAhead:Ee,onCompositionStart:Fe,onCompositionEnd:ke,highlightFirstItem:ne}),(e,s)=>(w(),q(n(P),{ref_key:"primitiveElement",ref:u,as:e.as,"as-child":e.asChild,dir:n(_),"data-disabled":n(m)?"":void 0,onPointerleave:J,onFocusout:s[0]||(s[0]=async f=>{const b=f.relatedTarget||f.target;await O(),C.value&&n(c)&&!n(c).contains(b)&&J(f)})},{default:K(()=>[D(e.$slots,"default",{modelValue:n(y)}),n(h)&&e.name?(w(),q(n(Je),{key:0,name:e.name,value:n(y),disabled:n(m),required:e.required},null,8,["name","value","disabled","required"])):pe("v-if",!0)]),_:3},8,["as","as-child","dir","data-disabled"]))}}),yt=at,it=B({__name:"ListboxContent",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(o){const{CollectionSlot:a}=W(),i=G(),t=me(!1,10);return(p,d)=>(w(),q(n(a),null,{default:K(()=>[he(n(P),{role:"listbox",as:p.as,"as-child":p.asChild,tabindex:n(i).focusable.value?n(i).highlightedElement.value?"-1":"0":"-1","aria-orientation":n(i).orientation.value,"aria-multiselectable":!!n(i).multiple.value,"data-orientation":n(i).orientation.value,onMousedown:d[0]||(d[0]=ge(g=>t.value=!0,["left"])),onFocus:d[1]||(d[1]=g=>{n(t)||n(i).onEnter(g)}),onKeydown:[d[2]||(d[2]=z(g=>{n(i).orientation.value==="vertical"&&(g.key==="ArrowLeft"||g.key==="ArrowRight")||n(i).orientation.value==="horizontal"&&(g.key==="ArrowUp"||g.key==="ArrowDown")||(g.preventDefault(),n(i).focusable.value&&n(i).onKeydownNavigation(g))},["down","up","left","right","home","end"])),z(n(i).onKeydownEnter,["enter"]),n(i).onKeydownTypeAhead]},{default:K(()=>[D(p.$slots,"default")]),_:3},8,["as","as-child","tabindex","aria-orientation","aria-multiselectable","data-orientation","onKeydown"])]),_:3}))}}),bt=it,nt=B({__name:"ListboxFilter",props:{modelValue:{type:String,required:!1},autoFocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"input"}},emits:["update:modelValue"],setup(o,{emit:a}){const i=o,p=fe(i,"modelValue",a,{defaultValue:"",passive:i.modelValue===void 0}),d=G(),{primitiveElement:g,currentElement:v}=ve(),m=H(()=>i.disabled||d.disabled.value||!1),k=S();Te(()=>k.value=d.highlightedElement.value?.id),He(()=>{d.focusable.value=!1,setTimeout(()=>{i.autoFocus&&v.value?.focus()},1)}),Be(()=>{d.focusable.value=!0});const{isComposing:E,handleCompositionStart:x,handleCompositionEnd:l}=Re(h=>{p.value=h.target.value,d.onCompositionEnd(),d.highlightFirstItem()});function u(){d.onCompositionStart(),x()}function c(h){E.value||(p.value=h.target.value,d.highlightFirstItem())}function r(h){E.value||(h.preventDefault(),d.onKeydownNavigation(h))}function _(h){E.value||d.onKeydownEnter(h)}return(h,A)=>(w(),q(n(P),{ref_key:"primitiveElement",ref:g,as:h.as,"as-child":h.asChild,value:n(p),disabled:m.value?"":void 0,"data-disabled":m.value?"":void 0,"aria-disabled":m.value??void 0,"aria-activedescendant":k.value,type:"text",onKeydown:[z(r,["down","up","home","end"]),z(_,["enter"])],onInput:c,onCompositionstart:u,onCompositionend:n(l)},{default:K(()=>[D(h.$slots,"default",{modelValue:n(p)})]),_:3},8,["as","as-child","value","disabled","data-disabled","aria-disabled","aria-activedescendant","onCompositionend"]))}}),xt=nt;const[_t,ot]=ee("ListboxGroup");var lt=B({__name:"ListboxGroup",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(o){const a=o,i=ye(void 0,"reka-listbox-group");return ot({id:i}),(t,p)=>(w(),q(n(P),te({role:"group"},a,{"aria-labelledby":n(i)}),{default:K(()=>[D(t.$slots,"default")]),_:3},16,["aria-labelledby"]))}}),Ct=lt;const st="listbox.select",[rt,ut]=ee("ListboxItem");var dt=B({__name:"ListboxItem",props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},emits:["select"],setup(o,{emit:a}){const i=o,t=a,p=ye(void 0,"reka-listbox-item"),{CollectionItem:d}=W(),{forwardRef:g,currentElement:v}=be(),m=G(),k=H(()=>v.value!=null&&v.value===m.highlightedElement.value),E=H(()=>et(m.modelValue.value,i.value,m.by)),x=H(()=>m.disabled.value||i.disabled);async function l(c){t("select",c),!c?.defaultPrevented&&!x.value&&c&&(m.onValueChange(i.value),m.changeHighlight(v.value))}function u(c){const r={originalEvent:c,value:i.value};Pe(st,l,r)}return ut({isSelected:E}),(c,r)=>(w(),q(n(d),{value:c.value},{default:K(()=>[De([k.value,E.value,x.value,n(m).focusable.value],()=>he(n(P),te({id:n(p)},c.$attrs,{ref:n(g),role:"option",tabindex:n(m).focusable.value?k.value?"0":"-1":-1,"aria-selected":E.value,as:c.as,"as-child":c.asChild,disabled:x.value?"":void 0,"data-disabled":x.value?"":void 0,"data-highlighted":k.value?"":void 0,"data-state":E.value?"checked":"unchecked",onClick:u,onKeydown:z(ge(u,["prevent"]),["space"]),onPointermove:r[0]||(r[0]=()=>{n(m).highlightedElement.value!==n(v)&&n(m).highlightOnHover.value&&n(m).changeHighlight(n(v),!1,!1)})}),{default:K(()=>[D(c.$slots,"default")]),_:3},16,["id","tabindex","aria-selected","as","as-child","disabled","data-disabled","data-highlighted","data-state","onKeydown"]),r,1)]),_:3},8,["value"]))}}),Et=dt,ct=B({__name:"ListboxItemIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(o){const a=o;be();const i=rt();return(t,p)=>n(i).isSelected.value?(w(),q(n(P),te({key:0,"aria-hidden":"true"},a),{default:K(()=>[D(t.$slots,"default")]),_:3},16)):pe("v-if",!0)}}),Ft=ct,ft=B({__name:"ListboxVirtualizer",props:{options:{type:Array,required:!0},overscan:{type:Number,required:!1},estimateSize:{type:[Number,Function],required:!1},textContent:{type:Function,required:!1}},setup(o){const a=o,i=Ne(),t=G(),p=Me(),{getItems:d}=W();t.isVirtual.value=!0;const g=H(()=>{const l=p.value;if(l){const u=window.getComputedStyle(l);return{start:Number.parseFloat(u.paddingBlockStart||u.paddingTop),end:Number.parseFloat(u.paddingBlockEnd||u.paddingBottom)}}else return{start:0,end:0}}),v=Qe({get scrollPaddingStart(){return g.value.start},get scrollPaddingEnd(){return g.value.end},get count(){return a.options.length},get horizontal(){return t.orientation.value==="horizontal"},estimateSize(l){return typeof a.estimateSize=="function"?a.estimateSize(l):a.estimateSize??28},getScrollElement(){return p.value},overscan:a.overscan??12}),m=H(()=>v.value.getVirtualItems().map(l=>{const u=i.default({option:a.options[l.index],virtualizer:v.value,virtualItem:l})[0],c=u.type===ue&&Array.isArray(u.children)?u.children.find(r=>typeof r.type!="symbol"):u;return{item:l,is:je(c,{key:`${l.key}`,"data-index":l.index,"aria-setsize":a.options.length,"aria-posinset":l.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${l.start}px)`,overflowAnchor:"none"}})}}));t.virtualFocusHook.on(({event:l,scroll:u})=>{const c=a.options.findIndex(r=>Array.isArray(t.modelValue.value)?L(r,t.modelValue.value[0],t.by):L(r,t.modelValue.value,t.by));c!==-1?(l?.preventDefault(),v.value.scrollToIndex(c,{align:"start"}),requestAnimationFrame(()=>{const r=de(p.value);r&&(t.changeHighlight(r,u,u?void 0:!1),l&&r?.focus())})):u?t.highlightFirstItem():requestAnimationFrame(()=>{const r=d().find(_=>_.ref.dataset.disabled!=="")?.ref;r&&t.changeHighlight(r,!1,!1)})}),t.virtualHighlightHook.on(l=>{const u=a.options.findIndex(c=>L(c,l,t.by));v.value.scrollToIndex(u,{align:"start"}),requestAnimationFrame(()=>{const c=de(p.value);c&&t.changeHighlight(c)})});const k=me("",1e3),E=H(()=>{const l=u=>a.textContent?a.textContent(u):u?.toString().toLowerCase();return a.options.map((u,c)=>({index:c,textContent:l(u)}))});function x(l,u){if(!t.firstValue?.value||!t.multiple.value||!Array.isArray(t.modelValue.value))return;const r=d().filter(h=>h.ref.dataset.disabled!=="").find(h=>h.ref===t.highlightedElement.value)?.value;if(!r)return;let _=null;switch(u){case"prev":case"next":{_=$(a.options,t.firstValue.value,r);break}case"first":{_=$(a.options,t.firstValue.value,a.options?.[0]);break}case"last":{_=$(a.options,t.firstValue.value,a.options.at(-1));break}}t.modelValue.value=_}return t.virtualKeydownHook.on(l=>{const u=l.altKey||l.ctrlKey||l.metaKey;if(l.key==="Tab"&&!u)return;let r=Oe[l.key];if(u&&l.key==="a"&&t.multiple.value?(l.preventDefault(),t.modelValue.value=[...a.options],r="last"):l.shiftKey&&r&&x(l,r),["first","last"].includes(r)){l.preventDefault();const _=r==="first"?0:a.options.length-1;v.value.scrollToIndex(_),requestAnimationFrame(()=>{const h=d(),A=r==="first"?h[0]:h.at(-1);A&&t.changeHighlight(A.ref)})}else if(!r&&!u){k.value+=l.key;const _=Number(ze()?.getAttribute("data-index")),h=E.value[_].textContent,A=E.value.map(y=>y.textContent??""),V=$e(A,k.value,h),T=E.value.find(y=>y.textContent===V);T&&(v.value.scrollToIndex(T.index,{align:"start"}),requestAnimationFrame(()=>{const y=p.value.querySelector(`[data-index="${T.index}"]`);y instanceof HTMLElement&&t.changeHighlight(y)}))}}),(l,u)=>(w(),re("div",{"data-reka-virtualizer":"",style:Ue({position:"relative",width:"100%",height:`${n(v).getTotalSize()}px`})},[(w(!0),re(ue,null,We(m.value,({is:c,item:r})=>(w(),q(Ge(c),{key:r.index}))),128))],4))}}),kt=ft;function pt(o,a){if(typeof o!="object"||o===null)return!1;const i=Ye(o,a);return i!=null&&i!==""}function ce(o,a){return a?{xs:44,sm:48,md:52,lg:56,xl:60}[o]:{xs:24,sm:28,md:32,lg:36,xl:40}[o]}function At(o,a,i,t){const p=ce(a,!0),d=ce(a,!1);return t?()=>p:i?g=>pt(o[g],i)?p:d:()=>d}export{yt as L,bt as a,Ct as b,xt as c,Et as d,Ft as e,kt as f,At as g,_t as h,G as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as i,o as t,c as o,F as c,y as l,f as p,g as _,m,t as f,k as a,q as u,_ as h}from"./
|
|
1
|
+
import{d as i,o as t,c as o,F as c,y as l,f as p,g as _,m,t as f,k as a,q as u,_ as h}from"./BrT_Sys2.js";import{k as d,x as g,w as k}from"./D7P0ML0H.js";const x={key:0,class:"flex flex-wrap gap-1"},y=i({__name:"RunReports",props:{reports:{}},setup(n){return(s,B)=>{const r=h;return n.reports?.length?(t(),o("div",x,[(t(!0),o(c,null,l(n.reports,e=>(t(),p(r,{key:`${e.type}-${e.path}`,href:`/api/files/${a(k)(e.path)}`,icon:("reportIcon"in s?s.reportIcon:a(g))(e.type),title:e.size?a(d)(e.size):e.label,target:"_blank",size:"xs",variant:"outline"},{default:_(()=>[m(f(e.label),1)]),_:2},1032,["href","icon","title"]))),128))])):u("",!0)}}}),$=Object.assign(y,{__name:"RunReports"});export{$ as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a0 as K,a1 as Q,X as W,a3 as Z,aM as ee,aX as ie,aO as ae,B as se,C as le,G as w,o as n,f as d,g as te,i as ne,U as B,k as i,T as b,c as k,p as r,v as A,aG as re,q as g,V as oe,h as ue,aY as de,a6 as ge}from"./
|
|
1
|
+
import{a0 as K,a1 as Q,X as W,a3 as Z,aM as ee,aX as ie,aO as ae,B as se,C as le,G as w,o as n,f as d,g as te,i as ne,U as B,k as i,T as b,c as k,p as r,v as A,aG as re,q as g,V as oe,h as ue,aY as de,a6 as ge}from"./BrT_Sys2.js";const ce={slots:{root:"relative inline-flex items-center",base:["w-full rounded-md border-0 appearance-none placeholder:text-dimmed disabled:cursor-not-allowed disabled:opacity-75","transition-colors"],leading:"absolute start-0 flex items-start",leadingIcon:"shrink-0 text-dimmed",leadingAvatar:"shrink-0",leadingAvatarSize:"",trailing:"absolute end-0 flex items-start",trailingIcon:"shrink-0 text-dimmed"},variants:{fieldGroup:{horizontal:{root:"group has-focus-visible:z-[1]",base:"group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none"},vertical:{root:"group has-focus-visible:z-[1]",base:"group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none"}},size:{xs:{base:"px-2 py-1 text-sm/4 gap-1",leading:"ps-2 inset-y-1",trailing:"pe-2 inset-y-1",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},sm:{base:"px-2.5 py-1.5 text-sm/4 gap-1.5",leading:"ps-2.5 inset-y-1.5",trailing:"pe-2.5 inset-y-1.5",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},md:{base:"px-2.5 py-1.5 text-base/5 gap-1.5",leading:"ps-2.5 inset-y-1.5",trailing:"pe-2.5 inset-y-1.5",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},lg:{base:"px-3 py-2 text-base/5 gap-2",leading:"ps-3 inset-y-2",trailing:"pe-3 inset-y-2",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},xl:{base:"px-3 py-2 text-base gap-2",leading:"ps-3 inset-y-2",trailing:"pe-3 inset-y-2",leadingIcon:"size-6",leadingAvatarSize:"xs",trailingIcon:"size-6"}},variant:{outline:"text-highlighted bg-default ring ring-inset ring-accented",soft:"text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50",subtle:"text-highlighted bg-elevated ring ring-inset ring-accented",ghost:"text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent",none:"text-highlighted bg-transparent focus:outline-none"},color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},leading:{true:""},trailing:{true:""},loading:{true:""},highlight:{true:""},fixed:{false:""},type:{file:"file:me-1.5 file:font-medium file:text-muted file:outline-none"},autoresize:{true:{base:"resize-none"}}},compoundVariants:[{color:"primary",variant:["outline","subtle"],class:"outline-primary/25 focus-visible:outline-3 focus-visible:ring-primary"},{color:"secondary",variant:["outline","subtle"],class:"outline-secondary/25 focus-visible:outline-3 focus-visible:ring-secondary"},{color:"success",variant:["outline","subtle"],class:"outline-success/25 focus-visible:outline-3 focus-visible:ring-success"},{color:"info",variant:["outline","subtle"],class:"outline-info/25 focus-visible:outline-3 focus-visible:ring-info"},{color:"warning",variant:["outline","subtle"],class:"outline-warning/25 focus-visible:outline-3 focus-visible:ring-warning"},{color:"error",variant:["outline","subtle"],class:"outline-error/25 focus-visible:outline-3 focus-visible:ring-error"},{color:"primary",variant:["soft","ghost"],class:"outline-primary/25 focus-visible:outline-3"},{color:"secondary",variant:["soft","ghost"],class:"outline-secondary/25 focus-visible:outline-3"},{color:"success",variant:["soft","ghost"],class:"outline-success/25 focus-visible:outline-3"},{color:"info",variant:["soft","ghost"],class:"outline-info/25 focus-visible:outline-3"},{color:"warning",variant:["soft","ghost"],class:"outline-warning/25 focus-visible:outline-3"},{color:"error",variant:["soft","ghost"],class:"outline-error/25 focus-visible:outline-3"},{color:"primary",highlight:!0,class:"ring ring-inset ring-primary"},{color:"secondary",highlight:!0,class:"ring ring-inset ring-secondary"},{color:"success",highlight:!0,class:"ring ring-inset ring-success"},{color:"info",highlight:!0,class:"ring ring-inset ring-info"},{color:"warning",highlight:!0,class:"ring ring-inset ring-warning"},{color:"error",highlight:!0,class:"ring ring-inset ring-error"},{color:"neutral",variant:["outline","subtle"],class:"outline-inverted/25 focus-visible:outline-3 focus-visible:ring-inverted"},{color:"neutral",variant:["soft","ghost"],class:"outline-inverted/25 focus-visible:outline-3"},{color:"neutral",highlight:!0,class:"ring ring-inset ring-inverted"},{leading:!0,size:"xs",class:"ps-7"},{leading:!0,size:"sm",class:"ps-8"},{leading:!0,size:"md",class:"ps-9"},{leading:!0,size:"lg",class:"ps-10"},{leading:!0,size:"xl",class:"ps-11"},{trailing:!0,size:"xs",class:"pe-7"},{trailing:!0,size:"sm",class:"pe-8"},{trailing:!0,size:"md",class:"pe-9"},{trailing:!0,size:"lg",class:"pe-10"},{trailing:!0,size:"xl",class:"pe-11"},{loading:!0,leading:!0,class:{leadingIcon:"animate-spin"}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:"animate-spin"}},{fixed:!1,size:"xs",class:"md:text-xs"},{fixed:!1,size:"sm",class:"md:text-xs"},{fixed:!1,size:"md",class:"md:text-sm"},{fixed:!1,size:"lg",class:"md:text-sm"}],defaultVariants:{size:"md",color:"primary",variant:"outline"}},fe=["id","value","name","rows","placeholder","disabled","required"],me=Object.assign({inheritAttrs:!1},{__name:"UTextarea",props:{as:{type:null,required:!1},id:{type:String,required:!1},name:{type:String,required:!1},placeholder:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1,default:0},autoresize:{type:Boolean,required:!1},autoresizeDelay:{type:Number,required:!1,default:0},disabled:{type:Boolean,required:!1},rows:{type:Number,required:!1,default:3},maxrows:{type:Number,required:!1,default:0},highlight:{type:Boolean,required:!1},fixed:{type:Boolean,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1},modelModifiers:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},emits:["update:modelValue","blur","change"],setup(S,{expose:V,emit:M}){const h=S,c=M,o=K(),e=Q("textarea",h),f=W(e,"modelValue",c,{defaultValue:e.defaultValue}),C=Z(),{emitFormFocus:y,emitFormBlur:N,emitFormInput:T,emitFormChange:F,size:_,color:$,id:R,name:D,highlight:O,disabled:j,ariaAttrs:G}=ee(h,{deferInputValidation:!0}),{isLeading:p,isTrailing:x,leadingIconName:z,trailingIconName:q}=ie(e),s=ue(()=>ge({extend:ce,...C.ui?.textarea||{}})({color:$.value??e.color,variant:e.variant,size:_?.value??e.size,loading:e.loading,highlight:O.value??e.highlight,fixed:e.fixed,autoresize:e.autoresize,leading:p.value||!!e.avatar||!!o.leading,trailing:x.value||!!o.trailing})),l=ae("textareaRef");function I(a){e.modelModifiers?.trim&&(typeof a=="string"||a===null||a===void 0)&&(a=a?.trim()??null),e.modelModifiers?.number&&(a=de(a)),e.modelModifiers?.nullable&&(a||=null),e.modelModifiers?.optional&&!e.modelModifiers?.nullable&&a!==null&&(a||=void 0),f.value=a,T()}function H(a){u(),e.modelModifiers?.lazy||I(a.target.value)}function P(a){const t=a.target.value;e.modelModifiers?.lazy&&I(t),e.modelModifiers?.trim&&(a.target.value=t.trim()),F(),c("change",a)}function U(a){N(),c("blur",a)}function X(){e.autofocus&&l.value?.focus()}function u(){if(e.autoresize&&l.value){l.value.rows=e.rows;const a=l.value.style.overflow;l.value.style.overflow="hidden";const t=window.getComputedStyle(l.value),m=Number.parseInt(t.paddingTop),E=Number.parseInt(t.paddingBottom),L=m+E,Y=Number.parseInt(t.lineHeight),{scrollHeight:J}=l.value,v=(J-L)/Y;v>e.rows&&(l.value.rows=e.maxrows?Math.min(v,e.maxrows):v),l.value.style.overflow=a}}return se(f,()=>{w(u)}),le(()=>{setTimeout(()=>{X()},e.autofocusDelay),setTimeout(async()=>{await w(),u()},e.autoresizeDelay)}),V({textareaRef:l,autoResize:u}),(a,t)=>(n(),d(i(oe),{as:i(e).as,"data-slot":a.$attrs["data-slot"]??"root",class:r(s.value.root({class:[i(e).ui?.root,i(e).class]}))},{default:te(()=>[ne("textarea",B({id:i(R),ref_key:"textareaRef",ref:l,value:i(f),name:i(D),rows:i(e).rows,placeholder:i(e).placeholder,class:s.value.base({class:i(e).ui?.base}),disabled:i(j),required:i(e).required},{...a.$attrs,...i(G)},{"data-slot":"base",onInput:H,onBlur:U,onChange:P,onFocus:t[0]||(t[0]=(...m)=>i(y)&&i(y)(...m))}),null,16,fe),b(a.$slots,"default",{ui:s.value}),i(p)||i(e).avatar||o.leading?(n(),k("span",{key:0,"data-slot":"leading",class:r(s.value.leading({class:i(e).ui?.leading}))},[b(a.$slots,"leading",{ui:s.value},()=>[i(p)&&i(z)?(n(),d(A,{key:0,name:i(z),"data-slot":"leadingIcon",class:r(s.value.leadingIcon({class:i(e).ui?.leadingIcon}))},null,8,["name","class"])):i(e).avatar?(n(),d(re,B({key:1,size:i(e).ui?.leadingAvatarSize||s.value.leadingAvatarSize()},i(e).avatar,{"data-slot":"leadingAvatar",class:s.value.leadingAvatar({class:i(e).ui?.leadingAvatar})}),null,16,["size","class"])):g("",!0)])],2)):g("",!0),i(x)||o.trailing?(n(),k("span",{key:1,"data-slot":"trailing",class:r(s.value.trailing({class:i(e).ui?.trailing}))},[b(a.$slots,"trailing",{ui:s.value},()=>[i(q)?(n(),d(A,{key:0,name:i(q),"data-slot":"trailingIcon",class:r(s.value.trailingIcon({class:i(e).ui?.trailingIcon}))},null,8,["name","class"])):g("",!0)])],2)):g("",!0)]),_:3},8,["as","data-slot","class"]))}});export{me as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as Re,a as Ee}from"./BS0gKVuF.js";import{d as H,z as le,B as se,o as n,f as P,g as u,i as s,j as c,D as G,l as W,k as o,c as p,v as ne,F as U,y as F,p as ie,m as A,t as S,q as _,A as X,r as E,h as N,G as $e,_ as re,w as ae,b as Oe,aa as Le,I as z}from"./BPKwYP2Q.js";import{_ as Be}from"./CQeMb57w.js";import{_ as pe}from"./D33On6AX.js";import{_ as fe}from"./C1K3r_fc.js";import{_ as ve}from"./DdbrJwT-.js";import{_ as ge}from"./bAfTAihV.js";import{_ as Fe}from"./nCjfWTGm.js";import{h as We}from"./r3SBLxtE.js";import{_ as ye}from"./DhA17dqR.js";import{h as De}from"./k-z_VVTK.js";import{u as oe}from"./BIf1R_fu.js";import{_ as Ne}from"./ABGJk0pu.js";import{p as Xe,g as qe}from"./Bf62wdzp.js";import"./Br2K9yi_.js";import"./DuMv-ugy.js";import"./DRtTLQri.js";import"./jIF87ALb.js";import"./C219JuBV.js";import"./mGJLLqyN.js";import"./BpceIssd.js";import"./B7yG1G_l.js";const je={class:"space-y-3"},Ke={key:0,class:"flex items-center justify-center gap-2 py-8 text-gray-400"},ze={key:1,class:"py-8 text-center text-sm text-gray-400"},He={key:2,class:"max-h-96 overflow-y-auto space-y-px"},Ge=["onClick"],Qe={class:"flex-1 min-w-0"},Ye={class:"text-sm font-medium leading-snug truncate"},Ze={key:0,class:"text-gray-500 font-normal"},Je={class:"text-xs text-gray-400 leading-snug mt-0.5"},et={key:3,class:"italic text-gray-500"},tt={key:0,class:"flex items-center gap-1 shrink-0 pt-0.5"},st=["title"],at=["title"],ot={key:0,class:"py-8 text-center text-sm text-gray-400"},lt=H({__name:"ModelPickerModal",props:X({models:{},selected:{},loading:{type:Boolean}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:X(["select"],["update:open"]),setup(a,{emit:I}){function T(y){return y?y>=1e6?`${(y/1e6).toFixed(1)}M`:y>=1e3?`${Math.round(y/1e3)}K`:String(y):""}const g=a,r=I,k=le(a,"open"),b=E(null),d=E("");se(k,y=>{y&&$e(()=>b.value?.focus())});const l=N(()=>{const y=d.value.toLowerCase();return y?g.models.filter(i=>i.id.toLowerCase().includes(y)||(i.label?.toLowerCase()??"").includes(y)):g.models}),x={image:{icon:"i-lucide-image",label:"Image input"},pdf:{icon:"i-lucide-file-text",label:"PDF input"},code:{icon:"i-lucide-code",label:"Code execution"},thinking:{icon:"i-lucide-brain",label:"Extended thinking"},json:{icon:"i-lucide-braces",label:"Structured output"},text:{icon:"i-lucide-type",label:"Text"},audio:{icon:"i-lucide-music",label:"Audio"}};function V(y){return y.map(i=>{const C=i.indexOf("→");if(C!==-1){const R=i.slice(0,C),O=i.slice(C+1);return{inputs:R.split("+").filter(Boolean),outputs:O.split("+").filter(Boolean)}}return{inputs:[i],outputs:[]}})}function $(y){r("select",y),k.value=!1,d.value=""}return(y,i)=>{const C=G,R=ne,O=Fe;return n(),P(O,{open:k.value,"onUpdate:open":i[1]||(i[1]=v=>k.value=v),title:"Select a model",ui:{content:"max-w-2xl"}},{body:u(()=>[s("div",je,[c(C,{ref_key:"searchInput",ref:b,modelValue:o(d),"onUpdate:modelValue":i[0]||(i[0]=v=>W(d)?d.value=v:null),placeholder:"Search models…",icon:"i-lucide-search",size:"sm"},null,8,["modelValue"]),a.models.length===0&&a.loading?(n(),p("div",Ke,[c(R,{name:"i-lucide-loader-2",class:"size-4 animate-spin"}),i[2]||(i[2]=s("span",{class:"text-sm"},"Loading models…",-1))])):a.models.length===0?(n(),p("div",ze," No models available — check your provider configuration ")):(n(),p("div",He,[(n(!0),p(U,null,F(o(l),v=>(n(),p("button",{key:v.id,class:ie(["w-full text-left px-4 py-3 rounded-lg hover:bg-elevated transition-colors border border-transparent hover:border-default flex items-start gap-4",a.selected===v.id?"bg-primary/10 ring-1 ring-inset ring-primary/30 border-primary/30":""]),onClick:h=>$(v.id)},[s("div",Qe,[s("p",Ye,[A(S(v.id)+" ",1),v.label&&v.label!==v.id?(n(),p("span",Ze," — "+S(v.label),1)):_("",!0)]),s("p",Je,[v.contextLength?(n(),p(U,{key:0},[A(S(T(v.contextLength))+" ctx",1)],64)):_("",!0),v.maxTokens?(n(),p(U,{key:1},[A(" · up to "+S(T(v.maxTokens))+" out",1)],64)):_("",!0),v.pricing?.prompt?(n(),p(U,{key:2},[A(" · $"+S(v.pricing.prompt)+" / $"+S(v.pricing.completion??"?")+" per 1M",1)],64)):_("",!0),!v.contextLength&&!v.maxTokens&&!v.pricing?.prompt?(n(),p("span",et,"No additional info")):_("",!0)])]),v.modalities?.length?(n(),p("div",tt,[(n(!0),p(U,null,F(V(v.modalities),h=>(n(),p(U,{key:h.inputs.join()+"→"+h.outputs.join()},[(n(!0),p(U,null,F(h.inputs,w=>(n(),p("span",{key:"in-"+w,title:x[w]?.label??w,class:"inline-flex items-center justify-center size-6 rounded-md bg-gray-100 dark:bg-gray-800 text-gray-500 hover:text-primary transition-colors"},[c(R,{name:x[w]?.icon??"i-lucide-cpu",class:"size-3.5"},null,8,["name"])],8,st))),128)),h.outputs.length?(n(),P(R,{key:0,name:"i-lucide-arrow-right",class:"size-3 text-gray-400 shrink-0"})):_("",!0),(n(!0),p(U,null,F(h.outputs,w=>(n(),p("span",{key:"out-"+w,title:x[w]?.label??w,class:"inline-flex items-center justify-center size-6 rounded-md bg-gray-100 dark:bg-gray-800 text-gray-500 hover:text-primary transition-colors"},[c(R,{name:x[w]?.icon??"i-lucide-cpu",class:"size-3.5"},null,8,["name"])],8,at))),128))],64))),128))])):_("",!0)],10,Ge))),128)),o(l).length===0?(n(),p("div",ot,' No models match "'+S(o(d))+'" ',1)):_("",!0)]))])]),_:1},8,["open"])}}}),nt=Object.assign(lt,{__name:"ModelPickerModal"}),it={class:"flex gap-2"},rt=H({__name:"ModelFieldInput",props:X({provider:{},providerResolved:{},reuse:{type:Boolean},models:{},loadingModels:{type:Boolean},placeholderAnthropic:{},placeholderOpenai:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:X(["loadModels"],["update:modelValue"]),setup(a,{emit:I}){const T=I,g=le(a,"modelValue"),r=E(!1);return(k,b)=>{const d=G,l=re,x=nt;return n(),p(U,null,[s("div",it,[c(d,{modelValue:g.value,"onUpdate:modelValue":b[0]||(b[0]=V=>g.value=V),placeholder:a.providerResolved==="anthropic"?a.placeholderAnthropic:a.placeholderOpenai,class:"flex-1"},null,8,["modelValue","placeholder"]),a.providerResolved?(n(),P(l,{key:0,size:"sm",variant:"soft",onClick:b[1]||(b[1]=V=>{T("loadModels"),r.value=!0})},{default:u(()=>[...b[4]||(b[4]=[A(" Choose model… ",-1)])]),_:1})):_("",!0)]),c(x,{open:o(r),"onUpdate:open":b[2]||(b[2]=V=>W(r)?r.value=V:null),models:a.models,selected:g.value,loading:a.loadingModels,onSelect:b[3]||(b[3]=V=>g.value=V)},null,8,["open","models","selected","loading"])],64)}}}),dt=Object.assign(rt,{__name:"ModelFieldInput"}),ct={class:"flex items-start justify-between gap-3"},ut={class:"flex items-start gap-2"},mt={class:"font-medium inline-flex items-center gap-1"},pt={class:"text-sm text-gray-500"},ft={class:"inline-flex items-center gap-1"},vt={class:"inline-flex items-center gap-1"},gt={class:"inline-flex items-center gap-1"},yt={key:3,class:"flex justify-end"},ht=H({__name:"AiRoleConfigForm",props:X({meta:{},hasApiKey:{type:Boolean},reuseOptions:{},providerOptions:{},presetOptions:{},disabled:{type:Boolean},envManaged:{type:Boolean},models:{},loadingModels:{type:Boolean},providerResolved:{},testing:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:X(["applyPreset","loadModels","test"],["update:modelValue"]),setup(a,{emit:I}){const T=a,g=I,r=le(a,"modelValue"),k=N({get:()=>r.value.reuse??"own",set:d=>r.value.reuse=d==="own"?null:d}),b=N(()=>We(T.meta.help));return(d,l)=>{const x=ne,V=Be,$=pe,y=fe,i=ve,C=ge,R=G,O=dt,v=re;return n(),p("div",{class:ie(["rounded-lg border border-default p-4 space-y-4",a.meta.optional&&!r.value.enabled?"opacity-80":""])},[s("div",ct,[s("div",ut,[c(x,{name:a.meta.icon,class:"size-5 mt-0.5 text-primary"},null,8,["name"]),s("div",null,[s("p",mt,[A(S(a.meta.title)+" ",1),c(V,{topic:a.meta.help},null,8,["topic"])]),s("p",pt,S(a.meta.blurb),1)])]),a.meta.optional?(n(),P($,{key:0,modelValue:r.value.enabled,"onUpdate:modelValue":l[0]||(l[0]=h=>r.value.enabled=h),disabled:a.disabled&&!a.envManaged,"aria-label":a.meta.enableLabel},null,8,["modelValue","disabled","aria-label"])):_("",!0)]),!a.meta.optional||r.value.enabled?(n(),p(U,{key:0},[a.meta.reuseTargets.length?(n(),P(i,{key:0,label:"Provider source"},{default:u(()=>[c(y,{modelValue:o(k),"onUpdate:modelValue":l[1]||(l[1]=h=>W(k)?k.value=h:null),items:a.reuseOptions,disabled:a.disabled&&!a.envManaged,class:"w-full"},null,8,["modelValue","items","disabled"])]),_:1})):_("",!0),r.value.reuse?_("",!0):(n(),p(U,{key:1},[c(i,{label:"Provider"},{label:u(()=>[s("span",ft,[l[9]||(l[9]=A(" Provider ",-1)),a.disabled?(n(),P(C,{key:0,"env-vars":o(b)},null,8,["env-vars"])):_("",!0)])]),default:u(()=>[c(y,{modelValue:r.value.provider,"onUpdate:modelValue":l[2]||(l[2]=h=>r.value.provider=h),items:a.providerOptions,disabled:a.disabled,placeholder:"Choose a provider…",class:"w-full"},null,8,["modelValue","items","disabled"])]),_:1}),r.value.provider==="openai"?(n(),P(i,{key:0,label:"Preset",description:"Pick a known provider to auto-fill the URL and model, then adjust as needed"},{default:u(()=>[c(y,{items:a.presetOptions,placeholder:"Choose a preset…",disabled:a.disabled,class:"w-full","onUpdate:modelValue":l[3]||(l[3]=h=>g("applyPreset",h))},null,8,["items","disabled"])]),_:1})):_("",!0),r.value.provider?(n(),P(i,{key:1,label:"API key",description:a.hasApiKey?"Leave empty to keep the stored key, clear and save to remove it":"Required for Anthropic; optional for local OpenAI-compatible servers"},{label:u(()=>[s("span",vt,[l[10]||(l[10]=A(" API key ",-1)),a.disabled?(n(),P(C,{key:0,"env-vars":o(b)},null,8,["env-vars"])):_("",!0)])]),default:u(()=>[c(R,{modelValue:r.value.apiKey,"onUpdate:modelValue":l[4]||(l[4]=h=>r.value.apiKey=h),type:"password",placeholder:a.hasApiKey?"•••••••• (unchanged)":"sk-…",disabled:a.disabled,class:"w-full font-mono"},null,8,["modelValue","placeholder","disabled"])]),_:1},8,["description"])):_("",!0),r.value.provider==="openai"?(n(),P(i,{key:2,label:"Base URL",description:"Required, e.g. http://localhost:11434/v1"},{label:u(()=>[s("span",gt,[l[11]||(l[11]=A(" Base URL ",-1)),a.disabled?(n(),P(C,{key:0,"env-vars":o(b)},null,8,["env-vars"])):_("",!0)])]),default:u(()=>[c(R,{modelValue:r.value.baseUrl,"onUpdate:modelValue":l[5]||(l[5]=h=>r.value.baseUrl=h),placeholder:"http://localhost:11434/v1",disabled:a.disabled,class:"w-full"},null,8,["modelValue","disabled"])]),_:1})):_("",!0)],64)),r.value.reuse||r.value.provider?(n(),P(i,{key:2,label:"Model",description:r.value.reuse?"Leave empty to use the reused role's model":void 0},{default:u(()=>[c(O,{modelValue:r.value.model,"onUpdate:modelValue":l[6]||(l[6]=h=>r.value.model=h),provider:r.value.provider,"provider-resolved":a.providerResolved,reuse:!!r.value.reuse,models:a.models,"loading-models":a.loadingModels,"placeholder-anthropic":a.meta.modelPlaceholderAnthropic,"placeholder-openai":a.meta.modelPlaceholderOpenai,onLoadModels:l[7]||(l[7]=h=>g("loadModels"))},null,8,["modelValue","provider","provider-resolved","reuse","models","loading-models","placeholder-anthropic","placeholder-openai"])]),_:1},8,["description"])):_("",!0),a.providerResolved?(n(),p("div",yt,[c(v,{size:"xs",color:"neutral",variant:"soft",icon:"i-lucide-plug",loading:a.testing,onClick:l[8]||(l[8]=h=>g("test"))},{default:u(()=>[...l[12]||(l[12]=[A(" Test connection ",-1)])]),_:1},8,["loading"])])):_("",!0)],64)):_("",!0)],2)}}}),bt=Object.assign(ht,{__name:"AiRoleConfigForm"}),_t={key:0,class:"space-y-3"},xt={class:"text-sm text-gray-500"},kt={key:0,class:"text-sm text-gray-500"},At={key:1,class:"overflow-x-auto"},It={class:"w-full text-sm"},Mt={class:"px-2 py-2"},St={class:"font-mono text-xs"},Vt={class:"text-xs text-gray-400"},wt={class:"text-right px-2 py-2"},Pt=["title"],Tt=["title"],Ut={class:"text-right px-2 py-2"},Ct={key:1,class:"flex items-center gap-2 py-4 text-muted"},Rt=H({__name:"AiUsagePanel",async setup(a){let I,T;const g=E(30),r=[{label:"Last 7 days",value:7},{label:"Last 30 days",value:30},{label:"Last 90 days",value:90}],{data:k,pending:b}=([I,T]=ae(()=>oe("/api/settings/ai/usage",{query:{days:g}},"$1ij5UlwVIK")),I=await I,T(),I);function d(l){return l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}k`:String(l)}return(l,x)=>{const V=fe,$=ne,y=ye;return n(),P(y,{icon:"i-lucide-activity",title:"AI usage"},{actions:u(()=>[c(V,{modelValue:o(g),"onUpdate:modelValue":x[0]||(x[0]=i=>W(g)?g.value=i:null),items:r,size:"sm",class:"w-36"},null,8,["modelValue"])]),default:u(()=>[o(k)?(n(),p("div",_t,[s("p",xt,S(d(o(k).totals.diagnoses))+" diagnoses · "+S(d(o(k).totals.inputTokens))+" input tokens · "+S(d(o(k).totals.outputTokens))+" output tokens ",1),o(k).byModel.length===0?(n(),p("p",kt,"No AI calls recorded in this period.")):(n(),p("div",At,[s("table",It,[x[1]||(x[1]=s("thead",null,[s("tr",{class:"text-xs text-gray-500 uppercase tracking-wider border-b border-default"},[s("th",{class:"text-left px-2 py-2 font-medium"},"Model"),s("th",{class:"text-right px-2 py-2 font-medium"},"Diagnoses"),s("th",{class:"text-right px-2 py-2 font-medium"},"Failed"),s("th",{class:"text-right px-2 py-2 font-medium"},"Input tokens"),s("th",{class:"text-right px-2 py-2 font-medium"},"Output tokens"),s("th",{class:"text-right px-2 py-2 font-medium"},"Avg duration")])],-1)),s("tbody",null,[(n(!0),p(U,null,F(o(k).byModel,i=>(n(),p("tr",{key:`${i.provider??"unknown"}/${i.model}`,class:"border-b last:border-b-0 border-default"},[s("td",Mt,[s("span",St,S(i.model),1),s("span",Vt," · "+S(i.provider??"unknown"),1)]),s("td",wt,S(i.diagnoses),1),s("td",{class:ie(["text-right px-2 py-2",i.failed>0?"text-red-600 dark:text-red-400":""])},S(i.failed),3),s("td",{class:"text-right px-2 py-2",title:i.inputTokens.toLocaleString()},S(d(i.inputTokens)),9,Pt),s("td",{class:"text-right px-2 py-2",title:i.outputTokens.toLocaleString()},S(d(i.outputTokens)),9,Tt),s("td",Ut,S(i.avgDurationMs===null?"—":("formatDuration"in l?l.formatDuration:o(De))(i.avgDurationMs)),1)]))),128))])])]))])):o(b)?(n(),p("div",Ct,[c($,{name:"i-lucide-loader-circle",class:"size-4 animate-spin"}),x[2]||(x[2]=s("span",{class:"text-sm"},"Loading usage…",-1))])):_("",!0)]),_:1})}}}),Et=Object.assign(Rt,{__name:"AiUsagePanel"}),$t=[{key:"sampleErrorChars",label:"Error text characters",envVar:"PIWI_AI_MAX_SAMPLE_ERROR_CHARS",description:"Max characters of raw error text (per error block).",min:200,max:5e4},{key:"scmPatchBudget",label:"SCM patch budget",envVar:"PIWI_AI_MAX_SCM_PATCH_BUDGET",description:"Total characters of diff patches across changed files.",min:0,max:5e4},{key:"affectedTests",label:"Affected tests",envVar:"PIWI_AI_MAX_AFFECTED_TESTS",description:"Max affected tests listed.",min:1,max:200},{key:"steps",label:"Test steps",envVar:"PIWI_AI_MAX_STEPS",description:"Max recent test steps included.",min:1,max:200},{key:"consoleEntries",label:"Console entries",envVar:"PIWI_AI_MAX_CONSOLE_ENTRIES",description:"Max console error/warning entries included.",min:0,max:200},{key:"consoleEntryChars",label:"Console entry characters",envVar:"PIWI_AI_MAX_CONSOLE_ENTRY_CHARS",description:"Max characters per console entry.",min:50,max:5e3},{key:"networkRequests",label:"Network requests",envVar:"PIWI_AI_MAX_NETWORK_REQUESTS",description:"Max failed network requests included.",min:0,max:200},{key:"ariaSnapshotChars",label:"ARIA snapshot characters",envVar:"PIWI_AI_MAX_ARIA_SNAPSHOT_CHARS",description:"Max characters of the page ARIA snapshot.",min:0,max:5e4},{key:"testSourceChars",label:"Test source characters",envVar:"PIWI_AI_MAX_TEST_SOURCE_CHARS",description:"Max characters of the test source snippet.",min:0,max:5e4},{key:"maxSourceFiles",label:"Full source files",envVar:"PIWI_AI_MAX_SOURCE_FILES",description:"Max full source files fetched from SCM to ground patches (0 disables).",min:0,max:20},{key:"sourceFileChars",label:"Source file characters",envVar:"PIWI_AI_MAX_SOURCE_FILE_CHARS",description:"Max characters per fetched full source file.",min:0,max:5e4},{key:"serverLogEntries",label:"Server log entries",envVar:"PIWI_AI_MAX_SERVER_LOG_ENTRIES",description:"Max backend server log entries (from X-Piwi-Logs header) included.",min:0,max:200},{key:"serverLogEntryChars",label:"Server log entry characters",envVar:"PIWI_AI_MAX_SERVER_LOG_ENTRY_CHARS",description:"Max characters per backend server log entry.",min:50,max:5e3},{key:"serverTraceSpans",label:"Server trace spans",envVar:"PIWI_AI_MAX_SERVER_TRACE_SPANS",description:"Max backend server spans (from X-Piwi-Trace header) included (0 disables).",min:0,max:500},{key:"maxImages",label:"Max screenshots",envVar:"PIWI_AI_MAX_IMAGES",description:"Max screenshots auto-included in the diagnosis context.",min:0,max:20},{key:"maxPassedPeers",label:"Max passed peers",envVar:"PIWI_AI_MAX_PASSED_PEERS",description:"Max peer tests in the same file listed when they passed.",min:0,max:100},{key:"maxConsoleWindow",label:"Console window entries",envVar:"PIWI_AI_MAX_CONSOLE_WINDOW",description:"Max console entries of any type in the window before failure.",min:0,max:200},{key:"slowRequestMs",label:"Slow request threshold (ms)",envVar:"PIWI_AI_SLOW_REQUEST_MS",description:"Network request duration threshold for flagging as slow.",min:100,max:3e4},{key:"maxTraceActions",label:"Trace actions",envVar:"PIWI_AI_MAX_TRACE_ACTIONS",description:"Max actions extracted from trace ZIP for failing-action context (0 disables).",min:0,max:50},{key:"traceDomChars",label:"Trace DOM excerpt characters",envVar:"PIWI_AI_TRACE_DOM_CHARS",description:"Max characters for the trace-derived DOM/ARIA excerpt in failing-action context.",min:0,max:2e4},{key:"traceStackFrames",label:"Trace stack frames",envVar:"PIWI_AI_MAX_TRACE_STACK_FRAMES",description:"Max call-stack frames (with source windows) from the trace (0 disables).",min:0,max:50},{key:"traceNetworkRequests",label:"Trace network requests",envVar:"PIWI_AI_MAX_TRACE_NETWORK_REQUESTS",description:"Max requests from the trace network stream (0 disables).",min:0,max:200},{key:"domSnapshotChars",label:"DOM snapshot characters",envVar:"PIWI_AI_MAX_DOM_SNAPSHOT_CHARS",description:"Max characters of the failure-time DOM snapshot rendered from the trace (0 disables).",min:0,max:5e4},{key:"imageMaxEdge",label:"Screenshot max edge (px)",envVar:"PIWI_AI_IMAGE_MAX_EDGE",description:"Screenshots are downscaled to at most this many pixels on the long edge before being sent.",min:512,max:8192}],Ot={class:"space-y-6"},Lt={class:"space-y-5"},Bt={class:"flex items-center gap-3"},Ft={class:"flex items-center gap-2 justify-end"},Wt={class:"flex justify-end"},Dt={class:"flex justify-end"},Nt={class:"grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-3"},Xt={class:"flex justify-end gap-2"},ms=H({__name:"ai",async setup(a){let I,T;const g=Oe(),{data:r,refresh:k}=([I,T]=ae(()=>oe("/api/settings/ai","$nV9xx-QVRl")),I=await I,T(),I);function b(){return{enabled:!1,reuse:null,provider:"",model:"",baseUrl:"",apiKey:""}}const d=z({diagnosis:b(),research:b(),embedding:b()}),l=E(!1),x=E(""),V=E(""),$=E(!1),y=E(!1),i=E(!1),C=z({diagnosis:!1,research:!1,embedding:!1}),R=z({diagnosis:[],research:[],embedding:[]}),O=z({diagnosis:!1,research:!1,embedding:!1});function v(t){const e=d[t];return e.reuse?d[e.reuse]?.provider||"":e.provider}async function h(t){const e=d[t],f=v(t),M=e.reuse?d[e.reuse]:e,ee=M.apiKey||void 0;O[t]=!0;try{const te=await $fetch("/api/settings/ai/models",{method:"POST",body:{role:t,provider:f,baseUrl:M.baseUrl||void 0,apiKey:ee}});R[t]=te.models}catch{R[t]=[]}finally{O[t]=!1}}const w=[{key:"diagnosis",title:"Diagnosis model",icon:"i-lucide-stethoscope",help:"settings.ai-provider",optional:!1,enableLabel:"",blurb:"The main model that writes the final diagnosis. Required to enable AI features.",reuseTargets:[],modelPlaceholderAnthropic:"claude-opus-4-8",modelPlaceholderOpenai:"e.g. gpt-4o, llama3.1"},{key:"research",title:"Research model",icon:"i-lucide-search",help:"settings.ai-research",optional:!0,enableLabel:"Two-stage diagnosis",blurb:"A cheaper/faster model that pre-analyzes the failure before the diagnosis model writes the final answer. Also used for cluster naming and merge adjudication.",reuseTargets:["diagnosis"],modelPlaceholderAnthropic:"e.g. claude-haiku-4-5",modelPlaceholderOpenai:"e.g. llama-3.1-8b-instant"},{key:"embedding",title:"Embedding model",icon:"i-lucide-vector-square",help:"settings.embedding-model",optional:!0,enableLabel:"Semantic clustering",blurb:"Embeds failures so semantically-similar errors group together (used by failure clustering).",reuseTargets:["diagnosis","research"],modelPlaceholderAnthropic:"— Anthropic has no embeddings API —",modelPlaceholderOpenai:"e.g. text-embedding-3-small"}],de=[{label:"Anthropic API",value:"anthropic"},{label:"OpenAI-compatible",value:"openai"}],he=de.filter(t=>t.value!=="anthropic"),be=N(()=>{const t={};for(const e of w)t[e.key]=[{label:"Configure its own provider",value:"own"},...e.reuseTargets.filter(f=>d[f].enabled||f==="diagnosis").filter(f=>e.key!=="embedding"||d[f].provider==="openai").map(f=>({label:`Reuse ${w.find(M=>M.key===f).title.toLowerCase()}`,value:f}))];return t}),D=N(()=>!!r.value?.envManaged),_e=Xe(qe("ai"));se(r,t=>{if(t){for(const e of w){const f=t.roles[e.key],M=d[e.key];M.enabled=!!f,M.reuse=f?.reuse??null,M.provider=f?.provider??"",M.model=f?.model??"",M.baseUrl=f?.baseUrl??"",M.apiKey=""}l.value=t.autoDiagnose,x.value=t.customInstructions||""}},{immediate:!0});function xe(t){return!!r.value?.roles[t]?.hasApiKey}const ce=[{label:"ollama (local)",baseUrl:"http://localhost:11434/v1",model:"llama3.1"},{label:"LM Studio (local)",baseUrl:"http://localhost:1234/v1",model:""},{label:"OpenRouter",baseUrl:"https://openrouter.ai/api/v1",model:"meta-llama/llama-3.1-8b-instruct"},{label:"Groq",baseUrl:"https://api.groq.com/openai/v1",model:"llama-3.1-8b-instant"},{label:"OpenAI",baseUrl:"https://api.openai.com/v1",model:"gpt-4o"},{label:"Mistral AI",baseUrl:"https://api.mistral.ai/v1",model:"mistral-small-latest"},{label:"Custom",baseUrl:"",model:""}],ke=ce.map(t=>({label:t.label,value:t.label}));function Ae(t,e){const f=ce.find(M=>M.label===e);!f||f.label==="Custom"||(d[t].baseUrl=f.baseUrl,d[t].model=f.model)}function Q(t){const e=d[t];if(!e.enabled)return null;if(e.reuse)return{reuse:e.reuse,model:e.model||void 0};const f={provider:e.provider,model:e.model||void 0,baseUrl:e.baseUrl||void 0};return e.apiKey!==""&&(f.apiKey=e.apiKey),f}async function Ie(){$.value=!0;try{!D&&(!d.diagnosis.enabled||!d.diagnosis.provider)?await $fetch("/api/settings/ai",{method:"PUT",body:{roles:null,autoDiagnose:l.value}}):await $fetch("/api/settings/ai",{method:"PUT",body:{roles:{diagnosis:Q("diagnosis"),research:Q("research"),embedding:Q("embedding")},autoDiagnose:l.value}}),await k();for(const t of w)d[t.key].apiKey="";g.add({title:"Settings saved",color:"success"})}catch(t){g.add({title:"Save failed",description:String(t?.message??t),color:"error"})}finally{$.value=!1}}async function Me(){i.value=!0;try{await $fetch("/api/settings/ai",{method:"PUT",body:{scmToken:V.value||null}}),await k(),V.value="",g.add({title:"SCM token saved",color:"success"})}catch(t){g.add({title:"Save failed",description:String(t?.message??t),color:"error"})}finally{i.value=!1}}async function Se(){y.value=!0;try{await $fetch("/api/settings/ai",{method:"PUT",body:{customInstructions:x.value||null}}),await k(),g.add({title:"Instructions saved",color:"success"})}catch(t){g.add({title:"Save failed",description:String(t?.message??t),color:"error"})}finally{y.value=!1}}async function Ve(t){C[t]=!0;try{const e=d[t],f=e.reuse?d[e.reuse]:e,M=await $fetch("/api/settings/ai/test",{method:"POST",body:{role:t,provider:f.provider||void 0,apiKey:f.apiKey||void 0,model:e.model||(e.reuse?f.model:"")||void 0,baseUrl:f.baseUrl||void 0}});M.success?g.add({title:"Connection successful",description:`Model: ${M.model}`,color:"success"}):g.add({title:"Connection failed",description:M.error||"Unknown error",color:"error"})}catch(e){g.add({title:"Connection failed",description:String(e?.message??e),color:"error"})}finally{C[t]=!1}}const{data:L}=([I,T]=ae(()=>oe("/api/settings/ai/limits","$cSpsteApgW")),I=await I,T(),I),Y=$t,q=z({}),Z=E(!1),J=N(()=>new Set(L.value?.envManaged??[]));se(L,t=>{if(t)for(const e of Y)q[e.key]=t.limits[e.key]},{immediate:!0});async function we(){Z.value=!0;try{L.value=await $fetch("/api/settings/ai/limits",{method:"PUT",body:{limits:q}}),g.add({title:"Context limits saved",color:"success"})}catch(t){g.add({title:"Failed to save context limits",description:String(t?.message??t),color:"error"})}finally{Z.value=!1}}function Pe(){if(L.value)for(const t of Y)J.value.has(t.key)||(q[t.key]=L.value.defaults[t.key])}return(t,e)=>{const f=Re,M=bt,ee=pe,te=Ee,j=re,K=ye,Te=Et,ue=G,me=ve,Ue=Ne,Ce=ge;return n(),p("div",Ot,[o(D)?(n(),P(f,{key:0,"env-vars":o(_e)},null,8,["env-vars"])):_("",!0),c(K,{icon:"i-lucide-sparkles",title:"Model providers",help:"settings.ai-provider"},{subtitle:u(()=>[...e[3]||(e[3]=[A(" Configure a complete provider for each model role. Optional roles can reuse another role's provider so you don't re-enter credentials. ",-1)])]),footer:u(()=>[s("div",Ft,[c(j,{color:"primary",loading:o($),icon:"i-lucide-save",onClick:Ie},{default:u(()=>[...e[5]||(e[5]=[A(" Save ",-1)])]),_:1},8,["loading"])])]),default:u(()=>[s("div",Lt,[(n(),p(U,null,F(w,m=>c(M,{key:m.key,modelValue:o(d)[m.key],"onUpdate:modelValue":B=>o(d)[m.key]=B,meta:m,"has-api-key":xe(m.key),"reuse-options":o(be)[m.key],"provider-options":m.key==="embedding"?o(he):de,"preset-options":o(ke),disabled:o(D),"env-managed":o(D),"provider-resolved":v(m.key),models:o(R)[m.key],"loading-models":o(O)[m.key],testing:o(C)[m.key],onApplyPreset:B=>Ae(m.key,B),onLoadModels:B=>h(m.key),onTest:B=>Ve(m.key)},null,8,["modelValue","onUpdate:modelValue","meta","has-api-key","reuse-options","provider-options","preset-options","disabled","env-managed","provider-resolved","models","loading-models","testing","onApplyPreset","onLoadModels","onTest"])),64)),c(te,{label:"Auto-diagnose",help:"settings.auto-diagnose","env-managed":o(D)},{default:u(()=>[s("div",Bt,[c(ee,{modelValue:o(l),"onUpdate:modelValue":e[0]||(e[0]=m=>W(l)?l.value=m:null),disabled:o(D)||!o(d).diagnosis.enabled},null,8,["modelValue","disabled"]),e[4]||(e[4]=s("span",{class:"text-sm text-gray-500"}," Automatically diagnose new failure clusters when a run finishes — up to 3 clusters per run (research + diagnosis call each), plus one batched call to title new clusters ",-1))])]),_:1},8,["env-managed"])])]),_:1}),c(Te),c(K,{title:"Repository access",help:"project.scm-token"},{subtitle:u(()=>[...e[6]||(e[6]=[A(" Optional — required for private repositories. Per-project tokens override this. ",-1)])]),footer:u(()=>[s("div",Wt,[c(j,{color:"primary",loading:o(i),icon:"i-lucide-save",onClick:Me},{default:u(()=>[...e[7]||(e[7]=[A(" Save token ",-1)])]),_:1},8,["loading"])])]),default:u(()=>[c(me,{label:"SCM token",description:o(r)?.hasScmToken?"Leave empty to keep the stored token, enter a new value to replace it, or save empty to remove it":"Personal access token with read access to repository contents. Supports GitHub (ghp_), GitLab (glpat-), and Bitbucket tokens."},{default:u(()=>[c(ue,{modelValue:o(V),"onUpdate:modelValue":e[1]||(e[1]=m=>W(V)?V.value=m:null),type:"password",placeholder:o(r)?.hasScmToken?"•••••••• (unchanged)":"ghp_..., glpat-..., or Bitbucket token",class:"w-full font-mono"},null,8,["modelValue","placeholder"])]),_:1},8,["description"])]),_:1}),c(K,{title:"Global analysis instructions",help:"settings.ai-instructions"},{footer:u(()=>[s("div",Dt,[c(j,{color:"primary",loading:o(y),icon:"i-lucide-save",onClick:Se},{default:u(()=>[...e[8]||(e[8]=[A(" Save instructions ",-1)])]),_:1},8,["loading"])])]),default:u(()=>[c(Ue,{modelValue:o(x),"onUpdate:modelValue":e[2]||(e[2]=m=>W(x)?x.value=m:null),rows:6,placeholder:"e.g. Always suggest running failing tests with --repeat-each 5 to confirm flakiness. Prefer network-level evidence over ARIA snapshots. Recommend git bisect when a commit range is available.",class:"w-full font-mono text-sm"},null,8,["modelValue"]),e[9]||(e[9]=s("p",{class:"text-xs text-gray-400 mt-2"}," These instructions are appended to the base system prompt. They shape how the AI analyzes failures but cannot override the response schema or confidence requirement. ",-1))]),_:1}),c(K,{title:"Diagnosis context limits",help:"settings.ai-limits"},{subtitle:u(()=>[...e[10]||(e[10]=[A(" Leave a field empty to use its default; env-managed fields are read-only. ",-1)])]),footer:u(()=>[s("div",Xt,[c(j,{color:"neutral",variant:"ghost",size:"sm",onClick:Pe},{default:u(()=>[...e[11]||(e[11]=[A("Reset to defaults",-1)])]),_:1}),c(j,{color:"primary",loading:o(Z),icon:"i-lucide-save",size:"sm",onClick:we},{default:u(()=>[...e[12]||(e[12]=[A(" Save limits ",-1)])]),_:1},8,["loading"])])]),default:u(()=>[s("div",Nt,[(n(!0),p(U,null,F(o(Y),m=>(n(),P(me,{key:m.key,label:m.label,description:m.description,hint:`default ${o(L)?.defaults[m.key]??""}`},{default:u(()=>[c(ue,{modelValue:o(q)[m.key],"onUpdate:modelValue":B=>o(q)[m.key]=B,modelModifiers:{number:!0},type:"number",min:m.min,max:m.max,disabled:o(J).has(m.key),placeholder:`default ${o(L)?.defaults[m.key]??""}`,class:"w-full"},Le({_:2},[o(J).has(m.key)?{name:"trailing",fn:u(()=>[c(Ce,{"env-vars":[m.envVar]},null,8,["env-vars"])]),key:"0"}:void 0]),1032,["modelValue","onUpdate:modelValue","min","max","disabled","placeholder"])]),_:2},1032,["label","description","hint"]))),128))])]),_:1}),c(K,{icon:"i-lucide-shield-check",title:"Privacy notice",help:"settings.privacy"},{default:u(()=>[...e[13]||(e[13]=[s("div",{class:"space-y-2 text-sm text-gray-600 dark:text-gray-400"},[s("p",null,"When diagnosing a failure cluster, the following data is sent to the configured LLM provider:"),s("ul",{class:"list-disc list-inside space-y-1 ml-2"},[s("li",null,"Normalized error signature and sample raw error text"),s("li",null,"Test titles and file paths for affected tests"),s("li",null,"Browser info, test steps, console error/warning entries (excerpts)"),s("li",null,"Failed network request URLs and status codes"),s("li",null,"ARIA page snapshot (if collected)"),s("li",null," Commit SHA range since last passing run, plus changed file names and diff patches fetched from GitHub/GitLab/Bitbucket (if a repository token is configured or the repo is public) ")]),s("p",{class:"mt-2"},[A(" API keys are stored encrypted in the application database (admin-only access). For stricter setups, use the "),s("code",{class:"font-mono text-xs"},"PIWI_AI_*"),A(" environment variables instead of the UI. ")])],-1)])]),_:1})])}}});export{ms as default};
|
|
1
|
+
import{_ as Re,a as Ee}from"./PxPbRVF-.js";import{d as H,z as le,B as se,o as n,f as P,g as u,i as s,j as c,D as G,l as W,k as o,c as p,v as ne,F as U,y as F,p as ie,m as A,t as S,q as _,A as X,r as E,h as N,G as $e,_ as re,w as ae,b as Oe,aa as Le,I as z}from"./BrT_Sys2.js";import{_ as Be}from"./B6hPf4UR.js";import{_ as pe}from"./Ds2Y3oms.js";import{_ as fe}from"./sMFaPAAR.js";import{_ as ve}from"./ClJkng9p.js";import{_ as ge}from"./CWmQcueG.js";import{_ as Fe}from"./BciovqwK.js";import{h as We}from"./r3SBLxtE.js";import{_ as ye}from"./CHIbdzqp.js";import{h as De}from"./D7P0ML0H.js";import{u as oe}from"./Dvc1aWpA.js";import{_ as Ne}from"./Dz3Wbekz.js";import{p as Xe,g as qe}from"./D_TbJDHY.js";import"./BU6xjw05.js";import"./DtXREpk_.js";import"./rw7Hdll3.js";import"./26ll_vBr.js";import"./DATh_1DQ.js";import"./ByoIgYX_.js";import"./DTH2lteW.js";import"./CoKEjZX7.js";const je={class:"space-y-3"},Ke={key:0,class:"flex items-center justify-center gap-2 py-8 text-gray-400"},ze={key:1,class:"py-8 text-center text-sm text-gray-400"},He={key:2,class:"max-h-96 overflow-y-auto space-y-px"},Ge=["onClick"],Qe={class:"flex-1 min-w-0"},Ye={class:"text-sm font-medium leading-snug truncate"},Ze={key:0,class:"text-gray-500 font-normal"},Je={class:"text-xs text-gray-400 leading-snug mt-0.5"},et={key:3,class:"italic text-gray-500"},tt={key:0,class:"flex items-center gap-1 shrink-0 pt-0.5"},st=["title"],at=["title"],ot={key:0,class:"py-8 text-center text-sm text-gray-400"},lt=H({__name:"ModelPickerModal",props:X({models:{},selected:{},loading:{type:Boolean}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:X(["select"],["update:open"]),setup(a,{emit:I}){function T(y){return y?y>=1e6?`${(y/1e6).toFixed(1)}M`:y>=1e3?`${Math.round(y/1e3)}K`:String(y):""}const g=a,r=I,k=le(a,"open"),b=E(null),d=E("");se(k,y=>{y&&$e(()=>b.value?.focus())});const l=N(()=>{const y=d.value.toLowerCase();return y?g.models.filter(i=>i.id.toLowerCase().includes(y)||(i.label?.toLowerCase()??"").includes(y)):g.models}),x={image:{icon:"i-lucide-image",label:"Image input"},pdf:{icon:"i-lucide-file-text",label:"PDF input"},code:{icon:"i-lucide-code",label:"Code execution"},thinking:{icon:"i-lucide-brain",label:"Extended thinking"},json:{icon:"i-lucide-braces",label:"Structured output"},text:{icon:"i-lucide-type",label:"Text"},audio:{icon:"i-lucide-music",label:"Audio"}};function V(y){return y.map(i=>{const C=i.indexOf("→");if(C!==-1){const R=i.slice(0,C),O=i.slice(C+1);return{inputs:R.split("+").filter(Boolean),outputs:O.split("+").filter(Boolean)}}return{inputs:[i],outputs:[]}})}function $(y){r("select",y),k.value=!1,d.value=""}return(y,i)=>{const C=G,R=ne,O=Fe;return n(),P(O,{open:k.value,"onUpdate:open":i[1]||(i[1]=v=>k.value=v),title:"Select a model",ui:{content:"max-w-2xl"}},{body:u(()=>[s("div",je,[c(C,{ref_key:"searchInput",ref:b,modelValue:o(d),"onUpdate:modelValue":i[0]||(i[0]=v=>W(d)?d.value=v:null),placeholder:"Search models…",icon:"i-lucide-search",size:"sm"},null,8,["modelValue"]),a.models.length===0&&a.loading?(n(),p("div",Ke,[c(R,{name:"i-lucide-loader-2",class:"size-4 animate-spin"}),i[2]||(i[2]=s("span",{class:"text-sm"},"Loading models…",-1))])):a.models.length===0?(n(),p("div",ze," No models available — check your provider configuration ")):(n(),p("div",He,[(n(!0),p(U,null,F(o(l),v=>(n(),p("button",{key:v.id,class:ie(["w-full text-left px-4 py-3 rounded-lg hover:bg-elevated transition-colors border border-transparent hover:border-default flex items-start gap-4",a.selected===v.id?"bg-primary/10 ring-1 ring-inset ring-primary/30 border-primary/30":""]),onClick:h=>$(v.id)},[s("div",Qe,[s("p",Ye,[A(S(v.id)+" ",1),v.label&&v.label!==v.id?(n(),p("span",Ze," — "+S(v.label),1)):_("",!0)]),s("p",Je,[v.contextLength?(n(),p(U,{key:0},[A(S(T(v.contextLength))+" ctx",1)],64)):_("",!0),v.maxTokens?(n(),p(U,{key:1},[A(" · up to "+S(T(v.maxTokens))+" out",1)],64)):_("",!0),v.pricing?.prompt?(n(),p(U,{key:2},[A(" · $"+S(v.pricing.prompt)+" / $"+S(v.pricing.completion??"?")+" per 1M",1)],64)):_("",!0),!v.contextLength&&!v.maxTokens&&!v.pricing?.prompt?(n(),p("span",et,"No additional info")):_("",!0)])]),v.modalities?.length?(n(),p("div",tt,[(n(!0),p(U,null,F(V(v.modalities),h=>(n(),p(U,{key:h.inputs.join()+"→"+h.outputs.join()},[(n(!0),p(U,null,F(h.inputs,w=>(n(),p("span",{key:"in-"+w,title:x[w]?.label??w,class:"inline-flex items-center justify-center size-6 rounded-md bg-gray-100 dark:bg-gray-800 text-gray-500 hover:text-primary transition-colors"},[c(R,{name:x[w]?.icon??"i-lucide-cpu",class:"size-3.5"},null,8,["name"])],8,st))),128)),h.outputs.length?(n(),P(R,{key:0,name:"i-lucide-arrow-right",class:"size-3 text-gray-400 shrink-0"})):_("",!0),(n(!0),p(U,null,F(h.outputs,w=>(n(),p("span",{key:"out-"+w,title:x[w]?.label??w,class:"inline-flex items-center justify-center size-6 rounded-md bg-gray-100 dark:bg-gray-800 text-gray-500 hover:text-primary transition-colors"},[c(R,{name:x[w]?.icon??"i-lucide-cpu",class:"size-3.5"},null,8,["name"])],8,at))),128))],64))),128))])):_("",!0)],10,Ge))),128)),o(l).length===0?(n(),p("div",ot,' No models match "'+S(o(d))+'" ',1)):_("",!0)]))])]),_:1},8,["open"])}}}),nt=Object.assign(lt,{__name:"ModelPickerModal"}),it={class:"flex gap-2"},rt=H({__name:"ModelFieldInput",props:X({provider:{},providerResolved:{},reuse:{type:Boolean},models:{},loadingModels:{type:Boolean},placeholderAnthropic:{},placeholderOpenai:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:X(["loadModels"],["update:modelValue"]),setup(a,{emit:I}){const T=I,g=le(a,"modelValue"),r=E(!1);return(k,b)=>{const d=G,l=re,x=nt;return n(),p(U,null,[s("div",it,[c(d,{modelValue:g.value,"onUpdate:modelValue":b[0]||(b[0]=V=>g.value=V),placeholder:a.providerResolved==="anthropic"?a.placeholderAnthropic:a.placeholderOpenai,class:"flex-1"},null,8,["modelValue","placeholder"]),a.providerResolved?(n(),P(l,{key:0,size:"sm",variant:"soft",onClick:b[1]||(b[1]=V=>{T("loadModels"),r.value=!0})},{default:u(()=>[...b[4]||(b[4]=[A(" Choose model… ",-1)])]),_:1})):_("",!0)]),c(x,{open:o(r),"onUpdate:open":b[2]||(b[2]=V=>W(r)?r.value=V:null),models:a.models,selected:g.value,loading:a.loadingModels,onSelect:b[3]||(b[3]=V=>g.value=V)},null,8,["open","models","selected","loading"])],64)}}}),dt=Object.assign(rt,{__name:"ModelFieldInput"}),ct={class:"flex items-start justify-between gap-3"},ut={class:"flex items-start gap-2"},mt={class:"font-medium inline-flex items-center gap-1"},pt={class:"text-sm text-gray-500"},ft={class:"inline-flex items-center gap-1"},vt={class:"inline-flex items-center gap-1"},gt={class:"inline-flex items-center gap-1"},yt={key:3,class:"flex justify-end"},ht=H({__name:"AiRoleConfigForm",props:X({meta:{},hasApiKey:{type:Boolean},reuseOptions:{},providerOptions:{},presetOptions:{},disabled:{type:Boolean},envManaged:{type:Boolean},models:{},loadingModels:{type:Boolean},providerResolved:{},testing:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:X(["applyPreset","loadModels","test"],["update:modelValue"]),setup(a,{emit:I}){const T=a,g=I,r=le(a,"modelValue"),k=N({get:()=>r.value.reuse??"own",set:d=>r.value.reuse=d==="own"?null:d}),b=N(()=>We(T.meta.help));return(d,l)=>{const x=ne,V=Be,$=pe,y=fe,i=ve,C=ge,R=G,O=dt,v=re;return n(),p("div",{class:ie(["rounded-lg border border-default p-4 space-y-4",a.meta.optional&&!r.value.enabled?"opacity-80":""])},[s("div",ct,[s("div",ut,[c(x,{name:a.meta.icon,class:"size-5 mt-0.5 text-primary"},null,8,["name"]),s("div",null,[s("p",mt,[A(S(a.meta.title)+" ",1),c(V,{topic:a.meta.help},null,8,["topic"])]),s("p",pt,S(a.meta.blurb),1)])]),a.meta.optional?(n(),P($,{key:0,modelValue:r.value.enabled,"onUpdate:modelValue":l[0]||(l[0]=h=>r.value.enabled=h),disabled:a.disabled&&!a.envManaged,"aria-label":a.meta.enableLabel},null,8,["modelValue","disabled","aria-label"])):_("",!0)]),!a.meta.optional||r.value.enabled?(n(),p(U,{key:0},[a.meta.reuseTargets.length?(n(),P(i,{key:0,label:"Provider source"},{default:u(()=>[c(y,{modelValue:o(k),"onUpdate:modelValue":l[1]||(l[1]=h=>W(k)?k.value=h:null),items:a.reuseOptions,disabled:a.disabled&&!a.envManaged,class:"w-full"},null,8,["modelValue","items","disabled"])]),_:1})):_("",!0),r.value.reuse?_("",!0):(n(),p(U,{key:1},[c(i,{label:"Provider"},{label:u(()=>[s("span",ft,[l[9]||(l[9]=A(" Provider ",-1)),a.disabled?(n(),P(C,{key:0,"env-vars":o(b)},null,8,["env-vars"])):_("",!0)])]),default:u(()=>[c(y,{modelValue:r.value.provider,"onUpdate:modelValue":l[2]||(l[2]=h=>r.value.provider=h),items:a.providerOptions,disabled:a.disabled,placeholder:"Choose a provider…",class:"w-full"},null,8,["modelValue","items","disabled"])]),_:1}),r.value.provider==="openai"?(n(),P(i,{key:0,label:"Preset",description:"Pick a known provider to auto-fill the URL and model, then adjust as needed"},{default:u(()=>[c(y,{items:a.presetOptions,placeholder:"Choose a preset…",disabled:a.disabled,class:"w-full","onUpdate:modelValue":l[3]||(l[3]=h=>g("applyPreset",h))},null,8,["items","disabled"])]),_:1})):_("",!0),r.value.provider?(n(),P(i,{key:1,label:"API key",description:a.hasApiKey?"Leave empty to keep the stored key, clear and save to remove it":"Required for Anthropic; optional for local OpenAI-compatible servers"},{label:u(()=>[s("span",vt,[l[10]||(l[10]=A(" API key ",-1)),a.disabled?(n(),P(C,{key:0,"env-vars":o(b)},null,8,["env-vars"])):_("",!0)])]),default:u(()=>[c(R,{modelValue:r.value.apiKey,"onUpdate:modelValue":l[4]||(l[4]=h=>r.value.apiKey=h),type:"password",placeholder:a.hasApiKey?"•••••••• (unchanged)":"sk-…",disabled:a.disabled,class:"w-full font-mono"},null,8,["modelValue","placeholder","disabled"])]),_:1},8,["description"])):_("",!0),r.value.provider==="openai"?(n(),P(i,{key:2,label:"Base URL",description:"Required, e.g. http://localhost:11434/v1"},{label:u(()=>[s("span",gt,[l[11]||(l[11]=A(" Base URL ",-1)),a.disabled?(n(),P(C,{key:0,"env-vars":o(b)},null,8,["env-vars"])):_("",!0)])]),default:u(()=>[c(R,{modelValue:r.value.baseUrl,"onUpdate:modelValue":l[5]||(l[5]=h=>r.value.baseUrl=h),placeholder:"http://localhost:11434/v1",disabled:a.disabled,class:"w-full"},null,8,["modelValue","disabled"])]),_:1})):_("",!0)],64)),r.value.reuse||r.value.provider?(n(),P(i,{key:2,label:"Model",description:r.value.reuse?"Leave empty to use the reused role's model":void 0},{default:u(()=>[c(O,{modelValue:r.value.model,"onUpdate:modelValue":l[6]||(l[6]=h=>r.value.model=h),provider:r.value.provider,"provider-resolved":a.providerResolved,reuse:!!r.value.reuse,models:a.models,"loading-models":a.loadingModels,"placeholder-anthropic":a.meta.modelPlaceholderAnthropic,"placeholder-openai":a.meta.modelPlaceholderOpenai,onLoadModels:l[7]||(l[7]=h=>g("loadModels"))},null,8,["modelValue","provider","provider-resolved","reuse","models","loading-models","placeholder-anthropic","placeholder-openai"])]),_:1},8,["description"])):_("",!0),a.providerResolved?(n(),p("div",yt,[c(v,{size:"xs",color:"neutral",variant:"soft",icon:"i-lucide-plug",loading:a.testing,onClick:l[8]||(l[8]=h=>g("test"))},{default:u(()=>[...l[12]||(l[12]=[A(" Test connection ",-1)])]),_:1},8,["loading"])])):_("",!0)],64)):_("",!0)],2)}}}),bt=Object.assign(ht,{__name:"AiRoleConfigForm"}),_t={key:0,class:"space-y-3"},xt={class:"text-sm text-gray-500"},kt={key:0,class:"text-sm text-gray-500"},At={key:1,class:"overflow-x-auto"},It={class:"w-full text-sm"},Mt={class:"px-2 py-2"},St={class:"font-mono text-xs"},Vt={class:"text-xs text-gray-400"},wt={class:"text-right px-2 py-2"},Pt=["title"],Tt=["title"],Ut={class:"text-right px-2 py-2"},Ct={key:1,class:"flex items-center gap-2 py-4 text-muted"},Rt=H({__name:"AiUsagePanel",async setup(a){let I,T;const g=E(30),r=[{label:"Last 7 days",value:7},{label:"Last 30 days",value:30},{label:"Last 90 days",value:90}],{data:k,pending:b}=([I,T]=ae(()=>oe("/api/settings/ai/usage",{query:{days:g}},"$1ij5UlwVIK")),I=await I,T(),I);function d(l){return l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}k`:String(l)}return(l,x)=>{const V=fe,$=ne,y=ye;return n(),P(y,{icon:"i-lucide-activity",title:"AI usage"},{actions:u(()=>[c(V,{modelValue:o(g),"onUpdate:modelValue":x[0]||(x[0]=i=>W(g)?g.value=i:null),items:r,size:"sm",class:"w-36"},null,8,["modelValue"])]),default:u(()=>[o(k)?(n(),p("div",_t,[s("p",xt,S(d(o(k).totals.diagnoses))+" diagnoses · "+S(d(o(k).totals.inputTokens))+" input tokens · "+S(d(o(k).totals.outputTokens))+" output tokens ",1),o(k).byModel.length===0?(n(),p("p",kt,"No AI calls recorded in this period.")):(n(),p("div",At,[s("table",It,[x[1]||(x[1]=s("thead",null,[s("tr",{class:"text-xs text-gray-500 uppercase tracking-wider border-b border-default"},[s("th",{class:"text-left px-2 py-2 font-medium"},"Model"),s("th",{class:"text-right px-2 py-2 font-medium"},"Diagnoses"),s("th",{class:"text-right px-2 py-2 font-medium"},"Failed"),s("th",{class:"text-right px-2 py-2 font-medium"},"Input tokens"),s("th",{class:"text-right px-2 py-2 font-medium"},"Output tokens"),s("th",{class:"text-right px-2 py-2 font-medium"},"Avg duration")])],-1)),s("tbody",null,[(n(!0),p(U,null,F(o(k).byModel,i=>(n(),p("tr",{key:`${i.provider??"unknown"}/${i.model}`,class:"border-b last:border-b-0 border-default"},[s("td",Mt,[s("span",St,S(i.model),1),s("span",Vt," · "+S(i.provider??"unknown"),1)]),s("td",wt,S(i.diagnoses),1),s("td",{class:ie(["text-right px-2 py-2",i.failed>0?"text-red-600 dark:text-red-400":""])},S(i.failed),3),s("td",{class:"text-right px-2 py-2",title:i.inputTokens.toLocaleString()},S(d(i.inputTokens)),9,Pt),s("td",{class:"text-right px-2 py-2",title:i.outputTokens.toLocaleString()},S(d(i.outputTokens)),9,Tt),s("td",Ut,S(i.avgDurationMs===null?"—":("formatDuration"in l?l.formatDuration:o(De))(i.avgDurationMs)),1)]))),128))])])]))])):o(b)?(n(),p("div",Ct,[c($,{name:"i-lucide-loader-circle",class:"size-4 animate-spin"}),x[2]||(x[2]=s("span",{class:"text-sm"},"Loading usage…",-1))])):_("",!0)]),_:1})}}}),Et=Object.assign(Rt,{__name:"AiUsagePanel"}),$t=[{key:"sampleErrorChars",label:"Error text characters",envVar:"PIWI_AI_MAX_SAMPLE_ERROR_CHARS",description:"Max characters of raw error text (per error block).",min:200,max:5e4},{key:"scmPatchBudget",label:"SCM patch budget",envVar:"PIWI_AI_MAX_SCM_PATCH_BUDGET",description:"Total characters of diff patches across changed files.",min:0,max:5e4},{key:"affectedTests",label:"Affected tests",envVar:"PIWI_AI_MAX_AFFECTED_TESTS",description:"Max affected tests listed.",min:1,max:200},{key:"steps",label:"Test steps",envVar:"PIWI_AI_MAX_STEPS",description:"Max recent test steps included.",min:1,max:200},{key:"consoleEntries",label:"Console entries",envVar:"PIWI_AI_MAX_CONSOLE_ENTRIES",description:"Max console error/warning entries included.",min:0,max:200},{key:"consoleEntryChars",label:"Console entry characters",envVar:"PIWI_AI_MAX_CONSOLE_ENTRY_CHARS",description:"Max characters per console entry.",min:50,max:5e3},{key:"networkRequests",label:"Network requests",envVar:"PIWI_AI_MAX_NETWORK_REQUESTS",description:"Max failed network requests included.",min:0,max:200},{key:"ariaSnapshotChars",label:"ARIA snapshot characters",envVar:"PIWI_AI_MAX_ARIA_SNAPSHOT_CHARS",description:"Max characters of the page ARIA snapshot.",min:0,max:5e4},{key:"testSourceChars",label:"Test source characters",envVar:"PIWI_AI_MAX_TEST_SOURCE_CHARS",description:"Max characters of the test source snippet.",min:0,max:5e4},{key:"maxSourceFiles",label:"Full source files",envVar:"PIWI_AI_MAX_SOURCE_FILES",description:"Max full source files fetched from SCM to ground patches (0 disables).",min:0,max:20},{key:"sourceFileChars",label:"Source file characters",envVar:"PIWI_AI_MAX_SOURCE_FILE_CHARS",description:"Max characters per fetched full source file.",min:0,max:5e4},{key:"serverLogEntries",label:"Server log entries",envVar:"PIWI_AI_MAX_SERVER_LOG_ENTRIES",description:"Max backend server log entries (from X-Piwi-Logs header) included.",min:0,max:200},{key:"serverLogEntryChars",label:"Server log entry characters",envVar:"PIWI_AI_MAX_SERVER_LOG_ENTRY_CHARS",description:"Max characters per backend server log entry.",min:50,max:5e3},{key:"serverTraceSpans",label:"Server trace spans",envVar:"PIWI_AI_MAX_SERVER_TRACE_SPANS",description:"Max backend server spans (from X-Piwi-Trace header) included (0 disables).",min:0,max:500},{key:"maxImages",label:"Max screenshots",envVar:"PIWI_AI_MAX_IMAGES",description:"Max screenshots auto-included in the diagnosis context.",min:0,max:20},{key:"maxPassedPeers",label:"Max passed peers",envVar:"PIWI_AI_MAX_PASSED_PEERS",description:"Max peer tests in the same file listed when they passed.",min:0,max:100},{key:"maxConsoleWindow",label:"Console window entries",envVar:"PIWI_AI_MAX_CONSOLE_WINDOW",description:"Max console entries of any type in the window before failure.",min:0,max:200},{key:"slowRequestMs",label:"Slow request threshold (ms)",envVar:"PIWI_AI_SLOW_REQUEST_MS",description:"Network request duration threshold for flagging as slow.",min:100,max:3e4},{key:"maxTraceActions",label:"Trace actions",envVar:"PIWI_AI_MAX_TRACE_ACTIONS",description:"Max actions extracted from trace ZIP for failing-action context (0 disables).",min:0,max:50},{key:"traceDomChars",label:"Trace DOM excerpt characters",envVar:"PIWI_AI_TRACE_DOM_CHARS",description:"Max characters for the trace-derived DOM/ARIA excerpt in failing-action context.",min:0,max:2e4},{key:"traceStackFrames",label:"Trace stack frames",envVar:"PIWI_AI_MAX_TRACE_STACK_FRAMES",description:"Max call-stack frames (with source windows) from the trace (0 disables).",min:0,max:50},{key:"traceNetworkRequests",label:"Trace network requests",envVar:"PIWI_AI_MAX_TRACE_NETWORK_REQUESTS",description:"Max requests from the trace network stream (0 disables).",min:0,max:200},{key:"domSnapshotChars",label:"DOM snapshot characters",envVar:"PIWI_AI_MAX_DOM_SNAPSHOT_CHARS",description:"Max characters of the failure-time DOM snapshot rendered from the trace (0 disables).",min:0,max:5e4},{key:"imageMaxEdge",label:"Screenshot max edge (px)",envVar:"PIWI_AI_IMAGE_MAX_EDGE",description:"Screenshots are downscaled to at most this many pixels on the long edge before being sent.",min:512,max:8192}],Ot={class:"space-y-6"},Lt={class:"space-y-5"},Bt={class:"flex items-center gap-3"},Ft={class:"flex items-center gap-2 justify-end"},Wt={class:"flex justify-end"},Dt={class:"flex justify-end"},Nt={class:"grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-3"},Xt={class:"flex justify-end gap-2"},ms=H({__name:"ai",async setup(a){let I,T;const g=Oe(),{data:r,refresh:k}=([I,T]=ae(()=>oe("/api/settings/ai","$nV9xx-QVRl")),I=await I,T(),I);function b(){return{enabled:!1,reuse:null,provider:"",model:"",baseUrl:"",apiKey:""}}const d=z({diagnosis:b(),research:b(),embedding:b()}),l=E(!1),x=E(""),V=E(""),$=E(!1),y=E(!1),i=E(!1),C=z({diagnosis:!1,research:!1,embedding:!1}),R=z({diagnosis:[],research:[],embedding:[]}),O=z({diagnosis:!1,research:!1,embedding:!1});function v(t){const e=d[t];return e.reuse?d[e.reuse]?.provider||"":e.provider}async function h(t){const e=d[t],f=v(t),M=e.reuse?d[e.reuse]:e,ee=M.apiKey||void 0;O[t]=!0;try{const te=await $fetch("/api/settings/ai/models",{method:"POST",body:{role:t,provider:f,baseUrl:M.baseUrl||void 0,apiKey:ee}});R[t]=te.models}catch{R[t]=[]}finally{O[t]=!1}}const w=[{key:"diagnosis",title:"Diagnosis model",icon:"i-lucide-stethoscope",help:"settings.ai-provider",optional:!1,enableLabel:"",blurb:"The main model that writes the final diagnosis. Required to enable AI features.",reuseTargets:[],modelPlaceholderAnthropic:"claude-opus-4-8",modelPlaceholderOpenai:"e.g. gpt-4o, llama3.1"},{key:"research",title:"Research model",icon:"i-lucide-search",help:"settings.ai-research",optional:!0,enableLabel:"Two-stage diagnosis",blurb:"A cheaper/faster model that pre-analyzes the failure before the diagnosis model writes the final answer. Also used for cluster naming and merge adjudication.",reuseTargets:["diagnosis"],modelPlaceholderAnthropic:"e.g. claude-haiku-4-5",modelPlaceholderOpenai:"e.g. llama-3.1-8b-instant"},{key:"embedding",title:"Embedding model",icon:"i-lucide-vector-square",help:"settings.embedding-model",optional:!0,enableLabel:"Semantic clustering",blurb:"Embeds failures so semantically-similar errors group together (used by failure clustering).",reuseTargets:["diagnosis","research"],modelPlaceholderAnthropic:"— Anthropic has no embeddings API —",modelPlaceholderOpenai:"e.g. text-embedding-3-small"}],de=[{label:"Anthropic API",value:"anthropic"},{label:"OpenAI-compatible",value:"openai"}],he=de.filter(t=>t.value!=="anthropic"),be=N(()=>{const t={};for(const e of w)t[e.key]=[{label:"Configure its own provider",value:"own"},...e.reuseTargets.filter(f=>d[f].enabled||f==="diagnosis").filter(f=>e.key!=="embedding"||d[f].provider==="openai").map(f=>({label:`Reuse ${w.find(M=>M.key===f).title.toLowerCase()}`,value:f}))];return t}),D=N(()=>!!r.value?.envManaged),_e=Xe(qe("ai"));se(r,t=>{if(t){for(const e of w){const f=t.roles[e.key],M=d[e.key];M.enabled=!!f,M.reuse=f?.reuse??null,M.provider=f?.provider??"",M.model=f?.model??"",M.baseUrl=f?.baseUrl??"",M.apiKey=""}l.value=t.autoDiagnose,x.value=t.customInstructions||""}},{immediate:!0});function xe(t){return!!r.value?.roles[t]?.hasApiKey}const ce=[{label:"ollama (local)",baseUrl:"http://localhost:11434/v1",model:"llama3.1"},{label:"LM Studio (local)",baseUrl:"http://localhost:1234/v1",model:""},{label:"OpenRouter",baseUrl:"https://openrouter.ai/api/v1",model:"meta-llama/llama-3.1-8b-instruct"},{label:"Groq",baseUrl:"https://api.groq.com/openai/v1",model:"llama-3.1-8b-instant"},{label:"OpenAI",baseUrl:"https://api.openai.com/v1",model:"gpt-4o"},{label:"Mistral AI",baseUrl:"https://api.mistral.ai/v1",model:"mistral-small-latest"},{label:"Custom",baseUrl:"",model:""}],ke=ce.map(t=>({label:t.label,value:t.label}));function Ae(t,e){const f=ce.find(M=>M.label===e);!f||f.label==="Custom"||(d[t].baseUrl=f.baseUrl,d[t].model=f.model)}function Q(t){const e=d[t];if(!e.enabled)return null;if(e.reuse)return{reuse:e.reuse,model:e.model||void 0};const f={provider:e.provider,model:e.model||void 0,baseUrl:e.baseUrl||void 0};return e.apiKey!==""&&(f.apiKey=e.apiKey),f}async function Ie(){$.value=!0;try{!D&&(!d.diagnosis.enabled||!d.diagnosis.provider)?await $fetch("/api/settings/ai",{method:"PUT",body:{roles:null,autoDiagnose:l.value}}):await $fetch("/api/settings/ai",{method:"PUT",body:{roles:{diagnosis:Q("diagnosis"),research:Q("research"),embedding:Q("embedding")},autoDiagnose:l.value}}),await k();for(const t of w)d[t.key].apiKey="";g.add({title:"Settings saved",color:"success"})}catch(t){g.add({title:"Save failed",description:String(t?.message??t),color:"error"})}finally{$.value=!1}}async function Me(){i.value=!0;try{await $fetch("/api/settings/ai",{method:"PUT",body:{scmToken:V.value||null}}),await k(),V.value="",g.add({title:"SCM token saved",color:"success"})}catch(t){g.add({title:"Save failed",description:String(t?.message??t),color:"error"})}finally{i.value=!1}}async function Se(){y.value=!0;try{await $fetch("/api/settings/ai",{method:"PUT",body:{customInstructions:x.value||null}}),await k(),g.add({title:"Instructions saved",color:"success"})}catch(t){g.add({title:"Save failed",description:String(t?.message??t),color:"error"})}finally{y.value=!1}}async function Ve(t){C[t]=!0;try{const e=d[t],f=e.reuse?d[e.reuse]:e,M=await $fetch("/api/settings/ai/test",{method:"POST",body:{role:t,provider:f.provider||void 0,apiKey:f.apiKey||void 0,model:e.model||(e.reuse?f.model:"")||void 0,baseUrl:f.baseUrl||void 0}});M.success?g.add({title:"Connection successful",description:`Model: ${M.model}`,color:"success"}):g.add({title:"Connection failed",description:M.error||"Unknown error",color:"error"})}catch(e){g.add({title:"Connection failed",description:String(e?.message??e),color:"error"})}finally{C[t]=!1}}const{data:L}=([I,T]=ae(()=>oe("/api/settings/ai/limits","$cSpsteApgW")),I=await I,T(),I),Y=$t,q=z({}),Z=E(!1),J=N(()=>new Set(L.value?.envManaged??[]));se(L,t=>{if(t)for(const e of Y)q[e.key]=t.limits[e.key]},{immediate:!0});async function we(){Z.value=!0;try{L.value=await $fetch("/api/settings/ai/limits",{method:"PUT",body:{limits:q}}),g.add({title:"Context limits saved",color:"success"})}catch(t){g.add({title:"Failed to save context limits",description:String(t?.message??t),color:"error"})}finally{Z.value=!1}}function Pe(){if(L.value)for(const t of Y)J.value.has(t.key)||(q[t.key]=L.value.defaults[t.key])}return(t,e)=>{const f=Re,M=bt,ee=pe,te=Ee,j=re,K=ye,Te=Et,ue=G,me=ve,Ue=Ne,Ce=ge;return n(),p("div",Ot,[o(D)?(n(),P(f,{key:0,"env-vars":o(_e)},null,8,["env-vars"])):_("",!0),c(K,{icon:"i-lucide-sparkles",title:"Model providers",help:"settings.ai-provider"},{subtitle:u(()=>[...e[3]||(e[3]=[A(" Configure a complete provider for each model role. Optional roles can reuse another role's provider so you don't re-enter credentials. ",-1)])]),footer:u(()=>[s("div",Ft,[c(j,{color:"primary",loading:o($),icon:"i-lucide-save",onClick:Ie},{default:u(()=>[...e[5]||(e[5]=[A(" Save ",-1)])]),_:1},8,["loading"])])]),default:u(()=>[s("div",Lt,[(n(),p(U,null,F(w,m=>c(M,{key:m.key,modelValue:o(d)[m.key],"onUpdate:modelValue":B=>o(d)[m.key]=B,meta:m,"has-api-key":xe(m.key),"reuse-options":o(be)[m.key],"provider-options":m.key==="embedding"?o(he):de,"preset-options":o(ke),disabled:o(D),"env-managed":o(D),"provider-resolved":v(m.key),models:o(R)[m.key],"loading-models":o(O)[m.key],testing:o(C)[m.key],onApplyPreset:B=>Ae(m.key,B),onLoadModels:B=>h(m.key),onTest:B=>Ve(m.key)},null,8,["modelValue","onUpdate:modelValue","meta","has-api-key","reuse-options","provider-options","preset-options","disabled","env-managed","provider-resolved","models","loading-models","testing","onApplyPreset","onLoadModels","onTest"])),64)),c(te,{label:"Auto-diagnose",help:"settings.auto-diagnose","env-managed":o(D)},{default:u(()=>[s("div",Bt,[c(ee,{modelValue:o(l),"onUpdate:modelValue":e[0]||(e[0]=m=>W(l)?l.value=m:null),disabled:o(D)||!o(d).diagnosis.enabled},null,8,["modelValue","disabled"]),e[4]||(e[4]=s("span",{class:"text-sm text-gray-500"}," Automatically diagnose new failure clusters when a run finishes — up to 3 clusters per run (research + diagnosis call each), plus one batched call to title new clusters ",-1))])]),_:1},8,["env-managed"])])]),_:1}),c(Te),c(K,{title:"Repository access",help:"project.scm-token"},{subtitle:u(()=>[...e[6]||(e[6]=[A(" Optional — required for private repositories. Per-project tokens override this. ",-1)])]),footer:u(()=>[s("div",Wt,[c(j,{color:"primary",loading:o(i),icon:"i-lucide-save",onClick:Me},{default:u(()=>[...e[7]||(e[7]=[A(" Save token ",-1)])]),_:1},8,["loading"])])]),default:u(()=>[c(me,{label:"SCM token",description:o(r)?.hasScmToken?"Leave empty to keep the stored token, enter a new value to replace it, or save empty to remove it":"Personal access token with read access to repository contents. Supports GitHub (ghp_), GitLab (glpat-), and Bitbucket tokens."},{default:u(()=>[c(ue,{modelValue:o(V),"onUpdate:modelValue":e[1]||(e[1]=m=>W(V)?V.value=m:null),type:"password",placeholder:o(r)?.hasScmToken?"•••••••• (unchanged)":"ghp_..., glpat-..., or Bitbucket token",class:"w-full font-mono"},null,8,["modelValue","placeholder"])]),_:1},8,["description"])]),_:1}),c(K,{title:"Global analysis instructions",help:"settings.ai-instructions"},{footer:u(()=>[s("div",Dt,[c(j,{color:"primary",loading:o(y),icon:"i-lucide-save",onClick:Se},{default:u(()=>[...e[8]||(e[8]=[A(" Save instructions ",-1)])]),_:1},8,["loading"])])]),default:u(()=>[c(Ue,{modelValue:o(x),"onUpdate:modelValue":e[2]||(e[2]=m=>W(x)?x.value=m:null),rows:6,placeholder:"e.g. Always suggest running failing tests with --repeat-each 5 to confirm flakiness. Prefer network-level evidence over ARIA snapshots. Recommend git bisect when a commit range is available.",class:"w-full font-mono text-sm"},null,8,["modelValue"]),e[9]||(e[9]=s("p",{class:"text-xs text-gray-400 mt-2"}," These instructions are appended to the base system prompt. They shape how the AI analyzes failures but cannot override the response schema or confidence requirement. ",-1))]),_:1}),c(K,{title:"Diagnosis context limits",help:"settings.ai-limits"},{subtitle:u(()=>[...e[10]||(e[10]=[A(" Leave a field empty to use its default; env-managed fields are read-only. ",-1)])]),footer:u(()=>[s("div",Xt,[c(j,{color:"neutral",variant:"ghost",size:"sm",onClick:Pe},{default:u(()=>[...e[11]||(e[11]=[A("Reset to defaults",-1)])]),_:1}),c(j,{color:"primary",loading:o(Z),icon:"i-lucide-save",size:"sm",onClick:we},{default:u(()=>[...e[12]||(e[12]=[A(" Save limits ",-1)])]),_:1},8,["loading"])])]),default:u(()=>[s("div",Nt,[(n(!0),p(U,null,F(o(Y),m=>(n(),P(me,{key:m.key,label:m.label,description:m.description,hint:`default ${o(L)?.defaults[m.key]??""}`},{default:u(()=>[c(ue,{modelValue:o(q)[m.key],"onUpdate:modelValue":B=>o(q)[m.key]=B,modelModifiers:{number:!0},type:"number",min:m.min,max:m.max,disabled:o(J).has(m.key),placeholder:`default ${o(L)?.defaults[m.key]??""}`,class:"w-full"},Le({_:2},[o(J).has(m.key)?{name:"trailing",fn:u(()=>[c(Ce,{"env-vars":[m.envVar]},null,8,["env-vars"])]),key:"0"}:void 0]),1032,["modelValue","onUpdate:modelValue","min","max","disabled","placeholder"])]),_:2},1032,["label","description","hint"]))),128))])]),_:1}),c(K,{icon:"i-lucide-shield-check",title:"Privacy notice",help:"settings.privacy"},{default:u(()=>[...e[13]||(e[13]=[s("div",{class:"space-y-2 text-sm text-gray-600 dark:text-gray-400"},[s("p",null,"When diagnosing a failure cluster, the following data is sent to the configured LLM provider:"),s("ul",{class:"list-disc list-inside space-y-1 ml-2"},[s("li",null,"Normalized error signature and sample raw error text"),s("li",null,"Test titles and file paths for affected tests"),s("li",null,"Browser info, test steps, console error/warning entries (excerpts)"),s("li",null,"Failed network request URLs and status codes"),s("li",null,"ARIA page snapshot (if collected)"),s("li",null," Commit SHA range since last passing run, plus changed file names and diff patches fetched from GitHub/GitLab/Bitbucket (if a repository token is configured or the repo is public) ")]),s("p",{class:"mt-2"},[A(" API keys are stored encrypted in the application database (admin-only access). For stricter setups, use the "),s("code",{class:"font-mono text-xs"},"PIWI_AI_*"),A(" environment variables instead of the UI. ")])],-1)])]),_:1})])}}});export{ms as default};
|