@wandox/sdk 0.1.42 → 0.1.43
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/dist/{V1Workbench-BMtwxYV1.cjs → V1Workbench-B9o_U8aO.cjs} +1 -1
- package/dist/{V1Workbench-BPM2Hyia.js → V1Workbench-DtwjchsP.js} +3 -3
- package/dist/V2Workbench-Bh5bDBlV.cjs +2 -0
- package/dist/{V2Workbench-SLCyuz0m.js → V2Workbench-etU2xPzD.js} +318 -312
- package/dist/{WorkbenchRuntime-Bw3YVJyj.cjs → WorkbenchRuntime-CVhbTmsn.cjs} +4 -4
- package/dist/{WorkbenchRuntime-D4TX08P0.js → WorkbenchRuntime-CypElf5G.js} +8 -7
- package/dist/{arc-TMt-ELu0.cjs → arc-DZC23cud.cjs} +1 -1
- package/dist/{arc-CTFudHUx.js → arc-KzT0EnTt.js} +1 -1
- package/dist/{architectureDiagram-3BPJPVTR-ma8wVb-G.cjs → architectureDiagram-3BPJPVTR-5k0jfbGR.cjs} +1 -1
- package/dist/{architectureDiagram-3BPJPVTR-D0nzJigQ.js → architectureDiagram-3BPJPVTR-RLP6nQvV.js} +3 -3
- package/dist/{blockDiagram-GPEHLZMM-CrLMJpgy.js → blockDiagram-GPEHLZMM-CoJLVb02.js} +3 -3
- package/dist/{blockDiagram-GPEHLZMM-B9SG48zF.cjs → blockDiagram-GPEHLZMM-DceAnJoY.cjs} +1 -1
- package/dist/{c4Diagram-AAUBKEIU-DYLkOb29.cjs → c4Diagram-AAUBKEIU-MzLmGCqL.cjs} +1 -1
- package/dist/{c4Diagram-AAUBKEIU-jGpmbYup.js → c4Diagram-AAUBKEIU-T-T4e0mB.js} +2 -2
- package/dist/{channel-xuGF2XHi.js → channel-BiS2QhjX.js} +1 -1
- package/dist/{channel-D9aXObDg.cjs → channel-Cm9GGpp6.cjs} +1 -1
- package/dist/{chunk-2J33WTMH-DfCPx4TK.js → chunk-2J33WTMH-Cz22cuO_.js} +1 -1
- package/dist/{chunk-2J33WTMH-Bb7r3UsS.cjs → chunk-2J33WTMH-DIajlLPT.cjs} +1 -1
- package/dist/{chunk-4BX2VUAB-BVBFGazg.js → chunk-4BX2VUAB-BKscTaJM.js} +1 -1
- package/dist/{chunk-4BX2VUAB-Ujuys49Z.cjs → chunk-4BX2VUAB-DzYu-_uE.cjs} +1 -1
- package/dist/{chunk-55IACEB6-D2bCK212.js → chunk-55IACEB6-DV_bsX8C.js} +1 -1
- package/dist/{chunk-55IACEB6-CCHNm8Tr.cjs → chunk-55IACEB6-TLFlN5WW.cjs} +1 -1
- package/dist/{chunk-727SXJPM-C72XbFAd.cjs → chunk-727SXJPM-DAmczDb4.cjs} +1 -1
- package/dist/{chunk-727SXJPM-Cio-wglM.js → chunk-727SXJPM-kB3sPt2T.js} +5 -5
- package/dist/{chunk-AQP2D5EJ-B3kQBTIw.cjs → chunk-AQP2D5EJ-DBd5RxkC.cjs} +1 -1
- package/dist/{chunk-AQP2D5EJ-Ba8JlV7E.js → chunk-AQP2D5EJ-j8WzCnfH.js} +3 -3
- package/dist/{chunk-FMBD7UC4-CYbGgPkz.cjs → chunk-FMBD7UC4-Bk8fGNrN.cjs} +1 -1
- package/dist/{chunk-FMBD7UC4-B8AkbgCj.js → chunk-FMBD7UC4-Bo9GmTwy.js} +1 -1
- package/dist/{chunk-ND2GUHAM-BgCWhBGM.cjs → chunk-ND2GUHAM-BlaLxZl9.cjs} +1 -1
- package/dist/{chunk-ND2GUHAM-CHUVXZay.js → chunk-ND2GUHAM-_2cK9e6-.js} +1 -1
- package/dist/{chunk-QZHKN3VN-CvOSWDrJ.cjs → chunk-QZHKN3VN-BVopp-sz.cjs} +1 -1
- package/dist/{chunk-QZHKN3VN-D8pfWLL2.js → chunk-QZHKN3VN-Cz700WiE.js} +1 -1
- package/dist/{classDiagram-4FO5ZUOK-BgajT1MN.cjs → classDiagram-4FO5ZUOK-C1_LKqgm.cjs} +1 -1
- package/dist/{classDiagram-4FO5ZUOK-BpqWK41p.js → classDiagram-4FO5ZUOK-Duc1S1C3.js} +2 -2
- package/dist/{classDiagram-v2-Q7XG4LA2-BgajT1MN.cjs → classDiagram-v2-Q7XG4LA2-C1_LKqgm.cjs} +1 -1
- package/dist/{classDiagram-v2-Q7XG4LA2-DIpkOsLT.js → classDiagram-v2-Q7XG4LA2-Cw_N2MCX.js} +2 -2
- package/dist/{cose-bilkent-S5V4N54A-CpfHDS3L.cjs → cose-bilkent-S5V4N54A-BKZqIzYg.cjs} +1 -1
- package/dist/{cose-bilkent-S5V4N54A-Cqi01qNn.js → cose-bilkent-S5V4N54A-BjpfMxaU.js} +2 -2
- package/dist/{dagre-BM42HDAG-C23jgWGl.js → dagre-BM42HDAG-CQThzdC_.js} +1 -1
- package/dist/{dagre-BM42HDAG-CLDIPr-X.cjs → dagre-BM42HDAG-Fld12_1l.cjs} +1 -1
- package/dist/{diagram-2AECGRRQ-CjnokWsQ.cjs → diagram-2AECGRRQ-BcTGhMXd.cjs} +1 -1
- package/dist/{diagram-2AECGRRQ-Cj24Od-u.js → diagram-2AECGRRQ-CIBRIVNG.js} +2 -2
- package/dist/{diagram-5GNKFQAL-BfV9uMUl.cjs → diagram-5GNKFQAL-BkLpALBg.cjs} +1 -1
- package/dist/{diagram-5GNKFQAL-BbiEdciY.js → diagram-5GNKFQAL-Zaw82XJh.js} +3 -3
- package/dist/{diagram-KO2AKTUF-D9v2ooVA.js → diagram-KO2AKTUF-B7xrMmCV.js} +2 -2
- package/dist/{diagram-KO2AKTUF-DrZSS2Gv.cjs → diagram-KO2AKTUF-D0_eoN0U.cjs} +1 -1
- package/dist/{diagram-LMA3HP47-rD-lWG_r.js → diagram-LMA3HP47-DUjmGtpP.js} +2 -2
- package/dist/{diagram-LMA3HP47-eMKAwWlp.cjs → diagram-LMA3HP47-DrKGcq4W.cjs} +1 -1
- package/dist/{diagram-OG6HWLK6-CflRan99.js → diagram-OG6HWLK6-DMninHP8.js} +3 -3
- package/dist/{diagram-OG6HWLK6-50-uYAg9.cjs → diagram-OG6HWLK6-pShu3fOg.cjs} +1 -1
- package/dist/{erDiagram-TEJ5UH35-CEHO-wXV.js → erDiagram-TEJ5UH35-DTfbMMC9.js} +4 -4
- package/dist/{erDiagram-TEJ5UH35-BTriOcqX.cjs → erDiagram-TEJ5UH35-Dk-sYhep.cjs} +1 -1
- package/dist/{flowDiagram-I6XJVG4X-BvOBJzbt.js → flowDiagram-I6XJVG4X-CLwM_Eg0.js} +6 -6
- package/dist/{flowDiagram-I6XJVG4X-BLp2Bhui.cjs → flowDiagram-I6XJVG4X-DppBTRsZ.cjs} +1 -1
- package/dist/{ganttDiagram-6RSMTGT7-9be6okZP.js → ganttDiagram-6RSMTGT7-DIa85OV9.js} +3 -3
- package/dist/{ganttDiagram-6RSMTGT7-DHYCnTZk.cjs → ganttDiagram-6RSMTGT7-EpoZQLvi.cjs} +1 -1
- package/dist/{gitGraphDiagram-PVQCEYII-DysW3J76.js → gitGraphDiagram-PVQCEYII-BRLUWeD3.js} +3 -3
- package/dist/{gitGraphDiagram-PVQCEYII-fuLhNOZJ.cjs → gitGraphDiagram-PVQCEYII-CsFY181r.cjs} +1 -1
- package/dist/{index-QIZEllkT.cjs → index-B5J1m72V.cjs} +1 -1
- package/dist/{index-BjGp64i-.js → index-BGQhNpL1.js} +2 -2
- package/dist/{index-DCt5j5lC.cjs → index-Cpei3C6T.cjs} +6 -6
- package/dist/{index-CN7b3cbE.js → index-DiKNNTFn.js} +8 -8
- package/dist/{infoDiagram-5YYISTIA-BQB8CM7E.cjs → infoDiagram-5YYISTIA-BE2ny8B4.cjs} +1 -1
- package/dist/{infoDiagram-5YYISTIA-BKiJ4C1R.js → infoDiagram-5YYISTIA-Cj29jNVn.js} +1 -1
- package/dist/{ishikawaDiagram-YF4QCWOH-Cm3nbVdr.js → ishikawaDiagram-YF4QCWOH-CTLGQ4PN.js} +1 -1
- package/dist/{ishikawaDiagram-YF4QCWOH-CmWN_962.cjs → ishikawaDiagram-YF4QCWOH-DyRH5JNV.cjs} +1 -1
- package/dist/{journeyDiagram-JHISSGLW-BH3kUnoi.js → journeyDiagram-JHISSGLW-BR4Ab1xq.js} +4 -4
- package/dist/{journeyDiagram-JHISSGLW-Qeh_6e_n.cjs → journeyDiagram-JHISSGLW-Byy1iuRk.cjs} +1 -1
- package/dist/{kanban-definition-UN3LZRKU-BcNQilMv.js → kanban-definition-UN3LZRKU-Cstu6gJZ.js} +2 -2
- package/dist/{kanban-definition-UN3LZRKU-BQVFSEa2.cjs → kanban-definition-UN3LZRKU-z4mwtimn.cjs} +1 -1
- package/dist/{linear-TarjbgsN.cjs → linear-CgTdlbkV.cjs} +1 -1
- package/dist/{linear-xl1chASq.js → linear-DHz5lgrw.js} +1 -1
- package/dist/{mermaid.core-CD8W-83J.cjs → mermaid.core-6Rboof0_.cjs} +3 -3
- package/dist/{mermaid.core-VImUQ-y-.js → mermaid.core-CS-i9hKc.js} +35 -35
- package/dist/{mindmap-definition-RKZ34NQL-DCRQT10I.cjs → mindmap-definition-RKZ34NQL-CQxvbyEf.cjs} +1 -1
- package/dist/{mindmap-definition-RKZ34NQL-BJl71t4P.js → mindmap-definition-RKZ34NQL-DBvY1gCG.js} +3 -3
- package/dist/{pieDiagram-4H26LBE5--tW4dEtH.cjs → pieDiagram-4H26LBE5-BJTvIeTN.cjs} +1 -1
- package/dist/{pieDiagram-4H26LBE5-DwQkQmdD.js → pieDiagram-4H26LBE5-BbulgKyH.js} +3 -3
- package/dist/{quadrantDiagram-W4KKPZXB-WFcfZghI.cjs → quadrantDiagram-W4KKPZXB-BGu3SyWz.cjs} +1 -1
- package/dist/{quadrantDiagram-W4KKPZXB-D41uKlpw.js → quadrantDiagram-W4KKPZXB-_rv2Qg71.js} +2 -2
- package/dist/{requirementDiagram-4Y6WPE33-ChLKzwEb.cjs → requirementDiagram-4Y6WPE33-Bm4ViepU.cjs} +1 -1
- package/dist/{requirementDiagram-4Y6WPE33-npAxQTol.js → requirementDiagram-4Y6WPE33-CpZeNXB3.js} +3 -3
- package/dist/{sankeyDiagram-5OEKKPKP-BvcPTB2N.cjs → sankeyDiagram-5OEKKPKP-BLxCUGiP.cjs} +1 -1
- package/dist/{sankeyDiagram-5OEKKPKP-fKgres6H.js → sankeyDiagram-5OEKKPKP-CZvgmmBP.js} +1 -1
- package/dist/{sequenceDiagram-3UESZ5HK-LGRgMkGi.cjs → sequenceDiagram-3UESZ5HK-BBDEZFwB.cjs} +1 -1
- package/dist/{sequenceDiagram-3UESZ5HK-CpEUV9gb.js → sequenceDiagram-3UESZ5HK-DwgEjoON.js} +3 -3
- package/dist/{stateDiagram-AJRCARHV-XBb-Dtow.cjs → stateDiagram-AJRCARHV-BqcG_ChJ.cjs} +1 -1
- package/dist/{stateDiagram-AJRCARHV-CHqQN0ix.js → stateDiagram-AJRCARHV-D3CASY0s.js} +2 -2
- package/dist/{stateDiagram-v2-BHNVJYJU-C14xhWxp.cjs → stateDiagram-v2-BHNVJYJU-CC1TA5cE.cjs} +1 -1
- package/dist/{stateDiagram-v2-BHNVJYJU-Z8Pi0Y3W.js → stateDiagram-v2-BHNVJYJU-vbr36pvU.js} +2 -2
- package/dist/{timeline-definition-PNZ67QCA-D6BDxDF0.cjs → timeline-definition-PNZ67QCA-BVkKzUPo.cjs} +1 -1
- package/dist/{timeline-definition-PNZ67QCA-CQlKM_xI.js → timeline-definition-PNZ67QCA-Bm1d-AzB.js} +2 -2
- package/dist/{vennDiagram-CIIHVFJN-BNuzvov-.cjs → vennDiagram-CIIHVFJN-4OYsnAtq.cjs} +1 -1
- package/dist/{vennDiagram-CIIHVFJN-CQuhupzV.js → vennDiagram-CIIHVFJN-yGUCdugP.js} +1 -1
- package/dist/wandox.cjs +1 -1
- package/dist/wandox.css +1 -1
- package/dist/wandox.js +1 -1
- package/dist/wandox.umd.js +276 -276
- package/dist/{wardleyDiagram-YWT4CUSO-MHRvjUGT.cjs → wardleyDiagram-YWT4CUSO-DAJJWPai.cjs} +1 -1
- package/dist/{wardleyDiagram-YWT4CUSO-22zzwPUn.js → wardleyDiagram-YWT4CUSO-DmASfXP7.js} +2 -2
- package/dist/{xychartDiagram-2RQKCTM6-CUe-G5Nn.cjs → xychartDiagram-2RQKCTM6-BKdlhCMk.cjs} +1 -1
- package/dist/{xychartDiagram-2RQKCTM6-BLOMoiAI.js → xychartDiagram-2RQKCTM6-C8BTMQrb.js} +2 -2
- package/package.json +1 -1
- package/dist/V2Workbench-Dldh6IwR.cjs +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DCt5j5lC.cjs"),q=require("./WorkbenchRuntime-Bw3YVJyj.cjs"),Je=require("./index-QIZEllkT.cjs");var At={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M952 474H829.8C812.5 327.6 696.4 211.5 550 194.2V72c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v122.2C327.6 211.5 211.5 327.6 194.2 474H72c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h122.2C211.5 696.4 327.6 812.5 474 829.8V952c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V829.8C696.4 812.5 812.5 696.4 829.8 550H952c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zM512 756c-134.8 0-244-109.2-244-244s109.2-244 244-244 244 109.2 244 244-109.2 244-244 244z"}},{tag:"path",attrs:{d:"M512 392c-32.1 0-62.1 12.4-84.8 35.2-22.7 22.7-35.2 52.7-35.2 84.8s12.5 62.1 35.2 84.8C449.9 619.4 480 632 512 632s62.1-12.5 84.8-35.2C619.4 574.1 632 544 632 512s-12.5-62.1-35.2-84.8A118.57 118.57 0 00512 392z"}}]},name:"aim",theme:"outlined"};function Fe(){return Fe=Object.assign?Object.assign.bind():function(n){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},Fe.apply(this,arguments)}const Mt=(n,s)=>e.reactExports.createElement(e.Icon,Fe({},n,{ref:s,icon:At})),$t=e.reactExports.forwardRef(Mt);var Tt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888.3 693.2c-42.5-24.6-94.3-18-129.2 12.8l-53-30.7V523.6c0-15.7-8.4-30.3-22-38.1l-136-78.3v-67.1c44.2-15 76-56.8 76-106.1 0-61.9-50.1-112-112-112s-112 50.1-112 112c0 49.3 31.8 91.1 76 106.1v67.1l-136 78.3c-13.6 7.8-22 22.4-22 38.1v151.6l-53 30.7c-34.9-30.8-86.8-37.4-129.2-12.8-53.5 31-71.7 99.4-41 152.9 30.8 53.5 98.9 71.9 152.2 41 42.5-24.6 62.7-73 53.6-118.8l48.7-28.3 140.6 81c6.8 3.9 14.4 5.9 22 5.9s15.2-2 22-5.9L674.5 740l48.7 28.3c-9.1 45.7 11.2 94.2 53.6 118.8 53.3 30.9 121.5 12.6 152.2-41 30.8-53.6 12.6-122-40.7-152.9zm-673 138.4a47.6 47.6 0 01-65.2-17.6c-13.2-22.9-5.4-52.3 17.5-65.5a47.6 47.6 0 0165.2 17.6c13.2 22.9 5.4 52.3-17.5 65.5zM522 463.8zM464 234a48.01 48.01 0 0196 0 48.01 48.01 0 01-96 0zm170 446.2l-122 70.3-122-70.3V539.8l122-70.3 122 70.3v140.4zm239.9 133.9c-13.2 22.9-42.4 30.8-65.2 17.6-22.8-13.2-30.7-42.6-17.5-65.5s42.4-30.8 65.2-17.6c22.9 13.2 30.7 42.5 17.5 65.5z"}}]},name:"deployment-unit",theme:"outlined"};function Ge(){return Ge=Object.assign?Object.assign.bind():function(n){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},Ge.apply(this,arguments)}const Lt=(n,s)=>e.reactExports.createElement(e.Icon,Ge({},n,{ref:s,icon:Tt})),Bt=e.reactExports.forwardRef(Lt);var Dt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M904 160H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0 624H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0-312H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8z"}}]},name:"menu",theme:"outlined"};function Ke(){return Ke=Object.assign?Object.assign.bind():function(n){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},Ke.apply(this,arguments)}const Ot=(n,s)=>e.reactExports.createElement(e.Icon,Ke({},n,{ref:s,icon:Dt})),ot=e.reactExports.forwardRef(Ot);var zt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M705.6 124.9a8 8 0 00-11.6 7.2v64.2c0 5.5 2.9 10.6 7.5 13.6a352.2 352.2 0 0162.2 49.8c32.7 32.8 58.4 70.9 76.3 113.3a355 355 0 0127.9 138.7c0 48.1-9.4 94.8-27.9 138.7a355.92 355.92 0 01-76.3 113.3 353.06 353.06 0 01-113.2 76.4c-43.8 18.6-90.5 28-138.5 28s-94.7-9.4-138.5-28a353.06 353.06 0 01-113.2-76.4A355.92 355.92 0 01184 650.4a355 355 0 01-27.9-138.7c0-48.1 9.4-94.8 27.9-138.7 17.9-42.4 43.6-80.5 76.3-113.3 19-19 39.8-35.6 62.2-49.8 4.7-2.9 7.5-8.1 7.5-13.6V132c0-6-6.3-9.8-11.6-7.2C178.5 195.2 82 339.3 80 506.3 77.2 745.1 272.5 943.5 511.2 944c239 .5 432.8-193.3 432.8-432.4 0-169.2-97-315.7-238.4-386.7zM480 560h64c4.4 0 8-3.6 8-8V88c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8z"}}]},name:"poweroff",theme:"outlined"};function Ze(){return Ze=Object.assign?Object.assign.bind():function(n){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},Ze.apply(this,arguments)}const Wt=(n,s)=>e.reactExports.createElement(e.Icon,Ze({},n,{ref:s,icon:zt})),Vt=e.reactExports.forwardRef(Wt);var qt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M876.6 239.5c-.5-.9-1.2-1.8-2-2.5-5-5-13.1-5-18.1 0L684.2 409.3l-67.9-67.9L788.7 169c.8-.8 1.4-1.6 2-2.5 3.6-6.1 1.6-13.9-4.5-17.5-98.2-58-226.8-44.7-311.3 39.7-67 67-89.2 162-66.5 247.4l-293 293c-3 3-2.8 7.9.3 11l169.7 169.7c3.1 3.1 8.1 3.3 11 .3l292.9-292.9c85.5 22.8 180.5.7 247.6-66.4 84.4-84.5 97.7-213.1 39.7-311.3zM786 499.8c-58.1 58.1-145.3 69.3-214.6 33.6l-8.8 8.8-.1-.1-274 274.1-79.2-79.2 230.1-230.1s0 .1.1.1l52.8-52.8c-35.7-69.3-24.5-156.5 33.6-214.6a184.2 184.2 0 01144-53.5L537 318.9a32.05 32.05 0 000 45.3l124.5 124.5a32.05 32.05 0 0045.3 0l132.8-132.8c3.7 51.8-14.4 104.8-53.6 143.9z"}}]},name:"tool",theme:"outlined"};function Ye(){return Ye=Object.assign?Object.assign.bind():function(n){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},Ye.apply(this,arguments)}const Qt=(n,s)=>e.reactExports.createElement(e.Icon,Ye({},n,{ref:s,icon:qt})),Ut=e.reactExports.forwardRef(Qt);function Ft(n){return n instanceof Error?n.message:"上传失败"}function Gt({open:n,playbook:s,onClose:i,onSubmit:o}){const h=e.reactExports.useMemo(()=>e.normalizeAgentInputFields(s==null?void 0:s.input_fields),[s]),[j,l]=e.reactExports.useState({}),[u,v]=e.reactExports.useState({}),[w,g]=e.reactExports.useState({}),p=e.useDynamicFieldOptions(h,j,l),R=e.reactExports.useMemo(()=>q.getVisibleInputFields(h,j),[h,j]);e.reactExports.useEffect(()=>{n&&(l(q.buildDefaultInputValues(h,(s==null?void 0:s.initial_params)??{})),v({}),g({}))},[h,n,s==null?void 0:s.initial_params]);const E=e.reactExports.useCallback((f,r)=>{l(c=>({...c,[f]:r}))},[]),B=e.reactExports.useCallback((f,r)=>async({file:c,onSuccess:N,onError:b})=>{var M,S;v(Q=>({...Q,[f]:!0}));try{const Q=c,$=await e.POST_Api_V1_Oss_Upload2(Q),D=(M=$==null?void 0:$.data)==null?void 0:M.url,C=((S=$==null?void 0:$.data)==null?void 0:S.name)||Q.name;if(!D)throw new Error("上传结果缺少文件地址");g(I=>({...I,[D]:C})),l(I=>{if(r<=1)return{...I,[f]:D};const U=Array.isArray(I[f])?I[f]:I[f]?[I[f]]:[];return{...I,[f]:[...U,D]}}),N==null||N($),e.staticMethods.success("上传成功")}catch(Q){const $=Q instanceof Error?Q:new Error(Ft(Q));b==null||b($),e.staticMethods.error($.message)}finally{v(Q=>({...Q,[f]:!1}))}},[]),z=()=>{if(!s)return;const f=R.filter(r=>r.required&&q.isMissingFieldValue(j[r.name]));if(f.length>0){e.staticMethods.warning(`请填写必填参数:${f.map(r=>r.label).join("、")}`);return}o(s,j)};return e.jsxRuntimeExports.jsxs(Je.Drawer,{className:"wandox-playbook-params-drawer",title:e.jsxRuntimeExports.jsxs("div",{className:"wandox-playbook-params-drawer__title",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-playbook-params-drawer__title-main",children:"填写执行参数"}),e.jsxRuntimeExports.jsx("span",{className:"wandox-playbook-params-drawer__title-sub",children:s==null?void 0:s.name})]}),open:n,size:640,destroyOnHidden:!0,maskClosable:!1,onClose:i,footer:e.jsxRuntimeExports.jsx("div",{className:"wandox-playbook-params-drawer__footer",children:e.jsxRuntimeExports.jsxs(e.Space,{children:[e.jsxRuntimeExports.jsx(e.Button,{onClick:i,children:"取消"}),e.jsxRuntimeExports.jsx(e.Button,{type:"primary",onClick:z,children:"开始执行"})]})}),children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-playbook-params-drawer__intro",children:[e.jsxRuntimeExports.jsx("span",{children:"填写本次运行需要的参数"}),e.jsxRuntimeExports.jsxs("span",{children:[R.length," 项"]})]}),e.jsxRuntimeExports.jsxs(e.Form,{layout:"vertical",className:"wandox-playbook-params-drawer__form",children:[R.map(f=>e.jsxRuntimeExports.jsx(e.Form.Item,{required:f.required,label:e.jsxRuntimeExports.jsxs("span",{className:"wandox-playbook-params-drawer__label",children:[f.label,f.description||f.hint?e.jsxRuntimeExports.jsx(e.Tooltip,{title:f.description||f.hint,children:e.jsxRuntimeExports.jsx(e.RefIcon$2,{"aria-label":`${f.label}说明`})}):null]}),children:e.jsxRuntimeExports.jsx(q.AgentInputFieldControl,{field:f,value:j[f.name],uploading:!!u[f.name],fileNameMap:w,getOptionState:p.getFieldState,onChange:E,onUpload:B,onDownloadTemplate:r=>window.open(r.path,"_blank","noopener,noreferrer")})},f.name)),R.length===0?e.jsxRuntimeExports.jsxs("div",{className:"wandox-playbook-params-drawer__empty",children:[e.jsxRuntimeExports.jsx(e.Spin,{size:"small"})," 正在读取参数配置"]}):null]})]})}function Kt({playbooks:n,onPlaybookClick:s,onPlaybookDelete:i,activePlaybookId:o}){const{t:h}=e.useLanguage(),[j,l]=e.reactExports.useState(""),[u,v]=e.reactExports.useState(!1),[w,g]=e.reactExports.useState(null),[p,R]=e.reactExports.useState(!1),E=n.filter(r=>{var c;return r.name.toLowerCase().includes(j.toLowerCase())||((c=r.description)==null?void 0:c.toLowerCase().includes(j.toLowerCase()))}),B=(r,c)=>{c.stopPropagation(),g(r),v(!0)},z=async()=>{if(w){R(!0);try{await e.DELETE_Api_V1_Playbooks_SolidifyView_ByPlaybookId(w.playbook_id),i==null||i(w.playbook_id),v(!1),g(null)}catch{}finally{R(!1)}}},f=()=>{v(!1),g(null)};return e.jsxRuntimeExports.jsxs("div",{className:"wandox-solidified-list",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-solidified-list-search",children:e.jsxRuntimeExports.jsx(e.Input.Search,{placeholder:"搜索",value:j,onChange:r=>l(r.target.value),allowClear:!0,enterButton:!1})}),e.jsxRuntimeExports.jsx("div",{className:"wandox-solidified-list-content",children:E.length===0?e.jsxRuntimeExports.jsx(e.Empty,{description:h(j?"noData":"solidified.empty"),image:e.Empty.PRESENTED_IMAGE_SIMPLE}):e.jsxRuntimeExports.jsx("div",{className:"wandox-solidified-list-grid",children:E.map(r=>e.jsxRuntimeExports.jsxs("div",{className:`wandox-solidified-card ${o===r.playbook_id?"active":""}`,onClick:()=>s==null?void 0:s(r.playbook_id),onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(s==null||s(r.playbook_id))},role:"button",tabIndex:0,children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-solidified-card-icon",children:e.jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsxRuntimeExports.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",stroke:"currentColor",strokeWidth:"2",fill:"none"}),e.jsxRuntimeExports.jsx("path",{d:"M9 3v18M15 3v18M3 9h18M3 15h18",stroke:"currentColor",strokeWidth:"1.5"}),e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor"})]})}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-solidified-card-content",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-solidified-card-name",children:r.name}),r.description&&e.jsxRuntimeExports.jsx("div",{className:"wandox-solidified-card-desc",children:r.description})]}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-solidified-card-delete",onClick:c=>B(r,c),title:h("solidified.delete"),children:e.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsxRuntimeExports.jsx("path",{d:"M6 7v12a2 2 0 002 2h8a2 2 0 002-2V7M4 7h16M10 11v6M14 11v6M9 7V4a1 1 0 011-1h4a1 1 0 011 1v3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},r.playbook_id))})}),e.jsxRuntimeExports.jsx(e.Modal,{title:h("solidified.deleteConfirm"),open:u,onOk:z,onCancel:f,okText:h("confirm"),cancelText:h("cancel"),okButtonProps:{danger:!0,loading:p},children:e.jsxRuntimeExports.jsxs("p",{children:[h("solidified.deleteConfirm")," 「",w==null?void 0:w.name,"」?"]})})]})}function Zt({inputParams:n,onSearch:s,loading:i=!1}){const[o]=e.Form.useForm();e.reactExports.useEffect(()=>{const l={};for(const u of n)u.default!==void 0&&u.default!==null&&u.default!==""&&(l[u.name]=u.default);o.setFieldsValue(l)},[n,o]);const h=()=>{o.validateFields().then(l=>{const u={};for(const v of Object.keys(l)){const w=l[v];w!=null&&w!==""&&(u[v]=w)}s(u)})},j=l=>{const{name:u,type:v,description:w}=l,g={placeholder:w||`请输入${u}`};switch(v){case"integer":return e.jsxRuntimeExports.jsx(e.TypedInputNumber,{...g,style:{width:"100%"}});case"array":return e.jsxRuntimeExports.jsx(e.Input,{...g});case"boolean":return e.jsxRuntimeExports.jsx(e.Input,{...g});case"string":default:return e.jsxRuntimeExports.jsx(e.Input,{...g})}};return e.jsxRuntimeExports.jsx("div",{className:"wandox-solidify-params-form",children:e.jsxRuntimeExports.jsxs(e.Form,{form:o,layout:"inline",onFinish:h,style:{marginBottom:16},children:[n.map(l=>e.jsxRuntimeExports.jsx(e.Form.Item,{name:l.name,label:l.description||l.name,rules:[{required:l.required,message:`请输入${l.description||l.name}`}],style:{marginBottom:8},children:j(l)},l.name)),e.jsxRuntimeExports.jsx(e.Form.Item,{style:{marginBottom:8},children:e.jsxRuntimeExports.jsx(e.Button,{type:"primary",htmlType:"submit",loading:i,children:"查询"})})]})})}function Yt({open:n,loading:s,playbooks:i,activePlaybookId:o,onClose:h,onPlaybookClick:j,onPlaybookDelete:l}){return e.jsxRuntimeExports.jsx(Je.Drawer,{title:"工具箱",placement:"right",size:"min(440px, 100vw)",open:n,loading:s,onClose:h,getContainer:!1,rootClassName:"wandox-toolbox-drawer",styles:{body:{padding:0,overflow:"hidden"}},children:e.jsxRuntimeExports.jsx(Kt,{playbooks:i,onPlaybookClick:j,onPlaybookDelete:l,activePlaybookId:o})})}const Jt="https://ai.maiduox.com/#/aitools/operation/product";function Xt(n){const{title:s,widgets:i,ssoDomain:o,ssoToken:h,ssoCompany:j,onExecuteComplete:l,activeAgent:u,agents:v,childAgents:w,externalRobotName:g,externalShowPanel:p,agentSwitcher:R}=n;n.onWidgetsUpdate,n.count,e.useLanguage();const[E,B]=e.reactExports.useState(!1),[z,f]=e.reactExports.useState(!1),[r,c]=e.reactExports.useState(null),[N,b]=e.reactExports.useState(null),[M,S]=e.reactExports.useState("results"),[Q,$]=e.reactExports.useState(!1),[D,C]=e.reactExports.useState([]),[I,U]=e.reactExports.useState(null),[F,Re]=e.reactExports.useState({}),[te,se]=e.reactExports.useState([]),[Ee,H]=e.reactExports.useState(!1),[Z,ue]=e.reactExports.useState(null),[X,ae]=e.reactExports.useState(void 0),[W,le]=e.reactExports.useState(!1),[ce,we]=e.reactExports.useState(!1),G=e.reactExports.useMemo(()=>(w||[]).map(t=>t.name),[w]),xe=e.reactExports.useMemo(()=>!u||u==="default"?null:(v==null?void 0:v.find(x=>x.agent_id===u||x.agent_code===u))||null,[u,v]),ne=e.reactExports.useMemo(()=>e.getAgentPackageBenefit(xe),[xe]);e.reactExports.useEffect(()=>{b(null)},[u]),e.reactExports.useEffect(()=>{ke(),w&&w.length>0&&_()},[w]),e.reactExports.useEffect(()=>{if(p&&(B(!0),g)){const t=G.find(x=>x===g);t?b(t):G.length>0}},[p,g,G]);const ke=async()=>{try{const t=await e.GET_Api_V1_Notification_Webhooks({});t!=null&&t.data&&se(t.data.map(x=>({webhook_id:x.webhook_id,name:x.name,platform:x.platform})))}catch{}},_=async()=>{try{const t={};await Promise.all(w.map(async x=>{var L;try{const k=await e.GET_Api_V1_Notification_Agents_Webhook_ByAgentId(x.agent_id,{});(L=k==null?void 0:k.data)!=null&&L.webhook_id&&(t[x.agent_id]=k.data.webhook_id)}catch{}})),Re(t)}catch{}},O=e.reactExports.useMemo(()=>N?i.filter(t=>{var k;const x=(k=t.title)==null?void 0:k.match(/^(.+?)\s*巡检结果$/);return(x?x[1]:t.agent_name)===N}):i,[i,N]),pe=e.reactExports.useMemo(()=>{if(!N)return"";const t=(w||[]).find(x=>x.name===N);return(t==null?void 0:t.agent_id)||""},[N,w]),Ne=o==="maiduo"&&N==="差评监控",Te=t=>{const x=N===t?null:t;b(x),x&&B(!0)},me=t=>{ue(t),ae(F[t.agent_id]),H(!0)},ee=e.reactExports.useCallback(async t=>{if(t){$(!0);try{const x=await e.GET_Api_V1_Agents_ActionExecutes({agent_id:t,limit:50});if(x!=null&&x.data&&Array.isArray(x.data)){const L=x.data.map((k,fe)=>({id:k.id||k.execute_id||`record_${fe}`,action_name:k.action_name||k.display_name||"未知动作",action_id:k.action_id||"",status:k.status||"pending",created_at:k.created_at||"",completed_at:k.completed_at,action_params:k.action_params,output_type:k.output_type,output_data:k.output_data,outputs:k.outputs,error:k.error})).sort((k,fe)=>new Date(fe.created_at).getTime()-new Date(k.created_at).getTime());C(L)}else C([])}catch{C([])}finally{$(!1)}}},[]),ie=t=>{if(!t)return"";try{const x=new Date(t),L=x.toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}),k=x.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"});return`${L} ${k}`}catch{return t}},V=t=>({pending:"等待中",running:"执行中",success:"成功",failed:"失败"})[t]||t,K=t=>({pending:"wandox-exec-status--pending",running:"wandox-exec-status--running",success:"wandox-exec-status--success",failed:"wandox-exec-status--failed"})[t]||"";e.reactExports.useEffect(()=>{M==="history"&&pe&&ee(pe)},[M,pe,ee]);const P=async()=>{if(!Z||!X){e.staticMethods.warning("请选择 Webhook");return}try{le(!0),await e.POST_Api_V1_Notification_Agents_Webhook({},{agent_id:Z.agent_id,webhook_id:X}),e.staticMethods.success("绑定成功"),H(!1),_()}catch(t){e.staticMethods.error((t==null?void 0:t.message)||"绑定失败")}finally{le(!1)}},Se=async()=>{if(Z)try{le(!0),await e.DELETE_Api_V1_Notification_Agents_Webhook_Delete_ByAgentId(Z.agent_id,{}),e.staticMethods.success("解绑成功"),H(!1),ae(void 0),_()}catch(t){e.staticMethods.error((t==null?void 0:t.message)||"解绑失败")}finally{le(!1)}},Ce=t=>{c(t),f(!0)},Ie=()=>{f(!1),c(null)},Pe=t=>{if(!t)return"";try{const x=new Date(t),L=x.toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}),k=x.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"});return`${L}
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-Cpei3C6T.cjs"),q=require("./WorkbenchRuntime-CVhbTmsn.cjs"),Je=require("./index-B5J1m72V.cjs");var At={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M952 474H829.8C812.5 327.6 696.4 211.5 550 194.2V72c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v122.2C327.6 211.5 211.5 327.6 194.2 474H72c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h122.2C211.5 696.4 327.6 812.5 474 829.8V952c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V829.8C696.4 812.5 812.5 696.4 829.8 550H952c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zM512 756c-134.8 0-244-109.2-244-244s109.2-244 244-244 244 109.2 244 244-109.2 244-244 244z"}},{tag:"path",attrs:{d:"M512 392c-32.1 0-62.1 12.4-84.8 35.2-22.7 22.7-35.2 52.7-35.2 84.8s12.5 62.1 35.2 84.8C449.9 619.4 480 632 512 632s62.1-12.5 84.8-35.2C619.4 574.1 632 544 632 512s-12.5-62.1-35.2-84.8A118.57 118.57 0 00512 392z"}}]},name:"aim",theme:"outlined"};function Fe(){return Fe=Object.assign?Object.assign.bind():function(n){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},Fe.apply(this,arguments)}const Mt=(n,s)=>e.reactExports.createElement(e.Icon,Fe({},n,{ref:s,icon:At})),$t=e.reactExports.forwardRef(Mt);var Tt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888.3 693.2c-42.5-24.6-94.3-18-129.2 12.8l-53-30.7V523.6c0-15.7-8.4-30.3-22-38.1l-136-78.3v-67.1c44.2-15 76-56.8 76-106.1 0-61.9-50.1-112-112-112s-112 50.1-112 112c0 49.3 31.8 91.1 76 106.1v67.1l-136 78.3c-13.6 7.8-22 22.4-22 38.1v151.6l-53 30.7c-34.9-30.8-86.8-37.4-129.2-12.8-53.5 31-71.7 99.4-41 152.9 30.8 53.5 98.9 71.9 152.2 41 42.5-24.6 62.7-73 53.6-118.8l48.7-28.3 140.6 81c6.8 3.9 14.4 5.9 22 5.9s15.2-2 22-5.9L674.5 740l48.7 28.3c-9.1 45.7 11.2 94.2 53.6 118.8 53.3 30.9 121.5 12.6 152.2-41 30.8-53.6 12.6-122-40.7-152.9zm-673 138.4a47.6 47.6 0 01-65.2-17.6c-13.2-22.9-5.4-52.3 17.5-65.5a47.6 47.6 0 0165.2 17.6c13.2 22.9 5.4 52.3-17.5 65.5zM522 463.8zM464 234a48.01 48.01 0 0196 0 48.01 48.01 0 01-96 0zm170 446.2l-122 70.3-122-70.3V539.8l122-70.3 122 70.3v140.4zm239.9 133.9c-13.2 22.9-42.4 30.8-65.2 17.6-22.8-13.2-30.7-42.6-17.5-65.5s42.4-30.8 65.2-17.6c22.9 13.2 30.7 42.5 17.5 65.5z"}}]},name:"deployment-unit",theme:"outlined"};function Ge(){return Ge=Object.assign?Object.assign.bind():function(n){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},Ge.apply(this,arguments)}const Lt=(n,s)=>e.reactExports.createElement(e.Icon,Ge({},n,{ref:s,icon:Tt})),Bt=e.reactExports.forwardRef(Lt);var Dt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M904 160H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0 624H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0-312H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8z"}}]},name:"menu",theme:"outlined"};function Ke(){return Ke=Object.assign?Object.assign.bind():function(n){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},Ke.apply(this,arguments)}const Ot=(n,s)=>e.reactExports.createElement(e.Icon,Ke({},n,{ref:s,icon:Dt})),ot=e.reactExports.forwardRef(Ot);var zt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M705.6 124.9a8 8 0 00-11.6 7.2v64.2c0 5.5 2.9 10.6 7.5 13.6a352.2 352.2 0 0162.2 49.8c32.7 32.8 58.4 70.9 76.3 113.3a355 355 0 0127.9 138.7c0 48.1-9.4 94.8-27.9 138.7a355.92 355.92 0 01-76.3 113.3 353.06 353.06 0 01-113.2 76.4c-43.8 18.6-90.5 28-138.5 28s-94.7-9.4-138.5-28a353.06 353.06 0 01-113.2-76.4A355.92 355.92 0 01184 650.4a355 355 0 01-27.9-138.7c0-48.1 9.4-94.8 27.9-138.7 17.9-42.4 43.6-80.5 76.3-113.3 19-19 39.8-35.6 62.2-49.8 4.7-2.9 7.5-8.1 7.5-13.6V132c0-6-6.3-9.8-11.6-7.2C178.5 195.2 82 339.3 80 506.3 77.2 745.1 272.5 943.5 511.2 944c239 .5 432.8-193.3 432.8-432.4 0-169.2-97-315.7-238.4-386.7zM480 560h64c4.4 0 8-3.6 8-8V88c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8z"}}]},name:"poweroff",theme:"outlined"};function Ze(){return Ze=Object.assign?Object.assign.bind():function(n){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},Ze.apply(this,arguments)}const Wt=(n,s)=>e.reactExports.createElement(e.Icon,Ze({},n,{ref:s,icon:zt})),Vt=e.reactExports.forwardRef(Wt);var qt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M876.6 239.5c-.5-.9-1.2-1.8-2-2.5-5-5-13.1-5-18.1 0L684.2 409.3l-67.9-67.9L788.7 169c.8-.8 1.4-1.6 2-2.5 3.6-6.1 1.6-13.9-4.5-17.5-98.2-58-226.8-44.7-311.3 39.7-67 67-89.2 162-66.5 247.4l-293 293c-3 3-2.8 7.9.3 11l169.7 169.7c3.1 3.1 8.1 3.3 11 .3l292.9-292.9c85.5 22.8 180.5.7 247.6-66.4 84.4-84.5 97.7-213.1 39.7-311.3zM786 499.8c-58.1 58.1-145.3 69.3-214.6 33.6l-8.8 8.8-.1-.1-274 274.1-79.2-79.2 230.1-230.1s0 .1.1.1l52.8-52.8c-35.7-69.3-24.5-156.5 33.6-214.6a184.2 184.2 0 01144-53.5L537 318.9a32.05 32.05 0 000 45.3l124.5 124.5a32.05 32.05 0 0045.3 0l132.8-132.8c3.7 51.8-14.4 104.8-53.6 143.9z"}}]},name:"tool",theme:"outlined"};function Ye(){return Ye=Object.assign?Object.assign.bind():function(n){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},Ye.apply(this,arguments)}const Qt=(n,s)=>e.reactExports.createElement(e.Icon,Ye({},n,{ref:s,icon:qt})),Ut=e.reactExports.forwardRef(Qt);function Ft(n){return n instanceof Error?n.message:"上传失败"}function Gt({open:n,playbook:s,onClose:i,onSubmit:o}){const h=e.reactExports.useMemo(()=>e.normalizeAgentInputFields(s==null?void 0:s.input_fields),[s]),[j,l]=e.reactExports.useState({}),[u,v]=e.reactExports.useState({}),[w,g]=e.reactExports.useState({}),p=e.useDynamicFieldOptions(h,j,l),R=e.reactExports.useMemo(()=>q.getVisibleInputFields(h,j),[h,j]);e.reactExports.useEffect(()=>{n&&(l(q.buildDefaultInputValues(h,(s==null?void 0:s.initial_params)??{})),v({}),g({}))},[h,n,s==null?void 0:s.initial_params]);const E=e.reactExports.useCallback((f,r)=>{l(c=>({...c,[f]:r}))},[]),B=e.reactExports.useCallback((f,r)=>async({file:c,onSuccess:N,onError:b})=>{var M,S;v(Q=>({...Q,[f]:!0}));try{const Q=c,$=await e.POST_Api_V1_Oss_Upload2(Q),D=(M=$==null?void 0:$.data)==null?void 0:M.url,C=((S=$==null?void 0:$.data)==null?void 0:S.name)||Q.name;if(!D)throw new Error("上传结果缺少文件地址");g(I=>({...I,[D]:C})),l(I=>{if(r<=1)return{...I,[f]:D};const U=Array.isArray(I[f])?I[f]:I[f]?[I[f]]:[];return{...I,[f]:[...U,D]}}),N==null||N($),e.staticMethods.success("上传成功")}catch(Q){const $=Q instanceof Error?Q:new Error(Ft(Q));b==null||b($),e.staticMethods.error($.message)}finally{v(Q=>({...Q,[f]:!1}))}},[]),z=()=>{if(!s)return;const f=R.filter(r=>r.required&&q.isMissingFieldValue(j[r.name]));if(f.length>0){e.staticMethods.warning(`请填写必填参数:${f.map(r=>r.label).join("、")}`);return}o(s,j)};return e.jsxRuntimeExports.jsxs(Je.Drawer,{className:"wandox-playbook-params-drawer",title:e.jsxRuntimeExports.jsxs("div",{className:"wandox-playbook-params-drawer__title",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-playbook-params-drawer__title-main",children:"填写执行参数"}),e.jsxRuntimeExports.jsx("span",{className:"wandox-playbook-params-drawer__title-sub",children:s==null?void 0:s.name})]}),open:n,size:640,destroyOnHidden:!0,maskClosable:!1,onClose:i,footer:e.jsxRuntimeExports.jsx("div",{className:"wandox-playbook-params-drawer__footer",children:e.jsxRuntimeExports.jsxs(e.Space,{children:[e.jsxRuntimeExports.jsx(e.Button,{onClick:i,children:"取消"}),e.jsxRuntimeExports.jsx(e.Button,{type:"primary",onClick:z,children:"开始执行"})]})}),children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-playbook-params-drawer__intro",children:[e.jsxRuntimeExports.jsx("span",{children:"填写本次运行需要的参数"}),e.jsxRuntimeExports.jsxs("span",{children:[R.length," 项"]})]}),e.jsxRuntimeExports.jsxs(e.Form,{layout:"vertical",className:"wandox-playbook-params-drawer__form",children:[R.map(f=>e.jsxRuntimeExports.jsx(e.Form.Item,{required:f.required,label:e.jsxRuntimeExports.jsxs("span",{className:"wandox-playbook-params-drawer__label",children:[f.label,f.description||f.hint?e.jsxRuntimeExports.jsx(e.Tooltip,{title:f.description||f.hint,children:e.jsxRuntimeExports.jsx(e.RefIcon$2,{"aria-label":`${f.label}说明`})}):null]}),children:e.jsxRuntimeExports.jsx(q.AgentInputFieldControl,{field:f,value:j[f.name],uploading:!!u[f.name],fileNameMap:w,getOptionState:p.getFieldState,onChange:E,onUpload:B,onDownloadTemplate:r=>window.open(r.path,"_blank","noopener,noreferrer")})},f.name)),R.length===0?e.jsxRuntimeExports.jsxs("div",{className:"wandox-playbook-params-drawer__empty",children:[e.jsxRuntimeExports.jsx(e.Spin,{size:"small"})," 正在读取参数配置"]}):null]})]})}function Kt({playbooks:n,onPlaybookClick:s,onPlaybookDelete:i,activePlaybookId:o}){const{t:h}=e.useLanguage(),[j,l]=e.reactExports.useState(""),[u,v]=e.reactExports.useState(!1),[w,g]=e.reactExports.useState(null),[p,R]=e.reactExports.useState(!1),E=n.filter(r=>{var c;return r.name.toLowerCase().includes(j.toLowerCase())||((c=r.description)==null?void 0:c.toLowerCase().includes(j.toLowerCase()))}),B=(r,c)=>{c.stopPropagation(),g(r),v(!0)},z=async()=>{if(w){R(!0);try{await e.DELETE_Api_V1_Playbooks_SolidifyView_ByPlaybookId(w.playbook_id),i==null||i(w.playbook_id),v(!1),g(null)}catch{}finally{R(!1)}}},f=()=>{v(!1),g(null)};return e.jsxRuntimeExports.jsxs("div",{className:"wandox-solidified-list",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-solidified-list-search",children:e.jsxRuntimeExports.jsx(e.Input.Search,{placeholder:"搜索",value:j,onChange:r=>l(r.target.value),allowClear:!0,enterButton:!1})}),e.jsxRuntimeExports.jsx("div",{className:"wandox-solidified-list-content",children:E.length===0?e.jsxRuntimeExports.jsx(e.Empty,{description:h(j?"noData":"solidified.empty"),image:e.Empty.PRESENTED_IMAGE_SIMPLE}):e.jsxRuntimeExports.jsx("div",{className:"wandox-solidified-list-grid",children:E.map(r=>e.jsxRuntimeExports.jsxs("div",{className:`wandox-solidified-card ${o===r.playbook_id?"active":""}`,onClick:()=>s==null?void 0:s(r.playbook_id),onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(s==null||s(r.playbook_id))},role:"button",tabIndex:0,children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-solidified-card-icon",children:e.jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsxRuntimeExports.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",stroke:"currentColor",strokeWidth:"2",fill:"none"}),e.jsxRuntimeExports.jsx("path",{d:"M9 3v18M15 3v18M3 9h18M3 15h18",stroke:"currentColor",strokeWidth:"1.5"}),e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor"})]})}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-solidified-card-content",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-solidified-card-name",children:r.name}),r.description&&e.jsxRuntimeExports.jsx("div",{className:"wandox-solidified-card-desc",children:r.description})]}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-solidified-card-delete",onClick:c=>B(r,c),title:h("solidified.delete"),children:e.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsxRuntimeExports.jsx("path",{d:"M6 7v12a2 2 0 002 2h8a2 2 0 002-2V7M4 7h16M10 11v6M14 11v6M9 7V4a1 1 0 011-1h4a1 1 0 011 1v3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},r.playbook_id))})}),e.jsxRuntimeExports.jsx(e.Modal,{title:h("solidified.deleteConfirm"),open:u,onOk:z,onCancel:f,okText:h("confirm"),cancelText:h("cancel"),okButtonProps:{danger:!0,loading:p},children:e.jsxRuntimeExports.jsxs("p",{children:[h("solidified.deleteConfirm")," 「",w==null?void 0:w.name,"」?"]})})]})}function Zt({inputParams:n,onSearch:s,loading:i=!1}){const[o]=e.Form.useForm();e.reactExports.useEffect(()=>{const l={};for(const u of n)u.default!==void 0&&u.default!==null&&u.default!==""&&(l[u.name]=u.default);o.setFieldsValue(l)},[n,o]);const h=()=>{o.validateFields().then(l=>{const u={};for(const v of Object.keys(l)){const w=l[v];w!=null&&w!==""&&(u[v]=w)}s(u)})},j=l=>{const{name:u,type:v,description:w}=l,g={placeholder:w||`请输入${u}`};switch(v){case"integer":return e.jsxRuntimeExports.jsx(e.TypedInputNumber,{...g,style:{width:"100%"}});case"array":return e.jsxRuntimeExports.jsx(e.Input,{...g});case"boolean":return e.jsxRuntimeExports.jsx(e.Input,{...g});case"string":default:return e.jsxRuntimeExports.jsx(e.Input,{...g})}};return e.jsxRuntimeExports.jsx("div",{className:"wandox-solidify-params-form",children:e.jsxRuntimeExports.jsxs(e.Form,{form:o,layout:"inline",onFinish:h,style:{marginBottom:16},children:[n.map(l=>e.jsxRuntimeExports.jsx(e.Form.Item,{name:l.name,label:l.description||l.name,rules:[{required:l.required,message:`请输入${l.description||l.name}`}],style:{marginBottom:8},children:j(l)},l.name)),e.jsxRuntimeExports.jsx(e.Form.Item,{style:{marginBottom:8},children:e.jsxRuntimeExports.jsx(e.Button,{type:"primary",htmlType:"submit",loading:i,children:"查询"})})]})})}function Yt({open:n,loading:s,playbooks:i,activePlaybookId:o,onClose:h,onPlaybookClick:j,onPlaybookDelete:l}){return e.jsxRuntimeExports.jsx(Je.Drawer,{title:"工具箱",placement:"right",size:"min(440px, 100vw)",open:n,loading:s,onClose:h,getContainer:!1,rootClassName:"wandox-toolbox-drawer",styles:{body:{padding:0,overflow:"hidden"}},children:e.jsxRuntimeExports.jsx(Kt,{playbooks:i,onPlaybookClick:j,onPlaybookDelete:l,activePlaybookId:o})})}const Jt="https://ai.maiduox.com/#/aitools/operation/product";function Xt(n){const{title:s,widgets:i,ssoDomain:o,ssoToken:h,ssoCompany:j,onExecuteComplete:l,activeAgent:u,agents:v,childAgents:w,externalRobotName:g,externalShowPanel:p,agentSwitcher:R}=n;n.onWidgetsUpdate,n.count,e.useLanguage();const[E,B]=e.reactExports.useState(!1),[z,f]=e.reactExports.useState(!1),[r,c]=e.reactExports.useState(null),[N,b]=e.reactExports.useState(null),[M,S]=e.reactExports.useState("results"),[Q,$]=e.reactExports.useState(!1),[D,C]=e.reactExports.useState([]),[I,U]=e.reactExports.useState(null),[F,Re]=e.reactExports.useState({}),[te,se]=e.reactExports.useState([]),[Ee,H]=e.reactExports.useState(!1),[Z,ue]=e.reactExports.useState(null),[X,ae]=e.reactExports.useState(void 0),[W,le]=e.reactExports.useState(!1),[ce,we]=e.reactExports.useState(!1),G=e.reactExports.useMemo(()=>(w||[]).map(t=>t.name),[w]),xe=e.reactExports.useMemo(()=>!u||u==="default"?null:(v==null?void 0:v.find(x=>x.agent_id===u||x.agent_code===u))||null,[u,v]),ne=e.reactExports.useMemo(()=>e.getAgentPackageBenefit(xe),[xe]);e.reactExports.useEffect(()=>{b(null)},[u]),e.reactExports.useEffect(()=>{ke(),w&&w.length>0&&_()},[w]),e.reactExports.useEffect(()=>{if(p&&(B(!0),g)){const t=G.find(x=>x===g);t?b(t):G.length>0}},[p,g,G]);const ke=async()=>{try{const t=await e.GET_Api_V1_Notification_Webhooks({});t!=null&&t.data&&se(t.data.map(x=>({webhook_id:x.webhook_id,name:x.name,platform:x.platform})))}catch{}},_=async()=>{try{const t={};await Promise.all(w.map(async x=>{var L;try{const k=await e.GET_Api_V1_Notification_Agents_Webhook_ByAgentId(x.agent_id,{});(L=k==null?void 0:k.data)!=null&&L.webhook_id&&(t[x.agent_id]=k.data.webhook_id)}catch{}})),Re(t)}catch{}},O=e.reactExports.useMemo(()=>N?i.filter(t=>{var k;const x=(k=t.title)==null?void 0:k.match(/^(.+?)\s*巡检结果$/);return(x?x[1]:t.agent_name)===N}):i,[i,N]),pe=e.reactExports.useMemo(()=>{if(!N)return"";const t=(w||[]).find(x=>x.name===N);return(t==null?void 0:t.agent_id)||""},[N,w]),Ne=o==="maiduo"&&N==="差评监控",Te=t=>{const x=N===t?null:t;b(x),x&&B(!0)},me=t=>{ue(t),ae(F[t.agent_id]),H(!0)},ee=e.reactExports.useCallback(async t=>{if(t){$(!0);try{const x=await e.GET_Api_V1_Agents_ActionExecutes({agent_id:t,limit:50});if(x!=null&&x.data&&Array.isArray(x.data)){const L=x.data.map((k,fe)=>({id:k.id||k.execute_id||`record_${fe}`,action_name:k.action_name||k.display_name||"未知动作",action_id:k.action_id||"",status:k.status||"pending",created_at:k.created_at||"",completed_at:k.completed_at,action_params:k.action_params,output_type:k.output_type,output_data:k.output_data,outputs:k.outputs,error:k.error})).sort((k,fe)=>new Date(fe.created_at).getTime()-new Date(k.created_at).getTime());C(L)}else C([])}catch{C([])}finally{$(!1)}}},[]),ie=t=>{if(!t)return"";try{const x=new Date(t),L=x.toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}),k=x.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"});return`${L} ${k}`}catch{return t}},V=t=>({pending:"等待中",running:"执行中",success:"成功",failed:"失败"})[t]||t,K=t=>({pending:"wandox-exec-status--pending",running:"wandox-exec-status--running",success:"wandox-exec-status--success",failed:"wandox-exec-status--failed"})[t]||"";e.reactExports.useEffect(()=>{M==="history"&&pe&&ee(pe)},[M,pe,ee]);const P=async()=>{if(!Z||!X){e.staticMethods.warning("请选择 Webhook");return}try{le(!0),await e.POST_Api_V1_Notification_Agents_Webhook({},{agent_id:Z.agent_id,webhook_id:X}),e.staticMethods.success("绑定成功"),H(!1),_()}catch(t){e.staticMethods.error((t==null?void 0:t.message)||"绑定失败")}finally{le(!1)}},Se=async()=>{if(Z)try{le(!0),await e.DELETE_Api_V1_Notification_Agents_Webhook_Delete_ByAgentId(Z.agent_id,{}),e.staticMethods.success("解绑成功"),H(!1),ae(void 0),_()}catch(t){e.staticMethods.error((t==null?void 0:t.message)||"解绑失败")}finally{le(!1)}},Ce=t=>{c(t),f(!0)},Ie=()=>{f(!1),c(null)},Pe=t=>{if(!t)return"";try{const x=new Date(t),L=x.toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}),k=x.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"});return`${L}
|
|
2
2
|
${k}`}catch{return t}},he=(t,x)=>{const L={high:"#ff4d4f",medium:"#faad14",low:"#52c41a"};return e.jsxRuntimeExports.jsxs("div",{className:"wandox-timeline-item",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-timeline-dot-wrapper",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-timeline-time",style:{whiteSpace:"pre-line"},children:Pe(t.timestamp||"")}),e.jsxRuntimeExports.jsx("div",{className:"wandox-timeline-dot",style:{background:L[t.priority]}}),!x&&e.jsxRuntimeExports.jsx("div",{className:"wandox-timeline-line"})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-widget-card",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-widget-title",children:t.title}),t.ui_payload&&e.jsxRuntimeExports.jsx("div",{className:"wandox-widget-content wandox-markdown-content",children:e.jsxRuntimeExports.jsx(e.PayloadRenderer,{payload:t.ui_payload})}),t.actions&&t.actions.length>0&&e.jsxRuntimeExports.jsx("div",{className:"wandox-widget-actions",children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-widget-view-detail-btn",onClick:()=>Ce(t),children:[e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img",children:[e.jsxRuntimeExports.jsx("title",{children:"快速执行"}),e.jsxRuntimeExports.jsx("path",{d:"M13 2L3 14H12L11 22L21 10H12L13 2Z",fill:"currentColor"})]}),"快速执行 (",t.actions.length,")"]})})]})]},t.id||`${t.type}_${t.title}_${t.timestamp}`)};return e.jsxRuntimeExports.jsxs("div",{className:"wandox-widget-section",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-section-header",children:[e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[R??e.jsxRuntimeExports.jsx("span",{className:"wandox-widget-section-title",children:s}),e.jsxRuntimeExports.jsx(q.AgentPackageTag,{benefit:ne})]}),e.jsxRuntimeExports.jsx("div",{className:"wandox-inspection-controls",children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:`wandox-inspection-agent-btn ${E?"wandox-inspection-agent-btn--expanded":""}`,onClick:()=>{E?(B(!1),b(null)):B(!0)},children:[e.jsxRuntimeExports.jsxs("span",{className:"wandox-inspection-agent-icon",children:[e.jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"4",stroke:"currentColor",strokeWidth:"1.5"}),e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor"})]}),e.jsxRuntimeExports.jsx("span",{className:"wandox-orbit-dot wandox-orbit-dot-1"}),e.jsxRuntimeExports.jsx("span",{className:"wandox-orbit-dot wandox-orbit-dot-2"}),e.jsxRuntimeExports.jsx("span",{className:"wandox-orbit-dot wandox-orbit-dot-3"})]}),e.jsxRuntimeExports.jsxs("span",{className:"wandox-inspection-agent-text",children:["巡检机器人(",G.length,")"]})]})})]}),E&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-timeline-list",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-agent-filter-row wandox-agent-filter-row--with-close",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-agent-filter-chips",children:[w.length>0&&e.jsxRuntimeExports.jsx("button",{type:"button",className:`wandox-agent-filter-chip ${N===null?"active":""}`,onClick:()=>b(null),children:"全部"}),w.map(t=>{const x=!!F[t.agent_id];return e.jsxRuntimeExports.jsxs("div",{className:`wandox-agent-filter-chip-compound ${N===t.name?"active":""}`,children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-agent-filter-chip-name",onClick:()=>Te(t.name),children:t.name}),e.jsxRuntimeExports.jsx("button",{type:"button",className:`wandox-agent-filter-chip-webhook ${x?"bound":""}`,onClick:()=>me(t),title:x?"已绑定 Webhook,点击修改":"绑定 Webhook 通知",children:x?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-webhook-dot","aria-hidden":"true"}),e.jsxRuntimeExports.jsx("span",{className:"wandox-webhook-label",children:"已通知"})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-webhook-plus","aria-hidden":"true",children:"+"}),e.jsxRuntimeExports.jsx("span",{className:"wandox-webhook-label",children:"通知"})]})})]},t.agent_id)})]}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-timeline-list-close",onClick:()=>{B(!1),b(null),S("results")},title:"关闭",children:"✕"})]}),Ne&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-negative-review-notice",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-negative-review-notice-icon","aria-hidden":"true",children:"ℹ️"}),e.jsxRuntimeExports.jsxs("span",{children:["差评监控需要先设置需要监控的ASIN,请前往AI工具》",e.jsxRuntimeExports.jsx("a",{href:Jt,target:"_blank",rel:"noreferrer",className:"wandox-negative-review-notice-link",children:"新老诊断"}),"进行设置。每个asin每一次都需要0.01算力。"]})]}),e.jsxRuntimeExports.jsx("div",{className:"wandox-timeline-tabs-header",children:e.jsxRuntimeExports.jsxs("div",{className:"wandox-timeline-tabs-nav",children:[e.jsxRuntimeExports.jsxs("button",{type:"button",className:`wandox-timeline-tab-btn ${M==="results"?"active":""}`,onClick:()=>S("results"),children:["巡检结果",O.length>0&&e.jsxRuntimeExports.jsx("span",{className:"wandox-timeline-tab-badge",children:O.length})]}),e.jsxRuntimeExports.jsx("button",{type:"button",className:`wandox-timeline-tab-btn ${M==="history"?"active":""}`,onClick:()=>S("history"),children:"执行记录"})]})}),M==="results"?e.jsxRuntimeExports.jsx("div",{className:"wandox-timeline-list-content",children:O.length>0?O.sort((t,x)=>{const L=t.timestamp?new Date(t.timestamp).getTime():0;return(x.timestamp?new Date(x.timestamp).getTime():0)-L}).map((t,x,L)=>he(t,x===L.length-1)):e.jsxRuntimeExports.jsxs("div",{className:"wandox-empty-state",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-icon",children:"�"}),e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-text",children:N?"没有符合筛选条件的数据":"暂无工作区数据"}),e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-desc",children:N?"请调整筛选条件":"工作区数据将在这里显示"})]})}):e.jsxRuntimeExports.jsx("div",{className:"wandox-timeline-list-content wandox-history-panel",children:N?Q?e.jsxRuntimeExports.jsxs("div",{className:"wandox-loading-state",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-spinner wandox-spinner--small"}),e.jsxRuntimeExports.jsx("span",{children:"加载中..."})]}):D.length===0?e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-state",children:e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-text",children:"暂无执行记录"})}):e.jsxRuntimeExports.jsx("div",{className:"wandox-exec-history-list",children:D.map(t=>e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-history-item",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-history-header",onClick:()=>U(I===t.id?null:t.id),onKeyDown:x=>x.key==="Enter"&&U(I===t.id?null:t.id),role:"button",tabIndex:0,children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-history-info",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-exec-history-name",children:t.action_name}),e.jsxRuntimeExports.jsx("span",{className:"wandox-exec-history-time",children:ie(t.created_at)})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-history-status-wrapper",children:[e.jsxRuntimeExports.jsx("span",{className:`wandox-exec-status ${K(t.status)}`,children:V(t.status)}),e.jsxRuntimeExports.jsx("span",{className:"wandox-exec-history-arrow","aria-hidden":"true",children:I===t.id?"▼":"▶"})]})]}),I===t.id&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-history-detail",children:[t.action_params&&Object.keys(t.action_params).length>0&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-params",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-exec-section-label",children:"执行参数"}),e.jsxRuntimeExports.jsx("div",{className:"wandox-exec-params-list",children:Object.entries(t.action_params).map(([x,L])=>e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-param-item",children:[e.jsxRuntimeExports.jsxs("span",{className:"wandox-exec-param-key",children:[x,":"]}),e.jsxRuntimeExports.jsx("span",{className:"wandox-exec-param-value",children:typeof L=="object"?JSON.stringify(L):String(L)})]},x))})]}),t.error?e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-error",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-exec-error-label",children:"错误信息:"}),e.jsxRuntimeExports.jsx("span",{className:"wandox-exec-error-msg",children:t.error})]}):t.output_type&&t.output_data?e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-outputs",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-exec-section-label",children:"执行结果"}),e.jsxRuntimeExports.jsx(e.PayloadRenderer,{payload:{type:t.output_type,...t.output_data}})]}):t.outputs?e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-outputs",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-exec-section-label",children:"执行结果"}),e.jsxRuntimeExports.jsx(e.PayloadRenderer,{payload:t.outputs})]}):e.jsxRuntimeExports.jsx("div",{className:"wandox-exec-no-output",children:"暂无输出结果"})]})]},t.id))}):e.jsxRuntimeExports.jsxs("div",{className:"wandox-empty-state",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-icon",children:"🤖"}),e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-text",children:"请先选择机器人"}),e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-desc",children:"在上方选择一个机器人查看执行记录"})]})})]}),e.jsxRuntimeExports.jsx(e.ActionDetailDrawer,{open:z,title:(r==null?void 0:r.title)||"动作详情",actions:(r==null?void 0:r.actions)||[],widgetId:r==null?void 0:r.id,ssoToken:h,ssoDomain:o,ssoCompany:j,onClose:Ie,onExecuteComplete:l}),e.jsxRuntimeExports.jsx(e.Modal,{title:e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[e.jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M12 22C10.8954 22 10 21.1046 10 20V14C10 12.8954 10.8954 12 12 12C13.1046 12 14 12.8954 14 14V20C14 21.1046 13.1046 22 12 22Z"}),e.jsxRuntimeExports.jsx("path",{d:"M18 16C16.8954 16 16 15.1046 16 14V10C16 8.89543 16.8954 8 18 8C19.1046 8 20 8.89543 20 10V14C20 15.1046 19.1046 16 18 16Z"}),e.jsxRuntimeExports.jsx("path",{d:"M6 16C4.89543 16 4 15.1046 4 14V10C4 8.89543 4.89543 8 6 8C7.10457 8 8 8.89543 8 10V14C8 15.1046 7.10457 16 6 16Z"}),e.jsxRuntimeExports.jsx("path",{d:"M10.5 4C10.5 2.61929 11.6193 1.5 13 1.5H13.5C14.8807 1.5 16 2.61929 16 4V6H10.5V4Z"})]}),e.jsxRuntimeExports.jsx("span",{children:"配置 Webhook 通知"})]}),open:Ee,onCancel:()=>{H(!1),ue(null),ae(void 0)},width:520,footer:null,centered:!0,children:e.jsxRuntimeExports.jsxs("div",{style:{padding:"8px 0"},children:[e.jsxRuntimeExports.jsxs("div",{style:{marginBottom:"20px",padding:"12px 16px",background:"#f5f7fa",borderRadius:"8px",border:"1px solid #e8eaed"},children:[e.jsxRuntimeExports.jsx("div",{style:{fontSize:"13px",color:"#666",marginBottom:"4px"},children:"智能体"}),e.jsxRuntimeExports.jsx("div",{style:{fontSize:"15px",color:"#1a1a1a",fontWeight:500},children:Z==null?void 0:Z.name})]}),e.jsxRuntimeExports.jsxs("div",{style:{marginBottom:"20px"},children:[e.jsxRuntimeExports.jsx("div",{style:{marginBottom:"8px",fontSize:"14px",color:"#333",fontWeight:500},children:"选择 通知地址"}),e.jsxRuntimeExports.jsx(e.Select,{style:{width:"100%"},size:"large",placeholder:"请选择 通知地址",value:X,onChange:ae,options:te.map(t=>({label:`${t.name} (${t.platform==="dingtalk"?"钉钉":t.platform==="feishu"?"飞书":"企业微信"})`,value:t.webhook_id})),disabled:W,popupRender:t=>e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[t,e.jsxRuntimeExports.jsx(Je.Divider,{style:{margin:"8px 0"}}),e.jsxRuntimeExports.jsx(e.Space,{style:{padding:"0 8px 4px"},children:e.jsxRuntimeExports.jsx(e.Button,{type:"text",icon:e.jsxRuntimeExports.jsx("span",{children:"+"}),onClick:()=>we(!0),children:"添加新的通知地址"})})]})}),te.length===0&&e.jsxRuntimeExports.jsxs("div",{style:{marginTop:"8px",padding:"8px 12px",background:"#fff7e6",border:"1px solid #ffd591",borderRadius:"4px",fontSize:"13px",color:"#d46b08",display:"flex",alignItems:"center",gap:"6px"},children:[e.jsxRuntimeExports.jsx("span",{children:"⚠️"}),e.jsxRuntimeExports.jsx("span",{children:'暂无可用的 通知地址,请先在"通知配置"中创建'})]})]}),e.jsxRuntimeExports.jsxs("div",{style:{padding:"12px 16px",background:"#f0f9ff",borderRadius:"8px",border:"1px solid #bae7ff",marginBottom:"20px"},children:[e.jsxRuntimeExports.jsx("div",{style:{fontSize:"13px",color:"#0958d9",fontWeight:500,marginBottom:"8px"},children:"💡 功能说明"}),e.jsxRuntimeExports.jsxs("div",{style:{fontSize:"13px",color:"#096dd9",lineHeight:"1.8"},children:[e.jsxRuntimeExports.jsx("div",{children:"• 绑定后,该智能体执行完成时会自动发送通知"}),e.jsxRuntimeExports.jsx("div",{children:"• 通知内容包含执行结果和相关信息"}),e.jsxRuntimeExports.jsx("div",{children:"• 可随时修改或解除绑定"})]})]}),e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end"},children:[F[(Z==null?void 0:Z.agent_id)||""]&&e.jsxRuntimeExports.jsx("button",{type:"button",onClick:Se,disabled:W,style:{marginRight:"auto",padding:"8px 20px",border:"1px solid #ff4d4f",borderRadius:"6px",background:"#fff",color:"#ff4d4f",cursor:W?"not-allowed":"pointer",fontSize:"14px",fontWeight:500,transition:"all 0.2s",opacity:W?.6:1},onMouseEnter:t=>{W||(t.currentTarget.style.background="#fff1f0")},onMouseLeave:t=>{t.currentTarget.style.background="#fff"},children:"解除绑定"}),e.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{H(!1),ue(null),ae(void 0)},disabled:W,style:{padding:"8px 24px",border:"1px solid #d9d9d9",borderRadius:"6px",background:"#fff",color:"#333",cursor:W?"not-allowed":"pointer",fontSize:"14px",fontWeight:500,transition:"all 0.2s",opacity:W?.6:1},onMouseEnter:t=>{W||(t.currentTarget.style.background="#fafafa")},onMouseLeave:t=>{t.currentTarget.style.background="#fff"},children:"取消"}),e.jsxRuntimeExports.jsx("button",{type:"button",onClick:P,disabled:W||!X,style:{padding:"8px 24px",border:"none",borderRadius:"6px",background:W||!X?"#d9d9d9":"#1890ff",color:"#fff",cursor:W||!X?"not-allowed":"pointer",fontSize:"14px",fontWeight:500,transition:"all 0.2s"},onMouseEnter:t=>{!W&&X&&(t.currentTarget.style.background="#40a9ff")},onMouseLeave:t=>{!W&&X&&(t.currentTarget.style.background="#1890ff")},children:W?"保存中...":"保存"})]})]})}),e.jsxRuntimeExports.jsx(q.QuickAddWebhook,{open:ce,onClose:()=>we(!1),onSuccess:t=>{se(x=>[...x,t]),ae(t.webhook_id)}})]})}function Ht({active:n,agents:s,collapsed:i,onToggle:o,className:h,activeView:j="chat",onViewChange:l,onToolboxOpen:u,showLogout:v,onLogout:w,sidebarAgentMode:g=!1,onToggleSidebarMode:p,onAgentSelect:R}){const E=localStorage.getItem("sso_domain")||"",B=[{key:"chat",icon:e.jsxRuntimeExports.jsx(q.RefIcon$4,{}),title:"对话"},...["maiduo","eccang"].includes(E)?[{key:"plan",icon:e.jsxRuntimeExports.jsx(Bt,{}),title:"自动化Beta"}]:[],{key:"professional",icon:e.jsxRuntimeExports.jsx(e.RefIcon$14,{}),title:"专业智能体"}],f=[...E==="yunduo"?[]:[{key:"toolbox",icon:e.jsxRuntimeExports.jsx(Ut,{}),label:"工具箱"},{key:"goals",icon:e.jsxRuntimeExports.jsx($t,{}),label:"目标追踪"}],{key:"settings",icon:e.jsxRuntimeExports.jsx(q.RefIcon$2,{}),label:"通知配置"}];return e.jsxRuntimeExports.jsx("div",{className:"wandox-aside-wrap",children:e.jsxRuntimeExports.jsxs("div",{className:`wandox-aside ${i?"wandox-aside--collapsed":""} ${h||""}`,"aria-hidden":i,children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-aside-header",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-header__title",children:"AI 智能体"}),o&&e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-aside-header-toggle",onClick:o,"aria-label":i?"展开侧边栏":"收起侧边栏",title:i?"展开侧边栏":"收起侧边栏",children:e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 24 24",children:[e.jsxRuntimeExports.jsx("title",{children:i?"展开侧边栏":"收起侧边栏"}),e.jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M21 5H11v14h10zM3 5h6v14H3zm0-2a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zm2 4.25a.75.75 0 0 0 0 1.5h2a.75.75 0 0 0 0-1.5zm-.75 3.5A.75.75 0 0 1 5 10h2a.75.75 0 0 1 0 1.5H5a.75.75 0 0 1-.75-.75m.75 2a.75.75 0 0 0 0 1.5h2a.75.75 0 0 0 0-1.5z"})]})})]}),e.jsxRuntimeExports.jsx("div",{className:"wandox-aside-main-nav",children:e.jsxRuntimeExports.jsx("div",{className:"wandox-aside-nav-list",children:B.map(r=>{const c=j===r.key,N=r.key==="professional";return e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsxs("div",{className:`wandox-aside-nav-item-wrap${c?" wandox-aside-nav-item-wrap--active":""}`,children:[e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>l==null?void 0:l(r.key),className:`wandox-aside-nav-item${c?" wandox-aside-nav-item--active":""}`,children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-nav-icon",children:r.icon}),e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-nav-title",children:r.title})]}),N&&!i&&p&&e.jsxRuntimeExports.jsx(e.Tooltip,{title:g?"收起列表":"展开列表",placement:"right",children:e.jsxRuntimeExports.jsx("button",{type:"button",className:`wandox-aside-mode-toggle${g?" wandox-aside-mode-toggle--active":""}`,onClick:b=>{b.stopPropagation(),p()},children:g?e.jsxRuntimeExports.jsx(e.RefIcon$12,{style:{fontSize:11}}):e.jsxRuntimeExports.jsx(e.RefIcon$13,{style:{fontSize:11}})})})]}),N&&(g||i)&&e.jsxRuntimeExports.jsx("div",{className:"wandox-aside-agent-list",children:s.map(b=>{const M=b.agent_id;if(!M)return null;const S=n===M&&j==="professional";return e.jsxRuntimeExports.jsx(e.Tooltip,{title:b.name,placement:"right",children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:`wandox-aside-agent-item${S?" wandox-aside-agent-item--active":""}`,onClick:()=>{R==null||R(M),j!=="professional"&&(l==null||l("professional"))},children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-agent-icon",children:q.getAgentIconById(b.icon)}),e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-agent-name",children:b.name})]})},M)})})]},r.key)})})}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-aside-bottom",children:[e.jsxRuntimeExports.jsx("p",{className:"wandox-aside-group-label",children:"系统功能"}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-aside-nav-list wandox-aside-nav-list--bottom",children:[f.map(r=>{const c=r.key!=="toolbox"&&j===r.key;return e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>{if(r.key==="toolbox"){u==null||u();return}l==null||l(r.key)},className:`wandox-aside-nav-item${c?" wandox-aside-nav-item--active":""}`,children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-nav-icon",children:r.icon}),e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-nav-title",children:r.label})]},r.key)}),v&&e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:w,className:"wandox-aside-nav-item wandox-aside-nav-item--logout",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-nav-icon",children:e.jsxRuntimeExports.jsx(Vt,{})}),e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-nav-title",children:"退出登录"})]})]}),e.jsxRuntimeExports.jsx("div",{style:{height:8}})]})]})})}function es(n){const{children:s}=n;return e.jsxRuntimeExports.jsx("div",{className:"wandox-layout wandox-root",children:e.jsxRuntimeExports.jsx("main",{className:"wandox-layout-content",style:{padding:0},children:s})})}function ts({queueStatus:n}){if(!n)return null;const s=n.status==="waiting";return e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-overlay",children:e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-modal",children:s?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-icon wandox-queue-icon--waiting",children:e.jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsxRuntimeExports.jsx("circle",{cx:"32",cy:"32",r:"28",stroke:"#E5E7EB",strokeWidth:"4"}),e.jsxRuntimeExports.jsx("path",{d:"M32 16V32L44 38",stroke:"#8B5CF6",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-title",children:"当前使用人数较多,正在排队中..."}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-queue-stats",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-queue-stat",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-stat-value",children:n.position}),e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-stat-label",children:"前面还有"})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-queue-stat",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-queue-stat-value",children:["~",n.estimated_wait,"s"]}),e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-stat-label",children:"预计等待"})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-queue-tip",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-queue-tip-icon",children:"💡"}),e.jsxRuntimeExports.jsx("span",{children:"小贴士:等待期间可先查看其他功能模块"})]})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-icon wandox-queue-icon--ready",children:e.jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsxRuntimeExports.jsx("rect",{x:"4",y:"4",width:"56",height:"56",rx:"8",fill:"#10B981"}),e.jsxRuntimeExports.jsx("path",{d:"M18 32L28 42L46 22",stroke:"white",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-title wandox-queue-title--ready",children:"轮到您了!"}),e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-subtitle",children:"正在处理您的请求..."})]})})})}function ss({open:n,actionName:s,defaultParams:i={},onCancel:o,onExecute:h}){const[j,l]=e.reactExports.useState({});e.reactExports.useEffect(()=>{if(n){const p={};for(const R of Object.keys(i)){const E=i[R];(typeof E=="string"||typeof E=="number")&&(p[R]=String(E))}l(p)}},[n,i]);const u=(p,R)=>{l(E=>({...E,[p]:R}))},v=p=>{p.preventDefault();const R={...i};for(const E of Object.keys(j))R[E]=j[E];h(R)},w=p=>{p.target===p.currentTarget&&o()},g=(p,R)=>typeof R=="object"&&R!==null?null:e.jsxRuntimeExports.jsxs("div",{className:"wandox-form-item",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-form-label",children:p}),e.jsxRuntimeExports.jsx("input",{type:"text",className:"wandox-form-input",placeholder:`请输入 ${p}`,value:j[p]||"",onChange:E=>u(p,E.target.value)})]},p);return n?e.jsxRuntimeExports.jsx("div",{className:"wandox-modal-overlay",onClick:w,children:e.jsxRuntimeExports.jsxs("div",{className:"wandox-modal",style:{width:600},children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-modal-header",children:[e.jsxRuntimeExports.jsxs("h3",{className:"wandox-modal-title",children:["执行 Action: ",s]}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-modal-close",onClick:o,"aria-label":"关闭",children:e.jsxRuntimeExports.jsx("svg",{width:"24",height:"24",viewBox:"0 0 16 16",fill:"currentColor",children:e.jsxRuntimeExports.jsx("path",{d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"})})})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-modal-body",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-modal-description",children:"以下是默认参数,您可以修改后执行,或直接使用默认值执行"}),e.jsxRuntimeExports.jsxs("form",{onSubmit:v,children:[Object.keys(i).map(p=>g(p,i[p])),Object.keys(i).length===0&&e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-params",children:"该 Action 无需参数"})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-modal-footer",children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-button wandox-button-default",onClick:o,children:"取消"}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-button wandox-button-primary",onClick:v,children:"执行"})]})]})}):null}const rt=["要努力呀,为了想要的生活,为了人间的烟火气,为了今天的风和月。","欣赏不来别人视若珍宝的,就该保持沉默。","日子总是有意思的,了无生趣的是打不起精神的你。","我们终其一生,就是要摆脱他人的期待,找到真正的自己。","别在最好的年纪选择了安逸,那是对自己最大的辜负。","你现在的气质里,藏着你走过的路、读过的书和爱过的人。","成长就是,你终于明白有些路只能一个人走。","不是每一次努力都有收获,但每一次收获都需要努力。","生活从不眷顾因循守旧、满足现状的人,而将更多机遇留给勇于探索的人。","所有的困难都是暂时的,熬过去就是晴天。","你若盛开,清风自来。","别人笑我太疯癫,我笑他人看不穿。","走慢一点,是为了走得更远。","不必羡慕别人,你的故事才刚刚开始。","心若向阳,何惧忧伤。","人生没有白走的路,每一步都算数。","你不是在浪费时间,你是在积蓄力量。","别让昨天的遗憾,占满今天的时间。","深夜的努力,终将照亮黎明。","只要路是对的,就不怕遥远。","生活不会辜负每一个认真的人。","做一个有温度的人,遇见有光的事。","你所经历的每一次失败,都是未来成功的伏笔。","不要因为走得太远,而忘记为什么出发。","把每一天当作礼物,而不是任务。","越努力,越幸运。","你值得拥有你所渴望的一切。","别把时间花在你不喜欢的事情上,除非它能带你去你喜欢的地方。","有些事现在不做,一辈子都不会做了。","你的潜力,远比你想象的要大。","不要等到准备好了才开始,开始了才会准备好。","慢慢来,比较快。","善待自己,你已经很努力了。","每一个你讨厌的早晨,都是别人求之不得的机会。","世界上只有一种真正的英雄主义,那就是认清生活的真相后仍然热爱它。","人生不是等待风暴过去,而是学会在雨中起舞。","别总想着逃离,先想想能不能改变。","你无法控制风向,但可以调整帆的方向。","没有人能替你走你该走的路。","不要因为没有掌声而停止歌唱。","把抱怨环境的心情,用来改善环境吧。","你今天的懒惰,是明天后悔的源头。","没有人永远年轻,但永远有人正在年轻。","读书破万卷,不如行路十里。","人生最大的遗憾,是轻易放弃了本不该放弃的。","你不是失败了,你只是还没成功。","今天的苦,是明天的底气。","别把别人的看法,活成自己的枷锁。","有一种勇敢,叫做即使害怕也要继续走。","生活是场修行,凡事皆有意义。","不要和自己过不去,人生很短,开心最重要。","你现在偷的懒,都是以后还的债。","最好的时机,就是现在。","你不必完美,但你必须真实。","与其等待一个完美的开始,不如从不完美中开始。","成功不是终点,失败也不是终结,重要的是继续的勇气。","每一个坚持的背后,都有一个不为人知的故事。","改变不了环境,就改变自己。","别用你的忙来掩盖你的懒,也别用你的懒来消耗你的忙。","人生就像骑自行车,要保持平衡就必须不断前行。","昨天已经过去,明天还未到来,今天才是你拥有的全部。","宁可辛苦一阵子,不要痛苦一辈子。","不要让今日的懒惰,成为明日的遗憾。","你的态度,决定了你人生的高度。","路是走出来的,不是想出来的。","做你自己,别人的角色已经有人在演了。","年轻时以为不读书不足惜,后来方知书中有乾坤。","你若想要,便去追;你若已得,便珍惜。","最怕你一生碌碌无为,还安慰自己平凡可贵。","人生没有捷径,弯路也是路。","种一棵树最好的时间是十年前,其次是现在。","每天进步一点点,人生就会不一样。","不要只是看,要有所感悟;不要只是听,要有所行动。","心态好了,一切都好了。","你的未来,取决于你现在的决定。","好好爱自己,才有能力去爱别人。","人生路上,勿忘初心。","有梦想就去追,别给自己的平庸找借口。","世界是你的,但首先你要努力。","坚持不一定成功,但放弃一定失败。","你比你想象的更坚强,比你感觉的更勇敢。","把每一次失败都当成学费,你就赚了。","选择了远方,便只顾风雨兼程。","人生的意义不在于拿一手好牌,而在于打好一手烂牌。","不要在还可以冲刺的年纪,选择散步。","钱不是万能的,但没有钱是万万不能的。努力赚钱,才是对自己最大的尊重。","所谓天才,不过是比别人多了一点坚持。","你改变不了昨天,但你可以决定明天。","做最好的自己,才能遇见最好的别人。","不要因为懒惰而失去了本来可以拥有的东西。","人生没有返回键,但有暂停和前进。","别等别人为你喝彩,先为自己鼓掌。","与其焦虑,不如行动。","每一个优秀的人,都曾经历过一段无人问津的岁月。","你的每一步努力,都在为未来的自己铺路。","不想当将军的士兵不是好士兵,但当不了将军的士兵也可以是好士兵。","生活的艺术,就是把每一个平凡的日子过得不平凡。","人生就是一场旅行,在乎的不是目的地,而是沿途的风景。","不要因为别人的否定,而放弃对自己的肯定。","勇敢不是不害怕,而是即使害怕也还是去做。","命运给了你一手烂牌,你要做的是把它打好。","真正的强大,是内心的平静。","你所不能击垮的,终将使你更强大。","成功的人找方法,失败的人找借口。","不要总是想着明天,今天就是你最年轻的一天。","人生最重要的不是你站在哪里,而是你朝哪个方向走。","每个人都是自己人生的主角,不要沦为配角。","你现在付出的努力,都是在为未来的幸福买单。","心宽了,路才宽。","你所拥有的,比你想要的更多。","不要用战术上的勤奋,掩盖战略上的懒惰。","很多人看起来很忙,实际上只是在低水平上勤奋。","格局大了,烦恼就少了。","你的圈子,决定了你的见识;你的见识,决定了你的未来。","别总是看别人的生活,好好经营自己的就够了。","脚踏实地,仰望星空,这才是人生的正确打开方式。","吃一堑,长一智;受一挫,强一分。","每一次跌倒,都是一次重新出发的机会。","低谷的时候,沉得住气;高峰的时候,守得住心。","你一定要过得很好,这样才不辜负自己受过的苦。","少说多做,是成功的捷径。","人生苦短,别把时间浪费在不值得的人和事上。","越是艰难处,越是修心时。","机会都是留给有准备的人的。","爱拼才会赢,努力才会赢。","人生就像一杯茶,不会苦一辈子,但总会苦一阵子。","不要轻言放弃,你不知道下一秒会发生什么奇迹。","真正的成熟,是能与不完美的自己握手言和。","你所走过的弯路,都是你成长的印记。","别人可以成功,你也可以。","只有不断超越自己,才能不断创造可能。","努力不一定成功,不努力一定不成功。","当你觉得累的时候,说明你在走上坡路。","不经历风雨,怎能见彩虹。","比起抱怨,不如改变。","年轻没有失败,试错才是成长。","你的样子,将决定你世界的样子。","愿你出走半生,归来仍是少年。","有时候你以为的终点,不过是下一段旅程的起点。","今天努力工作,明天努力生活。","不要总是活在别人的评价里,你自己最清楚自己是谁。","无论多难,都要坚持做你认为对的事。","你不需要变成别人,你只需要成为更好的自己。","凡事提前准备,才能游刃有余。","没有什么是理所当然的,感恩才能幸福。","不要把安全感建立在别人身上,那是一种危险的依赖。","清醒的认识自己,是成功的第一步。","沉默是金,但行动是钻石。","用行动证明,而不是用嘴巴解释。","最终你会明白,一切都是值得的。","把目光放长远,眼前的得失不算什么。","不要让自己的懒惰成为别人勤奋的舞台。","你的每一次选择,都在塑造未来的你。","有时候沉默不是因为没话说,而是因为懂得珍惜。","你今天的努力,是明天底气的来源。","先成为你想成为的人,其他的顺其自然。","把握现在,才能拥有未来。","越简单越快乐,越复杂越烦恼。","人生没有真正的绝境,除非你自己放弃。","你比你想象的更有力量。","把每一件平凡的事做好,就是不平凡。","那些没能打败你的,终将使你更强大。","做事情要有始有终,这是对自己最基本的尊重。","不在沉默中爆发,就在沉默中消亡。","不要害怕慢,就怕站。","只要还在走,就没有到不了的地方。","自律的人,才有资格谈自由。","与其等风来,不如追风去。","你有多自律,就有多自由。","凡是过往,皆为序章。","不要在该奋斗的年纪选择了安逸。","人生难得几回搏,此时不搏何时搏。","成长的代价是失去一些幼稚,但获得了更多可能。","有梦想的人,睡觉都是在充电。","不要辜负每一个认真的早晨。","生命的意义,在于不断地自我超越。","你有权利选择,但选择了就要承担。","最大的风险,是不冒任何风险。","生活会奖励那些敢于尝试的人。","不要拿别人的错误惩罚自己。","学会放下,才能腾出手来拥抱新的可能。","所有的天才都曾是努力的凡人。","比别人优秀不是目的,成为更好的自己才是。","你不需要被所有人喜欢,但你必须喜欢自己。","保持好奇心,世界就不会无聊。","每一个平静的背后,都有一颗强大的内心。","把抱怨的时间用来思考,把悲伤的时间用来行动。","只要心里有光,哪里都是出路。","你的奋斗轨迹,就是你最好的简历。","成功不是偶然的,它是努力、坚持和学习的结果。","不要小看自己,宇宙都是从一个点开始的。","真正的自由,是不依赖任何人的底气。","你的努力,终有一天会让你站在阳光下。","生活不在别处,就在此时此刻。","每一段经历,都是人生最好的礼物。"];function ns(){return e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-skeleton-card",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-skeleton-row",children:[e.jsxRuntimeExports.jsx(e.Skeleton.Avatar,{active:!0,size:28,shape:"circle"}),e.jsxRuntimeExports.jsx(e.Skeleton.Input,{active:!0,style:{width:120,height:18}})]}),e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsxRuntimeExports.jsx(e.Skeleton.Input,{active:!0,block:!0,style:{height:40,borderRadius:10}}),e.jsxRuntimeExports.jsx(e.Skeleton.Button,{active:!0,style:{width:80,height:40,borderRadius:10}})]})]})}function as(){return e.jsxRuntimeExports.jsx("div",{className:"wandox-hub-skeleton-insights",children:[1,2,3].map(n=>e.jsxRuntimeExports.jsx("div",{className:"wandox-hub-skeleton-insight-card",children:e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-skeleton-insight-inner",children:[e.jsxRuntimeExports.jsx(e.Skeleton.Input,{active:!0,style:{width:52,height:22,borderRadius:100}}),e.jsxRuntimeExports.jsxs("div",{style:{flex:1},children:[e.jsxRuntimeExports.jsx(e.Skeleton.Input,{active:!0,block:!0,style:{height:16,marginBottom:6}}),e.jsxRuntimeExports.jsx(e.Skeleton.Input,{active:!0,style:{width:"70%",height:12}})]})]})},n))})}function is(n){return!!n&&/^https?:\/\//.test(n)}function Qe(n){if(!n)return"✦";if(is(n))return e.jsxRuntimeExports.jsx("img",{src:n,alt:""});const s=q.agentIconMap.get(n);return s?s.component:n}function os(n,s){const i=`${n||""} ${s||""}`.toLowerCase();return i.includes("red")||i.includes("critical")?"wandox-insight-severity--red":i.includes("orange")||i.includes("high")?"wandox-insight-severity--orange":i.includes("yellow")||i.includes("medium")?"wandox-insight-severity--yellow":"wandox-insight-severity--gray"}function rs(n){const s=n.match(new RegExp("^\\p{Extended_Pictographic}","u"));return(s==null?void 0:s[0])||"📌"}function lt(n){return n.replace(new RegExp("^\\p{Extended_Pictographic}\\s*","u"),"")}function ct(n){var s;return n.bind_type==="playbook"&&n.bind_playbook_id&&((s=n.playbook_args)!=null&&s.length)?"执行":n.bind_type==="agent"?"找智能体聊聊":n.bind_type==="chat"?"分析一下":"查看详情"}function ls(n,s){const i=n.asin||n.ASIN||n.sku||n.seller_sku,o=n.site||n.marketplace||n.country;if(i||o)return[i,o&&`(${o})`].filter(Boolean).join(" ");const h=Object.values(n).find(j=>j!=null&&String(j).trim());return h?String(h):`参数 ${s+1}`}function cs(n,s){var o;const i=(o=n.query_template)==null?void 0:o.trim();return!i||!s?n.title:i.replace(/\{\{?\s*([\w.-]+)\s*\}?\}/g,(h,j)=>{const l=s[j];return l==null?h:String(l)})}function xs(n){return!n||n.status==="disabled"||n.status==="error"||!n.scenes?[]:Object.entries(n.scenes).map(([s,i])=>({name:s,total_affected:i.total_affected,suggestions_count:i.suggestions_count,cards:Array.isArray(i.cards)?i.cards:[]})).filter(s=>s.cards.length>0)}function ds({agentLoading:n,mainAgentForHub:s,mainAgentQuestions:i,agents:o,hubChatOpen:h,setHubChatOpen:j,hubChatInput:l,setHubChatInput:u,hubScrollIdx:v,hubScrollFading:w,onHubChatSend:g,onHubInputFocus:p,onHubInputBlur:R,messages:E,executing:B,hubInlineChatInput:z,setHubInlineChatInput:f,onHubInlineSend:r,onEnterProfessional:c,playbooks:N,executePlaybook:b,onRequestPlaybookParams:M,onAbort:S,onRespondToProposal:Q,ssoToken:$,ssoDomain:D,ssoCompany:C}){var L,k,fe,Ae,be;const I=n&&!s,U=localStorage.getItem("sso_username")||"",F=localStorage.getItem("sso_user_id")||"",Re=e.reactExports.useRef(null),te=e.reactExports.useRef(null),se=e.reactExports.useMemo(()=>[],[]),[Ee,H]=e.reactExports.useState(""),[Z,ue]=e.reactExports.useState([]),[X,ae]=e.reactExports.useState(!1),[W,le]=e.reactExports.useState("idle"),[ce,we]=e.reactExports.useState(0),[G,xe]=e.reactExports.useState(null),[ne,ke]=e.reactExports.useState(!1),_=o[0],O=(_==null?void 0:_.agent_code)||(_==null?void 0:_.agent_id)||"",pe=(L=_==null?void 0:_.questions)!=null&&L.length?_.questions:i,Ne=D!=="yunduo"&&pe[v%Math.max(pe.length,1)]||"今天仓库订单处理的怎么样了?",Te=e.reactExports.useMemo(()=>rt[Math.floor(Math.random()*rt.length)],[]),me=e.reactExports.useMemo(()=>({Authorization:`Bearer ${$}`,"X-Tenant-ID":C,"X-Domain":D,"Content-Type":"application/json"}),[$,C,D]),ee=e.reactExports.useCallback(async(a=!1)=>{if(!(!$||!D)){ae(!0);try{const y=await fetch(`${e.getBaseURL()}/api/v1/insights/${a?"refresh":"recommendations"}`,{method:a?"POST":"GET",headers:me});if(!y.ok)throw new Error(`HTTP ${y.status}`);const de=await y.json(),T=de==null?void 0:de.data;le((T==null?void 0:T.status)||"error"),we((T==null?void 0:T.total_cards)||0),ue(xs(T))}catch{le("error"),we(0),ue([])}finally{ae(!1)}}},[me,D,$]);e.reactExports.useEffect(()=>{ee()},[ee]),e.reactExports.useEffect(()=>{!Ee&&O&&H(O)},[O,Ee]);const ie=Z,V=Ee||O||((k=se[0])==null?void 0:k.agent_id)||(s==null?void 0:s.agent_id),K=e.useQuestionAutocomplete({token:$,domain:D,tenantId:C,agentId:V||"",limit:5});e.reactExports.useEffect(()=>{if(!ne||h){K.clear();return}K.search(l)},[ne,l,h,K.search,K.clear]);const P=ie.length>0&&ie.every(a=>a.cards.length===1),Se=se.slice(0,3),Ce=se.slice(3),Ie=V===O?_==null?void 0:_.name:(fe=se.find(a=>a.agent_id===V))==null?void 0:fe.name,Pe=V===O?_!=null&&_.icon?q.getAgentIconById(_.icon):q.getAgentIconById("robot"):Qe((Ae=se.find(a=>a.agent_id===V))==null?void 0:Ae.icon),he=V===O?_==null?void 0:_.description:(be=se.find(a=>a.agent_id===V))==null?void 0:be.description,t=(a,y)=>{if(a.bind_type==="agent"&&a.bind_agent_code){c(a.bind_agent_code);return}if(a.bind_type==="playbook"&&a.bind_playbook_id&&y){j(!0),b({message:cs(a,y),playbook_id:a.bind_playbook_id,playbook_params:y});return}g(V,a.title)},x=(a,y,de,T=!1,Be=!1)=>{const ye=Array.isArray(y.playbook_args)?y.playbook_args:[],ge=y.bind_type==="playbook"&&!!y.bind_playbook_id&&ye.length>0;return e.jsxRuntimeExports.jsxs("article",{className:`wandox-insight-card${T?" wandox-insight-card--modal":""}${Be?" wandox-insight-card--featured":""}`,children:[e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-insight-card-main",onClick:()=>{T&&xe(null),t(y,ye[0])},children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-insight-card-top",children:[e.jsxRuntimeExports.jsx("span",{className:`wandox-insight-severity ${os(y.severity_color,y.priority)}`,children:y.severity_label||"观察"}),y.affected_count&&e.jsxRuntimeExports.jsx("span",{children:y.affected_count})]}),e.jsxRuntimeExports.jsx("h4",{children:y.title}),y.description&&e.jsxRuntimeExports.jsx("p",{children:y.description}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-insight-card-foot",children:[e.jsxRuntimeExports.jsx("span",{children:y.value_hint||"建议进一步确认"}),!ge&&e.jsxRuntimeExports.jsxs("strong",{children:[ct(y)," →"]})]})]}),ge&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-insight-arg-list",children:[ye.slice(0,T?10:3).map((ve,Y)=>e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-insight-arg-action",onClick:()=>{T&&xe(null),t(y,ve)},children:[e.jsxRuntimeExports.jsx("span",{children:ls(ve,Y)}),e.jsxRuntimeExports.jsx("strong",{children:ct(y)})]},`${y.title}-${Y}`)),!T&&ye.length>3&&e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-insight-arg-more",onClick:()=>xe(ie.find(ve=>ve.name===a)||null),children:["还有 ",ye.length-3," 项可执行"]})]})]},`${a}-${y.title}-${de}`)};return e.jsxRuntimeExports.jsx("div",{className:"wandox-view-scroll",children:e.jsxRuntimeExports.jsxs("div",{className:"wandox-view-content wandox-hub-v2",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-header",children:[e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsxs("h1",{className:"wandox-hub-v2-title",children:["您好,",U||"欢迎回来"]}),e.jsxRuntimeExports.jsx("p",{className:"wandox-hub-v2-subtitle",children:Te})]}),D!=="yunduo"&&e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-hub-v2-report",onClick:()=>{const a=new URLSearchParams;$&&a.append("authorization",$),D&&a.append("x-domain",D),C&&a.append("x-tenant-id",C),F&&a.append("user_id",F),U&&a.append("username",U),window.open(`https://ai.wandox.com/trend-report/trend-report-6.html${a.toString()?`?${a.toString()}`:""}`,"_blank")},children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-hub-v2-report-logo",children:"麦"}),e.jsxRuntimeExports.jsxs("span",{children:[e.jsxRuntimeExports.jsx("strong",{children:"麦多趋势报告"}),e.jsxRuntimeExports.jsx("small",{children:"第六期 已更新 →"})]})]})]}),I?e.jsxRuntimeExports.jsx(ns,{}):e.jsxRuntimeExports.jsxs("div",{ref:Re,className:`wandox-hub-main-card${h?" wandox-hub-main-card--open":""}`,children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-hub-main-card-search",style:{opacity:h?0:1,maxHeight:h?0:520,transition:"opacity 0.2s ease, max-height 0.35s cubic-bezier(0.4,0,0.2,1)"},children:e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-input-panel",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-input-head",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-agent-title",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-hub-v2-agent-mark",children:Pe}),e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("strong",{children:Ie||(s==null?void 0:s.name)||"通用问答"}),e.jsxRuntimeExports.jsx("span",{children:he||"问什么都行,系统会自动分流到对应的专业能力"})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-chip-row",style:{display:"none"},children:[O&&e.jsxRuntimeExports.jsxs("button",{type:"button",className:`wandox-hub-v2-chip${V===O?" wandox-hub-v2-chip--active":""}`,onClick:()=>H(O),title:(_==null?void 0:_.description)||(_==null?void 0:_.name)||"全部",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-hub-v2-chip-icon",children:_!=null&&_.icon?q.getAgentIconById(_.icon):"✦"}),"全部"]}),Se.map(a=>e.jsxRuntimeExports.jsxs("button",{type:"button",className:`wandox-hub-v2-chip${a.agent_id===V?" wandox-hub-v2-chip--active":""}`,onClick:()=>H(a.agent_id),title:a.description||a.name,children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-hub-v2-chip-icon",children:Qe(a.icon)}),a.name]},a.agent_id)),Ce.length>0&&e.jsxRuntimeExports.jsx(e.Dropdown,{menu:{items:Ce.map(a=>({key:a.agent_id,label:e.jsxRuntimeExports.jsxs("span",{className:"wandox-hub-v2-more-item",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-hub-v2-chip-icon",children:Qe(a.icon)}),e.jsxRuntimeExports.jsx("span",{children:a.name})]})})),onClick:({key:a})=>H(String(a))},placement:"bottomRight",children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-hub-v2-chip wandox-hub-v2-chip--more",children:["更多 ",e.jsxRuntimeExports.jsx(e.RefIcon$3,{})]})})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-input-wrap",children:[e.jsxRuntimeExports.jsx(e.Input.TextArea,{value:l,onChange:a=>u(a.target.value),onPressEnter:a=>{a.shiftKey||(a.preventDefault(),g(V))},onFocus:()=>{ke(!0),p==null||p()},onBlur:()=>{window.setTimeout(()=>ke(!1),120),R==null||R()},placeholder:"请随便问,看看 AI 搭子怎么帮你避坑",autoSize:{minRows:3,maxRows:7},variant:"borderless",className:"wandox-hub-v2-textarea"}),e.jsxRuntimeExports.jsx(e.QuestionAutocomplete,{open:ne,rewrittenQuestion:K.rewrittenQuestion,questions:K.questions,loading:K.loading,placement:"bottom",onSelectRewrite:a=>{u(a),K.clear()},onSelectQuestion:a=>{u(""),K.clear(),g(V,a.title)}})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-input-bottom",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-example",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-hub-v2-example-label",children:"示例:"}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-hub-v2-example-text",onClick:()=>{u(Ne)},style:{opacity:w?0:1,transform:w?"translateY(-4px)":"translateY(0)"},children:Ne})]}),e.jsxRuntimeExports.jsx(e.Button,{type:"primary",icon:e.jsxRuntimeExports.jsx(e.RefIcon$15,{}),className:"wandox-hub-v2-send",onClick:()=>g(V),children:"发送问题"})]})]})}),e.jsxRuntimeExports.jsxs("div",{style:{height:h?"100%":0,display:"flex",flexDirection:"column",opacity:h?1:0,overflow:"hidden",transition:"opacity 0.3s ease 0.1s, max-height 0.4s cubic-bezier(0.4,0,0.2,1)",position:"relative",zIndex:h?1:-1},children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-chat-header",children:[s&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-chat-agent-avatar",children:[q.getAgentIconById(s.icon),s.is_main&&e.jsxRuntimeExports.jsx("div",{className:"wandox-hub-chat-agent-badge"})]}),e.jsxRuntimeExports.jsx("span",{className:"wandox-hub-chat-agent-name",children:s==null?void 0:s.name}),e.jsxRuntimeExports.jsx("span",{className:"wandox-hub-chat-status",children:"对话中"}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-hub-chat-close",onClick:()=>{S(),j(!1)},children:"×"})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-chat-section__body wandox-chat-section__body--hub",children:[e.jsxRuntimeExports.jsx(e.ChatMessageList,{messages:E,executing:B,ssoToken:$,ssoDomain:D,ssoCompany:C,onExecutePlaybook:a=>b(a),onFillPlaybookParams:a=>M({playbook_id:a.playbookId,name:a.playbookName,input_fields:a.inputFields,initial_params:a.initialParams,playbook_type:a.playbookType}),onRespondToProposal:Q,containerRef:te,className:"wandox-hub-messages"}),e.jsxRuntimeExports.jsx(e.ConversationOutline,{messages:E,scrollContainerRef:te})]}),e.jsxRuntimeExports.jsx("div",{className:"wandox-hub-chat-input-row",children:e.jsxRuntimeExports.jsx(e.ChatInput,{executing:B,onSend:r,playbooks:N,value:z,onValueChange:f,placeholder:"继续提问…",ssoToken:$,ssoDomain:D,ssoCompany:C,onRequestPlaybookParams:M})}),e.jsxRuntimeExports.jsx("div",{className:"wandox-hub-chat-footer",children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-hub-chat-enter-link",onClick:()=>c(),children:"进入完整对话视图 →"})})]})]}),(X||W==="error"||W==="success"&&ce>=0)&&W!=="disabled"&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-section wandox-hub-v2-insights",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-section-heading",children:[e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-section-kicker",children:[e.jsxRuntimeExports.jsx("span",{}),e.jsxRuntimeExports.jsx("strong",{children:"基于你的数据,建议先看"})]}),e.jsxRuntimeExports.jsx("p",{children:"系统每天扫描你的店铺数据,自动识别出值得处理的场景"})]}),e.jsxRuntimeExports.jsx(e.Button,{type:"text",size:"small",icon:e.jsxRuntimeExports.jsx(e.RefIcon$7,{}),className:"wandox-hub-v2-refresh",onClick:()=>ee(!0),children:"换一批"})]}),X?e.jsxRuntimeExports.jsx(as,{}):W==="error"?e.jsxRuntimeExports.jsxs("div",{className:"wandox-insight-empty",children:[e.jsxRuntimeExports.jsx("strong",{children:"数据获取失败,请稍后重试"}),e.jsxRuntimeExports.jsx(e.Button,{type:"link",size:"small",onClick:()=>ee(),children:"重试"})]}):ie.length===0?e.jsxRuntimeExports.jsxs("div",{className:"wandox-insight-empty",children:[e.jsxRuntimeExports.jsx("strong",{children:"暂无场景推荐,数据正常"}),e.jsxRuntimeExports.jsx("span",{children:"当前没有扫描到需要优先处理的运营场景"})]}):e.jsxRuntimeExports.jsx("div",{className:`wandox-insight-scene-list${P?" wandox-insight-scene-list--single-cards":""}${ie.length===1?" wandox-insight-scene-list--one-scene":""}`,children:ie.map(a=>e.jsxRuntimeExports.jsxs("section",{className:"wandox-insight-scene",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-insight-scene-head",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("strong",{children:lt(a.name)}),e.jsxRuntimeExports.jsxs("span",{children:["扫描到"," ",a.suggestions_count??a.cards.length," ","条建议"]})]})}),e.jsxRuntimeExports.jsx("div",{className:`wandox-insight-card-row${a.cards.length===1?" wandox-insight-card-row--single":""}`,children:a.cards.slice(0,4).map((y,de)=>x(a.name,y,de,!1,a.cards.length===1))}),a.cards.length>4&&e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-insight-view-all",onClick:()=>xe(a),children:["查看全部 ",a.cards.length," 条建议 →"]})]},a.name))})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-section",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-section-heading",children:[e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-section-kicker",children:[e.jsxRuntimeExports.jsx("span",{}),e.jsxRuntimeExports.jsx("strong",{children:"需要执行更专业的任务?"})]}),e.jsxRuntimeExports.jsx("p",{children:"直接进入对应专家,按业务流程一步步处理"})]}),e.jsxRuntimeExports.jsx(e.Button,{type:"link",size:"small",className:"wandox-hub-v2-refresh",onClick:()=>c(),children:"全部 →"})]}),I?e.jsxRuntimeExports.jsx("div",{className:"wandox-agent-grid",children:[1,2,3].map(a=>e.jsxRuntimeExports.jsxs("div",{className:"wandox-agent-entry-card",style:{pointerEvents:"none"},children:[e.jsxRuntimeExports.jsx(e.Skeleton.Avatar,{active:!0,size:36,shape:"square",style:{borderRadius:8,flexShrink:0}}),e.jsxRuntimeExports.jsxs("div",{style:{flex:1},children:[e.jsxRuntimeExports.jsx(e.Skeleton.Input,{active:!0,block:!0,style:{height:14,marginBottom:6}}),e.jsxRuntimeExports.jsx(e.Skeleton.Input,{active:!0,style:{width:"80%",height:11}})]})]},a))}):e.jsxRuntimeExports.jsx("div",{className:"wandox-agent-grid",children:o.filter(a=>!a.is_main).slice(0,4).map(a=>{const y=e.getAgentPackageBenefit(a);return e.jsxRuntimeExports.jsxs("button",{type:"button",className:`wandox-agent-entry-card${y?" wandox-agent-entry-card--with-badge":""}`,onClick:()=>c(a.agent_id||void 0),children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-agent-entry-icon",children:q.getAgentIconById(a.icon)}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-agent-entry-info",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-agent-entry-name",children:a.name}),e.jsxRuntimeExports.jsx("div",{className:"wandox-agent-entry-desc",children:a.description})]}),e.jsxRuntimeExports.jsx(e.RefIcon$6,{className:"wandox-agent-entry-arrow"}),y&&e.jsxRuntimeExports.jsx("span",{className:`wandox-agent-entry-badge wandox-agent-entry-badge--${y.kind}`,style:{background:y.badgeColor,color:y.badgeTextColor},children:y.badgeText})]},a.agent_id)})})]}),e.jsxRuntimeExports.jsx(e.Modal,{open:!!G,onCancel:()=>xe(null),footer:null,width:920,centered:!0,className:"wandox-insight-modal",title:G?e.jsxRuntimeExports.jsxs("div",{className:"wandox-insight-modal-title",children:[e.jsxRuntimeExports.jsx("span",{children:rs(G.name)}),e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("strong",{children:lt(G.name)}),e.jsxRuntimeExports.jsxs("small",{children:[G.cards.length," 条数据建议"]})]})]}):null,styles:{container:{padding:0}},children:G&&e.jsxRuntimeExports.jsx("div",{className:"wandox-insight-modal-grid",children:G.cards.map((a,y)=>x(G.name,a,y,!0))})})]})})}function us(n){const s=n.toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}),i=n.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"});return`${s}
|
|
3
3
|
${i}`}function Ue(n,s){return n.activeAgent===s.activeAgent&&n.webhookId===s.webhookId&&n.ssoToken===s.ssoToken&&n.ssoDomain===s.ssoDomain&&n.ssoCompany===s.ssoCompany}function ps(n){const{activeAgent:s,webhookId:i="",ssoToken:o="",ssoDomain:h="",ssoCompany:j=""}=n,[l,u]=e.reactExports.useState([]),v=e.reactExports.useRef({activeAgent:s,webhookId:i,ssoToken:o,ssoDomain:h,ssoCompany:j});e.reactExports.useEffect(()=>{v.current={activeAgent:s,webhookId:i,ssoToken:o,ssoDomain:h,ssoCompany:j},u([])},[s,i,o,h,j]);const w=e.reactExports.useCallback(async()=>{if(!s)return;const g={activeAgent:s,webhookId:i,ssoToken:o,ssoDomain:h,ssoCompany:j};if(Ue(v.current,g))try{const p=await e.GET_Api_V1_Agents_Workspaces({agent_id:s,limit:10,use_cache:!1});if(!Ue(v.current,g))return;if(p!=null&&p.data&&Array.isArray(p.data)){const R=p.data.map(E=>{const B=Array.isArray(E.actions)?E.actions||[]:[],z=E.ui_payload,f=z==null?void 0:z.actions,r=Array.isArray(f)?f:[],N=[...B,...r].map(M=>{const S=M;return{label:S.display_name||S.label||"执行",action_id:S.action_id,playbook_id:S.playbook_id,display_name:S.display_name,display_icon:S.display_icon,params:S.params,params_fields_map:S.params_fields_map,type:S.type,url:S.url,style:S.style,status:S.action_status||S.status||void 0,sort_order:S.sort_order,executed_job_id:S.executed_job_id,supports_batch:S.supports_batch===!0,batch_max_items:S.batch_max_items,batch_id:S.batch_id,outputs:S.outputs}}),b=E.outputs;return{type:E.widget_type||"daily_report",priority:E.priority||"medium",title:E.title||"每日战报",summary:E.summary||"",timestamp:E.created_at?us(new Date(E.created_at||"")):"",data:E.card_data||{},actions:N,id:E.inbox_id||"",agent_id:E.agent_id||"",read:!!E.is_read,ui_payload:b||z||{}}});if(R.length>0){const E=R.sort((B,z)=>{const f=B.timestamp?new Date(B.timestamp.replace(/\n/g," ")).getTime():0;return(z.timestamp?new Date(z.timestamp.replace(/\n/g," ")).getTime():0)-f});u(E)}else u([])}else u([])}catch(p){if(!Ue(v.current,g))return;throw u([]),p}},[s,i,o,h,j]);return{widgets:l,setWidgets:u,loadDailyReports:w}}function ms(){const[n,s]=e.reactExports.useState([]),[i,o]=e.reactExports.useState(!1),[h,j]=e.reactExports.useState(!1),[l,u]=e.reactExports.useState(""),[v,w]=e.reactExports.useState([]),[g,p]=e.reactExports.useState(!1),[R,E]=e.reactExports.useState(null),[B,z]=e.reactExports.useState(!0),f=e.reactExports.useRef(null),r=e.reactExports.useCallback(async()=>{if(f.current)return f.current;const C=(async()=>{o(!0);try{const I=await e.GET_Api_V1_Playbooks_SolidifyView_List({page:1,page_size:20});return Array.isArray(I==null?void 0:I.data)?(s(I.data),j(!0),!0):(j(!1),!1)}catch{return j(!1),!1}finally{o(!1),f.current=null}})();return f.current=C,C},[]),c=e.reactExports.useCallback(()=>h?Promise.resolve(!0):r(),[r,h]),N=e.reactExports.useCallback(C=>{u(C),E({session_id:C,type:"dashboard_intent",intents:[],data:{}}),z(!1),(async(U={})=>{p(!0);try{const F=await e.POST_Api_V1_Playbooks_SolidifyView_Run_ByPlaybookId(C,{params:U});F.success&&F.data&&(E(F.data),F.data.input_params&&w(F.data.input_params))}catch{}finally{p(!1)}})()},[]),b=e.reactExports.useCallback(C=>{if(!l)return;(async()=>{p(!0);try{const U=await e.POST_Api_V1_Playbooks_SolidifyView_Run_ByPlaybookId(l,{params:C});U.success&&U.data&&E(U.data)}catch{}finally{p(!1)}})()},[l]),M=e.reactExports.useCallback(C=>{l===C&&(u(""),E(null),w([])),r()},[l,r]),S=e.reactExports.useCallback(()=>{if(!l)return null;const C=n.find(I=>I.playbook_id===l);return(C==null?void 0:C.name)||null},[l,n]),Q=e.reactExports.useCallback((C,I)=>{E(C),z(I!==void 0?I:!0)},[]),$=e.reactExports.useCallback(()=>{},[]),D=e.reactExports.useCallback(()=>{u(""),E(null),w([])},[]);return{solidifiedPlaybooks:n,solidifiedPlaybooksLoading:i,solidifiedPlaybooksLoaded:h,activeSolidifiedPlaybook:l,setActiveSolidifiedPlaybook:u,solidifyInputParams:v,solidifyLoading:g,dashboardData:R,setDashboardData:E,dashboardShowSaveButton:B,setDashboardShowSaveButton:z,loadSolidifiedPlaybooks:r,ensureSolidifiedPlaybooksLoaded:c,handleSolidifiedPlaybookClick:N,handleSolidifyParamsSearch:b,handleSolidifiedPlaybookDelete:M,getCurrentSolidifiedPlaybookName:S,handleDashboardPreview:Q,handleSolidifyComplete:$,clearDashboard:D}}function hs(){const{allQuestions:n,setCurrentQuestion:s}=e.useQuestionsStore();e.reactExports.useEffect(()=>{if(n.length===0)return;const i=Math.floor(Math.random()*n.length);s(n[i]);const o=setInterval(()=>{const h=Math.floor(Math.random()*n.length);s(n[h])},1e4);return()=>{clearInterval(o)}},[n,s])}const xt={chat:{title:"对话",subtitle:""},plan:{title:"自动化",subtitle:"创建、管理并追踪自动化智能体的执行结果,支持定时触发与对内流转"},professional:{title:"专业智能体",subtitle:"深度分析与专业领域对话"},goals:{title:"目标追踪",subtitle:"跟踪关键业务指标和目标进展"},settings:{title:"通知配置",subtitle:"配置 Webhook 通知,实时接收系统重要事件"}},js=5*60*1e3,Es=3;function fs(n={}){const{showAside:s=!0,showLogout:i=!1,onLogout:o,presetAgents:h,webhookId:j,onReady:l,initialAgentId:u,initialPlaybookId:v,initialPlaybookParams:w}=n,g=localStorage.getItem("sso_token")||"",p=localStorage.getItem("sso_domain")||"maiduo",R=localStorage.getItem("sso_company")||"",B=`${e.getBaseURL()}/api/v1/oss/upload2`,z=e.reactExports.useCallback(async d=>{const{data:A}=await e.GET_Api_V1_Playbooks_Detail({playbook_id:d});return A},[]),f=e.reactExports.useCallback(d=>e.POST_Api_V1_Playbooks_SolidifyView_SaveV2({session_id:d.session_id||"",name:d.name,description:d.description}),[]),r=e.reactExports.useCallback(d=>e.POST_Api_V1_Playbooks_SolidifyView_PreviewV2({session_id:d.session_id||"",user_hint:d.user_hint||""}),[]),{activeAgent:c,setActiveAgent:N,sourceAgents:b,playbooks:M,userPlaybooks:S,userPlaybooksLoading:Q,childAgents:$,agentLoading:D,sceneLoading:C,loadUserPlaybooks:I,playbooksLoaded:U}=q.useWorkbenchRuntime({presetAgents:h,initialAgentId:u}),F=D||C,[Re,te]=e.reactExports.useState(()=>!!u),[se,Ee]=e.reactExports.useState(!1),[H,Z]=e.reactExports.useState(!1),[ue,X]=e.reactExports.useState([]),[ae,W]=e.reactExports.useState(0),le=e.reactExports.useRef(!1),{executing:ce,stopping:we,executingRef:G,queueStatus:xe,messageData:ne,actions:ke}=q.useWorkbenchSession({activeAgent:c,webhookId:j,ssoToken:g,ssoDomain:p,ssoCompany:R,onRecommendationsUpdate:X}),{sendMessage:_,executePlaybook:O,respondToProposal:pe,stopCurrent:Ne,retrigger:Te,abort:me,clearMessages:ee}=ke;e.reactExports.useEffect(()=>{le.current&&!ce&&W(d=>d+1),le.current=ce},[ce]);const{widgets:ie,setWidgets:V,loadDailyReports:K}=ps({activeAgent:c,webhookId:j,ssoToken:g,ssoDomain:p,ssoCompany:R}),P=ms();hs();const[Se,Ce]=e.reactExports.useState(()=>localStorage.getItem("wandox_sidebar_agent_mode")==="true"),Ie=e.reactExports.useCallback(()=>{Ce(d=>{const A=!d;return localStorage.setItem("wandox_sidebar_agent_mode",String(A)),A})},[]),[Pe,he]=e.reactExports.useState(!1),[t,x]=e.reactExports.useState(!1),[L,k]=e.reactExports.useState(!1),[fe,Ae]=e.reactExports.useState(!1),[be,a]=e.reactExports.useState(null),[y,de]=e.reactExports.useState(!1),[T,Be]=e.reactExports.useState(null),[ye,ge]=e.reactExports.useState(""),[ve,Y]=e.reactExports.useState(null),[oe,je]=e.reactExports.useState("chat"),[De,dt]=e.reactExports.useState(null),ut=e.reactExports.useCallback(()=>{he(!0),x(!1)},[]),pt=e.reactExports.useCallback(()=>{he(!1),x(!1)},[]),[Xe,He]=e.reactExports.useState(""),[et,tt]=e.reactExports.useState(0),[mt,ze]=e.reactExports.useState(!1),[st,nt]=e.reactExports.useState(!1),[ht,at]=e.reactExports.useState(!1),[jt,Et]=e.reactExports.useState(""),Oe=e.reactExports.useRef(null),Le=e.reactExports.useRef(!1),[ft,gt]=e.reactExports.useState(null),[Rt,wt]=e.reactExports.useState(!1),bt=F||ne.loading,yt=e.reactExports.useCallback(d=>{a(()=>d)},[]);e.reactExports.useEffect(()=>{l&&l({showInspectionResults:d=>{gt(d||null),wt(!0)}})},[l]),e.reactExports.useEffect(()=>{te(!!u),Ee(!1),Z(!1)},[u,v,w]),e.reactExports.useEffect(()=>{if(c)return X([]),()=>{G.current&&me()}},[c,j,g,p,R]),e.reactExports.useEffect(()=>{if(oe!=="professional"){Le.current=!1;return}if(!c)return;Le.current||(ne.loadMessagesAndDailyReport(),K()),Le.current=!1;let d=0,A=null;return A=setInterval(async()=>{try{await K(),d=0}catch{d++,d>=Es&&A&&(clearInterval(A),A=null)}},js),()=>{A&&clearInterval(A)}},[oe,c,j,g,p,R]);const J=b.find(d=>d.is_main)??b[0],Me=(J==null?void 0:J.questions)||[];e.reactExports.useEffect(()=>{tt(0),ze(!1)},[J==null?void 0:J.agent_id]),e.reactExports.useEffect(()=>{if(Me.length<=1||st)return;let d;const A=setInterval(()=>{ze(!0),d=setTimeout(()=>{tt(m=>(m+1)%Me.length),ze(!1)},350)},3500);return()=>{clearInterval(A),clearTimeout(d)}},[Me.length,st]),e.reactExports.useEffect(()=>{if(Oe.current&&c&&c!=="default"){const d=Oe.current;Oe.current=null,_(d)}},[c,_]),e.reactExports.useEffect(()=>{if(!u||!Re||!c||c==="default"||b.length===0)return;!!e.findAgentById(b,u)||te(!1)},[u,Re,c,b]),e.reactExports.useEffect(()=>{!u||v||se||!c||c==="default"||!b.find(A=>e.matchesAgent(A,c)&&e.matchesAgent(A,u))||(Ee(!0),je("professional"),P.clearDashboard(),te(!1))},[u,v,se,c,b,P]),e.reactExports.useEffect(()=>{var it;if(!u||!v||H||!c||c==="default"||!U||!b.find(_e=>e.matchesAgent(_e,c)&&e.matchesAgent(_e,u)))return;const A=M.find(_e=>e.matchesPlaybook(_e,v));if(!A){je("professional"),e.staticMethods.error(`指定的场景(${v})不存在,已切换到智能体界面`),Z(!0),te(!1);return}Z(!0),je("professional"),Le.current=!0,ee(),P.clearDashboard(),Y(null),ge("");const m=w||{},re=Object.keys(m).length>0,Ve=(A.input_fields??[]).filter(_e=>{if(!_e.required)return!1;const qe=m[_e.name];return qe==null||qe===""});if((((it=A.input_fields)==null?void 0:it.length)??0)>0&&(!re||Ve.length>0)){Y(A),te(!1);return}O({message:A.name,playbook_id:v,playbook_params:m}),te(!1)},[u,v,H,c,U,b,M,w]);const We=e.reactExports.useCallback(d=>{e.isSameAgentSelection(b,c,d)||(G.current&&(me(),e.staticMethods.info("已中止当前场景,切换智能体")),N(d),ge(""),Y(null),P.clearDashboard(),ee(),V([]))},[me,c,b,ee,G,N,P,V]),vt=(d,A)=>{const m=(A??Xe).trim()||Me[et%Me.length]||"",re=d||(J==null?void 0:J.agent_id);!m||!re||(He(""),at(!0),ee(),c===re?_(m):(Le.current=!0,Oe.current=m,N(re)))},_t=(d,A)=>{P.handleDashboardPreview(d,A),je("chat"),N("default")},kt=()=>{P.handleSolidifyComplete(),je("chat"),N("default")},Nt=d=>{je(d),(d==="goals"||d==="settings"||d==="plan"||d==="chat")&&P.clearDashboard()},St=()=>{x(!1),Ae(!0),P.ensureSolidifiedPlaybooksLoaded()},Ct=d=>{Ae(!1),P.handleSolidifiedPlaybookClick(d),je("chat"),N("default"),ge(""),Y(null)},It=()=>{var d,A;if(P.dashboardData)return e.jsxRuntimeExports.jsx(e.DashboardRenderer,{data:P.dashboardData,showSaveButton:P.dashboardShowSaveButton,onSaveSuccess:P.loadSolidifiedPlaybooks,onSaveDashboard:f,onPreviewDashboard:r,title:P.getCurrentSolidifiedPlaybookName()||void 0,customParamsForm:P.solidifyInputParams.length>0?e.jsxRuntimeExports.jsx(Zt,{inputParams:P.solidifyInputParams,onSearch:P.handleSolidifyParamsSearch,loading:P.solidifyLoading}):void 0,showGlobalFilter:P.solidifyInputParams.length>0});switch(oe){case"chat":return e.jsxRuntimeExports.jsx(e.PlaybookContext.Provider,{value:{onExecutePlaybook:O,getPlaybookDetail:z,ossUploadUrl:B,ssoToken:g,ssoDomain:p,ssoCompany:R,onFillPlaybookParams:m=>{const re={playbook_id:m.playbookId,name:m.playbookName,input_fields:m.inputFields,initial_params:m.initialParams,playbook_type:m.playbookType};Y(re),je("professional")}},children:e.jsxRuntimeExports.jsx(ds,{agentLoading:F,mainAgentForHub:J,mainAgentQuestions:Me,agents:b,hubChatOpen:ht,setHubChatOpen:at,hubChatInput:Xe,setHubChatInput:He,hubScrollIdx:et,hubScrollFading:mt,onHubChatSend:vt,onHubInputFocus:()=>nt(!0),onHubInputBlur:()=>nt(!1),messages:ne.messages,executing:ce,hubInlineChatInput:jt,setHubInlineChatInput:Et,onHubInlineSend:(m,re,Ve)=>{J!=null&&J.agent_id&&(c!==J.agent_id&&N(J.agent_id),_(m,re,Ve))},onEnterProfessional:m=>{m&&N(m),ge(""),Y(null),P.clearDashboard(),V([]),je("professional")},playbooks:M,executePlaybook:O,onRequestPlaybookParams:Y,clearMessages:ee,onAbort:me,onRespondToProposal:pe,ssoToken:g,ssoDomain:p,ssoCompany:R})});case"goals":return e.jsxRuntimeExports.jsx(e.GoalTracker,{});case"settings":return e.jsxRuntimeExports.jsx(q.SettingsWithTabs,{});case"plan":return e.jsxRuntimeExports.jsx(q.AutomationPage,{embedded:!0,onHeaderChange:dt,onCockpitEnter:ut,onCockpitExit:pt});case"professional":return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(Xt,{title:((d=b.find(m=>e.matchesAgent(m,c)))==null?void 0:d.name)||"Wandox智能体",agentSwitcher:Se?void 0:e.jsxRuntimeExports.jsxs("div",{style:{display:"inline-flex",alignItems:"center",height:34,background:"#fff",border:"1px solid #e5e0f0",borderRadius:10,boxSizing:"border-box",overflow:"hidden"},children:[e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 0 0 8px"},children:[e.jsxRuntimeExports.jsx("div",{style:{width:22,height:22,flexShrink:0},children:q.getAgentIconById((A=b.find(m=>e.matchesAgent(m,c)))==null?void 0:A.icon)}),e.jsxRuntimeExports.jsx(e.Select,{value:c,onChange:m=>We(m),options:b.map(m=>({value:m.agent_id,label:m.name})),variant:"borderless",suffixIcon:e.jsxRuntimeExports.jsx(e.RefIcon$13,{style:{color:"#9275ff",verticalAlign:"middle"}}),style:{fontWeight:600,fontSize:14,minWidth:100,color:"#4a3a6a"},popupMatchSelectWidth:!1})]}),e.jsxRuntimeExports.jsx("button",{type:"button",onClick:Ie,title:"切换为侧边栏选择",style:{display:"flex",alignItems:"center",justifyContent:"center",width:34,height:"100%",cursor:"pointer",color:"#b0a0c8",borderLeft:"1px solid #e5e0f0",transition:"all 0.15s",background:"none",border:"none",padding:0},onMouseEnter:m=>{m.currentTarget.style.color="#7c3aed",m.currentTarget.style.background="#f5f0ff"},onMouseLeave:m=>{m.currentTarget.style.color="#b0a0c8",m.currentTarget.style.background="transparent"},children:e.jsxRuntimeExports.jsx(ot,{style:{fontSize:13}})})]}),count:ie.length,widgets:ie,activeAgent:c,agents:b,childAgents:$,ssoDomain:p,ssoToken:g,ssoCompany:R,onWidgetsUpdate:V,onExecuteComplete:()=>{K()},externalRobotName:ft,externalShowPanel:Rt}),e.jsxRuntimeExports.jsx(e.Chat,{messages:ne.messages,playbooks:M,messagesTotal:ne.messagesTotal,loadMoreMessages:ne.loadMoreMessages,loading:bt,executing:ce,ssoToken:g,ssoDomain:p,ssoCompany:R,activeAgent:c,webhookId:j,onExecutePlaybook:O,onSolidifySuccess:P.loadSolidifiedPlaybooks,onDashboardPreview:_t,onSolidifyComplete:kt,onFillPlaybookParams:m=>{const re={playbook_id:m.playbookId,name:m.playbookName,input_fields:m.inputFields,initial_params:m.initialParams,playbook_type:m.playbookType};Y(re)},onActionClick:m=>{m.action_id?(k(!0),be&&be({action_id:m.action_id,action_params:m.params})):m.playbook_id&&O({message:m.display_name||"执行",playbook_id:m.playbook_id,...m.params?{playbook_params:m.params}:{}})},onExecuteComplete:()=>{K()},onRespondToProposal:pe,onRetrigger:Te}),e.jsxRuntimeExports.jsxs("div",{className:"chat-input-area",children:[e.jsxRuntimeExports.jsx(e.PlaybookHub,{playbooks:M,playbookLoading:F,onPlaybookClick:O,onSelectPlaybook:m=>{Y(m)},recommendations:ue,userPlaybooks:S,userPlaybooksLoading:Q,onLoadUserPlaybooks:I,agentId:e.getAgentPrimaryId(b.find(m=>e.matchesAgent(m,c)))||c,recentRefreshKey:ae}),e.jsxRuntimeExports.jsx(e.ChatInput,{executing:ce,stopping:we,onStop:Ne,onSend:_,playbooks:M,recommendations:ue,value:ye,onValueChange:ge,onRequestPlaybookParams:Y,ssoToken:g,ssoDomain:p,ssoCompany:R})]})]});default:return null}},$e=oe==="plan"?De??xt.plan:xt[oe],Pt=(oe==="plan"||!P.dashboardData)&&oe!=="professional"&&oe!=="chat";return e.jsxRuntimeExports.jsx(e.LanguageProvider,{children:e.jsxRuntimeExports.jsxs(es,{children:[e.jsxRuntimeExports.jsx("div",{className:`wandox-aside-overlay ${t?"wandox-aside-overlay--visible":""}`,onClick:()=>x(!1),onKeyDown:d=>d.key==="Escape"&&x(!1),role:"button",tabIndex:0,"aria-label":"关闭侧边栏"}),s&&e.jsxRuntimeExports.jsx(Ht,{active:c,agents:b,onChange:d=>{x(!1),We(d)},collapsed:Pe,onToggle:()=>he(d=>!d),className:t?"wandox-aside--mobile-open":"",activeView:oe,onViewChange:Nt,onToolboxOpen:St,showLogout:i,onLogout:o,sidebarAgentMode:Se,onToggleSidebarMode:Ie,onAgentSelect:d=>We(d)}),s&&Pe&&e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-aside-floating-open",onClick:()=>he(!1),"aria-label":"展开侧边栏",title:"展开侧边栏",children:e.jsxRuntimeExports.jsx(ot,{})}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-workspace",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-mobile-header",children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-mobile-menu-btn",onClick:()=>{he(!1),x(!0)},children:"☰"}),e.jsxRuntimeExports.jsx("h1",{className:"wandox-mobile-title",children:"Wandox"}),i&&o?e.jsxRuntimeExports.jsx("button",{type:"button",onClick:o,style:{width:40,height:40,background:"transparent",border:"none",cursor:"pointer"},children:"退出"}):e.jsxRuntimeExports.jsx("div",{style:{width:40}})]}),Pt&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-workspace-topbar",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-workspace-topbar-info",children:[e.jsxRuntimeExports.jsx("h1",{className:"wandox-workspace-topbar-title",children:($e==null?void 0:$e.title)??"您好,欢迎使用 AI 智能体"}),e.jsxRuntimeExports.jsx("p",{className:"wandox-workspace-topbar-subtitle",children:($e==null?void 0:$e.subtitle)??""})]}),e.jsxRuntimeExports.jsx("div",{className:"wandox-workspace-topbar-actions",children:oe==="plan"?De==null?void 0:De.actions:null})]}),e.jsxRuntimeExports.jsx("div",{className:`wandox-workspace-container${oe==="plan"?" wandox-workspace-container--automation":""}`,children:It()})]}),e.jsxRuntimeExports.jsx(Yt,{open:fe,loading:P.solidifiedPlaybooksLoading,playbooks:P.solidifiedPlaybooks,activePlaybookId:P.activeSolidifiedPlaybook,onClose:()=>Ae(!1),onPlaybookClick:Ct,onPlaybookDelete:P.handleSolidifiedPlaybookDelete}),e.jsxRuntimeExports.jsx(e.ActionExecutionDrawer,{open:L,ssoToken:g,ssoDomain:p,ssoCompany:R,onClose:()=>k(!1),onExecuteAction:yt,onExecuteComplete:()=>{setTimeout(()=>{K()},1e3)}}),e.jsxRuntimeExports.jsx(ss,{open:y,actionId:(T==null?void 0:T.action_id)||"",actionName:(T==null?void 0:T.display_name)||"",defaultParams:T==null?void 0:T.params,onCancel:()=>{de(!1),Be(null)},onExecute:d=>{de(!1),k(!0),be&&T&&be({action_id:T.action_id,action_params:d}),Be(null)}}),e.jsxRuntimeExports.jsx(Gt,{open:!!ve,playbook:ve,onClose:()=>Y(null),onSubmit:(d,A)=>{Y(null),O({message:d.name,playbook_id:d.playbook_id,playbook_params:A})}}),Re&&e.jsxRuntimeExports.jsx(e.InitialRouteLoading,{}),e.jsxRuntimeExports.jsx(ts,{queueStatus:xe})]})})}exports.default=fs;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { dt as s, af as Qe, da as Hs, d_ as Xs, aE as et, dG as he, d0 as e, N as ze, bL as ss, b0 as st, bC as tt, bB as _s, i as ve, e2 as ks, ai as qe, L as fs, aq as ls, F as at, bN as nt, ct as Ns, a6 as it, a4 as ot, P as lt, aO as He, A as dt, bz as Ss, y as rt, aA as ct, ba as ut, bb as Cs, bc as ht, cv as Is, eb as xt, J as mt, b1 as pt, aW as ft, bd as gt, o as bt, v as wt, n as Ps, b5 as yt, bA as xe, b4 as jt, T as vt, ab as _t, aG as gs, ec as kt, a9 as Nt, aH as St, aF as Ct, cl as It, d3 as Pe, d4 as Pt, cZ as At, am as Et, a as Rt, ah as Lt, G as $t, l as Mt, aQ as Tt, cu as Dt, ad as Ot, aP as Bt } from "./index-
|
|
2
|
-
import {
|
|
3
|
-
import { Drawer as As, Divider as Xt } from "./index-
|
|
1
|
+
import { dt as s, af as Qe, da as Hs, d_ as Xs, aE as et, dG as he, d0 as e, N as ze, bL as ss, b0 as st, bC as tt, bB as _s, i as ve, e2 as ks, ai as qe, L as fs, aq as ls, F as at, bN as nt, ct as Ns, a6 as it, a4 as ot, P as lt, aO as He, A as dt, bz as Ss, y as rt, aA as ct, ba as ut, bb as Cs, bc as ht, cv as Is, eb as xt, J as mt, b1 as pt, aW as ft, bd as gt, o as bt, v as wt, n as Ps, b5 as yt, bA as xe, b4 as jt, T as vt, ab as _t, aG as gs, ec as kt, a9 as Nt, aH as St, aF as Ct, cl as It, d3 as Pe, d4 as Pt, cZ as At, am as Et, a as Rt, ah as Lt, G as $t, l as Mt, aQ as Tt, cu as Dt, ad as Ot, aP as Bt } from "./index-DiKNNTFn.js";
|
|
2
|
+
import { m as zt, h as Wt, A as Vt, n as qt, a as Qt, Q as Ut, k as Ae, f as Ft, d as Gt, g as Kt, u as Zt, q as Jt, b as Yt, S as Ht } from "./WorkbenchRuntime-CypElf5G.js";
|
|
3
|
+
import { Drawer as As, Divider as Xt } from "./index-BGQhNpL1.js";
|
|
4
4
|
var ea = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "defs", attrs: {}, children: [{ tag: "style", attrs: {} }] }, { tag: "path", attrs: { d: "M952 474H829.8C812.5 327.6 696.4 211.5 550 194.2V72c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v122.2C327.6 211.5 211.5 327.6 194.2 474H72c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h122.2C211.5 696.4 327.6 812.5 474 829.8V952c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V829.8C696.4 812.5 812.5 696.4 829.8 550H952c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zM512 756c-134.8 0-244-109.2-244-244s109.2-244 244-244 244 109.2 244 244-109.2 244-244 244z" } }, { tag: "path", attrs: { d: "M512 392c-32.1 0-62.1 12.4-84.8 35.2-22.7 22.7-35.2 52.7-35.2 84.8s12.5 62.1 35.2 84.8C449.9 619.4 480 632 512 632s62.1-12.5 84.8-35.2C619.4 574.1 632 544 632 512s-12.5-62.1-35.2-84.8A118.57 118.57 0 00512 392z" } }] }, name: "aim", theme: "outlined" };
|
|
5
5
|
function ts() {
|
|
6
6
|
return ts = Object.assign ? Object.assign.bind() : function(n) {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-Cpei3C6T.cjs"),j=require("./WorkbenchRuntime-CVhbTmsn.cjs"),Ht=require("./index-B5J1m72V.cjs");var Cs={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 144H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm0 400H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zM464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm0 400H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16z"}}]},name:"appstore",theme:"filled"};function pt(){return pt=Object.assign?Object.assign.bind():function(o){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&(o[l]=i[l])}return o},pt.apply(this,arguments)}const Ss=(o,r)=>e.reactExports.createElement(e.Icon,pt({},o,{ref:r,icon:Cs})),Is=e.reactExports.forwardRef(Ss);var $s={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M689 165.1L308.2 493.5c-10.9 9.4-10.9 27.5 0 37L689 858.9c14.2 12.2 35 1.2 35-18.5V183.6c0-19.7-20.8-30.7-35-18.5z"}}]},name:"caret-left",theme:"filled"};function mt(){return mt=Object.assign?Object.assign.bind():function(o){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&(o[l]=i[l])}return o},mt.apply(this,arguments)}const As=(o,r)=>e.reactExports.createElement(e.Icon,mt({},o,{ref:r,icon:$s})),Ms=e.reactExports.forwardRef(As);var Ps={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z"}}]},name:"caret-right",theme:"filled"};function ht(){return ht=Object.assign?Object.assign.bind():function(o){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&(o[l]=i[l])}return o},ht.apply(this,arguments)}const Ls=(o,r)=>e.reactExports.createElement(e.Icon,ht({},o,{ref:r,icon:Ps})),Ts=e.reactExports.forwardRef(Ls);var Ds={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M320 224h-66v-56c0-4.4-3.6-8-8-8h-52c-4.4 0-8 3.6-8 8v56h-66c-4.4 0-8 3.6-8 8v560c0 4.4 3.6 8 8 8h66v56c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8v-56h66c4.4 0 8-3.6 8-8V232c0-4.4-3.6-8-8-8zm-60 508h-80V292h80v440zm644-436h-66v-96c0-4.4-3.6-8-8-8h-52c-4.4 0-8 3.6-8 8v96h-66c-4.4 0-8 3.6-8 8v416c0 4.4 3.6 8 8 8h66v96c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8v-96h66c4.4 0 8-3.6 8-8V304c0-4.4-3.6-8-8-8zm-60 364h-80V364h80v296zM612 404h-66V232c0-4.4-3.6-8-8-8h-52c-4.4 0-8 3.6-8 8v172h-66c-4.4 0-8 3.6-8 8v200c0 4.4 3.6 8 8 8h66v172c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8V620h66c4.4 0 8-3.6 8-8V412c0-4.4-3.6-8-8-8zm-60 145a3 3 0 01-3 3h-74a3 3 0 01-3-3v-74a3 3 0 013-3h74a3 3 0 013 3v74z"}}]},name:"sliders",theme:"outlined"};function jt(){return jt=Object.assign?Object.assign.bind():function(o){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&(o[l]=i[l])}return o},jt.apply(this,arguments)}const Fs=(o,r)=>e.reactExports.createElement(e.Icon,jt({},o,{ref:r,icon:Ds})),Ut=e.reactExports.forwardRef(Fs);var Os={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"unordered-list",theme:"outlined"};function _t(){return _t=Object.assign?Object.assign.bind():function(o){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&(o[l]=i[l])}return o},_t.apply(this,arguments)}const Vs=(o,r)=>e.reactExports.createElement(e.Icon,_t({},o,{ref:r,icon:Os})),Bs=e.reactExports.forwardRef(Vs);function Gt(o){return{category:null,description:o.desc,domain:"",id:0,name:o.title,playbook_id:o.playbook_id,scope:"",status:"",sub_category:null,tags:null,type:"",version:"",video_url:o.video_url,video_duration:o.video_duration,view_count:o.view_count}}function Kt(o){if(!o||o<=0)return"0:00";const r=Math.floor(o/60),i=String(Math.floor(o%60)).padStart(2,"0");return`${r}:${i}`}const dt="__all__",Bt="__my__",ut="__library_all__",zs="__library__:",qs=[{key:"all",label:"全部场景"},{key:"my",label:"我的场景"},{key:"map",label:"使用地图"}];function Ws(o){return o==="map"?"搜索当前地图下的场景":o==="my"?"搜索我的场景":"搜索全部场景"}function Hs({open:o,source:r,categories:i,categoryKey:l,search:h,cards:y,executing:p,loadingPlaybookId:_,onClose:C,onSourceChange:T,onCategoryChange:Y,onSearchChange:z,onSelectScene:re}){const[S,q]=e.reactExports.useState(null),M=e.reactExports.useMemo(()=>S?Gt(S):null,[S]),N=e.reactExports.useCallback((u,D)=>{u.stopPropagation(),q(D)},[]);return e.jsxRuntimeExports.jsxs(Ht.Drawer,{open:o,onClose:C,placement:"bottom",height:"min(82vh, 780px)",destroyOnClose:!1,styles:{body:{padding:0,background:"var(--wc-bg)"},header:{display:"none"}},getContainer:!1,title:null,closeIcon:null,push:!1,children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-chat__drawer",children:[e.jsxRuntimeExports.jsxs("header",{className:"wandox-console-chat__drawer-top",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chat__drawer-title",children:e.jsxRuntimeExports.jsx("nav",{className:"wandox-console-chat__drawer-tabs","aria-label":"场景来源",children:qs.map(u=>e.jsxRuntimeExports.jsx("button",{type:"button",className:r===u.key?"is-active":"",onClick:()=>T(u.key),children:u.label},u.key))})}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-console-chat__drawer-close",onClick:C,"aria-label":"关闭",children:e.jsxRuntimeExports.jsx(e.RefIcon,{})})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-chat__drawer-middle",children:[r!=="my"&&e.jsxRuntimeExports.jsxs("aside",{className:"wandox-console-chat__drawer-cats",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chat__drawer-catslabel",children:"场景分类"}),i.map(u=>{const D=u.key===l;return e.jsxRuntimeExports.jsxs("button",{type:"button",className:`wandox-console-chat__drawer-cat${D?" wandox-console-chat__drawer-cat--active":""}`,onClick:()=>Y(u.key),children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-console-chat__drawer-cat-name",children:u.name}),e.jsxRuntimeExports.jsx("span",{className:"wandox-console-chat__drawer-cat-count",children:u.count})]},u.key)})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-chat__drawer-body",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chat__drawer-toolbar",children:e.jsxRuntimeExports.jsx(e.Input,{allowClear:!0,prefix:e.jsxRuntimeExports.jsx(e.RefIcon$1,{}),placeholder:Ws(r),value:h,onChange:u=>z(u.target.value)})}),y.length===0?e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chat__drawer-empty",children:h?"没有匹配的场景":"暂无可用场景"}):e.jsxRuntimeExports.jsx("div",{className:"wandox-console-scenes",children:y.map(u=>{const D=_===u.playbook_id;return e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-scene-wrap",children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-console-scene",disabled:p||!!_,"aria-busy":D,onClick:()=>void re(u),children:e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-scene__body",children:[e.jsxRuntimeExports.jsx("strong",{title:u.title,children:u.title}),u.desc&&e.jsxRuntimeExports.jsx("span",{className:"wandox-console-scene__desc",title:u.desc,children:u.desc}),D&&e.jsxRuntimeExports.jsx("span",{className:"wandox-console-scene__loading",children:"正在读取场景..."})]})}),u.video_url&&e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-console-scene__video","aria-label":`播放${u.title}演示视频`,onClick:ce=>N(ce,u),children:["▶ ",Kt(u.video_duration)," 演示"]})]},u.key)})})]})]})]}),e.jsxRuntimeExports.jsx(e.PlaybookVideoModal,{playbook:M,onClose:()=>q(null)})]})}const Us=o=>{const{onError:r}=o;r==null||r(new Error("该场景暂不支持文件上传"))};function Yt({field:o,value:r,uploading:i,fileNameMap:l,getOptionState:h,onChange:y,onUpload:p}){const _=j.isMultiValueType(o.type),C=j.getFieldControlType(o)==="file",T=p??((Y,z)=>Us);return e.jsxRuntimeExports.jsxs("div",{className:`wandox-console-field${C?" wandox-console-field--file":""}`,children:[e.jsxRuntimeExports.jsxs("label",{htmlFor:`wc-param-${o.name}`,children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-console-field__label-text",children:o.label||o.name}),o.description||o.hint?e.jsxRuntimeExports.jsx(e.Tooltip,{title:o.description||o.hint,children:e.jsxRuntimeExports.jsx(e.RefIcon$2,{"aria-label":`${o.label||o.name}说明`})}):null,o.required&&e.jsxRuntimeExports.jsx("span",{className:"wandox-console-field__required",children:"必填"}),_&&e.jsxRuntimeExports.jsx("span",{className:"wandox-console-field__required",children:"多值"})]}),e.jsxRuntimeExports.jsx(j.AgentInputFieldControl,{field:o,value:r,uploading:i,fileNameMap:l,getOptionState:h,onChange:y,onUpload:T,onDownloadTemplate:Y=>window.open(Y.path,"_blank","noopener,noreferrer")})]})}function Gs(o){const r=Array.isArray(o.actions)?o.actions:[],i=o.ui_payload,l=Array.isArray(i==null?void 0:i.actions)?i.actions:[];return[...r,...l].map(y=>{const p=y??{};return{label:p.display_name||p.label||"执行",action_id:p.action_id,playbook_id:p.playbook_id,display_name:p.display_name,display_icon:p.display_icon??void 0,params:p.params,params_fields_map:p.params_fields_map,type:p.type,url:p.url,style:p.style,status:p.action_status||p.status||void 0,sort_order:p.sort_order,executed_job_id:p.executed_job_id,supports_batch:p.supports_batch===!0,batch_max_items:p.batch_max_items,batch_id:p.batch_id,outputs:p.outputs}})}function Ks(o){if(Array.isArray(o))return o;const r=o;return Array.isArray(r==null?void 0:r.user_playbooks)?r.user_playbooks:[]}function Ys({agentId:o,agentName:r,playbookId:i,playbookParams:l,initialMessage:h,initialAttachments:y,useMapCards:p=[],useMapCategories:_=[],playbooks:C=[],userPlaybooks:T=[],agents:Y=[],onChangeAgent:z,onBack:re,onSelectScene:S,onReady:q}){const M=localStorage.getItem("sso_token")||"",N=localStorage.getItem("sso_domain")||"maiduo",u=localStorage.getItem("sso_company")||"",D=e.reactExports.useRef(null),ce=e.reactExports.useRef(!1),[F,$]=e.reactExports.useState(!1),[W,oe]=e.reactExports.useState(""),[ne,H]=e.reactExports.useState(""),[O,U]=e.reactExports.useState("map"),[Q,ie]=e.reactExports.useState(dt),[I,V]=e.reactExports.useState(null),ye=e.reactExports.useRef(null),pe=e.reactExports.useRef(null),[le,Re]=e.reactExports.useState(!1),[me,Ne]=e.reactExports.useState([]),[Ce,ge]=e.reactExports.useState("");e.reactExports.useEffect(()=>{if(!I||F)return;const t=setTimeout(()=>{var s;(s=ye.current)==null||s.focus()},120);return()=>clearTimeout(t)},[I,F]),e.reactExports.useEffect(()=>{if(!I||F)return;const t=s=>{const a=pe.current,c=s.target;!a||!(c instanceof Node)||a.contains(c)||c instanceof Element&&c.closest(".ant-select-dropdown, .ant-picker-dropdown, .ant-tooltip, .ant-dropdown, .ant-popover, .ant-modal-wrap, .ant-drawer-content-wrapper, .ant-message, .ant-notification")||(V(null),G([]),J({}))};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[I,F]);const[Z,G]=e.reactExports.useState([]),[K,J]=e.reactExports.useState({}),ee=e.useDynamicFieldOptions(Z,K,J),he=e.reactExports.useMemo(()=>j.getVisibleInputFields(Z,K).filter(t=>t.required&&j.isMissingFieldValue(K[t.name])),[Z,K]),[X,m]=e.reactExports.useState("chat"),[E,ae]=e.reactExports.useState([]),[b,ve]=e.reactExports.useState(null),[xe,Se]=e.reactExports.useState("results"),[et,Be]=e.reactExports.useState(!1),[je,Ae]=e.reactExports.useState([]),[tt,ze]=e.reactExports.useState(!1),[Me,Ie]=e.reactExports.useState([]),[te,n]=e.reactExports.useState([]),[f,k]=e.reactExports.useState({}),[g,R]=e.reactExports.useState(!1),[L,we]=e.reactExports.useState(null),[B,A]=e.reactExports.useState(void 0),[_e,$e]=e.reactExports.useState(!1),[de,qe]=e.reactExports.useState(!1);e.reactExports.useEffect(()=>{q==null||q({showInspectionResults:t=>{m("robot"),Se("results"),ve(t||null)}})},[q]);const[Pe,Qt]=e.reactExports.useState([]),[Le,ke]=e.reactExports.useState(!1),[We,Zt]=e.reactExports.useState(void 0),[Et,bt]=e.reactExports.useState([]),[st,ft]=e.reactExports.useState(""),[ot,Xt]=e.reactExports.useState("map"),[Jt,Te]=e.reactExports.useState(void 0),He=e.reactExports.useRef(0),De=e.reactExports.useRef(0),[Ue,Rt]=e.reactExports.useState(e.EMPTY_SCHEDULE_DIALOG),[nt,wt]=e.reactExports.useState({}),[Ge,yt]=e.reactExports.useState(()=>new Set),at=e.reactExports.useCallback((t,s,a)=>({key:`${s}-${t.playbook_id}`,title:t.name||"未命名场景",desc:t.description||"",reason:a,tags:[],playbook_id:t.playbook_id,input_fields:t.input_fields||[],categoryKey:s,video_url:t.video_url,video_duration:t.video_duration,view_count:t.view_count}),[]),Fe=e.reactExports.useMemo(()=>{const t=T.map(d=>at(d,Bt,"我的场景")),s=new Map;for(const d of C){const v=d.category_name||d.category||d.type||"默认场景",w=`${zs}${v}`,fe=s.get(w)||[];fe.push(at(d,w,v)),s.set(w,fe)}const a=Array.from(s.values()).flat(),c=[{key:ut,name:"全部场景",count:a.length,cards:a},...Array.from(s,([d,v])=>{var w;return{key:d,name:((w=v[0])==null?void 0:w.reason)||"默认场景",count:v.length,cards:v}})],x=[{key:dt,name:"全部场景",count:p.length,cards:p},..._.map(d=>({key:d.key,name:d.name,count:d.count,cards:p.filter(v=>v.categoryKey===d.key)}))];return{allCategories:c,mapCategories:x,myCards:t}},[r,C,at,p,_,T]),rt=e.reactExports.useMemo(()=>O==="all"?Fe.allCategories:O==="map"?Fe.mapCategories:[],[Fe,O]),Ke=e.reactExports.useMemo(()=>p.map(t=>({category:null,category_name:t.reason,description:t.desc,domain:"",id:0,name:t.title,playbook_id:t.playbook_id,scope:"usemap",status:"available",sub_category:null,tags:t.tags.map(s=>s.name),input_fields:t.input_fields,video_url:t.video_url,video_duration:t.video_duration,view_count:t.view_count,type:"",version:""})),[p]),es=e.reactExports.useMemo(()=>{const t=new Map;for(const s of[...C,...T,...Ke])s.playbook_id&&t.set(s.playbook_id,s);return Array.from(t.values())},[C,T,Ke]),ts=e.reactExports.useMemo(()=>{const t=new Map;for(const s of C){const a=s.category_name||s.category||s.type||"默认场景",c=t.get(a)||[];c.push(s),t.set(a,c)}return[{key:"__my__",label:"我的场景",playbooks:[]},...Array.from(t,([s,a])=>({key:`all:${s}`,label:s,playbooks:a}))]},[C]),ss=e.reactExports.useMemo(()=>{const t=new Map(Ke.map(s=>[s.playbook_id,s]));return _.map(s=>({key:`map:${s.key}`,label:s.name,playbooks:p.filter(a=>a.categoryKey===s.key).map(a=>t.get(a.playbook_id)).filter(a=>!!a)}))},[p,_,Ke]),os=ot==="map"?ss:ts,ns=e.reactExports.useMemo(()=>{var a;const t=ne.trim().toLowerCase(),s=O==="my"?Fe.myCards:((a=rt.find(c=>c.key===Q))==null?void 0:a.cards)||[];return t?s.filter(c=>c.title.toLowerCase().includes(t)||c.desc.toLowerCase().includes(t)):s},[rt,Q,Fe.myCards,O,ne]),as=e.reactExports.useCallback(t=>{const s=Array.isArray(t)?t:[];Qt(s),ke(s.length>0)},[]),ue=e.reactExports.useMemo(()=>Y.find(t=>t.id===o),[Y,o]),{messageData:rs,executing:P,stopping:cs,actions:is}=j.useWorkbenchSession({activeAgent:o,ssoToken:M,ssoDomain:N,ssoCompany:u,onRecommendationsUpdate:as}),{sendMessage:Ye,executePlaybook:gt,respondToProposal:vt,stopCurrent:ls,retrigger:kt}=is,{messages:Ee,messagesTotal:Nt,loading:Ct,loadMessages:St,loadMoreMessages:It}=rs,Qe=e.reactExports.useMemo(()=>{for(let t=Ee.length-1;t>=0;t--)if(Ee[t].role==="assistant")return Ee[t].id},[Ee]),Ze=e.reactExports.useCallback(async()=>{if(!o||!M){bt([]);return}try{const t=await e.GET_Api_V1_Playbooks_RecentExecuted({agent_id:o,limit:8});bt(Array.isArray(t.data)?t.data:[])}catch{}},[o,M]);e.reactExports.useEffect(()=>{Ze()},[Ze]);const se=e.reactExports.useCallback(async t=>{await gt(t),Ze()},[gt,Ze]),$t=e.reactExports.useCallback(async t=>{const s=String(t.playbook_id||"").trim();if(!s)throw new Error("场景缺少 playbook_id");const{data:a}=await e.GET_Api_V1_Playbooks_Detail({playbook_id:s});return e.mergePlaybookDetail(t,a)},[]);e.reactExports.useEffect(()=>{ce.current||(ce.current=!0,(async()=>{if(await St(),i){const t=(h==null?void 0:h.trim())||"执行场景";se({message:t,playbook_id:i,playbook_params:l||{}})}else h!=null&&h.trim()&&Ye(h.trim(),void 0,y)})())},[i,h,y,l,se,St,Ye]),e.reactExports.useEffect(()=>{if(!o)return;let t=!1;return(async()=>{try{const{data:s}=await e.GET_Api_V1_Agents_Detail({agent_id:o});if(t)return;const a=(s==null?void 0:s.children)||[];ae(a),ve(null)}catch{ae([])}})(),()=>{t=!0}},[o]),e.reactExports.useEffect(()=>{Qe&&Qe!==We&&Zt(Qe)},[Qe,We]),e.reactExports.useEffect(()=>{if(X!=="robot"||xe!=="history"||!b){Ae([]);return}const t=E.find(a=>a.name===b);if(!t)return;let s=!1;return Be(!0),(async()=>{try{const a=await e.GET_Api_V1_Agents_ActionExecutes({agent_id:t.agent_id,limit:50});if(s)return;const x=(Array.isArray(a==null?void 0:a.data)?a.data:[]).map((d,v)=>({id:d.id||d.execute_id||`record_${v}`,action_name:d.action_name||d.display_name||"未知动作",status:d.status||"pending",created_at:d.created_at||"",completed_at:d.completed_at,output_data:d.output_data,error:d.error}));Ae(x)}catch{Ae([])}finally{s||Be(!1)}})(),()=>{s=!0}},[X,xe,b,E]);const At=e.reactExports.useCallback(async()=>{try{const t=await e.GET_Api_V1_Notification_Webhooks({});Array.isArray(t==null?void 0:t.data)&&n(t.data.map(s=>({webhook_id:s.webhook_id||"",name:s.name||"未命名渠道",platform:s.platform||""})))}catch{}},[]),Xe=e.reactExports.useCallback(async()=>{try{const t={};await Promise.all(E.map(async s=>{var a;try{const c=await e.GET_Api_V1_Notification_Agents_Webhook_ByAgentId(s.agent_id,{}),x=(a=c==null?void 0:c.data)==null?void 0:a.webhook_id;x&&(t[s.agent_id]=x)}catch{}})),k(t)}catch{}},[E]),Mt=e.reactExports.useCallback(async()=>{if(o){ze(!0);try{const t=await e.GET_Api_V1_Agents_Workspaces({agent_id:o,limit:20,use_cache:!1}),a=(Array.isArray(t==null?void 0:t.data)?t.data:[]).map(c=>{const x=c.ui_payload||c.outputs||void 0;return{id:c.inbox_id||c.id||"",title:c.title||"巡检结果",summary:c.summary||"",priority:c.priority||"medium",timestamp:c.created_at||"",ui_payload:x,agent_name:c.agent_name||c.agent_id||"",actions:Gs(c)}}).sort((c,x)=>new Date(x.timestamp||0).getTime()-new Date(c.timestamp||0).getTime());Ie(a)}catch{Ie([])}finally{ze(!1)}}},[o]);e.reactExports.useEffect(()=>{At(),E.length>0&&Xe()},[E,At,Xe]),e.reactExports.useEffect(()=>{X==="robot"&&xe==="results"&&Mt()},[X,xe,Mt]);const xs=t=>{we(t),A(f[t.agent_id]),R(!0)},ds=async()=>{if(!L||!B){e.staticMethods.warning("请选择通知渠道");return}try{$e(!0),await e.POST_Api_V1_Notification_Agents_Webhook({},{agent_id:L.agent_id,webhook_id:B}),e.staticMethods.success("绑定成功"),R(!1),await Xe()}catch(t){e.staticMethods.error((t==null?void 0:t.message)||"绑定失败")}finally{$e(!1)}},us=async()=>{if(L)try{$e(!0),await e.DELETE_Api_V1_Notification_Agents_Webhook_Delete_ByAgentId(L.agent_id,{}),e.staticMethods.success("解绑成功"),R(!1),A(void 0),await Xe()}catch(t){e.staticMethods.error((t==null?void 0:t.message)||"解绑失败")}finally{$e(!1)}},ct=e.reactExports.useMemo(()=>b?Me.filter(t=>{var c;const s=(c=t.title)==null?void 0:c.match(/^(.+?)\s*巡检结果$/);return(s?s[1]:t.agent_name)===b}):Me,[Me,b]),ps=t=>{if(!t)return"";try{return new Date(t).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}catch{return t}},it=e.reactExports.useCallback((t,s,a)=>{if(ke(!1),s){se({message:t,playbook_id:s});return}Ye(t,void 0,a)},[se,Ye]),ms=e.reactExports.useCallback(t=>{U(t),ie(t==="all"?ut:t==="map"?dt:Bt),H(""),V(null),G([]),J({})},[]),hs=e.reactExports.useCallback(()=>{U("all"),ie(ut),H(""),V(null),G([]),J({}),$(!0)},[]),js=e.reactExports.useCallback(()=>{$(!1),V(null),G([]),J({})},[]),be=e.reactExports.useCallback((t,s={})=>{V({key:t.playbook_id,playbook_id:t.playbook_id,title:t.name,desc:t.description??"",reason:"",tags:[],categoryKey:"",input_fields:t.input_fields||[]});const a=e.normalizeAgentInputFields(t.input_fields||[]);G(a),J(j.buildDefaultInputValues(a,s))},[]),_s=e.reactExports.useCallback(async t=>{var a;if(P||W)return;const s=String(t.playbook_id||"").trim();if(!s){e.staticMethods.error("场景缺少 playbook_id");return}oe(s);try{const c={category:null,category_name:t.reason||void 0,description:t.desc,domain:"",id:0,name:t.title,playbook_id:s,scope:"",status:"available",sub_category:null,tags:t.tags.map(v=>v.name),type:"",version:"",input_fields:t.input_fields,video_url:t.video_url,video_duration:t.video_duration,view_count:t.view_count},{data:x}=await e.GET_Api_V1_Playbooks_Detail({playbook_id:s});if(!x||typeof x!="object"||Array.isArray(x))throw new Error("场景详情为空");const d=e.mergePlaybookDetail(c,x);if($(!1),(a=d.input_fields)!=null&&a.length){be(d);return}it(d.name,d.playbook_id),S==null||S(t)}catch(c){const x=c instanceof Error?c.message:"场景加载失败";e.staticMethods.error(x)}finally{oe("")}},[P,be,it,S,W]),Pt=e.reactExports.useCallback(async t=>{if(!P){if(ke(!1),t.input_fields&&t.input_fields.length>0){be(t);return}try{await se({message:t.name,playbook_id:t.playbook_id})}catch(s){const a=s instanceof Error?s.message:"执行失败";e.staticMethods.error(a)}}},[P,se,be]),Es=e.reactExports.useCallback(async t=>{var a;if(P||st)return;const s=String(t.playbook_id||"").trim();if(s){ft(s),ke(!1);try{const c=e.extractRecentPlaybookValues(t),x=await $t(t);if((a=x.input_fields)!=null&&a.length){be(x,c);return}await se({message:x.name,playbook_id:x.playbook_id})}catch(c){const x=c instanceof Error?c.message:"场景参数加载失败";e.staticMethods.error(x)}finally{ft("")}}},[P,se,be,$t,st]),bs=e.reactExports.useCallback(async()=>{if(!I||P)return;const s=j.getVisibleInputFields(Z,K).filter(x=>x.required&&j.isMissingFieldValue(K[x.name]));if(s.length>0){e.staticMethods.warning(`请先填写 ${s.length} 项必填参数`);return}$(!1),ke(!1);const a=I,c=K;V(null),G([]),J({});try{const x=a.title||(h==null?void 0:h.trim())||"执行场景";await se({message:x,playbook_id:a.playbook_id,playbook_params:c}),S==null||S(a)}catch(x){const d=x instanceof Error?x.message:"执行失败";e.staticMethods.error(d)}},[I,Z,K,P,se,h,S]),fs=e.reactExports.useCallback(t=>{De.current+=1,Te({requestId:++He.current,playbooks:t})},[]),Rs=e.reactExports.useCallback(()=>{const t=++De.current;Te({requestId:++He.current,playbooks:[],loading:!0}),(async()=>{await new Promise(s=>{window.requestAnimationFrame(()=>s())});try{const{data:s}=await e.GET_Api_V1_Agents_UserPlaybooks({agent_id:o});if(t!==De.current)return;Te({requestId:++He.current,playbooks:Ks(s)})}catch{if(t!==De.current)return;e.staticMethods.error("我的场景加载失败"),Te({requestId:++He.current,playbooks:[]})}})()},[o]),ws=e.reactExports.useCallback(t=>{Te(s=>(s==null?void 0:s.requestId)===t?void 0:s)},[]),ys=e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-chat__scene-quick",children:[e.jsxRuntimeExports.jsx(e.Dropdown,{menu:{selectedKeys:[ot],items:[{key:"all",label:"全部场景"},{key:"map",label:"使用地图"}],onClick:({key:t})=>{De.current+=1,Xt(t)}},trigger:["click"],placement:"topLeft",children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-console-chat__scene-source",disabled:P,children:[e.jsxRuntimeExports.jsx("span",{children:ot==="map"?"使用地图":"全部场景"}),e.jsxRuntimeExports.jsx("svg",{className:"wandox-console-chat__scene-source-arrow",width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",focusable:"false",children:e.jsxRuntimeExports.jsx("path",{d:"M8.413 0.963a2 2 0 0 1 2.738.712l4.872 8.301a4 4 0 0 1 0 4.049l-4.872 8.3a2 2 0 1 1-3.45-2.025L12.574 12 7.701 3.7A2 2 0 0 1 8.413.963Z"})})]})}),e.jsxRuntimeExports.jsx("span",{className:"wandox-console-chat__scene-separator","aria-hidden":!0,children:"|"}),e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chat__scene-categories",children:os.map(t=>e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-console-chat__choose-scene",disabled:P,onClick:()=>t.key==="__my__"?Rs():fs(t.playbooks),children:t.label},t.key))})]}),Lt=e.reactExports.useCallback(async t=>{var d;const s=(d=t.meta_content)!=null&&d.playbook_id?"数据报表":"对话内容",a=new Date().toISOString().slice(0,10);if(e.isTableMessage(t)){const v=e.getTableExportData(t);if(!v){e.staticMethods.warning("没有可导出的表格数据");return}const w=v.fields.map(xt=>xt.label).join(","),fe=v.rows.map(xt=>v.fields.map(Ns=>e.toCsvCell(xt[Ns.name])).join(",")),ks=`\uFEFF${[w,...fe].join(`
|
|
2
|
+
`)}`;e.downloadBlob(new Blob([ks],{type:"text/csv;charset=utf-8;"}),`${s}_${a}.csv`);return}const c=document.querySelector(`[data-message-id="${t.message_id||t.id}"] .wandox-message-content`);if(!c){e.staticMethods.warning("无法定位消息内容");return}const x=window.open("","_blank");if(!x){e.staticMethods.warning("请允许弹出窗口");return}x.document.write(`<!DOCTYPE html><html><head><meta charset="utf-8"><title>${s}_${a}</title><style>body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;padding:20px;color:#333}table{border-collapse:collapse;width:100%}th,td{border:1px solid #d9d9d9;padding:6px 8px;font-size:13px;text-align:left}th{background:#fafafa}img{max-width:100%}pre{white-space:pre-wrap;word-break:break-all;font-size:12px;background:#f5f5f5;padding:12px;border-radius:4px}button,.ant-btn,.ant-tooltip-open{display:none!important}</style></head><body>${c.innerHTML}</body></html>`),x.document.close(),x.onload=()=>{x.print(),x.close()}},[]),Tt=e.reactExports.useCallback(t=>{var x,d,v;const s=Ee.find(w=>w.message_id===t||w.id===t),a=e.getMessagePlaybookId(s);if(!a){e.staticMethods.warning("缺少场景 ID,无法配置定时触发");return}const c=((d=(x=s==null?void 0:s.actions)==null?void 0:x.find(w=>w.playbook_id===a))==null?void 0:d.display_name)||((v=s==null?void 0:s.meta_content)==null?void 0:v.playbook_name)||a;Rt({visible:!0,messageId:t,agentId:o,playbookId:a,playbookName:c})},[o,Ee]),gs=e.reactExports.useCallback(()=>{Rt(e.EMPTY_SCHEDULE_DIALOG)},[]),Je=e.reactExports.useCallback(t=>{const s=t.message_id;return s&&Object.prototype.hasOwnProperty.call(nt,s)?nt[s]:e.getMessageFeedbackRating(t)},[nt]),Dt=e.reactExports.useCallback(async(t,s,a)=>{var v;const c=t.message_id;if(!c||Ge.has(c))return!1;const x=Je(t),d=e.getNextMessageFeedbackRating(x,s);wt(w=>({...w,[c]:d})),yt(w=>new Set(w).add(c));try{const w=await e.POST_Api_V1_Agents_Messages_Feedback({domain:N},{message_id:c,rating:d,tags:(v=a==null?void 0:a.tags)!=null&&v.length?a.tags:void 0,text:(a==null?void 0:a.text)||void 0});if((w==null?void 0:w.success)===!1)throw new Error(w.message||"反馈提交失败");return!0}catch(w){return wt(fe=>({...fe,[c]:x})),e.staticMethods.error(w instanceof Error?w.message:"反馈提交失败,请稍后重试"),!1}finally{yt(w=>{const fe=new Set(w);return fe.delete(c),fe})}},[Ge,Je,N]),Ft=e.reactExports.useCallback(async t=>{ke(!1);try{await kt(t)}catch(s){const a=s instanceof Error?s.message:"重新生成失败";e.staticMethods.error(a)}},[kt]),Ot=e.reactExports.useCallback(()=>{ke(t=>!t)},[]),Vt=e.reactExports.useCallback((t,s)=>{if(t.role!=="assistant"||t.execution_status==="executing")return null;const c=s&&t.id===We&&Pe.length>0,x=Le?"隐藏推荐":c?`显示推荐(${Pe.length})`:"推荐";return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.MessageToolbar,{msg:t,domain:N,onExportMessage:Lt,exportIcon:"copy",showSolidify:!1,onOpenScheduleDialog:Tt,onRetrigger:Ft,feedbackRating:Je(t),feedbackPending:!!t.message_id&&Ge.has(t.message_id),onFeedback:Dt,extraActions:c?e.jsxRuntimeExports.jsx(e.Tooltip,{title:x,children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:`wandox-console-chat__toolbar-toggle${Le?" is-active":""}`,"aria-label":x,"aria-expanded":Le,onClick:Ot,children:[e.jsxRuntimeExports.jsx(Bs,{}),e.jsxRuntimeExports.jsx("span",{className:"wandox-console-chat__toolbar-toggle-count",children:Pe.length})]})}):null}),c&&Le&&e.jsxRuntimeExports.jsx("ul",{className:"wandox-console-chat__recommendations","aria-label":"推荐场景",children:Pe.map((d,v)=>e.jsxRuntimeExports.jsx("li",{className:"wandox-console-chat__recommendations-item",children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-console-chat__recommendations-pill",disabled:P,onClick:()=>{Pt(d)},title:d.description||d.name,children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-console-chat__recommendations-pill-label",children:d.name}),e.jsxRuntimeExports.jsx("span",{className:"wandox-console-chat__recommendations-pill-arrow",children:e.jsxRuntimeExports.jsx(j.RefIcon,{})})]})},`${d.playbook_id||d.name}-${v}`))})]})},[P,Ge,Je,Pt,Lt,Dt,Tt,Ft,Pe,We,Le,N,Ot]),lt=e.reactExports.useCallback((t,s)=>{ge(t),Ne(s),Re(!0)},[]),vs=e.reactExports.useMemo(()=>e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-chat__body",children:[e.jsxRuntimeExports.jsx(e.ChatMessageList,{messages:Ee,executing:P,ssoToken:M,ssoDomain:N,ssoCompany:u,onExecutePlaybook:se,onFillPlaybookParams:t=>be({category:null,domain:"",id:0,name:t.playbookName,playbook_id:t.playbookId,scope:"",status:"available",sub_category:null,tags:null,type:"",version:"",input_fields:t.inputFields,playbook_type:t.playbookType},t.initialParams??{}),onRespondToProposal:vt,containerRef:D,messagesTotal:Nt,loadMoreMessages:It,loading:Ct,initialLoadingContent:e.jsxRuntimeExports.jsx(e.ChatHistoryLoading,{}),conversationKey:o,messageToolbar:Vt,onOpenActionDrawer:lt}),e.jsxRuntimeExports.jsx(e.ConversationOutline,{messages:Ee,scrollContainerRef:D,mode:"deepseek"})]}),[o,se,P,be,It,Ee,Ct,Nt,lt,Vt,vt,u,N,M]);return e.jsxRuntimeExports.jsxs("div",{className:"wandox-root wandox-console-chat",children:[e.jsxRuntimeExports.jsxs("header",{className:"wandox-console-chat__top",children:[e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-console-chat__back",onClick:re,children:[e.jsxRuntimeExports.jsx(j.RefIcon$1,{}),e.jsxRuntimeExports.jsx("span",{children:"返回"})]}),e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chat__agent-selector",children:e.jsxRuntimeExports.jsx(e.Dropdown,{menu:{items:Y.map(t=>({key:t.id,disabled:t.id===o,label:e.jsxRuntimeExports.jsxs("span",{className:"wandox-console-agent-menu-item",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-console-agent-menu-item__icon",children:t.icon}),e.jsxRuntimeExports.jsx("span",{className:"wandox-console-agent-menu-item__name",children:t.name}),t.id===o&&e.jsxRuntimeExports.jsx(e.RefIcon$4,{className:"wandox-console-agent-menu-item__check"})]})})),onClick:({key:t})=>z==null?void 0:z(t)},trigger:["click"],placement:"bottomLeft",children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-console-chat__title","aria-label":"切换智能体",title:"切换智能体",children:[(ue==null?void 0:ue.icon)&&e.jsxRuntimeExports.jsx("span",{className:"wandox-console-chat__title-icon",children:ue.icon}),e.jsxRuntimeExports.jsx("span",{className:"wandox-console-chat__title-name",children:r||(ue==null?void 0:ue.name)||"智能体"}),e.jsxRuntimeExports.jsx(e.RefIcon$3,{className:"wandox-console-chat__title-arrow"})]})})}),e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-console-chat__all-scenes",disabled:P,onClick:hs,children:[e.jsxRuntimeExports.jsx(Is,{}),e.jsxRuntimeExports.jsx("span",{children:"全部场景"})]}),e.jsxRuntimeExports.jsx(j.AgentPackageTag,{benefit:ue==null?void 0:ue.packageBenefit})]}),e.jsxRuntimeExports.jsxs("nav",{className:"wandox-console-chat__topbar",children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:`wandox-console-chat__topbar-tab ${X==="chat"?"active":""}`,onClick:()=>m("chat"),children:"智能体会话"}),e.jsxRuntimeExports.jsx("button",{type:"button",className:`wandox-console-chat__topbar-tab ${X==="robot"?"active":""}`,onClick:()=>{m("robot"),ve(null)},children:e.jsxRuntimeExports.jsx("span",{children:"巡检机器人"})})]}),X==="chat"?vs:e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-chat__robot",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chat__robot-chips",children:E.length===0?e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chat__robot-empty",children:"该智能体暂无巡检机器人"}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[E.length>0&&e.jsxRuntimeExports.jsx("button",{type:"button",className:`wandox-console-chat__robot-chip ${b===null?"active":""}`,onClick:()=>ve(null),children:"全部"}),E.map(t=>{const s=!!f[t.agent_id];return e.jsxRuntimeExports.jsxs("div",{className:`wandox-console-chat__robot-chip-compound ${b===t.name?"active":""}`,children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-console-chat__robot-chip-name",onClick:()=>ve(t.name),children:t.name}),e.jsxRuntimeExports.jsx("button",{type:"button",className:`wandox-console-chat__robot-chip-bind ${s?"bound":""}`,onClick:()=>xs(t),title:s?"已绑定通知渠道,点击修改":"绑定通知渠道",children:s?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-console-chat__robot-chip-bind-dot","aria-hidden":"true"}),e.jsxRuntimeExports.jsx("span",{children:"已通知"})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(j.RefIcon$2,{}),e.jsxRuntimeExports.jsx("span",{children:"通知"})]})})]},t.agent_id)})]})}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-chat__robot-tabs",children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:`wandox-console-chat__robot-tab ${xe==="results"?"active":""}`,onClick:()=>Se("results"),children:"巡检结果"}),e.jsxRuntimeExports.jsxs("button",{type:"button",className:`wandox-console-chat__robot-tab ${xe==="history"?"active":""}`,onClick:()=>Se("history"),children:["执行记录",xe==="history"&&b&&je.length>0&&e.jsxRuntimeExports.jsx("span",{className:"wandox-console-chat__robot-tab-badge",children:je.length})]})]}),e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chat__robot-content",children:xe==="results"?tt?e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-chat__robot-loading",children:[e.jsxRuntimeExports.jsx(e.Spin,{size:"small"}),e.jsxRuntimeExports.jsx("span",{children:"加载中..."})]}):ct.length===0?e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-chat__robot-empty",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chat__robot-empty-icon",children:e.jsxRuntimeExports.jsx(j.RefIcon$3,{})}),e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chat__robot-empty-title",children:b?`${b} 暂无巡检结果`:"暂无巡检结果"}),e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chat__robot-empty-desc",children:"巡检结果会在机器人执行后展示在这里"})]}):e.jsxRuntimeExports.jsx("ul",{className:"wandox-console-chat__robot-timeline",children:ct.map((t,s)=>{const a={high:"#ff4d4f",medium:"#faad14",low:"#52c41a"},c=s===ct.length-1;return e.jsxRuntimeExports.jsxs("li",{className:"wandox-console-chat__robot-timeline-item",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-chat__robot-timeline-axis",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-console-chat__robot-timeline-time",children:ps(t.timestamp)}),e.jsxRuntimeExports.jsx("span",{className:"wandox-console-chat__robot-timeline-dot",style:{background:a[t.priority]}}),!c&&e.jsxRuntimeExports.jsx("span",{className:"wandox-console-chat__robot-timeline-line"})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-chat__robot-timeline-card",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chat__robot-timeline-title",children:t.title}),t.summary&&e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chat__robot-timeline-summary",children:t.summary}),t.ui_payload&&e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chat__robot-timeline-content wandox-markdown-content",children:e.jsxRuntimeExports.jsx(e.PayloadRenderer,{payload:t.ui_payload})}),t.actions&&t.actions.length>0&&e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chat__robot-timeline-actions",children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-console-chat__robot-timeline-action-btn",onClick:()=>lt(t.title,t.actions??[]),children:[e.jsxRuntimeExports.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img",children:[e.jsxRuntimeExports.jsx("title",{children:"快速执行"}),e.jsxRuntimeExports.jsx("path",{d:"M13 2L3 14H12L11 22L21 10H12L13 2Z",fill:"currentColor"})]}),e.jsxRuntimeExports.jsxs("span",{children:["快速执行 (",t.actions.length,")"]})]})})]})]},t.id||`result_${s}`)})}):b?et?e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-chat__robot-loading",children:[e.jsxRuntimeExports.jsx(e.Spin,{size:"small"}),e.jsxRuntimeExports.jsx("span",{children:"加载中..."})]}):je.length===0?e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chat__robot-empty",children:e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chat__robot-empty-title",children:"暂无执行记录"})}):e.jsxRuntimeExports.jsx("ul",{className:"wandox-console-chat__robot-history",children:je.map(t=>e.jsxRuntimeExports.jsxs("li",{className:`wandox-console-chat__robot-history-item wandox-console-chat__robot-history-item--${t.status}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-chat__robot-history-info",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-console-chat__robot-history-name",children:t.action_name}),e.jsxRuntimeExports.jsx("span",{className:"wandox-console-chat__robot-history-time",children:t.created_at?new Date(t.created_at).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):""})]}),e.jsxRuntimeExports.jsx("span",{className:`wandox-console-chat__robot-history-status wandox-console-chat__robot-history-status--${t.status}`,children:{pending:"等待中",running:"执行中",success:"成功",failed:"失败"}[t.status]||t.status})]},t.id))}):e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-chat__robot-empty",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chat__robot-empty-icon",children:e.jsxRuntimeExports.jsx(j.RefIcon$3,{})}),e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chat__robot-empty-title",children:"请先选择机器人"}),e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chat__robot-empty-desc",children:"在上方选择机器人以查看其执行记录"})]})})]}),X==="chat"&&Et.length>0&&!(I&&!F)&&e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chat__recent",children:e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chat__recent-bar",children:Et.map((t,s)=>e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-console-chat__recent-chip",disabled:P||!!st,title:t.description||t.name,onClick:()=>{Es(t)},children:t.name},`${t.playbook_id||t.name}-${s}`))})}),X==="chat"&&e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chat__input",children:I&&!F?e.jsxRuntimeExports.jsxs("div",{ref:pe,className:"wandox-console-input-playbook wandox-console-prompt",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-prompt__head",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-scenechoice",children:[e.jsxRuntimeExports.jsx("span",{children:"已选择场景"}),e.jsxRuntimeExports.jsx("strong",{children:I.title})]}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-console-changescene",onClick:()=>{V(null),G([]),J({})},children:"重新选择"})]}),e.jsxRuntimeExports.jsx("div",{ref:ye,tabIndex:-1,className:"wandox-console-taskarea wandox-console-taskarea--static",children:I.desc||I.title}),Z.length>0&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-paramarea",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-paramhead",children:[e.jsxRuntimeExports.jsx(Ut,{}),e.jsxRuntimeExports.jsx("strong",{children:"确认分析范围"}),e.jsxRuntimeExports.jsxs("span",{className:"wandox-console-paramhead__status",children:[e.jsxRuntimeExports.jsx(e.RefIcon$5,{})," ",he.length>0?`待填 ${he.length} 项必填参数`:"参数已就绪"]})]}),e.jsxRuntimeExports.jsx("div",{className:"wandox-console-params",children:j.getVisibleInputFields(Z,K).map(t=>e.jsxRuntimeExports.jsx(Yt,{field:t,value:K[t.name],uploading:!1,fileNameMap:{},getOptionState:ee.getFieldState,onChange:(s,a)=>J(c=>({...c,[s]:a}))},t.name))})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-prompt__foot",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-console-input-playbook__tip",children:"· 已继承当前上下文"}),e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-console-start",disabled:!I||P||he.length>0,onClick:bs,children:["开始执行",e.jsxRuntimeExports.jsx(j.RefIcon,{})]})]})]}):e.jsxRuntimeExports.jsx(e.ChatInput,{onSend:it,executing:P,stopping:cs,onStop:ls,placeholder:" / 快速搜索场景",ssoToken:M,ssoDomain:N,ssoCompany:u,leadingActions:ys,uploadButtonAsLeading:!0,uploadButtonLabel:"添加文件",mentionTriggerChar:"/",mentionListRequest:Jt,onMentionListRequestHandled:ws,autoFocusInput:!I,playbooks:es,onRequestPlaybookParams:be})}),e.jsxRuntimeExports.jsx(Hs,{open:F,source:O,categories:rt,categoryKey:Q,search:ne,cards:ns,executing:P,loadingPlaybookId:W,onClose:js,onSourceChange:ms,onCategoryChange:ie,onSearchChange:H,onSelectScene:_s}),e.jsxRuntimeExports.jsx(e.NotificationScheduleModal,{open:Ue.visible,agentId:Ue.agentId,playbookId:Ue.playbookId,playbookName:Ue.playbookName,onClose:gs}),M&&N&&u&&e.jsxRuntimeExports.jsx(e.ActionDetailDrawer,{open:le,title:Ce,actions:me,ssoToken:M,ssoDomain:N,ssoCompany:u,onClose:()=>Re(!1)}),e.jsxRuntimeExports.jsx(e.Modal,{title:"配置通知渠道",open:g,onCancel:()=>{R(!1),we(null),A(void 0)},width:520,centered:!0,footer:[f[(L==null?void 0:L.agent_id)||""]?e.jsxRuntimeExports.jsx(e.Button,{danger:!0,loading:_e,style:{marginRight:"auto"},onClick:us,children:"解除绑定"},"unbind"):null,e.jsxRuntimeExports.jsx(e.Button,{disabled:_e,onClick:()=>{R(!1),we(null),A(void 0)},children:"取消"},"cancel"),e.jsxRuntimeExports.jsx(e.Button,{type:"primary",loading:_e,disabled:!B,onClick:ds,children:"保存"},"ok")],children:e.jsxRuntimeExports.jsxs("div",{style:{padding:"8px 0"},children:[e.jsxRuntimeExports.jsxs("div",{style:{marginBottom:16,padding:"12px 16px",background:"#f5f7fa",borderRadius:8,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxRuntimeExports.jsx("div",{style:{fontSize:13,color:"#666"},children:"巡检机器人"}),e.jsxRuntimeExports.jsx("div",{style:{fontSize:15,color:"#1a1a1a",fontWeight:500},children:L==null?void 0:L.name})]}),e.jsxRuntimeExports.jsx("div",{style:{marginBottom:8,fontSize:14,color:"#333",fontWeight:500},children:"选择通知渠道"}),e.jsxRuntimeExports.jsx(e.Select,{style:{width:"100%"},placeholder:"请选择通知渠道",value:B,onChange:A,disabled:_e,options:te.map(t=>({label:`${t.name}(${t.platform==="dingtalk"?"钉钉":t.platform==="feishu"?"飞书":"企业微信"})`,value:t.webhook_id})),popupRender:t=>e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[t,e.jsxRuntimeExports.jsx(Ht.Divider,{style:{margin:"8px 0"}}),e.jsxRuntimeExports.jsx(e.Space,{style:{padding:"0 8px 4px"},children:e.jsxRuntimeExports.jsx(e.Button,{type:"text",icon:e.jsxRuntimeExports.jsx("span",{children:"+"}),onClick:()=>qe(!0),children:"添加新的通知渠道"})})]})}),te.length===0&&e.jsxRuntimeExports.jsx("div",{style:{marginTop:8,padding:"8px 12px",background:"#fff7e6",border:"1px solid #ffd591",borderRadius:4,fontSize:13,color:"#d46b08"},children:"暂无可用的通知渠道,请先在「通知配置」中创建"})]})}),e.jsxRuntimeExports.jsx(j.QuickAddWebhook,{open:de,onClose:()=>qe(!1),onSuccess:t=>{n(s=>[...s,t]),A(t.webhook_id)}})]})}const{TextArea:Qs}=e.Input,Oe=5;function Zs({useMapCards:o,useMapCategories:r,playbooks:i=[],selectedCategoryKey:l,onCategorySelect:h,loading:y,useMapError:p,onRetry:_,onStartAnalysis:C,agents:T,selectedAgentId:Y,onAgentSelect:z,onOpenAgentChat:re}){const[S,q]=e.reactExports.useState(""),[M,N]=e.reactExports.useState(""),[u,D]=e.reactExports.useState(null),ce=e.reactExports.useRef(null),[F,$]=e.reactExports.useState([]),[W,oe]=e.reactExports.useState(!1),[ne,H]=e.reactExports.useState(""),O=e.reactExports.useRef(0),[U,Q]=e.reactExports.useState({}),[ie,I]=e.reactExports.useState({}),[V,ye]=e.reactExports.useState({}),[pe,le]=e.reactExports.useState([]),[Re,me]=e.reactExports.useState(!1),Ne=e.reactExports.useRef(null),[Ce,ge]=e.reactExports.useState(0),Z=Math.max(1,Math.ceil(r.length/Oe)),G=Math.min(Ce,Z-1),K=r.length>Oe,J=e.reactExports.useMemo(()=>r.slice(G*Oe,G*Oe+Oe),[r,G]);e.reactExports.useEffect(()=>{ge(0)},[Y]);const ee=e.reactExports.useMemo(()=>o.length>0?o:j.buildDefaultSceneCards(i),[o,i]),he=e.reactExports.useMemo(()=>l?ee.filter(n=>n.categoryKey===l):ee,[ee,l]),X=e.reactExports.useMemo(()=>{const n=M.trim().toLowerCase();return n?he.filter(f=>f.title.toLowerCase().includes(n)||f.desc.toLowerCase().includes(n)):he},[he,M]),m=y||p&&ee.length===0||X.length>0,[E,ae]=e.reactExports.useState("");e.reactExports.useEffect(()=>{O.current+=1,ae(""),q(""),$([]),Q({}),oe(!1),H("")},[l]),e.reactExports.useEffect(()=>{E&&!ee.some(n=>n.playbook_id===E)&&(O.current+=1,ae(""),q(""),$([]),Q({}),oe(!1),H(""))},[E,ee]);const b=e.reactExports.useMemo(()=>ee.find(n=>n.playbook_id===E)??null,[ee,E]),ve=e.reactExports.useMemo(()=>u?Gt(u):null,[u]),xe=e.reactExports.useCallback((n,f)=>{n.stopPropagation(),D(f)},[]);e.reactExports.useEffect(()=>{if(y||b)return;const n=window.setTimeout(()=>{var k,g;const f=(g=(k=ce.current)==null?void 0:k.resizableTextArea)==null?void 0:g.textArea;f==null||f.focus()},0);return()=>window.clearTimeout(n)},[y,b]);const Se=e.reactExports.useCallback(async n=>{const f=String(n.playbook_id||"").trim();if(!f){e.staticMethods.error("场景缺少 playbook_id");return}const k=++O.current;ae(f),$([]),Q({}),I({}),ye({}),oe(!0),H("");try{const{data:g}=await e.GET_Api_V1_Playbooks_Detail({playbook_id:f});if(k!==O.current)return;if(!g||typeof g!="object"||Array.isArray(g))throw new Error("场景详情为空");const R=e.normalizeAgentInputFields(e.getPlaybookDetailFields(g));$(R),Q(j.buildDefaultInputValues(R))}catch(g){if(k!==O.current)return;const R=g instanceof Error?g.message:"场景参数加载失败";H(R),e.staticMethods.error("场景参数加载失败,请稍后重试")}finally{k===O.current&&oe(!1)}},[]),et=()=>{O.current+=1,ae(""),q(""),$([]),Q({}),oe(!1),H("")},Be=e.useDynamicFieldOptions(F,U,Q),je=e.reactExports.useMemo(()=>j.getVisibleInputFields(F,U),[F,U]),Ae=e.reactExports.useCallback((n,f)=>{Q(k=>({...k,[n]:f}))},[]),tt=e.reactExports.useCallback((n,f)=>async({file:k,onSuccess:g,onError:R})=>{var L,we;I(B=>({...B,[n]:!0}));try{const B=k,A=await e.POST_Api_V1_Oss_Upload2(B),_e=(L=A==null?void 0:A.data)==null?void 0:L.url,$e=((we=A==null?void 0:A.data)==null?void 0:we.name)||B.name;if(!_e)throw new Error("上传结果缺少文件地址");ye(de=>({...de,[_e]:$e})),Q(de=>{if(f<=1)return{...de,[n]:_e};const qe=Array.isArray(de[n])?de[n]:de[n]?[de[n]]:[];return{...de,[n]:[...qe,_e]}}),g==null||g(A),e.staticMethods.success("上传成功")}catch(B){const A=B instanceof Error?B:new Error("上传失败");R==null||R(A),e.staticMethods.error(A.message)}finally{I(B=>({...B,[n]:!1}))}},[]),ze=e.reactExports.useCallback(async n=>{const f=Array.from(n.target.files??[]);if(n.target.value="",f.length!==0){me(!0);try{const k=await Promise.all(f.map(async g=>{var B,A;const R=await e.POST_Api_V1_Oss_Upload2(g),L=(B=R==null?void 0:R.data)==null?void 0:B.url,we=((A=R==null?void 0:R.data)==null?void 0:A.name)||g.name;if(!L)throw new Error("上传结果缺少文件地址");return{type:g.type.startsWith("image/")?"image":"file",url:L,name:we,mime_type:g.type}}));le(g=>[...g,...k]),e.staticMethods.success(`已添加 ${k.length} 个附件`)}catch(k){e.staticMethods.error(k instanceof Error?k.message:"上传失败")}finally{me(!1)}}},[]),Me=e.reactExports.useCallback(n=>{le(f=>f.filter(k=>k.url!==n))},[]),Ie=e.reactExports.useMemo(()=>je.filter(n=>n.required&&j.isMissingFieldValue(U[n.name])),[je,U]),te=e.reactExports.useMemo(()=>T.find(n=>n.id===Y)??T.find(n=>n.current)??T[0],[T,Y]);return e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-view",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-homecenter",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-homecenter-hero",children:[te&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-home-header",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-home-header__agent",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-console-home-header__avatar",children:te.icon}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-home-header__identity",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-home-header__selector-row",children:[e.jsxRuntimeExports.jsx(e.Dropdown,{menu:{items:T.map(n=>({key:n.id,disabled:n.id===te.id,label:e.jsxRuntimeExports.jsxs("span",{className:"wandox-console-agent-menu-item",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-console-agent-menu-item__icon",children:n.icon}),e.jsxRuntimeExports.jsx("span",{className:"wandox-console-agent-menu-item__name",children:n.name}),n.id===te.id&&e.jsxRuntimeExports.jsx(e.RefIcon$5,{className:"wandox-console-agent-menu-item__check"})]})})),onClick:({key:n})=>z==null?void 0:z(n)},trigger:["click"],placement:"bottomLeft",children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-console-home-header__selector","aria-label":"切换智能体",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-console-home-header__name",children:te.name}),e.jsxRuntimeExports.jsx(e.RefIcon$3,{className:"wandox-console-home-header__arrow"})]})}),e.jsxRuntimeExports.jsx(j.AgentPackageTag,{benefit:te.packageBenefit})]}),te.desc&&e.jsxRuntimeExports.jsx("p",{className:"wandox-console-home-header__description",title:te.desc,children:te.desc})]})]}),e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-console-home-header__history",onClick:()=>re==null?void 0:re(),children:[e.jsxRuntimeExports.jsx("span",{children:"会话记录"}),e.jsxRuntimeExports.jsx(e.RefIcon$6,{className:"wandox-console-home-header__history-arrow"})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-prompt",children:[b&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-prompt__head",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-scenechoice",children:[e.jsxRuntimeExports.jsx("span",{children:"已选择场景"}),e.jsxRuntimeExports.jsx("strong",{children:b.title})]}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-console-changescene",onClick:et,children:"重新选择"})]}),b?e.jsxRuntimeExports.jsx("div",{className:"wandox-console-taskarea wandox-console-taskarea--static",children:b.desc||b.title}):e.jsxRuntimeExports.jsx("div",{className:"wandox-console-taskarea",children:e.jsxRuntimeExports.jsx(Qs,{ref:ce,value:S,onChange:n=>q(n.target.value),autoSize:{minRows:2},variant:"borderless",placeholder:"直接描述你的问题,或选择一个场景开始"})}),b&&W&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-paramarea wandox-console-paramarea--state",children:[e.jsxRuntimeExports.jsx(e.RecommendationLoader,{}),e.jsxRuntimeExports.jsx("span",{children:"正在读取场景参数..."})]}),b&&!W&&ne&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-paramarea wandox-console-paramarea--state",children:[e.jsxRuntimeExports.jsx("span",{children:"场景参数加载失败"}),e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-console-paramarea__retry",onClick:()=>void Se(b),children:[e.jsxRuntimeExports.jsx(e.RefIcon$7,{}),"重试"]})]}),b&&!W&&!ne&&je.length>0&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-paramarea",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-paramhead",children:[e.jsxRuntimeExports.jsx(Ut,{}),e.jsxRuntimeExports.jsx("strong",{children:"确认分析范围"}),e.jsxRuntimeExports.jsxs("span",{className:"wandox-console-paramhead__status",children:[e.jsxRuntimeExports.jsx(e.RefIcon$5,{})," ",Ie.length>0?`待填 ${Ie.length} 项必填参数`:"参数已就绪"]})]}),e.jsxRuntimeExports.jsx("div",{className:"wandox-console-params",children:je.map(n=>e.jsxRuntimeExports.jsx(Yt,{field:n,value:U[n.name],uploading:!!ie[n.name],fileNameMap:V,getOptionState:Be.getFieldState,onChange:Ae,onUpload:tt},n.name))})]}),e.jsxRuntimeExports.jsxs("div",{className:`wandox-console-prompt__foot${b?" wandox-console-prompt__foot--scene":""}`,children:[!b&&e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-console-attach",onClick:()=>{var n;return(n=Ne.current)==null?void 0:n.click()},disabled:Re,title:Re?"上传中…":"附件",children:e.jsxRuntimeExports.jsx(e.RefIcon$8,{})}),e.jsxRuntimeExports.jsx("input",{ref:Ne,type:"file",multiple:!0,accept:"image/*,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv,.zip",hidden:!0,onChange:ze}),b?e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-console-start",disabled:W||!!ne||Ie.length>0,onClick:()=>{C==null||C({playbookId:b.playbook_id,playbookParams:U,message:b.title,attachments:pe})},children:["开始执行",e.jsxRuntimeExports.jsx(j.RefIcon,{})]}):e.jsxRuntimeExports.jsx("div",{className:"wandox-console-prompt__foot-right",children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-console-prompt__send",disabled:!S.trim(),onClick:()=>{C==null||C({playbookParams:{},message:S.trim(),attachments:pe})},"aria-label":"发送",children:e.jsxRuntimeExports.jsx(e.RefIcon$9,{})})})]})]}),pe.length>0&&e.jsxRuntimeExports.jsx("div",{className:"wandox-console-attachments",children:pe.map(n=>e.jsxRuntimeExports.jsxs("span",{className:"wandox-console-attach-item",children:[n.type==="image"?e.jsxRuntimeExports.jsx("img",{src:n.url,alt:n.name,className:"wandox-console-attach-item__thumb"}):e.jsxRuntimeExports.jsx(e.RefIcon$10,{className:"wandox-console-attach-item__icon"}),e.jsxRuntimeExports.jsx("span",{className:"wandox-console-attach-item__name",title:n.name,children:n.name}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-console-attach-item__remove","aria-label":"移除附件",onClick:()=>Me(n.url),children:e.jsxRuntimeExports.jsx(e.RefIcon,{})})]},n.url))}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-scenehead",children:[K&&e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-console-chipnav","aria-label":"上一页分类",disabled:G===0,onClick:()=>ge(n=>Math.max(0,n-1)),children:e.jsxRuntimeExports.jsx(Ms,{})}),e.jsxRuntimeExports.jsx("div",{className:"wandox-console-chips",role:"tablist","aria-label":"场景分类",children:J.map(n=>e.jsxRuntimeExports.jsx("button",{type:"button",role:"tab","aria-selected":l===n.key,className:`wandox-console-chip${l===n.key?" wandox-console-chip--active":""}`,onClick:()=>h==null?void 0:h(n.key),children:e.jsxRuntimeExports.jsx("span",{children:n.name})},n.key))}),K&&e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-console-chipnav","aria-label":"下一页分类",disabled:G===Z-1,onClick:()=>ge(n=>Math.min(Z-1,n+1)),children:e.jsxRuntimeExports.jsx(Ts,{})}),e.jsxRuntimeExports.jsx("div",{className:"wandox-console-scenesearch",children:e.jsxRuntimeExports.jsx(e.Input,{allowClear:!0,prefix:e.jsxRuntimeExports.jsx(e.RefIcon$1,{}),placeholder:"搜索当前地图下的场景",value:M,onChange:n=>N(n.target.value)})})]})]}),m&&e.jsxRuntimeExports.jsxs("section",{className:"wandox-console-scene-section","aria-label":"个性化场景",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-console-scene-section__header",children:e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx("h2",{children:"为你推荐"})})}),y?e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-agents__loading",style:{justifyContent:"center",padding:"40px 0"},children:[e.jsxRuntimeExports.jsx(e.Spin,{size:"small"}),e.jsxRuntimeExports.jsx("span",{children:"正在加载场景..."})]}):p&&ee.length===0?e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-agents__error",style:{alignItems:"center",padding:"32px 0"},children:[e.jsxRuntimeExports.jsx("span",{children:p}),e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:_,children:[e.jsxRuntimeExports.jsx(e.RefIcon$7,{}),"重试"]})]}):X.length===0?e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-scene-section__empty",children:[e.jsxRuntimeExports.jsx(e.RefIcon$1,{}),e.jsxRuntimeExports.jsx("span",{children:M?"没有匹配的场景":"当前分类暂无场景"})]}):e.jsxRuntimeExports.jsx("div",{className:"wandox-console-scenes-wrap",children:e.jsxRuntimeExports.jsx("div",{className:"wandox-console-scenes",children:X.map(n=>{const f=Js(n),k=Xs(n),g=eo(n.tags);return e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-scene-wrap",children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:`wandox-console-scene${k?" wandox-console-scene--featured":""}${E===n.playbook_id?" wandox-console-scene--selected":""}`,onClick:()=>Se(n),children:e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-scene__body",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-scene__head",children:[e.jsxRuntimeExports.jsx("strong",{title:n.title,children:n.title}),f&&e.jsxRuntimeExports.jsx("span",{className:`wandox-console-scene__badge wandox-console-scene__badge--${f.kind}`,children:f.text})]}),n.desc&&e.jsxRuntimeExports.jsx("span",{className:"wandox-console-scene__desc",title:n.desc,children:n.desc}),(k||g.length>0)&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-scene__tags",children:[k&&e.jsxRuntimeExports.jsx("span",{className:"wandox-console-scene__tag wandox-console-scene__tag--featured",children:"精品"}),g.map((R,L)=>e.jsxRuntimeExports.jsx("span",{className:"wandox-console-scene__tag",style:to(R),children:R.name},`${R.name}-${L}`))]})]})}),n.video_url&&e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-console-scene__video","aria-label":`播放${n.title}演示视频`,onClick:R=>xe(R,n),children:["▶ ",Kt(n.video_duration)," 演示"]})]},n.key)})})})]})]}),e.jsxRuntimeExports.jsx(e.PlaybookVideoModal,{playbook:ve,onClose:()=>D(null)})]})}function Xs(o){return o.is_featured===!0||o.badge==="featured"}function Js(o){return o.badge==="recommend"?{text:"推荐",kind:"recommend"}:o.badge==="new"?{text:"New",kind:"new"}:null}function eo(o){return Array.isArray(o)?o.filter(r=>typeof(r==null?void 0:r.name)=="string"&&r.name.trim()!==""):[]}function to(o){if(!(o.variant!=="soft"||!o.color))return{color:o.color,borderColor:zt(o.color,.28),backgroundColor:zt(o.color,.08)}}function zt(o,r){const i=o.trim().replace("#","");if(!/^[0-9a-fA-F]{6}$/.test(i))return o;const l=Number.parseInt(i.slice(0,2),16),h=Number.parseInt(i.slice(2,4),16),y=Number.parseInt(i.slice(4,6),16);return`rgba(${l}, ${h}, ${y}, ${r})`}const so=[{id:"conversation",title:"智能体",desc:"与智能体自由对话或选择场景执行任务",icon:e.jsxRuntimeExports.jsx(j.RefIcon$4,{}),accent:"#4f46e5"},{id:"automation",title:"自动化",desc:"管理与执行自动化流程、定时任务与驾驶舱",icon:e.jsxRuntimeExports.jsx(e.RefIcon$11,{}),accent:"#4f46e5"}],Ve={id:"notification",title:"通知配置",icon:e.jsxRuntimeExports.jsx(j.RefIcon$2,{}),accent:"#e0730c"};function oo({features:o,onOpenFeature:r,activeId:i}){return e.jsxRuntimeExports.jsxs("header",{className:"wandox-console-topnav","aria-label":"控制台顶部导航",children:[e.jsxRuntimeExports.jsx("nav",{className:"wandox-console-topnav__pill","aria-label":"工作台",children:o.map(l=>{const h=i===l.id;return e.jsxRuntimeExports.jsxs("button",{type:"button",className:`wandox-console-topnav__pill-btn${h?" wandox-console-topnav__pill-btn--active":""}`,title:l.title,"aria-label":l.title,"aria-current":h?"page":void 0,onClick:()=>r(l.id),children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-console-topnav__pill-icon",children:l.icon}),e.jsxRuntimeExports.jsx("span",{className:"wandox-console-topnav__pill-text",children:l.title})]},l.id)})}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-console-topnav__notify",style:{"--notify-accent":Ve.accent},title:Ve.title,"aria-label":Ve.title,onClick:()=>r(Ve.id),children:e.jsxRuntimeExports.jsx("span",{className:"wandox-console-topnav__notify-icon",children:Ve.icon})})]})}function no({className:o="",state:r="idle"}){return e.jsxRuntimeExports.jsx("img",{className:`wandox-console-companion${o?` ${o}`:""}`,"data-state":r,src:e.wandoxMarkUrl,alt:"","aria-hidden":"true"})}function qt({fading:o}){return e.jsxRuntimeExports.jsxs("div",{className:`wandox-console-init${o?" wandox-console-init--fading":""}`,"aria-hidden":!0,children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-console-init__halo wandox-console-init__halo--a"}),e.jsxRuntimeExports.jsx("div",{className:"wandox-console-init__halo wandox-console-init__halo--b"}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-init__inner",children:[e.jsxRuntimeExports.jsx(no,{className:"wandox-console-init__companion",state:"thinking"}),e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-console-init__title",children:"正在准备你的控制台"}),e.jsxRuntimeExports.jsx("div",{className:"wandox-console-init__subtitle",children:"正在加载智能体与场景数据…"})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-init__dots","aria-hidden":!0,children:[e.jsxRuntimeExports.jsx("span",{}),e.jsxRuntimeExports.jsx("span",{}),e.jsxRuntimeExports.jsx("span",{}),e.jsxRuntimeExports.jsx("span",{}),e.jsxRuntimeExports.jsx("span",{})]})]}),e.jsxRuntimeExports.jsx("div",{className:"wandox-console-init__footnote",children:"由 Wandox AI 提供动力"})]})}function Wt({title:o,onBack:r,hideHeader:i=!1,className:l,children:h}){return e.jsxRuntimeExports.jsxs("div",{className:`wandox-console-featureview${l?` ${l}`:""}`,children:[!i&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-featureview__bar",children:[e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-console-featureview__back",onClick:r,children:[e.jsxRuntimeExports.jsx(j.RefIcon$1,{}),"返回控制台"]}),e.jsxRuntimeExports.jsx("span",{className:"wandox-console-featureview__title",children:o})]}),e.jsxRuntimeExports.jsx("div",{className:"wandox-console-featureview__body",children:h})]})}function ao({agents:o,initialAgentId:r,initialPlaybookId:i,initialPlaybookParams:l,onReady:h}={}){const{agents:y,agentLoading:p,selectedAgentId:_,selectedAgent:C,selectAgent:T,...Y}=j.useWorkbenchRuntime({presetAgents:o,initialAgentId:r}),[z,re]=e.reactExports.useState(null),S=e.reactExports.useRef(null),q=e.reactExports.useRef(!1),[M,N]=e.reactExports.useState("home"),[u,D]=e.reactExports.useState(null),[ce,F]=e.reactExports.useState(!1),[$,W]=e.reactExports.useState(null),[oe,ne]=e.reactExports.useState(""),H=C==null?void 0:C.name,O=e.reactExports.useCallback(m=>{if(S.current){S.current.showInspectionResults(m);return}re({robotName:m})},[]);e.reactExports.useEffect(()=>{h==null||h({showInspectionResults:O})},[O,h]),e.reactExports.useEffect(()=>{!z||S.current||!_||M==="chat"||(W({agentId:_,agentName:H,playbookParams:{},message:""}),N("chat"))},[M,z,_,H]),e.reactExports.useEffect(()=>{ne("")},[_]);const{playbooks:U,userPlaybooks:Q,useMapCategories:ie,useMapCards:I,sceneLoading:V,useMapError:ye,reload:pe}=Y,le=e.reactExports.useMemo(()=>ie.length>0?ie:j.buildDefaultSceneCategories(U),[ie,U]);e.reactExports.useEffect(()=>{if(le.length===0)return;le.some(E=>E.key===oe)||ne(le[0].key)},[le]);const Re=e.reactExports.useRef(!1);e.reactExports.useEffect(()=>{if(Re.current||!i||!_||V)return;const m=y.find(E=>E.id===_&&j.matchesWorkbenchAgent(E,r));m&&(Re.current=!0,W({agentId:_,agentName:m.name,playbookId:i,playbookParams:l||{},message:""}),N("chat"))},[V,y,r,i,l,_,H]),e.reactExports.useEffect(()=>{if(q.current||!r||i||!_||V)return;const m=y.find(E=>E.id===_&&j.matchesWorkbenchAgent(E,r));m&&(q.current=!0,W({agentId:m.id,agentName:m.name,playbookParams:{},message:""}),N("chat"))},[y,V,r,i,_]);const[me,Ne]=e.reactExports.useState(!0),[Ce,ge]=e.reactExports.useState(!1);e.reactExports.useEffect(()=>{if(!me||!(!p&&y.length>0&&!!_&&!V))return;ge(!0);const ae=setTimeout(()=>Ne(!1),280);return()=>clearTimeout(ae)},[p,y.length,_,V,me]);const Z=e.reactExports.useCallback(()=>{N("home"),D(null),F(!1)},[]),G=e.reactExports.useCallback(m=>{if(m==="conversation"){Z();return}F(!1),D(m)},[Z]),K=m=>{T(m),N("home")},J=m=>{if(m===_)return;const E=y.find(ae=>ae.id===m);T(m),W({agentId:m,agentName:E==null?void 0:E.name,playbookParams:{},message:""})},ee=()=>{_&&(W({agentId:_,agentName:H,playbookParams:{},message:""}),N("chat"))},he=m=>{W({agentId:_,agentName:H,playbookId:m.playbookId,playbookParams:m.playbookParams,message:m.message,attachments:m.attachments}),N("chat")};return M==="chat"&&$?e.jsxRuntimeExports.jsxs("div",{className:"wandox-console-chat-shell",children:[e.jsxRuntimeExports.jsx(Ys,{agentId:$.agentId,agentName:$.agentName,playbookId:$.playbookId,playbookParams:$.playbookParams,initialMessage:$.message,initialAttachments:$.attachments,useMapCards:I,useMapCategories:ie,playbooks:U,userPlaybooks:Q,agents:y,onReady:m=>{S.current=m,z&&(m.showInspectionResults(z.robotName),re(null))},onChangeAgent:J,onBack:()=>{S.current=null,N("home")},onSelectScene:()=>{}},`${$.agentId}:${$.playbookId||"free-chat"}`),me&&e.jsxRuntimeExports.jsx(qt,{fading:Ce})]}):e.jsxRuntimeExports.jsxs("div",{className:`wandox-console${ce?" wandox-console--secondary":""}`,children:[me&&e.jsxRuntimeExports.jsx(qt,{fading:Ce}),!ce&&e.jsxRuntimeExports.jsx(oo,{features:so,activeId:u??"conversation",onOpenFeature:G}),e.jsxRuntimeExports.jsxs("main",{className:"wandox-console-main",children:[u==="automation"&&e.jsxRuntimeExports.jsx(Wt,{title:"自动化",onBack:()=>D(null),hideHeader:!0,className:"wandox-console-featureview--automation",children:e.jsxRuntimeExports.jsx(j.AutomationPage,{onCockpitEnter:()=>F(!0),onCockpitExit:()=>F(!1),onInboxEnter:()=>F(!0)})}),u==="notification"&&e.jsxRuntimeExports.jsx(Wt,{title:"通知配置",onBack:()=>D(null),hideHeader:!0,children:e.jsxRuntimeExports.jsx(j.SettingsWithTabs,{})}),!u&&e.jsxRuntimeExports.jsx(Zs,{useMapCards:I,useMapCategories:le,playbooks:U,selectedCategoryKey:oe,onCategorySelect:ne,loading:V,useMapError:ye,onRetry:pe,onStartAnalysis:he,agents:y,selectedAgentId:_,onAgentSelect:K,onOpenAgentChat:ee})]})]})}exports.default=ao;
|