@recombine-ai/bosun 0.3.9 → 0.3.10
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/build/client/_app/immutable/assets/0.CJ5NCdBm.css +1 -0
- package/build/client/_app/immutable/assets/0.CJ5NCdBm.css.br +0 -0
- package/build/client/_app/immutable/assets/0.CJ5NCdBm.css.gz +0 -0
- package/build/client/_app/immutable/assets/{2.DOE0DQ6H.css → 2.DxwYfh1z.css} +1 -1
- package/build/client/_app/immutable/assets/2.DxwYfh1z.css.br +0 -0
- package/build/client/_app/immutable/assets/2.DxwYfh1z.css.gz +0 -0
- package/build/client/_app/immutable/assets/8.BX46PfEJ.css +1 -0
- package/build/client/_app/immutable/assets/8.BX46PfEJ.css.br +0 -0
- package/build/client/_app/immutable/assets/8.BX46PfEJ.css.gz +0 -0
- package/build/client/_app/immutable/assets/{AgentSidebar.QeNZJtLq.css → AgentSidebar.BL1i3rB_.css} +1 -1
- package/build/client/_app/immutable/assets/AgentSidebar.BL1i3rB_.css.br +0 -0
- package/build/client/_app/immutable/assets/AgentSidebar.BL1i3rB_.css.gz +0 -0
- package/build/client/_app/immutable/assets/Tab.DlCfjMY1.css +1 -0
- package/build/client/_app/immutable/assets/Tab.DlCfjMY1.css.br +0 -0
- package/build/client/_app/immutable/assets/Tab.DlCfjMY1.css.gz +0 -0
- package/build/client/_app/immutable/chunks/{CYkx2jgw.js → BNoAJ1Rf.js} +1 -1
- package/build/client/_app/immutable/chunks/BNoAJ1Rf.js.br +0 -0
- package/build/client/_app/immutable/chunks/BNoAJ1Rf.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{CbCJfhin.js → BVDwc-2z.js} +1 -1
- package/build/client/_app/immutable/chunks/BVDwc-2z.js.br +0 -0
- package/build/client/_app/immutable/chunks/BVDwc-2z.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{_HWrJCgx.js → BXkrt826.js} +1 -1
- package/build/client/_app/immutable/chunks/BXkrt826.js.br +0 -0
- package/build/client/_app/immutable/chunks/BXkrt826.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{DbYdNz4J.js → Bdb5tyDH.js} +1 -1
- package/build/client/_app/immutable/chunks/Bdb5tyDH.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bdb5tyDH.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{CdTjAjKm.js → BfHUxT3G.js} +7 -7
- package/build/client/_app/immutable/chunks/BfHUxT3G.js.br +0 -0
- package/build/client/_app/immutable/chunks/{CdTjAjKm.js.gz → BfHUxT3G.js.gz} +0 -0
- package/build/client/_app/immutable/chunks/{CFcfsVkY.js → Bk1rEq7o.js} +1 -1
- package/build/client/_app/immutable/chunks/Bk1rEq7o.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bk1rEq7o.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{Cv6CwVfk.js → BkclRFLx.js} +1 -1
- package/build/client/_app/immutable/chunks/BkclRFLx.js.br +0 -0
- package/build/client/_app/immutable/chunks/BkclRFLx.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{Cnr0cZA4.js → BnxfhlSj.js} +1 -1
- package/build/client/_app/immutable/chunks/BnxfhlSj.js.br +0 -0
- package/build/client/_app/immutable/chunks/BnxfhlSj.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{Y0ymTIHd.js → BqROrg0C.js} +1 -1
- package/build/client/_app/immutable/chunks/BqROrg0C.js.br +0 -0
- package/build/client/_app/immutable/chunks/BqROrg0C.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{Bub2VLj9.js → ByQey8Oa.js} +1 -1
- package/build/client/_app/immutable/chunks/ByQey8Oa.js.br +0 -0
- package/build/client/_app/immutable/chunks/ByQey8Oa.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{DrMdBz9b.js → CFwu9ET3.js} +1 -1
- package/build/client/_app/immutable/chunks/CFwu9ET3.js.br +0 -0
- package/build/client/_app/immutable/chunks/CFwu9ET3.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{BGEE3mf3.js → CIIE25ox.js} +1 -1
- package/build/client/_app/immutable/chunks/CIIE25ox.js.br +0 -0
- package/build/client/_app/immutable/chunks/CIIE25ox.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{D8qEOlWC.js → CNMNmz2q.js} +1 -1
- package/build/client/_app/immutable/chunks/CNMNmz2q.js.br +0 -0
- package/build/client/_app/immutable/chunks/CNMNmz2q.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CNvyTQrC.js +1 -0
- package/build/client/_app/immutable/chunks/CNvyTQrC.js.br +2 -0
- package/build/client/_app/immutable/chunks/CNvyTQrC.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{Cp_hX0eh.js → CVHvdSBf.js} +1 -1
- package/build/client/_app/immutable/chunks/CVHvdSBf.js.br +0 -0
- package/build/client/_app/immutable/chunks/{Cp_hX0eh.js.gz → CVHvdSBf.js.gz} +0 -0
- package/build/client/_app/immutable/chunks/{DiFAgw_s.js → CYiRxJxs.js} +1 -1
- package/build/client/_app/immutable/chunks/CYiRxJxs.js.br +0 -0
- package/build/client/_app/immutable/chunks/CYiRxJxs.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CZPhtqrs.js +8 -0
- package/build/client/_app/immutable/chunks/CZPhtqrs.js.br +0 -0
- package/build/client/_app/immutable/chunks/CZPhtqrs.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{qPgPowuc.js → CdzpH-Ca.js} +1 -1
- package/build/client/_app/immutable/chunks/CdzpH-Ca.js.br +0 -0
- package/build/client/_app/immutable/chunks/CdzpH-Ca.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{B3K88SyC.js → Cf8q8_nj.js} +1 -1
- package/build/client/_app/immutable/chunks/Cf8q8_nj.js.br +0 -0
- package/build/client/_app/immutable/chunks/Cf8q8_nj.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Cg3F7Z11.js +1 -0
- package/build/client/_app/immutable/chunks/Cg3F7Z11.js.br +0 -0
- package/build/client/_app/immutable/chunks/Cg3F7Z11.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{ri5tqg4N.js → CpSIcnXs.js} +1 -1
- package/build/client/_app/immutable/chunks/CpSIcnXs.js.br +0 -0
- package/build/client/_app/immutable/chunks/CpSIcnXs.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{sdLD1XcR.js → Ct9HfpvA.js} +1 -1
- package/build/client/_app/immutable/chunks/Ct9HfpvA.js.br +0 -0
- package/build/client/_app/immutable/chunks/Ct9HfpvA.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{C0sQKHpE.js → DJPBfZIx.js} +1 -1
- package/build/client/_app/immutable/chunks/DJPBfZIx.js.br +0 -0
- package/build/client/_app/immutable/chunks/DJPBfZIx.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{BH7VBnJ7.js → DOatwnEt.js} +1 -1
- package/build/client/_app/immutable/chunks/DOatwnEt.js.br +0 -0
- package/build/client/_app/immutable/chunks/DOatwnEt.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{C0mQlu7J.js → DQqJYxgt.js} +1 -1
- package/build/client/_app/immutable/chunks/DQqJYxgt.js.br +0 -0
- package/build/client/_app/immutable/chunks/DQqJYxgt.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{DadWvtYR.js → DSfxalyG.js} +1 -1
- package/build/client/_app/immutable/chunks/DSfxalyG.js.br +0 -0
- package/build/client/_app/immutable/chunks/DSfxalyG.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{CZ6iREyA.js → Djx0Ybbq.js} +6 -6
- package/build/client/_app/immutable/chunks/Djx0Ybbq.js.br +0 -0
- package/build/client/_app/immutable/chunks/Djx0Ybbq.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{CojkI8AD.js → Drkf9Bgr.js} +3 -3
- package/build/client/_app/immutable/chunks/Drkf9Bgr.js.br +0 -0
- package/build/client/_app/immutable/chunks/Drkf9Bgr.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{tLFXBP7P.js → DujX6kBV.js} +1 -1
- package/build/client/_app/immutable/chunks/DujX6kBV.js.br +0 -0
- package/build/client/_app/immutable/chunks/{tLFXBP7P.js.gz → DujX6kBV.js.gz} +0 -0
- package/build/client/_app/immutable/chunks/{CmPVG-ki.js → HPBQctDD.js} +1 -1
- package/build/client/_app/immutable/chunks/HPBQctDD.js.br +0 -0
- package/build/client/_app/immutable/chunks/HPBQctDD.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Jaf1TUfw.js +1 -0
- package/build/client/_app/immutable/chunks/Jaf1TUfw.js.br +2 -0
- package/build/client/_app/immutable/chunks/Jaf1TUfw.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{ByppsbS-.js → KDW88ZZa.js} +1 -1
- package/build/client/_app/immutable/chunks/KDW88ZZa.js.br +0 -0
- package/build/client/_app/immutable/chunks/KDW88ZZa.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{BOrnwyTp.js → TO5ESkEd.js} +1 -1
- package/build/client/_app/immutable/chunks/TO5ESkEd.js.br +0 -0
- package/build/client/_app/immutable/chunks/TO5ESkEd.js.gz +0 -0
- package/build/client/_app/immutable/chunks/axPa8Xqj.js +1 -0
- package/build/client/_app/immutable/chunks/axPa8Xqj.js.br +0 -0
- package/build/client/_app/immutable/chunks/axPa8Xqj.js.gz +0 -0
- package/build/client/_app/immutable/chunks/mbM5jWoB.js +4 -0
- package/build/client/_app/immutable/chunks/mbM5jWoB.js.br +0 -0
- package/build/client/_app/immutable/chunks/mbM5jWoB.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{DU-D8S0B.js → oeB0PCTX.js} +1 -1
- package/build/client/_app/immutable/chunks/oeB0PCTX.js.br +0 -0
- package/build/client/_app/immutable/chunks/oeB0PCTX.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{DsvX5v5e.js → rtsVMmSs.js} +1 -1
- package/build/client/_app/immutable/chunks/rtsVMmSs.js.br +0 -0
- package/build/client/_app/immutable/chunks/rtsVMmSs.js.gz +0 -0
- package/build/client/_app/immutable/chunks/trViNh3G.js +1 -0
- package/build/client/_app/immutable/chunks/trViNh3G.js.br +0 -0
- package/build/client/_app/immutable/chunks/trViNh3G.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{BbaH2eDw.js → yWz0pZR0.js} +1 -1
- package/build/client/_app/immutable/chunks/yWz0pZR0.js.br +0 -0
- package/build/client/_app/immutable/chunks/yWz0pZR0.js.gz +0 -0
- package/build/client/_app/immutable/entry/{app.jP0Pyfdy.js → app.Bf26VmYF.js} +2 -2
- package/build/client/_app/immutable/entry/app.Bf26VmYF.js.br +0 -0
- package/build/client/_app/immutable/entry/app.Bf26VmYF.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.B7gGsWVa.js +1 -0
- package/build/client/_app/immutable/entry/start.B7gGsWVa.js.br +2 -0
- package/build/client/_app/immutable/entry/start.B7gGsWVa.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{0.ByrdmeSo.js → 0.DzfWS9dq.js} +1 -1
- package/build/client/_app/immutable/nodes/0.DzfWS9dq.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.DzfWS9dq.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.DXQZr-dH.js +1 -0
- package/build/client/_app/immutable/nodes/1.DXQZr-dH.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.DXQZr-dH.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{13.DetV1tDO.js → 13.DaAF9e8t.js} +1 -1
- package/build/client/_app/immutable/nodes/13.DaAF9e8t.js.br +0 -0
- package/build/client/_app/immutable/nodes/13.DaAF9e8t.js.gz +0 -0
- package/build/client/_app/immutable/nodes/14.f9d5b8IR.js +11 -0
- package/build/client/_app/immutable/nodes/14.f9d5b8IR.js.br +0 -0
- package/build/client/_app/immutable/nodes/14.f9d5b8IR.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.pYR7L1PM.js +35 -0
- package/build/client/_app/immutable/nodes/2.pYR7L1PM.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.pYR7L1PM.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.D-_vDp-o.js +1 -0
- package/build/client/_app/immutable/nodes/3.D-_vDp-o.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.D-_vDp-o.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{4.CtzHYc6x.js → 4.DylMSvDw.js} +1 -1
- package/build/client/_app/immutable/nodes/4.DylMSvDw.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.DylMSvDw.js.gz +0 -0
- package/build/client/_app/immutable/nodes/5.DqrhJj9B.js +1 -0
- package/build/client/_app/immutable/nodes/5.DqrhJj9B.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.DqrhJj9B.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.C1zE2WMk.js +2 -0
- package/build/client/_app/immutable/nodes/7.C1zE2WMk.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.C1zE2WMk.js.gz +0 -0
- package/build/client/_app/immutable/nodes/8.CiDoIZSu.js +6 -0
- package/build/client/_app/immutable/nodes/8.CiDoIZSu.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.CiDoIZSu.js.gz +0 -0
- package/build/client/_app/version.json +1 -1
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/server/chunks/0-aCCGn5tt.js +9 -0
- package/build/server/chunks/{0-CjpeDbMt.js.map → 0-aCCGn5tt.js.map} +1 -1
- package/build/server/chunks/1-PJOfwEJU.js +9 -0
- package/build/server/chunks/{1-M0YzuUQM.js.map → 1-PJOfwEJU.js.map} +1 -1
- package/build/server/chunks/{13-BQ9R_Ex-.js → 13-DPcsc1p-.js} +2 -2
- package/build/server/chunks/{13-BQ9R_Ex-.js.map → 13-DPcsc1p-.js.map} +1 -1
- package/build/server/chunks/14-PJnTNd-L.js +9 -0
- package/build/server/chunks/14-PJnTNd-L.js.map +1 -0
- package/build/server/chunks/2-CGWn8izo.js +9 -0
- package/build/server/chunks/2-CGWn8izo.js.map +1 -0
- package/build/server/chunks/3-DSX59wuh.js +9 -0
- package/build/server/chunks/3-DSX59wuh.js.map +1 -0
- package/build/server/chunks/4-BML64sIA.js +9 -0
- package/build/server/chunks/{4-CSgrzh2F.js.map → 4-BML64sIA.js.map} +1 -1
- package/build/server/chunks/5-vxvPoTJ3.js +9 -0
- package/build/server/chunks/5-vxvPoTJ3.js.map +1 -0
- package/build/server/chunks/7-C3AnIPYT.js +9 -0
- package/build/server/chunks/{7-DewREBAN.js.map → 7-C3AnIPYT.js.map} +1 -1
- package/build/server/chunks/8-BJTCvcMs.js +9 -0
- package/build/server/chunks/{8-Dk3ms3jm.js.map → 8-BJTCvcMs.js.map} +1 -1
- package/build/server/chunks/{Button-Cd4Yzpdy.js → Button-DZYrr6c0.js} +3 -3
- package/build/server/chunks/Button-DZYrr6c0.js.map +1 -0
- package/build/server/chunks/{ChatStepTrace-cq26gF4B.js → ChatStepTrace-COI_fylM.js} +3 -137
- package/build/server/chunks/ChatStepTrace-COI_fylM.js.map +1 -0
- package/build/server/chunks/{ContextEditor-CfjBPLpI.js → ContextEditor-ByGoXY5_.js} +2 -9
- package/build/server/chunks/ContextEditor-ByGoXY5_.js.map +1 -0
- package/build/server/chunks/{Input-BJW36iKz.js → Input-DZT3Mm_-.js} +2 -1
- package/build/server/chunks/Input-DZT3Mm_-.js.map +1 -0
- package/build/server/chunks/{Tab-DheAG-QC.js → Tab-ClYAMM-e.js} +2 -2
- package/build/server/chunks/Tab-ClYAMM-e.js.map +1 -0
- package/build/server/chunks/{_layout.svelte-DHgaGTP_.js → _layout.svelte-BdnWuh8V.js} +17 -12
- package/build/server/chunks/_layout.svelte-BdnWuh8V.js.map +1 -0
- package/build/server/chunks/{_layout.svelte-BL8XnK1E.js → _layout.svelte-h89mGXIj.js} +8 -9
- package/build/server/chunks/_layout.svelte-h89mGXIj.js.map +1 -0
- package/build/server/chunks/{_page.svelte-DCP-PSh0.js → _page.svelte-B3PTKffw.js} +246 -97
- package/build/server/chunks/_page.svelte-B3PTKffw.js.map +1 -0
- package/build/server/chunks/{_page.svelte-BpnUXzfh.js → _page.svelte-B4py4PyV.js} +139 -6
- package/build/server/chunks/_page.svelte-B4py4PyV.js.map +1 -0
- package/build/server/chunks/_page.svelte-CC26hDwf.js +675 -0
- package/build/server/chunks/_page.svelte-CC26hDwf.js.map +1 -0
- package/build/server/chunks/{_page.svelte-CmsDxzfh.js → _page.svelte-CnjXZO9K.js} +3 -4
- package/build/server/chunks/_page.svelte-CnjXZO9K.js.map +1 -0
- package/build/server/index.js +1 -1
- package/build/server/index.js.map +1 -1
- package/build/server/manifest.js +11 -11
- package/build/server/manifest.js.map +1 -1
- package/package.json +1 -1
- package/build/client/_app/immutable/assets/0.XjKA4GPF.css +0 -1
- package/build/client/_app/immutable/assets/0.XjKA4GPF.css.br +0 -0
- package/build/client/_app/immutable/assets/0.XjKA4GPF.css.gz +0 -0
- package/build/client/_app/immutable/assets/2.DOE0DQ6H.css.br +0 -0
- package/build/client/_app/immutable/assets/2.DOE0DQ6H.css.gz +0 -0
- package/build/client/_app/immutable/assets/8.DoLA3Mkm.css +0 -1
- package/build/client/_app/immutable/assets/8.DoLA3Mkm.css.br +0 -0
- package/build/client/_app/immutable/assets/8.DoLA3Mkm.css.gz +0 -0
- package/build/client/_app/immutable/assets/AgentSidebar.QeNZJtLq.css.br +0 -0
- package/build/client/_app/immutable/assets/AgentSidebar.QeNZJtLq.css.gz +0 -0
- package/build/client/_app/immutable/assets/Tab.jOjMVh6j.css +0 -1
- package/build/client/_app/immutable/assets/Tab.jOjMVh6j.css.br +0 -0
- package/build/client/_app/immutable/assets/Tab.jOjMVh6j.css.gz +0 -0
- package/build/client/_app/immutable/chunks/7wcu2ga1.js +0 -1
- package/build/client/_app/immutable/chunks/7wcu2ga1.js.br +0 -0
- package/build/client/_app/immutable/chunks/7wcu2ga1.js.gz +0 -0
- package/build/client/_app/immutable/chunks/B3K88SyC.js.br +0 -0
- package/build/client/_app/immutable/chunks/B3K88SyC.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BGEE3mf3.js.br +0 -0
- package/build/client/_app/immutable/chunks/BGEE3mf3.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BH7VBnJ7.js.br +0 -0
- package/build/client/_app/immutable/chunks/BH7VBnJ7.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BHkx8tAH.js +0 -1
- package/build/client/_app/immutable/chunks/BHkx8tAH.js.br +0 -0
- package/build/client/_app/immutable/chunks/BHkx8tAH.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BMwJcaLS.js +0 -1
- package/build/client/_app/immutable/chunks/BMwJcaLS.js.br +0 -2
- package/build/client/_app/immutable/chunks/BMwJcaLS.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BOrnwyTp.js.br +0 -0
- package/build/client/_app/immutable/chunks/BOrnwyTp.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BbaH2eDw.js.br +0 -0
- package/build/client/_app/immutable/chunks/BbaH2eDw.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bub2VLj9.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bub2VLj9.js.gz +0 -0
- package/build/client/_app/immutable/chunks/ByppsbS-.js.br +0 -0
- package/build/client/_app/immutable/chunks/ByppsbS-.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C0mQlu7J.js.br +0 -1
- package/build/client/_app/immutable/chunks/C0mQlu7J.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C0pV4x1v.js +0 -1
- package/build/client/_app/immutable/chunks/C0pV4x1v.js.br +0 -2
- package/build/client/_app/immutable/chunks/C0pV4x1v.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C0sQKHpE.js.br +0 -0
- package/build/client/_app/immutable/chunks/C0sQKHpE.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CFcfsVkY.js.br +0 -0
- package/build/client/_app/immutable/chunks/CFcfsVkY.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CYkx2jgw.js.br +0 -0
- package/build/client/_app/immutable/chunks/CYkx2jgw.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CZ6iREyA.js.br +0 -0
- package/build/client/_app/immutable/chunks/CZ6iREyA.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CbCJfhin.js.br +0 -0
- package/build/client/_app/immutable/chunks/CbCJfhin.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CdTjAjKm.js.br +0 -0
- package/build/client/_app/immutable/chunks/CmPVG-ki.js.br +0 -0
- package/build/client/_app/immutable/chunks/CmPVG-ki.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Cnr0cZA4.js.br +0 -0
- package/build/client/_app/immutable/chunks/Cnr0cZA4.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CojkI8AD.js.br +0 -0
- package/build/client/_app/immutable/chunks/CojkI8AD.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Cp_hX0eh.js.br +0 -0
- package/build/client/_app/immutable/chunks/Cv6CwVfk.js.br +0 -0
- package/build/client/_app/immutable/chunks/Cv6CwVfk.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D8qEOlWC.js.br +0 -0
- package/build/client/_app/immutable/chunks/D8qEOlWC.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DOMF1VtZ.js +0 -8
- package/build/client/_app/immutable/chunks/DOMF1VtZ.js.br +0 -0
- package/build/client/_app/immutable/chunks/DOMF1VtZ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DRaGXt8e.js +0 -1
- package/build/client/_app/immutable/chunks/DRaGXt8e.js.br +0 -0
- package/build/client/_app/immutable/chunks/DRaGXt8e.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DU-D8S0B.js.br +0 -0
- package/build/client/_app/immutable/chunks/DU-D8S0B.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DadWvtYR.js.br +0 -0
- package/build/client/_app/immutable/chunks/DadWvtYR.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DbYdNz4J.js.br +0 -0
- package/build/client/_app/immutable/chunks/DbYdNz4J.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DiFAgw_s.js.br +0 -0
- package/build/client/_app/immutable/chunks/DiFAgw_s.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DrMdBz9b.js.br +0 -0
- package/build/client/_app/immutable/chunks/DrMdBz9b.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DsvX5v5e.js.br +0 -0
- package/build/client/_app/immutable/chunks/DsvX5v5e.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Y0ymTIHd.js.br +0 -0
- package/build/client/_app/immutable/chunks/Y0ymTIHd.js.gz +0 -0
- package/build/client/_app/immutable/chunks/_HWrJCgx.js.br +0 -0
- package/build/client/_app/immutable/chunks/_HWrJCgx.js.gz +0 -0
- package/build/client/_app/immutable/chunks/qPgPowuc.js.br +0 -0
- package/build/client/_app/immutable/chunks/qPgPowuc.js.gz +0 -0
- package/build/client/_app/immutable/chunks/ri5tqg4N.js.br +0 -0
- package/build/client/_app/immutable/chunks/ri5tqg4N.js.gz +0 -0
- package/build/client/_app/immutable/chunks/sdLD1XcR.js.br +0 -0
- package/build/client/_app/immutable/chunks/sdLD1XcR.js.gz +0 -0
- package/build/client/_app/immutable/chunks/t1v2-usS.js +0 -4
- package/build/client/_app/immutable/chunks/t1v2-usS.js.br +0 -0
- package/build/client/_app/immutable/chunks/t1v2-usS.js.gz +0 -0
- package/build/client/_app/immutable/chunks/tLFXBP7P.js.br +0 -0
- package/build/client/_app/immutable/entry/app.jP0Pyfdy.js.br +0 -0
- package/build/client/_app/immutable/entry/app.jP0Pyfdy.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.KD1JZMOT.js +0 -1
- package/build/client/_app/immutable/entry/start.KD1JZMOT.js.br +0 -2
- package/build/client/_app/immutable/entry/start.KD1JZMOT.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.ByrdmeSo.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.ByrdmeSo.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.VLeq38lN.js +0 -1
- package/build/client/_app/immutable/nodes/1.VLeq38lN.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.VLeq38lN.js.gz +0 -0
- package/build/client/_app/immutable/nodes/13.DetV1tDO.js.br +0 -0
- package/build/client/_app/immutable/nodes/13.DetV1tDO.js.gz +0 -0
- package/build/client/_app/immutable/nodes/14.I-eiMWQu.js +0 -11
- package/build/client/_app/immutable/nodes/14.I-eiMWQu.js.br +0 -0
- package/build/client/_app/immutable/nodes/14.I-eiMWQu.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.DX9U9zLg.js +0 -35
- package/build/client/_app/immutable/nodes/2.DX9U9zLg.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.DX9U9zLg.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.Bh8il5iy.js +0 -1
- package/build/client/_app/immutable/nodes/3.Bh8il5iy.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.Bh8il5iy.js.gz +0 -0
- package/build/client/_app/immutable/nodes/4.CtzHYc6x.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.CtzHYc6x.js.gz +0 -0
- package/build/client/_app/immutable/nodes/5.B4dlomkV.js +0 -1
- package/build/client/_app/immutable/nodes/5.B4dlomkV.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.B4dlomkV.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.CBPrYfFp.js +0 -2
- package/build/client/_app/immutable/nodes/7.CBPrYfFp.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.CBPrYfFp.js.gz +0 -0
- package/build/client/_app/immutable/nodes/8.4NTWYv4c.js +0 -6
- package/build/client/_app/immutable/nodes/8.4NTWYv4c.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.4NTWYv4c.js.gz +0 -0
- package/build/server/chunks/0-CjpeDbMt.js +0 -9
- package/build/server/chunks/1-M0YzuUQM.js +0 -9
- package/build/server/chunks/14-BFsI6u_W.js +0 -9
- package/build/server/chunks/14-BFsI6u_W.js.map +0 -1
- package/build/server/chunks/2-Cjh0UTU6.js +0 -9
- package/build/server/chunks/2-Cjh0UTU6.js.map +0 -1
- package/build/server/chunks/3-VrGFs76T.js +0 -9
- package/build/server/chunks/3-VrGFs76T.js.map +0 -1
- package/build/server/chunks/4-CSgrzh2F.js +0 -9
- package/build/server/chunks/5-zKehYil3.js +0 -9
- package/build/server/chunks/5-zKehYil3.js.map +0 -1
- package/build/server/chunks/7-DewREBAN.js +0 -9
- package/build/server/chunks/8-Dk3ms3jm.js +0 -9
- package/build/server/chunks/Button-Cd4Yzpdy.js.map +0 -1
- package/build/server/chunks/ChatStepTrace-cq26gF4B.js.map +0 -1
- package/build/server/chunks/ContextEditor-CfjBPLpI.js.map +0 -1
- package/build/server/chunks/Input-BJW36iKz.js.map +0 -1
- package/build/server/chunks/Tab-DheAG-QC.js.map +0 -1
- package/build/server/chunks/_layout.svelte-BL8XnK1E.js.map +0 -1
- package/build/server/chunks/_layout.svelte-DHgaGTP_.js.map +0 -1
- package/build/server/chunks/_page.svelte-BpnUXzfh.js.map +0 -1
- package/build/server/chunks/_page.svelte-C1YaC_Qg.js +0 -2309
- package/build/server/chunks/_page.svelte-C1YaC_Qg.js.map +0 -1
- package/build/server/chunks/_page.svelte-CmsDxzfh.js.map +0 -1
- package/build/server/chunks/_page.svelte-DCP-PSh0.js.map +0 -1
|
@@ -1,2309 +0,0 @@
|
|
|
1
|
-
import { h as head, b as attr_class, a as attr, s as stringify, e as ensure_array_like, c as attr_style, j as attributes } from './index2-BuOY2QE4.js';
|
|
2
|
-
import { g as getEditWorkspaceContext, P as Panel } from './edit-workspace-context-OTOIRCI0.js';
|
|
3
|
-
import { B as Button } from './Button-Cd4Yzpdy.js';
|
|
4
|
-
import { M as Modal } from './Modal-D4tx0Bdo.js';
|
|
5
|
-
import { C as ContextEditor, P as PopoverModal } from './ContextEditor-CfjBPLpI.js';
|
|
6
|
-
import { I as Input } from './Input-BJW36iKz.js';
|
|
7
|
-
import { o as onDestroy } from './index-server-CefdgakO.js';
|
|
8
|
-
import { I as Icon$1, h as html } from './Icon-BgknHaZs.js';
|
|
9
|
-
import { t as trpc } from './trpc-client-Bucti7HD.js';
|
|
10
|
-
import { X as escape_html } from './context-zH5kvtGY.js';
|
|
11
|
-
import './events-M0vvlm3M.js';
|
|
12
|
-
import 'js-yaml';
|
|
13
|
-
import '@trpc/client';
|
|
14
|
-
|
|
15
|
-
const matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
|
|
16
|
-
const stringToIcon = (value, validate, allowSimpleName, provider = "") => {
|
|
17
|
-
const colonSeparated = value.split(":");
|
|
18
|
-
if (value.slice(0, 1) === "@") {
|
|
19
|
-
if (colonSeparated.length < 2 || colonSeparated.length > 3) return null;
|
|
20
|
-
provider = colonSeparated.shift().slice(1);
|
|
21
|
-
}
|
|
22
|
-
if (colonSeparated.length > 3 || !colonSeparated.length) return null;
|
|
23
|
-
if (colonSeparated.length > 1) {
|
|
24
|
-
const name$1 = colonSeparated.pop();
|
|
25
|
-
const prefix = colonSeparated.pop();
|
|
26
|
-
const result = {
|
|
27
|
-
provider: colonSeparated.length > 0 ? colonSeparated[0] : provider,
|
|
28
|
-
prefix,
|
|
29
|
-
name: name$1
|
|
30
|
-
};
|
|
31
|
-
return validate && !validateIconName(result) ? null : result;
|
|
32
|
-
}
|
|
33
|
-
const name = colonSeparated[0];
|
|
34
|
-
const dashSeparated = name.split("-");
|
|
35
|
-
if (dashSeparated.length > 1) {
|
|
36
|
-
const result = {
|
|
37
|
-
provider,
|
|
38
|
-
prefix: dashSeparated.shift(),
|
|
39
|
-
name: dashSeparated.join("-")
|
|
40
|
-
};
|
|
41
|
-
return validate && !validateIconName(result) ? null : result;
|
|
42
|
-
}
|
|
43
|
-
if (allowSimpleName && provider === "") {
|
|
44
|
-
const result = {
|
|
45
|
-
provider,
|
|
46
|
-
prefix: "",
|
|
47
|
-
name
|
|
48
|
-
};
|
|
49
|
-
return validate && !validateIconName(result, allowSimpleName) ? null : result;
|
|
50
|
-
}
|
|
51
|
-
return null;
|
|
52
|
-
};
|
|
53
|
-
const validateIconName = (icon, allowSimpleName) => {
|
|
54
|
-
if (!icon) return false;
|
|
55
|
-
return !!((allowSimpleName && icon.prefix === "" || !!icon.prefix) && !!icon.name);
|
|
56
|
-
};
|
|
57
|
-
function getIconsTree(data, names) {
|
|
58
|
-
const icons = data.icons;
|
|
59
|
-
const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
|
|
60
|
-
const resolved = /* @__PURE__ */ Object.create(null);
|
|
61
|
-
function resolve(name) {
|
|
62
|
-
if (icons[name]) return resolved[name] = [];
|
|
63
|
-
if (!(name in resolved)) {
|
|
64
|
-
resolved[name] = null;
|
|
65
|
-
const parent = aliases[name] && aliases[name].parent;
|
|
66
|
-
const value = parent && resolve(parent);
|
|
67
|
-
if (value) resolved[name] = [parent].concat(value);
|
|
68
|
-
}
|
|
69
|
-
return resolved[name];
|
|
70
|
-
}
|
|
71
|
-
Object.keys(icons).concat(Object.keys(aliases)).forEach(resolve);
|
|
72
|
-
return resolved;
|
|
73
|
-
}
|
|
74
|
-
const defaultIconDimensions = Object.freeze({
|
|
75
|
-
left: 0,
|
|
76
|
-
top: 0,
|
|
77
|
-
width: 16,
|
|
78
|
-
height: 16
|
|
79
|
-
});
|
|
80
|
-
const defaultIconTransformations = Object.freeze({
|
|
81
|
-
rotate: 0,
|
|
82
|
-
vFlip: false,
|
|
83
|
-
hFlip: false
|
|
84
|
-
});
|
|
85
|
-
const defaultIconProps = Object.freeze({
|
|
86
|
-
...defaultIconDimensions,
|
|
87
|
-
...defaultIconTransformations
|
|
88
|
-
});
|
|
89
|
-
const defaultExtendedIconProps = Object.freeze({
|
|
90
|
-
...defaultIconProps,
|
|
91
|
-
body: "",
|
|
92
|
-
hidden: false
|
|
93
|
-
});
|
|
94
|
-
function mergeIconTransformations(obj1, obj2) {
|
|
95
|
-
const result = {};
|
|
96
|
-
if (!obj1.hFlip !== !obj2.hFlip) result.hFlip = true;
|
|
97
|
-
if (!obj1.vFlip !== !obj2.vFlip) result.vFlip = true;
|
|
98
|
-
const rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;
|
|
99
|
-
if (rotate) result.rotate = rotate;
|
|
100
|
-
return result;
|
|
101
|
-
}
|
|
102
|
-
function mergeIconData(parent, child) {
|
|
103
|
-
const result = mergeIconTransformations(parent, child);
|
|
104
|
-
for (const key in defaultExtendedIconProps) if (key in defaultIconTransformations) {
|
|
105
|
-
if (key in parent && !(key in result)) result[key] = defaultIconTransformations[key];
|
|
106
|
-
} else if (key in child) result[key] = child[key];
|
|
107
|
-
else if (key in parent) result[key] = parent[key];
|
|
108
|
-
return result;
|
|
109
|
-
}
|
|
110
|
-
function internalGetIconData(data, name, tree) {
|
|
111
|
-
const icons = data.icons;
|
|
112
|
-
const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
|
|
113
|
-
let currentProps = {};
|
|
114
|
-
function parse(name$1) {
|
|
115
|
-
currentProps = mergeIconData(icons[name$1] || aliases[name$1], currentProps);
|
|
116
|
-
}
|
|
117
|
-
parse(name);
|
|
118
|
-
tree.forEach(parse);
|
|
119
|
-
return mergeIconData(data, currentProps);
|
|
120
|
-
}
|
|
121
|
-
function parseIconSet(data, callback) {
|
|
122
|
-
const names = [];
|
|
123
|
-
if (typeof data !== "object" || typeof data.icons !== "object") return names;
|
|
124
|
-
if (data.not_found instanceof Array) data.not_found.forEach((name) => {
|
|
125
|
-
callback(name, null);
|
|
126
|
-
names.push(name);
|
|
127
|
-
});
|
|
128
|
-
const tree = getIconsTree(data);
|
|
129
|
-
for (const name in tree) {
|
|
130
|
-
const item = tree[name];
|
|
131
|
-
if (item) {
|
|
132
|
-
callback(name, internalGetIconData(data, name, item));
|
|
133
|
-
names.push(name);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
return names;
|
|
137
|
-
}
|
|
138
|
-
const optionalPropertyDefaults = {
|
|
139
|
-
provider: "",
|
|
140
|
-
aliases: {},
|
|
141
|
-
not_found: {},
|
|
142
|
-
...defaultIconDimensions
|
|
143
|
-
};
|
|
144
|
-
function checkOptionalProps(item, defaults) {
|
|
145
|
-
for (const prop in defaults) if (prop in item && typeof item[prop] !== typeof defaults[prop]) return false;
|
|
146
|
-
return true;
|
|
147
|
-
}
|
|
148
|
-
function quicklyValidateIconSet(obj) {
|
|
149
|
-
if (typeof obj !== "object" || obj === null) return null;
|
|
150
|
-
const data = obj;
|
|
151
|
-
if (typeof data.prefix !== "string" || !obj.icons || typeof obj.icons !== "object") return null;
|
|
152
|
-
if (!checkOptionalProps(obj, optionalPropertyDefaults)) return null;
|
|
153
|
-
const icons = data.icons;
|
|
154
|
-
for (const name in icons) {
|
|
155
|
-
const icon = icons[name];
|
|
156
|
-
if (!name || typeof icon.body !== "string" || !checkOptionalProps(icon, defaultExtendedIconProps)) return null;
|
|
157
|
-
}
|
|
158
|
-
const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
|
|
159
|
-
for (const name in aliases) {
|
|
160
|
-
const icon = aliases[name];
|
|
161
|
-
const parent = icon.parent;
|
|
162
|
-
if (!name || typeof parent !== "string" || !icons[parent] && !aliases[parent] || !checkOptionalProps(icon, defaultExtendedIconProps)) return null;
|
|
163
|
-
}
|
|
164
|
-
return data;
|
|
165
|
-
}
|
|
166
|
-
const dataStorage = /* @__PURE__ */ Object.create(null);
|
|
167
|
-
function newStorage(provider, prefix) {
|
|
168
|
-
return {
|
|
169
|
-
provider,
|
|
170
|
-
prefix,
|
|
171
|
-
icons: /* @__PURE__ */ Object.create(null),
|
|
172
|
-
missing: /* @__PURE__ */ new Set()
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
function getStorage(provider, prefix) {
|
|
176
|
-
const providerStorage = dataStorage[provider] || (dataStorage[provider] = /* @__PURE__ */ Object.create(null));
|
|
177
|
-
return providerStorage[prefix] || (providerStorage[prefix] = newStorage(provider, prefix));
|
|
178
|
-
}
|
|
179
|
-
function addIconSet(storage2, data) {
|
|
180
|
-
if (!quicklyValidateIconSet(data)) return [];
|
|
181
|
-
return parseIconSet(data, (name, icon) => {
|
|
182
|
-
if (icon) storage2.icons[name] = icon;
|
|
183
|
-
else storage2.missing.add(name);
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
function addIconToStorage(storage2, name, icon) {
|
|
187
|
-
try {
|
|
188
|
-
if (typeof icon.body === "string") {
|
|
189
|
-
storage2.icons[name] = { ...icon };
|
|
190
|
-
return true;
|
|
191
|
-
}
|
|
192
|
-
} catch (err) {
|
|
193
|
-
}
|
|
194
|
-
return false;
|
|
195
|
-
}
|
|
196
|
-
let simpleNames = false;
|
|
197
|
-
function allowSimpleNames(allow) {
|
|
198
|
-
if (typeof allow === "boolean") simpleNames = allow;
|
|
199
|
-
return simpleNames;
|
|
200
|
-
}
|
|
201
|
-
function getIconData(name) {
|
|
202
|
-
const icon = typeof name === "string" ? stringToIcon(name, true, simpleNames) : name;
|
|
203
|
-
if (icon) {
|
|
204
|
-
const storage2 = getStorage(icon.provider, icon.prefix);
|
|
205
|
-
const iconName = icon.name;
|
|
206
|
-
return storage2.icons[iconName] || (storage2.missing.has(iconName) ? null : void 0);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
function addIcon(name, data) {
|
|
210
|
-
const icon = stringToIcon(name, true, simpleNames);
|
|
211
|
-
if (!icon) return false;
|
|
212
|
-
const storage2 = getStorage(icon.provider, icon.prefix);
|
|
213
|
-
if (data) return addIconToStorage(storage2, icon.name, data);
|
|
214
|
-
else {
|
|
215
|
-
storage2.missing.add(icon.name);
|
|
216
|
-
return true;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
function addCollection(data, provider) {
|
|
220
|
-
if (typeof data !== "object") return false;
|
|
221
|
-
if (typeof provider !== "string") provider = data.provider || "";
|
|
222
|
-
if (simpleNames && !provider && !data.prefix) {
|
|
223
|
-
let added = false;
|
|
224
|
-
if (quicklyValidateIconSet(data)) {
|
|
225
|
-
data.prefix = "";
|
|
226
|
-
parseIconSet(data, (name, icon) => {
|
|
227
|
-
if (addIcon(name, icon)) added = true;
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
return added;
|
|
231
|
-
}
|
|
232
|
-
const prefix = data.prefix;
|
|
233
|
-
if (!validateIconName({
|
|
234
|
-
prefix,
|
|
235
|
-
name: "a"
|
|
236
|
-
})) return false;
|
|
237
|
-
const storage2 = getStorage(provider, prefix);
|
|
238
|
-
return !!addIconSet(storage2, data);
|
|
239
|
-
}
|
|
240
|
-
const defaultIconSizeCustomisations = Object.freeze({
|
|
241
|
-
width: null,
|
|
242
|
-
height: null
|
|
243
|
-
});
|
|
244
|
-
const defaultIconCustomisations = Object.freeze({
|
|
245
|
-
...defaultIconSizeCustomisations,
|
|
246
|
-
...defaultIconTransformations
|
|
247
|
-
});
|
|
248
|
-
const unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
|
|
249
|
-
const unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
|
250
|
-
function calculateSize(size, ratio, precision) {
|
|
251
|
-
if (ratio === 1) return size;
|
|
252
|
-
precision = precision || 100;
|
|
253
|
-
if (typeof size === "number") return Math.ceil(size * ratio * precision) / precision;
|
|
254
|
-
if (typeof size !== "string") return size;
|
|
255
|
-
const oldParts = size.split(unitsSplit);
|
|
256
|
-
if (oldParts === null || !oldParts.length) return size;
|
|
257
|
-
const newParts = [];
|
|
258
|
-
let code = oldParts.shift();
|
|
259
|
-
let isNumber = unitsTest.test(code);
|
|
260
|
-
while (true) {
|
|
261
|
-
if (isNumber) {
|
|
262
|
-
const num = parseFloat(code);
|
|
263
|
-
if (isNaN(num)) newParts.push(code);
|
|
264
|
-
else newParts.push(Math.ceil(num * ratio * precision) / precision);
|
|
265
|
-
} else newParts.push(code);
|
|
266
|
-
code = oldParts.shift();
|
|
267
|
-
if (code === void 0) return newParts.join("");
|
|
268
|
-
isNumber = !isNumber;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
function splitSVGDefs(content, tag = "defs") {
|
|
272
|
-
let defs = "";
|
|
273
|
-
const index = content.indexOf("<" + tag);
|
|
274
|
-
while (index >= 0) {
|
|
275
|
-
const start = content.indexOf(">", index);
|
|
276
|
-
const end = content.indexOf("</" + tag);
|
|
277
|
-
if (start === -1 || end === -1) break;
|
|
278
|
-
const endEnd = content.indexOf(">", end);
|
|
279
|
-
if (endEnd === -1) break;
|
|
280
|
-
defs += content.slice(start + 1, end).trim();
|
|
281
|
-
content = content.slice(0, index).trim() + content.slice(endEnd + 1);
|
|
282
|
-
}
|
|
283
|
-
return {
|
|
284
|
-
defs,
|
|
285
|
-
content
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
function mergeDefsAndContent(defs, content) {
|
|
289
|
-
return defs ? "<defs>" + defs + "</defs>" + content : content;
|
|
290
|
-
}
|
|
291
|
-
function wrapSVGContent(body, start, end) {
|
|
292
|
-
const split = splitSVGDefs(body);
|
|
293
|
-
return mergeDefsAndContent(split.defs, start + split.content + end);
|
|
294
|
-
}
|
|
295
|
-
const isUnsetKeyword = (value) => value === "unset" || value === "undefined" || value === "none";
|
|
296
|
-
function iconToSVG(icon, customisations) {
|
|
297
|
-
const fullIcon = {
|
|
298
|
-
...defaultIconProps,
|
|
299
|
-
...icon
|
|
300
|
-
};
|
|
301
|
-
const fullCustomisations = {
|
|
302
|
-
...defaultIconCustomisations,
|
|
303
|
-
...customisations
|
|
304
|
-
};
|
|
305
|
-
const box = {
|
|
306
|
-
left: fullIcon.left,
|
|
307
|
-
top: fullIcon.top,
|
|
308
|
-
width: fullIcon.width,
|
|
309
|
-
height: fullIcon.height
|
|
310
|
-
};
|
|
311
|
-
let body = fullIcon.body;
|
|
312
|
-
[fullIcon, fullCustomisations].forEach((props) => {
|
|
313
|
-
const transformations = [];
|
|
314
|
-
const hFlip = props.hFlip;
|
|
315
|
-
const vFlip = props.vFlip;
|
|
316
|
-
let rotation = props.rotate;
|
|
317
|
-
if (hFlip) if (vFlip) rotation += 2;
|
|
318
|
-
else {
|
|
319
|
-
transformations.push("translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")");
|
|
320
|
-
transformations.push("scale(-1 1)");
|
|
321
|
-
box.top = box.left = 0;
|
|
322
|
-
}
|
|
323
|
-
else if (vFlip) {
|
|
324
|
-
transformations.push("translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")");
|
|
325
|
-
transformations.push("scale(1 -1)");
|
|
326
|
-
box.top = box.left = 0;
|
|
327
|
-
}
|
|
328
|
-
let tempValue;
|
|
329
|
-
if (rotation < 0) rotation -= Math.floor(rotation / 4) * 4;
|
|
330
|
-
rotation = rotation % 4;
|
|
331
|
-
switch (rotation) {
|
|
332
|
-
case 1:
|
|
333
|
-
tempValue = box.height / 2 + box.top;
|
|
334
|
-
transformations.unshift("rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")");
|
|
335
|
-
break;
|
|
336
|
-
case 2:
|
|
337
|
-
transformations.unshift("rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")");
|
|
338
|
-
break;
|
|
339
|
-
case 3:
|
|
340
|
-
tempValue = box.width / 2 + box.left;
|
|
341
|
-
transformations.unshift("rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")");
|
|
342
|
-
break;
|
|
343
|
-
}
|
|
344
|
-
if (rotation % 2 === 1) {
|
|
345
|
-
if (box.left !== box.top) {
|
|
346
|
-
tempValue = box.left;
|
|
347
|
-
box.left = box.top;
|
|
348
|
-
box.top = tempValue;
|
|
349
|
-
}
|
|
350
|
-
if (box.width !== box.height) {
|
|
351
|
-
tempValue = box.width;
|
|
352
|
-
box.width = box.height;
|
|
353
|
-
box.height = tempValue;
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
if (transformations.length) body = wrapSVGContent(body, '<g transform="' + transformations.join(" ") + '">', "</g>");
|
|
357
|
-
});
|
|
358
|
-
const customisationsWidth = fullCustomisations.width;
|
|
359
|
-
const customisationsHeight = fullCustomisations.height;
|
|
360
|
-
const boxWidth = box.width;
|
|
361
|
-
const boxHeight = box.height;
|
|
362
|
-
let width;
|
|
363
|
-
let height;
|
|
364
|
-
if (customisationsWidth === null) {
|
|
365
|
-
height = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
|
|
366
|
-
width = calculateSize(height, boxWidth / boxHeight);
|
|
367
|
-
} else {
|
|
368
|
-
width = customisationsWidth === "auto" ? boxWidth : customisationsWidth;
|
|
369
|
-
height = customisationsHeight === null ? calculateSize(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
|
|
370
|
-
}
|
|
371
|
-
const attributes2 = {};
|
|
372
|
-
const setAttr = (prop, value) => {
|
|
373
|
-
if (!isUnsetKeyword(value)) attributes2[prop] = value.toString();
|
|
374
|
-
};
|
|
375
|
-
setAttr("width", width);
|
|
376
|
-
setAttr("height", height);
|
|
377
|
-
const viewBox = [
|
|
378
|
-
box.left,
|
|
379
|
-
box.top,
|
|
380
|
-
boxWidth,
|
|
381
|
-
boxHeight
|
|
382
|
-
];
|
|
383
|
-
attributes2.viewBox = viewBox.join(" ");
|
|
384
|
-
return {
|
|
385
|
-
attributes: attributes2,
|
|
386
|
-
viewBox,
|
|
387
|
-
body
|
|
388
|
-
};
|
|
389
|
-
}
|
|
390
|
-
const regex = /\sid="(\S+)"/g;
|
|
391
|
-
const randomPrefix = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
|
|
392
|
-
let counter = 0;
|
|
393
|
-
function replaceIDs(body, prefix = randomPrefix) {
|
|
394
|
-
const ids = [];
|
|
395
|
-
let match;
|
|
396
|
-
while (match = regex.exec(body)) ids.push(match[1]);
|
|
397
|
-
if (!ids.length) return body;
|
|
398
|
-
const suffix = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
|
|
399
|
-
ids.forEach((id) => {
|
|
400
|
-
const newID = typeof prefix === "function" ? prefix(id) : prefix + (counter++).toString();
|
|
401
|
-
const escapedID = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
402
|
-
body = body.replace(new RegExp('([#;"])(' + escapedID + ')([")]|\\.[a-z])', "g"), "$1" + newID + suffix + "$3");
|
|
403
|
-
});
|
|
404
|
-
body = body.replace(new RegExp(suffix, "g"), "");
|
|
405
|
-
return body;
|
|
406
|
-
}
|
|
407
|
-
const storage = /* @__PURE__ */ Object.create(null);
|
|
408
|
-
function setAPIModule(provider, item) {
|
|
409
|
-
storage[provider] = item;
|
|
410
|
-
}
|
|
411
|
-
function getAPIModule(provider) {
|
|
412
|
-
return storage[provider] || storage[""];
|
|
413
|
-
}
|
|
414
|
-
function createAPIConfig(source) {
|
|
415
|
-
let resources;
|
|
416
|
-
if (typeof source.resources === "string") resources = [source.resources];
|
|
417
|
-
else {
|
|
418
|
-
resources = source.resources;
|
|
419
|
-
if (!(resources instanceof Array) || !resources.length) return null;
|
|
420
|
-
}
|
|
421
|
-
const result = {
|
|
422
|
-
resources,
|
|
423
|
-
path: source.path || "/",
|
|
424
|
-
maxURL: source.maxURL || 500,
|
|
425
|
-
rotate: source.rotate || 750,
|
|
426
|
-
timeout: source.timeout || 5e3,
|
|
427
|
-
random: source.random === true,
|
|
428
|
-
index: source.index || 0,
|
|
429
|
-
dataAfterTimeout: source.dataAfterTimeout !== false
|
|
430
|
-
};
|
|
431
|
-
return result;
|
|
432
|
-
}
|
|
433
|
-
const configStorage = /* @__PURE__ */ Object.create(null);
|
|
434
|
-
const fallBackAPISources = ["https://api.simplesvg.com", "https://api.unisvg.com"];
|
|
435
|
-
const fallBackAPI = [];
|
|
436
|
-
while (fallBackAPISources.length > 0) if (fallBackAPISources.length === 1) fallBackAPI.push(fallBackAPISources.shift());
|
|
437
|
-
else if (Math.random() > 0.5) fallBackAPI.push(fallBackAPISources.shift());
|
|
438
|
-
else fallBackAPI.push(fallBackAPISources.pop());
|
|
439
|
-
configStorage[""] = createAPIConfig({ resources: ["https://api.iconify.design"].concat(fallBackAPI) });
|
|
440
|
-
function addAPIProvider(provider, customConfig) {
|
|
441
|
-
const config = createAPIConfig(customConfig);
|
|
442
|
-
if (config === null) return false;
|
|
443
|
-
configStorage[provider] = config;
|
|
444
|
-
return true;
|
|
445
|
-
}
|
|
446
|
-
function getAPIConfig(provider) {
|
|
447
|
-
return configStorage[provider];
|
|
448
|
-
}
|
|
449
|
-
const detectFetch = () => {
|
|
450
|
-
let callback;
|
|
451
|
-
try {
|
|
452
|
-
callback = fetch;
|
|
453
|
-
if (typeof callback === "function") return callback;
|
|
454
|
-
} catch (err) {
|
|
455
|
-
}
|
|
456
|
-
};
|
|
457
|
-
let fetchModule = detectFetch();
|
|
458
|
-
function calculateMaxLength(provider, prefix) {
|
|
459
|
-
const config = getAPIConfig(provider);
|
|
460
|
-
if (!config) return 0;
|
|
461
|
-
let result;
|
|
462
|
-
if (!config.maxURL) result = 0;
|
|
463
|
-
else {
|
|
464
|
-
let maxHostLength = 0;
|
|
465
|
-
config.resources.forEach((item) => {
|
|
466
|
-
const host = item;
|
|
467
|
-
maxHostLength = Math.max(maxHostLength, host.length);
|
|
468
|
-
});
|
|
469
|
-
const url = prefix + ".json?icons=";
|
|
470
|
-
result = config.maxURL - maxHostLength - config.path.length - url.length;
|
|
471
|
-
}
|
|
472
|
-
return result;
|
|
473
|
-
}
|
|
474
|
-
function shouldAbort(status) {
|
|
475
|
-
return status === 404;
|
|
476
|
-
}
|
|
477
|
-
const prepare = (provider, prefix, icons) => {
|
|
478
|
-
const results = [];
|
|
479
|
-
const maxLength = calculateMaxLength(provider, prefix);
|
|
480
|
-
const type = "icons";
|
|
481
|
-
let item = {
|
|
482
|
-
type,
|
|
483
|
-
provider,
|
|
484
|
-
prefix,
|
|
485
|
-
icons: []
|
|
486
|
-
};
|
|
487
|
-
let length = 0;
|
|
488
|
-
icons.forEach((name, index) => {
|
|
489
|
-
length += name.length + 1;
|
|
490
|
-
if (length >= maxLength && index > 0) {
|
|
491
|
-
results.push(item);
|
|
492
|
-
item = {
|
|
493
|
-
type,
|
|
494
|
-
provider,
|
|
495
|
-
prefix,
|
|
496
|
-
icons: []
|
|
497
|
-
};
|
|
498
|
-
length = name.length;
|
|
499
|
-
}
|
|
500
|
-
item.icons.push(name);
|
|
501
|
-
});
|
|
502
|
-
results.push(item);
|
|
503
|
-
return results;
|
|
504
|
-
};
|
|
505
|
-
function getPath(provider) {
|
|
506
|
-
if (typeof provider === "string") {
|
|
507
|
-
const config = getAPIConfig(provider);
|
|
508
|
-
if (config) return config.path;
|
|
509
|
-
}
|
|
510
|
-
return "/";
|
|
511
|
-
}
|
|
512
|
-
const send = (host, params, callback) => {
|
|
513
|
-
if (!fetchModule) {
|
|
514
|
-
callback("abort", 424);
|
|
515
|
-
return;
|
|
516
|
-
}
|
|
517
|
-
let path = getPath(params.provider);
|
|
518
|
-
switch (params.type) {
|
|
519
|
-
case "icons": {
|
|
520
|
-
const prefix = params.prefix;
|
|
521
|
-
const icons = params.icons;
|
|
522
|
-
const iconsList = icons.join(",");
|
|
523
|
-
const urlParams = new URLSearchParams({ icons: iconsList });
|
|
524
|
-
path += prefix + ".json?" + urlParams.toString();
|
|
525
|
-
break;
|
|
526
|
-
}
|
|
527
|
-
case "custom": {
|
|
528
|
-
const uri = params.uri;
|
|
529
|
-
path += uri.slice(0, 1) === "/" ? uri.slice(1) : uri;
|
|
530
|
-
break;
|
|
531
|
-
}
|
|
532
|
-
default:
|
|
533
|
-
callback("abort", 400);
|
|
534
|
-
return;
|
|
535
|
-
}
|
|
536
|
-
let defaultError = 503;
|
|
537
|
-
fetchModule(host + path).then((response) => {
|
|
538
|
-
const status = response.status;
|
|
539
|
-
if (status !== 200) {
|
|
540
|
-
setTimeout(() => {
|
|
541
|
-
callback(shouldAbort(status) ? "abort" : "next", status);
|
|
542
|
-
});
|
|
543
|
-
return;
|
|
544
|
-
}
|
|
545
|
-
defaultError = 501;
|
|
546
|
-
return response.json();
|
|
547
|
-
}).then((data) => {
|
|
548
|
-
if (typeof data !== "object" || data === null) {
|
|
549
|
-
setTimeout(() => {
|
|
550
|
-
if (data === 404) callback("abort", data);
|
|
551
|
-
else callback("next", defaultError);
|
|
552
|
-
});
|
|
553
|
-
return;
|
|
554
|
-
}
|
|
555
|
-
setTimeout(() => {
|
|
556
|
-
callback("success", data);
|
|
557
|
-
});
|
|
558
|
-
}).catch(() => {
|
|
559
|
-
callback("next", defaultError);
|
|
560
|
-
});
|
|
561
|
-
};
|
|
562
|
-
const fetchAPIModule = {
|
|
563
|
-
prepare,
|
|
564
|
-
send
|
|
565
|
-
};
|
|
566
|
-
function removeCallback(storages, id) {
|
|
567
|
-
storages.forEach((storage2) => {
|
|
568
|
-
const items = storage2.loaderCallbacks;
|
|
569
|
-
if (items) storage2.loaderCallbacks = items.filter((row) => row.id !== id);
|
|
570
|
-
});
|
|
571
|
-
}
|
|
572
|
-
function updateCallbacks(storage2) {
|
|
573
|
-
if (!storage2.pendingCallbacksFlag) {
|
|
574
|
-
storage2.pendingCallbacksFlag = true;
|
|
575
|
-
setTimeout(() => {
|
|
576
|
-
storage2.pendingCallbacksFlag = false;
|
|
577
|
-
const items = storage2.loaderCallbacks ? storage2.loaderCallbacks.slice(0) : [];
|
|
578
|
-
if (!items.length) return;
|
|
579
|
-
let hasPending = false;
|
|
580
|
-
const provider = storage2.provider;
|
|
581
|
-
const prefix = storage2.prefix;
|
|
582
|
-
items.forEach((item) => {
|
|
583
|
-
const icons = item.icons;
|
|
584
|
-
const oldLength = icons.pending.length;
|
|
585
|
-
icons.pending = icons.pending.filter((icon) => {
|
|
586
|
-
if (icon.prefix !== prefix) return true;
|
|
587
|
-
const name = icon.name;
|
|
588
|
-
if (storage2.icons[name]) icons.loaded.push({
|
|
589
|
-
provider,
|
|
590
|
-
prefix,
|
|
591
|
-
name
|
|
592
|
-
});
|
|
593
|
-
else if (storage2.missing.has(name)) icons.missing.push({
|
|
594
|
-
provider,
|
|
595
|
-
prefix,
|
|
596
|
-
name
|
|
597
|
-
});
|
|
598
|
-
else {
|
|
599
|
-
hasPending = true;
|
|
600
|
-
return true;
|
|
601
|
-
}
|
|
602
|
-
return false;
|
|
603
|
-
});
|
|
604
|
-
if (icons.pending.length !== oldLength) {
|
|
605
|
-
if (!hasPending) removeCallback([storage2], item.id);
|
|
606
|
-
item.callback(icons.loaded.slice(0), icons.missing.slice(0), icons.pending.slice(0), item.abort);
|
|
607
|
-
}
|
|
608
|
-
});
|
|
609
|
-
});
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
let idCounter = 0;
|
|
613
|
-
function storeCallback(callback, icons, pendingSources) {
|
|
614
|
-
const id = idCounter++;
|
|
615
|
-
const abort = removeCallback.bind(null, pendingSources, id);
|
|
616
|
-
if (!icons.pending.length) return abort;
|
|
617
|
-
const item = {
|
|
618
|
-
id,
|
|
619
|
-
icons,
|
|
620
|
-
callback,
|
|
621
|
-
abort
|
|
622
|
-
};
|
|
623
|
-
pendingSources.forEach((storage2) => {
|
|
624
|
-
(storage2.loaderCallbacks || (storage2.loaderCallbacks = [])).push(item);
|
|
625
|
-
});
|
|
626
|
-
return abort;
|
|
627
|
-
}
|
|
628
|
-
function sortIcons(icons) {
|
|
629
|
-
const result = {
|
|
630
|
-
loaded: [],
|
|
631
|
-
missing: [],
|
|
632
|
-
pending: []
|
|
633
|
-
};
|
|
634
|
-
const storage2 = /* @__PURE__ */ Object.create(null);
|
|
635
|
-
icons.sort((a, b) => {
|
|
636
|
-
if (a.provider !== b.provider) return a.provider.localeCompare(b.provider);
|
|
637
|
-
if (a.prefix !== b.prefix) return a.prefix.localeCompare(b.prefix);
|
|
638
|
-
return a.name.localeCompare(b.name);
|
|
639
|
-
});
|
|
640
|
-
let lastIcon = {
|
|
641
|
-
provider: "",
|
|
642
|
-
prefix: "",
|
|
643
|
-
name: ""
|
|
644
|
-
};
|
|
645
|
-
icons.forEach((icon) => {
|
|
646
|
-
if (lastIcon.name === icon.name && lastIcon.prefix === icon.prefix && lastIcon.provider === icon.provider) return;
|
|
647
|
-
lastIcon = icon;
|
|
648
|
-
const provider = icon.provider;
|
|
649
|
-
const prefix = icon.prefix;
|
|
650
|
-
const name = icon.name;
|
|
651
|
-
const providerStorage = storage2[provider] || (storage2[provider] = /* @__PURE__ */ Object.create(null));
|
|
652
|
-
const localStorage = providerStorage[prefix] || (providerStorage[prefix] = getStorage(provider, prefix));
|
|
653
|
-
let list;
|
|
654
|
-
if (name in localStorage.icons) list = result.loaded;
|
|
655
|
-
else if (prefix === "" || localStorage.missing.has(name)) list = result.missing;
|
|
656
|
-
else list = result.pending;
|
|
657
|
-
const item = {
|
|
658
|
-
provider,
|
|
659
|
-
prefix,
|
|
660
|
-
name
|
|
661
|
-
};
|
|
662
|
-
list.push(item);
|
|
663
|
-
});
|
|
664
|
-
return result;
|
|
665
|
-
}
|
|
666
|
-
function listToIcons(list, validate = true, simpleNames2 = false) {
|
|
667
|
-
const result = [];
|
|
668
|
-
list.forEach((item) => {
|
|
669
|
-
const icon = typeof item === "string" ? stringToIcon(item, validate, simpleNames2) : item;
|
|
670
|
-
if (icon) result.push(icon);
|
|
671
|
-
});
|
|
672
|
-
return result;
|
|
673
|
-
}
|
|
674
|
-
const defaultConfig = {
|
|
675
|
-
resources: [],
|
|
676
|
-
index: 0,
|
|
677
|
-
timeout: 2e3,
|
|
678
|
-
rotate: 750,
|
|
679
|
-
random: false,
|
|
680
|
-
dataAfterTimeout: false
|
|
681
|
-
};
|
|
682
|
-
function sendQuery(config, payload, query, done) {
|
|
683
|
-
const resourcesCount = config.resources.length;
|
|
684
|
-
const startIndex = config.random ? Math.floor(Math.random() * resourcesCount) : config.index;
|
|
685
|
-
let resources;
|
|
686
|
-
if (config.random) {
|
|
687
|
-
let list = config.resources.slice(0);
|
|
688
|
-
resources = [];
|
|
689
|
-
while (list.length > 1) {
|
|
690
|
-
const nextIndex = Math.floor(Math.random() * list.length);
|
|
691
|
-
resources.push(list[nextIndex]);
|
|
692
|
-
list = list.slice(0, nextIndex).concat(list.slice(nextIndex + 1));
|
|
693
|
-
}
|
|
694
|
-
resources = resources.concat(list);
|
|
695
|
-
} else resources = config.resources.slice(startIndex).concat(config.resources.slice(0, startIndex));
|
|
696
|
-
const startTime = Date.now();
|
|
697
|
-
let status = "pending";
|
|
698
|
-
let queriesSent = 0;
|
|
699
|
-
let lastError;
|
|
700
|
-
let timer = null;
|
|
701
|
-
let queue = [];
|
|
702
|
-
let doneCallbacks = [];
|
|
703
|
-
if (typeof done === "function") doneCallbacks.push(done);
|
|
704
|
-
function resetTimer() {
|
|
705
|
-
if (timer) {
|
|
706
|
-
clearTimeout(timer);
|
|
707
|
-
timer = null;
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
function abort() {
|
|
711
|
-
if (status === "pending") status = "aborted";
|
|
712
|
-
resetTimer();
|
|
713
|
-
queue.forEach((item) => {
|
|
714
|
-
if (item.status === "pending") item.status = "aborted";
|
|
715
|
-
});
|
|
716
|
-
queue = [];
|
|
717
|
-
}
|
|
718
|
-
function subscribe(callback, overwrite) {
|
|
719
|
-
if (overwrite) doneCallbacks = [];
|
|
720
|
-
if (typeof callback === "function") doneCallbacks.push(callback);
|
|
721
|
-
}
|
|
722
|
-
function getQueryStatus() {
|
|
723
|
-
return {
|
|
724
|
-
startTime,
|
|
725
|
-
payload,
|
|
726
|
-
status,
|
|
727
|
-
queriesSent,
|
|
728
|
-
queriesPending: queue.length,
|
|
729
|
-
subscribe,
|
|
730
|
-
abort
|
|
731
|
-
};
|
|
732
|
-
}
|
|
733
|
-
function failQuery() {
|
|
734
|
-
status = "failed";
|
|
735
|
-
doneCallbacks.forEach((callback) => {
|
|
736
|
-
callback(void 0, lastError);
|
|
737
|
-
});
|
|
738
|
-
}
|
|
739
|
-
function clearQueue() {
|
|
740
|
-
queue.forEach((item) => {
|
|
741
|
-
if (item.status === "pending") item.status = "aborted";
|
|
742
|
-
});
|
|
743
|
-
queue = [];
|
|
744
|
-
}
|
|
745
|
-
function moduleResponse(item, response, data) {
|
|
746
|
-
const isError = response !== "success";
|
|
747
|
-
queue = queue.filter((queued) => queued !== item);
|
|
748
|
-
switch (status) {
|
|
749
|
-
case "pending":
|
|
750
|
-
break;
|
|
751
|
-
case "failed":
|
|
752
|
-
if (isError || !config.dataAfterTimeout) return;
|
|
753
|
-
break;
|
|
754
|
-
default:
|
|
755
|
-
return;
|
|
756
|
-
}
|
|
757
|
-
if (response === "abort") {
|
|
758
|
-
lastError = data;
|
|
759
|
-
failQuery();
|
|
760
|
-
return;
|
|
761
|
-
}
|
|
762
|
-
if (isError) {
|
|
763
|
-
lastError = data;
|
|
764
|
-
if (!queue.length) if (!resources.length) failQuery();
|
|
765
|
-
else execNext();
|
|
766
|
-
return;
|
|
767
|
-
}
|
|
768
|
-
resetTimer();
|
|
769
|
-
clearQueue();
|
|
770
|
-
if (!config.random) {
|
|
771
|
-
const index = config.resources.indexOf(item.resource);
|
|
772
|
-
if (index !== -1 && index !== config.index) config.index = index;
|
|
773
|
-
}
|
|
774
|
-
status = "completed";
|
|
775
|
-
doneCallbacks.forEach((callback) => {
|
|
776
|
-
callback(data);
|
|
777
|
-
});
|
|
778
|
-
}
|
|
779
|
-
function execNext() {
|
|
780
|
-
if (status !== "pending") return;
|
|
781
|
-
resetTimer();
|
|
782
|
-
const resource = resources.shift();
|
|
783
|
-
if (resource === void 0) {
|
|
784
|
-
if (queue.length) {
|
|
785
|
-
timer = setTimeout(() => {
|
|
786
|
-
resetTimer();
|
|
787
|
-
if (status === "pending") {
|
|
788
|
-
clearQueue();
|
|
789
|
-
failQuery();
|
|
790
|
-
}
|
|
791
|
-
}, config.timeout);
|
|
792
|
-
return;
|
|
793
|
-
}
|
|
794
|
-
failQuery();
|
|
795
|
-
return;
|
|
796
|
-
}
|
|
797
|
-
const item = {
|
|
798
|
-
status: "pending",
|
|
799
|
-
resource,
|
|
800
|
-
callback: (status$1, data) => {
|
|
801
|
-
moduleResponse(item, status$1, data);
|
|
802
|
-
}
|
|
803
|
-
};
|
|
804
|
-
queue.push(item);
|
|
805
|
-
queriesSent++;
|
|
806
|
-
timer = setTimeout(execNext, config.rotate);
|
|
807
|
-
query(resource, payload, item.callback);
|
|
808
|
-
}
|
|
809
|
-
setTimeout(execNext);
|
|
810
|
-
return getQueryStatus;
|
|
811
|
-
}
|
|
812
|
-
function initRedundancy(cfg) {
|
|
813
|
-
const config = {
|
|
814
|
-
...defaultConfig,
|
|
815
|
-
...cfg
|
|
816
|
-
};
|
|
817
|
-
let queries = [];
|
|
818
|
-
function cleanup() {
|
|
819
|
-
queries = queries.filter((item) => item().status === "pending");
|
|
820
|
-
}
|
|
821
|
-
function query(payload, queryCallback, doneCallback) {
|
|
822
|
-
const query$1 = sendQuery(config, payload, queryCallback, (data, error) => {
|
|
823
|
-
cleanup();
|
|
824
|
-
if (doneCallback) doneCallback(data, error);
|
|
825
|
-
});
|
|
826
|
-
queries.push(query$1);
|
|
827
|
-
return query$1;
|
|
828
|
-
}
|
|
829
|
-
function find(callback) {
|
|
830
|
-
return queries.find((value) => {
|
|
831
|
-
return callback(value);
|
|
832
|
-
}) || null;
|
|
833
|
-
}
|
|
834
|
-
const instance = {
|
|
835
|
-
query,
|
|
836
|
-
find,
|
|
837
|
-
setIndex: (index) => {
|
|
838
|
-
config.index = index;
|
|
839
|
-
},
|
|
840
|
-
getIndex: () => config.index,
|
|
841
|
-
cleanup
|
|
842
|
-
};
|
|
843
|
-
return instance;
|
|
844
|
-
}
|
|
845
|
-
function emptyCallback$1() {
|
|
846
|
-
}
|
|
847
|
-
const redundancyCache = /* @__PURE__ */ Object.create(null);
|
|
848
|
-
function getRedundancyCache(provider) {
|
|
849
|
-
if (!redundancyCache[provider]) {
|
|
850
|
-
const config = getAPIConfig(provider);
|
|
851
|
-
if (!config) return;
|
|
852
|
-
const redundancy = initRedundancy(config);
|
|
853
|
-
const cachedReundancy = {
|
|
854
|
-
config,
|
|
855
|
-
redundancy
|
|
856
|
-
};
|
|
857
|
-
redundancyCache[provider] = cachedReundancy;
|
|
858
|
-
}
|
|
859
|
-
return redundancyCache[provider];
|
|
860
|
-
}
|
|
861
|
-
function sendAPIQuery(target, query, callback) {
|
|
862
|
-
let redundancy;
|
|
863
|
-
let send2;
|
|
864
|
-
if (typeof target === "string") {
|
|
865
|
-
const api = getAPIModule(target);
|
|
866
|
-
if (!api) {
|
|
867
|
-
callback(void 0, 424);
|
|
868
|
-
return emptyCallback$1;
|
|
869
|
-
}
|
|
870
|
-
send2 = api.send;
|
|
871
|
-
const cached = getRedundancyCache(target);
|
|
872
|
-
if (cached) redundancy = cached.redundancy;
|
|
873
|
-
} else {
|
|
874
|
-
const config = createAPIConfig(target);
|
|
875
|
-
if (config) {
|
|
876
|
-
redundancy = initRedundancy(config);
|
|
877
|
-
const moduleKey = target.resources ? target.resources[0] : "";
|
|
878
|
-
const api = getAPIModule(moduleKey);
|
|
879
|
-
if (api) send2 = api.send;
|
|
880
|
-
}
|
|
881
|
-
}
|
|
882
|
-
if (!redundancy || !send2) {
|
|
883
|
-
callback(void 0, 424);
|
|
884
|
-
return emptyCallback$1;
|
|
885
|
-
}
|
|
886
|
-
return redundancy.query(query, send2, callback)().abort;
|
|
887
|
-
}
|
|
888
|
-
function emptyCallback() {
|
|
889
|
-
}
|
|
890
|
-
function loadedNewIcons(storage2) {
|
|
891
|
-
if (!storage2.iconsLoaderFlag) {
|
|
892
|
-
storage2.iconsLoaderFlag = true;
|
|
893
|
-
setTimeout(() => {
|
|
894
|
-
storage2.iconsLoaderFlag = false;
|
|
895
|
-
updateCallbacks(storage2);
|
|
896
|
-
});
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
function checkIconNamesForAPI(icons) {
|
|
900
|
-
const valid = [];
|
|
901
|
-
const invalid = [];
|
|
902
|
-
icons.forEach((name) => {
|
|
903
|
-
(name.match(matchIconName) ? valid : invalid).push(name);
|
|
904
|
-
});
|
|
905
|
-
return {
|
|
906
|
-
valid,
|
|
907
|
-
invalid
|
|
908
|
-
};
|
|
909
|
-
}
|
|
910
|
-
function parseLoaderResponse(storage2, icons, data) {
|
|
911
|
-
function checkMissing() {
|
|
912
|
-
const pending = storage2.pendingIcons;
|
|
913
|
-
icons.forEach((name) => {
|
|
914
|
-
if (pending) pending.delete(name);
|
|
915
|
-
if (!storage2.icons[name]) storage2.missing.add(name);
|
|
916
|
-
});
|
|
917
|
-
}
|
|
918
|
-
if (data && typeof data === "object") try {
|
|
919
|
-
const parsed = addIconSet(storage2, data);
|
|
920
|
-
if (!parsed.length) {
|
|
921
|
-
checkMissing();
|
|
922
|
-
return;
|
|
923
|
-
}
|
|
924
|
-
} catch (err) {
|
|
925
|
-
console.error(err);
|
|
926
|
-
}
|
|
927
|
-
checkMissing();
|
|
928
|
-
loadedNewIcons(storage2);
|
|
929
|
-
}
|
|
930
|
-
function parsePossiblyAsyncResponse(response, callback) {
|
|
931
|
-
if (response instanceof Promise) response.then((data) => {
|
|
932
|
-
callback(data);
|
|
933
|
-
}).catch(() => {
|
|
934
|
-
callback(null);
|
|
935
|
-
});
|
|
936
|
-
else callback(response);
|
|
937
|
-
}
|
|
938
|
-
function loadNewIcons(storage2, icons) {
|
|
939
|
-
if (!storage2.iconsToLoad) storage2.iconsToLoad = icons;
|
|
940
|
-
else storage2.iconsToLoad = storage2.iconsToLoad.concat(icons).sort();
|
|
941
|
-
if (!storage2.iconsQueueFlag) {
|
|
942
|
-
storage2.iconsQueueFlag = true;
|
|
943
|
-
setTimeout(() => {
|
|
944
|
-
storage2.iconsQueueFlag = false;
|
|
945
|
-
const { provider, prefix } = storage2;
|
|
946
|
-
const icons$1 = storage2.iconsToLoad;
|
|
947
|
-
delete storage2.iconsToLoad;
|
|
948
|
-
if (!icons$1 || !icons$1.length) return;
|
|
949
|
-
const customIconLoader = storage2.loadIcon;
|
|
950
|
-
if (storage2.loadIcons && (icons$1.length > 1 || !customIconLoader)) {
|
|
951
|
-
parsePossiblyAsyncResponse(storage2.loadIcons(icons$1, prefix, provider), (data) => {
|
|
952
|
-
parseLoaderResponse(storage2, icons$1, data);
|
|
953
|
-
});
|
|
954
|
-
return;
|
|
955
|
-
}
|
|
956
|
-
if (customIconLoader) {
|
|
957
|
-
icons$1.forEach((name) => {
|
|
958
|
-
const response = customIconLoader(name, prefix, provider);
|
|
959
|
-
parsePossiblyAsyncResponse(response, (data) => {
|
|
960
|
-
const iconSet = data ? {
|
|
961
|
-
prefix,
|
|
962
|
-
icons: { [name]: data }
|
|
963
|
-
} : null;
|
|
964
|
-
parseLoaderResponse(storage2, [name], iconSet);
|
|
965
|
-
});
|
|
966
|
-
});
|
|
967
|
-
return;
|
|
968
|
-
}
|
|
969
|
-
const { valid, invalid } = checkIconNamesForAPI(icons$1);
|
|
970
|
-
if (invalid.length) parseLoaderResponse(storage2, invalid, null);
|
|
971
|
-
if (!valid.length) return;
|
|
972
|
-
const api = prefix.match(matchIconName) ? getAPIModule(provider) : null;
|
|
973
|
-
if (!api) {
|
|
974
|
-
parseLoaderResponse(storage2, valid, null);
|
|
975
|
-
return;
|
|
976
|
-
}
|
|
977
|
-
const params = api.prepare(provider, prefix, valid);
|
|
978
|
-
params.forEach((item) => {
|
|
979
|
-
sendAPIQuery(provider, item, (data) => {
|
|
980
|
-
parseLoaderResponse(storage2, item.icons, data);
|
|
981
|
-
});
|
|
982
|
-
});
|
|
983
|
-
});
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
const loadIcons = (icons, callback) => {
|
|
987
|
-
const cleanedIcons = listToIcons(icons, true, allowSimpleNames());
|
|
988
|
-
const sortedIcons = sortIcons(cleanedIcons);
|
|
989
|
-
if (!sortedIcons.pending.length) {
|
|
990
|
-
let callCallback = true;
|
|
991
|
-
if (callback) setTimeout(() => {
|
|
992
|
-
if (callCallback) callback(sortedIcons.loaded, sortedIcons.missing, sortedIcons.pending, emptyCallback);
|
|
993
|
-
});
|
|
994
|
-
return () => {
|
|
995
|
-
callCallback = false;
|
|
996
|
-
};
|
|
997
|
-
}
|
|
998
|
-
const newIcons = /* @__PURE__ */ Object.create(null);
|
|
999
|
-
const sources = [];
|
|
1000
|
-
let lastProvider, lastPrefix;
|
|
1001
|
-
sortedIcons.pending.forEach((icon) => {
|
|
1002
|
-
const { provider, prefix } = icon;
|
|
1003
|
-
if (prefix === lastPrefix && provider === lastProvider) return;
|
|
1004
|
-
lastProvider = provider;
|
|
1005
|
-
lastPrefix = prefix;
|
|
1006
|
-
sources.push(getStorage(provider, prefix));
|
|
1007
|
-
const providerNewIcons = newIcons[provider] || (newIcons[provider] = /* @__PURE__ */ Object.create(null));
|
|
1008
|
-
if (!providerNewIcons[prefix]) providerNewIcons[prefix] = [];
|
|
1009
|
-
});
|
|
1010
|
-
sortedIcons.pending.forEach((icon) => {
|
|
1011
|
-
const { provider, prefix, name } = icon;
|
|
1012
|
-
const storage2 = getStorage(provider, prefix);
|
|
1013
|
-
const pendingQueue = storage2.pendingIcons || (storage2.pendingIcons = /* @__PURE__ */ new Set());
|
|
1014
|
-
if (!pendingQueue.has(name)) {
|
|
1015
|
-
pendingQueue.add(name);
|
|
1016
|
-
newIcons[provider][prefix].push(name);
|
|
1017
|
-
}
|
|
1018
|
-
});
|
|
1019
|
-
sources.forEach((storage2) => {
|
|
1020
|
-
const list = newIcons[storage2.provider][storage2.prefix];
|
|
1021
|
-
if (list.length) loadNewIcons(storage2, list);
|
|
1022
|
-
});
|
|
1023
|
-
return callback ? storeCallback(callback, sortedIcons, sources) : emptyCallback;
|
|
1024
|
-
};
|
|
1025
|
-
function mergeCustomisations(defaults, item) {
|
|
1026
|
-
const result = { ...defaults };
|
|
1027
|
-
for (const key in item) {
|
|
1028
|
-
const value = item[key];
|
|
1029
|
-
const valueType = typeof value;
|
|
1030
|
-
if (key in defaultIconSizeCustomisations) {
|
|
1031
|
-
if (value === null || value && (valueType === "string" || valueType === "number")) result[key] = value;
|
|
1032
|
-
} else if (valueType === typeof result[key]) result[key] = key === "rotate" ? value % 4 : value;
|
|
1033
|
-
}
|
|
1034
|
-
return result;
|
|
1035
|
-
}
|
|
1036
|
-
const separator = /[\s,]+/;
|
|
1037
|
-
function flipFromString(custom, flip) {
|
|
1038
|
-
flip.split(separator).forEach((str) => {
|
|
1039
|
-
const value = str.trim();
|
|
1040
|
-
switch (value) {
|
|
1041
|
-
case "horizontal":
|
|
1042
|
-
custom.hFlip = true;
|
|
1043
|
-
break;
|
|
1044
|
-
case "vertical":
|
|
1045
|
-
custom.vFlip = true;
|
|
1046
|
-
break;
|
|
1047
|
-
}
|
|
1048
|
-
});
|
|
1049
|
-
}
|
|
1050
|
-
function rotateFromString(value, defaultValue = 0) {
|
|
1051
|
-
const units = value.replace(/^-?[0-9.]*/, "");
|
|
1052
|
-
function cleanup(value$1) {
|
|
1053
|
-
while (value$1 < 0) value$1 += 4;
|
|
1054
|
-
return value$1 % 4;
|
|
1055
|
-
}
|
|
1056
|
-
if (units === "") {
|
|
1057
|
-
const num = parseInt(value);
|
|
1058
|
-
return isNaN(num) ? 0 : cleanup(num);
|
|
1059
|
-
} else if (units !== value) {
|
|
1060
|
-
let split = 0;
|
|
1061
|
-
switch (units) {
|
|
1062
|
-
case "%":
|
|
1063
|
-
split = 25;
|
|
1064
|
-
break;
|
|
1065
|
-
case "deg":
|
|
1066
|
-
split = 90;
|
|
1067
|
-
}
|
|
1068
|
-
if (split) {
|
|
1069
|
-
let num = parseFloat(value.slice(0, value.length - units.length));
|
|
1070
|
-
if (isNaN(num)) return 0;
|
|
1071
|
-
num = num / split;
|
|
1072
|
-
return num % 1 === 0 ? cleanup(num) : 0;
|
|
1073
|
-
}
|
|
1074
|
-
}
|
|
1075
|
-
return defaultValue;
|
|
1076
|
-
}
|
|
1077
|
-
function iconToHTML(body, attributes2) {
|
|
1078
|
-
let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
|
|
1079
|
-
for (const attr2 in attributes2) renderAttribsHTML += " " + attr2 + '="' + attributes2[attr2] + '"';
|
|
1080
|
-
return '<svg xmlns="http://www.w3.org/2000/svg"' + renderAttribsHTML + ">" + body + "</svg>";
|
|
1081
|
-
}
|
|
1082
|
-
function encodeSVGforURL(svg) {
|
|
1083
|
-
return svg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
|
|
1084
|
-
}
|
|
1085
|
-
function svgToData(svg) {
|
|
1086
|
-
return "data:image/svg+xml," + encodeSVGforURL(svg);
|
|
1087
|
-
}
|
|
1088
|
-
function svgToURL(svg) {
|
|
1089
|
-
return 'url("' + svgToData(svg) + '")';
|
|
1090
|
-
}
|
|
1091
|
-
const defaultExtendedIconCustomisations = {
|
|
1092
|
-
...defaultIconCustomisations,
|
|
1093
|
-
inline: false
|
|
1094
|
-
};
|
|
1095
|
-
const svgDefaults = {
|
|
1096
|
-
"xmlns": "http://www.w3.org/2000/svg",
|
|
1097
|
-
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
1098
|
-
"aria-hidden": true,
|
|
1099
|
-
"role": "img"
|
|
1100
|
-
};
|
|
1101
|
-
const commonProps = {
|
|
1102
|
-
display: "inline-block"
|
|
1103
|
-
};
|
|
1104
|
-
const monotoneProps = {
|
|
1105
|
-
"background-color": "currentColor"
|
|
1106
|
-
};
|
|
1107
|
-
const coloredProps = {
|
|
1108
|
-
"background-color": "transparent"
|
|
1109
|
-
};
|
|
1110
|
-
const propsToAdd = {
|
|
1111
|
-
image: "var(--svg)",
|
|
1112
|
-
repeat: "no-repeat",
|
|
1113
|
-
size: "100% 100%"
|
|
1114
|
-
};
|
|
1115
|
-
const propsToAddTo = {
|
|
1116
|
-
"-webkit-mask": monotoneProps,
|
|
1117
|
-
"mask": monotoneProps,
|
|
1118
|
-
"background": coloredProps
|
|
1119
|
-
};
|
|
1120
|
-
for (const prefix in propsToAddTo) {
|
|
1121
|
-
const list = propsToAddTo[prefix];
|
|
1122
|
-
for (const prop in propsToAdd) {
|
|
1123
|
-
list[prefix + "-" + prop] = propsToAdd[prop];
|
|
1124
|
-
}
|
|
1125
|
-
}
|
|
1126
|
-
function fixSize(value) {
|
|
1127
|
-
return value + (value.match(/^[-0-9.]+$/) ? "px" : "");
|
|
1128
|
-
}
|
|
1129
|
-
function render(icon, props) {
|
|
1130
|
-
const customisations = mergeCustomisations(defaultExtendedIconCustomisations, props);
|
|
1131
|
-
const mode = props.mode || "svg";
|
|
1132
|
-
const componentProps = mode === "svg" ? { ...svgDefaults } : {};
|
|
1133
|
-
if (icon.body.indexOf("xlink:") === -1) {
|
|
1134
|
-
delete componentProps["xmlns:xlink"];
|
|
1135
|
-
}
|
|
1136
|
-
let style = typeof props.style === "string" ? props.style : "";
|
|
1137
|
-
for (let key in props) {
|
|
1138
|
-
const value = props[key];
|
|
1139
|
-
if (value === void 0) {
|
|
1140
|
-
continue;
|
|
1141
|
-
}
|
|
1142
|
-
switch (key) {
|
|
1143
|
-
case "icon":
|
|
1144
|
-
case "style":
|
|
1145
|
-
case "onLoad":
|
|
1146
|
-
case "mode":
|
|
1147
|
-
case "ssr":
|
|
1148
|
-
break;
|
|
1149
|
-
case "inline":
|
|
1150
|
-
case "hFlip":
|
|
1151
|
-
case "vFlip":
|
|
1152
|
-
customisations[key] = value === true || value === "true" || value === 1;
|
|
1153
|
-
break;
|
|
1154
|
-
case "flip":
|
|
1155
|
-
if (typeof value === "string") {
|
|
1156
|
-
flipFromString(customisations, value);
|
|
1157
|
-
}
|
|
1158
|
-
break;
|
|
1159
|
-
case "color":
|
|
1160
|
-
style = style + (style.length > 0 && style.trim().slice(-1) !== ";" ? ";" : "") + "color: " + value + "; ";
|
|
1161
|
-
break;
|
|
1162
|
-
case "rotate":
|
|
1163
|
-
if (typeof value === "string") {
|
|
1164
|
-
customisations[key] = rotateFromString(value);
|
|
1165
|
-
} else if (typeof value === "number") {
|
|
1166
|
-
customisations[key] = value;
|
|
1167
|
-
}
|
|
1168
|
-
break;
|
|
1169
|
-
case "ariaHidden":
|
|
1170
|
-
case "aria-hidden":
|
|
1171
|
-
if (value !== true && value !== "true") {
|
|
1172
|
-
delete componentProps["aria-hidden"];
|
|
1173
|
-
}
|
|
1174
|
-
break;
|
|
1175
|
-
default:
|
|
1176
|
-
if (key.slice(0, 3) === "on:") {
|
|
1177
|
-
break;
|
|
1178
|
-
}
|
|
1179
|
-
if (defaultExtendedIconCustomisations[key] === void 0) {
|
|
1180
|
-
componentProps[key] = value;
|
|
1181
|
-
}
|
|
1182
|
-
}
|
|
1183
|
-
}
|
|
1184
|
-
const item = iconToSVG(icon, customisations);
|
|
1185
|
-
const renderAttribs = item.attributes;
|
|
1186
|
-
if (customisations.inline) {
|
|
1187
|
-
style = "vertical-align: -0.125em; " + style;
|
|
1188
|
-
}
|
|
1189
|
-
if (mode === "svg") {
|
|
1190
|
-
Object.assign(componentProps, renderAttribs);
|
|
1191
|
-
if (style !== "") {
|
|
1192
|
-
componentProps.style = style;
|
|
1193
|
-
}
|
|
1194
|
-
let localCounter = 0;
|
|
1195
|
-
let id = props.id;
|
|
1196
|
-
if (typeof id === "string") {
|
|
1197
|
-
id = id.replace(/-/g, "_");
|
|
1198
|
-
}
|
|
1199
|
-
return {
|
|
1200
|
-
svg: true,
|
|
1201
|
-
attributes: componentProps,
|
|
1202
|
-
body: replaceIDs(item.body, id ? () => id + "ID" + localCounter++ : "iconifySvelte")
|
|
1203
|
-
};
|
|
1204
|
-
}
|
|
1205
|
-
const { body, width, height } = icon;
|
|
1206
|
-
const useMask = mode === "mask" || (mode === "bg" ? false : body.indexOf("currentColor") !== -1);
|
|
1207
|
-
const html2 = iconToHTML(body, {
|
|
1208
|
-
...renderAttribs,
|
|
1209
|
-
width: width + "",
|
|
1210
|
-
height: height + ""
|
|
1211
|
-
});
|
|
1212
|
-
const url = svgToURL(html2);
|
|
1213
|
-
const styles = {
|
|
1214
|
-
"--svg": url
|
|
1215
|
-
};
|
|
1216
|
-
const size = (prop) => {
|
|
1217
|
-
const value = renderAttribs[prop];
|
|
1218
|
-
if (value) {
|
|
1219
|
-
styles[prop] = fixSize(value);
|
|
1220
|
-
}
|
|
1221
|
-
};
|
|
1222
|
-
size("width");
|
|
1223
|
-
size("height");
|
|
1224
|
-
Object.assign(styles, commonProps, useMask ? monotoneProps : coloredProps);
|
|
1225
|
-
let customStyle = "";
|
|
1226
|
-
for (const key in styles) {
|
|
1227
|
-
customStyle += key + ": " + styles[key] + ";";
|
|
1228
|
-
}
|
|
1229
|
-
componentProps.style = customStyle + style;
|
|
1230
|
-
return {
|
|
1231
|
-
svg: false,
|
|
1232
|
-
attributes: componentProps
|
|
1233
|
-
};
|
|
1234
|
-
}
|
|
1235
|
-
allowSimpleNames(true);
|
|
1236
|
-
setAPIModule("", fetchAPIModule);
|
|
1237
|
-
if (typeof document !== "undefined" && typeof window !== "undefined") {
|
|
1238
|
-
const _window = window;
|
|
1239
|
-
if (_window.IconifyPreload !== void 0) {
|
|
1240
|
-
const preload = _window.IconifyPreload;
|
|
1241
|
-
const err = "Invalid IconifyPreload syntax.";
|
|
1242
|
-
if (typeof preload === "object" && preload !== null) {
|
|
1243
|
-
(preload instanceof Array ? preload : [preload]).forEach((item) => {
|
|
1244
|
-
try {
|
|
1245
|
-
if (
|
|
1246
|
-
// Check if item is an object and not null/array
|
|
1247
|
-
typeof item !== "object" || item === null || item instanceof Array || // Check for 'icons' and 'prefix'
|
|
1248
|
-
typeof item.icons !== "object" || typeof item.prefix !== "string" || // Add icon set
|
|
1249
|
-
!addCollection(item)
|
|
1250
|
-
) {
|
|
1251
|
-
console.error(err);
|
|
1252
|
-
}
|
|
1253
|
-
} catch (e) {
|
|
1254
|
-
console.error(err);
|
|
1255
|
-
}
|
|
1256
|
-
});
|
|
1257
|
-
}
|
|
1258
|
-
}
|
|
1259
|
-
if (_window.IconifyProviders !== void 0) {
|
|
1260
|
-
const providers = _window.IconifyProviders;
|
|
1261
|
-
if (typeof providers === "object" && providers !== null) {
|
|
1262
|
-
for (let key in providers) {
|
|
1263
|
-
const err = "IconifyProviders[" + key + "] is invalid.";
|
|
1264
|
-
try {
|
|
1265
|
-
const value = providers[key];
|
|
1266
|
-
if (typeof value !== "object" || !value || value.resources === void 0) {
|
|
1267
|
-
continue;
|
|
1268
|
-
}
|
|
1269
|
-
if (!addAPIProvider(key, value)) {
|
|
1270
|
-
console.error(err);
|
|
1271
|
-
}
|
|
1272
|
-
} catch (e) {
|
|
1273
|
-
console.error(err);
|
|
1274
|
-
}
|
|
1275
|
-
}
|
|
1276
|
-
}
|
|
1277
|
-
}
|
|
1278
|
-
}
|
|
1279
|
-
function checkIconState(icon, state, mounted, callback, onload) {
|
|
1280
|
-
function abortLoading() {
|
|
1281
|
-
if (state.loading) {
|
|
1282
|
-
state.loading.abort();
|
|
1283
|
-
state.loading = null;
|
|
1284
|
-
}
|
|
1285
|
-
}
|
|
1286
|
-
if (typeof icon === "object" && icon !== null && typeof icon.body === "string") {
|
|
1287
|
-
state.name = "";
|
|
1288
|
-
abortLoading();
|
|
1289
|
-
return { data: { ...defaultIconProps, ...icon } };
|
|
1290
|
-
}
|
|
1291
|
-
let iconName;
|
|
1292
|
-
if (typeof icon !== "string" || (iconName = stringToIcon(icon, false, true)) === null) {
|
|
1293
|
-
abortLoading();
|
|
1294
|
-
return null;
|
|
1295
|
-
}
|
|
1296
|
-
const data = getIconData(iconName);
|
|
1297
|
-
if (!data) {
|
|
1298
|
-
if (mounted && (!state.loading || state.loading.name !== icon)) {
|
|
1299
|
-
abortLoading();
|
|
1300
|
-
state.name = "";
|
|
1301
|
-
state.loading = {
|
|
1302
|
-
name: icon,
|
|
1303
|
-
abort: loadIcons([iconName], callback)
|
|
1304
|
-
};
|
|
1305
|
-
}
|
|
1306
|
-
return null;
|
|
1307
|
-
}
|
|
1308
|
-
abortLoading();
|
|
1309
|
-
if (state.name !== icon) {
|
|
1310
|
-
state.name = icon;
|
|
1311
|
-
if (onload && !state.destroyed) {
|
|
1312
|
-
setTimeout(() => {
|
|
1313
|
-
onload(icon);
|
|
1314
|
-
});
|
|
1315
|
-
}
|
|
1316
|
-
}
|
|
1317
|
-
const classes = ["iconify"];
|
|
1318
|
-
if (iconName.prefix !== "") {
|
|
1319
|
-
classes.push("iconify--" + iconName.prefix);
|
|
1320
|
-
}
|
|
1321
|
-
if (iconName.provider !== "") {
|
|
1322
|
-
classes.push("iconify--" + iconName.provider);
|
|
1323
|
-
}
|
|
1324
|
-
return { data, classes };
|
|
1325
|
-
}
|
|
1326
|
-
function generateIcon(icon, props) {
|
|
1327
|
-
return icon ? render({
|
|
1328
|
-
...defaultIconProps,
|
|
1329
|
-
...icon
|
|
1330
|
-
}, props) : null;
|
|
1331
|
-
}
|
|
1332
|
-
function Icon($$renderer, $$props) {
|
|
1333
|
-
$$renderer.component(($$renderer2) => {
|
|
1334
|
-
const iconState = {
|
|
1335
|
-
// Last icon name
|
|
1336
|
-
name: "",
|
|
1337
|
-
// Loading status
|
|
1338
|
-
loading: null,
|
|
1339
|
-
// Destroyed status
|
|
1340
|
-
destroyed: false
|
|
1341
|
-
};
|
|
1342
|
-
const { $$slots, $$events, ...props } = $$props;
|
|
1343
|
-
let mounted = false;
|
|
1344
|
-
let isMounted = !!props.ssr || mounted;
|
|
1345
|
-
let iconData = (() => {
|
|
1346
|
-
return checkIconState(props.icon, iconState, isMounted, loaded, props.onload);
|
|
1347
|
-
})();
|
|
1348
|
-
let data = (() => {
|
|
1349
|
-
const generatedData = iconData ? generateIcon(iconData.data, props) : null;
|
|
1350
|
-
if (generatedData && iconData.classes) {
|
|
1351
|
-
generatedData.attributes["class"] = (typeof props["class"] === "string" ? props["class"] + " " : "") + iconData.classes.join(" ");
|
|
1352
|
-
}
|
|
1353
|
-
return generatedData;
|
|
1354
|
-
})();
|
|
1355
|
-
function loaded() {
|
|
1356
|
-
}
|
|
1357
|
-
onDestroy(() => {
|
|
1358
|
-
iconState.destroyed = true;
|
|
1359
|
-
if (iconState.loading) {
|
|
1360
|
-
iconState.loading.abort();
|
|
1361
|
-
iconState.loading = null;
|
|
1362
|
-
}
|
|
1363
|
-
});
|
|
1364
|
-
if (data) {
|
|
1365
|
-
$$renderer2.push("<!--[-->");
|
|
1366
|
-
if (data.svg) {
|
|
1367
|
-
$$renderer2.push("<!--[-->");
|
|
1368
|
-
$$renderer2.push(`<svg${attributes({ ...data.attributes }, void 0, void 0, void 0, 3)}>${html(data.body)}</svg>`);
|
|
1369
|
-
} else {
|
|
1370
|
-
$$renderer2.push("<!--[!-->");
|
|
1371
|
-
$$renderer2.push(`<span${attributes({ ...data.attributes })}></span>`);
|
|
1372
|
-
}
|
|
1373
|
-
$$renderer2.push(`<!--]-->`);
|
|
1374
|
-
} else {
|
|
1375
|
-
$$renderer2.push("<!--[!-->");
|
|
1376
|
-
}
|
|
1377
|
-
$$renderer2.push(`<!--]-->`);
|
|
1378
|
-
});
|
|
1379
|
-
}
|
|
1380
|
-
function MiniEditor($$renderer, $$props) {
|
|
1381
|
-
$$renderer.component(($$renderer2) => {
|
|
1382
|
-
let editor = null;
|
|
1383
|
-
let model = null;
|
|
1384
|
-
let disposables = [];
|
|
1385
|
-
let editorElement;
|
|
1386
|
-
let {
|
|
1387
|
-
height = 120
|
|
1388
|
-
} = $$props;
|
|
1389
|
-
function handleWheelCapture(e) {
|
|
1390
|
-
e.stopPropagation();
|
|
1391
|
-
}
|
|
1392
|
-
onDestroy(() => {
|
|
1393
|
-
try {
|
|
1394
|
-
editorElement.removeEventListener("wheel", handleWheelCapture, { capture: true });
|
|
1395
|
-
} catch {
|
|
1396
|
-
}
|
|
1397
|
-
for (const d of disposables) {
|
|
1398
|
-
try {
|
|
1399
|
-
d.dispose();
|
|
1400
|
-
} catch {
|
|
1401
|
-
}
|
|
1402
|
-
}
|
|
1403
|
-
disposables = [];
|
|
1404
|
-
const toDisposeModel = model;
|
|
1405
|
-
model = null;
|
|
1406
|
-
try {
|
|
1407
|
-
if (editor) {
|
|
1408
|
-
try {
|
|
1409
|
-
editor.setModel(null);
|
|
1410
|
-
} catch {
|
|
1411
|
-
}
|
|
1412
|
-
editor.dispose();
|
|
1413
|
-
}
|
|
1414
|
-
} finally {
|
|
1415
|
-
editor = null;
|
|
1416
|
-
}
|
|
1417
|
-
try {
|
|
1418
|
-
toDisposeModel?.dispose();
|
|
1419
|
-
} catch {
|
|
1420
|
-
}
|
|
1421
|
-
});
|
|
1422
|
-
$$renderer2.push(`<div class="w-full"${attr_style(
|
|
1423
|
-
// Update language when prop changes without recreating the editor
|
|
1424
|
-
// External value changes should update the model (avoid loops)
|
|
1425
|
-
`height:${height}px`
|
|
1426
|
-
)}></div>`);
|
|
1427
|
-
});
|
|
1428
|
-
}
|
|
1429
|
-
function _page($$renderer, $$props) {
|
|
1430
|
-
$$renderer.component(($$renderer2) => {
|
|
1431
|
-
const { state: workspace, actions } = getEditWorkspaceContext();
|
|
1432
|
-
const agent = workspace.agentId;
|
|
1433
|
-
function safeClone(v) {
|
|
1434
|
-
try {
|
|
1435
|
-
return structuredClone(v);
|
|
1436
|
-
} catch {
|
|
1437
|
-
try {
|
|
1438
|
-
return JSON.parse(JSON.stringify(v));
|
|
1439
|
-
} catch {
|
|
1440
|
-
return v;
|
|
1441
|
-
}
|
|
1442
|
-
}
|
|
1443
|
-
}
|
|
1444
|
-
function clamp(n, min, max) {
|
|
1445
|
-
return Math.max(min, Math.min(max, n));
|
|
1446
|
-
}
|
|
1447
|
-
let repeats = 1;
|
|
1448
|
-
let concurrency = 1;
|
|
1449
|
-
let defaultContext = {};
|
|
1450
|
-
let defaultContextDraft = {};
|
|
1451
|
-
let showDefaultContextModal = false;
|
|
1452
|
-
let testContextPopoverTestId = null;
|
|
1453
|
-
let testContextDraft = {};
|
|
1454
|
-
let showViewerModal = false;
|
|
1455
|
-
let viewerTitle = "";
|
|
1456
|
-
let analyzeRunning = false;
|
|
1457
|
-
const baseAssertionTypes = [
|
|
1458
|
-
{ value: "llm-rubric", label: "LLM" },
|
|
1459
|
-
{ value: "answer-relevance", label: "Answer Relevance (LLM)" },
|
|
1460
|
-
{
|
|
1461
|
-
value: "context-faithfulness",
|
|
1462
|
-
label: "Context Faithfulness (LLM)"
|
|
1463
|
-
},
|
|
1464
|
-
{ value: "context-recall", label: "Context Recall (LLM)" },
|
|
1465
|
-
{ value: "context-relevance", label: "Context Relevance (LLM)" },
|
|
1466
|
-
{
|
|
1467
|
-
value: "model-graded-closedqa",
|
|
1468
|
-
label: "Model-Graded Closed QA"
|
|
1469
|
-
},
|
|
1470
|
-
{
|
|
1471
|
-
value: "model-graded-factuality",
|
|
1472
|
-
label: "Model-Graded Factuality"
|
|
1473
|
-
},
|
|
1474
|
-
{ value: "moderation", label: "Moderation" },
|
|
1475
|
-
{ value: "classifier", label: "Classifier" },
|
|
1476
|
-
{ value: "g-eval", label: "G-Eval" },
|
|
1477
|
-
{ value: "factuality", label: "Factuality" },
|
|
1478
|
-
{
|
|
1479
|
-
value: "conversation-relevance",
|
|
1480
|
-
label: "Conversation Relevance"
|
|
1481
|
-
},
|
|
1482
|
-
{ value: "equals", label: "Equals" },
|
|
1483
|
-
{ value: "contains", label: "Contains" },
|
|
1484
|
-
{ value: "icontains", label: "Contains (case-insensitive)" },
|
|
1485
|
-
{ value: "contains-all", label: "Contains All" },
|
|
1486
|
-
{ value: "contains-any", label: "Contains Any" },
|
|
1487
|
-
{ value: "icontains-all", label: "Contains All (iCase)" },
|
|
1488
|
-
{ value: "icontains-any", label: "Contains Any (iCase)" },
|
|
1489
|
-
{ value: "starts-with", label: "Starts With" },
|
|
1490
|
-
{ value: "regex", label: "Regex" },
|
|
1491
|
-
{ value: "levenshtein", label: "Levenshtein Distance" },
|
|
1492
|
-
{ value: "is-refusal", label: "Is Refusal" },
|
|
1493
|
-
{ value: "is-html", label: "Is HTML" },
|
|
1494
|
-
{ value: "contains-html", label: "Contains HTML" },
|
|
1495
|
-
{ value: "is-json", label: "Is JSON" },
|
|
1496
|
-
{ value: "contains-json", label: "Contains JSON" },
|
|
1497
|
-
{ value: "is-xml", label: "Is XML" },
|
|
1498
|
-
{ value: "contains-xml", label: "Contains XML" },
|
|
1499
|
-
{ value: "is-sql", label: "Is SQL" },
|
|
1500
|
-
{ value: "contains-sql", label: "Contains SQL" },
|
|
1501
|
-
{ value: "similar", label: "Semantic Similarity" },
|
|
1502
|
-
{ value: "rouge-n", label: "ROUGE-N" },
|
|
1503
|
-
{ value: "bleu", label: "BLEU" },
|
|
1504
|
-
{ value: "gleu", label: "GLEU" },
|
|
1505
|
-
{ value: "meteor", label: "METEOR" },
|
|
1506
|
-
{ value: "perplexity", label: "Perplexity" },
|
|
1507
|
-
{ value: "perplexity-score", label: "Perplexity Score" },
|
|
1508
|
-
{ value: "latency", label: "Latency" },
|
|
1509
|
-
{ value: "cost", label: "Cost" },
|
|
1510
|
-
{ value: "finish-reason", label: "Finish Reason" },
|
|
1511
|
-
{ value: "trace-error-spans", label: "Trace Error Spans" },
|
|
1512
|
-
{ value: "trace-span-count", label: "Trace Span Count" },
|
|
1513
|
-
{ value: "trace-span-duration", label: "Trace Span Duration" },
|
|
1514
|
-
{
|
|
1515
|
-
value: "is-valid-function-call",
|
|
1516
|
-
label: "Is Valid Function Call"
|
|
1517
|
-
},
|
|
1518
|
-
{
|
|
1519
|
-
value: "is-valid-openai-function-call",
|
|
1520
|
-
label: "Is Valid OpenAI Function Call"
|
|
1521
|
-
},
|
|
1522
|
-
{
|
|
1523
|
-
value: "is-valid-openai-tools-call",
|
|
1524
|
-
label: "Is Valid OpenAI Tools Call"
|
|
1525
|
-
},
|
|
1526
|
-
{ value: "guardrails", label: "Guardrails" },
|
|
1527
|
-
{ value: "javascript", label: "JavaScript (custom)" },
|
|
1528
|
-
{ value: "python", label: "Python (custom)" },
|
|
1529
|
-
{ value: "webhook", label: "Webhook (custom)" },
|
|
1530
|
-
{ value: "pi", label: "Pi Scorer" }
|
|
1531
|
-
];
|
|
1532
|
-
const assertionTypes = [
|
|
1533
|
-
...baseAssertionTypes,
|
|
1534
|
-
...baseAssertionTypes.map((opt) => ({ value: `not-${opt.value}`, label: `Not ${opt.label}` }))
|
|
1535
|
-
];
|
|
1536
|
-
let tests = [];
|
|
1537
|
-
let running = false;
|
|
1538
|
-
let canceling = false;
|
|
1539
|
-
let cancelRequested = false;
|
|
1540
|
-
let runScope = null;
|
|
1541
|
-
let runSingleTestId = null;
|
|
1542
|
-
let runDone = 0;
|
|
1543
|
-
let runTotal = 0;
|
|
1544
|
-
let runExpectedRuns = 1;
|
|
1545
|
-
let pollInFlight = false;
|
|
1546
|
-
let pollTimer = null;
|
|
1547
|
-
let runToken = 0;
|
|
1548
|
-
const pendingSaves = /* @__PURE__ */ new Set();
|
|
1549
|
-
let pendingSaveCount = 0;
|
|
1550
|
-
const isSaving = pendingSaveCount > 0;
|
|
1551
|
-
let hasFetchedTests = false;
|
|
1552
|
-
function trackSave(p) {
|
|
1553
|
-
pendingSaves.add(p);
|
|
1554
|
-
pendingSaveCount += 1;
|
|
1555
|
-
p.finally(() => {
|
|
1556
|
-
pendingSaves.delete(p);
|
|
1557
|
-
pendingSaveCount -= 1;
|
|
1558
|
-
});
|
|
1559
|
-
return p;
|
|
1560
|
-
}
|
|
1561
|
-
function makeResult(id, rr) {
|
|
1562
|
-
const rawRuns = Array.isArray(rr.results) ? rr.results : [];
|
|
1563
|
-
const successCount = rawRuns.reduce((acc, run2) => acc + (run2?.success ? 1 : 0), 0);
|
|
1564
|
-
return {
|
|
1565
|
-
success_rate: rr.success_rate,
|
|
1566
|
-
successes: successCount,
|
|
1567
|
-
total_runs: rawRuns.length,
|
|
1568
|
-
isOld: !!rr.is_old,
|
|
1569
|
-
previous: rr.previous && typeof rr.previous === "object" ? {
|
|
1570
|
-
success_count: Number(rr.previous.success_count ?? 0),
|
|
1571
|
-
total_runs: Number(rr.previous.total_runs ?? 0),
|
|
1572
|
-
report_timestamp: String(rr.previous.report_timestamp ?? "")
|
|
1573
|
-
} : void 0,
|
|
1574
|
-
runs: rawRuns.map((run2, idx) => {
|
|
1575
|
-
const timestamp = rr.report_timestamp;
|
|
1576
|
-
const params = { agent, id, timestamp, run: idx };
|
|
1577
|
-
return {
|
|
1578
|
-
index: idx + 1,
|
|
1579
|
-
success: !!run2.success,
|
|
1580
|
-
text: String(run2.result || ""),
|
|
1581
|
-
evaluation: String(run2.evaluation || ""),
|
|
1582
|
-
links: {
|
|
1583
|
-
renderedPrompt: { ...params, key: "rendered_prompt" },
|
|
1584
|
-
receivedPrompt: { ...params, key: "received_prompt" },
|
|
1585
|
-
conversation: { ...params, key: "stringified_conversation" },
|
|
1586
|
-
context: { ...params, key: "received_context" },
|
|
1587
|
-
logs: { ...params, key: "logs" },
|
|
1588
|
-
traces: { ...params, key: "traces" }
|
|
1589
|
-
}
|
|
1590
|
-
};
|
|
1591
|
-
}).reverse()
|
|
1592
|
-
};
|
|
1593
|
-
}
|
|
1594
|
-
async function refresh() {
|
|
1595
|
-
if (!agent) return;
|
|
1596
|
-
try {
|
|
1597
|
-
const [{ rows }, config, results] = await Promise.all([
|
|
1598
|
-
trpc.tests.list.query({ agent }),
|
|
1599
|
-
trpc.tests.config.query({ agent }),
|
|
1600
|
-
trpc.tests.latestResult.query({ agent })
|
|
1601
|
-
]);
|
|
1602
|
-
repeats = config.repeats ?? 1;
|
|
1603
|
-
concurrency = config.concurrency ?? 1;
|
|
1604
|
-
defaultContext = config.defaultContext ?? {};
|
|
1605
|
-
tests = rows.map((r) => {
|
|
1606
|
-
const id = r.id;
|
|
1607
|
-
const rr = results[id];
|
|
1608
|
-
return {
|
|
1609
|
-
id,
|
|
1610
|
-
pinned: String(r.pinned).toUpperCase() === "TRUE",
|
|
1611
|
-
scenario: r.scenario || "",
|
|
1612
|
-
step: String(r.step ?? ""),
|
|
1613
|
-
author: r.author || "",
|
|
1614
|
-
assertion_type: r.assertion_type || "llm-rubric",
|
|
1615
|
-
assertion_value: r.assertion_value || "",
|
|
1616
|
-
conversation: r.conversation || "",
|
|
1617
|
-
expected_output: r.expected_output || "",
|
|
1618
|
-
conversation_ui: buildConversationEditorValue(r.conversation || "", r.expected_output || ""),
|
|
1619
|
-
timeout: Number(r.timeout ?? 0),
|
|
1620
|
-
similarity_threshold: Number(r.similarity_threshold ?? 60),
|
|
1621
|
-
context: JSON.stringify(r.context),
|
|
1622
|
-
result: rr ? makeResult(id, rr) : void 0
|
|
1623
|
-
};
|
|
1624
|
-
});
|
|
1625
|
-
} catch (e) {
|
|
1626
|
-
console.error(e);
|
|
1627
|
-
tests = [];
|
|
1628
|
-
repeats = 1;
|
|
1629
|
-
concurrency = 1;
|
|
1630
|
-
defaultContext = {};
|
|
1631
|
-
} finally {
|
|
1632
|
-
hasFetchedTests = true;
|
|
1633
|
-
}
|
|
1634
|
-
}
|
|
1635
|
-
async function pollLatestResults(activeToken) {
|
|
1636
|
-
if (pollInFlight) return;
|
|
1637
|
-
pollInFlight = true;
|
|
1638
|
-
try {
|
|
1639
|
-
const results = await trpc.tests.latestResult.query({ agent });
|
|
1640
|
-
if (activeToken !== runToken) return;
|
|
1641
|
-
const nextTests = tests.map((t) => {
|
|
1642
|
-
const rr = results[t.id];
|
|
1643
|
-
return { ...t, result: rr ? makeResult(t.id, rr) : void 0 };
|
|
1644
|
-
});
|
|
1645
|
-
tests = nextTests;
|
|
1646
|
-
const scope = runScope;
|
|
1647
|
-
const expectedRuns = Math.max(1, Number(runExpectedRuns) || 1);
|
|
1648
|
-
const done = nextTests.reduce(
|
|
1649
|
-
(acc, t) => {
|
|
1650
|
-
if (scope === "single" && t.id !== runSingleTestId) return acc;
|
|
1651
|
-
if (scope === "pinned" && !t.pinned) return acc;
|
|
1652
|
-
return t.result && !t.result.isOld && t.result.total_runs >= expectedRuns ? acc + 1 : acc;
|
|
1653
|
-
},
|
|
1654
|
-
0
|
|
1655
|
-
);
|
|
1656
|
-
runDone = done;
|
|
1657
|
-
} catch (e) {
|
|
1658
|
-
console.error(e);
|
|
1659
|
-
} finally {
|
|
1660
|
-
pollInFlight = false;
|
|
1661
|
-
}
|
|
1662
|
-
}
|
|
1663
|
-
async function run(scope) {
|
|
1664
|
-
running = true;
|
|
1665
|
-
cancelRequested = false;
|
|
1666
|
-
runScope = scope;
|
|
1667
|
-
runSingleTestId = null;
|
|
1668
|
-
runTotal = scope === "all" ? tests.length : tests.filter((t) => t.pinned).length;
|
|
1669
|
-
runDone = 0;
|
|
1670
|
-
runExpectedRuns = Math.max(1, Number(repeats) || 1);
|
|
1671
|
-
runToken += 1;
|
|
1672
|
-
const activeToken = runToken;
|
|
1673
|
-
await Promise.all([...pendingSaves]);
|
|
1674
|
-
if (pollTimer) clearInterval(pollTimer);
|
|
1675
|
-
pollTimer = setInterval(() => pollLatestResults(activeToken), 800);
|
|
1676
|
-
void pollLatestResults(activeToken);
|
|
1677
|
-
try {
|
|
1678
|
-
await trpc.tests.runTests.mutate({ agent, scope });
|
|
1679
|
-
} finally {
|
|
1680
|
-
if (pollTimer) clearInterval(pollTimer);
|
|
1681
|
-
pollTimer = null;
|
|
1682
|
-
try {
|
|
1683
|
-
await refresh();
|
|
1684
|
-
} finally {
|
|
1685
|
-
running = false;
|
|
1686
|
-
runScope = null;
|
|
1687
|
-
}
|
|
1688
|
-
}
|
|
1689
|
-
}
|
|
1690
|
-
async function runSingle(testId) {
|
|
1691
|
-
if (!agent) return;
|
|
1692
|
-
running = true;
|
|
1693
|
-
cancelRequested = false;
|
|
1694
|
-
runScope = "single";
|
|
1695
|
-
runSingleTestId = testId;
|
|
1696
|
-
runTotal = 1;
|
|
1697
|
-
runDone = 0;
|
|
1698
|
-
runExpectedRuns = Math.max(1, Number(repeats) || 1);
|
|
1699
|
-
runToken += 1;
|
|
1700
|
-
const activeToken = runToken;
|
|
1701
|
-
await Promise.all([...pendingSaves]);
|
|
1702
|
-
if (pollTimer) clearInterval(pollTimer);
|
|
1703
|
-
pollTimer = setInterval(() => pollLatestResults(activeToken), 800);
|
|
1704
|
-
void pollLatestResults(activeToken);
|
|
1705
|
-
try {
|
|
1706
|
-
await trpc.tests.runTests.mutate({ agent, testId });
|
|
1707
|
-
} finally {
|
|
1708
|
-
if (pollTimer) clearInterval(pollTimer);
|
|
1709
|
-
pollTimer = null;
|
|
1710
|
-
try {
|
|
1711
|
-
await refresh();
|
|
1712
|
-
} finally {
|
|
1713
|
-
running = false;
|
|
1714
|
-
runScope = null;
|
|
1715
|
-
runSingleTestId = null;
|
|
1716
|
-
}
|
|
1717
|
-
}
|
|
1718
|
-
}
|
|
1719
|
-
async function cancelCurrentRun() {
|
|
1720
|
-
if (!running || canceling || cancelRequested) return;
|
|
1721
|
-
canceling = true;
|
|
1722
|
-
try {
|
|
1723
|
-
const ok = await trpc.tests.cancelRun.mutate({ agent });
|
|
1724
|
-
if (ok) cancelRequested = true;
|
|
1725
|
-
} catch (e) {
|
|
1726
|
-
console.error(e);
|
|
1727
|
-
} finally {
|
|
1728
|
-
canceling = false;
|
|
1729
|
-
}
|
|
1730
|
-
}
|
|
1731
|
-
const pinnedCount = tests.filter((t) => t.pinned).length;
|
|
1732
|
-
const hasPinned = pinnedCount > 0;
|
|
1733
|
-
tests.length > 0 && pinnedCount === tests.length;
|
|
1734
|
-
async function addTest() {
|
|
1735
|
-
const res = await trpc.tests.addTest.mutate({ agent, seed: {}, mergeContexts: true });
|
|
1736
|
-
tests = [parseTest(res), ...tests];
|
|
1737
|
-
}
|
|
1738
|
-
function parseTest(res) {
|
|
1739
|
-
return {
|
|
1740
|
-
...res,
|
|
1741
|
-
step: String(res.step ?? ""),
|
|
1742
|
-
pinned: res.pinned === "TRUE",
|
|
1743
|
-
timeout: Number(res.timeout),
|
|
1744
|
-
similarity_threshold: Number(res.similarity_threshold),
|
|
1745
|
-
context: JSON.stringify(res.context),
|
|
1746
|
-
conversation_ui: buildConversationEditorValue(res.conversation || "", res.expected_output || "")
|
|
1747
|
-
};
|
|
1748
|
-
}
|
|
1749
|
-
function formatEvaluation(ev) {
|
|
1750
|
-
if (!ev) return "";
|
|
1751
|
-
try {
|
|
1752
|
-
return ev.replace(/^\s*\d+\s*[:.)-]?\s*(?:[❌✖️✔✅✗xX])?\s*/u, "");
|
|
1753
|
-
} catch {
|
|
1754
|
-
return ev;
|
|
1755
|
-
}
|
|
1756
|
-
}
|
|
1757
|
-
function parseJson(s) {
|
|
1758
|
-
try {
|
|
1759
|
-
return s && s.trim() ? JSON.parse(s) : {};
|
|
1760
|
-
} catch {
|
|
1761
|
-
return {};
|
|
1762
|
-
}
|
|
1763
|
-
}
|
|
1764
|
-
const roleMatch = (line) => line.match(/^\s*(agent|assistant|user|system)\s*:\s*(.*)$/i);
|
|
1765
|
-
function formatExpectedAsAgentBlock(expected) {
|
|
1766
|
-
const trimmed = String(expected ?? "").trimEnd();
|
|
1767
|
-
if (!trimmed) return "";
|
|
1768
|
-
if (/^\s*(agent|assistant)\s*:/i.test(trimmed)) return trimmed;
|
|
1769
|
-
return `Agent: ${trimmed}`;
|
|
1770
|
-
}
|
|
1771
|
-
function buildConversationEditorValue(conversation, expected) {
|
|
1772
|
-
const conv = String(conversation ?? "").trimEnd();
|
|
1773
|
-
const expectedBlock = formatExpectedAsAgentBlock(expected);
|
|
1774
|
-
if (!expectedBlock) return conv;
|
|
1775
|
-
if (!conv) return expectedBlock;
|
|
1776
|
-
return `${conv}
|
|
1777
|
-
${expectedBlock}`;
|
|
1778
|
-
}
|
|
1779
|
-
function parseExpectedFromConversationEditor(text) {
|
|
1780
|
-
const raw = String(text ?? "");
|
|
1781
|
-
const lines = raw.split(/\r?\n/);
|
|
1782
|
-
const blocks = [];
|
|
1783
|
-
let current = null;
|
|
1784
|
-
for (let i = 0; i < lines.length; i++) {
|
|
1785
|
-
const m2 = roleMatch(lines[i]);
|
|
1786
|
-
if (!m2) continue;
|
|
1787
|
-
if (current) {
|
|
1788
|
-
blocks.push({ ...current, endLine: i });
|
|
1789
|
-
}
|
|
1790
|
-
const roleRaw = String(m2[1] ?? "").toLowerCase();
|
|
1791
|
-
const role = roleRaw === "assistant" ? "agent" : roleRaw;
|
|
1792
|
-
current = { role, startLine: i + 1 };
|
|
1793
|
-
}
|
|
1794
|
-
if (current) blocks.push({ ...current, endLine: lines.length });
|
|
1795
|
-
const expectedBlock = blocks.at(-1);
|
|
1796
|
-
const promptBlock = blocks.length >= 2 ? blocks.at(-2) : null;
|
|
1797
|
-
const canExtractExpected = expectedBlock?.role === "agent";
|
|
1798
|
-
const valid = canExtractExpected && promptBlock?.role === "user";
|
|
1799
|
-
if (!canExtractExpected || !expectedBlock) {
|
|
1800
|
-
return { valid: false, expected: "", conversation: raw.trimEnd() };
|
|
1801
|
-
}
|
|
1802
|
-
const expectedLines = lines.slice(expectedBlock.startLine - 1, expectedBlock.endLine);
|
|
1803
|
-
const first = expectedLines[0] ?? "";
|
|
1804
|
-
const m = roleMatch(first);
|
|
1805
|
-
const firstContent = m ? m[2] ?? "" : "";
|
|
1806
|
-
const expected = [firstContent, ...expectedLines.slice(1)].join("\n").trimEnd();
|
|
1807
|
-
const conversation = lines.slice(0, expectedBlock.startLine - 1).join("\n").trimEnd();
|
|
1808
|
-
return {
|
|
1809
|
-
valid,
|
|
1810
|
-
expected,
|
|
1811
|
-
conversation,
|
|
1812
|
-
highlight: {
|
|
1813
|
-
startLine: expectedBlock.startLine,
|
|
1814
|
-
endLine: expectedBlock.endLine
|
|
1815
|
-
}
|
|
1816
|
-
};
|
|
1817
|
-
}
|
|
1818
|
-
function erf(x) {
|
|
1819
|
-
const sign = x < 0 ? -1 : 1;
|
|
1820
|
-
const ax = Math.abs(x);
|
|
1821
|
-
const a1 = 0.254829592;
|
|
1822
|
-
const a2 = -0.284496736;
|
|
1823
|
-
const a3 = 1.421413741;
|
|
1824
|
-
const a4 = -1.453152027;
|
|
1825
|
-
const a5 = 1.061405429;
|
|
1826
|
-
const p = 0.3275911;
|
|
1827
|
-
const t = 1 / (1 + p * ax);
|
|
1828
|
-
const y = 1 - ((((a5 * t + a4) * t + a3) * t + a2) * t + a1) * t * Math.exp(-ax * ax);
|
|
1829
|
-
return sign * y;
|
|
1830
|
-
}
|
|
1831
|
-
function normalCdf(x) {
|
|
1832
|
-
return 0.5 * (1 + erf(x / Math.SQRT2));
|
|
1833
|
-
}
|
|
1834
|
-
function twoProportionZTestPValue(x1, n1, x2, n2) {
|
|
1835
|
-
if (!Number.isFinite(x1) || !Number.isFinite(n1) || !Number.isFinite(x2) || !Number.isFinite(n2)) return null;
|
|
1836
|
-
if (n1 <= 0 || n2 <= 0) return null;
|
|
1837
|
-
const p1 = x1 / n1;
|
|
1838
|
-
const p2 = x2 / n2;
|
|
1839
|
-
const pooled = (x1 + x2) / (n1 + n2);
|
|
1840
|
-
const denom = Math.sqrt(pooled * (1 - pooled) * (1 / n1 + 1 / n2));
|
|
1841
|
-
if (!Number.isFinite(denom) || denom <= 0) return null;
|
|
1842
|
-
const z = (p2 - p1) / denom;
|
|
1843
|
-
const p = 2 * (1 - normalCdf(Math.abs(z)));
|
|
1844
|
-
return Math.max(0, Math.min(1, p));
|
|
1845
|
-
}
|
|
1846
|
-
function getExpectedTrend(result, expectedRuns) {
|
|
1847
|
-
if (!result || result.isOld) return null;
|
|
1848
|
-
const doneRuns = result.total_runs;
|
|
1849
|
-
if (doneRuns <= 0) return null;
|
|
1850
|
-
const prev = result.previous;
|
|
1851
|
-
const prevRate = prev && prev.total_runs > 0 ? prev.success_count / prev.total_runs : null;
|
|
1852
|
-
const currRate = result.successes / doneRuns;
|
|
1853
|
-
const direction = prevRate === null ? "higher" : currRate >= prevRate ? "higher" : "lower";
|
|
1854
|
-
const significant = (() => {
|
|
1855
|
-
if (doneRuns <= 5 || !prev || prev.total_runs <= 0) return false;
|
|
1856
|
-
const pValue = twoProportionZTestPValue(prev.success_count, prev.total_runs, result.successes, doneRuns);
|
|
1857
|
-
return pValue !== null && pValue < 0.05;
|
|
1858
|
-
})();
|
|
1859
|
-
const showExpected = Number.isFinite(expectedRuns) && expectedRuns > 0 && doneRuns < expectedRuns;
|
|
1860
|
-
if (!showExpected && !significant) return null;
|
|
1861
|
-
const expectedSuccesses = showExpected ? Math.round(result.successes / doneRuns * expectedRuns) : void 0;
|
|
1862
|
-
return {
|
|
1863
|
-
showExpected,
|
|
1864
|
-
expectedSuccesses,
|
|
1865
|
-
expectedRuns,
|
|
1866
|
-
significant,
|
|
1867
|
-
direction
|
|
1868
|
-
};
|
|
1869
|
-
}
|
|
1870
|
-
async function saveRow(id, patch) {
|
|
1871
|
-
await trpc.tests.patchTest.mutate({ agent, id, patch });
|
|
1872
|
-
}
|
|
1873
|
-
function openTestContext(row) {
|
|
1874
|
-
if (!agent) return;
|
|
1875
|
-
testContextPopoverTestId = row.id;
|
|
1876
|
-
testContextDraft = safeClone(parseJson(row.context));
|
|
1877
|
-
}
|
|
1878
|
-
async function closeTestContextPopover() {
|
|
1879
|
-
const id = testContextPopoverTestId;
|
|
1880
|
-
if (!id || !agent) {
|
|
1881
|
-
testContextPopoverTestId = null;
|
|
1882
|
-
return;
|
|
1883
|
-
}
|
|
1884
|
-
const draft = safeClone(testContextDraft);
|
|
1885
|
-
testContextPopoverTestId = null;
|
|
1886
|
-
tests = tests.map((t) => t.id === id ? { ...t, context: JSON.stringify(draft) } : t);
|
|
1887
|
-
try {
|
|
1888
|
-
await trackSave(saveRow(id, { context: draft }));
|
|
1889
|
-
} catch (e) {
|
|
1890
|
-
console.error(e);
|
|
1891
|
-
await refresh();
|
|
1892
|
-
}
|
|
1893
|
-
}
|
|
1894
|
-
async function saveConfigPatch(patch) {
|
|
1895
|
-
await trpc.tests.updateConfig.mutate({ agent, cfg: patch });
|
|
1896
|
-
}
|
|
1897
|
-
onDestroy(() => {
|
|
1898
|
-
if (pollTimer) clearInterval(pollTimer);
|
|
1899
|
-
});
|
|
1900
|
-
let $$settled = true;
|
|
1901
|
-
let $$inner_renderer;
|
|
1902
|
-
function $$render_inner($$renderer3) {
|
|
1903
|
-
head($$renderer3, ($$renderer4) => {
|
|
1904
|
-
$$renderer4.push(`<link rel="preload" href="/ui/arrow_tests.svg" as="image"/>`);
|
|
1905
|
-
});
|
|
1906
|
-
{
|
|
1907
|
-
let children = function($$renderer4) {
|
|
1908
|
-
ContextEditor($$renderer4, {
|
|
1909
|
-
class: "h-[70vh]",
|
|
1910
|
-
context: defaultContextDraft,
|
|
1911
|
-
onContextChanged: (ctx) => defaultContextDraft = ctx,
|
|
1912
|
-
suppressErrors: true,
|
|
1913
|
-
defaultFormat: "json",
|
|
1914
|
-
hideHeader: true
|
|
1915
|
-
});
|
|
1916
|
-
}, footer = function($$renderer4) {
|
|
1917
|
-
Button($$renderer4, {
|
|
1918
|
-
variant: "outlined",
|
|
1919
|
-
size: "small",
|
|
1920
|
-
onclick: () => showDefaultContextModal = false,
|
|
1921
|
-
children: ($$renderer5) => {
|
|
1922
|
-
$$renderer5.push(`<!---->Cancel`);
|
|
1923
|
-
},
|
|
1924
|
-
$$slots: { default: true }
|
|
1925
|
-
});
|
|
1926
|
-
$$renderer4.push(`<!----> `);
|
|
1927
|
-
Button($$renderer4, {
|
|
1928
|
-
size: "small",
|
|
1929
|
-
onclick: async () => {
|
|
1930
|
-
defaultContext = defaultContextDraft;
|
|
1931
|
-
await trackSave(saveConfigPatch({ defaultContext }));
|
|
1932
|
-
showDefaultContextModal = false;
|
|
1933
|
-
},
|
|
1934
|
-
children: ($$renderer5) => {
|
|
1935
|
-
$$renderer5.push(`<!---->Save`);
|
|
1936
|
-
},
|
|
1937
|
-
$$slots: { default: true }
|
|
1938
|
-
});
|
|
1939
|
-
$$renderer4.push(`<!---->`);
|
|
1940
|
-
};
|
|
1941
|
-
Modal($$renderer3, {
|
|
1942
|
-
title: "Default Context",
|
|
1943
|
-
get open() {
|
|
1944
|
-
return showDefaultContextModal;
|
|
1945
|
-
},
|
|
1946
|
-
set open($$value) {
|
|
1947
|
-
showDefaultContextModal = $$value;
|
|
1948
|
-
$$settled = false;
|
|
1949
|
-
},
|
|
1950
|
-
children,
|
|
1951
|
-
footer,
|
|
1952
|
-
$$slots: { default: true, footer: true }
|
|
1953
|
-
});
|
|
1954
|
-
}
|
|
1955
|
-
$$renderer3.push(`<!----> `);
|
|
1956
|
-
{
|
|
1957
|
-
let children = function($$renderer4) {
|
|
1958
|
-
{
|
|
1959
|
-
$$renderer4.push("<!--[!-->");
|
|
1960
|
-
{
|
|
1961
|
-
$$renderer4.push("<!--[!-->");
|
|
1962
|
-
$$renderer4.push(`<pre class="whitespace-pre-wrap font-mono text-gray-200">${escape_html("—")}</pre>`);
|
|
1963
|
-
}
|
|
1964
|
-
$$renderer4.push(`<!--]-->`);
|
|
1965
|
-
}
|
|
1966
|
-
$$renderer4.push(`<!--]-->`);
|
|
1967
|
-
}, footer = function($$renderer4) {
|
|
1968
|
-
Button($$renderer4, {
|
|
1969
|
-
variant: "outlined",
|
|
1970
|
-
size: "small",
|
|
1971
|
-
onclick: () => showViewerModal = false,
|
|
1972
|
-
children: ($$renderer5) => {
|
|
1973
|
-
$$renderer5.push(`<!---->Close`);
|
|
1974
|
-
},
|
|
1975
|
-
$$slots: { default: true }
|
|
1976
|
-
});
|
|
1977
|
-
};
|
|
1978
|
-
Modal($$renderer3, {
|
|
1979
|
-
title: viewerTitle,
|
|
1980
|
-
class: "!w-[80vw] !max-w-5xl",
|
|
1981
|
-
get open() {
|
|
1982
|
-
return showViewerModal;
|
|
1983
|
-
},
|
|
1984
|
-
set open($$value) {
|
|
1985
|
-
showViewerModal = $$value;
|
|
1986
|
-
$$settled = false;
|
|
1987
|
-
},
|
|
1988
|
-
children,
|
|
1989
|
-
footer,
|
|
1990
|
-
$$slots: { default: true, footer: true }
|
|
1991
|
-
});
|
|
1992
|
-
}
|
|
1993
|
-
$$renderer3.push(`<!----> <div class="flex h-full min-h-0 flex-col"><div class="flex flex-none items-center justify-between gap-3 border-b border-rc-gray-700 p-2"><div class="flex items-center gap-3">`);
|
|
1994
|
-
Button($$renderer3, {
|
|
1995
|
-
variant: "secondary",
|
|
1996
|
-
disabled: running || isSaving || !agent,
|
|
1997
|
-
onclick: () => {
|
|
1998
|
-
defaultContextDraft = safeClone(defaultContext);
|
|
1999
|
-
showDefaultContextModal = true;
|
|
2000
|
-
},
|
|
2001
|
-
children: ($$renderer4) => {
|
|
2002
|
-
$$renderer4.push(`<!---->Edit default context`);
|
|
2003
|
-
},
|
|
2004
|
-
$$slots: { default: true }
|
|
2005
|
-
});
|
|
2006
|
-
$$renderer3.push(`<!----> <div class="relative inline-flex items-center">`);
|
|
2007
|
-
Button($$renderer3, {
|
|
2008
|
-
variant: "secondary",
|
|
2009
|
-
onclick: addTest,
|
|
2010
|
-
disabled: isSaving || running || !agent,
|
|
2011
|
-
children: ($$renderer4) => {
|
|
2012
|
-
$$renderer4.push(`<!---->New test`);
|
|
2013
|
-
},
|
|
2014
|
-
$$slots: { default: true }
|
|
2015
|
-
});
|
|
2016
|
-
$$renderer3.push(`<!----> `);
|
|
2017
|
-
if (hasFetchedTests && tests.length === 0) {
|
|
2018
|
-
$$renderer3.push("<!--[-->");
|
|
2019
|
-
$$renderer3.push(`<div class="pointer-events-none absolute -left-28 top-full mt-4 inline-flex -translate-x-1/2 flex-col items-center"><div class="relative w-50vw max-w-2xl"><img src="/ui/arrow_tests.svg" alt="Arrow" class="block h-auto w-full object-contain"/> <span class="absolute inset-0 mt-48 flex items-center justify-center text-center text-4xl font-extrabold text-rc-gray-200">No tests yet.<br/>Add the first one</span></div></div>`);
|
|
2020
|
-
} else {
|
|
2021
|
-
$$renderer3.push("<!--[!-->");
|
|
2022
|
-
}
|
|
2023
|
-
$$renderer3.push(`<!--]--></div></div> <div class="flex flex-wrap items-center gap-3">`);
|
|
2024
|
-
if (running) {
|
|
2025
|
-
$$renderer3.push("<!--[-->");
|
|
2026
|
-
$$renderer3.push(`<div class="mr-3 flex items-center gap-3"><span class="animate-pulse rounded bg-rc-green-200 px-3 py-1 text-white">Running… ${escape_html(runDone)}/${escape_html(runTotal)}</span> `);
|
|
2027
|
-
Button($$renderer3, {
|
|
2028
|
-
variant: "secondary",
|
|
2029
|
-
disabled: canceling || cancelRequested,
|
|
2030
|
-
onclick: cancelCurrentRun,
|
|
2031
|
-
children: ($$renderer4) => {
|
|
2032
|
-
$$renderer4.push(`<!---->${escape_html(cancelRequested ? "Cancel requested…" : canceling ? "Canceling…" : "Cancel")}`);
|
|
2033
|
-
},
|
|
2034
|
-
$$slots: { default: true }
|
|
2035
|
-
});
|
|
2036
|
-
$$renderer3.push(`<!----></div>`);
|
|
2037
|
-
} else {
|
|
2038
|
-
$$renderer3.push("<!--[!-->");
|
|
2039
|
-
}
|
|
2040
|
-
$$renderer3.push(`<!--]--> <div class="flex items-center gap-2"><label class="text-rc-gray-300">Repeats</label> `);
|
|
2041
|
-
Input($$renderer3, {
|
|
2042
|
-
type: "number",
|
|
2043
|
-
min: "0",
|
|
2044
|
-
max: "500",
|
|
2045
|
-
class: "w-16",
|
|
2046
|
-
onchange: () => {
|
|
2047
|
-
repeats = clamp(+repeats || 0, 0, 500);
|
|
2048
|
-
trackSave(saveConfigPatch({ repeats }));
|
|
2049
|
-
},
|
|
2050
|
-
get value() {
|
|
2051
|
-
return repeats;
|
|
2052
|
-
},
|
|
2053
|
-
set value($$value) {
|
|
2054
|
-
repeats = $$value;
|
|
2055
|
-
$$settled = false;
|
|
2056
|
-
}
|
|
2057
|
-
});
|
|
2058
|
-
$$renderer3.push(`<!----></div> <div class="flex items-center gap-2"><label class="text-rc-gray-300">Concurrency</label> `);
|
|
2059
|
-
Input($$renderer3, {
|
|
2060
|
-
type: "number",
|
|
2061
|
-
min: "0",
|
|
2062
|
-
max: "20",
|
|
2063
|
-
class: "w-16",
|
|
2064
|
-
onchange: () => {
|
|
2065
|
-
concurrency = clamp(+concurrency || 0, 0, 20);
|
|
2066
|
-
trackSave(saveConfigPatch({ concurrency }));
|
|
2067
|
-
},
|
|
2068
|
-
get value() {
|
|
2069
|
-
return concurrency;
|
|
2070
|
-
},
|
|
2071
|
-
set value($$value) {
|
|
2072
|
-
concurrency = $$value;
|
|
2073
|
-
$$settled = false;
|
|
2074
|
-
}
|
|
2075
|
-
});
|
|
2076
|
-
$$renderer3.push(`<!----></div> `);
|
|
2077
|
-
Button($$renderer3, {
|
|
2078
|
-
class: "disabled:cursor-not-allowed disabled:opacity-50",
|
|
2079
|
-
disabled: running || isSaving || tests.length === 0 || hasPinned && pinnedCount === 0,
|
|
2080
|
-
onclick: () => run(hasPinned ? "pinned" : "all"),
|
|
2081
|
-
children: ($$renderer4) => {
|
|
2082
|
-
$$renderer4.push(`<!---->▶ ${escape_html(hasPinned ? "Run pinned" : "Run all")}`);
|
|
2083
|
-
},
|
|
2084
|
-
$$slots: { default: true }
|
|
2085
|
-
});
|
|
2086
|
-
$$renderer3.push(`<!----></div></div> <div class="min-h-0 flex-1 overflow-hidden p-2">`);
|
|
2087
|
-
Panel($$renderer3, {
|
|
2088
|
-
class: "relative flex h-full min-w-0 flex-col overflow-hidden !rounded-none p-0",
|
|
2089
|
-
children: ($$renderer4) => {
|
|
2090
|
-
$$renderer4.push(`<div class="rc-scroll min-h-0 flex-1 overflow-auto"><div class="grid grid-cols-[2.25rem,1fr] items-center gap-2 border-b border-rc-gray-700 p-2"><button${attr_class(
|
|
2091
|
-
`icon-btn justify-self-center ${stringify(hasPinned ? "text-rc-green-350 hover:text-rc-green-250" : "text-gray-300 hover:text-gray-100")}`,
|
|
2092
|
-
"svelte-rdft55"
|
|
2093
|
-
)} aria-label="Pin/unpin all" title="Pin/unpin all"${attr("disabled", running || isSaving || tests.length === 0, true)}>`);
|
|
2094
|
-
Icon($$renderer4, {
|
|
2095
|
-
class: "block",
|
|
2096
|
-
icon: hasPinned ? "mdi:pin" : "mdi:pin-outline",
|
|
2097
|
-
width: 18,
|
|
2098
|
-
height: 18
|
|
2099
|
-
});
|
|
2100
|
-
$$renderer4.push(`<!----></button> <span class="text-left text-rc-gray-300">Pinned: ${escape_html(pinnedCount)}/${escape_html(tests.length)}</span></div> `);
|
|
2101
|
-
if (!hasFetchedTests) {
|
|
2102
|
-
$$renderer4.push("<!--[-->");
|
|
2103
|
-
$$renderer4.push(`<div class="p-3 text-gray-400">Loading tests…</div>`);
|
|
2104
|
-
} else {
|
|
2105
|
-
$$renderer4.push("<!--[!-->");
|
|
2106
|
-
if (tests.length === 0) {
|
|
2107
|
-
$$renderer4.push("<!--[-->");
|
|
2108
|
-
$$renderer4.push(`<div class="p-3 text-gray-400">—</div>`);
|
|
2109
|
-
} else {
|
|
2110
|
-
$$renderer4.push("<!--[!-->");
|
|
2111
|
-
$$renderer4.push(`<div class="flex flex-col space-y-5"><!--[-->`);
|
|
2112
|
-
const each_array = ensure_array_like(tests);
|
|
2113
|
-
for (let i = 0, $$length = each_array.length; i < $$length; i++) {
|
|
2114
|
-
let t = each_array[i];
|
|
2115
|
-
const expectedInfo = parseExpectedFromConversationEditor(t.conversation_ui);
|
|
2116
|
-
$$renderer4.push(`<div class="border-b border-rc-gray-700 p-2"${attr("data-id", t.id)}><div class="grid grid-cols-[2.25rem,1fr] gap-2"><div class="flex flex-col items-center gap-1"><button${attr_class(
|
|
2117
|
-
`icon-btn ${stringify(t.pinned ? "text-rc-green-350 hover:text-rc-green-250" : "text-gray-300 hover:text-gray-100")}`,
|
|
2118
|
-
"svelte-rdft55"
|
|
2119
|
-
)}${attr("aria-label", t.pinned ? "Unpin" : "Pin")}${attr("title", t.pinned ? "Unpin" : "Pin")}${attr("disabled", running || isSaving, true)}>`);
|
|
2120
|
-
Icon($$renderer4, {
|
|
2121
|
-
class: "block",
|
|
2122
|
-
icon: t.pinned ? "mdi:pin" : "mdi:pin-outline",
|
|
2123
|
-
width: 18,
|
|
2124
|
-
height: 18
|
|
2125
|
-
});
|
|
2126
|
-
$$renderer4.push(`<!----></button> <button title="Duplicate" class="icon-btn text-gray-300 hover:text-gray-100 disabled:cursor-not-allowed disabled:opacity-50 svelte-rdft55"${attr("disabled", running || isSaving, true)}>`);
|
|
2127
|
-
Icon($$renderer4, { icon: "mdi:content-copy", width: 18, height: 18 });
|
|
2128
|
-
$$renderer4.push(`<!----></button> <button title="Delete" class="icon-btn text-gray-300 hover:text-gray-100 disabled:cursor-not-allowed disabled:opacity-50 svelte-rdft55"${attr("disabled", running || isSaving, true)}>`);
|
|
2129
|
-
Icon($$renderer4, { icon: "mdi:trash-can-outline", width: 18, height: 18 });
|
|
2130
|
-
$$renderer4.push(`<!----></button></div> <div class="min-w-0"><div${attr_class(`left-details-bg flex flex-col rounded border ${expectedInfo.valid ? "border-rc-gray-700" : "border-rc-red-600"}`, "svelte-rdft55")}><div class="left-details-bg sticky top-0 z-10 rounded-t border-b border-rc-gray-700 px-2 pb-1 pt-2 svelte-rdft55"><input class="card-input-title svelte-rdft55" type="text" placeholder="Scenario"${attr("value", t.scenario)}/></div> <div class="flex flex-col gap-2 p-2">`);
|
|
2131
|
-
if (!expectedInfo.valid) {
|
|
2132
|
-
$$renderer4.push("<!--[-->");
|
|
2133
|
-
$$renderer4.push(`<div class="text-rc-red-600">Invalid test: expected must be the last block (“Agent: …”), with a prompt
|
|
2134
|
-
“User: …” block right above it</div>`);
|
|
2135
|
-
} else {
|
|
2136
|
-
$$renderer4.push("<!--[!-->");
|
|
2137
|
-
}
|
|
2138
|
-
$$renderer4.push(`<!--]--> <input class="card-input-subtle svelte-rdft55" type="text" placeholder="Author"${attr("value", t.author)}/> <div class="flex items-center gap-2">`);
|
|
2139
|
-
$$renderer4.select(
|
|
2140
|
-
{
|
|
2141
|
-
class: "rc-scroll rc-input w-36",
|
|
2142
|
-
value: t.assertion_type,
|
|
2143
|
-
"aria-label": "Assertion Type",
|
|
2144
|
-
onchange: () => saveRow(t.id, { assertion_type: t.assertion_type })
|
|
2145
|
-
},
|
|
2146
|
-
($$renderer5) => {
|
|
2147
|
-
$$renderer5.push(`<!--[-->`);
|
|
2148
|
-
const each_array_1 = ensure_array_like(assertionTypes);
|
|
2149
|
-
for (let $$index = 0, $$length2 = each_array_1.length; $$index < $$length2; $$index++) {
|
|
2150
|
-
let opt = each_array_1[$$index];
|
|
2151
|
-
$$renderer5.option({ value: opt.value }, ($$renderer6) => {
|
|
2152
|
-
$$renderer6.push(`${escape_html(opt.label)}`);
|
|
2153
|
-
});
|
|
2154
|
-
}
|
|
2155
|
-
$$renderer5.push(`<!--]-->`);
|
|
2156
|
-
},
|
|
2157
|
-
"svelte-rdft55"
|
|
2158
|
-
);
|
|
2159
|
-
$$renderer4.push(` <input class="rc-input min-w-0 flex-1 svelte-rdft55" type="text"${attr("value", t.assertion_value)} placeholder="Assertion value"/></div> <div class="flex flex-wrap items-center gap-3"><div class="flex items-center gap-2"><span class="text-rc-gray-300">Timeout (s)</span> <input class="rc-input no-spin w-16 svelte-rdft55" type="number" min="0" max="999"${attr("value", t.timeout)} placeholder="Timeout"/></div> <div class="flex items-center gap-2"><span class="text-rc-gray-300">Similarity (%)</span> <input class="rc-input no-spin w-16 svelte-rdft55" type="number" min="0" max="100"${attr("value", t.similarity_threshold)} placeholder="Similarity (%)"/></div> `);
|
|
2160
|
-
Button($$renderer4, {
|
|
2161
|
-
variant: "secondary",
|
|
2162
|
-
size: "small",
|
|
2163
|
-
disabled: running || isSaving,
|
|
2164
|
-
onclick: () => openTestContext(t),
|
|
2165
|
-
children: ($$renderer5) => {
|
|
2166
|
-
$$renderer5.push(`<!---->Edit context`);
|
|
2167
|
-
},
|
|
2168
|
-
$$slots: { default: true }
|
|
2169
|
-
});
|
|
2170
|
-
$$renderer4.push(`<!----></div> `);
|
|
2171
|
-
MiniEditor($$renderer4, {
|
|
2172
|
-
value: t.conversation_ui,
|
|
2173
|
-
highlights: expectedInfo.highlight ? [
|
|
2174
|
-
{
|
|
2175
|
-
startLine: expectedInfo.highlight.startLine,
|
|
2176
|
-
endLine: expectedInfo.highlight.endLine,
|
|
2177
|
-
className: "test-expected-output"
|
|
2178
|
-
}
|
|
2179
|
-
] : void 0,
|
|
2180
|
-
height: 220
|
|
2181
|
-
});
|
|
2182
|
-
$$renderer4.push(`<!----></div> <div class="rounded-b border-t border-rc-gray-700 bg-rc-gray-980 p-2"><div class="flex flex-wrap items-center gap-3">`);
|
|
2183
|
-
Button($$renderer4, {
|
|
2184
|
-
size: "small",
|
|
2185
|
-
disabled: running || isSaving || !expectedInfo.valid,
|
|
2186
|
-
title: !expectedInfo.valid ? "Expected must be the last block (“Agent: …”) and there must be a prompt “User: …” block right above it" : "Run",
|
|
2187
|
-
onclick: () => runSingle(t.id),
|
|
2188
|
-
children: ($$renderer5) => {
|
|
2189
|
-
$$renderer5.push(`<!---->▶ Run`);
|
|
2190
|
-
},
|
|
2191
|
-
$$slots: { default: true }
|
|
2192
|
-
});
|
|
2193
|
-
$$renderer4.push(`<!----> `);
|
|
2194
|
-
if (t.result) {
|
|
2195
|
-
$$renderer4.push("<!--[-->");
|
|
2196
|
-
const trend = getExpectedTrend(t.result, runExpectedRuns);
|
|
2197
|
-
$$renderer4.push(`<div class="text-lg font-extrabold"><span class="text-rc-gray-200">${escape_html(t.result.successes)}/${escape_html(t.result.total_runs)}</span> `);
|
|
2198
|
-
if (trend?.showExpected) {
|
|
2199
|
-
$$renderer4.push("<!--[-->");
|
|
2200
|
-
$$renderer4.push(`<span class="ml-2 text-rc-gray-400">(${escape_html(trend.expectedSuccesses)}/${escape_html(trend.expectedRuns)} expected)</span>`);
|
|
2201
|
-
} else {
|
|
2202
|
-
$$renderer4.push("<!--[!-->");
|
|
2203
|
-
}
|
|
2204
|
-
$$renderer4.push(`<!--]--> `);
|
|
2205
|
-
if (trend?.significant) {
|
|
2206
|
-
$$renderer4.push("<!--[-->");
|
|
2207
|
-
$$renderer4.push(`<span${attr_class(`ml-2 whitespace-nowrap font-semibold ${trend.direction === "higher" ? "text-rc-green-200" : "text-rc-red-600"}`, "svelte-rdft55")}>`);
|
|
2208
|
-
Icon$1($$renderer4, {
|
|
2209
|
-
name: trend.direction === "higher" ? "chevron-up" : "chevron-down",
|
|
2210
|
-
width: 18,
|
|
2211
|
-
height: 18,
|
|
2212
|
-
class: "inline-block align-text-bottom"
|
|
2213
|
-
});
|
|
2214
|
-
$$renderer4.push(`<!----><span class="ml-1">significant</span></span>`);
|
|
2215
|
-
} else {
|
|
2216
|
-
$$renderer4.push("<!--[!-->");
|
|
2217
|
-
}
|
|
2218
|
-
$$renderer4.push(`<!--]--> `);
|
|
2219
|
-
if (t.result.isOld) {
|
|
2220
|
-
$$renderer4.push("<!--[-->");
|
|
2221
|
-
$$renderer4.push(`<span class="text-rc-gray-400">(old)</span>`);
|
|
2222
|
-
} else {
|
|
2223
|
-
$$renderer4.push("<!--[!-->");
|
|
2224
|
-
}
|
|
2225
|
-
$$renderer4.push(`<!--]--></div>`);
|
|
2226
|
-
} else {
|
|
2227
|
-
$$renderer4.push("<!--[!-->");
|
|
2228
|
-
}
|
|
2229
|
-
$$renderer4.push(`<!--]--></div> `);
|
|
2230
|
-
if (t.result) {
|
|
2231
|
-
$$renderer4.push("<!--[-->");
|
|
2232
|
-
$$renderer4.push(`<div class="mt-3 flex flex-col gap-4"><!--[-->`);
|
|
2233
|
-
const each_array_2 = ensure_array_like(t.result.runs);
|
|
2234
|
-
for (let $$index_1 = 0, $$length2 = each_array_2.length; $$index_1 < $$length2; $$index_1++) {
|
|
2235
|
-
let run2 = each_array_2[$$index_1];
|
|
2236
|
-
$$renderer4.push(`<div class="flex flex-col gap-2"><div${attr_class(`w-full whitespace-pre-wrap break-words rounded-lg px-3 py-2 text-rc-gray-100 ${run2.success ? "bg-rc-green-700 backdrop-blur-md" : ""}`, "svelte-rdft55")}${attr_style(!run2.success ? "background-color: rgb(156 80 80)" : "")}>${escape_html(run2.text || "—")}</div> <div${attr_class(`flex w-full flex-col gap-x-4 whitespace-pre-wrap break-words ${run2.success ? "text-rc-green-200" : "text-rc-red-800"}`, "svelte-rdft55")}><div class="flex items-center gap-0">`);
|
|
2237
|
-
if (run2.success) {
|
|
2238
|
-
$$renderer4.push("<!--[-->");
|
|
2239
|
-
Icon$1($$renderer4, {
|
|
2240
|
-
name: "checkmark",
|
|
2241
|
-
width: 20,
|
|
2242
|
-
height: 20,
|
|
2243
|
-
class: "shrink-0 self-end"
|
|
2244
|
-
});
|
|
2245
|
-
} else {
|
|
2246
|
-
$$renderer4.push("<!--[!-->");
|
|
2247
|
-
Icon$1($$renderer4, {
|
|
2248
|
-
name: "close",
|
|
2249
|
-
width: 18,
|
|
2250
|
-
height: 18,
|
|
2251
|
-
class: "shrink-0 scale-110 self-start"
|
|
2252
|
-
});
|
|
2253
|
-
}
|
|
2254
|
-
$$renderer4.push(`<!--]--> <span>${escape_html(run2.success ? "Pass" : formatEvaluation(run2.evaluation) || "Fail")}</span></div> <div class="mt-1 flex flex-wrap items-center gap-x-4"><button type="button" class="pseudolink svelte-rdft55">Rendered prompt</button> <button type="button" class="pseudolink svelte-rdft55">Received prompt</button> <button type="button" class="pseudolink svelte-rdft55">Conversation</button> <button type="button" class="pseudolink svelte-rdft55">Context</button> <button type="button" class="pseudolink svelte-rdft55">Logs</button> <button type="button" class="pseudolink svelte-rdft55">Traces</button> <button type="button" class="pseudolink svelte-rdft55"${attr("disabled", analyzeRunning, true)}>Analyze</button></div></div></div>`);
|
|
2255
|
-
}
|
|
2256
|
-
$$renderer4.push(`<!--]--></div>`);
|
|
2257
|
-
} else {
|
|
2258
|
-
$$renderer4.push("<!--[!-->");
|
|
2259
|
-
}
|
|
2260
|
-
$$renderer4.push(`<!--]--></div></div></div></div></div>`);
|
|
2261
|
-
}
|
|
2262
|
-
$$renderer4.push(`<!--]--></div>`);
|
|
2263
|
-
}
|
|
2264
|
-
$$renderer4.push(`<!--]-->`);
|
|
2265
|
-
}
|
|
2266
|
-
$$renderer4.push(`<!--]--></div> `);
|
|
2267
|
-
if (testContextPopoverTestId) {
|
|
2268
|
-
$$renderer4.push("<!--[-->");
|
|
2269
|
-
const row = tests.find((t) => t.id === testContextPopoverTestId);
|
|
2270
|
-
{
|
|
2271
|
-
let children = function($$renderer5) {
|
|
2272
|
-
$$renderer5.push(`<div class="min-h-0 flex-1 overflow-hidden p-3"><!---->`);
|
|
2273
|
-
{
|
|
2274
|
-
ContextEditor($$renderer5, {
|
|
2275
|
-
class: "h-full min-h-0 border-thin border-rc-gray-650 shadow-inner-white-soft backdrop-blur-3xl",
|
|
2276
|
-
context: testContextDraft,
|
|
2277
|
-
suppressErrors: true,
|
|
2278
|
-
defaultFormat: "yaml",
|
|
2279
|
-
hideHeader: true,
|
|
2280
|
-
onContextChanged: (ctx) => testContextDraft = ctx
|
|
2281
|
-
});
|
|
2282
|
-
}
|
|
2283
|
-
$$renderer5.push(`<!----></div>`);
|
|
2284
|
-
};
|
|
2285
|
-
PopoverModal($$renderer4, {
|
|
2286
|
-
title: `Test context — ${row?.scenario || "Test"}`,
|
|
2287
|
-
onClose: () => void closeTestContextPopover(),
|
|
2288
|
-
children
|
|
2289
|
-
});
|
|
2290
|
-
}
|
|
2291
|
-
} else {
|
|
2292
|
-
$$renderer4.push("<!--[!-->");
|
|
2293
|
-
}
|
|
2294
|
-
$$renderer4.push(`<!--]-->`);
|
|
2295
|
-
}
|
|
2296
|
-
});
|
|
2297
|
-
$$renderer3.push(`<!----></div></div>`);
|
|
2298
|
-
}
|
|
2299
|
-
do {
|
|
2300
|
-
$$settled = true;
|
|
2301
|
-
$$inner_renderer = $$renderer2.copy();
|
|
2302
|
-
$$render_inner($$inner_renderer);
|
|
2303
|
-
} while (!$$settled);
|
|
2304
|
-
$$renderer2.subsume($$inner_renderer);
|
|
2305
|
-
});
|
|
2306
|
-
}
|
|
2307
|
-
|
|
2308
|
-
export { _page as default };
|
|
2309
|
-
//# sourceMappingURL=_page.svelte-C1YaC_Qg.js.map
|