@recombine-ai/bosun 0.9.1 → 0.10.1
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/.svelte-kit/tsconfig.json +8 -1
- package/README.md +2 -0
- package/bin/bosun.js +198 -12
- package/build/client/_app/immutable/assets/0.B4t3dozz.css +1 -0
- package/build/client/_app/immutable/assets/0.B4t3dozz.css.br +0 -0
- package/build/client/_app/immutable/assets/0.B4t3dozz.css.gz +0 -0
- package/build/client/_app/immutable/chunks/7E8m6dwk.js +1 -0
- package/build/client/_app/immutable/chunks/7E8m6dwk.js.br +0 -0
- package/build/client/_app/immutable/chunks/7E8m6dwk.js.gz +0 -0
- package/build/client/_app/immutable/chunks/7qRqthsa.js +1 -0
- package/build/client/_app/immutable/chunks/7qRqthsa.js.br +2 -0
- package/build/client/_app/immutable/chunks/7qRqthsa.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Ajb1KYIn.js +1 -0
- package/build/client/_app/immutable/chunks/Ajb1KYIn.js.br +0 -0
- package/build/client/_app/immutable/chunks/Ajb1KYIn.js.gz +0 -0
- package/build/client/_app/immutable/chunks/B0iEglSe.js +1 -0
- package/build/client/_app/immutable/chunks/B0iEglSe.js.br +0 -0
- package/build/client/_app/immutable/chunks/B0iEglSe.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{B394X4Dm.js → BIpSIzUr.js} +1 -1
- package/build/client/_app/immutable/chunks/BIpSIzUr.js.br +0 -0
- package/build/client/_app/immutable/chunks/BIpSIzUr.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BM0jKynj.js +1 -0
- package/build/client/_app/immutable/chunks/BM0jKynj.js.br +0 -0
- package/build/client/_app/immutable/chunks/BM0jKynj.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BTvePR6r.js +1 -0
- package/build/client/_app/immutable/chunks/BTvePR6r.js.br +2 -0
- package/build/client/_app/immutable/chunks/BTvePR6r.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bcu62lFq.js +1 -0
- package/build/client/_app/immutable/chunks/Bcu62lFq.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bcu62lFq.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BwtfALfL.js +11 -0
- package/build/client/_app/immutable/chunks/BwtfALfL.js.br +0 -0
- package/build/client/_app/immutable/chunks/BwtfALfL.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BxsDwlgp.js +4 -0
- package/build/client/_app/immutable/chunks/BxsDwlgp.js.br +0 -0
- package/build/client/_app/immutable/chunks/BxsDwlgp.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C-whEtKd.js +1 -0
- package/build/client/_app/immutable/chunks/C-whEtKd.js.br +2 -0
- package/build/client/_app/immutable/chunks/C-whEtKd.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C1WqE8CP.js +1 -0
- package/build/client/_app/immutable/chunks/C1WqE8CP.js.br +2 -0
- package/build/client/_app/immutable/chunks/C1WqE8CP.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C4D-JXnS.js +1 -0
- package/build/client/_app/immutable/chunks/C4D-JXnS.js.br +0 -0
- package/build/client/_app/immutable/chunks/C4D-JXnS.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C4SnSfql.js +1 -0
- package/build/client/_app/immutable/chunks/C4SnSfql.js.br +0 -0
- package/build/client/_app/immutable/chunks/C4SnSfql.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CF66fWJN.js +1 -0
- package/build/client/_app/immutable/chunks/CF66fWJN.js.br +0 -0
- package/build/client/_app/immutable/chunks/CF66fWJN.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{CZNq9Fp2.js → CNLU4B3p.js} +1 -1
- package/build/client/_app/immutable/chunks/CNLU4B3p.js.br +0 -0
- package/build/client/_app/immutable/chunks/CNLU4B3p.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CXo2BVs0.js +1 -0
- package/build/client/_app/immutable/chunks/CXo2BVs0.js.br +0 -0
- package/build/client/_app/immutable/chunks/CXo2BVs0.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CZLNSMhF.js +33 -0
- package/build/client/_app/immutable/chunks/CZLNSMhF.js.br +0 -0
- package/build/client/_app/immutable/chunks/CZLNSMhF.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CqO5tR2_.js +1 -0
- package/build/client/_app/immutable/chunks/CqO5tR2_.js.br +0 -0
- package/build/client/_app/immutable/chunks/CqO5tR2_.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CqxCTxvJ.js +1 -0
- package/build/client/_app/immutable/chunks/CqxCTxvJ.js.br +0 -0
- package/build/client/_app/immutable/chunks/CqxCTxvJ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D-wf2QNc.js +1 -0
- package/build/client/_app/immutable/chunks/D-wf2QNc.js.br +0 -0
- package/build/client/_app/immutable/chunks/D-wf2QNc.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D4obUD_s.js +1 -0
- package/build/client/_app/immutable/chunks/D4obUD_s.js.br +0 -0
- package/build/client/_app/immutable/chunks/D4obUD_s.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D8e7SQh9.js +1 -0
- package/build/client/_app/immutable/chunks/D8e7SQh9.js.br +0 -0
- package/build/client/_app/immutable/chunks/D8e7SQh9.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DNLcpWO_.js +1 -0
- package/build/client/_app/immutable/chunks/DNLcpWO_.js.br +0 -0
- package/build/client/_app/immutable/chunks/DNLcpWO_.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DTXUDKH5.js +8 -0
- package/build/client/_app/immutable/chunks/DTXUDKH5.js.br +0 -0
- package/build/client/_app/immutable/chunks/DTXUDKH5.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DYhTBLDc.js +2 -0
- package/build/client/_app/immutable/chunks/DYhTBLDc.js.br +0 -0
- package/build/client/_app/immutable/chunks/DYhTBLDc.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DhBm2Vx9.js +1 -0
- package/build/client/_app/immutable/chunks/DhBm2Vx9.js.br +0 -0
- package/build/client/_app/immutable/chunks/DhBm2Vx9.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Dp760K13.js +2 -0
- package/build/client/_app/immutable/chunks/Dp760K13.js.br +0 -0
- package/build/client/_app/immutable/chunks/Dp760K13.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Dv0gjm25.js +1 -0
- package/build/client/_app/immutable/chunks/Dv0gjm25.js.br +0 -0
- package/build/client/_app/immutable/chunks/Dv0gjm25.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Dv8m1cTI.js +1 -0
- package/build/client/_app/immutable/chunks/Dv8m1cTI.js.br +0 -0
- package/build/client/_app/immutable/chunks/Dv8m1cTI.js.gz +0 -0
- package/build/client/_app/immutable/chunks/HJHYLHDn.js +1 -0
- package/build/client/_app/immutable/chunks/HJHYLHDn.js.br +0 -0
- package/build/client/_app/immutable/chunks/HJHYLHDn.js.gz +0 -0
- package/build/client/_app/immutable/chunks/HXxIsSOO.js +1 -0
- package/build/client/_app/immutable/chunks/HXxIsSOO.js.br +0 -0
- package/build/client/_app/immutable/chunks/HXxIsSOO.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{8mHyIC1B.js → JcG4w2gF.js} +1 -1
- package/build/client/_app/immutable/chunks/JcG4w2gF.js.br +0 -0
- package/build/client/_app/immutable/chunks/JcG4w2gF.js.gz +0 -0
- package/build/client/_app/immutable/chunks/OA8UcISh.js +1 -0
- package/build/client/_app/immutable/chunks/OA8UcISh.js.br +0 -0
- package/build/client/_app/immutable/chunks/OA8UcISh.js.gz +0 -0
- package/build/client/_app/immutable/chunks/T0seCQS_.js +1 -0
- package/build/client/_app/immutable/chunks/T0seCQS_.js.br +0 -0
- package/build/client/_app/immutable/chunks/T0seCQS_.js.gz +0 -0
- package/build/client/_app/immutable/chunks/_yZg6Sf-.js +2 -0
- package/build/client/_app/immutable/chunks/_yZg6Sf-.js.br +0 -0
- package/build/client/_app/immutable/chunks/_yZg6Sf-.js.gz +0 -0
- package/build/client/_app/immutable/chunks/gULlE0tz.js +1 -0
- package/build/client/_app/immutable/chunks/gULlE0tz.js.br +2 -0
- package/build/client/_app/immutable/chunks/gULlE0tz.js.gz +0 -0
- package/build/client/_app/immutable/chunks/xC2C8d09.js +1 -0
- package/build/client/_app/immutable/chunks/xC2C8d09.js.br +0 -0
- package/build/client/_app/immutable/chunks/xC2C8d09.js.gz +0 -0
- package/build/client/_app/immutable/chunks/xebNt8-Z.js +1 -0
- package/build/client/_app/immutable/chunks/xebNt8-Z.js.br +0 -0
- package/build/client/_app/immutable/chunks/xebNt8-Z.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.C4wJtvtH.js +2 -0
- package/build/client/_app/immutable/entry/app.C4wJtvtH.js.br +0 -0
- package/build/client/_app/immutable/entry/app.C4wJtvtH.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.BId2vqhS.js +1 -0
- package/build/client/_app/immutable/entry/start.BId2vqhS.js.br +2 -0
- package/build/client/_app/immutable/entry/start.BId2vqhS.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{0.cfpwGp_4.js → 0.BCmKHiYo.js} +2 -2
- package/build/client/_app/immutable/nodes/0.BCmKHiYo.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.BCmKHiYo.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.8skEZBEw.js +1 -0
- package/build/client/_app/immutable/nodes/1.8skEZBEw.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.8skEZBEw.js.gz +0 -0
- package/build/client/_app/immutable/nodes/10.YgmBfSWN.js +5 -0
- package/build/client/_app/immutable/nodes/10.YgmBfSWN.js.br +0 -0
- package/build/client/_app/immutable/nodes/10.YgmBfSWN.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{11.BVI-eEdV.js → 11.CsTD16Gn.js} +1 -1
- package/build/client/_app/immutable/nodes/11.CsTD16Gn.js.br +0 -0
- package/build/client/_app/immutable/nodes/11.CsTD16Gn.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{12.BHSGZYEC.js → 12.DYXd_leK.js} +1 -1
- package/build/client/_app/immutable/nodes/12.DYXd_leK.js.br +0 -0
- package/build/client/_app/immutable/nodes/12.DYXd_leK.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{13.CZ_7M4AF.js → 13.DQMjAUKq.js} +1 -1
- package/build/client/_app/immutable/nodes/13.DQMjAUKq.js.br +1 -0
- package/build/client/_app/immutable/nodes/13.DQMjAUKq.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{14.D96_XEm-.js → 14.C59tyoG0.js} +1 -1
- package/build/client/_app/immutable/nodes/14.C59tyoG0.js.br +0 -0
- package/build/client/_app/immutable/nodes/14.C59tyoG0.js.gz +0 -0
- package/build/client/_app/immutable/nodes/15.Wmhj7gOy.js +1 -0
- package/build/client/_app/immutable/nodes/15.Wmhj7gOy.js.br +0 -0
- package/build/client/_app/immutable/nodes/15.Wmhj7gOy.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{16.MpUk9w5x.js → 16.DRwcAQjb.js} +1 -1
- package/build/client/_app/immutable/nodes/16.DRwcAQjb.js.br +0 -0
- package/build/client/_app/immutable/nodes/16.DRwcAQjb.js.gz +0 -0
- package/build/client/_app/immutable/nodes/17.D8ydco6g.js +3 -0
- package/build/client/_app/immutable/nodes/17.D8ydco6g.js.br +0 -0
- package/build/client/_app/immutable/nodes/17.D8ydco6g.js.gz +0 -0
- package/build/client/_app/immutable/nodes/18.C67CqGm5.js +11 -0
- package/build/client/_app/immutable/nodes/18.C67CqGm5.js.br +0 -0
- package/build/client/_app/immutable/nodes/18.C67CqGm5.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.BdQ4KFOK.js +35 -0
- package/build/client/_app/immutable/nodes/2.BdQ4KFOK.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.BdQ4KFOK.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.nCmkz6kS.js +1 -0
- package/build/client/_app/immutable/nodes/3.nCmkz6kS.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.nCmkz6kS.js.gz +0 -0
- package/build/client/_app/immutable/nodes/4.DAwO0_Am.js +1 -0
- package/build/client/_app/immutable/nodes/4.DAwO0_Am.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.DAwO0_Am.js.gz +0 -0
- package/build/client/_app/immutable/nodes/5.C_SvvZjG.js +1 -0
- package/build/client/_app/immutable/nodes/5.C_SvvZjG.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.C_SvvZjG.js.gz +0 -0
- package/build/client/_app/immutable/nodes/6.DfOe9lph.js +1 -0
- package/build/client/_app/immutable/nodes/6.DfOe9lph.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.DfOe9lph.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{7.CkeP1yO3.js → 7.7N4iPidV.js} +1 -1
- package/build/client/_app/immutable/nodes/7.7N4iPidV.js.br +1 -0
- package/build/client/_app/immutable/nodes/7.7N4iPidV.js.gz +0 -0
- package/build/client/_app/immutable/nodes/8.DWNYX1kH.js +2 -0
- package/build/client/_app/immutable/nodes/8.DWNYX1kH.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.DWNYX1kH.js.gz +0 -0
- package/build/client/_app/immutable/nodes/9.D7SG4T7Z.js +2 -0
- package/build/client/_app/immutable/nodes/9.D7SG4T7Z.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.D7SG4T7Z.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-D5BNSI7t.js +9 -0
- package/build/server/chunks/0-D5BNSI7t.js.map +1 -0
- package/build/server/chunks/1-C1mGPV-S.js +9 -0
- package/build/server/chunks/{1--P6amfWt.js.map → 1-C1mGPV-S.js.map} +1 -1
- package/build/server/chunks/10-BUo1e_HG.js +9 -0
- package/build/server/chunks/10-BUo1e_HG.js.map +1 -0
- package/build/server/chunks/{11-D9ueFvgV.js → 11-CB5q84io.js} +3 -3
- package/build/server/chunks/{11-D9ueFvgV.js.map → 11-CB5q84io.js.map} +1 -1
- package/build/server/chunks/{12-s9qxLZI8.js → 12-CfqC_Y1R.js} +3 -3
- package/build/server/chunks/{12-s9qxLZI8.js.map → 12-CfqC_Y1R.js.map} +1 -1
- package/build/server/chunks/{13-DSBw3elU.js → 13-ByddfU7G.js} +3 -3
- package/build/server/chunks/{13-DSBw3elU.js.map → 13-ByddfU7G.js.map} +1 -1
- package/build/server/chunks/{14-Dys1MDrz.js → 14-Dk7DCwHC.js} +3 -3
- package/build/server/chunks/{14-Dys1MDrz.js.map → 14-Dk7DCwHC.js.map} +1 -1
- package/build/server/chunks/15-CZBxPMAc.js +9 -0
- package/build/server/chunks/15-CZBxPMAc.js.map +1 -0
- package/build/server/chunks/{16-BRBiMoCX.js → 16-Y9KLA9UF.js} +3 -3
- package/build/server/chunks/{16-BRBiMoCX.js.map → 16-Y9KLA9UF.js.map} +1 -1
- package/build/server/chunks/17-iNFqG1My.js +9 -0
- package/build/server/chunks/17-iNFqG1My.js.map +1 -0
- package/build/server/chunks/18-u8T5X6fM.js +9 -0
- package/build/server/chunks/18-u8T5X6fM.js.map +1 -0
- package/build/server/chunks/2-tLlSByHA.js +9 -0
- package/build/server/chunks/2-tLlSByHA.js.map +1 -0
- package/build/server/chunks/3-D1KY9yVZ.js +9 -0
- package/build/server/chunks/3-D1KY9yVZ.js.map +1 -0
- package/build/server/chunks/4-7zu0cJha.js +9 -0
- package/build/server/chunks/4-7zu0cJha.js.map +1 -0
- package/build/server/chunks/5-DblV-OAd.js +9 -0
- package/build/server/chunks/5-DblV-OAd.js.map +1 -0
- package/build/server/chunks/6-BDC5budM.js +9 -0
- package/build/server/chunks/6-BDC5budM.js.map +1 -0
- package/build/server/chunks/{7-BixmjuY5.js → 7-olXOjo4r.js} +3 -3
- package/build/server/chunks/{7-BixmjuY5.js.map → 7-olXOjo4r.js.map} +1 -1
- package/build/server/chunks/8-DhmD-opq.js +9 -0
- package/build/server/chunks/8-DhmD-opq.js.map +1 -0
- package/build/server/chunks/9-BGj28GI6.js +9 -0
- package/build/server/chunks/9-BGj28GI6.js.map +1 -0
- package/build/server/chunks/{AgentSidebar-DqMxRWln.js → AgentSidebar-XdGj1sqT.js} +32 -24
- package/build/server/chunks/AgentSidebar-XdGj1sqT.js.map +1 -0
- package/build/server/chunks/{Button-qfXYs6Cv.js → Button-Dsy3QY7B.js} +5 -5
- package/build/server/chunks/Button-Dsy3QY7B.js.map +1 -0
- package/build/server/chunks/{ChatStepTrace-Bvxmgz7y.js → ChatStepTrace-1q74tVYO.js} +118 -267
- package/build/server/chunks/ChatStepTrace-1q74tVYO.js.map +1 -0
- package/build/server/chunks/{ContextEditor-CsiHhmH8.js → ContextEditor-D5B2mO8Z.js} +6 -5
- package/build/server/chunks/ContextEditor-D5B2mO8Z.js.map +1 -0
- package/build/server/chunks/{Dropdown-DroDbZQ6.js → Dropdown-7dp1qEYv.js} +4 -4
- package/build/server/chunks/Dropdown-7dp1qEYv.js.map +1 -0
- package/build/server/chunks/{Icon-SOvOgynh.js → Icon-CXFHkSIr.js} +7 -7
- package/build/server/chunks/Icon-CXFHkSIr.js.map +1 -0
- package/build/server/chunks/{Input-D-7S8dEO.js → Input-CHFlfduw.js} +4 -4
- package/build/server/chunks/Input-CHFlfduw.js.map +1 -0
- package/build/server/chunks/{Modal-CBKUwUGm.js → Modal-DtVsRmmO.js} +131 -93
- package/build/server/chunks/Modal-DtVsRmmO.js.map +1 -0
- package/build/server/chunks/{Tab-DMBlstpi.js → Tab-CD1H0E3P.js} +6 -7
- package/build/server/chunks/Tab-CD1H0E3P.js.map +1 -0
- package/build/server/chunks/{_layout.svelte-CqwbWo_W.js → _layout.svelte-B2lwUacy.js} +142 -154
- package/build/server/chunks/_layout.svelte-B2lwUacy.js.map +1 -0
- package/build/server/chunks/{_layout.svelte-B3_pVwfN.js → _layout.svelte-C5eqrEen.js} +10 -9
- package/build/server/chunks/_layout.svelte-C5eqrEen.js.map +1 -0
- package/build/server/chunks/{_layout.svelte-BnUNGsUV.js → _layout.svelte-C7JgNCIu.js} +15 -15
- package/build/server/chunks/_layout.svelte-C7JgNCIu.js.map +1 -0
- package/build/server/chunks/{_layout.svelte-DuOlsMHY.js → _layout.svelte-DJ4kDgDL.js} +62 -60
- package/build/server/chunks/_layout.svelte-DJ4kDgDL.js.map +1 -0
- package/build/server/chunks/{_page.svelte-BB_XBfMx.js → _page.svelte-BYVcy49A.js} +8 -8
- package/build/server/chunks/_page.svelte-BYVcy49A.js.map +1 -0
- package/build/server/chunks/{_page.svelte-DASkT6Tk.js → _page.svelte-Bl1WcAXy.js} +18 -26
- package/build/server/chunks/_page.svelte-Bl1WcAXy.js.map +1 -0
- package/build/server/chunks/{_page.svelte-Tl1k8pGd.js → _page.svelte-BpRksNEG.js} +18 -17
- package/build/server/chunks/_page.svelte-BpRksNEG.js.map +1 -0
- package/build/server/chunks/{_page.svelte-c2LBV2K4.js → _page.svelte-CA3-vgl2.js} +182 -171
- package/build/server/chunks/_page.svelte-CA3-vgl2.js.map +1 -0
- package/build/server/chunks/{_page.svelte-B8NFVmqA.js → _page.svelte-DDpBtd3X.js} +9 -9
- package/build/server/chunks/_page.svelte-DDpBtd3X.js.map +1 -0
- package/build/server/chunks/{_page.svelte-BaDwHJpC.js → _page.svelte-DbV3HGn5.js} +3 -4
- package/build/server/chunks/_page.svelte-DbV3HGn5.js.map +1 -0
- package/build/server/chunks/{_page.svelte-Ch8DnIjK.js → _page.svelte-FufhMKh4.js} +182 -141
- package/build/server/chunks/_page.svelte-FufhMKh4.js.map +1 -0
- package/build/server/chunks/_page.svelte-GaxktsuT.js +1410 -0
- package/build/server/chunks/_page.svelte-GaxktsuT.js.map +1 -0
- package/build/server/chunks/{_server.ts-DviONucl.js → _server.ts-CtO28tLc.js} +2 -2
- package/build/server/chunks/{_server.ts-DviONucl.js.map → _server.ts-CtO28tLc.js.map} +1 -1
- package/build/server/chunks/{_server.ts-CUTB_pVv.js → _server.ts-D_eo_OAK.js} +2 -2
- package/build/server/chunks/{_server.ts-CUTB_pVv.js.map → _server.ts-D_eo_OAK.js.map} +1 -1
- package/build/server/chunks/{agents-context-DJAK2Ml6.js → agents-context-rV2narXG.js} +2 -2
- package/build/server/chunks/agents-context-rV2narXG.js.map +1 -0
- package/build/server/chunks/{client-tqD_VlIn.js → client-DzvEkq51.js} +14 -2
- package/build/server/chunks/client-DzvEkq51.js.map +1 -0
- package/build/server/chunks/{edit-workspace-context-BQXwYkgE.js → edit-workspace-context-B1nYQ5hD.js} +2 -3
- package/build/server/chunks/edit-workspace-context-B1nYQ5hD.js.map +1 -0
- package/build/server/chunks/error.svelte-DA-yulF5.js +15 -0
- package/build/server/chunks/error.svelte-DA-yulF5.js.map +1 -0
- package/build/server/chunks/{events-Hd1jvlZp.js → events-BQ65tUJo.js} +15 -18
- package/build/server/chunks/events-BQ65tUJo.js.map +1 -0
- package/build/server/chunks/{hooks-BJphIAi-.js → hooks.universal-BJphIAi-.js} +1 -1
- package/build/server/chunks/hooks.universal-BJphIAi-.js.map +1 -0
- package/build/server/chunks/index-CSpGrMM2.js +4062 -0
- package/build/server/chunks/index-CSpGrMM2.js.map +1 -0
- package/build/server/chunks/{index-Djsj11qr.js → index-NcxaM188.js} +26 -4
- package/build/server/chunks/index-NcxaM188.js.map +1 -0
- package/build/server/chunks/{index-server-BI-Ep7Rw.js → index-server-DsYEXu5n.js} +2 -3
- package/build/server/chunks/index-server-DsYEXu5n.js.map +1 -0
- package/build/server/chunks/{index3-Cp9d5nmD.js → index2-DO4B3D-P.js} +5 -5
- package/build/server/chunks/index2-DO4B3D-P.js.map +1 -0
- package/build/server/chunks/{index-BSa6KzSq.js → index3-qVi61CNf.js} +2 -2
- package/build/server/chunks/{index-BSa6KzSq.js.map → index3-qVi61CNf.js.map} +1 -1
- package/build/server/chunks/latency--f3JYIRg.js +157 -0
- package/build/server/chunks/latency--f3JYIRg.js.map +1 -0
- package/build/server/chunks/{log-content.svelte-B3ZvaoLs.js → log-content.svelte-CfQzj-v_.js} +2 -2
- package/build/server/chunks/{log-content.svelte-B3ZvaoLs.js.map → log-content.svelte-CfQzj-v_.js.map} +1 -1
- package/build/server/chunks/root-CDJwhpIB.js +1152 -0
- package/build/server/chunks/root-CDJwhpIB.js.map +1 -0
- package/build/server/chunks/{source-selection-hOQHZ-fn.js → source-selection-eA--VEKo.js} +17 -2
- package/build/server/chunks/source-selection-eA--VEKo.js.map +1 -0
- package/build/server/chunks/state.svelte-DT7cgvTK.js +11 -0
- package/build/server/chunks/state.svelte-DT7cgvTK.js.map +1 -0
- package/build/server/chunks/trpc-client-D8L6vWf4.js +14 -0
- package/build/server/chunks/trpc-client-D8L6vWf4.js.map +1 -0
- package/build/server/index.js +2467 -2815
- package/build/server/index.js.map +1 -1
- package/build/server/manifest.js +22 -22
- package/build/server/manifest.js.map +1 -1
- package/package.json +5 -1
- package/src/backend/roleplay/router.ts +14 -8
- package/src/backend/server.ts +22 -3
- package/build/client/_app/immutable/assets/0.DkT7Ji57.css +0 -1
- package/build/client/_app/immutable/assets/0.DkT7Ji57.css.br +0 -0
- package/build/client/_app/immutable/assets/0.DkT7Ji57.css.gz +0 -0
- package/build/client/_app/immutable/assets/ChatStepTrace.CDucuryp.css +0 -1
- package/build/client/_app/immutable/assets/ChatStepTrace.CDucuryp.css.br +0 -0
- package/build/client/_app/immutable/assets/ChatStepTrace.CDucuryp.css.gz +0 -0
- package/build/client/_app/immutable/chunks/3HVf2z3Q.js +0 -1
- package/build/client/_app/immutable/chunks/3HVf2z3Q.js.br +0 -0
- package/build/client/_app/immutable/chunks/3HVf2z3Q.js.gz +0 -0
- package/build/client/_app/immutable/chunks/8mHyIC1B.js.br +0 -0
- package/build/client/_app/immutable/chunks/8mHyIC1B.js.gz +0 -0
- package/build/client/_app/immutable/chunks/B394X4Dm.js.br +0 -0
- package/build/client/_app/immutable/chunks/B394X4Dm.js.gz +0 -0
- package/build/client/_app/immutable/chunks/B5CoBEt2.js +0 -1330
- package/build/client/_app/immutable/chunks/B5CoBEt2.js.br +0 -0
- package/build/client/_app/immutable/chunks/B5CoBEt2.js.gz +0 -0
- package/build/client/_app/immutable/chunks/B7r4ghJg.js +0 -1
- package/build/client/_app/immutable/chunks/B7r4ghJg.js.br +0 -2
- package/build/client/_app/immutable/chunks/B7r4ghJg.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BEJ5fU19.js +0 -1
- package/build/client/_app/immutable/chunks/BEJ5fU19.js.br +0 -0
- package/build/client/_app/immutable/chunks/BEJ5fU19.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BFchB-2I.js +0 -1
- package/build/client/_app/immutable/chunks/BFchB-2I.js.br +0 -0
- package/build/client/_app/immutable/chunks/BFchB-2I.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BRMnbBOX.js +0 -1
- package/build/client/_app/immutable/chunks/BRMnbBOX.js.br +0 -0
- package/build/client/_app/immutable/chunks/BRMnbBOX.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BUApaBEI.js +0 -1
- package/build/client/_app/immutable/chunks/BUApaBEI.js.br +0 -0
- package/build/client/_app/immutable/chunks/BUApaBEI.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bb9ZigkD.js +0 -2
- package/build/client/_app/immutable/chunks/Bb9ZigkD.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bb9ZigkD.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BiBGf8wR.js +0 -1
- package/build/client/_app/immutable/chunks/BiBGf8wR.js.br +0 -0
- package/build/client/_app/immutable/chunks/BiBGf8wR.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bk5z628g.js +0 -1
- package/build/client/_app/immutable/chunks/Bk5z628g.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bk5z628g.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BmJonxL2.js +0 -1
- package/build/client/_app/immutable/chunks/BmJonxL2.js.br +0 -0
- package/build/client/_app/immutable/chunks/BmJonxL2.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BqYZT6mz.js +0 -5
- package/build/client/_app/immutable/chunks/BqYZT6mz.js.br +0 -0
- package/build/client/_app/immutable/chunks/BqYZT6mz.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C1rQHXql.js +0 -1
- package/build/client/_app/immutable/chunks/C1rQHXql.js.br +0 -0
- package/build/client/_app/immutable/chunks/C1rQHXql.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C3cmQ-ZQ.js +0 -1
- package/build/client/_app/immutable/chunks/C3cmQ-ZQ.js.br +0 -0
- package/build/client/_app/immutable/chunks/C3cmQ-ZQ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C8-d_pGN.js +0 -11
- package/build/client/_app/immutable/chunks/C8-d_pGN.js.br +0 -0
- package/build/client/_app/immutable/chunks/C8-d_pGN.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CB3MYTwM.js +0 -2
- package/build/client/_app/immutable/chunks/CB3MYTwM.js.br +0 -0
- package/build/client/_app/immutable/chunks/CB3MYTwM.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CJHvtD7r.js +0 -8
- package/build/client/_app/immutable/chunks/CJHvtD7r.js.br +0 -0
- package/build/client/_app/immutable/chunks/CJHvtD7r.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CMN-Rq6J.js +0 -1
- package/build/client/_app/immutable/chunks/CMN-Rq6J.js.br +0 -0
- package/build/client/_app/immutable/chunks/CMN-Rq6J.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CWj6FrbW.js +0 -1
- package/build/client/_app/immutable/chunks/CWj6FrbW.js.br +0 -0
- package/build/client/_app/immutable/chunks/CWj6FrbW.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CZNq9Fp2.js.br +0 -0
- package/build/client/_app/immutable/chunks/CZNq9Fp2.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CmatTLDp.js +0 -1
- package/build/client/_app/immutable/chunks/CmatTLDp.js.br +0 -0
- package/build/client/_app/immutable/chunks/CmatTLDp.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CnRh8Bgk.js +0 -33
- package/build/client/_app/immutable/chunks/CnRh8Bgk.js.br +0 -0
- package/build/client/_app/immutable/chunks/CnRh8Bgk.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Cob_zFH5.js +0 -1
- package/build/client/_app/immutable/chunks/Cob_zFH5.js.br +0 -0
- package/build/client/_app/immutable/chunks/Cob_zFH5.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DAyj7AJo.js +0 -1
- package/build/client/_app/immutable/chunks/DAyj7AJo.js.br +0 -0
- package/build/client/_app/immutable/chunks/DAyj7AJo.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DCT4VKzQ.js +0 -1
- package/build/client/_app/immutable/chunks/DCT4VKzQ.js.br +0 -0
- package/build/client/_app/immutable/chunks/DCT4VKzQ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DJH8-Pxb.js +0 -1
- package/build/client/_app/immutable/chunks/DJH8-Pxb.js.br +0 -0
- package/build/client/_app/immutable/chunks/DJH8-Pxb.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DMtzEpj5.js +0 -2
- package/build/client/_app/immutable/chunks/DMtzEpj5.js.br +0 -0
- package/build/client/_app/immutable/chunks/DMtzEpj5.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DT74mAuZ.js +0 -1
- package/build/client/_app/immutable/chunks/DT74mAuZ.js.br +0 -0
- package/build/client/_app/immutable/chunks/DT74mAuZ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D_iTaAhh.js +0 -1
- package/build/client/_app/immutable/chunks/D_iTaAhh.js.br +0 -0
- package/build/client/_app/immutable/chunks/D_iTaAhh.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DgnCUaz1.js +0 -1
- package/build/client/_app/immutable/chunks/DgnCUaz1.js.br +0 -0
- package/build/client/_app/immutable/chunks/DgnCUaz1.js.gz +0 -0
- package/build/client/_app/immutable/chunks/hp4PFHFv.js +0 -1
- package/build/client/_app/immutable/chunks/hp4PFHFv.js.br +0 -2
- package/build/client/_app/immutable/chunks/hp4PFHFv.js.gz +0 -0
- package/build/client/_app/immutable/chunks/rHISuZrQ.js +0 -1
- package/build/client/_app/immutable/chunks/rHISuZrQ.js.br +0 -0
- package/build/client/_app/immutable/chunks/rHISuZrQ.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.CE1yZowM.js +0 -2
- package/build/client/_app/immutable/entry/app.CE1yZowM.js.br +0 -0
- package/build/client/_app/immutable/entry/app.CE1yZowM.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.D15lqSpY.js +0 -1
- package/build/client/_app/immutable/entry/start.D15lqSpY.js.br +0 -2
- package/build/client/_app/immutable/entry/start.D15lqSpY.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.cfpwGp_4.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.cfpwGp_4.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.CHri8WYe.js +0 -1
- package/build/client/_app/immutable/nodes/1.CHri8WYe.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.CHri8WYe.js.gz +0 -0
- package/build/client/_app/immutable/nodes/10.CNlp77FZ.js +0 -5
- package/build/client/_app/immutable/nodes/10.CNlp77FZ.js.br +0 -0
- package/build/client/_app/immutable/nodes/10.CNlp77FZ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/11.BVI-eEdV.js.br +0 -0
- package/build/client/_app/immutable/nodes/11.BVI-eEdV.js.gz +0 -0
- package/build/client/_app/immutable/nodes/12.BHSGZYEC.js.br +0 -0
- package/build/client/_app/immutable/nodes/12.BHSGZYEC.js.gz +0 -0
- package/build/client/_app/immutable/nodes/13.CZ_7M4AF.js.br +0 -0
- package/build/client/_app/immutable/nodes/13.CZ_7M4AF.js.gz +0 -0
- package/build/client/_app/immutable/nodes/14.D96_XEm-.js.br +0 -0
- package/build/client/_app/immutable/nodes/14.D96_XEm-.js.gz +0 -0
- package/build/client/_app/immutable/nodes/15.DJq8KQca.js +0 -1
- package/build/client/_app/immutable/nodes/15.DJq8KQca.js.br +0 -0
- package/build/client/_app/immutable/nodes/15.DJq8KQca.js.gz +0 -0
- package/build/client/_app/immutable/nodes/16.MpUk9w5x.js.br +0 -0
- package/build/client/_app/immutable/nodes/16.MpUk9w5x.js.gz +0 -0
- package/build/client/_app/immutable/nodes/17.BTYNQV25.js +0 -4
- package/build/client/_app/immutable/nodes/17.BTYNQV25.js.br +0 -0
- package/build/client/_app/immutable/nodes/17.BTYNQV25.js.gz +0 -0
- package/build/client/_app/immutable/nodes/18.B8hhkZZh.js +0 -11
- package/build/client/_app/immutable/nodes/18.B8hhkZZh.js.br +0 -0
- package/build/client/_app/immutable/nodes/18.B8hhkZZh.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.DZ1cMXf3.js +0 -35
- package/build/client/_app/immutable/nodes/2.DZ1cMXf3.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.DZ1cMXf3.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.CCm10CUg.js +0 -1
- package/build/client/_app/immutable/nodes/3.CCm10CUg.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.CCm10CUg.js.gz +0 -0
- package/build/client/_app/immutable/nodes/4.Bh8P8-OG.js +0 -1
- package/build/client/_app/immutable/nodes/4.Bh8P8-OG.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.Bh8P8-OG.js.gz +0 -0
- package/build/client/_app/immutable/nodes/5.BqUmLlVD.js +0 -1
- package/build/client/_app/immutable/nodes/5.BqUmLlVD.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.BqUmLlVD.js.gz +0 -0
- package/build/client/_app/immutable/nodes/6.Bt2W7P40.js +0 -1
- package/build/client/_app/immutable/nodes/6.Bt2W7P40.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.Bt2W7P40.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.CkeP1yO3.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.CkeP1yO3.js.gz +0 -0
- package/build/client/_app/immutable/nodes/8.CaESldgZ.js +0 -2
- package/build/client/_app/immutable/nodes/8.CaESldgZ.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.CaESldgZ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/9.Td5mdQc9.js +0 -2
- package/build/client/_app/immutable/nodes/9.Td5mdQc9.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.Td5mdQc9.js.gz +0 -0
- package/build/server/chunks/0-bHCVPlND.js +0 -9
- package/build/server/chunks/0-bHCVPlND.js.map +0 -1
- package/build/server/chunks/1--P6amfWt.js +0 -9
- package/build/server/chunks/10-BWSo2Lz2.js +0 -9
- package/build/server/chunks/10-BWSo2Lz2.js.map +0 -1
- package/build/server/chunks/15-D8gRuCBg.js +0 -9
- package/build/server/chunks/15-D8gRuCBg.js.map +0 -1
- package/build/server/chunks/17-CoHFBhYv.js +0 -9
- package/build/server/chunks/17-CoHFBhYv.js.map +0 -1
- package/build/server/chunks/18-BbzKL6Ws.js +0 -9
- package/build/server/chunks/18-BbzKL6Ws.js.map +0 -1
- package/build/server/chunks/2-C4K8hcZz.js +0 -9
- package/build/server/chunks/2-C4K8hcZz.js.map +0 -1
- package/build/server/chunks/3-DE5hYVwf.js +0 -9
- package/build/server/chunks/3-DE5hYVwf.js.map +0 -1
- package/build/server/chunks/4-Cg9g_jQ6.js +0 -9
- package/build/server/chunks/4-Cg9g_jQ6.js.map +0 -1
- package/build/server/chunks/5-QQH3C-Ro.js +0 -9
- package/build/server/chunks/5-QQH3C-Ro.js.map +0 -1
- package/build/server/chunks/6-BrZQQi63.js +0 -9
- package/build/server/chunks/6-BrZQQi63.js.map +0 -1
- package/build/server/chunks/8-msXmgb8C.js +0 -9
- package/build/server/chunks/8-msXmgb8C.js.map +0 -1
- package/build/server/chunks/9-F1QcQ0ns.js +0 -9
- package/build/server/chunks/9-F1QcQ0ns.js.map +0 -1
- package/build/server/chunks/AgentSidebar-DqMxRWln.js.map +0 -1
- package/build/server/chunks/Button-qfXYs6Cv.js.map +0 -1
- package/build/server/chunks/ChatStepTrace-Bvxmgz7y.js.map +0 -1
- package/build/server/chunks/ContextEditor-CsiHhmH8.js.map +0 -1
- package/build/server/chunks/Dropdown-DroDbZQ6.js.map +0 -1
- package/build/server/chunks/Icon-SOvOgynh.js.map +0 -1
- package/build/server/chunks/Input-D-7S8dEO.js.map +0 -1
- package/build/server/chunks/Modal-CBKUwUGm.js.map +0 -1
- package/build/server/chunks/Tab-DMBlstpi.js.map +0 -1
- package/build/server/chunks/_layout.svelte-B3_pVwfN.js.map +0 -1
- package/build/server/chunks/_layout.svelte-BnUNGsUV.js.map +0 -1
- package/build/server/chunks/_layout.svelte-CqwbWo_W.js.map +0 -1
- package/build/server/chunks/_layout.svelte-DuOlsMHY.js.map +0 -1
- package/build/server/chunks/_page.svelte-B8NFVmqA.js.map +0 -1
- package/build/server/chunks/_page.svelte-BB_XBfMx.js.map +0 -1
- package/build/server/chunks/_page.svelte-BaDwHJpC.js.map +0 -1
- package/build/server/chunks/_page.svelte-Ch8DnIjK.js.map +0 -1
- package/build/server/chunks/_page.svelte-DASkT6Tk.js.map +0 -1
- package/build/server/chunks/_page.svelte-Tl1k8pGd.js.map +0 -1
- package/build/server/chunks/_page.svelte-VFizsKQC.js +0 -763
- package/build/server/chunks/_page.svelte-VFizsKQC.js.map +0 -1
- package/build/server/chunks/_page.svelte-c2LBV2K4.js.map +0 -1
- package/build/server/chunks/agents-context-DJAK2Ml6.js.map +0 -1
- package/build/server/chunks/client-tqD_VlIn.js.map +0 -1
- package/build/server/chunks/context-B0vutJuA.js +0 -1819
- package/build/server/chunks/context-B0vutJuA.js.map +0 -1
- package/build/server/chunks/edit-workspace-context-BQXwYkgE.js.map +0 -1
- package/build/server/chunks/error.svelte-DZg1sSW2.js +0 -14
- package/build/server/chunks/error.svelte-DZg1sSW2.js.map +0 -1
- package/build/server/chunks/events-Hd1jvlZp.js.map +0 -1
- package/build/server/chunks/hooks-BJphIAi-.js.map +0 -1
- package/build/server/chunks/index-Djsj11qr.js.map +0 -1
- package/build/server/chunks/index-server-BI-Ep7Rw.js.map +0 -1
- package/build/server/chunks/index2-BpEbpEAf.js +0 -828
- package/build/server/chunks/index2-BpEbpEAf.js.map +0 -1
- package/build/server/chunks/index3-Cp9d5nmD.js.map +0 -1
- package/build/server/chunks/source-selection-hOQHZ-fn.js.map +0 -1
- package/build/server/chunks/state.svelte-DbqYHGBV.js +0 -10
- package/build/server/chunks/state.svelte-DbqYHGBV.js.map +0 -1
- package/build/server/chunks/trpc-client-Bucti7HD.js +0 -13
- package/build/server/chunks/trpc-client-Bucti7HD.js.map +0 -1
- package/build/server/chunks/utils-KcIDVAAe.js +0 -238
- package/build/server/chunks/utils-KcIDVAAe.js.map +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{a as l,t as D,f as b,d as pe,c as Kt,b as oe}from"../chunks/C4SnSfql.js";import"../chunks/7qRqthsa.js";import{o as $e}from"../chunks/C-whEtKd.js";import{p as se,d as Se,j as t,w as c,c as _,f as at,s as S,n as bt,r as y,a as le,q as Bt,o as mt,t as U,k as Nt,h as v,Y as nt,bg as ne,bh as Pe,e as Ne,$ as Ae,a2 as H}from"../chunks/Dv8m1cTI.js";import{s as K}from"../chunks/_yZg6Sf-.js";import{p as Q,s as Le,a as ke}from"../chunks/HJHYLHDn.js";import{i as P}from"../chunks/CXo2BVs0.js";import{e as ie,i as ue}from"../chunks/D8e7SQh9.js";import{h as Ce}from"../chunks/HXxIsSOO.js";import{c as Ie}from"../chunks/C4D-JXnS.js";import{i as me}from"../chunks/CqxCTxvJ.js";import{s as Me}from"../chunks/D-wf2QNc.js";import{T as Oe,g as Re}from"../chunks/JcG4w2gF.js";import{b as je,f as Je}from"../chunks/T0seCQS_.js";import{B as ct}from"../chunks/BwtfALfL.js";import{D as Ee}from"../chunks/Ajb1KYIn.js";import{I as Fe,h as fe}from"../chunks/Dp760K13.js";import{M as ve}from"../chunks/DTXUDKH5.js";import{m as ze}from"../chunks/ddC1NP9R.js";import{C as Ue,a as De,b as We}from"../chunks/BxsDwlgp.js";import{s as Pt}from"../chunks/DYhTBLDc.js";const qe=()=>{const et=Me;return{page:{subscribe:et.page.subscribe},navigating:{subscribe:et.navigating.subscribe},updated:et.updated}},Ke={subscribe(et){return qe().page.subscribe(et)}};var Be=b("<!> <!>",1),He=b('<div class="mt-1 overflow-hidden rounded-lg border border-rc-gray-110 bg-rc-gray-930 shadow-inner-white-soft backdrop-blur-2xl" role="listbox"><!> <!></div>'),Ye=b("<div><!> <!></div>");function Ge(et,A){se(A,!0);let I=Q(A,"disabled",3,!1),_t=Q(A,"dropdownId",3,"copy-traces-dropdown"),j=Bt(!1),gt=Bt(null),X=Bt(null),J=Bt(null);Se(()=>{I()&&t(j)&&c(j,!1)});async function ot(O){try{const W=O==="with-prompts"?A.getWithPromptsText():A.getWithoutPromptsText();await navigator.clipboard.writeText(W),c(X,O,!0),t(J)&&clearTimeout(t(J)),c(J,window.setTimeout(()=>{c(X,null),c(J,null)},2e3),!0)}catch(W){console.error("Failed to copy traces",W)}}var M=Ye(),ht=_(M);ct(ht,{variant:"secondary",size:"small",get disabled(){return I()},get"aria-expanded"(){return t(j)},"aria-haspopup":"listbox",get"aria-controls"(){return _t()},onclick:O=>{O.stopPropagation(),c(j,!t(j))},class:"flex items-center gap-1",get el(){return t(gt)},set el(O){c(gt,O,!0)},children:(O,W)=>{var m=Be(),Y=at(m);{var st=N=>{var q=D("Copied traces (without prompts)");l(N,q)},p=N=>{var q=D("Copied traces (with prompts)");l(N,q)},dt=N=>{var q=D("Copy traces");l(N,q)};P(Y,N=>{t(X)==="without-prompts"?N(st):t(X)==="with-prompts"?N(p,1):N(dt,-1)})}var B=S(Y,2);{let N=bt(()=>"size-5 text-rc-gray-400 transition-transform duration-200 "+(t(j)?"rotate-180":""));Fe(B,{name:"chevron-down",get class(){return t(N)}})}l(O,m)},$$slots:{default:!0}});var it=S(ht,2);Ee(it,{get id(){return _t()},get open(){return t(j)},onClose:()=>c(j,!1),get anchorEl(){return t(gt)},placement:"bottom-end",offset:[0,1],children:W=>{var m=He(),Y=_(m);ct(Y,{variant:"ghost",size:"small",role:"option",onclick:p=>{p.stopPropagation(),c(j,!1),ot("without-prompts")},class:"w-full rounded-none border-b border-rc-gray-110 py-2 pr-3 text-left backdrop-blur-2xl hover:bg-rc-gray-700 focus:bg-rc-gray-400",children:(p,dt)=>{mt();var B=D("Without prompts");l(p,B)},$$slots:{default:!0}});var st=S(Y,2);ct(st,{variant:"ghost",size:"small",role:"option",onclick:p=>{p.stopPropagation(),c(j,!1),ot("with-prompts")},class:"w-full rounded-none py-2 pr-3 text-left backdrop-blur-2xl hover:bg-rc-gray-700 focus:bg-rc-gray-400",children:(p,dt)=>{mt();var B=D("With prompts");l(p,B)},$$slots:{default:!0}}),y(m),l(W,m)},$$slots:{default:!0}}),y(M),l(et,M),le()}var Ve=b("<div> </div>"),Qe=b('<div class="mt-1 whitespace-pre-wrap break-words text-xs italic text-rc-gray-200"> </div>'),Xe=b("<div><!> <!> <!></div>"),Ze=b("<div><div><div> </div> <div><!> <!></div> <!></div></div>"),tr=b('<div class="space-y-3"></div>'),er=b('<div class="whitespace-pre-wrap break-words"><!></div>'),rr=b('<button class="inline-flex text-sm text-rc-green-200 hover:text-rc-green-100"> </button>'),ar=b('<div><span class="whitespace-pre-wrap break-words"><!></span> <!></div>');function nr(et,A){se(A,!1);let I=Q(A,"value",8,""),_t=Q(A,"limit",8,200),j=Q(A,"maxLines",8,null),gt=Q(A,"className",8,""),X=Q(A,"collapsedLabel",8,"...more"),J=Q(A,"initiallyExpanded",8,!1),ot=Q(A,"stopPropagation",8,!0),M=Q(A,"expanded",28,J),ht=Q(A,"treatPlainText",8,!1),it=Q(A,"highlightPrompt",8,!1);function O(o){return o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function W(o){const i=m(o);let a=O(i);const f=[];return a=a.replace(/(\{+[\s\S]*?\}+)/g,x=>{const h=f.length;return f.push(x),`__CURLY${h}__`}),a=a.replace(/^(\s*#.*)$/gm,'<span class="prompt-heading">$1</span>'),a=a.replace(/(<[^&]*?>)/g,'<span class="mtk8">$1</span>'),a=a.replace(/^(\s*)(\d+)([.)])(\s+)/gm,(x,h,$,E,ut)=>`${h}<span class="mtk8">${$}${E}</span>${ut}`),f.forEach((x,h)=>{const $=`<span class="mtk5">${x}</span>`;a=a.replace(`__CURLY${h}__`,$)}),a=a.replace(/\n/g,"<br/>"),a}function m(o){let i=o.replace(/\r\n/g,`
|
|
2
|
+
`);return i=i.replace(/\\n/g,`
|
|
3
|
+
`),i}function Y(o){try{if(Array.isArray(o)){const i=o.map(a=>(a==null?void 0:a.text)??(a==null?void 0:a.content)??JSON.stringify(a)).join(" ");return m(i)}if(typeof o=="string")try{const i=JSON.parse(o);if(Array.isArray(i)){const a=i.map(f=>(f==null?void 0:f.text)??(f==null?void 0:f.content)??JSON.stringify(f)).join(" ");return m(a)}return m(o)}catch{return m(o)}return m(JSON.stringify(o))}catch{return m(String(o??""))}}function st(o){try{if(Array.isArray(o)){const i=o.map(a=>(a==null?void 0:a.text)??(a==null?void 0:a.content)??JSON.stringify(a)).join(`
|
|
4
|
+
`);return m(i)}if(typeof o=="string")try{const i=JSON.parse(o);if(Array.isArray(i)){const a=i.map(f=>(f==null?void 0:f.text)??(f==null?void 0:f.content)??JSON.stringify(f)).join(`
|
|
5
|
+
`);return m(a)}return m(o)}catch{return m(o)}return m(JSON.stringify(o,null,2))}catch{return m(String(o??""))}}function p(o){const a=m(o).split(/\n+/).map($=>$.trim()).filter($=>$.length>0),f=[];let x,h="";for(const $ of a){const E=$.match(/^(user|assistant|system|customer|caller|tool|model|agent)\s*[:\-]\s*(.*)$/i);E?(h&&f.push({text:h,role:x}),x=E[1].toLowerCase(),h=E[2]??""):h?h+=`
|
|
6
|
+
`+$:h=$}return h&&f.push({text:h,role:x}),f}function dt(o){try{let i=o;if(typeof o=="string")try{i=JSON.parse(o)}catch{return ht()?p(o):[]}if(!Array.isArray(i))if(Array.isArray(i==null?void 0:i.messages))i=i.messages;else return[];return i.map(a=>{let f;return(a==null?void 0:a.text)!=null?f=String(a.text):(a==null?void 0:a.content)!=null?Array.isArray(a.content)?f=a.content.map(x=>{var h;return typeof x=="string"?x:typeof(x==null?void 0:x.text)=="string"?x.text:typeof((h=x==null?void 0:x.text)==null?void 0:h.value)=="string"?x.text.value:JSON.stringify(x)}).join(" "):typeof a.content=="string"?f=a.content:f=JSON.stringify(a.content):typeof a=="string"?f=a:f=JSON.stringify(a),{text:m(f),role:a==null?void 0:a.role,time:a==null?void 0:a.time,duration:a==null?void 0:a.duration}}).filter(a=>a.text&&String(a.text).trim().length>0)}catch{return[]}}const B=()=>Y(I()),N=()=>st(I()),q=()=>B().split(`
|
|
7
|
+
`),rt=()=>dt(I()),Tt=()=>rt().length>0,At=()=>j()!=null?q().length>j():B().length>_t(),Lt=()=>{const o=B();return At()?j()!=null?q().slice(0,j()).join(`
|
|
8
|
+
`):o.slice(0,_t()):o};function jt(o){if(!o)return null;try{const i=new Date(o);return Number.isNaN(i.getTime())?o:i.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return o}}function Ht(o){if(o==null||!Number.isFinite(o))return null;const i=Number(o),a=Math.floor(i),f=Math.floor(a/60),x=a%60,h=String(f).padStart(2,"0"),$=String(x).padStart(2,"0");return`${h}:${$}`}function kt(o){if(!o)return"Assistant";const i=o.trim();return i?i.charAt(0).toUpperCase()+i.slice(1):"Assistant"}function Jt(o){const i=(o==null?void 0:o.toLowerCase())??"";return i==="user"||i==="customer"||i==="caller"}function Et(o){const i=[];return{main:o.replace(/<([^>]+)>/g,(f,x)=>{const h=String(x).trim();return h&&i.push(h),""}).trim(),system:i}}function Ft(o){ot()&&o.stopPropagation(),M(!M())}function Yt(o){ot()&&o.stopPropagation()}me();var Ct=Kt(),zt=at(Ct);{var Gt=o=>{var i=Kt(),a=at(i);{var f=$=>{var E=tr();ie(E,5,()=>v(rt),ue,(ut,T)=>{const L=nt(()=>(t(T),v(()=>Jt(t(T).role)))),R=nt(()=>(t(T),v(()=>(t(T).role??"").toLowerCase()==="system"))),F=nt(()=>(t(T),v(()=>Et(t(T).text)))),Z=nt(()=>(t(T),v(()=>jt(t(T).time)))),yt=nt(()=>(t(T),v(()=>Ht(t(T).duration))));var xt=Ze(),It=_(xt),wt=_(It),Qt=_(wt,!0);y(wt);var $t=S(wt,2),Ut=_($t);{var Xt=G=>{var tt=Ve(),lt=_(tt,!0);y(tt),U(()=>K(lt,(Nt(t(F)),v(()=>t(F).main)))),l(G,tt)};P(Ut,G=>{Nt(t(F)),v(()=>t(F).main)&&G(Xt)})}var Zt=S(Ut,2);ie(Zt,1,()=>(Nt(t(F)),v(()=>t(F).system)),ue,(G,tt)=>{var lt=Qe(),Mt=_(lt);y(lt),U(()=>K(Mt,`<${t(tt)??""}>`)),l(G,lt)}),y($t);var Dt=S($t,2);{var te=G=>{var tt=Xe(),lt=_(tt);{var Mt=V=>{var ft=D();U(()=>K(ft,t(Z))),l(V,ft)};P(lt,V=>{t(Z)&&V(Mt)})}var Wt=S(lt,2);{var qt=V=>{var ft=D("·");l(V,ft)};P(Wt,V=>{t(Z)&&t(yt)&&V(qt)})}var ee=S(Wt,2);{var re=V=>{var ft=D();U(()=>K(ft,t(yt))),l(V,ft)};P(ee,V=>{t(yt)&&V(re)})}y(tt),U(()=>Pt(tt,1,`mt-1 text-xs text-rc-gray-300 ${t(L)?"text-right":"text-left"}`)),l(G,tt)};P(Dt,G=>{(t(Z)||t(yt))&&G(te)})}y(It),y(xt),U(G=>{Pt(xt,1,`flex ${t(L)?"justify-end":"justify-start"}`),Pt(It,1,`max-w-[70%] break-words rounded-md px-3 py-2 text-sm shadow-sm ${t(L)?"bg-rc-gray-600 text-rc-gray-100":"bg-rc-gray-700 text-rc-gray-100"}`),Pt(wt,1,`my-1 text-xs font-semibold uppercase ${t(R)?"text-rc-blue "+(t(L)?"text-right":"text-left"):"text-rc-green-200 "+(t(L)?"text-right":"text-left")}`),K(Qt,G),Pt($t,1,`whitespace-pre-wrap break-words py-1 text-sm ${t(L)?"text-justify":"text-left"} ${t(R)?"italic text-rc-gray-200":""}`)},[()=>(t(T),v(()=>kt(t(T).role)))]),l(ut,xt)}),y(E),l($,E)},x=bt(()=>v(Tt)),h=$=>{var E=er(),ut=_(E);{var T=R=>{var F=Kt(),Z=at(F);fe(Z,()=>v(()=>W(N()))),l(R,F)},L=R=>{var F=D();U(Z=>K(F,Z),[()=>v(N)]),l(R,F)};P(ut,R=>{it()?R(T):R(L,-1)})}y(E),l($,E)};P(a,$=>{t(x)?$(f):$(h,-1)})}l(o,i)},Vt=o=>{var i=ar(),a=_(i),f=_(a);{var x=T=>{var L=Kt(),R=at(L);fe(R,()=>v(()=>W(Lt()))),l(T,L)},h=T=>{var L=D();U(R=>K(L,R),[()=>v(Lt)]),l(T,L)};P(f,T=>{it()?T(x):T(h,-1)})}y(a);var $=S(a,2);{var E=T=>{var L=rr(),R=_(L,!0);y(L),U(()=>K(R,X())),oe("click",L,Ft),l(T,L)},ut=bt(()=>v(At));P($,T=>{t(ut)&&T(E)})}y(i),U(()=>Pt(i,1,`mt-1 cursor-text select-text rounded bg-rc-gray-900 p-2 text-sm text-rc-gray-200 ${gt()}`)),oe("click",i,Yt),l(o,i)};P(zt,o=>{M()?o(Gt):o(Vt,-1)})}l(et,Ct),le()}pe(["click"]);var or=b('<span class="text-rc-gray-100">for conversation Id:</span> <span class="text-rc-green-200"> </span>',1),ir=b('<div class="flex flex-wrap items-center gap-2"><!> <!> <!></div>'),sr=b('<div class="mt-2 text-sm text-rc-gray-400">Loading call details…</div>'),lr=b('<div class="mt-2 text-sm text-rc-gray-300"> </div>'),cr=b('<div class="py-8 text-center text-rc-gray-300">No conversation selected</div>'),dr=b('<div class="py-8 text-center text-rc-gray-200">Loading traces...</div>'),ur=b('<div class="z-50 py-8 text-center text-red-400"> </div>'),fr=b('<div class="py-8 text-center text-rc-gray-300">No traces found</div>'),vr=b('<div class="my-3 flex w-full justify-center"><div class="rounded-full border border-rc-gray-650 bg-rc-gray-900/40 px-3 py-1 text-xs text-rc-gray-200"> </div></div>'),pr=b('<div class="my-3 flex w-full justify-center"><div class="rounded-full border border-red-500 bg-red-950/30 px-3 py-1 text-xs font-semibold text-red-200"> </div></div>'),mr=b("<!> <!> <!>",1),gr=b('<div class="mt-3 flex justify-center"><!></div>'),yr=b("<div></div> <!>",1),xr=b('<audio class="w-full" controls=""></audio> <div class="mt-3 break-all text-sm text-rc-gray-300"> </div>',1),_r=b("<!> <!>",1),hr=b('<div class="rc-scroll flex max-h-[60vh] flex-col gap-4 overflow-scroll p-2"><!></div>'),br=b('<div class="flex w-full items-center justify-end gap-5"><!> <!></div>'),Tr=b('<div class="flex h-full w-full flex-col bg-rc-gray-700"><div class="flex-none border-b border-rc-gray-300/40 p-4"><div class="flex flex-wrap items-start justify-between gap-3"><h2 class="text-lg font-semibold text-rc-gray-100">Traces <!></h2> <!></div> <!></div> <div class="rc-scroll min-h-0 flex-1 overflow-scroll p-4"><!></div></div> <!> <!>',1);function qr(et,A){se(A,!1);const I=()=>ke(Ke,"$page",_t),[_t,j]=Le();let gt=Q(A,"useMock",8,!1);const X=new Oe(fetch);X.setSourceId(Re()??void 0);let J=H([]),ot=H([]),M=H([]),ht=H(new Map),it=H(!1),O=H(!1),W=H(null),m=H(null),Y=null,st=H(!1),p=H(null),dt=H(!1),B=H(null),N=H(!1),q=H(!1),rt=0,Tt=0;const At=new WeakMap;let Lt=0;function jt(e){if(typeof e!="string")return null;const r=e.trim();return r||null}function Ht(e){return`${Math.round(e)} ms`}function kt(e){const r=jt(e==null?void 0:e.traceId);if(r)return r;const n=At.get(e);if(n)return n;Lt+=1;const s=`synthetic-${e.traceType}-${e.createdAt}-${Lt}`;return At.set(e,s),s}function Jt(e){const r=new Set;return e.filter(n=>{const s=jt(n==null?void 0:n.traceId);return s?r.has(s)?!1:(r.add(s),!0):!0})}function Et(e){return e?t(J):t(J).map(r=>{if(r.traceType!=="STEP")return r;const{receivedPrompt:n,renderedPrompt:s,...u}=r;return u})}function Ft(e){return e&&typeof e.renderedPrompt=="string"?e.renderedPrompt:null}function Yt(e,r){for(let n=r-1;n>=0;n--){const s=e[n];if(s.traceType!=="STEP")continue;const u=s;if(u.name==="main"&&Ft(u))return u}for(let n=r-1;n>=0;n--){const s=e[n];if(s.traceType!=="STEP")continue;const u=s;if(u.name==="prewarm"&&Ft(u))return u}return null}function Ct(e){return!!(e!=null&&e.audioUrl&&String(e.audioUrl).trim())}function zt(e){const r=e==null?void 0:e.transcript;return typeof r=="string"?r.trim()!=="":Array.isArray(r)?r.length>0:!1}function Gt(e){const r=e==null?void 0:e.transcript;return r?typeof r=="string"?r:Array.isArray(r)?r.map(n=>{const s=typeof(n==null?void 0:n.time)=="string"?n.time:"",u=typeof(n==null?void 0:n.role)=="string"?n.role:"",g=typeof(n==null?void 0:n.text)=="string"?n.text:"",d=[s,u].filter(Boolean).join(" • ");return d?`${d}
|
|
9
|
+
${g}`:g}).join(`
|
|
10
|
+
|
|
11
|
+
`):"":""}async function Vt(){try{await navigator.clipboard.writeText(Gt(t(p)))}catch(e){console.error("Failed to copy transcript",e)}}async function o(){var e;try{const r=(e=t(p))==null?void 0:e.audioUrl;if(!r)return;await navigator.clipboard.writeText(r)}catch(r){console.error("Failed to copy recording URL",r)}}function i(e){return e.traceType!=="CONVERSATIONAL"?!1:e.eventName==="received-message"||e.eventName==="llm-handler-stream-requested"||e.eventName==="finished-main-streaming-step"||e.eventName==="sent-message"||e.eventName==="transfer-requested"||e.eventName==="hangup-requested"}function a(e,r){const n=new Map;for(const s of je(r)){if(!s.isHigh)continue;const u=Je(e,s);if(!u)continue;const g=kt(u),d=n.get(g);(!d||s.durationMs>d.durationMs)&&n.set(g,{id:s.id,durationMs:s.durationMs})}return n}function f(e){return t(ht).get(kt(e))??null}const x=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function h(e){if(typeof e!="number"||!Number.isFinite(e))return null;const r=new Date(e);if(Number.isNaN(r.getTime()))return null;const n=r.getFullYear(),s=String(r.getMonth()+1).padStart(2,"0"),u=String(r.getDate()).padStart(2,"0");return`${n}-${s}-${u}`}function $(e){if(typeof e!="number"||!Number.isFinite(e))return null;const r=new Date(e);if(Number.isNaN(r.getTime()))return null;const n=r.getDate(),s=x[r.getMonth()],u=r.getFullYear();return`${n} ${s} ${u}`}async function E(e){const r=++Tt;c(dt,!0),c(B,null),c(p,null);try{if(gt())return;const n=await X.getConversation(e);if(r!==Tt)return;c(p,n)}catch(n){if(r!==Tt)return;c(B,n.message),c(p,null)}finally{if(r!==Tt)return;c(dt,!1)}}async function ut(e){const r=[];let n;for(;;){const s=await X.getLatencyTraces(e,500,n);if(r.push(...s.items??[]),n=s.lastTraceId,!n)break}return r}async function T(e){if(!e||e===t(m))return;const r=++rt;c(m,e),c(it,!0),c(O,!1),c(W,null),Y=null,c(st,!1),c(ot,[]),c(N,!1),c(q,!1),E(e);try{let n=[],s=null,u=!1,g=[];if(gt())n=(await ze.fetchTraces(e)).items??[];else{const[d,w]=await Promise.all([X.getTraces(e,100),ut(e).catch(k=>(console.error("Failed to load latency traces for chat warnings:",k),[]))]);n=d.items??[],s=d.lastTraceId??null,u=s!=null,g=w}if(r!==rt)return;Y=s,c(st,u),c(ot,g),c(J,Jt(n).slice().sort((d,w)=>d.createdAt-w.createdAt))}catch(n){if(r!==rt)return;c(W,n.message),c(J,[]),console.error("Failed to load traces:",n)}finally{if(r!==rt)return;c(it,!1)}}async function L(){if(!t(m)||!Y||t(O))return;const e=t(m),r=rt;c(O,!0),c(W,null);try{const n=await X.getTraces(e,100,Y),s=n.items??[];if(e!==t(m)||r!==rt)return;const u=n.lastTraceId??null;Y=u,c(st,u!=null),c(J,Jt(t(J).concat(s)).slice().sort((g,d)=>g.createdAt-d.createdAt))}catch(n){if(e!==t(m)||r!==rt)return;c(W,n.message),console.error("Failed to load more traces:",n)}finally{if(e!==t(m)||r!==rt)return;c(O,!1)}}$e(()=>{const e=I().params.conversationId;e&&T(e)}),ne(()=>t(J),()=>{c(M,t(J).filter(e=>e.traceType==="API_CALL"||e.traceType==="STEP"||i(e)))}),ne(()=>(t(M),t(ot)),()=>{c(ht,a(t(M),t(ot)))}),ne(()=>(I(),t(m)),()=>{const e=I().params.conversationId;e&&e!==t(m)&&T(e)}),Pe(),me();var R=Tr();Ce("1uatba4",e=>{Ne(()=>{Ae.title="Bosun: Telescope"})});var F=at(R),Z=_(F),yt=_(Z),xt=_(yt),It=S(_(xt));{var wt=e=>{var r=or(),n=S(at(r),2),s=_(n,!0);y(n),U(()=>K(s,(I(),v(()=>I().params.conversationId)))),l(e,r)};P(It,e=>{I(),v(()=>I().params.conversationId)&&e(wt)})}y(xt);var Qt=S(xt,2);{var $t=e=>{var r=ir(),n=_(r);{var s=C=>{ct(C,{variant:"secondary",size:"small",onclick:()=>c(N,!0),children:(vt,Ot)=>{mt();var St=D("Recording");l(vt,St)},$$slots:{default:!0}})},u=bt(()=>(t(p),v(()=>Ct(t(p)))));P(n,C=>{t(u)&&C(s)})}var g=S(n,2);{var d=C=>{ct(C,{variant:"secondary",size:"small",onclick:()=>c(q,!0),children:(vt,Ot)=>{mt();var St=D("Transcript");l(vt,St)},$$slots:{default:!0}})},w=bt(()=>(t(p),v(()=>zt(t(p)))));P(g,C=>{t(w)&&C(d)})}var k=S(g,2);{let C=nt(()=>(t(J),t(it),v(()=>!t(J).length||t(it))));Ge(k,{get disabled(){return t(C)},getWithPromptsText:()=>JSON.stringify(Et(!0),null,2),getWithoutPromptsText:()=>JSON.stringify(Et(!1),null,2)})}y(r),l(e,r)};P(Qt,e=>{I(),v(()=>I().params.conversationId)&&e($t)})}y(yt);var Ut=S(yt,2);{var Xt=e=>{var r=sr();l(e,r)},Zt=e=>{var r=lr(),n=_(r);y(r),U(()=>K(n,`Call details unavailable: ${t(B)??""}`)),l(e,r)};P(Ut,e=>{t(dt)?e(Xt):t(B)&&e(Zt,1)})}y(Z);var Dt=S(Z,2),te=_(Dt);{var G=e=>{var r=cr();l(e,r)},tt=e=>{var r=dr();l(e,r)},lt=e=>{var r=ur(),n=_(r);y(r),U(()=>K(n,`Error: ${t(W)??""}`)),l(e,r)},Mt=e=>{var r=fr();l(e,r)},Wt=e=>{var r=yr(),n=at(r);ie(n,7,()=>t(M),g=>kt(g),(g,d,w)=>{const k=nt(()=>(t(d),v(()=>h(t(d).createdAt)))),C=nt(()=>(Nt(t(w)),t(M),v(()=>t(w)>0?h(t(M)[t(w)-1].createdAt):null))),vt=nt(()=>(t(d),v(()=>$(t(d).createdAt)))),Ot=nt(()=>(t(d),v(()=>f(t(d)))));var St=mr(),ce=at(St);{var ye=z=>{var pt=vr(),Rt=_(pt),ae=_(Rt,!0);y(Rt),y(pt),U(()=>K(ae,t(vt))),l(z,pt)};P(ce,z=>{t(k)&&t(vt)&&t(k)!==t(C)&&z(ye)})}var de=S(ce,2);{var xe=z=>{Ue(z,{get trace(){return t(d)}})},_e=z=>{{let pt=nt(()=>(t(d),t(M),Nt(t(w)),v(()=>t(d).name==="main"?Yt(t(M),t(w)):null)));De(z,{get trace(){return t(d)},get compareTrace(){return t(pt)}})}},he=z=>{We(z,{get trace(){return t(d)},context:null,agentId:void 0})};P(de,z=>{t(d),v(()=>t(d).traceType==="API_CALL")?z(xe):(t(d),v(()=>t(d).traceType==="STEP")?z(_e,1):z(he,-1))})}var be=S(de,2);{var Te=z=>{var pt=pr(),Rt=_(pt),ae=_(Rt);y(Rt),y(pt),U(we=>K(ae,`High response latency: ${we??""}`),[()=>(Nt(t(Ot)),v(()=>Ht(t(Ot).durationMs)))]),l(z,pt)};P(be,z=>{t(Ot)&&z(Te)})}l(g,St)}),y(n);var s=S(n,2);{var u=g=>{var d=gr(),w=_(d);ct(w,{variant:"secondary",size:"small",get disabled(){return t(O)},onclick:L,children:(k,C)=>{mt();var vt=D();U(()=>K(vt,t(O)?"Loading more…":"Load more")),l(k,vt)},$$slots:{default:!0}}),y(d),l(g,d)};P(s,g=>{t(st)&&g(u)})}l(e,r)};P(te,e=>{I(),v(()=>!I().params.conversationId)?e(G):t(it)?e(tt,1):t(W)?e(lt,2):(t(M),v(()=>!t(M).length)?e(Mt,3):e(Wt,-1))})}y(Dt),y(F);var qt=S(F,2);{var ee=e=>{ve(e,{title:"Recording",class:"!max-w-3xl",get open(){return t(N)},set open(s){c(N,s)},children:s=>{var u=xr(),g=at(u),d=S(g,2),w=_(d,!0);y(d),U(()=>{Ie(g,"src",(t(p),v(()=>{var k;return(k=t(p))==null?void 0:k.audioUrl}))),K(w,(t(p),v(()=>{var k;return(k=t(p))==null?void 0:k.audioUrl})))}),l(s,u)},footer:s=>{var u=_r(),g=at(u);ct(g,{variant:"secondary",size:"small",onclick:o,children:(w,k)=>{mt();var C=D("Copy URL");l(w,C)},$$slots:{default:!0}});var d=S(g,2);ct(d,{variant:"secondary",size:"small",onclick:()=>c(N,!1),children:(w,k)=>{mt();var C=D("Close");l(w,C)},$$slots:{default:!0}}),l(s,u)},$$slots:{default:!0,footer:!0},$$legacy:!0})},re=bt(()=>(t(N),t(p),v(()=>t(N)&&Ct(t(p)))));P(qt,e=>{t(re)&&e(ee)})}var V=S(qt,2);{var ft=e=>{ve(e,{title:"Transcript",class:"!max-w-4xl",get open(){return t(q)},set open(s){c(q,s)},children:s=>{var u=hr(),g=_(u);{var d=w=>{nr(w,{get value(){return t(p),v(()=>t(p).transcript)},limit:500,expanded:!0})};P(g,w=>{t(p),v(()=>{var k;return typeof((k=t(p))==null?void 0:k.transcript)=="string"})&&w(d)})}y(u),l(s,u)},footer:s=>{var u=br(),g=_(u);ct(g,{onclick:Vt,children:(w,k)=>{mt();var C=D("Copy transcript");l(w,C)},$$slots:{default:!0}});var d=S(g,2);ct(d,{variant:"secondary",onclick:()=>c(q,!1),children:(w,k)=>{mt();var C=D("Close");l(w,C)},$$slots:{default:!0}}),y(u),l(s,u)},$$slots:{default:!0,footer:!0},$$legacy:!0})},ge=bt(()=>(t(q),t(p),v(()=>t(q)&&zt(t(p)))));P(V,e=>{t(ge)&&e(ft)})}oe("click",F,e=>e.stopPropagation()),l(et,R),le(),j()}pe(["click"]);export{qr as component};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/DLQqXQ6R.js","../chunks/C1FmrZbK.js","../assets/editor.BMIWPGx3.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var un=Object.defineProperty;var fn=(N,T,c)=>T in N?un(N,T,{enumerable:!0,configurable:!0,writable:!0,value:c}):N[T]=c;var Le=(N,T,c)=>fn(N,typeof T!="symbol"?T+"":T,c);import{a as oe,f as me,d as It,b as xt,t as He,c as ht}from"../chunks/C4SnSfql.js";import{o as Ft,a as qt}from"../chunks/C-whEtKd.js";import{p as vt,j as C,w as Te,d as Ge,c as se,r as re,a as mt,q as Ue,s as ve,o as Ve,t as je,n as Ae,f as Be,a2 as pn,bq as hn,Y as dn,v as Bt}from"../chunks/Dv8m1cTI.js";import{s as Re}from"../chunks/_yZg6Sf-.js";import{i as Ce}from"../chunks/CXo2BVs0.js";import{k as vn,M as mn}from"../chunks/DTXUDKH5.js";import{e as ot,i as Nt}from"../chunks/D8e7SQh9.js";import{s as gn}from"../chunks/D4obUD_s.js";import{r as zt,d as yn}from"../chunks/C4D-JXnS.js";import{s as _n}from"../chunks/DYhTBLDc.js";import{a as wn}from"../chunks/BM0jKynj.js";import{P as dt,g as Qt,s as xn}from"../chunks/C1WqE8CP.js";import{B as wt}from"../chunks/BwtfALfL.js";import{d as Mt,e as bn,f as En,g as kn,D as On}from"../chunks/Ajb1KYIn.js";import{I as Sn}from"../chunks/Dp760K13.js";import{T as Pt,a as it}from"../chunks/xebNt8-Z.js";import{p as Tt,l as Ln,C as Tn,P as Kt}from"../chunks/CZLNSMhF.js";import{r as An,g as pt}from"../chunks/D-wf2QNc.js";import{p as Qe}from"../chunks/CNLU4B3p.js";import{e as At,t as st}from"../chunks/DhBm2Vx9.js";import{_ as Yt}from"../chunks/C1FmrZbK.js";import{b as Jt}from"../chunks/B0iEglSe.js";import{e as Xt,a as Zt,c as Cn}from"../chunks/BU7aeYn4.js";import{p as Ct}from"../chunks/HJHYLHDn.js";import{A as Nn}from"../chunks/CqO5tR2_.js";import{g as Pn}from"../chunks/BTvePR6r.js";import"../chunks/7qRqthsa.js";import{i as Rn}from"../chunks/CqxCTxvJ.js";import{c as jt,a as In}from"../chunks/Dv0gjm25.js";var Fn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bn(N){return N&&N.__esModule&&Object.prototype.hasOwnProperty.call(N,"default")?N.default:N}class Mn{constructor(T){Le(this,"ws",null);Le(this,"openHandler",null);Le(this,"closeHandler",null);Le(this,"errorHandler",null);Le(this,"messageHandler",null);Le(this,"retries",0);Le(this,"maxRetries",5);Le(this,"retryDelay",500);Le(this,"retryTimeout",null);Le(this,"isOpen",!1);Le(this,"isDestroyed",!1);Le(this,"agentsLoaded",!1);Le(this,"init",()=>{if(!this.isOpen){this.agentsLoaded=!1,console.log(`Initializing websocket connection with [${this.wsUrl}]`);try{this.ws=new WebSocket(this.wsUrl)}catch{this.retryConnect();return}this.isDestroyed=!1,this.ws.onmessage=T=>{var E,_,d,x,l,n,y,S;const c=JSON.parse(T.data);c.channel==="error"?(E=this.errorHandler)==null||E.call(this,c.message):c.channel==="app-events"?(console.log("MSG:",c.event.type),c.event.type==="agents-loaded"&&(this.agentsLoaded=!0)):c.channel==="log"?console.log(`MSG: log [${c.message.severity}]`,c.message.message):c.channel==="api-call-trace"?console.log("MSG: api-call-trace",(_=c.trace)==null?void 0:_.operationName,(d=c.trace)==null?void 0:d.method,(x=c.trace)==null?void 0:x.path):c.channel==="conversational-trace"&&console.log("MSG: conversational-trace",(l=c.trace)==null?void 0:l.eventName,(n=c.trace)==null?void 0:n.role,(y=c.trace)==null?void 0:y.medium),(S=this.messageHandler)==null||S.call(this,c)},this.ws.onerror=T=>{var c;console.error("Websocket error:",T),(c=this.ws)==null||c.close(),this.retryConnect()},this.ws.onclose=()=>{console.log("Websocket closed"),this.isOpen=!1,this.retryConnect()},this.ws.onopen=()=>{var T;this.retries=0,this.isOpen=!0,this.retryTimeout&&clearTimeout(this.retryTimeout),(T=this.openHandler)==null||T.call(this),console.log("Websocket connected")}}});Le(this,"destroy",()=>{var T;this.isDestroyed=!0,(T=this.ws)==null||T.close()});Le(this,"onOpen",T=>{this.openHandler=T,this.isOpen&&T()});Le(this,"onClose",T=>{this.closeHandler=T,this.isOpen||T()});Le(this,"onError",T=>{this.errorHandler=T});Le(this,"onMessage",T=>{this.messageHandler=T});Le(this,"sendMessage",T=>{var c;T.channel,(c=this.ws)==null||c.send(JSON.stringify(T))});Le(this,"isReady",()=>this.isOpen&&this.agentsLoaded);Le(this,"retryConnect",()=>{var T,c;this.isDestroyed||(!this.isOpen&&this.retries<this.maxRetries?(this.retries++,this.init(),this.retryTimeout=setTimeout(this.retryConnect,this.retryDelay)):((T=this.errorHandler)==null||T.call(this,"WebSocket Error, please reload the browser"),(c=this.closeHandler)==null||c.call(this)))});this.wsUrl=T}}const Kn=At.PUBLIC_WS_HOST??`ws://${At.PUBLIC_WS_HOSTNAME??"localhost"}:${At.PUBLIC_WS_PORT??"8080"}`,rt=new Mn(Kn);var jn=me('<div class="flex h-full flex-col"><div class="h-full w-full"></div></div>');function Dn(N,T){vt(T,!0);let c=Ue(null),E=null,_=[],d=!1,x;Ft(async()=>{if(!x)return;Xt();const l=await Yt(()=>import("../chunks/DLQqXQ6R.js").then(n=>n.e),__vite__mapDeps([0,1,2]),import.meta.url);d||(Zt(l),Te(c,l.editor.create(x,{value:T.schema??"",language:"typescript",theme:"bosun-dark",lineNumbers:"off",automaticLayout:!0,minimap:{enabled:!1},matchBrackets:"never",bracketPairColorization:{enabled:!1},guides:{highlightActiveBracketPair:!1,bracketPairs:!1,bracketPairsHorizontal:!1},occurrencesHighlight:"off",selectionHighlight:!1,unicodeHighlight:{ambiguousCharacters:!1,nonBasicASCII:!1,invisibleCharacters:!1,includeStrings:!1,includeComments:!1},autoClosingQuotes:"never"}),!0),E=C(c).getModel(),_.push(C(c).onDidChangeModelContent(()=>{if(!C(c))return;const n=C(c).getValue();n!==T.schema&&T.onChange(n)})))}),qt(()=>{d=!0;for(const n of _)try{n.dispose()}catch{}_=[];const l=E;E=null;try{if(C(c)){try{C(c).setModel(null)}catch{}C(c).dispose()}}finally{Te(c,null)}try{l==null||l.dispose()}catch{}}),Ge(()=>{if(!C(c))return;const l=T.schema??"";C(c).getValue()!==l&&C(c).setValue(l)}),dt(N,{get class(){return`overflow-hidden ${T.class??""}`},children:(l,n)=>{var y=jn(),S=se(y);Jt(S,V=>x=V,()=>x),re(y),oe(l,y)}}),mt()}function Vn(N,T){return N.languages.registerCompletionItemProvider("markdown",{triggerCharacters:[" ","."],provideCompletionItems:(c,E)=>{const _=c.getValueInRange({startLineNumber:E.lineNumber,startColumn:1,endLineNumber:E.lineNumber,endColumn:E.column}),d=_.match(/\{%\s*(if|elif|for)\s+([^%]*)$/),x=_.match(/\{\{\s*([^}]*)$/);if(d||x){let n="";d?n=d[2].trim():x&&(n=x[1].trim());const{keys:y,lastPartLength:S}=Un(T,n);return{suggestions:y.map(D=>({label:D,kind:N.languages.CompletionItemKind.Variable,insertText:D,range:{startLineNumber:E.lineNumber,endLineNumber:E.lineNumber,startColumn:E.column-S,endColumn:E.column}}))}}const l=_.match(/\{%\s*([^%]*)$/);if(l){const n=l[1].trim();return{suggestions:Rt(["if","elif","else","endif","for","endfor"],n).map((S,V)=>({label:S,kind:N.languages.CompletionItemKind.Keyword,insertText:S,sortText:String(V).padStart(2,"0"),range:{startLineNumber:E.lineNumber,endLineNumber:E.lineNumber,startColumn:E.column-n.length,endColumn:E.column}}))}}return{suggestions:[]}}})}function Un(N,T){let c=N,E=[],_=0;if(T==="")E=Object.keys(N??{}),_=0;else if(T.includes(".")){const d=T.split("."),x=d.pop()||"";_=x.length;for(const l of d)if(c&&typeof c=="object"&&l in c)c=c[l];else{c=null;break}c&&typeof c=="object"&&(E=Rt(Object.keys(c),x))}else _=T.length,E=Rt(Object.keys(N??{}),T);return{keys:E,lastPartLength:_}}function Rt(N,T){return T?N.map((c,E)=>({value:c,index:E,match:Wn(c,T)})).filter(c=>c.match!==null).sort((c,E)=>c.match.kindRank!==E.match.kindRank?c.match.kindRank-E.match.kindRank:c.match.span!==E.match.span?c.match.span-E.match.span:c.match.gapCount!==E.match.gapCount?c.match.gapCount-E.match.gapCount:c.match.start!==E.match.start?c.match.start-E.match.start:c.index-E.index).map(c=>c.value):N}function Wn(N,T){const c=N.toLowerCase(),E=T.toLowerCase();if(!E)return null;if(c.startsWith(E))return{kindRank:0,start:0,span:E.length,gapCount:0};const _=c.indexOf(E);if(_!==-1)return{kindRank:qn(N,_,E.length),start:_,span:E.length,gapCount:0};const d=$n(c,E);return d?{kindRank:4,start:d.start,span:d.span,gapCount:d.gapCount}:null}function $n(N,T){if(!N||!T)return null;let c=null,E=0;for(;E<N.length;){let _=E,d=0;for(;_<N.length&&d<T.length;)N[_]===T[d]&&(d+=1),_+=1;if(d!==T.length)break;const x=new Array(T.length);let l=_-1;for(let S=T.length-1;S>=0;S--){for(;l>=0&&N[l]!==T[S];)l-=1;if(l<0)return c;x[S]=l,l-=1}let n=0;for(let S=1;S<x.length;S++)n+=x[S]-x[S-1]-1;const y={start:x[0],span:x[x.length-1]-x[0]+1,gapCount:n};(!c||y.span<c.span||y.span===c.span&&y.gapCount<c.gapCount||y.span===c.span&&y.gapCount===c.gapCount&&y.start<c.start)&&(c=y),E=x[0]+1}return c}function Hn(N,T){return T<=0?!0:/[\s._-]/.test(N[T-1]??"")}function Gn(N,T){return T>=N.length?!0:/[\s._-]/.test(N[T]??"")}function qn(N,T,c){const E=Hn(N,T),_=Gn(N,T+c);return E&&_?1:E?2:3}const zn=/^(#{1,6})\s/,Qn=/^\s*\{%\s*(if|elif|elseif|else|endif|for|endfor)\b/,Yn={provideFoldingRanges(N){return Xn(N)}},Jn={provideFoldingRanges(N){return Zn(N)}};function Xn(N){const T=[],c=N.getLineCount(),E=[];for(let _=1;_<=c;_++){const d=zn.exec(N.getLineContent(_));d&&E.push({line:_,level:d[1].length})}for(let _=0;_<E.length;_++){const{line:d,level:x}=E[_];let l=c;for(let n=_+1;n<E.length;n++)if(E[n].level<=x){l=E[n].line-1;break}l=en(N,d,l),l>d&&T.push({start:d,end:l})}return T}function Zn(N){const T=[],c=[],E=N.getLineCount();for(let _=1;_<=E;_++){const d=Qn.exec(N.getLineContent(_));if(!d)continue;const x=d[1];if(x==="if"){c.push({kind:"if",branchStarts:[_],startLine:_});continue}if(x==="for"){c.push({kind:"for",branchStarts:[_],startLine:_});continue}if(x==="elif"||x==="elseif"||x==="else"){const l=er(c,"if");if(!l)continue;_t(T,N,l.branchStarts.at(-1)??l.startLine,_-1),l.branchStarts.push(_);continue}if(x==="endif"){const l=Dt(c,"if");if(!l)continue;_t(T,N,l.branchStarts.at(-1)??l.startLine,_-1);continue}if(x==="endfor"){const l=Dt(c,"for");if(!l)continue;_t(T,N,l.startLine,_-1)}}for(const _ of c){const d=_.kind==="if"?_.branchStarts.at(-1)??_.startLine:_.startLine;_t(T,N,d,E)}return T}function er(N,T){for(let c=N.length-1;c>=0;c--)if(N[c].kind===T)return N[c];return null}function Dt(N,T){for(let c=N.length-1;c>=0;c--)if(N[c].kind===T)return N.splice(c,1)[0];return null}function _t(N,T,c,E){const _=en(T,c,E);_>c&&N.push({start:c,end:_})}function en(N,T,c){let E=c;for(;E>T&&N.getLineContent(E).trim()==="";)E-=1;return E}const tr=/\{%[-\s]*(if|elif|elseif|else|endif|for|endfor)\b/,nr={provideDocumentHighlights(N,T){const c=ir(N),E=T.lineNumber,_=T.column;for(const d of c)for(const x of d)if(x.line===E&&_>=x.startColumn&&_<=x.endColumn)return d.map(l=>({range:{startLineNumber:l.line,startColumn:l.startColumn,endLineNumber:l.line,endColumn:l.endColumn},kind:1}));return[]}};function rr(N,T){const c=N.getLineContent(T),E=tr.exec(c);if(!E)return null;const _=E[1],d=E.index+E[0].length-_.length;return{line:T,startColumn:d+1,endColumn:d+_.length+1,keyword:_}}function ir(N){const T=[],c=N.getLineCount(),E=[];for(let _=1;_<=c;_++){const d=rr(N,_);if(!d)continue;const x=d.keyword;if(x==="if"){E.push({kind:"if",tags:[d]});continue}if(x==="for"){E.push({kind:"for",tags:[d]});continue}if(x==="elif"||x==="elseif"||x==="else"){const l=or(E,"if");l&&l.tags.push(d);continue}if(x==="endif"){const l=Vt(E,"if");l&&(l.tags.push(d),T.push(l.tags));continue}if(x==="endfor"){const l=Vt(E,"for");l&&(l.tags.push(d),T.push(l.tags))}}return T}function or(N,T){for(let c=N.length-1;c>=0;c--)if(N[c].kind===T)return N[c];return null}function Vt(N,T){for(let c=N.length-1;c>=0;c--)if(N[c].kind===T)return N.splice(c,1)[0];return null}var tn={exports:{}};/*! Browser bundle of nunjucks 3.2.4 */(function(N,T){(function(E,_){N.exports=_()})(typeof self<"u"?self:Fn,function(){return function(c){var E={};function _(d){if(E[d])return E[d].exports;var x=E[d]={i:d,l:!1,exports:{}};return c[d].call(x.exports,x,x.exports,_),x.l=!0,x.exports}return _.m=c,_.c=E,_.d=function(d,x,l){_.o(d,x)||Object.defineProperty(d,x,{configurable:!1,enumerable:!0,get:l})},_.n=function(d){var x=d&&d.__esModule?function(){return d.default}:function(){return d};return _.d(x,"a",x),x},_.o=function(d,x){return Object.prototype.hasOwnProperty.call(d,x)},_.p="",_(_.s=11)}([function(c,y,_){var d=Array.prototype,x=Object.prototype,l={"&":"&",'"':""","'":"'","<":"<",">":">","\\":"\"},n=/[&"'<>\\]/g,y=c.exports={};function S(p,k){return x.hasOwnProperty.call(p,k)}y.hasOwnProp=S;function V(p){return l[p]}function D(p,k,K){if(K.Update||(K=new y.TemplateError(K)),K.Update(p),!k){var P=K;K=new Error(P.message),K.name=P.name}return K}y._prettifyError=D;function B(p,k,K){var P,$;p instanceof Error&&($=p,p=$.name+": "+$.message),Object.setPrototypeOf?(P=new Error(p),Object.setPrototypeOf(P,B.prototype)):(P=this,Object.defineProperty(P,"message",{enumerable:!1,writable:!0,value:p})),Object.defineProperty(P,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(P,this.constructor);var te;if($){var X=Object.getOwnPropertyDescriptor($,"stack");te=X&&(X.get||function(){return X.value}),te||(te=function(){return $.stack})}else{var ue=new Error(p).stack;te=function(){return ue}}return Object.defineProperty(P,"stack",{get:function(){return te.call(P)}}),Object.defineProperty(P,"cause",{value:$}),P.lineno=k,P.colno=K,P.firstUpdate=!0,P.Update=function(J){var Z="("+(J||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?Z+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(Z+=" [Line "+this.lineno+"]")),Z+=`
|
|
3
|
+
`,this.firstUpdate&&(Z+=" "),this.message=Z+(this.message||""),this.firstUpdate=!1,this},P}Object.setPrototypeOf?Object.setPrototypeOf(B.prototype,Error.prototype):B.prototype=Object.create(Error.prototype,{constructor:{value:B}}),y.TemplateError=B;function O(p){return p.replace(n,V)}y.escape=O;function R(p){return x.toString.call(p)==="[object Function]"}y.isFunction=R;function e(p){return x.toString.call(p)==="[object Array]"}y.isArray=e;function r(p){return x.toString.call(p)==="[object String]"}y.isString=r;function i(p){return x.toString.call(p)==="[object Object]"}y.isObject=i;function m(p){return p?typeof p=="string"?p.split("."):[p]:[]}function f(p){var k=m(p);return function(P){for(var $=P,te=0;te<k.length;te++){var X=k[te];if(S($,X))$=$[X];else return}return $}}y.getAttrGetter=f;function g(p,k,K){for(var P={},$=R(k)?k:f(k),te=0;te<p.length;te++){var X=p[te],ue=$(X,te);if(ue===void 0&&K===!0)throw new TypeError('groupby: attribute "'+k+'" resolved to undefined');(P[ue]||(P[ue]=[])).push(X)}return P}y.groupBy=g;function t(p){return Array.prototype.slice.call(p)}y.toArray=t;function a(p){var k=[];if(!p)return k;for(var K=p.length,P=t(arguments).slice(1),$=-1;++$<K;)L(P,p[$])===-1&&k.push(p[$]);return k}y.without=a;function u(p,k){for(var K="",P=0;P<k;P++)K+=p;return K}y.repeat=u;function o(p,k,K){if(p!=null){if(d.forEach&&p.forEach===d.forEach)p.forEach(k,K);else if(p.length===+p.length)for(var P=0,$=p.length;P<$;P++)k.call(K,p[P],P,p)}}y.each=o;function s(p,k){var K=[];if(p==null)return K;if(d.map&&p.map===d.map)return p.map(k);for(var P=0;P<p.length;P++)K[K.length]=k(p[P],P);return p.length===+p.length&&(K.length=p.length),K}y.map=s;function h(p,k,K){var P=-1;function $(){P++,P<p.length?k(p[P],P,$,K):K()}$()}y.asyncIter=h;function v(p,k,K){var P=F(p||{}),$=P.length,te=-1;function X(){te++;var ue=P[te];te<$?k(ue,p[ue],te,$,X):K()}X()}y.asyncFor=v;function L(p,k,K){return Array.prototype.indexOf.call(p||[],k,K)}y.indexOf=L;function F(p){var k=[];for(var K in p)S(p,K)&&k.push(K);return k}y.keys=F;function I(p){return F(p).map(function(k){return[k,p[k]]})}y._entries=I;function M(p){return F(p).map(function(k){return p[k]})}y._values=M;function U(p,k){return p=p||{},F(k).forEach(function(K){p[K]=k[K]}),p}y._assign=y.extend=U;function w(p,k){if(e(k)||r(k))return k.indexOf(p)!==-1;if(i(k))return p in k;throw new Error('Cannot use "in" operator to search for "'+p+'" in unexpected types.')}y.inOperator=w},function(c,E,_){function d(r,i){for(var m=0;m<i.length;m++){var f=i[m];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(r,l(f.key),f)}}function x(r,i,m){return i&&d(r.prototype,i),Object.defineProperty(r,"prototype",{writable:!1}),r}function l(r){var i=n(r,"string");return typeof i=="symbol"?i:String(i)}function n(r,i){if(typeof r!="object"||r===null)return r;var m=r[Symbol.toPrimitive];if(m!==void 0){var f=m.call(r,i);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function y(r,i){r.prototype=Object.create(i.prototype),r.prototype.constructor=r,S(r,i)}function S(r,i){return S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(f,g){return f.__proto__=g,f},S(r,i)}var V=_(16),D=_(0);function B(r,i){return typeof r!="function"||typeof i!="function"?i:function(){var f=this.parent;this.parent=r;var g=i.apply(this,arguments);return this.parent=f,g}}function O(r,i,m){m=m||{},D.keys(m).forEach(function(g){m[g]=B(r.prototype[g],m[g])});var f=function(g){y(t,g);function t(){return g.apply(this,arguments)||this}return x(t,[{key:"typename",get:function(){return i}}]),t}(r);return D._assign(f.prototype,m),f}var R=function(){function r(){this.init.apply(this,arguments)}var i=r.prototype;return i.init=function(){},r.extend=function(f,g){return typeof f=="object"&&(g=f,f="anonymous"),O(this,f,g)},x(r,[{key:"typename",get:function(){return this.constructor.name}}]),r}(),e=function(r){y(i,r);function i(){var f,g;return g=r.call(this)||this,(f=g).init.apply(f,arguments),g}var m=i.prototype;return m.init=function(){},i.extend=function(g,t){return typeof g=="object"&&(t=g,g="anonymous"),O(this,g,t)},x(i,[{key:"typename",get:function(){return this.constructor.name}}]),i}(V);c.exports={Obj:R,EmitterObj:e}},function(c,E,_){var d=_(0),x=Array.from,l=typeof Symbol=="function"&&Symbol.iterator&&typeof x=="function",n=function(){function s(v,L){this.variables=Object.create(null),this.parent=v,this.topLevel=!1,this.isolateWrites=L}var h=s.prototype;return h.set=function(L,F,I){var M=L.split("."),U=this.variables,w=this;if(I&&(w=this.resolve(M[0],!0))){w.set(L,F);return}for(var p=0;p<M.length-1;p++){var k=M[p];U[k]||(U[k]={}),U=U[k]}U[M[M.length-1]]=F},h.get=function(L){var F=this.variables[L];return F!==void 0?F:null},h.lookup=function(L){var F=this.parent,I=this.variables[L];return I!==void 0?I:F&&F.lookup(L)},h.resolve=function(L,F){var I=F&&this.isolateWrites?void 0:this.parent,M=this.variables[L];return M!==void 0?this:I&&I.resolve(L)},h.push=function(L){return new s(this,L)},h.pop=function(){return this.parent},s}();function y(s,h,v){return function(){for(var F=arguments.length,I=new Array(F),M=0;M<F;M++)I[M]=arguments[M];var U=B(I),w,p=D(I);if(U>s.length)w=I.slice(0,s.length),I.slice(w.length,U).forEach(function(P,$){$<h.length&&(p[h[$]]=P)}),w.push(p);else if(U<s.length){w=I.slice(0,U);for(var k=U;k<s.length;k++){var K=s[k];w.push(p[K]),delete p[K]}w.push(p)}else w=I;return v.apply(this,w)}}function S(s){return s.__keywords=!0,s}function V(s){return s&&Object.prototype.hasOwnProperty.call(s,"__keywords")}function D(s){var h=s.length;if(h){var v=s[h-1];if(V(v))return v}return{}}function B(s){var h=s.length;if(h===0)return 0;var v=s[h-1];return V(v)?h-1:h}function O(s){if(typeof s!="string")return s;this.val=s,this.length=s.length}O.prototype=Object.create(String.prototype,{length:{writable:!0,configurable:!0,value:0}}),O.prototype.valueOf=function(){return this.val},O.prototype.toString=function(){return this.val};function R(s,h){return s instanceof O?new O(h):h.toString()}function e(s){var h=typeof s;return h==="string"?new O(s):h!=="function"?s:function(L){var F=s.apply(this,arguments);return typeof F=="string"?new O(F):F}}function r(s,h){return s=s??"",h&&!(s instanceof O)&&(s=d.escape(s.toString())),s}function i(s,h,v){if(s==null)throw new d.TemplateError("attempted to output null or undefined value",h+1,v+1);return s}function m(s,h){if(s!=null)return typeof s[h]=="function"?function(){for(var v=arguments.length,L=new Array(v),F=0;F<v;F++)L[F]=arguments[F];return s[h].apply(s,L)}:s[h]}function f(s,h,v,L){if(s){if(typeof s!="function")throw new Error("Unable to call `"+h+"`, which is not a function")}else throw new Error("Unable to call `"+h+"`, which is undefined or falsey");return s.apply(v,L)}function g(s,h,v){var L=h.lookup(v);return L!==void 0?L:s.lookup(v)}function t(s,h,v){return s.lineno?s:new d.TemplateError(s,h,v)}function a(s,h,v,L){if(d.isArray(s)){var F=s.length;d.asyncIter(s,function(M,U,w){switch(h){case 1:v(M,U,F,w);break;case 2:v(M[0],M[1],U,F,w);break;case 3:v(M[0],M[1],M[2],U,F,w);break;default:M.push(U,F,w),v.apply(this,M)}},L)}else d.asyncFor(s,function(M,U,w,p,k){v(M,U,w,p,k)},L)}function u(s,h,v,L){var F=0,I,M;function U($,te){F++,M[$]=te,F===I&&L(null,M.join(""))}if(d.isArray(s))if(I=s.length,M=new Array(I),I===0)L(null,"");else for(var w=0;w<s.length;w++){var p=s[w];switch(h){case 1:v(p,w,I,U);break;case 2:v(p[0],p[1],w,I,U);break;case 3:v(p[0],p[1],p[2],w,I,U);break;default:p.push(w,I,U),v.apply(this,p)}}else{var k=d.keys(s||{});if(I=k.length,M=new Array(I),I===0)L(null,"");else for(var K=0;K<k.length;K++){var P=k[K];v(P,s[P],K,I,U)}}}function o(s){return typeof s!="object"||s===null||d.isArray(s)?s:l&&Symbol.iterator in s?x(s):s}c.exports={Frame:n,makeMacro:y,makeKeywordArgs:S,numArgs:B,suppressValue:r,ensureDefined:i,memberLookup:m,contextOrFrameLookup:g,callWrap:f,handleError:t,isArray:d.isArray,keys:d.keys,SafeString:O,copySafeness:R,markSafe:e,asyncEach:a,asyncAll:u,inOperator:d.inOperator,fromIterator:o}},function(c,E,_){function d(ee,ne){for(var de=0;de<ne.length;de++){var pe=ne[de];pe.enumerable=pe.enumerable||!1,pe.configurable=!0,"value"in pe&&(pe.writable=!0),Object.defineProperty(ee,l(pe.key),pe)}}function x(ee,ne,de){return ne&&d(ee.prototype,ne),Object.defineProperty(ee,"prototype",{writable:!1}),ee}function l(ee){var ne=n(ee,"string");return typeof ne=="symbol"?ne:String(ne)}function n(ee,ne){if(typeof ee!="object"||ee===null)return ee;var de=ee[Symbol.toPrimitive];if(de!==void 0){var pe=de.call(ee,ne);if(typeof pe!="object")return pe;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ee)}function y(ee,ne){ee.prototype=Object.create(ne.prototype),ee.prototype.constructor=ee,S(ee,ne)}function S(ee,ne){return S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(pe,ye){return pe.__proto__=ye,pe},S(ee,ne)}var V=_(1),D=V.Obj;function B(ee,ne,de){ee instanceof ne&&de.push(ee),ee instanceof O&&ee.findAll(ne,de)}var O=function(ee){y(ne,ee);function ne(){return ee.apply(this,arguments)||this}var de=ne.prototype;return de.init=function(ye,Oe){for(var Ne=arguments,$e=this,Je=arguments.length,kt=new Array(Je>2?Je-2:0),et=2;et<Je;et++)kt[et-2]=arguments[et];this.lineno=ye,this.colno=Oe,this.fields.forEach(function(Ot,St){var ut=Ne[St+2];ut===void 0&&(ut=null),$e[Ot]=ut})},de.findAll=function(ye,Oe){var Ne=this;return Oe=Oe||[],this instanceof e?this.children.forEach(function($e){return B($e,ye,Oe)}):this.fields.forEach(function($e){return B(Ne[$e],ye,Oe)}),Oe},de.iterFields=function(ye){var Oe=this;this.fields.forEach(function(Ne){ye(Oe[Ne],Ne)})},ne}(D),R=function(ee){y(ne,ee);function ne(){return ee.apply(this,arguments)||this}return x(ne,[{key:"typename",get:function(){return"Value"}},{key:"fields",get:function(){return["value"]}}]),ne}(O),e=function(ee){y(ne,ee);function ne(){return ee.apply(this,arguments)||this}var de=ne.prototype;return de.init=function(ye,Oe,Ne){ee.prototype.init.call(this,ye,Oe,Ne||[])},de.addChild=function(ye){this.children.push(ye)},x(ne,[{key:"typename",get:function(){return"NodeList"}},{key:"fields",get:function(){return["children"]}}]),ne}(O),r=e.extend("Root"),i=R.extend("Literal"),m=R.extend("Symbol"),f=e.extend("Group"),g=e.extend("Array"),t=O.extend("Pair",{fields:["key","value"]}),a=e.extend("Dict"),u=O.extend("LookupVal",{fields:["target","val"]}),o=O.extend("If",{fields:["cond","body","else_"]}),s=o.extend("IfAsync"),h=O.extend("InlineIf",{fields:["cond","body","else_"]}),v=O.extend("For",{fields:["arr","name","body","else_"]}),L=v.extend("AsyncEach"),F=v.extend("AsyncAll"),I=O.extend("Macro",{fields:["name","args","body"]}),M=I.extend("Caller"),U=O.extend("Import",{fields:["template","target","withContext"]}),w=function(ee){y(ne,ee);function ne(){return ee.apply(this,arguments)||this}var de=ne.prototype;return de.init=function(ye,Oe,Ne,$e,Je){ee.prototype.init.call(this,ye,Oe,Ne,$e||new e,Je)},x(ne,[{key:"typename",get:function(){return"FromImport"}},{key:"fields",get:function(){return["template","names","withContext"]}}]),ne}(O),p=O.extend("FunCall",{fields:["name","args"]}),k=p.extend("Filter"),K=k.extend("FilterAsync",{fields:["name","args","symbol"]}),P=a.extend("KeywordArgs"),$=O.extend("Block",{fields:["name","body"]}),te=O.extend("Super",{fields:["blockName","symbol"]}),X=O.extend("TemplateRef",{fields:["template"]}),ue=X.extend("Extends"),ge=O.extend("Include",{fields:["template","ignoreMissing"]}),J=O.extend("Set",{fields:["targets","value"]}),Z=O.extend("Switch",{fields:["expr","cases","default"]}),H=O.extend("Case",{fields:["cond","body"]}),Q=e.extend("Output"),Y=O.extend("Capture",{fields:["body"]}),ce=i.extend("TemplateData"),he=O.extend("UnaryOp",{fields:["target"]}),_e=O.extend("BinOp",{fields:["left","right"]}),Se=_e.extend("In"),b=_e.extend("Is"),j=_e.extend("Or"),z=_e.extend("And"),G=he.extend("Not"),ie=_e.extend("Add"),ae=_e.extend("Concat"),we=_e.extend("Sub"),fe=_e.extend("Mul"),be=_e.extend("Div"),Ie=_e.extend("FloorDiv"),Me=_e.extend("Mod"),We=_e.extend("Pow"),at=he.extend("Neg"),lt=he.extend("Pos"),bt=O.extend("Compare",{fields:["expr","ops"]}),gt=O.extend("CompareOperand",{fields:["expr","type"]}),ct=O.extend("CallExtension",{init:function(ne,de,pe,ye){this.parent(),this.extName=ne.__name||ne,this.prop=de,this.args=pe||new e,this.contentArgs=ye||[],this.autoescape=ne.autoescape},fields:["extName","prop","args","contentArgs"]}),Et=ct.extend("CallExtensionAsync");function Ye(ee,ne,de){var pe=ee.split(`
|
|
4
|
+
`);pe.forEach(function(ye,Oe){ye&&(de&&Oe>0||!de)&&process.stdout.write(" ".repeat(ne));var Ne=Oe===pe.length-1?"":`
|
|
5
|
+
`;process.stdout.write(""+ye+Ne)})}function Ze(ee,ne){if(ne=ne||0,Ye(ee.typename+": ",ne),ee instanceof e)Ye(`
|
|
6
|
+
`),ee.children.forEach(function(ye){Ze(ye,ne+2)});else if(ee instanceof ct)Ye(ee.extName+"."+ee.prop+`
|
|
7
|
+
`),ee.args&&Ze(ee.args,ne+2),ee.contentArgs&&ee.contentArgs.forEach(function(ye){Ze(ye,ne+2)});else{var de=[],pe=null;ee.iterFields(function(ye,Oe){ye instanceof O?de.push([Oe,ye]):(pe=pe||{},pe[Oe]=ye)}),pe?Ye(JSON.stringify(pe,null,2)+`
|
|
8
|
+
`,null,!0):Ye(`
|
|
9
|
+
`),de.forEach(function(ye){var Oe=ye[0],Ne=ye[1];Ye("["+Oe+"] =>",ne+2),Ze(Ne,ne+4)})}}c.exports={Node:O,Root:r,NodeList:e,Value:R,Literal:i,Symbol:m,Group:f,Array:g,Pair:t,Dict:a,Output:Q,Capture:Y,TemplateData:ce,If:o,IfAsync:s,InlineIf:h,For:v,AsyncEach:L,AsyncAll:F,Macro:I,Caller:M,Import:U,FromImport:w,FunCall:p,Filter:k,FilterAsync:K,KeywordArgs:P,Block:$,Super:te,Extends:ue,Include:ge,Set:J,Switch:Z,Case:H,LookupVal:u,BinOp:_e,In:Se,Is:b,Or:j,And:z,Not:G,Add:ie,Concat:ae,Sub:we,Mul:fe,Div:be,FloorDiv:Ie,Mod:Me,Pow:We,Neg:at,Pos:lt,Compare:bt,CompareOperand:gt,CallExtension:ct,CallExtensionAsync:Et,printNodes:Ze}},function(c,E){},function(c,E,_){function d(i,m){i.prototype=Object.create(m.prototype),i.prototype.constructor=i,x(i,m)}function x(i,m){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(g,t){return g.__proto__=t,g},x(i,m)}var l=_(8),n=_(17),y=_(3),S=_(0),V=S.TemplateError,D=_(2),B=D.Frame,O=_(1),R=O.Obj,e={"==":"==","===":"===","!=":"!=","!==":"!==","<":"<",">":">","<=":"<=",">=":">="},r=function(i){d(m,i);function m(){return i.apply(this,arguments)||this}var f=m.prototype;return f.init=function(t,a){this.templateName=t,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this._scopeClosers="",this.inBlock=!1,this.throwOnUndefined=a},f.fail=function(t,a,u){throw a!==void 0&&(a+=1),u!==void 0&&(u+=1),new V(t,a,u)},f._pushBuffer=function(){var t=this._tmpid();return this.bufferStack.push(this.buffer),this.buffer=t,this._emit("var "+this.buffer+' = "";'),t},f._popBuffer=function(){this.buffer=this.bufferStack.pop()},f._emit=function(t){this.codebuf.push(t)},f._emitLine=function(t){this._emit(t+`
|
|
10
|
+
`)},f._emitLines=function(){for(var t=this,a=arguments.length,u=new Array(a),o=0;o<a;o++)u[o]=arguments[o];u.forEach(function(s){return t._emitLine(s)})},f._emitFuncBegin=function(t,a){this.buffer="output",this._scopeClosers="",this._emitLine("function "+a+"(env, context, frame, runtime, cb) {"),this._emitLine("var lineno = "+t.lineno+";"),this._emitLine("var colno = "+t.colno+";"),this._emitLine("var "+this.buffer+' = "";'),this._emitLine("try {")},f._emitFuncEnd=function(t){t||this._emitLine("cb(null, "+this.buffer+");"),this._closeScopeLevels(),this._emitLine("} catch (e) {"),this._emitLine(" cb(runtime.handleError(e, lineno, colno));"),this._emitLine("}"),this._emitLine("}"),this.buffer=null},f._addScopeLevel=function(){this._scopeClosers+="})"},f._closeScopeLevels=function(){this._emitLine(this._scopeClosers+";"),this._scopeClosers=""},f._withScopedSyntax=function(t){var a=this._scopeClosers;this._scopeClosers="",t.call(this),this._closeScopeLevels(),this._scopeClosers=a},f._makeCallback=function(t){var a=this._tmpid();return"function("+a+(t?","+t:"")+`) {
|
|
11
|
+
if(`+a+") { cb("+a+"); return; }"},f._tmpid=function(){return this.lastId++,"t_"+this.lastId},f._templateName=function(){return this.templateName==null?"undefined":JSON.stringify(this.templateName)},f._compileChildren=function(t,a){var u=this;t.children.forEach(function(o){u.compile(o,a)})},f._compileAggregate=function(t,a,u,o){var s=this;u&&this._emit(u),t.children.forEach(function(h,v){v>0&&s._emit(","),s.compile(h,a)}),o&&this._emit(o)},f._compileExpression=function(t,a){this.assertType(t,y.Literal,y.Symbol,y.Group,y.Array,y.Dict,y.FunCall,y.Caller,y.Filter,y.LookupVal,y.Compare,y.InlineIf,y.In,y.Is,y.And,y.Or,y.Not,y.Add,y.Concat,y.Sub,y.Mul,y.Div,y.FloorDiv,y.Mod,y.Pow,y.Neg,y.Pos,y.Compare,y.NodeList),this.compile(t,a)},f.assertType=function(t){for(var a=arguments.length,u=new Array(a>1?a-1:0),o=1;o<a;o++)u[o-1]=arguments[o];u.some(function(s){return t instanceof s})||this.fail("assertType: invalid type: "+t.typename,t.lineno,t.colno)},f.compileCallExtension=function(t,a,u){var o=this,s=t.args,h=t.contentArgs,v=typeof t.autoescape=="boolean"?t.autoescape:!0;if(u||this._emit(this.buffer+" += runtime.suppressValue("),this._emit('env.getExtension("'+t.extName+'")["'+t.prop+'"]('),this._emit("context"),(s||h)&&this._emit(","),s&&(s instanceof y.NodeList||this.fail("compileCallExtension: arguments must be a NodeList, use `parser.parseSignature`"),s.children.forEach(function(F,I){o._compileExpression(F,a),(I!==s.children.length-1||h.length)&&o._emit(",")})),h.length&&h.forEach(function(F,I){if(I>0&&o._emit(","),F){o._emitLine("function(cb) {"),o._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var M=o._pushBuffer();o._withScopedSyntax(function(){o.compile(F,a),o._emitLine("cb(null, "+M+");")}),o._popBuffer(),o._emitLine("return "+M+";"),o._emitLine("}")}else o._emit("null")}),u){var L=this._tmpid();this._emitLine(", "+this._makeCallback(L)),this._emitLine(this.buffer+" += runtime.suppressValue("+L+", "+v+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+v+` && env.opts.autoescape);
|
|
12
|
+
`)},f.compileCallExtensionAsync=function(t,a){this.compileCallExtension(t,a,!0)},f.compileNodeList=function(t,a){this._compileChildren(t,a)},f.compileLiteral=function(t){if(typeof t.value=="string"){var a=t.value.replace(/\\/g,"\\\\");a=a.replace(/"/g,'\\"'),a=a.replace(/\n/g,"\\n"),a=a.replace(/\r/g,"\\r"),a=a.replace(/\t/g,"\\t"),a=a.replace(/\u2028/g,"\\u2028"),this._emit('"'+a+'"')}else t.value===null?this._emit("null"):this._emit(t.value.toString())},f.compileSymbol=function(t,a){var u=t.value,o=a.lookup(u);o?this._emit(o):this._emit('runtime.contextOrFrameLookup(context, frame, "'+u+'")')},f.compileGroup=function(t,a){this._compileAggregate(t,a,"(",")")},f.compileArray=function(t,a){this._compileAggregate(t,a,"[","]")},f.compileDict=function(t,a){this._compileAggregate(t,a,"{","}")},f.compilePair=function(t,a){var u=t.key,o=t.value;u instanceof y.Symbol?u=new y.Literal(u.lineno,u.colno,u.value):u instanceof y.Literal&&typeof u.value=="string"||this.fail("compilePair: Dict keys must be strings or names",u.lineno,u.colno),this.compile(u,a),this._emit(": "),this._compileExpression(o,a)},f.compileInlineIf=function(t,a){this._emit("("),this.compile(t.cond,a),this._emit("?"),this.compile(t.body,a),this._emit(":"),t.else_!==null?this.compile(t.else_,a):this._emit('""'),this._emit(")")},f.compileIn=function(t,a){this._emit("runtime.inOperator("),this.compile(t.left,a),this._emit(","),this.compile(t.right,a),this._emit(")")},f.compileIs=function(t,a){var u=t.right.name?t.right.name.value:t.right.value;this._emit('env.getTest("'+u+'").call(context, '),this.compile(t.left,a),t.right.args&&(this._emit(","),this.compile(t.right.args,a)),this._emit(") === true")},f._binOpEmitter=function(t,a,u){this.compile(t.left,a),this._emit(u),this.compile(t.right,a)},f.compileOr=function(t,a){return this._binOpEmitter(t,a," || ")},f.compileAnd=function(t,a){return this._binOpEmitter(t,a," && ")},f.compileAdd=function(t,a){return this._binOpEmitter(t,a," + ")},f.compileConcat=function(t,a){return this._binOpEmitter(t,a,' + "" + ')},f.compileSub=function(t,a){return this._binOpEmitter(t,a," - ")},f.compileMul=function(t,a){return this._binOpEmitter(t,a," * ")},f.compileDiv=function(t,a){return this._binOpEmitter(t,a," / ")},f.compileMod=function(t,a){return this._binOpEmitter(t,a," % ")},f.compileNot=function(t,a){this._emit("!"),this.compile(t.target,a)},f.compileFloorDiv=function(t,a){this._emit("Math.floor("),this.compile(t.left,a),this._emit(" / "),this.compile(t.right,a),this._emit(")")},f.compilePow=function(t,a){this._emit("Math.pow("),this.compile(t.left,a),this._emit(", "),this.compile(t.right,a),this._emit(")")},f.compileNeg=function(t,a){this._emit("-"),this.compile(t.target,a)},f.compilePos=function(t,a){this._emit("+"),this.compile(t.target,a)},f.compileCompare=function(t,a){var u=this;this.compile(t.expr,a),t.ops.forEach(function(o){u._emit(" "+e[o.type]+" "),u.compile(o.expr,a)})},f.compileLookupVal=function(t,a){this._emit("runtime.memberLookup(("),this._compileExpression(t.target,a),this._emit("),"),this._compileExpression(t.val,a),this._emit(")")},f._getNodeName=function(t){switch(t.typename){case"Symbol":return t.value;case"FunCall":return"the return value of ("+this._getNodeName(t.name)+")";case"LookupVal":return this._getNodeName(t.target)+'["'+this._getNodeName(t.val)+'"]';case"Literal":return t.value.toString();default:return"--expression--"}},f.compileFunCall=function(t,a){this._emit("(lineno = "+t.lineno+", colno = "+t.colno+", "),this._emit("runtime.callWrap("),this._compileExpression(t.name,a),this._emit(', "'+this._getNodeName(t.name).replace(/"/g,'\\"')+'", context, '),this._compileAggregate(t.args,a,"[","])"),this._emit(")")},f.compileFilter=function(t,a){var u=t.name;this.assertType(u,y.Symbol),this._emit('env.getFilter("'+u.value+'").call(context, '),this._compileAggregate(t.args,a),this._emit(")")},f.compileFilterAsync=function(t,a){var u=t.name,o=t.symbol.value;this.assertType(u,y.Symbol),a.set(o,o),this._emit('env.getFilter("'+u.value+'").call(context, '),this._compileAggregate(t.args,a),this._emitLine(", "+this._makeCallback(o)),this._addScopeLevel()},f.compileKeywordArgs=function(t,a){this._emit("runtime.makeKeywordArgs("),this.compileDict(t,a),this._emit(")")},f.compileSet=function(t,a){var u=this,o=[];t.targets.forEach(function(s){var h=s.value,v=a.lookup(h);v==null&&(v=u._tmpid(),u._emitLine("var "+v+";")),o.push(v)}),t.value?(this._emit(o.join(" = ")+" = "),this._compileExpression(t.value,a),this._emitLine(";")):(this._emit(o.join(" = ")+" = "),this.compile(t.body,a),this._emitLine(";")),t.targets.forEach(function(s,h){var v=o[h],L=s.value;u._emitLine('frame.set("'+L+'", '+v+", true);"),u._emitLine("if(frame.topLevel) {"),u._emitLine('context.setVariable("'+L+'", '+v+");"),u._emitLine("}"),L.charAt(0)!=="_"&&(u._emitLine("if(frame.topLevel) {"),u._emitLine('context.addExport("'+L+'", '+v+");"),u._emitLine("}"))})},f.compileSwitch=function(t,a){var u=this;this._emit("switch ("),this.compile(t.expr,a),this._emit(") {"),t.cases.forEach(function(o,s){u._emit("case "),u.compile(o.cond,a),u._emit(": "),u.compile(o.body,a),o.body.children.length&&u._emitLine("break;")}),t.default&&(this._emit("default:"),this.compile(t.default,a)),this._emit("}")},f.compileIf=function(t,a,u){var o=this;this._emit("if("),this._compileExpression(t.cond,a),this._emitLine(") {"),this._withScopedSyntax(function(){o.compile(t.body,a),u&&o._emit("cb()")}),t.else_?(this._emitLine(`}
|
|
13
|
+
else {`),this._withScopedSyntax(function(){o.compile(t.else_,a),u&&o._emit("cb()")})):u&&(this._emitLine(`}
|
|
14
|
+
else {`),this._emit("cb()")),this._emitLine("}")},f.compileIfAsync=function(t,a){this._emit("(function(cb) {"),this.compileIf(t,a,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},f._emitLoopBindings=function(t,a,u,o){var s=this,h=[{name:"index",val:u+" + 1"},{name:"index0",val:u},{name:"revindex",val:o+" - "+u},{name:"revindex0",val:o+" - "+u+" - 1"},{name:"first",val:u+" === 0"},{name:"last",val:u+" === "+o+" - 1"},{name:"length",val:o}];h.forEach(function(v){s._emitLine('frame.set("loop.'+v.name+'", '+v.val+");")})},f.compileFor=function(t,a){var u=this,o=this._tmpid(),s=this._tmpid(),h=this._tmpid();if(a=a.push(),this._emitLine("frame = frame.push();"),this._emit("var "+h+" = "),this._compileExpression(t.arr,a),this._emitLine(";"),this._emit("if("+h+") {"),this._emitLine(h+" = runtime.fromIterator("+h+");"),t.name instanceof y.Array){this._emitLine("var "+o+";"),this._emitLine("if(runtime.isArray("+h+")) {"),this._emitLine("var "+s+" = "+h+".length;"),this._emitLine("for("+o+"=0; "+o+" < "+h+".length; "+o+"++) {"),t.name.children.forEach(function(w,p){var k=u._tmpid();u._emitLine("var "+k+" = "+h+"["+o+"]["+p+"];"),u._emitLine('frame.set("'+w+'", '+h+"["+o+"]["+p+"]);"),a.set(t.name.children[p].value,k)}),this._emitLoopBindings(t,h,o,s),this._withScopedSyntax(function(){u.compile(t.body,a)}),this._emitLine("}"),this._emitLine("} else {");var v=t.name.children,L=v[0],F=v[1],I=this._tmpid(),M=this._tmpid();a.set(L.value,I),a.set(F.value,M),this._emitLine(o+" = -1;"),this._emitLine("var "+s+" = runtime.keys("+h+").length;"),this._emitLine("for(var "+I+" in "+h+") {"),this._emitLine(o+"++;"),this._emitLine("var "+M+" = "+h+"["+I+"];"),this._emitLine('frame.set("'+L.value+'", '+I+");"),this._emitLine('frame.set("'+F.value+'", '+M+");"),this._emitLoopBindings(t,h,o,s),this._withScopedSyntax(function(){u.compile(t.body,a)}),this._emitLine("}"),this._emitLine("}")}else{var U=this._tmpid();a.set(t.name.value,U),this._emitLine("var "+s+" = "+h+".length;"),this._emitLine("for(var "+o+"=0; "+o+" < "+h+".length; "+o+"++) {"),this._emitLine("var "+U+" = "+h+"["+o+"];"),this._emitLine('frame.set("'+t.name.value+'", '+U+");"),this._emitLoopBindings(t,h,o,s),this._withScopedSyntax(function(){u.compile(t.body,a)}),this._emitLine("}")}this._emitLine("}"),t.else_&&(this._emitLine("if (!"+s+") {"),this.compile(t.else_,a),this._emitLine("}")),this._emitLine("frame = frame.pop();")},f._compileAsyncLoop=function(t,a,u){var o=this,s=this._tmpid(),h=this._tmpid(),v=this._tmpid(),L=u?"asyncAll":"asyncEach";if(a=a.push(),this._emitLine("frame = frame.push();"),this._emit("var "+v+" = runtime.fromIterator("),this._compileExpression(t.arr,a),this._emitLine(");"),t.name instanceof y.Array){var F=t.name.children.length;this._emit("runtime."+L+"("+v+", "+F+", function("),t.name.children.forEach(function(U){o._emit(U.value+",")}),this._emit(s+","+h+",next) {"),t.name.children.forEach(function(U){var w=U.value;a.set(w,w),o._emitLine('frame.set("'+w+'", '+w+");")})}else{var I=t.name.value;this._emitLine("runtime."+L+"("+v+", 1, function("+I+", "+s+", "+h+",next) {"),this._emitLine('frame.set("'+I+'", '+I+");"),a.set(I,I)}this._emitLoopBindings(t,v,s,h),this._withScopedSyntax(function(){var U;u&&(U=o._pushBuffer()),o.compile(t.body,a),o._emitLine("next("+s+(U?","+U:"")+");"),u&&o._popBuffer()});var M=this._tmpid();this._emitLine("}, "+this._makeCallback(M)),this._addScopeLevel(),u&&this._emitLine(this.buffer+" += "+M+";"),t.else_&&(this._emitLine("if (!"+v+".length) {"),this.compile(t.else_,a),this._emitLine("}")),this._emitLine("frame = frame.pop();")},f.compileAsyncEach=function(t,a){this._compileAsyncLoop(t,a)},f.compileAsyncAll=function(t,a){this._compileAsyncLoop(t,a,!0)},f._compileMacro=function(t,a){var u=this,o=[],s=null,h="macro_"+this._tmpid(),v=a!==void 0;t.args.children.forEach(function(w,p){p===t.args.children.length-1&&w instanceof y.Dict?s=w:(u.assertType(w,y.Symbol),o.push(w))});var L=[].concat(o.map(function(w){return"l_"+w.value}),["kwargs"]),F=o.map(function(w){return'"'+w.value+'"'}),I=(s&&s.children||[]).map(function(w){return'"'+w.key.value+'"'}),M;v?M=a.push(!0):M=new B,this._emitLines("var "+h+" = runtime.makeMacro(","["+F.join(", ")+"], ","["+I.join(", ")+"], ","function ("+L.join(", ")+") {","var callerFrame = frame;","frame = "+(v?"frame.push(true);":"new runtime.Frame();"),"kwargs = kwargs || {};",'if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {','frame.set("caller", kwargs.caller); }'),o.forEach(function(w){u._emitLine('frame.set("'+w.value+'", l_'+w.value+");"),M.set(w.value,"l_"+w.value)}),s&&s.children.forEach(function(w){var p=w.key.value;u._emit('frame.set("'+p+'", '),u._emit('Object.prototype.hasOwnProperty.call(kwargs, "'+p+'")'),u._emit(' ? kwargs["'+p+'"] : '),u._compileExpression(w.value,M),u._emit(");")});var U=this._pushBuffer();return this._withScopedSyntax(function(){u.compile(t.body,M)}),this._emitLine("frame = "+(v?"frame.pop();":"callerFrame;")),this._emitLine("return new runtime.SafeString("+U+");"),this._emitLine("});"),this._popBuffer(),h},f.compileMacro=function(t,a){var u=this._compileMacro(t),o=t.name.value;a.set(o,u),a.parent?this._emitLine('frame.set("'+o+'", '+u+");"):(t.name.value.charAt(0)!=="_"&&this._emitLine('context.addExport("'+o+'");'),this._emitLine('context.setVariable("'+o+'", '+u+");"))},f.compileCaller=function(t,a){this._emit("(function (){");var u=this._compileMacro(t,a);this._emit("return "+u+";})()")},f._compileGetTemplate=function(t,a,u,o){var s=this._tmpid(),h=this._templateName(),v=this._makeCallback(s),L=u?"true":"false",F=o?"true":"false";return this._emit("env.getTemplate("),this._compileExpression(t.template,a),this._emitLine(", "+L+", "+h+", "+F+", "+v),s},f.compileImport=function(t,a){var u=t.target.value,o=this._compileGetTemplate(t,a,!1,!1);this._addScopeLevel(),this._emitLine(o+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(o)),this._addScopeLevel(),a.set(u,o),a.parent?this._emitLine('frame.set("'+u+'", '+o+");"):this._emitLine('context.setVariable("'+u+'", '+o+");")},f.compileFromImport=function(t,a){var u=this,o=this._compileGetTemplate(t,a,!1,!1);this._addScopeLevel(),this._emitLine(o+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(o)),this._addScopeLevel(),t.names.children.forEach(function(s){var h,v,L=u._tmpid();s instanceof y.Pair?(h=s.key.value,v=s.value.value):(h=s.value,v=h),u._emitLine("if(Object.prototype.hasOwnProperty.call("+o+', "'+h+'")) {'),u._emitLine("var "+L+" = "+o+"."+h+";"),u._emitLine("} else {"),u._emitLine(`cb(new Error("cannot import '`+h+`'")); return;`),u._emitLine("}"),a.set(v,L),a.parent?u._emitLine('frame.set("'+v+'", '+L+");"):u._emitLine('context.setVariable("'+v+'", '+L+");")})},f.compileBlock=function(t){var a=this._tmpid();this.inBlock||this._emit('(parentTemplate ? function(e, c, f, r, cb) { cb(""); } : '),this._emit('context.getBlock("'+t.name.value+'")'),this.inBlock||this._emit(")"),this._emitLine("(env, context, frame, runtime, "+this._makeCallback(a)),this._emitLine(this.buffer+" += "+a+";"),this._addScopeLevel()},f.compileSuper=function(t,a){var u=t.blockName.value,o=t.symbol.value,s=this._makeCallback(o);this._emitLine('context.getSuper(env, "'+u+'", b_'+u+", frame, runtime, "+s),this._emitLine(o+" = runtime.markSafe("+o+");"),this._addScopeLevel(),a.set(o,o)},f.compileExtends=function(t,a){var u=this._tmpid(),o=this._compileGetTemplate(t,a,!0,!1);this._emitLine("parentTemplate = "+o),this._emitLine("for(var "+u+" in parentTemplate.blocks) {"),this._emitLine("context.addBlock("+u+", parentTemplate.blocks["+u+"]);"),this._emitLine("}"),this._addScopeLevel()},f.compileInclude=function(t,a){this._emitLine("var tasks = [];"),this._emitLine("tasks.push("),this._emitLine("function(callback) {");var u=this._compileGetTemplate(t,a,!1,t.ignoreMissing);this._emitLine("callback(null,"+u+");});"),this._emitLine("});");var o=this._tmpid();this._emitLine("tasks.push("),this._emitLine("function(template, callback){"),this._emitLine("template.render(context.getVariables(), frame, "+this._makeCallback(o)),this._emitLine("callback(null,"+o+");});"),this._emitLine("});"),this._emitLine("tasks.push("),this._emitLine("function(result, callback){"),this._emitLine(this.buffer+" += result;"),this._emitLine("callback(null);"),this._emitLine("});"),this._emitLine("env.waterfall(tasks, function(){"),this._addScopeLevel()},f.compileTemplateData=function(t,a){this.compileLiteral(t,a)},f.compileCapture=function(t,a){var u=this,o=this.buffer;this.buffer="output",this._emitLine("(function() {"),this._emitLine('var output = "";'),this._withScopedSyntax(function(){u.compile(t.body,a)}),this._emitLine("return output;"),this._emitLine("})()"),this.buffer=o},f.compileOutput=function(t,a){var u=this,o=t.children;o.forEach(function(s){s instanceof y.TemplateData?s.value&&(u._emit(u.buffer+" += "),u.compileLiteral(s,a),u._emitLine(";")):(u._emit(u.buffer+" += runtime.suppressValue("),u.throwOnUndefined&&u._emit("runtime.ensureDefined("),u.compile(s,a),u.throwOnUndefined&&u._emit(","+t.lineno+","+t.colno+")"),u._emit(`, env.opts.autoescape);
|
|
15
|
+
`))})},f.compileRoot=function(t,a){var u=this;a&&this.fail("compileRoot: root node can't have frame"),a=new B,this._emitFuncBegin(t,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(t,a),this._emitLine("if(parentTemplate) {"),this._emitLine("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this._emitLine("} else {"),this._emitLine("cb(null, "+this.buffer+");"),this._emitLine("}"),this._emitFuncEnd(!0),this.inBlock=!0;var o=[],s=t.findAll(y.Block);s.forEach(function(h,v){var L=h.name.value;if(o.indexOf(L)!==-1)throw new Error('Block "'+L+'" defined more than once.');o.push(L),u._emitFuncBegin(h,"b_"+L);var F=new B;u._emitLine("var frame = frame.push(true);"),u.compile(h.body,F),u._emitFuncEnd()}),this._emitLine("return {"),s.forEach(function(h,v){var L="b_"+h.name.value;u._emitLine(L+": "+L+",")}),this._emitLine(`root: root
|
|
16
|
+
};`)},f.compile=function(t,a){var u=this["compile"+t.typename];u?u.call(this,t,a):this.fail("compile: Cannot compile node: "+t.typename,t.lineno,t.colno)},f.getCode=function(){return this.codebuf.join("")},m}(R);c.exports={compile:function(m,f,g,t,a){a===void 0&&(a={});var u=new r(t,a.throwOnUndefined),o=(g||[]).map(function(h){return h.preprocess}).filter(function(h){return!!h}),s=o.reduce(function(h,v){return v(h)},m);return u.compile(n.transform(l.parse(s,g,a),f,t)),u.getCode()},Compiler:r}},function(c,E,_){function d(S,V){S.prototype=Object.create(V.prototype),S.prototype.constructor=S,x(S,V)}function x(S,V){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(B,O){return B.__proto__=O,B},x(S,V)}var l=_(4),n=_(1),y=n.EmitterObj;c.exports=function(S){d(V,S);function V(){return S.apply(this,arguments)||this}var D=V.prototype;return D.resolve=function(O,R){return l.resolve(l.dirname(O),R)},D.isRelative=function(O){return O.indexOf("./")===0||O.indexOf("../")===0},V}(y)},function(c,E,_){function d(F,I){F.prototype=Object.create(I.prototype),F.prototype.constructor=F,x(F,I)}function x(F,I){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(U,w){return U.__proto__=w,U},x(F,I)}var l=_(12),n=_(15),y=_(0),S=_(5),V=_(18),D=_(10),B=D.FileSystemLoader,O=D.WebLoader,R=D.PrecompiledLoader,e=_(20),r=_(21),i=_(1),m=i.Obj,f=i.EmitterObj,g=_(2),t=g.handleError,a=g.Frame,u=_(22);function o(F,I,M){l(function(){F(I,M)})}var s={type:"code",obj:{root:function(I,M,U,w,p){try{p(null,"")}catch(k){p(t(k,null,null))}}}},h=function(F){d(I,F);function I(){return F.apply(this,arguments)||this}var M=I.prototype;return M.init=function(w,p){var k=this;p=this.opts=p||{},this.opts.dev=!!p.dev,this.opts.autoescape=p.autoescape!=null?p.autoescape:!0,this.opts.throwOnUndefined=!!p.throwOnUndefined,this.opts.trimBlocks=!!p.trimBlocks,this.opts.lstripBlocks=!!p.lstripBlocks,this.loaders=[],w?this.loaders=y.isArray(w)?w:[w]:B?this.loaders=[new B("views")]:O&&(this.loaders=[new O("/views")]),typeof window<"u"&&window.nunjucksPrecompiled&&this.loaders.unshift(new R(window.nunjucksPrecompiled)),this._initLoaders(),this.globals=r(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],y._entries(V).forEach(function(K){var P=K[0],$=K[1];return k.addFilter(P,$)}),y._entries(e).forEach(function(K){var P=K[0],$=K[1];return k.addTest(P,$)})},M._initLoaders=function(){var w=this;this.loaders.forEach(function(p){p.cache={},typeof p.on=="function"&&(p.on("update",function(k,K){p.cache[k]=null,w.emit("update",k,K,p)}),p.on("load",function(k,K){w.emit("load",k,K,p)}))})},M.invalidateCache=function(){this.loaders.forEach(function(w){w.cache={}})},M.addExtension=function(w,p){return p.__name=w,this.extensions[w]=p,this.extensionsList.push(p),this},M.removeExtension=function(w){var p=this.getExtension(w);p&&(this.extensionsList=y.without(this.extensionsList,p),delete this.extensions[w])},M.getExtension=function(w){return this.extensions[w]},M.hasExtension=function(w){return!!this.extensions[w]},M.addGlobal=function(w,p){return this.globals[w]=p,this},M.getGlobal=function(w){if(typeof this.globals[w]>"u")throw new Error("global not found: "+w);return this.globals[w]},M.addFilter=function(w,p,k){var K=p;return k&&this.asyncFilters.push(w),this.filters[w]=K,this},M.getFilter=function(w){if(!this.filters[w])throw new Error("filter not found: "+w);return this.filters[w]},M.addTest=function(w,p){return this.tests[w]=p,this},M.getTest=function(w){if(!this.tests[w])throw new Error("test not found: "+w);return this.tests[w]},M.resolveTemplate=function(w,p,k){var K=w.isRelative&&p?w.isRelative(k):!1;return K&&w.resolve?w.resolve(p,k):k},M.getTemplate=function(w,p,k,K,P){var $=this,te=this,X=null;if(w&&w.raw&&(w=w.raw),y.isFunction(k)&&(P=k,k=null,p=p||!1),y.isFunction(p)&&(P=p,p=!1),w instanceof L)X=w;else{if(typeof w!="string")throw new Error("template names must be a string: "+w);for(var ue=0;ue<this.loaders.length;ue++){var ge=this.loaders[ue];if(X=ge.cache[this.resolveTemplate(ge,k,w)],X)break}}if(X)if(p&&X.compile(),P){P(null,X);return}else return X;var J,Z=function(Q,Y){if(!Y&&!Q&&!K&&(Q=new Error("template not found: "+w)),Q)if(P){P(Q);return}else throw Q;var ce;Y?(ce=new L(Y.src,$,Y.path,p),Y.noCache||(Y.loader.cache[w]=ce)):ce=new L(s,$,"",p),P?P(null,ce):J=ce};return y.asyncIter(this.loaders,function(H,Q,Y,ce){function he(_e,Se){_e?ce(_e):Se?(Se.loader=H,ce(null,Se)):Y()}w=te.resolveTemplate(H,k,w),H.async?H.getSource(w,he):he(null,H.getSource(w))},Z),J},M.express=function(w){return u(this,w)},M.render=function(w,p,k){y.isFunction(p)&&(k=p,p=null);var K=null;return this.getTemplate(w,function(P,$){if(P&&k)o(k,P);else{if(P)throw P;K=$.render(p,k)}}),K},M.renderString=function(w,p,k,K){y.isFunction(k)&&(K=k,k={}),k=k||{};var P=new L(w,this,k.path);return P.render(p,K)},M.waterfall=function(w,p,k){return n(w,p,k)},I}(f),v=function(F){d(I,F);function I(){return F.apply(this,arguments)||this}var M=I.prototype;return M.init=function(w,p,k){var K=this;this.env=k||new h,this.ctx=y.extend({},w),this.blocks={},this.exported=[],y.keys(p).forEach(function(P){K.addBlock(P,p[P])})},M.lookup=function(w){return w in this.env.globals&&!(w in this.ctx)?this.env.globals[w]:this.ctx[w]},M.setVariable=function(w,p){this.ctx[w]=p},M.getVariables=function(){return this.ctx},M.addBlock=function(w,p){return this.blocks[w]=this.blocks[w]||[],this.blocks[w].push(p),this},M.getBlock=function(w){if(!this.blocks[w])throw new Error('unknown block "'+w+'"');return this.blocks[w][0]},M.getSuper=function(w,p,k,K,P,$){var te=y.indexOf(this.blocks[p]||[],k),X=this.blocks[p][te+1],ue=this;if(te===-1||!X)throw new Error('no super block available for "'+p+'"');X(w,ue,K,P,$)},M.addExport=function(w){this.exported.push(w)},M.getExported=function(){var w=this,p={};return this.exported.forEach(function(k){p[k]=w.ctx[k]}),p},I}(m),L=function(F){d(I,F);function I(){return F.apply(this,arguments)||this}var M=I.prototype;return M.init=function(w,p,k,K){if(this.env=p||new h,y.isObject(w))switch(w.type){case"code":this.tmplProps=w.obj;break;case"string":this.tmplStr=w.obj;break;default:throw new Error("Unexpected template object type "+w.type+"; expected 'code', or 'string'")}else if(y.isString(w))this.tmplStr=w;else throw new Error("src must be a string or an object describing the source");if(this.path=k,K)try{this._compile()}catch(P){throw y._prettifyError(this.path,this.env.opts.dev,P)}else this.compiled=!1},M.render=function(w,p,k){var K=this;typeof w=="function"?(k=w,w={}):typeof p=="function"&&(k=p,p=null);var P=!p;try{this.compile()}catch(J){var $=y._prettifyError(this.path,this.env.opts.dev,J);if(k)return o(k,$);throw $}var te=new v(w||{},this.blocks,this.env),X=p?p.push(!0):new a;X.topLevel=!0;var ue=null,ge=!1;return this.rootRenderFunc(this.env,te,X,g,function(J,Z){if(!(ge&&k&&typeof Z<"u"))if(J&&(J=y._prettifyError(K.path,K.env.opts.dev,J),ge=!0),k)P?o(k,J,Z):k(J,Z);else{if(J)throw J;ue=Z}}),ue},M.getExported=function(w,p,k){typeof w=="function"&&(k=w,w={}),typeof p=="function"&&(k=p,p=null);try{this.compile()}catch($){if(k)return k($);throw $}var K=p?p.push():new a;K.topLevel=!0;var P=new v(w||{},this.blocks,this.env);this.rootRenderFunc(this.env,P,K,g,function($){$?k($,null):k(null,P.getExported())})},M.compile=function(){this.compiled||this._compile()},M._compile=function(){var w;if(this.tmplProps)w=this.tmplProps;else{var p=S.compile(this.tmplStr,this.env.asyncFilters,this.env.extensionsList,this.path,this.env.opts),k=new Function(p);w=k()}this.blocks=this._getBlocks(w),this.rootRenderFunc=w.root,this.compiled=!0},M._getBlocks=function(w){var p={};return y.keys(w).forEach(function(k){k.slice(0,2)==="b_"&&(p[k.slice(2)]=w[k])}),p},I}(m);c.exports={Environment:h,Template:L}},function(c,E,_){function d(D,B){D.prototype=Object.create(B.prototype),D.prototype.constructor=D,x(D,B)}function x(D,B){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(R,e){return R.__proto__=e,R},x(D,B)}var l=_(9),n=_(3),y=_(1).Obj,S=_(0),V=function(D){d(B,D);function B(){return D.apply(this,arguments)||this}var O=B.prototype;return O.init=function(e){this.tokens=e,this.peeked=null,this.breakOnBlocks=null,this.dropLeadingWhitespace=!1,this.extensions=[]},O.nextToken=function(e){var r;if(this.peeked)if(!e&&this.peeked.type===l.TOKEN_WHITESPACE)this.peeked=null;else return r=this.peeked,this.peeked=null,r;if(r=this.tokens.nextToken(),!e)for(;r&&r.type===l.TOKEN_WHITESPACE;)r=this.tokens.nextToken();return r},O.peekToken=function(){return this.peeked=this.peeked||this.nextToken(),this.peeked},O.pushToken=function(e){if(this.peeked)throw new Error("pushToken: can only push one token on between reads");this.peeked=e},O.error=function(e,r,i){if(r===void 0||i===void 0){var m=this.peekToken()||{};r=m.lineno,i=m.colno}return r!==void 0&&(r+=1),i!==void 0&&(i+=1),new S.TemplateError(e,r,i)},O.fail=function(e,r,i){throw this.error(e,r,i)},O.skip=function(e){var r=this.nextToken();return!r||r.type!==e?(this.pushToken(r),!1):!0},O.expect=function(e){var r=this.nextToken();return r.type!==e&&this.fail("expected "+e+", got "+r.type,r.lineno,r.colno),r},O.skipValue=function(e,r){var i=this.nextToken();return!i||i.type!==e||i.value!==r?(this.pushToken(i),!1):!0},O.skipSymbol=function(e){return this.skipValue(l.TOKEN_SYMBOL,e)},O.advanceAfterBlockEnd=function(e){var r;return e||(r=this.peekToken(),r||this.fail("unexpected end of file"),r.type!==l.TOKEN_SYMBOL&&this.fail("advanceAfterBlockEnd: expected symbol token or explicit name to be passed"),e=this.nextToken().value),r=this.nextToken(),r&&r.type===l.TOKEN_BLOCK_END?r.value.charAt(0)==="-"&&(this.dropLeadingWhitespace=!0):this.fail("expected block end in "+e+" statement"),r},O.advanceAfterVariableEnd=function(){var e=this.nextToken();e&&e.type===l.TOKEN_VARIABLE_END?this.dropLeadingWhitespace=e.value.charAt(e.value.length-this.tokens.tags.VARIABLE_END.length-1)==="-":(this.pushToken(e),this.fail("expected variable end"))},O.parseFor=function(){var e=this.peekToken(),r,i;this.skipSymbol("for")?(r=new n.For(e.lineno,e.colno),i="endfor"):this.skipSymbol("asyncEach")?(r=new n.AsyncEach(e.lineno,e.colno),i="endeach"):this.skipSymbol("asyncAll")?(r=new n.AsyncAll(e.lineno,e.colno),i="endall"):this.fail("parseFor: expected for{Async}",e.lineno,e.colno),r.name=this.parsePrimary(),r.name instanceof n.Symbol||this.fail("parseFor: variable name expected for loop");var m=this.peekToken().type;if(m===l.TOKEN_COMMA){var f=r.name;for(r.name=new n.Array(f.lineno,f.colno),r.name.addChild(f);this.skip(l.TOKEN_COMMA);){var g=this.parsePrimary();r.name.addChild(g)}}return this.skipSymbol("in")||this.fail('parseFor: expected "in" keyword for loop',e.lineno,e.colno),r.arr=this.parseExpression(),this.advanceAfterBlockEnd(e.value),r.body=this.parseUntilBlocks(i,"else"),this.skipSymbol("else")&&(this.advanceAfterBlockEnd("else"),r.else_=this.parseUntilBlocks(i)),this.advanceAfterBlockEnd(),r},O.parseMacro=function(){var e=this.peekToken();this.skipSymbol("macro")||this.fail("expected macro");var r=this.parsePrimary(!0),i=this.parseSignature(),m=new n.Macro(e.lineno,e.colno,r,i);return this.advanceAfterBlockEnd(e.value),m.body=this.parseUntilBlocks("endmacro"),this.advanceAfterBlockEnd(),m},O.parseCall=function(){var e=this.peekToken();this.skipSymbol("call")||this.fail("expected call");var r=this.parseSignature(!0)||new n.NodeList,i=this.parsePrimary();this.advanceAfterBlockEnd(e.value);var m=this.parseUntilBlocks("endcall");this.advanceAfterBlockEnd();var f=new n.Symbol(e.lineno,e.colno,"caller"),g=new n.Caller(e.lineno,e.colno,f,r,m),t=i.args.children;t[t.length-1]instanceof n.KeywordArgs||t.push(new n.KeywordArgs);var a=t[t.length-1];return a.addChild(new n.Pair(e.lineno,e.colno,f,g)),new n.Output(e.lineno,e.colno,[i])},O.parseWithContext=function(){var e=this.peekToken(),r=null;return this.skipSymbol("with")?r=!0:this.skipSymbol("without")&&(r=!1),r!==null&&(this.skipSymbol("context")||this.fail("parseFrom: expected context after with/without",e.lineno,e.colno)),r},O.parseImport=function(){var e=this.peekToken();this.skipSymbol("import")||this.fail("parseImport: expected import",e.lineno,e.colno);var r=this.parseExpression();this.skipSymbol("as")||this.fail('parseImport: expected "as" keyword',e.lineno,e.colno);var i=this.parseExpression(),m=this.parseWithContext(),f=new n.Import(e.lineno,e.colno,r,i,m);return this.advanceAfterBlockEnd(e.value),f},O.parseFrom=function(){var e=this.peekToken();this.skipSymbol("from")||this.fail("parseFrom: expected from");var r=this.parseExpression();this.skipSymbol("import")||this.fail("parseFrom: expected import",e.lineno,e.colno);for(var i=new n.NodeList,m;;){var f=this.peekToken();if(f.type===l.TOKEN_BLOCK_END){i.children.length||this.fail("parseFrom: Expected at least one import name",e.lineno,e.colno),f.value.charAt(0)==="-"&&(this.dropLeadingWhitespace=!0),this.nextToken();break}i.children.length>0&&!this.skip(l.TOKEN_COMMA)&&this.fail("parseFrom: expected comma",e.lineno,e.colno);var g=this.parsePrimary();if(g.value.charAt(0)==="_"&&this.fail("parseFrom: names starting with an underscore cannot be imported",g.lineno,g.colno),this.skipSymbol("as")){var t=this.parsePrimary();i.addChild(new n.Pair(g.lineno,g.colno,g,t))}else i.addChild(g);m=this.parseWithContext()}return new n.FromImport(e.lineno,e.colno,r,i,m)},O.parseBlock=function(){var e=this.peekToken();this.skipSymbol("block")||this.fail("parseBlock: expected block",e.lineno,e.colno);var r=new n.Block(e.lineno,e.colno);r.name=this.parsePrimary(),r.name instanceof n.Symbol||this.fail("parseBlock: variable name expected",e.lineno,e.colno),this.advanceAfterBlockEnd(e.value),r.body=this.parseUntilBlocks("endblock"),this.skipSymbol("endblock"),this.skipSymbol(r.name.value);var i=this.peekToken();return i||this.fail("parseBlock: expected endblock, got end of file"),this.advanceAfterBlockEnd(i.value),r},O.parseExtends=function(){var e="extends",r=this.peekToken();this.skipSymbol(e)||this.fail("parseTemplateRef: expected "+e);var i=new n.Extends(r.lineno,r.colno);return i.template=this.parseExpression(),this.advanceAfterBlockEnd(r.value),i},O.parseInclude=function(){var e="include",r=this.peekToken();this.skipSymbol(e)||this.fail("parseInclude: expected "+e);var i=new n.Include(r.lineno,r.colno);return i.template=this.parseExpression(),this.skipSymbol("ignore")&&this.skipSymbol("missing")&&(i.ignoreMissing=!0),this.advanceAfterBlockEnd(r.value),i},O.parseIf=function(){var e=this.peekToken(),r;this.skipSymbol("if")||this.skipSymbol("elif")||this.skipSymbol("elseif")?r=new n.If(e.lineno,e.colno):this.skipSymbol("ifAsync")?r=new n.IfAsync(e.lineno,e.colno):this.fail("parseIf: expected if, elif, or elseif",e.lineno,e.colno),r.cond=this.parseExpression(),this.advanceAfterBlockEnd(e.value),r.body=this.parseUntilBlocks("elif","elseif","else","endif");var i=this.peekToken();switch(i&&i.value){case"elseif":case"elif":r.else_=this.parseIf();break;case"else":this.advanceAfterBlockEnd(),r.else_=this.parseUntilBlocks("endif"),this.advanceAfterBlockEnd();break;case"endif":r.else_=null,this.advanceAfterBlockEnd();break;default:this.fail("parseIf: expected elif, else, or endif, got end of file")}return r},O.parseSet=function(){var e=this.peekToken();this.skipSymbol("set")||this.fail("parseSet: expected set",e.lineno,e.colno);for(var r=new n.Set(e.lineno,e.colno,[]),i;(i=this.parsePrimary())&&(r.targets.push(i),!!this.skip(l.TOKEN_COMMA)););return this.skipValue(l.TOKEN_OPERATOR,"=")?(r.value=this.parseExpression(),this.advanceAfterBlockEnd(e.value)):this.skip(l.TOKEN_BLOCK_END)?(r.body=new n.Capture(e.lineno,e.colno,this.parseUntilBlocks("endset")),r.value=null,this.advanceAfterBlockEnd()):this.fail("parseSet: expected = or block end in set tag",e.lineno,e.colno),r},O.parseSwitch=function(){var e="switch",r="endswitch",i="case",m="default",f=this.peekToken();!this.skipSymbol(e)&&!this.skipSymbol(i)&&!this.skipSymbol(m)&&this.fail('parseSwitch: expected "switch," "case" or "default"',f.lineno,f.colno);var g=this.parseExpression();this.advanceAfterBlockEnd(e),this.parseUntilBlocks(i,m,r);var t=this.peekToken(),a=[],u;do{this.skipSymbol(i);var o=this.parseExpression();this.advanceAfterBlockEnd(e);var s=this.parseUntilBlocks(i,m,r);a.push(new n.Case(t.line,t.col,o,s)),t=this.peekToken()}while(t&&t.value===i);switch(t.value){case m:this.advanceAfterBlockEnd(),u=this.parseUntilBlocks(r),this.advanceAfterBlockEnd();break;case r:this.advanceAfterBlockEnd();break;default:this.fail('parseSwitch: expected "case," "default" or "endswitch," got EOF.')}return new n.Switch(f.lineno,f.colno,g,a,u)},O.parseStatement=function(){var e=this.peekToken(),r;if(e.type!==l.TOKEN_SYMBOL&&this.fail("tag name expected",e.lineno,e.colno),this.breakOnBlocks&&S.indexOf(this.breakOnBlocks,e.value)!==-1)return null;switch(e.value){case"raw":return this.parseRaw();case"verbatim":return this.parseRaw("verbatim");case"if":case"ifAsync":return this.parseIf();case"for":case"asyncEach":case"asyncAll":return this.parseFor();case"block":return this.parseBlock();case"extends":return this.parseExtends();case"include":return this.parseInclude();case"set":return this.parseSet();case"macro":return this.parseMacro();case"call":return this.parseCall();case"import":return this.parseImport();case"from":return this.parseFrom();case"filter":return this.parseFilterStatement();case"switch":return this.parseSwitch();default:if(this.extensions.length)for(var i=0;i<this.extensions.length;i++){var m=this.extensions[i];if(S.indexOf(m.tags||[],e.value)!==-1)return m.parse(this,n,l)}this.fail("unknown block tag: "+e.value,e.lineno,e.colno)}return r},O.parseRaw=function(e){e=e||"raw";for(var r="end"+e,i=new RegExp("([\\s\\S]*?){%\\s*("+e+"|"+r+")\\s*(?=%})%}"),m=1,f="",g=null,t=this.advanceAfterBlockEnd();(g=this.tokens._extractRegex(i))&&m>0;){var a=g[0],u=g[1],o=g[2];o===e?m+=1:o===r&&(m-=1),m===0?(f+=u,this.tokens.backN(a.length-u.length)):f+=a}return new n.Output(t.lineno,t.colno,[new n.TemplateData(t.lineno,t.colno,f)])},O.parsePostfix=function(e){for(var r,i=this.peekToken();i;){if(i.type===l.TOKEN_LEFT_PAREN)e=new n.FunCall(i.lineno,i.colno,e,this.parseSignature());else if(i.type===l.TOKEN_LEFT_BRACKET)r=this.parseAggregate(),r.children.length>1&&this.fail("invalid index"),e=new n.LookupVal(i.lineno,i.colno,e,r.children[0]);else if(i.type===l.TOKEN_OPERATOR&&i.value==="."){this.nextToken();var m=this.nextToken();m.type!==l.TOKEN_SYMBOL&&this.fail("expected name as lookup value, got "+m.value,m.lineno,m.colno),r=new n.Literal(m.lineno,m.colno,m.value),e=new n.LookupVal(i.lineno,i.colno,e,r)}else break;i=this.peekToken()}return e},O.parseExpression=function(){var e=this.parseInlineIf();return e},O.parseInlineIf=function(){var e=this.parseOr();if(this.skipSymbol("if")){var r=this.parseOr(),i=e;e=new n.InlineIf(e.lineno,e.colno),e.body=i,e.cond=r,this.skipSymbol("else")?e.else_=this.parseOr():e.else_=null}return e},O.parseOr=function(){for(var e=this.parseAnd();this.skipSymbol("or");){var r=this.parseAnd();e=new n.Or(e.lineno,e.colno,e,r)}return e},O.parseAnd=function(){for(var e=this.parseNot();this.skipSymbol("and");){var r=this.parseNot();e=new n.And(e.lineno,e.colno,e,r)}return e},O.parseNot=function(){var e=this.peekToken();return this.skipSymbol("not")?new n.Not(e.lineno,e.colno,this.parseNot()):this.parseIn()},O.parseIn=function(){for(var e=this.parseIs();;){var r=this.nextToken();if(!r)break;var i=r.type===l.TOKEN_SYMBOL&&r.value==="not";if(i||this.pushToken(r),this.skipSymbol("in")){var m=this.parseIs();e=new n.In(e.lineno,e.colno,e,m),i&&(e=new n.Not(e.lineno,e.colno,e))}else{i&&this.pushToken(r);break}}return e},O.parseIs=function(){var e=this.parseCompare();if(this.skipSymbol("is")){var r=this.skipSymbol("not"),i=this.parseCompare();e=new n.Is(e.lineno,e.colno,e,i),r&&(e=new n.Not(e.lineno,e.colno,e))}return e},O.parseCompare=function(){for(var e=["==","===","!=","!==","<",">","<=",">="],r=this.parseConcat(),i=[];;){var m=this.nextToken();if(m)if(e.indexOf(m.value)!==-1)i.push(new n.CompareOperand(m.lineno,m.colno,this.parseConcat(),m.value));else{this.pushToken(m);break}else break}return i.length?new n.Compare(i[0].lineno,i[0].colno,r,i):r},O.parseConcat=function(){for(var e=this.parseAdd();this.skipValue(l.TOKEN_TILDE,"~");){var r=this.parseAdd();e=new n.Concat(e.lineno,e.colno,e,r)}return e},O.parseAdd=function(){for(var e=this.parseSub();this.skipValue(l.TOKEN_OPERATOR,"+");){var r=this.parseSub();e=new n.Add(e.lineno,e.colno,e,r)}return e},O.parseSub=function(){for(var e=this.parseMul();this.skipValue(l.TOKEN_OPERATOR,"-");){var r=this.parseMul();e=new n.Sub(e.lineno,e.colno,e,r)}return e},O.parseMul=function(){for(var e=this.parseDiv();this.skipValue(l.TOKEN_OPERATOR,"*");){var r=this.parseDiv();e=new n.Mul(e.lineno,e.colno,e,r)}return e},O.parseDiv=function(){for(var e=this.parseFloorDiv();this.skipValue(l.TOKEN_OPERATOR,"/");){var r=this.parseFloorDiv();e=new n.Div(e.lineno,e.colno,e,r)}return e},O.parseFloorDiv=function(){for(var e=this.parseMod();this.skipValue(l.TOKEN_OPERATOR,"//");){var r=this.parseMod();e=new n.FloorDiv(e.lineno,e.colno,e,r)}return e},O.parseMod=function(){for(var e=this.parsePow();this.skipValue(l.TOKEN_OPERATOR,"%");){var r=this.parsePow();e=new n.Mod(e.lineno,e.colno,e,r)}return e},O.parsePow=function(){for(var e=this.parseUnary();this.skipValue(l.TOKEN_OPERATOR,"**");){var r=this.parseUnary();e=new n.Pow(e.lineno,e.colno,e,r)}return e},O.parseUnary=function(e){var r=this.peekToken(),i;return this.skipValue(l.TOKEN_OPERATOR,"-")?i=new n.Neg(r.lineno,r.colno,this.parseUnary(!0)):this.skipValue(l.TOKEN_OPERATOR,"+")?i=new n.Pos(r.lineno,r.colno,this.parseUnary(!0)):i=this.parsePrimary(),e||(i=this.parseFilter(i)),i},O.parsePrimary=function(e){var r=this.nextToken(),i,m=null;if(r?r.type===l.TOKEN_STRING?i=r.value:r.type===l.TOKEN_INT?i=parseInt(r.value,10):r.type===l.TOKEN_FLOAT?i=parseFloat(r.value):r.type===l.TOKEN_BOOLEAN?r.value==="true"?i=!0:r.value==="false"?i=!1:this.fail("invalid boolean: "+r.value,r.lineno,r.colno):r.type===l.TOKEN_NONE?i=null:r.type===l.TOKEN_REGEX&&(i=new RegExp(r.value.body,r.value.flags)):this.fail("expected expression, got end of file"),i!==void 0?m=new n.Literal(r.lineno,r.colno,i):r.type===l.TOKEN_SYMBOL?m=new n.Symbol(r.lineno,r.colno,r.value):(this.pushToken(r),m=this.parseAggregate()),e||(m=this.parsePostfix(m)),m)return m;throw this.error("unexpected token: "+r.value,r.lineno,r.colno)},O.parseFilterName=function(){for(var e=this.expect(l.TOKEN_SYMBOL),r=e.value;this.skipValue(l.TOKEN_OPERATOR,".");)r+="."+this.expect(l.TOKEN_SYMBOL).value;return new n.Symbol(e.lineno,e.colno,r)},O.parseFilterArgs=function(e){if(this.peekToken().type===l.TOKEN_LEFT_PAREN){var r=this.parsePostfix(e);return r.args.children}return[]},O.parseFilter=function(e){for(;this.skip(l.TOKEN_PIPE);){var r=this.parseFilterName();e=new n.Filter(r.lineno,r.colno,r,new n.NodeList(r.lineno,r.colno,[e].concat(this.parseFilterArgs(e))))}return e},O.parseFilterStatement=function(){var e=this.peekToken();this.skipSymbol("filter")||this.fail("parseFilterStatement: expected filter");var r=this.parseFilterName(),i=this.parseFilterArgs(r);this.advanceAfterBlockEnd(e.value);var m=new n.Capture(r.lineno,r.colno,this.parseUntilBlocks("endfilter"));this.advanceAfterBlockEnd();var f=new n.Filter(r.lineno,r.colno,r,new n.NodeList(r.lineno,r.colno,[m].concat(i)));return new n.Output(r.lineno,r.colno,[f])},O.parseAggregate=function(){var e=this.nextToken(),r;switch(e.type){case l.TOKEN_LEFT_PAREN:r=new n.Group(e.lineno,e.colno);break;case l.TOKEN_LEFT_BRACKET:r=new n.Array(e.lineno,e.colno);break;case l.TOKEN_LEFT_CURLY:r=new n.Dict(e.lineno,e.colno);break;default:return null}for(;;){var i=this.peekToken().type;if(i===l.TOKEN_RIGHT_PAREN||i===l.TOKEN_RIGHT_BRACKET||i===l.TOKEN_RIGHT_CURLY){this.nextToken();break}if(r.children.length>0&&(this.skip(l.TOKEN_COMMA)||this.fail("parseAggregate: expected comma after expression",e.lineno,e.colno)),r instanceof n.Dict){var m=this.parsePrimary();this.skip(l.TOKEN_COLON)||this.fail("parseAggregate: expected colon after dict key",e.lineno,e.colno);var f=this.parseExpression();r.addChild(new n.Pair(m.lineno,m.colno,m,f))}else{var g=this.parseExpression();r.addChild(g)}}return r},O.parseSignature=function(e,r){var i=this.peekToken();if(!r&&i.type!==l.TOKEN_LEFT_PAREN){if(e)return null;this.fail("expected arguments",i.lineno,i.colno)}i.type===l.TOKEN_LEFT_PAREN&&(i=this.nextToken());for(var m=new n.NodeList(i.lineno,i.colno),f=new n.KeywordArgs(i.lineno,i.colno),g=!1;;){if(i=this.peekToken(),!r&&i.type===l.TOKEN_RIGHT_PAREN){this.nextToken();break}else if(r&&i.type===l.TOKEN_BLOCK_END)break;if(g&&!this.skip(l.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",i.lineno,i.colno);else{var t=this.parseExpression();this.skipValue(l.TOKEN_OPERATOR,"=")?f.addChild(new n.Pair(t.lineno,t.colno,t,this.parseExpression())):m.addChild(t)}g=!0}return f.children.length&&m.addChild(f),m},O.parseUntilBlocks=function(){for(var e=this.breakOnBlocks,r=arguments.length,i=new Array(r),m=0;m<r;m++)i[m]=arguments[m];this.breakOnBlocks=i;var f=this.parse();return this.breakOnBlocks=e,f},O.parseNodes=function(){for(var e,r=[];e=this.nextToken();)if(e.type===l.TOKEN_DATA){var i=e.value,m=this.peekToken(),f=m&&m.value;this.dropLeadingWhitespace&&(i=i.replace(/^\s*/,""),this.dropLeadingWhitespace=!1),m&&(m.type===l.TOKEN_BLOCK_START&&f.charAt(f.length-1)==="-"||m.type===l.TOKEN_VARIABLE_START&&f.charAt(this.tokens.tags.VARIABLE_START.length)==="-"||m.type===l.TOKEN_COMMENT&&f.charAt(this.tokens.tags.COMMENT_START.length)==="-")&&(i=i.replace(/\s*$/,"")),r.push(new n.Output(e.lineno,e.colno,[new n.TemplateData(e.lineno,e.colno,i)]))}else if(e.type===l.TOKEN_BLOCK_START){this.dropLeadingWhitespace=!1;var g=this.parseStatement();if(!g)break;r.push(g)}else if(e.type===l.TOKEN_VARIABLE_START){var t=this.parseExpression();this.dropLeadingWhitespace=!1,this.advanceAfterVariableEnd(),r.push(new n.Output(e.lineno,e.colno,[t]))}else e.type===l.TOKEN_COMMENT?this.dropLeadingWhitespace=e.value.charAt(e.value.length-this.tokens.tags.COMMENT_END.length-1)==="-":this.fail("Unexpected token at top-level: "+e.type,e.lineno,e.colno);return r},O.parse=function(){return new n.NodeList(0,0,this.parseNodes())},O.parseAsRoot=function(){return new n.Root(0,0,this.parseNodes())},B}(y);c.exports={parse:function(B,O,R){var e=new V(l.lex(B,R));return O!==void 0&&(e.extensions=O),e.parseAsRoot()},Parser:V}},function(c,E,_){var d=_(0),x=`
|
|
17
|
+
\r `,l="()[]{}%*-+~/#,:|.<>=!",n="0123456789",y="{%",S="%}",V="{{",D="}}",B="{#",O="#}",R="string",e="whitespace",r="data",i="block-start",m="block-end",f="variable-start",g="variable-end",t="comment",a="left-paren",u="right-paren",o="left-bracket",s="right-bracket",h="left-curly",v="right-curly",L="operator",F="comma",I="colon",M="tilde",U="pipe",w="int",p="float",k="boolean",K="none",P="symbol",$="special",te="regex";function X(ge,J,Z,H){return{type:ge,value:J,lineno:Z,colno:H}}var ue=function(){function ge(Z,H){this.str=Z,this.index=0,this.len=Z.length,this.lineno=0,this.colno=0,this.in_code=!1,H=H||{};var Q=H.tags||{};this.tags={BLOCK_START:Q.blockStart||y,BLOCK_END:Q.blockEnd||S,VARIABLE_START:Q.variableStart||V,VARIABLE_END:Q.variableEnd||D,COMMENT_START:Q.commentStart||B,COMMENT_END:Q.commentEnd||O},this.trimBlocks=!!H.trimBlocks,this.lstripBlocks=!!H.lstripBlocks}var J=ge.prototype;return J.nextToken=function(){var H=this.lineno,Q=this.colno,Y;if(this.in_code){var ce=this.current();if(this.isFinished())return null;if(ce==='"'||ce==="'")return X(R,this._parseString(ce),H,Q);if(Y=this._extract(x))return X(e,Y,H,Q);if((Y=this._extractString(this.tags.BLOCK_END))||(Y=this._extractString("-"+this.tags.BLOCK_END)))return this.in_code=!1,this.trimBlocks&&(ce=this.current(),ce===`
|
|
18
|
+
`?this.forward():ce==="\r"&&(this.forward(),ce=this.current(),ce===`
|
|
19
|
+
`?this.forward():this.back())),X(m,Y,H,Q);if((Y=this._extractString(this.tags.VARIABLE_END))||(Y=this._extractString("-"+this.tags.VARIABLE_END)))return this.in_code=!1,X(g,Y,H,Q);if(ce==="r"&&this.str.charAt(this.index+1)==="/"){this.forwardN(2);for(var he="";!this.isFinished();)if(this.current()==="/"&&this.previous()!=="\\"){this.forward();break}else he+=this.current(),this.forward();for(var _e=["g","i","m","y"],Se="";!this.isFinished();){var b=_e.indexOf(this.current())!==-1;if(b)Se+=this.current(),this.forward();else break}return X(te,{body:he,flags:Se},H,Q)}else if(l.indexOf(ce)!==-1){this.forward();var j=["==","===","!=","!==","<=",">=","//","**"],z=ce+this.current(),G;switch(d.indexOf(j,z)!==-1&&(this.forward(),ce=z,d.indexOf(j,z+this.current())!==-1&&(ce=z+this.current(),this.forward())),ce){case"(":G=a;break;case")":G=u;break;case"[":G=o;break;case"]":G=s;break;case"{":G=h;break;case"}":G=v;break;case",":G=F;break;case":":G=I;break;case"~":G=M;break;case"|":G=U;break;default:G=L}return X(G,ce,H,Q)}else if(Y=this._extractUntil(x+l),Y.match(/^[-+]?[0-9]+$/))if(this.current()==="."){this.forward();var ie=this._extract(n);return X(p,Y+"."+ie,H,Q)}else return X(w,Y,H,Q);else{if(Y.match(/^(true|false)$/))return X(k,Y,H,Q);if(Y==="none")return X(K,Y,H,Q);if(Y==="null")return X(K,Y,H,Q);if(Y)return X(P,Y,H,Q);throw new Error("Unexpected value while parsing: "+Y)}}else{var ae=this.tags.BLOCK_START.charAt(0)+this.tags.VARIABLE_START.charAt(0)+this.tags.COMMENT_START.charAt(0)+this.tags.COMMENT_END.charAt(0);if(this.isFinished())return null;if((Y=this._extractString(this.tags.BLOCK_START+"-"))||(Y=this._extractString(this.tags.BLOCK_START)))return this.in_code=!0,X(i,Y,H,Q);if((Y=this._extractString(this.tags.VARIABLE_START+"-"))||(Y=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,X(f,Y,H,Q);Y="";var we,fe=!1;for(this._matches(this.tags.COMMENT_START)&&(fe=!0,Y=this._extractString(this.tags.COMMENT_START));(we=this._extractUntil(ae))!==null;)if(Y+=we,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!fe){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=Y.length){var be=Y.slice(-this.colno);if(/^\s+$/.test(be)&&(Y=Y.slice(0,-this.colno),!Y.length))return this.nextToken()}break}else if(this._matches(this.tags.COMMENT_END)){if(!fe)throw new Error("unexpected end of comment");Y+=this._extractString(this.tags.COMMENT_END);break}else Y+=this.current(),this.forward();if(we===null&&fe)throw new Error("expected end of comment, got end of file");return X(fe?t:r,Y,H,Q)}},J._parseString=function(H){this.forward();for(var Q="";!this.isFinished()&&this.current()!==H;){var Y=this.current();if(Y==="\\"){switch(this.forward(),this.current()){case"n":Q+=`
|
|
20
|
+
`;break;case"t":Q+=" ";break;case"r":Q+="\r";break;default:Q+=this.current()}this.forward()}else Q+=Y,this.forward()}return this.forward(),Q},J._matches=function(H){if(this.index+H.length>this.len)return null;var Q=this.str.slice(this.index,this.index+H.length);return Q===H},J._extractString=function(H){return this._matches(H)?(this.forwardN(H.length),H):null},J._extractUntil=function(H){return this._extractMatching(!0,H||"")},J._extract=function(H){return this._extractMatching(!1,H)},J._extractMatching=function(H,Q){if(this.isFinished())return null;var Y=Q.indexOf(this.current());if(H&&Y===-1||!H&&Y!==-1){var ce=this.current();this.forward();for(var he=Q.indexOf(this.current());(H&&he===-1||!H&&he!==-1)&&!this.isFinished();)ce+=this.current(),this.forward(),he=Q.indexOf(this.current());return ce}return""},J._extractRegex=function(H){var Q=this.currentStr().match(H);return Q?(this.forwardN(Q[0].length),Q):null},J.isFinished=function(){return this.index>=this.len},J.forwardN=function(H){for(var Q=0;Q<H;Q++)this.forward()},J.forward=function(){this.index++,this.previous()===`
|
|
21
|
+
`?(this.lineno++,this.colno=0):this.colno++},J.backN=function(H){for(var Q=0;Q<H;Q++)this.back()},J.back=function(){if(this.index--,this.current()===`
|
|
22
|
+
`){this.lineno--;var H=this.src.lastIndexOf(`
|
|
23
|
+
`,this.index-1);H===-1?this.colno=this.index:this.colno=this.index-H}else this.colno--},J.current=function(){return this.isFinished()?"":this.str.charAt(this.index)},J.currentStr=function(){return this.isFinished()?"":this.str.substr(this.index)},J.previous=function(){return this.str.charAt(this.index-1)},ge}();c.exports={lex:function(J,Z){return new ue(J,Z)},TOKEN_STRING:R,TOKEN_WHITESPACE:e,TOKEN_DATA:r,TOKEN_BLOCK_START:i,TOKEN_BLOCK_END:m,TOKEN_VARIABLE_START:f,TOKEN_VARIABLE_END:g,TOKEN_COMMENT:t,TOKEN_LEFT_PAREN:a,TOKEN_RIGHT_PAREN:u,TOKEN_LEFT_BRACKET:o,TOKEN_RIGHT_BRACKET:s,TOKEN_LEFT_CURLY:h,TOKEN_RIGHT_CURLY:v,TOKEN_OPERATOR:L,TOKEN_COMMA:F,TOKEN_COLON:I,TOKEN_TILDE:M,TOKEN_PIPE:U,TOKEN_INT:w,TOKEN_FLOAT:p,TOKEN_BOOLEAN:k,TOKEN_NONE:K,TOKEN_SYMBOL:P,TOKEN_SPECIAL:$,TOKEN_REGEX:te}},function(c,E,_){function d(V,D){V.prototype=Object.create(D.prototype),V.prototype.constructor=V,x(V,D)}function x(V,D){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(O,R){return O.__proto__=R,O},x(V,D)}var l=_(6),n=_(19),y=n.PrecompiledLoader,S=function(V){d(D,V);function D(O,R){var e;return e=V.call(this)||this,e.baseURL=O||".",R=R||{},e.useCache=!!R.useCache,e.async=!!R.async,e}var B=D.prototype;return B.resolve=function(R,e){throw new Error("relative templates not support in the browser yet")},B.getSource=function(R,e){var r=this,i=this.useCache,m;return this.fetch(this.baseURL+"/"+R,function(f,g){if(f)if(e)e(f.content);else if(f.status===404)m=null;else throw f.content;else m={src:g,path:R,noCache:!i},r.emit("load",R,m),e&&e(null,m)}),m},B.fetch=function(R,e){if(typeof window>"u")throw new Error("WebLoader can only by used in a browser");var r=new XMLHttpRequest,i=!0;r.onreadystatechange=function(){r.readyState===4&&i&&(i=!1,r.status===0||r.status===200?e(null,r.responseText):e({status:r.status,content:r.responseText}))},R+=(R.indexOf("?")===-1?"?":"&")+"s="+new Date().getTime(),r.open("GET",R,this.async),r.send()},D}(l);c.exports={WebLoader:S,PrecompiledLoader:y}},function(c,E,_){var d=_(0),x=_(7),l=x.Environment,n=x.Template,y=_(6),S=_(10),V=_(23),D=_(5),B=_(8),O=_(9),R=_(2),e=_(3),r=_(25),i;function m(f,g){g=g||{},d.isObject(f)&&(g=f,f=null);var t;return S.FileSystemLoader?t=new S.FileSystemLoader(f,{watch:g.watch,noCache:g.noCache}):S.WebLoader&&(t=new S.WebLoader(f,{useCache:g.web&&g.web.useCache,async:g.web&&g.web.async})),i=new l(t,g),g&&g.express&&i.express(g.express),i}c.exports={Environment:l,Template:n,Loader:y,FileSystemLoader:S.FileSystemLoader,NodeResolveLoader:S.NodeResolveLoader,PrecompiledLoader:S.PrecompiledLoader,WebLoader:S.WebLoader,compiler:D,parser:B,lexer:O,runtime:R,lib:d,nodes:e,installJinjaCompat:r,configure:m,reset:function(){i=void 0},compile:function(g,t,a,u){return i||m(),new n(g,t,a,u)},render:function(g,t,a){return i||m(),i.render(g,t,a)},renderString:function(g,t,a){return i||m(),i.renderString(g,t,a)},precompile:V?V.precompile:void 0,precompileString:V?V.precompileString:void 0}},function(c,E,_){var d=_(13),x=[],l=[],n=d.makeRequestCallFromTimer(y);function y(){if(l.length)throw l.shift()}c.exports=S;function S(D){var B;x.length?B=x.pop():B=new V,B.task=D,d(B)}function V(){this.task=null}V.prototype.call=function(){try{this.task.call()}catch(D){S.onerror?S.onerror(D):(l.push(D),n())}finally{this.task=null,x[x.length]=this}}},function(c,E,_){(function(d){c.exports=x;function x(e){l.length||n(),l[l.length]=e}var l=[],n,y=0,S=1024;function V(){for(;y<l.length;){var e=y;if(y=y+1,l[e].call(),y>S){for(var r=0,i=l.length-y;r<i;r++)l[r]=l[r+y];l.length-=y,y=0}}l.length=0,y=0}var D=typeof d<"u"?d:self,B=D.MutationObserver||D.WebKitMutationObserver;typeof B=="function"?n=O(V):n=R(V),x.requestFlush=n;function O(e){var r=1,i=new B(e),m=document.createTextNode("");return i.observe(m,{characterData:!0}),function(){r=-r,m.data=r}}function R(e){return function(){var i=setTimeout(f,0),m=setInterval(f,50);function f(){clearTimeout(i),clearInterval(m),e()}}}x.makeRequestCallFromTimer=R}).call(E,_(14))},function(c,E){var _;_=function(){return this}();try{_=_||Function("return this")()||(0,eval)("this")}catch{typeof window=="object"&&(_=window)}c.exports=_},function(c,E,_){var d,x;(function(l){var n=function(){var B=Array.prototype.slice.call(arguments);typeof B[0]=="function"&&B[0].apply(null,B.splice(1))},y=function(B){typeof setImmediate=="function"?setImmediate(B):typeof process<"u"&&process.nextTick?process.nextTick(B):setTimeout(B,0)},S=function(B){var O=function(R){var e=function(){return B.length&&B[R].apply(null,arguments),e.next()};return e.next=function(){return R<B.length-1?O(R+1):null},e};return O(0)},V=Array.isArray||function(B){return Object.prototype.toString.call(B)==="[object Array]"},D=function(B,O,R){var e=R?y:n;if(O=O||function(){},!V(B)){var r=new Error("First argument to waterfall must be an array of functions");return O(r)}if(!B.length)return O();var i=function(m){return function(f){if(f)O.apply(null,arguments),O=function(){};else{var g=Array.prototype.slice.call(arguments,1),t=m.next();t?g.push(i(t)):g.push(O),e(function(){m.apply(null,g)})}}};i(S(B))()};d=[],x=(function(){return D}).apply(E,d),x!==void 0&&(c.exports=x)})()},function(c,E,_){var d=typeof Reflect=="object"?Reflect:null,x=d&&typeof d.apply=="function"?d.apply:function(s,h,v){return Function.prototype.apply.call(s,h,v)},l;d&&typeof d.ownKeys=="function"?l=d.ownKeys:Object.getOwnPropertySymbols?l=function(s){return Object.getOwnPropertyNames(s).concat(Object.getOwnPropertySymbols(s))}:l=function(s){return Object.getOwnPropertyNames(s)};function n(o){console&&console.warn&&console.warn(o)}var y=Number.isNaN||function(s){return s!==s};function S(){S.init.call(this)}c.exports=S,c.exports.once=t,S.EventEmitter=S,S.prototype._events=void 0,S.prototype._eventsCount=0,S.prototype._maxListeners=void 0;var V=10;function D(o){if(typeof o!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof o)}Object.defineProperty(S,"defaultMaxListeners",{enumerable:!0,get:function(){return V},set:function(o){if(typeof o!="number"||o<0||y(o))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+o+".");V=o}}),S.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},S.prototype.setMaxListeners=function(s){if(typeof s!="number"||s<0||y(s))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+s+".");return this._maxListeners=s,this};function B(o){return o._maxListeners===void 0?S.defaultMaxListeners:o._maxListeners}S.prototype.getMaxListeners=function(){return B(this)},S.prototype.emit=function(s){for(var h=[],v=1;v<arguments.length;v++)h.push(arguments[v]);var L=s==="error",F=this._events;if(F!==void 0)L=L&&F.error===void 0;else if(!L)return!1;if(L){var I;if(h.length>0&&(I=h[0]),I instanceof Error)throw I;var M=new Error("Unhandled error."+(I?" ("+I.message+")":""));throw M.context=I,M}var U=F[s];if(U===void 0)return!1;if(typeof U=="function")x(U,this,h);else for(var w=U.length,p=m(U,w),v=0;v<w;++v)x(p[v],this,h);return!0};function O(o,s,h,v){var L,F,I;if(D(h),F=o._events,F===void 0?(F=o._events=Object.create(null),o._eventsCount=0):(F.newListener!==void 0&&(o.emit("newListener",s,h.listener?h.listener:h),F=o._events),I=F[s]),I===void 0)I=F[s]=h,++o._eventsCount;else if(typeof I=="function"?I=F[s]=v?[h,I]:[I,h]:v?I.unshift(h):I.push(h),L=B(o),L>0&&I.length>L&&!I.warned){I.warned=!0;var M=new Error("Possible EventEmitter memory leak detected. "+I.length+" "+String(s)+" listeners added. Use emitter.setMaxListeners() to increase limit");M.name="MaxListenersExceededWarning",M.emitter=o,M.type=s,M.count=I.length,n(M)}return o}S.prototype.addListener=function(s,h){return O(this,s,h,!1)},S.prototype.on=S.prototype.addListener,S.prototype.prependListener=function(s,h){return O(this,s,h,!0)};function R(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function e(o,s,h){var v={fired:!1,wrapFn:void 0,target:o,type:s,listener:h},L=R.bind(v);return L.listener=h,v.wrapFn=L,L}S.prototype.once=function(s,h){return D(h),this.on(s,e(this,s,h)),this},S.prototype.prependOnceListener=function(s,h){return D(h),this.prependListener(s,e(this,s,h)),this},S.prototype.removeListener=function(s,h){var v,L,F,I,M;if(D(h),L=this._events,L===void 0)return this;if(v=L[s],v===void 0)return this;if(v===h||v.listener===h)--this._eventsCount===0?this._events=Object.create(null):(delete L[s],L.removeListener&&this.emit("removeListener",s,v.listener||h));else if(typeof v!="function"){for(F=-1,I=v.length-1;I>=0;I--)if(v[I]===h||v[I].listener===h){M=v[I].listener,F=I;break}if(F<0)return this;F===0?v.shift():f(v,F),v.length===1&&(L[s]=v[0]),L.removeListener!==void 0&&this.emit("removeListener",s,M||h)}return this},S.prototype.off=S.prototype.removeListener,S.prototype.removeAllListeners=function(s){var h,v,L;if(v=this._events,v===void 0)return this;if(v.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):v[s]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete v[s]),this;if(arguments.length===0){var F=Object.keys(v),I;for(L=0;L<F.length;++L)I=F[L],I!=="removeListener"&&this.removeAllListeners(I);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(h=v[s],typeof h=="function")this.removeListener(s,h);else if(h!==void 0)for(L=h.length-1;L>=0;L--)this.removeListener(s,h[L]);return this};function r(o,s,h){var v=o._events;if(v===void 0)return[];var L=v[s];return L===void 0?[]:typeof L=="function"?h?[L.listener||L]:[L]:h?g(L):m(L,L.length)}S.prototype.listeners=function(s){return r(this,s,!0)},S.prototype.rawListeners=function(s){return r(this,s,!1)},S.listenerCount=function(o,s){return typeof o.listenerCount=="function"?o.listenerCount(s):i.call(o,s)},S.prototype.listenerCount=i;function i(o){var s=this._events;if(s!==void 0){var h=s[o];if(typeof h=="function")return 1;if(h!==void 0)return h.length}return 0}S.prototype.eventNames=function(){return this._eventsCount>0?l(this._events):[]};function m(o,s){for(var h=new Array(s),v=0;v<s;++v)h[v]=o[v];return h}function f(o,s){for(;s+1<o.length;s++)o[s]=o[s+1];o.pop()}function g(o){for(var s=new Array(o.length),h=0;h<s.length;++h)s[h]=o[h].listener||o[h];return s}function t(o,s){return new Promise(function(h,v){function L(I){o.removeListener(s,F),v(I)}function F(){typeof o.removeListener=="function"&&o.removeListener("error",L),h([].slice.call(arguments))}u(o,s,F,{once:!0}),s!=="error"&&a(o,L,{once:!0})})}function a(o,s,h){typeof o.on=="function"&&u(o,"error",s,h)}function u(o,s,h,v){if(typeof o.on=="function")v.once?o.once(s,h):o.on(s,h);else if(typeof o.addEventListener=="function")o.addEventListener(s,function L(F){v.once&&o.removeEventListener(s,L),h(F)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof o)}},function(c,E,_){var d=_(3),x=_(0),l=0;function n(){return"hole_"+l++}function y(i,m){for(var f=null,g=0;g<i.length;g++){var t=m(i[g]);t!==i[g]&&(f||(f=i.slice()),f[g]=t)}return f||i}function S(i,m,f){if(!(i instanceof d.Node))return i;if(!f){var g=m(i);if(g&&g!==i)return g}if(i instanceof d.NodeList){var t=y(i.children,function(h){return S(h,m,f)});t!==i.children&&(i=new d[i.typename](i.lineno,i.colno,t))}else if(i instanceof d.CallExtension){var a=S(i.args,m,f),u=y(i.contentArgs,function(h){return S(h,m,f)});(a!==i.args||u!==i.contentArgs)&&(i=new d[i.typename](i.extName,i.prop,a,u))}else{var o=i.fields.map(function(h){return i[h]}),s=y(o,function(h){return S(h,m,f)});s!==o&&(i=new d[i.typename](i.lineno,i.colno),s.forEach(function(h,v){i[i.fields[v]]=h}))}return f&&m(i)||i}function V(i,m){return S(i,m,!0)}function D(i,m,f){var g=[],t=V(f?i[f]:i,function(a){var u;return a instanceof d.Block?a:((a instanceof d.Filter&&x.indexOf(m,a.name.value)!==-1||a instanceof d.CallExtensionAsync)&&(u=new d.Symbol(a.lineno,a.colno,n()),g.push(new d.FilterAsync(a.lineno,a.colno,a.name,a.args,u))),u)});return f?i[f]=t:i=t,g.length?(g.push(i),new d.NodeList(i.lineno,i.colno,g)):i}function B(i,m){return V(i,function(f){return f instanceof d.Output?D(f,m):f instanceof d.Set?D(f,m,"value"):f instanceof d.For?D(f,m,"arr"):f instanceof d.If?D(f,m,"cond"):f instanceof d.CallExtension?D(f,m,"args"):void 0})}function O(i){return S(i,function(m){if(m instanceof d.Block){var f=!1,g=n();m.body=S(m.body,function(t){if(t instanceof d.FunCall&&t.name.value==="super")return f=!0,new d.Symbol(t.lineno,t.colno,g)}),f&&m.body.children.unshift(new d.Super(0,0,m.name,new d.Symbol(0,0,g)))}})}function R(i){return V(i,function(m){if(!(!(m instanceof d.If)&&!(m instanceof d.For))){var f=!1;if(S(m,function(g){if(g instanceof d.FilterAsync||g instanceof d.IfAsync||g instanceof d.AsyncEach||g instanceof d.AsyncAll||g instanceof d.CallExtensionAsync)return f=!0,g}),f){if(m instanceof d.If)return new d.IfAsync(m.lineno,m.colno,m.cond,m.body,m.else_);if(m instanceof d.For&&!(m instanceof d.AsyncAll))return new d.AsyncEach(m.lineno,m.colno,m.arr,m.name,m.body,m.else_)}}})}function e(i,m){return R(O(B(i,m)))}function r(i,m){return e(i,m||[])}c.exports={transform:r}},function(c,l,_){var d=_(0),x=_(2),l=c.exports={};function n(b,j){return b==null||b===!1?j:b}l.abs=Math.abs;function y(b){return b!==b}function S(b,j,z){var G,ie=[],ae=[];for(G=0;G<b.length;G++)G%j===0&&ae.length&&(ie.push(ae),ae=[]),ae.push(b[G]);if(ae.length){if(z)for(G=ae.length;G<j;G++)ae.push(z);ie.push(ae)}return ie}l.batch=S;function V(b){b=n(b,"");var j=b.toLowerCase();return x.copySafeness(b,j.charAt(0).toUpperCase()+j.slice(1))}l.capitalize=V;function D(b,j){if(b=n(b,""),j=j||80,b.length>=j)return b;var z=j-b.length,G=d.repeat(" ",z/2-z%2),ie=d.repeat(" ",z/2);return x.copySafeness(b,G+b+ie)}l.center=D;function B(b,j,z){return z?b||j:b!==void 0?b:j}l.default=B;function O(b,j,z){if(!d.isObject(b))throw new d.TemplateError("dictsort filter: val must be an object");var G=[];for(var ie in b)G.push([ie,b[ie]]);var ae;if(z===void 0||z==="key")ae=0;else if(z==="value")ae=1;else throw new d.TemplateError("dictsort filter: You can only sort by either key or value");return G.sort(function(we,fe){var be=we[ae],Ie=fe[ae];return j||(d.isString(be)&&(be=be.toUpperCase()),d.isString(Ie)&&(Ie=Ie.toUpperCase())),be>Ie?1:be===Ie?0:-1}),G}l.dictsort=O;function R(b,j){return JSON.stringify(b,null,j)}l.dump=R;function e(b){return b instanceof x.SafeString?b:(b=b??"",x.markSafe(d.escape(b.toString())))}l.escape=e;function r(b){return b instanceof x.SafeString?b:(b=b??"",x.markSafe(b.toString()))}l.safe=r;function i(b){return b[0]}l.first=i;function m(b){return b=b??"",x.markSafe(d.escape(b.toString()))}l.forceescape=m;function f(b,j){return d.groupBy(b,j,this.env.opts.throwOnUndefined)}l.groupby=f;function g(b,j,z){if(b=n(b,""),b==="")return"";j=j||4;var G=b.split(`
|
|
24
|
+
`),ie=d.repeat(" ",j),ae=G.map(function(we,fe){return fe===0&&!z?we:""+ie+we}).join(`
|
|
25
|
+
`);return x.copySafeness(b,ae)}l.indent=g;function t(b,j,z){return j=j||"",z&&(b=d.map(b,function(G){return G[z]})),b.join(j)}l.join=t;function a(b){return b[b.length-1]}l.last=a;function u(b){var j=n(b,"");return j!==void 0?typeof Map=="function"&&j instanceof Map||typeof Set=="function"&&j instanceof Set?j.size:d.isObject(j)&&!(j instanceof x.SafeString)?d.keys(j).length:j.length:0}l.length=u;function o(b){if(d.isString(b))return b.split("");if(d.isObject(b))return d._entries(b||{}).map(function(j){var z=j[0],G=j[1];return{key:z,value:G}});if(d.isArray(b))return b;throw new d.TemplateError("list filter: type not iterable")}l.list=o;function s(b){return b=n(b,""),b.toLowerCase()}l.lower=s;function h(b){return b==null?"":x.copySafeness(b,b.replace(/\r\n|\n/g,`<br />
|
|
26
|
+
`))}l.nl2br=h;function v(b){return b[Math.floor(Math.random()*b.length)]}l.random=v;function L(b){function j(z,G,ie){G===void 0&&(G="truthy");var ae=this,we=ae.env.getTest(G);return d.toArray(z).filter(function(be){return we.call(ae,be,ie)===b})}return j}l.reject=L(!1);function F(b,j){return b.filter(function(z){return!z[j]})}l.rejectattr=F,l.select=L(!0);function I(b,j){return b.filter(function(z){return!!z[j]})}l.selectattr=I;function M(b,j,z,G){var ie=b;if(j instanceof RegExp)return b.replace(j,z);typeof G>"u"&&(G=-1);var ae="";if(typeof j=="number")j=""+j;else if(typeof j!="string")return b;if(typeof b=="number"&&(b=""+b),typeof b!="string"&&!(b instanceof x.SafeString))return b;if(j==="")return ae=z+b.split("").join(z)+z,x.copySafeness(b,ae);var we=b.indexOf(j);if(G===0||we===-1)return b;for(var fe=0,be=0;we>-1&&(G===-1||be<G);)ae+=b.substring(fe,we)+z,fe=we+j.length,be++,we=b.indexOf(j,fe);return fe<b.length&&(ae+=b.substring(fe)),x.copySafeness(ie,ae)}l.replace=M;function U(b){var j;return d.isString(b)?j=o(b):j=d.map(b,function(z){return z}),j.reverse(),d.isString(b)?x.copySafeness(b,j.join("")):j}l.reverse=U;function w(b,j,z){j=j||0;var G=Math.pow(10,j),ie;return z==="ceil"?ie=Math.ceil:z==="floor"?ie=Math.floor:ie=Math.round,ie(b*G)/G}l.round=w;function p(b,j,z){for(var G=Math.floor(b.length/j),ie=b.length%j,ae=[],we=0,fe=0;fe<j;fe++){var be=we+fe*G;fe<ie&&we++;var Ie=we+(fe+1)*G,Me=b.slice(be,Ie);z&&fe>=ie&&Me.push(z),ae.push(Me)}return ae}l.slice=p;function k(b,j,z){return z===void 0&&(z=0),j&&(b=d.map(b,function(G){return G[j]})),z+b.reduce(function(G,ie){return G+ie},0)}l.sum=k,l.sort=x.makeMacro(["value","reverse","case_sensitive","attribute"],[],function(j,z,G,ie){var ae=this,we=d.map(j,function(be){return be}),fe=d.getAttrGetter(ie);return we.sort(function(be,Ie){var Me=ie?fe(be):be,We=ie?fe(Ie):Ie;if(ae.env.opts.throwOnUndefined&&ie&&(Me===void 0||We===void 0))throw new TypeError('sort: attribute "'+ie+'" resolved to undefined');return!G&&d.isString(Me)&&d.isString(We)&&(Me=Me.toLowerCase(),We=We.toLowerCase()),Me<We?z?1:-1:Me>We?z?-1:1:0}),we});function K(b){return x.copySafeness(b,b)}l.string=K;function P(b,j){b=n(b,"");var z=/<\/?([a-z][a-z0-9]*)\b[^>]*>|<!--[\s\S]*?-->/gi,G=te(b.replace(z,"")),ie="";return j?ie=G.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,`
|
|
27
|
+
`).replace(/\n\n\n+/g,`
|
|
28
|
+
|
|
29
|
+
`):ie=G.replace(/\s+/gi," "),x.copySafeness(b,ie)}l.striptags=P;function $(b){b=n(b,"");var j=b.split(" ").map(function(z){return V(z)});return x.copySafeness(b,j.join(" "))}l.title=$;function te(b){return x.copySafeness(b,b.replace(/^\s*|\s*$/g,""))}l.trim=te;function X(b,j,z,G){var ie=b;if(b=n(b,""),j=j||255,b.length<=j)return b;if(z)b=b.substring(0,j);else{var ae=b.lastIndexOf(" ",j);ae===-1&&(ae=j),b=b.substring(0,ae)}return b+=G??"...",x.copySafeness(ie,b)}l.truncate=X;function ue(b){return b=n(b,""),b.toUpperCase()}l.upper=ue;function ge(b){var j=encodeURIComponent;if(d.isString(b))return j(b);var z=d.isArray(b)?b:d._entries(b);return z.map(function(G){var ie=G[0],ae=G[1];return j(ie)+"="+j(ae)}).join("&")}l.urlencode=ge;var J=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,Z=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,H=/^https?:\/\/.*$/,Q=/^www\./,Y=/\.(?:org|net|com)(?:\:|\/|$)/;function ce(b,j,z){y(j)&&(j=1/0);var G=z===!0?' rel="nofollow"':"",ie=b.split(/(\s+)/).filter(function(ae){return ae&&ae.length}).map(function(ae){var we=ae.match(J),fe=we?we[1]:ae,be=fe.substr(0,j);return H.test(fe)?'<a href="'+fe+'"'+G+">"+be+"</a>":Q.test(fe)?'<a href="http://'+fe+'"'+G+">"+be+"</a>":Z.test(fe)?'<a href="mailto:'+fe+'">'+fe+"</a>":Y.test(fe)?'<a href="http://'+fe+'"'+G+">"+be+"</a>":ae});return ie.join("")}l.urlize=ce;function he(b){b=n(b,"");var j=b?b.match(/\w+/g):null;return j?j.length:null}l.wordcount=he;function _e(b,j){var z=parseFloat(b);return y(z)?j:z}l.float=_e;var Se=x.makeMacro(["value","default","base"],[],function(j,z,G){G===void 0&&(G=10);var ie=parseInt(j,G);return y(ie)?z:ie});l.int=Se,l.d=l.default,l.e=l.escape},function(c,E,_){function d(y,S){y.prototype=Object.create(S.prototype),y.prototype.constructor=y,x(y,S)}function x(y,S){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(D,B){return D.__proto__=B,D},x(y,S)}var l=_(6),n=function(y){d(S,y);function S(D){var B;return B=y.call(this)||this,B.precompiled=D||{},B}var V=S.prototype;return V.getSource=function(B){return this.precompiled[B]?{src:{type:"code",obj:this.precompiled[B]},path:B}:null},S}(l);c.exports={PrecompiledLoader:n}},function(c,E,_){var d=_(2).SafeString;function x(v){return typeof v=="function"}E.callable=x;function l(v){return v!==void 0}E.defined=l;function n(v,L){return v%L===0}E.divisibleby=n;function y(v){return v instanceof d}E.escaped=y;function S(v,L){return v===L}E.equalto=S,E.eq=E.equalto,E.sameas=E.equalto;function V(v){return v%2===0}E.even=V;function D(v){return!v}E.falsy=D;function B(v,L){return v>=L}E.ge=B;function O(v,L){return v>L}E.greaterthan=O,E.gt=E.greaterthan;function R(v,L){return v<=L}E.le=R;function e(v,L){return v<L}E.lessthan=e,E.lt=E.lessthan;function r(v){return v.toLowerCase()===v}E.lower=r;function i(v,L){return v!==L}E.ne=i;function m(v){return v===null}E.null=m;function f(v){return typeof v=="number"}E.number=f;function g(v){return v%2===1}E.odd=g;function t(v){return typeof v=="string"}E.string=t;function a(v){return!!v}E.truthy=a;function u(v){return v===void 0}E.undefined=u;function o(v){return v.toUpperCase()===v}E.upper=o;function s(v){return typeof Symbol<"u"?!!v[Symbol.iterator]:Array.isArray(v)||typeof v=="string"}E.iterable=s;function h(v){var L=v!=null&&typeof v=="object"&&!Array.isArray(v);return Set?L&&!(v instanceof Set):L}E.mapping=h},function(c,E,_){function d(n){var y=-1;return{current:null,reset:function(){y=-1,this.current=null},next:function(){return y++,y>=n.length&&(y=0),this.current=n[y],this.current}}}function x(n){n=n||",";var y=!0;return function(){var S=y?"":n;return y=!1,S}}function l(){return{range:function(y,S,V){typeof S>"u"?(S=y,y=0,V=1):V||(V=1);var D=[];if(V>0)for(var B=y;B<S;B+=V)D.push(B);else for(var O=y;O>S;O+=V)D.push(O);return D},cycler:function(){return d(Array.prototype.slice.call(arguments))},joiner:function(y){return x(y)}}}c.exports=l},function(c,E,_){var d=_(4);c.exports=function(l,n){function y(S,V){if(this.name=S,this.path=S,this.defaultEngine=V.defaultEngine,this.ext=d.extname(S),!this.ext&&!this.defaultEngine)throw new Error("No default engine was specified and no extension was provided.");this.ext||(this.name+=this.ext=(this.defaultEngine[0]!=="."?".":"")+this.defaultEngine)}return y.prototype.render=function(V,D){l.render(this.name,V,D)},n.set("view",y),n.set("nunjucksEnv",l),l}},function(c,E,_){var d=_(4),x=_(4),l=_(0),n=l._prettifyError,y=_(5),S=_(7),V=S.Environment,D=_(24);function B(r,i){return Array.isArray(i)?i.some(function(m){return r.match(m)}):!1}function O(r,i){i=i||{},i.isString=!0;var m=i.env||new V([]),f=i.wrapper||D;if(!i.name)throw new Error('the "name" option is required when compiling a string');return f([e(r,i.name,m)],i)}function R(r,i){i=i||{};var m=i.env||new V([]),f=i.wrapper||D;if(i.isString)return O(r,i);var g=d.existsSync(r)&&d.statSync(r),t=[],a=[];function u(h){d.readdirSync(h).forEach(function(v){var L=x.join(h,v),F=L.substr(x.join(r,"/").length),I=d.statSync(L);I&&I.isDirectory()?(F+="/",B(F,i.exclude)||u(L)):B(F,i.include)&&a.push(L)})}if(g.isFile())t.push(e(d.readFileSync(r,"utf-8"),i.name||r,m));else if(g.isDirectory()){u(r);for(var o=0;o<a.length;o++){var s=a[o].replace(x.join(r,"/"),"");try{t.push(e(d.readFileSync(a[o],"utf-8"),s,m))}catch(h){if(i.force)console.error(h);else throw h}}}return f(t,i)}function e(r,i,m){m=m||new V([]);var f=m.asyncFilters,g=m.extensionsList,t;i=i.replace(/\\/g,"/");try{t=y.compile(r,f,g,i,m.opts)}catch(a){throw n(i,!1,a)}return{name:i,template:t}}c.exports={precompile:R,precompileString:O}},function(c,E,_){function d(x,l){var n="";l=l||{};for(var y=0;y<x.length;y++){var S=JSON.stringify(x[y].name),V=x[y].template;n+="(function() {(window.nunjucksPrecompiled = window.nunjucksPrecompiled || {})["+S+`] = (function() {
|
|
30
|
+
`+V+`
|
|
31
|
+
})();
|
|
32
|
+
`,l.asFunction&&(n+="return function(ctx, cb) { return nunjucks.render("+S+`, ctx, cb); }
|
|
33
|
+
`),n+=`})();
|
|
34
|
+
`}return n}c.exports=d},function(c,E,_){function d(){var x=this.runtime,l=this.lib,n=this.compiler.Compiler,y=this.parser.Parser,S=this.nodes,V=this.lexer,D=x.contextOrFrameLookup,B=x.memberLookup,O,R;n&&(O=n.prototype.assertType),y&&(R=y.prototype.parseAggregate);function e(){x.contextOrFrameLookup=D,x.memberLookup=B,n&&(n.prototype.assertType=O),y&&(y.prototype.parseAggregate=R)}x.contextOrFrameLookup=function(u,o,s){var h=D.apply(this,arguments);if(h!==void 0)return h;switch(s){case"True":return!0;case"False":return!1;case"None":return null;default:return}};function r(a){return{index:a.index,lineno:a.lineno,colno:a.colno}}if(S&&n&&y){var i=S.Node.extend("Slice",{fields:["start","stop","step"],init:function(u,o,s,h,v){s=s||new S.Literal(u,o,null),h=h||new S.Literal(u,o,null),v=v||new S.Literal(u,o,1),this.parent(u,o,s,h,v)}});n.prototype.assertType=function(u){u instanceof i||O.apply(this,arguments)},n.prototype.compileSlice=function(u,o){this._emit("("),this._compileExpression(u.start,o),this._emit("),("),this._compileExpression(u.stop,o),this._emit("),("),this._compileExpression(u.step,o),this._emit(")")},y.prototype.parseAggregate=function(){var u=this,o=r(this.tokens);o.colno--,o.index--;try{return R.apply(this)}catch(U){var s=r(this.tokens),h=function(){return l._assign(u.tokens,s),U};l._assign(this.tokens,o),this.peeked=!1;var v=this.peekToken();if(v.type!==V.TOKEN_LEFT_BRACKET)throw h();this.nextToken();for(var L=new i(v.lineno,v.colno),F=!1,I=0;I<=L.fields.length&&!this.skip(V.TOKEN_RIGHT_BRACKET);I++){if(I===L.fields.length)if(F)this.fail("parseSlice: too many slice components",v.lineno,v.colno);else break;if(this.skip(V.TOKEN_COLON))F=!0;else{var M=L.fields[I];L[M]=this.parseExpression(),F=this.skip(V.TOKEN_COLON)||F}}if(!F)throw h();return new S.Array(v.lineno,v.colno,[L])}}}function m(a,u,o,s){a=a||[],u===null&&(u=s<0?a.length-1:0),o===null?o=s<0?-1:a.length:o<0&&(o+=a.length),u<0&&(u+=a.length);for(var h=[],v=u;!(v<0||v>a.length||s>0&&v>=o||s<0&&v<=o);v+=s)h.push(x.memberLookup(a,v));return h}function f(a,u){return Object.prototype.hasOwnProperty.call(a,u)}var g={pop:function(u){if(u===void 0)return this.pop();if(u>=this.length||u<0)throw new Error("KeyError");return this.splice(u,1)},append:function(u){return this.push(u)},remove:function(u){for(var o=0;o<this.length;o++)if(this[o]===u)return this.splice(o,1);throw new Error("ValueError")},count:function(u){for(var o=0,s=0;s<this.length;s++)this[s]===u&&o++;return o},index:function(u){var o;if((o=this.indexOf(u))===-1)throw new Error("ValueError");return o},find:function(u){return this.indexOf(u)},insert:function(u,o){return this.splice(u,0,o)}},t={items:function(){return l._entries(this)},values:function(){return l._values(this)},keys:function(){return l.keys(this)},get:function(u,o){var s=this[u];return s===void 0&&(s=o),s},has_key:function(u){return f(this,u)},pop:function(u,o){var s=this[u];if(s===void 0&&o!==void 0)s=o;else{if(s===void 0)throw new Error("KeyError");delete this[u]}return s},popitem:function(){var u=l.keys(this);if(!u.length)throw new Error("KeyError");var o=u[0],s=this[o];return delete this[o],[o,s]},setdefault:function(u,o){return o===void 0&&(o=null),u in this||(this[u]=o),this[u]},update:function(u){return l._assign(this,u),null}};return t.iteritems=t.items,t.itervalues=t.values,t.iterkeys=t.keys,x.memberLookup=function(u,o,s){return arguments.length===4?m.apply(this,arguments):(u=u||{},l.isArray(u)&&f(g,o)?g[o].bind(u):l.isObject(u)&&f(t,o)?t[o].bind(u):B.apply(this,arguments))},e}c.exports=d}])})})(tn);var sr=tn.exports;const Ut=Bn(sr);var ar=me('<label class="absolute right-6 top-1 z-10 inline-flex cursor-pointer items-center gap-2 bg-transparent text-rc-gray-100 focus:outline-none focus:ring-0"><input type="checkbox" class="checkbox svelte-1br1z62"/> <span>Preview</span></label>'),lr=me('<div class="flex justify-end"><!></div>'),cr=me('<div class="prompt-editor flex h-full flex-col"><div class="relative flex-1"><div class="h-full w-full"></div> <!></div> <!></div>');function ur(N,T){vt(T,!0);let c=Ue(null),E,_=Ct(T,"readOnly",3,!1),d=Ct(T,"showPreviewToggle",3,!0),x=Ct(T,"preview",3,null),l=!1,n=null,y=null,S=!1,V=null,D=[],B=null,O=null,R=0,e=null;const r=24;let i=Ue(!1);const m=Ae(()=>x()!==null?x():C(i)),f=Ae(()=>`editorState/prompt/${T.agentId}/${T.stepName}`),g=Ae(()=>`editorState/prompt/${T.agentId}/${T.stepName}/preview`),t=Ae(()=>C(m)?C(g):C(f));function a(p,k){const K=p.getLayoutInfo(),P=Number((K==null?void 0:K.contentWidth)??0);if(!Number.isFinite(P)||P<=0)return 80;const $=p.getOption(k.editor.EditorOption.fontInfo),te=Number($==null?void 0:$.typicalHalfwidthCharacterWidth)||Number($==null?void 0:$.typicalFullwidthCharacterWidth)||7;if(!Number.isFinite(te)||te<=0)return 80;const X=Math.floor((P-r)/te);return Math.max(20,X)}function u(){!C(c)||!y||O==null&&(O=requestAnimationFrame(()=>{if(O=null,!C(c)||!y)return;const p=a(C(c),y);p!==R&&(R=p,C(c).updateOptions({wordWrap:"bounded",wordWrapColumn:p}))}))}function o(){Tt(C(t),C(c))}function s(p,k){const K=Ln(k);if(!K)return;const P=p.getContribution("editor.contrib.folding");if(P!=null&&P.getFoldingModel)P.getFoldingModel().then(()=>{try{p.restoreViewState(K)}catch{}});else try{p.restoreViewState(K)}catch{}}function h(){e!=null&&clearTimeout(e),e=setTimeout(()=>{e=null,o()},180)}Ft(()=>{if(!E)return;Xt();let p=!1;return Yt(()=>import("../chunks/DLQqXQ6R.js").then(k=>k.e),__vite__mapDeps([0,1,2]),import.meta.url).then(k=>{if(p)return;y=k,Zt(k),D.push(k.languages.registerFoldingRangeProvider("markdown",Yn)),D.push(k.languages.registerFoldingRangeProvider("markdown",Jn)),D.push(k.languages.registerDocumentHighlightProvider("markdown",nr)),Te(c,k.editor.create(E,{value:"",language:"markdown",theme:"bosun-dark",lineNumbers:"off",fontSize:14,fontFamily:'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',automaticLayout:!0,minimap:{enabled:!1},wordBasedSuggestions:"off",wordWrap:"bounded",wordWrapColumn:120,wrappingStrategy:"advanced",matchBrackets:"never",bracketPairColorization:{enabled:!0},guides:{highlightActiveBracketPair:!1,bracketPairs:!1,bracketPairsHorizontal:!1},selectionHighlight:!1,unicodeHighlight:{ambiguousCharacters:!1,nonBasicASCII:!1,invisibleCharacters:!1,includeStrings:!1,includeComments:!1},autoClosingQuotes:"never",padding:{top:32},readOnly:_()}),!0),V=C(c).getModel(),u(),D.push(C(c).onDidLayoutChange(()=>u())),D.push(C(c).onDidChangeModelDecorations(()=>h())),D.push(C(c).onDidScrollChange(()=>h())),D.push(C(c).onDidChangeCursorPosition(()=>h())),D.push(C(c).onDidBlurEditorText(()=>o())),st.agents.context.query({agentId:T.agentId}).then(P=>{p||(B==null||B.dispose(),B=Vn(k,P),D.push(B))}),n=Cn(k,C(c));const K=T.initialPrompt??"";if(l=!0,C(c).setValue(K),l=!1,requestAnimationFrame(()=>{n==null||n.update(),C(c)&&s(C(c),C(t))}),D.push(C(c).onDidChangeModelContent(()=>{if(C(c)&&(n==null||n.update(),!l)){h();try{const P=C(c).getValue();T.onPromptChanged(P)}catch(P){console.error("Error updating prompt",P)}}})),S=!0,T.onEditorReady)try{T.onEditorReady(C(c),k)}catch(P){console.error("PromptEditor onEditorReady error",P)}}).catch(k=>{console.error("Error initializing Monaco editor:",k)}),()=>{p=!0,O!=null&&cancelAnimationFrame(O),O=null,e!=null&&clearTimeout(e),e=null,o(),B=null;for(const K of D)try{K.dispose()}catch{}D=[],n==null||n.dispose(),n=null;const k=V;if(V=null,C(c)){try{C(c).setModel(null)}catch{}C(c).dispose(),Te(c,null)}try{k==null||k.dispose()}catch{}}}),Ge(()=>{!C(c)||!S||C(c).updateOptions({readOnly:_()})});function v(p,k){return Ut.configure({autoescape:!1,trimBlocks:!0,lstripBlocks:!0}),Ut.renderString(p,k||{})}let L="",F=0;function I(p){var k;if(x()!==null){(k=T.onPreviewChange)==null||k.call(T,p);return}Te(i,p,!0)}function M(){if(F+=1,!!C(c)){Tt(C(g),C(c)),l=!0;try{L&&(C(c).setValue(L),L=""),C(c).updateOptions({readOnly:_()})}finally{l=!1}s(C(c),C(f))}}async function U(){if(!C(c)||_())return;Tt(C(f),C(c)),L=C(c).getValue();const p=F+=1;let k=null;try{k=await st.agents.context.query({agentId:T.agentId})}catch(P){console.error("Failed to load agent context for preview:",P),k=null}if(p!==F||!C(c)||!C(m))return;const K=v(L,k||{});l=!0;try{C(c).setValue(K),C(c).updateOptions({readOnly:!0})}finally{l=!1}s(C(c),C(g))}let w=Ue(!1);Ge(()=>{if(!C(c)||!S)return;const p=!!C(m)&&!_();p!==C(w)&&(Te(w,p,!0),p?U():M())}),dt(N,{get class(){return`relative overflow-hidden ${T.class??""}`},children:(p,k)=>{var K=cr(),P=se(K),$=se(P);Jt($,J=>E=J,()=>E);var te=ve($,2);{var X=J=>{var Z=ar(),H=se(Z);zt(H),Ve(2),re(Z),je(()=>yn(H,C(m))),xt("change",H,Q=>I(Q.currentTarget.checked)),oe(J,Z)};Ce(te,J=>{d()&&!_()&&J(X)})}re(P);var ue=ve(P,2);{var ge=J=>{var Z=lr(),H=se(Z);wt(H,{variant:"secondary",get onclick(){return T.onSchemaClick},class:"absolute bottom-2 right-6 !font-medium",children:(Q,Y)=>{Ve();var ce=He("Schema");oe(Q,ce)},$$slots:{default:!0}}),re(Z),oe(J,Z)};Ce(ue,J=>{T.showSchemaButton&&T.onSchemaClick&&J(ge)})}re(K),oe(p,K)}}),mt()}It(["change"]);var fr=me("<!> <!>",1),pr=me('<div class="flex h-full items-center justify-center text-sm text-rc-gray-300">Loading</div>'),Wt=me('<pre class="whitespace-pre-wrap font-mono text-xs text-rc-gray-200"> </pre>'),hr=me('<div class="flex h-full flex-col gap-3"><div class="text-sm text-red-400"> </div></div>'),dr=me('<div class="text-red-400">Error</div>'),vr=me('<div class="rounded-md border border-rc-gray-700 bg-rc-gray-900/40 px-3 py-2"><div class="flex items-center justify-between text-xs text-rc-gray-400"><div> </div> <!></div> <div class="whitespace-pre-wrap break-words text-sm text-rc-gray-100"> </div></div>'),mr=me('<div class="mb-4"><div class="mb-2 text-xs font-semibold text-rc-gray-400">Why this response</div> <div class="flex flex-col gap-2"></div></div>'),gr=me('<button type="button" class="rounded-md border border-rc-gray-700 bg-rc-gray-900/40 px-3 py-2 text-left hover:border-rc-gray-500"><div class="flex items-center justify-between text-xs text-rc-gray-400"><div> </div> <div> </div></div> <div class="whitespace-pre-wrap break-words text-sm text-rc-gray-100"> </div></button>'),yr=me('<div class="flex flex-col gap-2"></div>'),_r=me('<div class="text-sm text-rc-gray-300">No quotes returned.</div>'),wr=me('<div class="mb-3 text-sm font-semibold text-rc-gray-100"> </div> <!> <!>',1),xr=me('<button type="button" class="rounded-md border border-rc-gray-700 bg-rc-gray-900/40 px-3 py-2 text-left hover:border-rc-gray-500"><div class="whitespace-pre-wrap break-words text-sm text-rc-gray-100"> </div></button>'),br=me('<div class="mt-3 flex flex-col gap-2"></div>'),Er=me('<div class="rounded-md border border-rc-gray-700 bg-rc-gray-900/40 p-3"><div class="flex items-start justify-between gap-3"><div class="text-xs font-semibold text-rc-gray-400"></div> <div class="text-xs text-rc-gray-500"> </div></div> <div class="mt-1 whitespace-pre-wrap break-words text-sm text-rc-gray-100"> </div> <!></div>'),kr=me('<div class="flex flex-col gap-3"></div>'),Or=me('<div class="text-sm text-rc-gray-300">No issues found.</div>'),Sr=me('<div class="mb-3 text-sm font-semibold text-rc-gray-100"> </div> <!>',1),Lr=me('<div class="border-b border-rc-gray-700 px-2 py-1"><!></div> <div class="min-h-0 flex-1 overflow-auto p-3"><!></div>',1);function Tr(N,T){vt(T,!0);const{state:c,actions:E}=Qt();let _=Ue("results"),d=Ue(null);Ge(()=>{var S;const y=((S=c.edit.popover)==null?void 0:S.requestId)??null;y!==C(d)&&(Te(d,y,!0),Te(_,"results"))});var x=ht(),l=Be(x);{var n=y=>{const S=Ae(()=>c.edit.popover);var V=Lr(),D=Be(V),B=se(D);Pt(B,{get value(){return C(_)},ariaLabel:"Popover tabs",onChange:({value:m})=>Te(_,m,!0),children:(m,f)=>{var g=fr(),t=Be(g);it(t,{value:"results",children:(u,o)=>{Ve();var s=He("Results");oe(u,s)},$$slots:{default:!0}});var a=ve(t,2);it(a,{value:"raw",children:(u,o)=>{Ve();var s=He("Raw");oe(u,s)},$$slots:{default:!0}}),oe(m,g)},$$slots:{default:!0}}),re(D);var O=ve(D,2),R=se(O);{var e=m=>{var f=pr();oe(m,f)},r=m=>{var f=ht(),g=Be(f);{var t=u=>{const o=Ae(()=>{var v;return typeof((v=C(S).data)==null?void 0:v.raw)=="string"?C(S).data.raw:C(S).error});var s=Wt(),h=se(s,!0);re(s),je(()=>Re(h,C(o)||"—")),oe(u,s)},a=u=>{var o=hr(),s=se(o),h=se(s,!0);re(s),re(o),je(()=>Re(h,C(S).error)),oe(u,o)};Ce(g,u=>{C(_)==="raw"?u(t):u(a,-1)})}oe(m,f)},i=m=>{const f=Ae(()=>C(S).data);var g=ht(),t=Be(g);{var a=s=>{var h=Wt(),v=se(h,!0);re(h),je(()=>{var L;return Re(v,typeof((L=C(f))==null?void 0:L.raw)=="string"?C(f).raw:"—")}),oe(s,h)},u=s=>{const h=Ae(()=>{var P;return typeof((P=C(f))==null?void 0:P.parallelCalls)=="number"&&Number.isFinite(C(f).parallelCalls)?C(f).parallelCalls:10});var v=wr(),L=Be(v),F=se(L,!0);re(L);var I=ve(L,2);{var M=P=>{var $=mr(),te=ve(se($),2);ot(te,23,()=>C(f).rationales,(X,ue)=>X.attempt??ue,(X,ue,ge)=>{var J=vr(),Z=se(J),H=se(Z),Q=se(H);re(H);var Y=ve(H,2);{var ce=Se=>{var b=dr();oe(Se,b)};Ce(Y,Se=>{C(ue).status==="error"&&Se(ce)})}re(Z);var he=ve(Z,2),_e=se(he,!0);re(he),re(J),je(()=>{Re(Q,`Analysis ${C(ue).attempt??C(ge)+1??""}`),Re(_e,C(ue).text)}),oe(X,J)}),re(te),re($),oe(P,$)},U=Ae(()=>{var P;return Array.isArray((P=C(f))==null?void 0:P.rationales)&&C(f).rationales.length>0});Ce(I,P=>{C(U)&&P(M)})}var w=ve(I,2);{var p=P=>{var $=yr();ot($,23,()=>C(f).quotes,te=>te.quote,(te,X,ue)=>{var ge=gr(),J=se(ge),Z=se(J),H=se(Z);re(Z);var Q=ve(Z,2),Y=se(Q);re(Q),re(J);var ce=ve(J,2),he=se(ce,!0);re(ce),re(ge),je(()=>{Re(H,`Quote ${C(ue)+1}`),Re(Y,`x${C(X).count??""}/${C(h)??""}`),Re(he,C(X).quote)}),xt("click",ge,()=>E.focusQuote(C(X).quote)),oe(te,ge)}),re($),oe(P,$)},k=Ae(()=>{var P;return Array.isArray((P=C(f))==null?void 0:P.quotes)&&C(f).quotes.length>0}),K=P=>{var $=_r();oe(P,$)};Ce(w,P=>{C(k)?P(p):P(K,-1)})}je(()=>{var P;return Re(F,((P=C(f))==null?void 0:P.title)??"Analysis")}),oe(s,v)},o=s=>{var h=Sr(),v=Be(h),L=se(v,!0);re(v);var F=ve(v,2);{var I=w=>{var p=kr();ot(p,21,()=>C(f).issues,Nt,(k,K,P)=>{var $=Er(),te=se($),X=se(te);X.textContent=`Issue ${P+1}`;var ue=ve(X,2),ge=se(ue,!0);re(ue),re(te);var J=ve(te,2),Z=se(J,!0);re(J);var H=ve(J,2);{var Q=Y=>{var ce=br();ot(ce,20,()=>C(K).contradictingQuotes,he=>he,(he,_e)=>{var Se=xr(),b=se(Se),j=se(b,!0);re(b),re(Se),je(()=>Re(j,_e)),xt("click",Se,()=>E.focusQuote(_e)),oe(he,Se)}),re(ce),oe(Y,ce)};Ce(H,Y=>{C(K).contradictingQuotes&&C(K).contradictingQuotes.length>0&&Y(Q)})}re($),je(()=>{Re(ge,C(K).type),Re(Z,C(K).reason)}),oe(k,$)}),re(p),oe(w,p)},M=Ae(()=>{var w;return Array.isArray((w=C(f))==null?void 0:w.issues)&&C(f).issues.length>0}),U=w=>{var p=Or();oe(w,p)};Ce(F,w=>{C(M)?w(I):w(U,-1)})}je(()=>{var w;return Re(L,((w=C(f))==null?void 0:w.title)??"Prompt issues")}),oe(s,h)};Ce(t,s=>{C(_)==="raw"?s(a):C(S).kind==="analyze"?s(u,1):s(o,-1)})}oe(m,g)};Ce(R,m=>{C(S).status==="loading"?m(e):C(S).status==="error"?m(r,1):m(i,-1)})}re(O),oe(y,V)};Ce(l,y=>{c.edit.popover&&y(n)})}oe(N,x),mt()}It(["click"]);var Ar=me('<div class="min-h-0 flex-1 overflow-hidden p-3"><!></div>');function Cr(N,T){vt(T,!1);const c=Qt(),E=pn(c.state),_=c.actions;function d(n){hn(E,C(E).context=n),_.sendAppEvent({type:"context-updated",context:n})}Rn();var x=Ar(),l=se(x);{let n=dn(()=>{var y;return`editorState/context/${C(E).agentId}/${((y=C(E).currentStep)==null?void 0:y.name)??"main"}`});Tn(l,{class:"h-full min-h-0 border-thin border-rc-gray-650 shadow-inner-white-soft backdrop-blur-3xl focus:outline-none focus:ring-0",get context(){return C(E).context},onContextChanged:d,get editorStateKey(){return C(n)},suppressErrors:!0})}re(x),oe(N,x),mt()}function Nr(N){try{return decodeURIComponent(N)}catch{return N}}function nn(N){var d;const c=(((d=String(N||"").split("?")[0])==null?void 0:d.split("#")[0])??"").split("/").filter(Boolean);if(c[0]!=="edit")return{agentId:null,tab:null};if(c.length===1)return{agentId:null,tab:null};const E=Nr(c[1]??""),_=c[2]??null;return _?_==="roleplay"?{agentId:E,tab:"roleplay"}:_==="tests"?{agentId:E,tab:"tests"}:_==="configure"?{agentId:E,tab:"configure"}:{agentId:E,tab:null}:{agentId:E,tab:"roleplay"}}function Pr(N){return{tab:nn(N.pathname).tab??"roleplay",popover:null,highlights:null,requestSeq:0}}function Rr(N,T){const E=nn(T.pathname).tab??"roleplay";return{...N,tab:E,popover:null,highlights:null}}function Ir(N,T){const c=N.requestSeq+1;return{...N,requestSeq:c,popover:{kind:T.kind,status:"loading",requestId:c},highlights:null}}function Fr(N,T){return!N.popover||N.popover.requestId!==T.requestId?N:{...N,popover:{...N.popover,status:"ready",data:T.data,error:void 0}}}function Br(N,T){return!N.popover||N.popover.requestId!==T.requestId?N:{...N,popover:{...N.popover,status:"error",error:String(T.error||"Unknown error"),data:T.data}}}function Mr(N){return{...N,popover:null,highlights:null}}function Kr(N,T){return{...N,highlights:{quotes:T??[],focusQuote:null,focusNonce:0}}}function jr(N,T){const c=String(T||"");if(!c)return N;const E=N.highlights??{quotes:[],focusQuote:null,focusNonce:0};return{...N,highlights:{...E,focusQuote:c,focusNonce:(E.focusNonce??0)+1}}}function Dr(N,T){const c=String(N??""),E=Vr(T),_=Gt(c);for(const d of E){const x=$t(c,d);if(x.length>0)return x;const l=Ht(c,d);if(l.length>0)return l;const n=Gt(d);if(_!==c||n!==d){const y=$t(_,n);if(y.length>0)return y;const S=Ht(_,n);if(S.length>0)return S}}return[]}function $t(N,T){const c=String(T??"");if(!c)return[];const E=[];let _=0;for(;_<=N.length-c.length;){const d=N.indexOf(c,_);if(d===-1)break;E.push({start:d,end:d+c.length}),_=d+1}return E}function Ht(N,T){const c=String(T??"");if(!c.trim())return[];const E=Ur(c).replace(/\s+/g,"\\s+");let _;try{_=new RegExp(`(?=(${E}))`,"gu")}catch{return[]}const d=[];let x;for(;(x=_.exec(N))!==null;){const l=x.index,n=x[1]??"",y=l+n.length;y>l&&d.push({start:l,end:y}),_.lastIndex===l&&(_.lastIndex+=1)}return d}function Vr(N){const T=String(N??""),c=T.trim(),E=new Set;for(const x of[T,c])x&&E.add(x);const _=c.replace(/^[-*•]\s+/,"");_&&_!==c&&E.add(_);const d=c.replace(/^(?:\(?\d+\)?[.)]|[a-zA-Z][.)])\s+/,"");return d&&d!==c&&E.add(d),[...E].filter(x=>x.trim().length>0)}function Gt(N){return String(N??"").replace(/\r/g,`
|
|
35
|
+
`).replace(/[\u00A0\u2007\u202F\u2009\u200A\u200B\uFEFF]/g," ").replace(/[\u201C\u201D\u201E\u00AB\u00BB]/g,'"').replace(/[\u2018\u2019]/g,"'").replace(/[\u2013\u2014]/g,"-")}function Ur(N){return N.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Wr(N,T){const c=N.createDecorationsCollection(),E=N.createDecorationsCollection();let _=null,d=new Map,x=new Map,l=0;function n(){d=new Map,x=new Map,l=0}function y(e,r,i){return Number.isNaN(e)?r:Math.max(r,Math.min(i,e))}function S(e){const r=y(e,1,10);return`rgba(220, 38, 38, ${y(.22+r*.06,.28,.82)})`}function V(e,r){const i=String(e??"");if(!i)return[];const m=d.get(i);if(m)return m;const f=Dr(r,i);return d.set(i,f),f}function D(e){const r=N.getModel();if(!r)return;const i=r.getValue()??"",m=[],f=[...e||[]].sort((g,t)=>(g.count||0)-(t.count||0));for(const g of f){const t=String(g.quote||"");if(!t)continue;const a=y(Number(g.count||0),1,10),u=S(a),o=V(t,i);for(const s of o){const h=r.getPositionAt(s.start),v=r.getPositionAt(s.end);m.push({range:new T.Range(h.lineNumber,h.column,v.lineNumber,v.column),options:{inlineClassName:`analysis-quote analysis-quote-l${a}`,overviewRuler:{color:u,position:T.editor.OverviewRulerLane.Center}}})}}c.set(m)}function B(e){const r=N.getModel();if(!r)return;const i=r.getValue()??"",m=V(e,i);if(m.length===0)return;const g=((x.get(e)??-1)+1)%m.length;x.set(e,g);const t=m[g],a=r.getPositionAt(t.start),u=r.getPositionAt(t.end),o=new T.Range(a.lineNumber,a.column,u.lineNumber,u.column);E.set([{range:o,options:{inlineClassName:"analysis-quote-focus"}}]),N.setSelection(o),N.revealRangeInCenter(o,T.editor.ScrollType.Smooth),N.focus()}function O(e){if(_=e,!_){c.clear(),E.clear(),n();return}D(_.quotes||[]),_.focusQuote&&_.focusNonce!==l?(l=_.focusNonce,B(_.focusQuote)):_.focusQuote||E.clear()}const R=N.onDidChangeModelContent(()=>{_&&(d=new Map,E.clear(),D(_.quotes||[]))});return{setHighlights:O,dispose:()=>{try{R.dispose(),c.clear(),E.clear()}finally{_=null,n()}}}}var $r=me("<!> <!>",1),Hr=me('<span class="truncate"> </span> <!>',1),Gr=me('<div class="mt-1 overflow-hidden rounded-lg border border-rc-gray-110 bg-rc-gray-930 shadow-inner-white-soft backdrop-blur-2xl" role="listbox" aria-label="Region"></div>'),qr=me('<span class="text-sm text-rc-gray-300">Region</span> <div><!> <!></div>',1),zr=me('<div class="p-2 text-rc-gray-400">Connecting…</div>'),Qr=me('<div class="p-2 text-rc-gray-400">No steps</div>'),Yr=me('<button><span class="block truncate"> </span></button>'),Jr=me('<div class="rc-scroll min-h-0 flex-1 overflow-auto p-2"><!></div>'),Xr=me("<!> <!> <!>",1),Zr=me('<div class="border-b border-rc-gray-700 p-2"><!></div> <div class="min-h-0 flex-1"><!></div> <!> <!>',1),ei=me('<div class="flex h-screen"><!> <div class="flex h-full min-w-0 flex-1 flex-col bg-rc-gray-980 pb-3 pr-4 pt-2"><nav class="flex flex-none items-center bg-rc-gray-980"><div class="flex w-1/3 justify-start"></div> <div class="flex w-1/3 justify-center"><!></div> <div class="flex w-1/3 items-center justify-end gap-2 pr-2"><!></div></nav> <div class="flex-1 overflow-hidden"><div class="grid h-full w-full grid-cols-[minmax(140px,2fr)_minmax(0,10fr)_minmax(0,11fr)]"><!> <div class="flex h-full min-w-0 flex-col"><div class="flex h-14 flex-none items-center justify-between gap-3 border-b border-rc-gray-700 p-2"><div class="min-w-0"><div class="truncate font-semibold text-rc-gray-100"> </div></div> <div class="flex items-center gap-3"><label class="inline-flex items-center gap-2 text-rc-gray-300"><input type="checkbox" aria-label="Preview rendered prompt" class="h-4 w-4 appearance-none rounded border border-rc-gray-300 bg-rc-gray-600 !accent-rc-gray-600 outline-none ring-0 checked:border-rc-gray-200 checked:bg-rc-gray-600 hover:border-rc-gray-200 hover:bg-rc-gray-600 focus:outline-none focus:ring-0 active:border-rc-gray-200 active:bg-rc-gray-600 disabled:cursor-not-allowed disabled:opacity-50"/> <span>Preview</span></label> <!></div></div> <div class="min-h-0 flex-1"><!></div></div> <!></div></div></div></div> <!>',1);function Ni(N,T){vt(T,!0);const{onError:c}=Pn();let E=Ue(Bt([]));const _=A=>{try{return A?decodeURIComponent(A):""}catch{return A||""}},d=A=>encodeURIComponent(A);function x(A){return _(A).trim().replace(/^\/+|\/+$/g,"")}const l=Ae(()=>x(T.params.agent)),n=Bt({agentId:x(T.params.agent),region:null,availableRegions:[],defaultRegion:null,agentType:void 0,wsLoaded:!1,chatReady:!1,steps:[],currentStep:null,promptDrafts:{},context:null,promptContext:null,agentStates:[],currentState:null,contextPopoverOpen:!1,edit:Pr({pathname:Qe.url.pathname})});let y=null,S=null,V;const D="region-dropdown";let B=Ue(!1),O=Ue(null);Ge(()=>{const A=n.availableRegions,W=n.region;(!A.length||!W||!A.includes(W))&&Te(B,!1)});function R(A,W){if(typeof window>"u")return;const q=new URL(window.location.href);W===null?q.searchParams.delete(A):q.searchParams.set(A,W),An(q.toString(),{})}function e(A){rt.sendMessage({channel:"app-events",event:A})}function r(A){A!=null&&A.name&&n.promptDrafts[A.name]===void 0&&(n.promptDrafts[A.name]=A.prompt??"")}const i=Ae(()=>{var A;return((A=n.currentStep)==null?void 0:A.name)??null}),m=Ae(()=>{const A=C(i);if(!A)return"";const W=n.promptDrafts[A];return typeof W=="string"?W:""});let f=null,g=null,t=Promise.resolve();const a=800;function u(){f&&(clearTimeout(f),f=null)}async function o(A,W,q){try{await st.agents.savePrompt.mutate({agentId:A,step:W,prompt:q})}catch(le){console.error("Failed to save prompt",le);const xe=n.promptDrafts[W];throw n.agentId===A&&xe===q&&(g={stepName:W,prompt:q}),le}}function s(A,W,q){const le=t.catch(()=>{}).then(()=>o(A,W,q));return t=le.catch(()=>{}),le}async function h(){if(!g)return;const A=n.agentId.trim();if(!A)return;const{stepName:W,prompt:q}=g;u(),g=null,await s(A,W,q)}function v(A,W){g={stepName:A,prompt:W},u(),f=setTimeout(()=>{f=null,h()},a)}Ge(()=>{n.wsLoaded&&h()});async function L(A){try{const W=await st.regionConfig.meta.query({agent:A});if(!W){n.availableRegions=[],n.defaultRegion=null,n.region=null,R("region",null);return}if(n.availableRegions=W.availableRegions,n.defaultRegion=W.defaultRegion??null,!Array.isArray(W.availableRegions)||W.availableRegions.length===0){n.region=null,R("region",null);return}const q=(Qe.url.searchParams.get("region")||"").trim()||null,le=q&&W.availableRegions.includes(q)&&q||W.defaultRegion&&W.availableRegions.includes(W.defaultRegion)&&W.defaultRegion||W.availableRegions[0]||null;n.region=le,R("region",le)}catch(W){console.error("Failed to load region config meta",W),n.availableRegions=[],n.defaultRegion=null,n.region=null,R("region",null)}}Ge(()=>{const A=C(l);A&&A!==S&&(S=A,L(A))});function F(A){h(),H();const W=n.steps.find(q=>q.name===A)||null;n.currentStep=W,W?(r(W),R("step",W.name),e({type:"step-selected",step:W.name})):R("step",null)}function I(A){const W=C(i);W&&(n.promptDrafts[W]=A,v(W,A))}const M=Ae(()=>{var A;return((A=n.currentStep)==null?void 0:A.schema)??null}),U=Ae(()=>!!C(M)&&C(M).trim().length>0);let w=Ue(!1);function p(){C(M)&&Te(w,!0)}function k({value:A}){if(A===n.edit.tab)return;h(),H();const W=Qe.url.searchParams.get("step"),q=Qe.url.searchParams.get("region"),le=`/edit/${d(n.agentId)}/${A}`,xe=new URLSearchParams;W&&xe.set("step",W),q&&xe.set("region",q);const Ee=xe.size?`${le}?${xe.toString()}`:le;pt(Ee)}const K=Ae(()=>{const A=Qe.url.pathname.split("/")[1];return A==="traces"?"view":A});function P({value:A}){if(A!==C(K)){if(h(),H(),A==="edit")return pt("/edit");if(A==="view")return pt(`/view?agent=${d(n.agentId)}`);pt("/"+A)}}function $(A){var W;return n.contextPopoverOpen=!1,n.edit=Ir(n.edit,{kind:A}),((W=n.edit.popover)==null?void 0:W.requestId)??0}function te(A,W){n.edit=Fr(n.edit,{requestId:A,data:W})}function X(A,W,q){n.edit=Br(n.edit,{requestId:A,error:W,data:q})}function ue(){n.edit=Mr(n.edit)}function ge(){ue(),n.contextPopoverOpen=!0}function J(){n.contextPopoverOpen=!1}function Z(){n.contextPopoverOpen?J():ge()}function H(){ue(),J()}function Q(A){return A==="analyze"?"Analyze":"Find issues"}function Y(A){n.edit=Kr(n.edit,A)}function ce(A){n.edit=jr(n.edit,A)}let he=null,_e=Ue(!1),Se=null;Ge(()=>{var W;const A=((W=n.currentStep)==null?void 0:W.name)??null;A!==Se&&(Se=A,Te(_e,!1))});function b(A,W){he==null||he.dispose(),he=Wr(A,W),he.setHighlights(n.edit.highlights)}Ge(()=>{const A=n.edit.highlights;he==null||he.setHighlights(A)});let j=Ue("");Ge(()=>{const A=Qe.url.toString();A!==C(j)&&(Te(j,A,!0),n.edit=Rr(n.edit,{pathname:Qe.url.pathname}),n.contextPopoverOpen=!1)});function z(A,W,q){return Math.max(W,Math.min(q,A))}function G(A){const W=new Map;for(const q of A||[])for(const le of q.contradictingQuotes||[]){const xe=String(le||"").trim();xe&&W.set(xe,(W.get(xe)||0)+1)}return[...W.entries()].map(([q,le])=>({quote:q,count:z(le,1,10)})).sort((q,le)=>le.count-q.count||q.quote.localeCompare(le.quote))}let ie=Ue(!1);async function ae(){var W;if(C(ie)||!n.currentStep)return;Te(ie,!0);const A=$("findIssues");try{const q=await st.tests.findPromptIssues.mutate({agent:n.agentId,step:n.currentStep.name,prompt:C(m)}),le=G(q.issues||[]);if(((W=n.edit.popover)==null?void 0:W.requestId)!==A)return;Y(le);let xe=null;try{xe=JSON.stringify(q.raw,null,2)}catch{xe=null}te(A,{title:`Prompt issues — ${n.currentStep.name}`,issues:q.issues,raw:xe})}catch(q){console.error(q);const le=typeof(q==null?void 0:q.message)=="string"?q.message:(()=>{try{return JSON.stringify(q)}catch{return String(q)}})();X(A,le||"Failed to find issues in this prompt",{title:`Prompt issues failed — ${n.currentStep.name}`,raw:le})}finally{Te(ie,!1)}}function we(A){h(),H();const W=Qe.url.searchParams.get("step"),q=Qe.url.searchParams.get("region"),le=`/edit/${d(A)}/${n.edit.tab}`,xe=new URLSearchParams;W&&xe.set("step",W),q&&xe.set("region",q);const Ee=xe.size?`${le}?${xe.toString()}`:le;pt(Ee)}function fe(A){!A||A===n.region||(h(),n.region=A,R("region",A))}xn({state:n,actions:{openPopover:$,setPopoverReady:te,setPopoverError:X,closePopover:ue,setHighlightQuotes:Y,focusQuote:ce,openContextPopover:ge,closeContextPopover:J,toggleContextPopover:Z,sendAppEvent:e,sendChatMessage:A=>{if(!n.wsLoaded||!n.chatReady){console.warn("[roleplay] Ignoring chat message while websocket session is reconnecting");return}rt.sendMessage({channel:"chat",message:A})},flushPromptSave:h,selectState:A=>{h(),H(),V=A,n.currentState=A,Mt(),jt(),e({type:"select-agent",agent:n.agentId,state:A,region:n.region})},hangup(){e({type:"hangup",agentId:n.agentId,region:n.region})}}}),Ft(async()=>{try{Te(E,await st.agents.list.query(),!0)}catch(A){console.error("Failed to load agents",A)}rt.onClose(()=>{n.wsLoaded=!1,n.chatReady=!1,n.context=null,n.promptContext=null,n.agentStates=[],n.currentState=null,n.contextPopoverOpen=!1,y=null}),rt.onError(A=>c(A)),rt.onMessage(A=>{if(A.channel==="app-events"){if(A.event.type==="agents-loaded"){n.wsLoaded=!0;return}if(A.event.type==="context-updated"){n.context=A.event.context,A.event.promptContext&&(n.promptContext=A.event.promptContext);return}if(A.event.type==="update-states"){const W=n.agentStates.length;n.agentStates=A.event.states;const q=n.agentStates.length>0?n.agentStates[n.agentStates.length-1].id:null;V!==void 0?n.currentState=V:(n.currentState===null&&W===0&&q||n.agentStates.length>W)&&(n.currentState=q),V=void 0;return}if(A.event.type==="agent-selected"){n.steps=A.event.agent.steps,n.agentType=A.event.agent.type;const W={};for(const Fe of n.steps){const ke=n.promptDrafts[Fe.name];W[Fe.name]=typeof ke=="string"?ke:Fe.prompt??""}n.promptDrafts=W;const q=(Qe.url.searchParams.get("step")||"").trim()||null,le=q?n.steps.find(Fe=>Fe.name===q)??null:null,xe=n.steps.find(Fe=>Fe.name.toLowerCase()==="main")??n.steps[0]??null,Ee=le??xe;n.currentStep=Ee,Ee?(r(Ee),Ee.name!==q&&R("step",Ee.name),e({type:"step-selected",step:Ee.name}),h()):R("step",null);return}return}if(A.channel==="log"){In(A.message);return}if(A.channel==="step-trace"){bn(A.trace);return}if(A.channel==="api-call-trace"){En(A.trace);return}if(A.channel==="conversational-trace"){kn(A.trace);return}if(A.channel==="error"){c(A.message);return}}),rt.init(),n.wsLoaded=rt.isReady()}),qt(()=>{h(),u(),he==null||he.dispose(),he=null}),Ge(()=>{const A=C(l);if(A!==n.agentId&&(h(),g=null,u(),n.chatReady=!1,n.promptDrafts={},n.steps=[],n.currentStep=null),n.agentId=A,!n.wsLoaded){n.chatReady=!1;return}if(!n.agentId){n.chatReady=!1;return}if(n.availableRegions.length>0&&!n.region){n.chatReady=!1;return}const W=`${n.agentId}::${n.region??""}`;y!==W&&(y=W,Mt(),jt(),H(),n.currentState=null,n.agentStates=[],n.context=null,n.promptContext=null,h(),V=void 0,n.chatReady=!1,e({type:"select-agent",agent:n.agentId,region:n.region}),n.chatReady=!0)});var be=ei(),Ie=Be(be),Me=se(Ie);Nn(Me,{className:"flex-none",get agents(){return C(E)},get currentAgent(){return n.agentId},onAgentClick:we});var We=ve(Me,2),at=se(We),lt=ve(se(at),2),bt=se(lt);Pt(bt,{get value(){return C(K)},ariaLabel:"Top tabs",onChange:P,children:(A,W)=>{var q=$r(),le=Be(q);it(le,{value:"edit",children:(Ee,Fe)=>{Ve();var ke=He("Edit");oe(Ee,ke)},$$slots:{default:!0}});var xe=ve(le,2);it(xe,{value:"view",children:(Ee,Fe)=>{Ve();var ke=He("View");oe(Ee,ke)},$$slots:{default:!0}}),oe(A,q)},$$slots:{default:!0}}),re(lt);var gt=ve(lt,2),ct=se(gt);{var Et=A=>{var W=qr(),q=ve(Be(W),2),le=se(q);wt(le,{variant:"secondary",size:"small",get"aria-expanded"(){return C(B)},"aria-haspopup":"listbox","aria-controls":D,onclick:Ee=>{Ee.stopPropagation(),Te(B,!C(B))},class:"flex w-32 items-center justify-between gap-1 !px-3 !py-1",get el(){return C(O)},set el(Ee){Te(O,Ee,!0)},children:(Ee,Fe)=>{var ke=Hr(),Ke=Be(ke),qe=se(Ke,!0);re(Ke);var tt=ve(Ke,2);{let Pe=Ae(()=>"size-5 text-rc-gray-400 transition-transform duration-200 "+(C(B)?"rotate-180":""));Sn(tt,{name:"chevron-down",get class(){return C(Pe)}})}je(()=>Re(qe,n.region)),oe(Ee,ke)},$$slots:{default:!0}});var xe=ve(le,2);On(xe,{id:D,get open(){return C(B)},onClose:()=>Te(B,!1),get anchorEl(){return C(O)},placement:"bottom-end",offset:[0,1],children:Fe=>{var ke=Gr();ot(ke,21,()=>n.availableRegions,Nt,(Ke,qe)=>{{let tt=Ae(()=>C(qe)===n.region),Pe=Ae(()=>`w-full rounded-none py-2 pr-3 text-left backdrop-blur-2xl hover:bg-rc-gray-700 focus:bg-rc-gray-400 ${C(qe)===n.region?"bg-rc-gray-800 text-rc-gray-100":"text-rc-gray-200"}`);wt(Ke,{variant:"ghost",size:"small",role:"option",get"aria-selected"(){return C(tt)},onclick:De=>{De.stopPropagation(),Te(B,!1),fe(C(qe))},get class(){return C(Pe)},children:(De,ze)=>{Ve();var Xe=He();je(()=>Re(Xe,C(qe))),oe(De,Xe)},$$slots:{default:!0}})}}),re(ke),oe(Fe,ke)},$$slots:{default:!0}}),re(q),oe(A,W)};Ce(ct,A=>{n.availableRegions.length>0&&n.region&&A(Et)})}re(gt),re(at);var Ye=ve(at,2),Ze=se(Ye),ee=se(Ze);dt(ee,{class:"flex h-full min-w-0 flex-col !rounded-none p-0",children:(A,W)=>{var q=Jr(),le=se(q);{var xe=ke=>{var Ke=zr();oe(ke,Ke)},Ee=ke=>{var Ke=Qr();oe(ke,Ke)},Fe=ke=>{var Ke=ht(),qe=Be(Ke);ot(qe,17,()=>n.steps,Nt,(tt,Pe)=>{var De=Yr(),ze=se(De),Xe=se(ze,!0);re(ze),re(De),je(()=>{var ft;_n(De,1,`my-1 w-full rounded-lg px-3 py-2 text-left text-rc-gray-200 hover:bg-rc-gray-700 ${C(Pe).name===((ft=n.currentStep)==null?void 0:ft.name)?"bg-rc-gray-600":"bg-transparent"}`),Re(Xe,C(Pe).name)}),xt("click",De,()=>F(C(Pe).name)),oe(tt,De)}),oe(ke,Ke)};Ce(le,ke=>{n.wsLoaded?n.steps.length===0?ke(Ee,1):ke(Fe,-1):ke(xe)})}re(q),oe(A,q)}});var ne=ve(ee,2),de=se(ne),pe=se(de),ye=se(pe),Oe=se(ye,!0);re(ye),re(pe);var Ne=ve(pe,2),$e=se(Ne),Je=se($e);zt(Je),Ve(2),re($e);var kt=ve($e,2);{let A=Ae(()=>!n.currentStep||C(ie));wt(kt,{variant:"secondary",get disabled(){return C(A)},onclick:ae,children:(W,q)=>{Ve();var le=He("Find issues");oe(W,le)},$$slots:{default:!0}})}re(Ne),re(de);var et=ve(de,2),Ot=se(et);{var St=A=>{var W=ht(),q=Be(W);vn(q,()=>n.currentStep.name,le=>{ur(le,{class:"h-full min-w-0 border-thin border-rc-gray-650 bg-rc-gray-800 shadow-inner-white-soft backdrop-blur-3xl focus:outline-none focus:ring-0",get initialPrompt(){return C(m)},get agentId(){return n.agentId},get stepName(){return n.currentStep.name},onPromptChanged:I,get showSchemaButton(){return C(U)},onSchemaClick:p,showPreviewToggle:!1,get preview(){return C(_e)},onEditorReady:b})}),oe(A,W)},ut=A=>{dt(A,{class:"flex h-full min-w-0 items-center justify-center !rounded-none p-4 text-sm text-rc-gray-400",children:(W,q)=>{Ve();var le=He("Select a step to edit its prompt");oe(W,le)}})};Ce(Ot,A=>{n.currentStep?A(St):A(ut,-1)})}re(et),re(ne);var rn=ve(ne,2);dt(rn,{class:"relative flex h-full min-w-0 flex-col overflow-hidden !rounded-none p-0",children:(A,W)=>{var q=Zr(),le=Be(q),xe=se(le);Pt(xe,{get value(){return n.edit.tab},ariaLabel:"Mode tabs",onChange:k,children:(Pe,De)=>{var ze=Xr(),Xe=Be(ze);it(Xe,{value:"roleplay",children:(nt,Lt)=>{Ve();var yt=He("Roleplay");oe(nt,yt)},$$slots:{default:!0}});var ft=ve(Xe,2);it(ft,{value:"tests",children:(nt,Lt)=>{Ve();var yt=He("Tests");oe(nt,yt)},$$slots:{default:!0}});var an=ve(ft,2);{var ln=nt=>{it(nt,{value:"configure",children:(Lt,yt)=>{Ve();var cn=He("Configure");oe(Lt,cn)},$$slots:{default:!0}})};Ce(an,nt=>{n.defaultRegion!==null&&nt(ln)})}oe(Pe,ze)},$$slots:{default:!0}}),re(le);var Ee=ve(le,2),Fe=se(Ee);gn(Fe,()=>T.children),re(Ee);var ke=ve(Ee,2);{var Ke=Pe=>{{const De=Xe=>{Tr(Xe,{})};let ze=Ae(()=>Q(n.edit.popover.kind));Kt(Pe,{get title(){return C(ze)},onClose:ue,children:De})}};Ce(ke,Pe=>{n.edit.popover&&Pe(Ke)})}var qe=ve(ke,2);{var tt=Pe=>{Kt(Pe,{title:"Edit context",onClose:J,children:ze=>{Cr(ze,{})}})};Ce(qe,Pe=>{n.contextPopoverOpen&&Pe(tt)})}oe(A,q)}}),re(Ze),re(Ye),re(We),re(Ie);var on=ve(Ie,2);{var sn=A=>{mn(A,{title:"Schema",class:"!w-[80vw] !max-w-5xl",get open(){return C(w)},set open(q){Te(w,q,!0)},children:q=>{Dn(q,{class:"h-[70vh] min-w-0",get schema(){return C(M)},onChange:console.log})},$$slots:{default:!0}})};Ce(on,A=>{C(M)&&A(sn)})}je(()=>{var A;Re(Oe,((A=n.currentStep)==null?void 0:A.name)??"Prompt"),Je.disabled=!n.currentStep}),wn(Je,()=>C(_e),A=>Te(_e,A)),oe(N,be),mt()}It(["click"]);export{Ni as component};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as Mt,b as U,a as v,t as C,f as b,c as zt}from"../chunks/C4SnSfql.js";import{o as Bt}from"../chunks/C-whEtKd.js";import{p as Rt,q as d,v as ge,d as qt,t as k,j as t,a as Ot,e as Gt,f as me,s as i,c as n,w as s,n as P,$ as Qt,o as T,r as o}from"../chunks/Dv8m1cTI.js";import{s as f}from"../chunks/_yZg6Sf-.js";import{i as Q}from"../chunks/CXo2BVs0.js";import{e as Qe,i as Ve}from"../chunks/D8e7SQh9.js";import{s as Vt}from"../chunks/D4obUD_s.js";import{h as Wt}from"../chunks/HXxIsSOO.js";import{b as We,c as He}from"../chunks/C4D-JXnS.js";import{s as Ht}from"../chunks/DYhTBLDc.js";import{p as Jt}from"../chunks/HJHYLHDn.js";import{g as y}from"../chunks/D-wf2QNc.js";import{p as g}from"../chunks/CNLU4B3p.js";import{B as V}from"../chunks/BwtfALfL.js";import{I as Kt}from"../chunks/Dp760K13.js";import{I as Xt}from"../chunks/CF66fWJN.js";import{m as Yt}from"../chunks/ddC1NP9R.js";import{p as Je,T as Zt,g as ea}from"../chunks/JcG4w2gF.js";import{T as ta,a as Ke}from"../chunks/xebNt8-Z.js";import{A as aa}from"../chunks/CqO5tR2_.js";import{g as ra}from"../chunks/BTvePR6r.js";import{t as sa}from"../chunks/DhBm2Vx9.js";var oa=b("<!> <!>",1),Xe=b("<option> </option>"),na=b('<button type="button" aria-label="Clear search" class="absolute right-2 top-1/2 flex -translate-y-1/2 items-center justify-center rounded p-1 text-rc-gray-200 hover:bg-rc-gray-600 hover:text-rc-gray-100 focus:outline-none"><!></button>'),la=b('<p class="py-8 text-center text-rc-gray-200">Loading...</p>'),ia=b('<p class="py-8 text-center text-rc-gray-300">No conversations found</p>'),ca=b('<span class="text-rc-gray-200">, Agent Id:</span> <span class="text-rc-green-200"> </span>',1),da=b('<li><div class="flex w-full flex-col gap-2"><div class="flex w-full items-center justify-between"><div class="text-gray-300"> </div> <div class="flex items-center gap-2"><span class="text-xs text-rc-gray-300"> </span> <span class="font-semibold text-rc-gray-100"> </span></div></div> <div class="flex items-center justify-between gap-4"><div class="text-sm"><span class="text-rc-gray-200">Conversation Id:</span> <span class="text-rc-green-200"> </span> <!></div> <p class="text-sm text-gray-400"> </p></div></div></li>'),va=b('<ul class="space-y-2"></ul>'),ua=b('<div class="flex h-screen"><!> <div class="flex h-full min-w-0 flex-1 flex-col bg-rc-gray-980 pb-3 pr-4 pt-2"><nav class="flex flex-none flex-col bg-rc-gray-980"><div class="flex items-center justify-center"><!></div> <div class="flex flex-wrap items-center gap-4"><div class="flex-1"><label class="block"><div class="flex gap-2"><select class="select svelte-1uk1thp" aria-label="Telescope source"><!></select> <div class="relative"><!><!></div> <!></div></label></div> <div class="hidden items-center gap-2"><div class="text-rc-gray-200">Sort:</div> <!></div> <div class="hidden items-center gap-2"><div class="text-rc-gray-200">Page size:</div> <select class="rounded-sm border border-rc-gray-300 bg-rc-gray-700 p-2 pr-8 text-rc-gray-100"><option>5</option><option>10</option><option>20</option><option>50</option></select></div> <div class="flex items-center gap-3"><div class="flex items-center gap-2"><!> <!> <div class="text-sm text-rc-gray-200"> </div></div></div> <div class="ml-auto whitespace-nowrap text-sm"><span class="text-gray-400">API Mode:</span> <span class="font-semibold text-rc-green-200"> </span></div></div></nav> <main class="flex flex-1 overflow-hidden"><div class="flex h-full w-1/3 flex-col"><div class="flex-none border-b border-rc-gray-300/40 p-4"><h2 class="text-lg font-semibold text-rc-gray-100">Conversations</h2></div> <div class="rc-scroll min-h-0 flex-1 overflow-scroll px-3 py-4"><!></div></div> <div class="flex h-full w-2/3 flex-col bg-rc-gray-980"><!></div></main></div></div>');function Fa(Ye,W){Rt(W,!0);const j=new Zt(fetch);let _e=d(ge([])),_=d(void 0),h=d(null);const p=P(()=>(g.url.searchParams.get("agent")??"").trim());let L=d(""),H=d(20),M=d("20"),z=d(!0),x=d(ge([])),I=d(null),B=d(!1),J=d(null),he=d(0),w=d(ge([])),N=d(""),R=d(!1),K=d(null),xe=d(!1),X=d(null),ye=Jt(W,"useMock",3,!1);const{onError:be}=ra();function Ze(e){return new Date(e).toLocaleString()}function et(e){const a=Math.floor(e/60),r=e%60;return`${a}:${String(r).padStart(2,"0")}`}function we(e=t(p)){const a=new URLSearchParams;e&&a.set("agent",e);const r=a.toString();return r?`?${r}`:""}function D(e=t(p)){return`${t(Se)}/conversations${we(e)}`}const tt=P(()=>g.url.pathname.split("/").at(-1)==="latency"?"latency":"traces");function at(e,a=t(tt),r=t(p)){return`${t(Se)}/conversations/${encodeURIComponent(e)}/${a}${we(r)}`}async function rt(e,a=t(H),r,l){return ye()?Yt.fetchConversations(a,e,r??void 0):j.getConversations({phoneNumber:e,agentId:l,limit:Number(a),lastConversationId:r??void 0})}async function E(){s(x,[],!0),s(I,null),await Y()}async function st(){s(R,!0),s(K,null);try{const e=await fetch("/traces/api/sources");if(!e.ok)throw new Error(`Failed to load sources (${e.status})`);const a=await e.json(),r=Array.isArray(a)?a:[];if(s(w,r.filter(c=>c&&typeof c.id=="string"&&typeof c.label=="string"),!0),!t(w).length)throw new Error("No sources returned");const l=ea(),u=l&&t(w).some(c=>c.id===l)?l:t(w)[0].id;s(N,u,!0),Je(u),j.setSourceId(u)}catch(e){console.error("Failed to load Telescope sources:",e),s(K,(e==null?void 0:e.message)??"Failed to load Telescope sources",!0),s(w,[],!0),s(N,""),j.setSourceId(void 0)}finally{s(R,!1)}}async function ot(e){const a=e.target.value;s(N,a,!0),Je(a),j.setSourceId(a),s(h,null),await y(D()),await E()}async function nt(){try{s(_e,await sa.agents.list.query(),!0)}catch(e){const a=e instanceof Error?e.message:e?String(e):"Unknown error";console.error("Failed to load agents:",e),be(`Failed to load agents: ${a}`)}}async function Y(){s(B,!0),s(J,null);try{const e=await rt(t(L)||void 0,t(H),t(I)??void 0,t(p)||void 0);let a=Array.isArray(e.items)?e.items.slice():[];a=a.filter(r=>!!(r!=null&&r.phoneNumber)),s(_,{limit:e.limit,items:a,lastConversationId:e.lastConversationId},!0),s(he,a.length,!0),s(I,e.lastConversationId??null,!0),s(B,!1)}catch(e){s(B,!1),s(J,e.message||"Unknown error",!0),be(`Error loading conversations: ${t(J)}`),console.error("Load page error:",e)}}async function lt(){var e;(e=t(_))!=null&&e.lastConversationId&&(t(x).push(t(_).lastConversationId),s(I,t(_).lastConversationId,!0),await Y())}async function it(){t(x).length&&(t(x).pop(),s(I,t(x).length?t(x)[t(x).length-1]:null,!0),await Y())}function ct(){var e;s(z,!t(z)),(e=t(_))!=null&&e.items&&t(_).items.sort((a,r)=>t(z)?r.createdAt-a.createdAt:a.createdAt-r.createdAt)}async function dt(e,a){var l;if(a==null||a.stopPropagation(),g.params.conversationId&&g.params.conversationId===e.conversationId||!g.params.conversationId&&((l=t(h))==null?void 0:l.conversationId)===e.conversationId){s(h,null),await y(D());return}s(h,e,!0),await y(at(e.conversationId))}function vt(e){const a=e.target.value;s(M,a,!0),s(H,parseInt(t(M),10)||20,!0)}async function Ie(){await E()}async function ut(e){e==null||e.preventDefault(),e==null||e.stopPropagation(),s(L,""),s(x,[],!0),s(I,null),await E()}const $e=P(()=>{const e=g.url.pathname.split("/")[1];return e==="traces"?"view":e}),Se=P(()=>g.url.pathname.startsWith("/view")?"/view":"/traces");function pt({value:e}){if(e!==t($e)){if(e==="edit")return t(p)?y(`/edit/${encodeURIComponent(t(p))}/roleplay`):y("/edit");if(e==="view")return y(D());y("/"+e)}}async function ft(e,a){a==null||a.stopPropagation(),e!==t(p)&&(s(h,null),await y(D(e)))}async function gt(e){e==null||e.stopPropagation(),t(p)&&(s(h,null),await y(D("")))}qt(()=>{const e=t(p);t(xe)&&e!==t(X)&&(s(X,e,!0),s(h,null),E())}),Bt(()=>{(async()=>(await Promise.all([nt(),st()]),await E(),s(X,t(p),!0),s(xe,!0)))()});var Z=ua();Wt("1uk1thp",e=>{Gt(()=>{Qt.title="Bosun: Telescope"})});var Ae=n(Z);aa(Ae,{get agents(){return t(_e)},get currentAgent(){return t(p)},onAgentClick:ft,showAllAgentsOption:!0,onAllAgentsClick:gt,className:"flex-none"});var Ce=i(Ae,2),ee=n(Ce),te=n(ee),mt=n(te);ta(mt,{get value(){return t($e)},ariaLabel:"Top tabs",onChange:pt,children:(e,a)=>{var r=oa(),l=me(r);Ke(l,{value:"edit",children:(c,S)=>{T();var m=C("Edit");v(c,m)},$$slots:{default:!0}});var u=i(l,2);Ke(u,{value:"view",children:(c,S)=>{T();var m=C("View");v(c,m)},$$slots:{default:!0}}),v(e,r)},$$slots:{default:!0}}),o(te);var ke=i(te,2),ae=n(ke),Pe=n(ae),Te=n(Pe),$=n(Te),_t=n($);{var ht=e=>{var a=zt(),r=me(a);Qe(r,17,()=>t(w),Ve,(l,u)=>{var c=Xe(),S=n(c,!0);o(c);var m={};k(()=>{f(S,t(u).label),m!==(m=t(u).id)&&(c.value=(c.__value=t(u).id)??"")}),v(l,c)}),v(e,a)},xt=e=>{var a=Xe(),r=n(a,!0);o(a),a.value=a.__value="",k(()=>f(r,t(R)?"Loading…":"No sources")),v(e,a)};Q(_t,e=>{t(w).length?e(ht):e(xt,-1)})}o($);var re=i($,2),Le=n(re);Xt(Le,{class:"w-56 rounded-r-none !border !border-rc-gray-500 !p-2 !pr-8 hover:border-rc-gray-400",placeholder:"Search by phone...",onkeydown:e=>{e.key==="Enter"&&(e.preventDefault(),e.stopPropagation(),Ie())},get value(){return t(L)},set value(e){s(L,e,!0)}});var yt=i(Le);{var bt=e=>{var a=na(),r=n(a);Kt(r,{name:"close",width:18,height:18}),o(a),U("click",a,ut),v(e,a)};Q(yt,e=>{t(L)&&e(bt)})}o(re);var wt=i(re,2);V(wt,{onclick:Ie,children:(e,a)=>{T();var r=C("Search");v(e,r)},$$slots:{default:!0}}),o(Te),o(Pe),o(ae);var se=i(ae,2),It=i(n(se),2);V(It,{onclick:ct,children:(e,a)=>{T();var r=C();k(()=>f(r,t(z)?"Newest first":"Oldest first")),v(e,r)},$$slots:{default:!0}}),o(se);var oe=i(se,2),q=i(n(oe),2),ne=n(q);ne.value=ne.__value="5";var le=i(ne);le.value=le.__value="10";var ie=i(le);ie.value=ie.__value="20";var Ne=i(ie);Ne.value=Ne.__value="50",o(q),o(oe);var ce=i(oe,2),De=n(ce),Ee=n(De);{let e=P(()=>t(x).length===0&&!t(I));V(Ee,{onclick:it,get disabled(){return t(e)},children:(a,r)=>{T();var l=C("Prev");v(a,l)},$$slots:{default:!0}})}var Fe=i(Ee,2);{let e=P(()=>{var a;return!((a=t(_))!=null&&a.items.length)});V(Fe,{onclick:lt,get disabled(){return t(e)},children:(a,r)=>{T();var l=C("Next");v(a,l)},$$slots:{default:!0}})}var Ue=i(Fe,2),$t=n(Ue);o(Ue),o(De),o(ce);var je=i(ce,2),Me=i(n(je),2),St=n(Me,!0);o(Me),o(je),o(ke),o(ee);var ze=i(ee,2),de=n(ze),Be=i(n(de),2),At=n(Be);{var Ct=e=>{var a=la();v(e,a)},kt=e=>{var a=ia();v(e,a)},Pt=e=>{var a=va();Qe(a,21,()=>t(_).items,Ve,(r,l)=>{var u=da(),c=n(u),S=n(c),m=n(S),Lt=n(m,!0);o(m);var Re=i(m,2),ue=n(Re),Nt=n(ue,!0);o(ue);var qe=i(ue,2),Dt=n(qe,!0);o(qe),o(Re),o(S);var Oe=i(S,2),pe=n(Oe),fe=i(n(pe),2),Et=n(fe,!0);o(fe);var Ft=i(fe,2);{var Ut=A=>{var O=ca(),F=i(me(O),2),G=n(F,!0);o(F),k(()=>f(G,t(l).agentId)),v(A,O)};Q(Ft,A=>{!t(p)&&t(l).agentId&&A(Ut)})}o(pe);var Ge=i(pe,2),jt=n(Ge);o(Ge),o(Oe),o(c),o(u),k((A,O)=>{var F,G;Ht(u,1,`cursor-pointer rounded-lg p-3 transition-colors ${(g.params.conversationId?t(l).conversationId===g.params.conversationId:t(l).conversationId===((F=t(h))==null?void 0:F.conversationId))?"bg-rc-gray-600":"bg-rc-gray-700 hover:bg-rc-gray-650"}`,"svelte-1uk1thp"),He(u,"aria-selected",g.params.conversationId?t(l).conversationId===g.params.conversationId:t(l).conversationId===((G=t(h))==null?void 0:G.conversationId)),f(Lt,A),f(Nt,t(l).medium),f(Dt,t(l).phoneNumber),f(Et,t(l).conversationId),f(jt,`Duration: ${O??""}`)},[()=>Ze(t(l).createdAt),()=>et(t(l).duration??0)]),U("click",u,A=>dt(t(l),A)),v(r,u)}),o(a),v(e,a)};Q(At,e=>{var a,r;t(B)?e(Ct):(r=(a=t(_))==null?void 0:a.items)!=null&&r.length?e(Pt,-1):e(kt,1)})}o(Be),o(de);var ve=i(de,2),Tt=n(ve);Vt(Tt,()=>W.children),o(ve),o(ze),o(Ce),o(Z),k(()=>{$.disabled=t(R)||!t(w).length,He($,"title",t(K)??"Telescope source"),f($t,`Items: ${t(he)??""}`),f(St,ye()?"Mock (local)":"Live")}),U("change",$,ot),We($,()=>t(N),e=>s(N,e)),U("change",q,vt),We(q,()=>t(M),e=>s(M,e)),U("click",ve,e=>e.stopPropagation()),v(Ye,Z),Ot()}Mt(["change","click"]);export{Fa as component};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as L,b as U,a as r,t as h,f as x}from"../chunks/C4SnSfql.js";import{p as j,a as B,f as R,j as l,s as g,n as $,c,o as b,r as d}from"../chunks/Dv8m1cTI.js";import{s as W}from"../chunks/D4obUD_s.js";import{g as q}from"../chunks/D-wf2QNc.js";import{p as s}from"../chunks/CNLU4B3p.js";import{T as z,a as _}from"../chunks/xebNt8-Z.js";var A=x("<!> <!>",1),D=x('<div class="flex h-full min-h-0 flex-col bg-rc-gray-980"><div class="flex-none border-b border-rc-gray-300/40 px-4 pt-3"><!></div> <div class="min-h-0 flex-1"><!></div></div>');function M(y,v){j(v,!0);const p=$(()=>s.url.pathname.split("/").at(-1)==="latency"?"latency":"traces"),w=$(()=>s.url.pathname.startsWith("/view")?"/view":"/traces");function T(a){const u=s.params.conversationId??"",t=s.url.search;return`${l(w)}/conversations/${encodeURIComponent(u)}/${a}${t}`}function C({value:a}){a!=="traces"&&a!=="latency"||a!==l(p)&&q(T(a))}var e=D(),o=c(e),P=c(o);z(P,{get value(){return l(p)},ariaLabel:"View conversation tabs",onChange:C,children:(a,u)=>{var t=A(),m=R(t);_(m,{value:"traces",children:(n,k)=>{b();var i=h("Traces");r(n,i)},$$slots:{default:!0}});var V=g(m,2);_(V,{value:"latency",children:(n,k)=>{b();var i=h("Latency");r(n,i)},$$slots:{default:!0}}),r(a,t)},$$slots:{default:!0}}),d(o);var f=g(o,2),I=c(f);W(I,()=>v.children),d(f),d(e),U("click",e,a=>a.stopPropagation()),r(y,e),B()}L(["click"]);export{M as component};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as C,b as A,a as m,f}from"../chunks/C4SnSfql.js";import{o as N}from"../chunks/C-whEtKd.js";import{p as _,d as q,a as h,s as k,c as o,r as l,t as F,j as n,q as S,v as j,e as H,w as M,$ as O}from"../chunks/Dv8m1cTI.js";import{h as P}from"../chunks/HXxIsSOO.js";import{e as R,c as z,A as B}from"../chunks/CqO5tR2_.js";import{s as D}from"../chunks/_yZg6Sf-.js";import{e as E,i as G}from"../chunks/D8e7SQh9.js";import{s as I,c as J}from"../chunks/C4D-JXnS.js";import{s as K}from"../chunks/DYhTBLDc.js";import{g as L}from"../chunks/BTvePR6r.js";import{t as Q}from"../chunks/DhBm2Vx9.js";var T=f('<button><span class="agent-name svelte-16acuk9"> </span></button>'),U=f('<div class="agent-grid-container svelte-16acuk9"><div class="agent-grid svelte-16acuk9"><!> <button class="agent-card new-agent svelte-16acuk9" aria-label="Create new agent"><span class="agent-name agent-name_new svelte-16acuk9">New Agent</span></button></div></div>');function V(u,a){_(a,!0),q(()=>{R(a.agents)});const i=t=>t.split("/").at(-1)??t;var r=U(),c=o(r),g=o(c);E(g,17,()=>a.agents,G,(t,e)=>{var s=T();let p;var b=o(s),x=o(b,!0);l(b),l(s),F((d,y,w)=>{p=K(s,1,"agent-card svelte-16acuk9",null,p,{active:n(e)===a.currentAgent}),I(s,`--agent-color: ${d??""}`),J(s,"aria-label",y),D(x,w)},[()=>z(n(e)),()=>`Open ${i(n(e))}`,()=>i(n(e))]),A("click",s,d=>a.onAgentClick(n(e),d)),m(t,s)});var v=k(g,2);l(c),l(r),A("click",v,function(...t){var e;(e=a.onNewAgent)==null||e.apply(this,t)}),m(u,r),h()}C(["click"]);var W=f('<div class="flex h-screen"><!> <div class="flex h-full min-w-0 flex-1 flex-col bg-rc-gray-980 py-3 pr-4"><div class="flex-1"><!></div></div></div>');function le(u,a){_(a,!0);const{onAgentSelect:i}=L();let r=S(j([]));N(async()=>{M(r,await Q.agents.list.query(),!0)});var c=W();P("1uha8ag",s=>{H(()=>{O.title="Recombine Agents Hub"})});var g=o(c);B(g,{className:"flex-none border-r-thin border-r-rc-gray-600",get agents(){return n(r)},currentAgent:"",get onAgentClick(){return i},initiallyCollapsed:!1,hoverCollapse:!1});var v=k(g,2),t=o(v),e=o(t);V(e,{get agents(){return n(r)},currentAgent:"",get onAgentClick(){return i}}),l(t),l(v),l(c),m(u,c),h()}export{le as component};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,t as b,f as C}from"../chunks/C4SnSfql.js";import{o as L}from"../chunks/C-whEtKd.js";import{p as M,q as _,v as N,d as U,a as V,e as z,j as t,f as D,s as y,c as i,n as G,w,$ as H,o as l,r as f}from"../chunks/Dv8m1cTI.js";import{h as I}from"../chunks/HXxIsSOO.js";import{g as c}from"../chunks/D-wf2QNc.js";import{g as J}from"../chunks/BTvePR6r.js";import{t as K}from"../chunks/DhBm2Vx9.js";import{A as O}from"../chunks/CqO5tR2_.js";import{T as Q,a as A}from"../chunks/xebNt8-Z.js";import{p as T}from"../chunks/CNLU4B3p.js";var R=C("<!> <!>",1),W=C('<div class="flex h-screen"><!> <div class="flex h-full min-w-0 flex-1 flex-col bg-rc-gray-980 pb-3 pr-4 pt-2"><nav class="flex flex-none items-center justify-center bg-rc-gray-980"><!></nav> <main class="flex-1 pr-80 pt-40"><div class="flex h-full items-start justify-center text-rc-gray-200">Select an agent on the left panel to start editing</div></main></div></div>');function ie(S,E){M(E,!0);const{onAgentSelect:d,onError:j}=J();let r=_(N([])),p=_(!1);const g=G(()=>T.url.pathname.split("/")[1]);function k({value:e}){if(e!==t(g)){if(e==="edit")return c("/edit");if(e==="view")return c("/view");c("/"+e)}}function P(e){d(e)}U(()=>{t(p)||T.url.pathname==="/edit"&&t(r).length&&(w(p,!0),d(t(r)[0]))}),L(async()=>{try{w(r,await K.agents.list.query(),!0)}catch(e){const h=e instanceof Error?e.message:e?String(e):"Unknown error";console.error("Failed to load agents:",e),j(`Failed to load agents: ${h}`)}});var s=W();I("17v3h6h",e=>{z(()=>{H.title="Bosun: Edit"})});var m=i(s);O(m,{className:"flex-none",get agents(){return t(r)},currentAgent:"",onAgentClick:P});var u=y(m,2),v=i(u),q=i(v);Q(q,{get value(){return t(g)},ariaLabel:"Top tabs",onChange:k,children:(e,h)=>{var $=R(),x=D($);A(x,{value:"edit",children:(n,B)=>{l();var o=b("Edit");a(n,o)},$$slots:{default:!0}});var F=y(x,2);A(F,{value:"view",children:(n,B)=>{l();var o=b("View");a(n,o)},$$slots:{default:!0}}),a(e,$)},$$slots:{default:!0}}),f(v),l(2),f(u),f(s),a(S,s),V()}export{ie as component};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a}from"../chunks/
|
|
1
|
+
import{r as a}from"../chunks/gULlE0tz.js";function i({url:t,params:n}){const o=t.searchParams.get("step"),r=t.searchParams.get("region"),s=`/edit/${encodeURIComponent(n.agent)}/roleplay`,e=new URLSearchParams;o&&e.set("step",o),r&&e.set("region",r),a(307,e.size?`${s}?${e.toString()}`:s)}const g=Object.freeze(Object.defineProperty({__proto__:null,load:i},Symbol.toStringTag,{value:"Module"}));export{g as universal};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
�`�ν�SHňM���(5�*�S7��Ai̊�Mk �a�qz�@��&o��ĥ�xJ�:��� ����zbx��G��#SB=׃%^�3��r[T�+��-槙1/���]����bIY�c�OXô��k�=��&�h|���}�R�o�A���n��dw(�硰�AߣȄ�4��ԉW�ڐf�̜]@G���J2����6"�������iN�]%uw�b� Q�f�l;�_p'סa
|
|
Binary file
|