@abtnode/webapp 1.16.52-beta-20250930-134044-9b691563 → 1.16.52-beta-20251002-030549-0f91dab2
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/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{AdapterDayjs-C_fZicyZ.js → AdapterDayjs-V0ywFO6Q.js} +1 -1
- package/dist/assets/{Add-CPP2iq1t.js → Add-CzkO3Pzz.js} +1 -1
- package/dist/assets/ArrowDropDown-190S9d7I.js +1 -0
- package/dist/assets/{Autocomplete-BxF5Rvbu.js → Autocomplete-BW388eBP.js} +1 -1
- package/dist/assets/{Breadcrumbs-uc8Wt7P9.js → Breadcrumbs-NrwCYnz0.js} +1 -1
- package/dist/assets/{ButtonGroup-B8UFaNni.js → ButtonGroup-o6LmfxeX.js} +1 -1
- package/dist/assets/{CSSTransition-CfJLD8on.js → CSSTransition-DsMKw-p5.js} +1 -1
- package/dist/assets/{CallMerge-CHXixBm1.js → CallMerge-D1XWrRjM.js} +1 -1
- package/dist/assets/{CardContent-Ct11BveH.js → CardContent-D4rz6FRp.js} +1 -1
- package/dist/assets/{ChevronLeft-DTV9VYLb.js → ChevronLeft-D4CgzTJY.js} +1 -1
- package/dist/assets/{ChevronRight-BV25Yw2E.js → ChevronRight-DXz-F6L7.js} +1 -1
- package/dist/assets/{Clear-BLlKzOYZ.js → Clear-NASbJHS6.js} +1 -1
- package/dist/assets/{DeleteOutline-1ia7MYDd.js → DeleteOutline-DsnSViGb.js} +1 -1
- package/dist/assets/{Done-CV1WQndD.js → Done-D4PPkPui.js} +1 -1
- package/dist/assets/{Edit-DrhdrT5r.js → Edit-V0eiBsGU.js} +1 -1
- package/dist/assets/{ErrorOutline-CTbGiGqZ.js → ErrorOutline-DA3_RUVz.js} +1 -1
- package/dist/assets/{FilterList-Cfx770te.js → FilterList-Y719g2Zi.js} +1 -1
- package/dist/assets/{Google-BzDCB92M.js → Google-B3YPvJDV.js} +1 -1
- package/dist/assets/{HelpOutline-lLOp8ZZO.js → HelpOutline-c-XuWHxw.js} +1 -1
- package/dist/assets/{Launch-C8YfDHGR.js → Launch-COjBPQdg.js} +1 -1
- package/dist/assets/{Link-CbeDJYWI.js → Link-qCg-dCX5.js} +1 -1
- package/dist/assets/{ListItemButton-DnyaGhp1.js → ListItemButton-BTbVPhQ8.js} +1 -1
- package/dist/assets/{ListSubheader-BdUpkkMj.js → ListSubheader-CA8Y4o8o.js} +1 -1
- package/dist/assets/{LoadingButton-KJ-dQwc4.js → LoadingButton-DN5HznZc.js} +1 -1
- package/dist/assets/{MoreVert-Dgq_vg7Y.js → MoreVert-BQ022_rm.js} +1 -1
- package/dist/assets/{OpenInNew-qKGRXQvM.js → OpenInNew-BB6MBnzE.js} +1 -1
- package/dist/assets/{Refresh-B8uvuAS9.js → Refresh-r7y4CgN5.js} +1 -1
- package/dist/assets/{Search-Djv8dYGS.js → Search-CGTjTzzo.js} +1 -1
- package/dist/assets/{Stepper-CNcPZVkm.js → Stepper-CfXniFN2.js} +1 -1
- package/dist/assets/{Switch-BtvxAY3n.js → Switch-DYjTi7gg.js} +1 -1
- package/dist/assets/{TableSearch-DvRPn5Nk.js → TableSearch-BwtXbQG-.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-CYkaYq-d.js → ToggleButtonGroup-DvCR9SNw.js} +1 -1
- package/dist/assets/{UnfoldMore-DEEAKAvu.js → UnfoldMore-B3amhCTg.js} +1 -1
- package/dist/assets/{Verified-Bq_Wx0qC.js → Verified-DmBfm1uD.js} +1 -1
- package/dist/assets/{VerifiedUser-Dib9C-dd.js → VerifiedUser-mZGHgzQb.js} +1 -1
- package/dist/assets/{ViewList-Clq_0H-Y.js → ViewList-DtqzxGZt.js} +1 -1
- package/dist/assets/{_createAggregator-BRpw45dg.js → _createAggregator-nGamgeOn.js} +1 -1
- package/dist/assets/{actions-D3Odd9Yn.js → actions-6ll7jsa3.js} +1 -1
- package/dist/assets/{actions-BSoY8XcA.js → actions-DheKYBlc.js} +1 -1
- package/dist/assets/{agreement-DKUxCfnZ.js → agreement-CHm-YwcP.js} +1 -1
- package/dist/assets/api-D4aKRawp.js +1 -0
- package/dist/assets/{appearance-BFqZUmk7.js → appearance-BISi6FkN.js} +1 -1
- package/dist/assets/{ar-DWsJvQhm.js → ar-DDKSNNIB.js} +1 -1
- package/dist/assets/{audit-logs-Dq1BGSc7.js → audit-logs-DylpExtV.js} +1 -1
- package/dist/assets/{base-chart-BBdPuf36.js → base-chart-DWjEmmtF.js} +1 -1
- package/dist/assets/{blocklet-IAGGMJGV.js → blocklet-DwOY6PM2.js} +1 -1
- package/dist/assets/chain-CrqO5ZBK.js +6 -0
- package/dist/assets/{click-to-copy-B8TemOOI.js → click-to-copy-QDhx8_BO.js} +1 -1
- package/dist/assets/client-Beap4FeV.js +1 -0
- package/dist/assets/cloneDeep-BGXXbqSz.js +1 -0
- package/dist/assets/{collapse-CzUrkZT7.js → collapse-C5JgD0iT.js} +1 -1
- package/dist/assets/{config-navigation-DuNEv-wk.js → config-navigation-CBsV4a0j.js} +46 -46
- package/dist/assets/connect-to-CKdf31e5.js +29 -0
- package/dist/assets/{cssMode-Bdog3gks.js → cssMode-aqWJN-f_.js} +1 -1
- package/dist/assets/{de-rG0WLGYs.js → de-C5jW-Aco.js} +1 -1
- package/dist/assets/{delete-confirm-BtX2gH4O.js → delete-confirm-DFLlapHl.js} +1 -1
- package/dist/assets/{depsEqual-nDl4Jb8n.js → depsEqual-CHA3TYmk.js} +1 -1
- package/dist/assets/{detail-B3ZtaseD.js → detail-CNTenkKV.js} +3 -3
- package/dist/assets/domains-WhieF3AY.js +28 -0
- package/dist/assets/download-BH2P43wY.js +445 -0
- package/dist/assets/{edit.svg-sU05Ggc3.js → edit.svg-CkS6r8rY.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-BVx7paDx.js +1 -0
- package/dist/assets/engine-BcZHSV9-.js +1 -0
- package/dist/assets/{es-6DKPq8Yn.js → es-DnE5Se03.js} +1 -1
- package/dist/assets/{fr-CT3g9qN-.js → fr-BpXortYf.js} +1 -1
- package/dist/assets/{freemarker2-D763tjOa.js → freemarker2-Cybw0O8m.js} +1 -1
- package/dist/assets/{get-safe-url-73euyU4H.js → get-safe-url-CwiNWKY8.js} +1 -1
- package/dist/assets/getValidReactChildren-BiC2BfQo.js +1 -0
- package/dist/assets/{graphqlMode-BxGdEegt.js → graphqlMode-gSVowOId.js} +2 -2
- package/dist/assets/{handlebars-CnvMtAI-.js → handlebars-63KuA5s0.js} +1 -1
- package/dist/assets/{html-DgZaqpvK.js → html-DV0Fd3Kx.js} +1 -1
- package/dist/assets/{html-title-BKasCGZJ.js → html-title-8eEQvwSm.js} +1 -1
- package/dist/assets/{htmlMode-D-_QLCVp.js → htmlMode-DeseqIni.js} +1 -1
- package/dist/assets/{iframe-BuacfLs-.js → iframe-BS88FRwX.js} +1 -1
- package/dist/assets/{index-BcN0CYKC.js → index-7KYdF6ej.js} +1 -1
- package/dist/assets/{index-B66X35Zr.js → index-9hx_-WS9.js} +1 -1
- package/dist/assets/{index-C77hr-z5.js → index-B0bwsr2k.js} +20 -20
- package/dist/assets/{index-Dj6T1F9F.js → index-B3uFEeJa.js} +1 -1
- package/dist/assets/{index-BhJ8Uq3P.js → index-B93qsZTj.js} +9 -9
- package/dist/assets/{index-BqVOndt8.js → index-BMFG6xYn.js} +3 -3
- package/dist/assets/{index-BovHLRw3.js → index-BMbE3uR8.js} +1 -1
- package/dist/assets/{index-RPptJKLV.js → index-BNPmFilX.js} +1 -1
- package/dist/assets/{index-C9MF5wBV.js → index-BOv_-aOp.js} +1 -1
- package/dist/assets/index-Bj3vXLSw.js +375 -0
- package/dist/assets/index-BjWva3kW.js +1 -0
- package/dist/assets/{index-COo5KQxE.js → index-BjhmwRPF.js} +1 -1
- package/dist/assets/{index-Cmrtk-04.js → index-BkM0NufG.js} +1 -1
- package/dist/assets/{index-BFfavAgR.js → index-BlmPoc3t.js} +1 -1
- package/dist/assets/index-BqWVYrv4.js +1 -0
- package/dist/assets/{index-5Geg2lIs.js → index-BsAylPTP.js} +1 -1
- package/dist/assets/{index-B6PGxOxy.js → index-BwKc3rqr.js} +2 -2
- package/dist/assets/{index-w5ELx1UU.js → index-C0ZKfJQm.js} +1 -1
- package/dist/assets/{index-CVcsyn47.js → index-C5HHk93s.js} +1 -1
- package/dist/assets/{index-CwqTtDFk.js → index-CB1cOH1l.js} +1 -1
- package/dist/assets/{index-iY4v_oAl.js → index-CEIY_r6h.js} +3 -3
- package/dist/assets/{index-DTgUL_kq.js → index-CI4dlXTe.js} +116 -119
- package/dist/assets/{index-BaMKae63.js → index-CQ74V8K8.js} +1 -1
- package/dist/assets/{index-DHUxi_Ui.js → index-CT8o9Y85.js} +3 -3
- package/dist/assets/{index-Dh8M0C3a.js → index-CbEOHXQc.js} +1 -1
- package/dist/assets/{index-CGrBiIvb.js → index-Cka3nP81.js} +1 -1
- package/dist/assets/{index-DXCxMet4.js → index-Cw4aE7m_.js} +1 -1
- package/dist/assets/{index-CtUHsvTQ.js → index-CzA1rttv.js} +1 -1
- package/dist/assets/{index-vo-Q5TYh.js → index-DFdk3ofB.js} +1 -1
- package/dist/assets/{index-CLfLgOcG.js → index-DGINP96S.js} +1 -1
- package/dist/assets/{index-DodJ1kPf.js → index-DHL_Vi4i.js} +3 -3
- package/dist/assets/{index-o_J-i5y_.js → index-DXLVGozs.js} +1 -1
- package/dist/assets/{index-CzuugLSH.js → index-DZ4p_r8e.js} +1 -1
- package/dist/assets/{index-RmXxUdma.js → index-DZM3J5Wp.js} +1 -1
- package/dist/assets/{index-XZFG9Nmo.js → index-DgZWZUlS.js} +1 -1
- package/dist/assets/{index-DSMID0YC.js → index-DgzKW9Ex.js} +3 -3
- package/dist/assets/{index-DtmSsKvG.js → index-IlXLx7We.js} +1 -1
- package/dist/assets/{index-eJLhgfjC.js → index-QSBtrt6h.js} +1 -1
- package/dist/assets/{index-Cmujcn4-.js → index-TwUe_Tvk.js} +1 -1
- package/dist/assets/{index-DzYKqeD0.js → index-Uzc8DiTP.js} +1 -1
- package/dist/assets/{index-wkMHahcA.js → index-_d7QPgTP.js} +1 -1
- package/dist/assets/{index-CqyxuFxM.js → index-h_zu579g.js} +1 -1
- package/dist/assets/{index-CV7nG2ul.js → index-nOMeb0Cp.js} +1 -1
- package/dist/assets/{index-DhhaeVfE.js → index-phRP0JhX.js} +1 -1
- package/dist/assets/{index-DC1eDdhF.js → index-w_ABp53I.js} +1 -1
- package/dist/assets/{index.esm-DZjUBqeE.js → index.esm-ItCPJOAO.js} +1 -1
- package/dist/assets/{install-from-url-CcBy5URE.js → install-from-url-DvUzVhpS.js} +1 -1
- package/dist/assets/{invitation-1xJqyxq_.js → invitation-DbyKhAZm.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-lXhGy4Qe.js → is-path-prefix-equal-BvAHrQj-.js} +1 -1
- package/dist/assets/{item-rv42JECv.js → item-gJv-5KQT.js} +1 -1
- package/dist/assets/{javascript-BrLPoZMP.js → javascript-BIMIemmE.js} +1 -1
- package/dist/assets/{jsonMode-xZNOlAc_.js → jsonMode-3N-YuMar.js} +1 -1
- package/dist/assets/{ko-Crmr1RC-.js → ko-DGXdpX64.js} +1 -1
- package/dist/assets/{liquid-BJGZbDya.js → liquid-CQYhn0Yk.js} +1 -1
- package/dist/assets/{list-header-CIE-ZsHl.js → list-header-D5PvV4Ns.js} +1 -1
- package/dist/assets/{lock.svg-CW50QWyX.js → lock.svg-Dml_SUcw.js} +1 -1
- package/dist/assets/{log-qrE6EEc9.js → log-hCli4ygZ.js} +1 -1
- package/dist/assets/{lottie-react.esm-B1jN3OaN.js → lottie-react.esm-C1KoLgaH.js} +1 -1
- package/dist/assets/{mdx-ctVQvgda.js → mdx-Fu7jp7wB.js} +1 -1
- package/dist/assets/{memory-CHbtQUwm.js → memory-Da1Mktb-.js} +1 -1
- package/dist/assets/{metric-DYtzKSlS.js → metric-DKt7Dv_o.js} +1 -1
- package/dist/assets/omit-VPuIA8hg.js +1 -0
- package/dist/assets/{overview-CGaQ7UAo.js → overview-CKMQGhx9.js} +1 -1
- package/dist/assets/{permission-Cjh6O_vg.js → permission-CY9xhitI.js} +1 -1
- package/dist/assets/{preference-DmDF-9zQ.js → preference-DV6_upOl.js} +3 -3
- package/dist/assets/{pt-DlPLN19J.js → pt-CIqefLTL.js} +1 -1
- package/dist/assets/{python--YGRQx8o.js → python-Bi1toJg2.js} +1 -1
- package/dist/assets/{raf-schd.esm-DhD0av-m.js → raf-schd.esm-pJPdUflv.js} +1 -1
- package/dist/assets/{razor-DnLbP29E.js → razor-DrpZeVMl.js} +1 -1
- package/dist/assets/{rotate-session-key-DRE7AHCX.js → rotate-session-key-efxghCi1.js} +1 -1
- package/dist/assets/{ru-BNhuVXCB.js → ru-B4h3WudR.js} +1 -1
- package/dist/assets/{runtime-BTIndKDh.js → runtime-jGUL5QuT.js} +1 -1
- package/dist/assets/schema-D7YjS37r.js +1 -0
- package/dist/assets/sdk-BEqYN1lC.js +1 -0
- package/dist/assets/{service-BHlYsjeB.js → service-MB0T2aB0.js} +1 -1
- package/dist/assets/{shorten-label-qUYJropg.js → shorten-label-DTPTvpJ1.js} +1 -1
- package/dist/assets/{simple-select-DulurVBk.js → simple-select-DAk8AY1P.js} +1 -1
- package/dist/assets/{spaces-CPJZ8D5i.js → spaces-DH7TZUlN.js} +1 -1
- package/dist/assets/{status-DTceE034.js → status--V5SQYgM.js} +1 -1
- package/dist/assets/{status-BsrsqdGC.js → status-DX1yJUTs.js} +1 -1
- package/dist/assets/{switch-control-DaLS546c.js → switch-control-D1F-cHNq.js} +1 -1
- package/dist/assets/{table-icons-BkGCumri.js → table-icons-CcdGfjTh.js} +1 -1
- package/dist/assets/{team-D7kOXsCz.js → team-BrSgmhmc.js} +1 -1
- package/dist/assets/{th-CSbI3a1U.js → th-BjttL5p9.js} +1 -1
- package/dist/assets/{toLower-DfYXTTzA.js → toLower-ByD7rJFr.js} +1 -1
- package/dist/assets/toUpper-jya-zxKt.js +1 -0
- package/dist/assets/{traffic-QqCF1YrQ.js → traffic-wbGiv6hW.js} +1 -1
- package/dist/assets/{tsMode-DiqvPVXO.js → tsMode-C7gy9xLC.js} +1 -1
- package/dist/assets/{typescript-k-ZT-XZa.js → typescript-DJoWvhbC.js} +1 -1
- package/dist/assets/{url-evaluation-CT0SPpn4.js → url-evaluation-Bsg9-ill.js} +1 -1
- package/dist/assets/{url-join-C5dWHLIk.js → url-join-DpnUEv7-.js} +1 -1
- package/dist/assets/{use-mobile-DTi9VXen.js → use-mobile-CeVGXvtj.js} +1 -1
- package/dist/assets/{use-mobile-DsnimkNQ.js → use-mobile-CuAbTch1.js} +1 -1
- package/dist/assets/{useAsync-Ch82e5od.js → useAsync-DxwaXQxu.js} +1 -1
- package/dist/assets/{useAsyncRetry-B6dXhqn8.js → useAsyncRetry-C_rRPNUy.js} +1 -1
- package/dist/assets/{useLocalStorage-CM-c3Psr.js → useLocalStorage-CoABMXGW.js} +1 -1
- package/dist/assets/{useThemeProps-Cnj5mhqW.js → useThemeProps-DJWWp5kh.js} +1 -1
- package/dist/assets/{util-697UkaoT.js → util-BdUmm2ZH.js} +1 -1
- package/dist/assets/{wait-container-BNz4T5iB.js → wait-container-DJAGSnuK.js} +1 -1
- package/dist/assets/{without-wallet-B_mB7V7Y.js → without-wallet-v9tjrlHV.js} +1 -1
- package/dist/assets/{wrap-locale-B3K4zvne.js → wrap-locale-Ba4TE2iy.js} +1 -1
- package/dist/assets/{xml-DRsBbGwY.js → xml-avm6PJAG.js} +1 -1
- package/dist/assets/{yaml-CsiEhwWc.js → yaml-DO7DaC1O.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/ArrowDropDown-WDxAjlut.js +0 -1
- package/dist/assets/api-NQY55sw9.js +0 -1
- package/dist/assets/chain-DS7ybvMh.js +0 -6
- package/dist/assets/client-DyT3eIsb.js +0 -1
- package/dist/assets/cloneDeep-DrGysqIa.js +0 -1
- package/dist/assets/connect-to-CVSL3PnV.js +0 -30
- package/dist/assets/domains-DrM7lxS4.js +0 -28
- package/dist/assets/download-2dYWOb0Z.js +0 -445
- package/dist/assets/emotion-cache.browser.esm-DRbBs3XS.js +0 -1
- package/dist/assets/engine-BskDM1z4.js +0 -1
- package/dist/assets/getValidReactChildren-RYNnEL64.js +0 -1
- package/dist/assets/index-Cu0q_J05.js +0 -1
- package/dist/assets/index-RhVPyjJ9.js +0 -375
- package/dist/assets/index-ZmjmhRka.js +0 -1
- package/dist/assets/omit-Bo6UNg3a.js +0 -1
- package/dist/assets/schema-nNhP5AbE.js +0 -1
- package/dist/assets/sdk-NwNh0j-E.js +0 -1
- package/dist/assets/slugify-bzSZ5XYw.js +0 -1
- package/dist/assets/toLower-DdKrtUeG.js +0 -1
- package/dist/assets/toUpper-C_yFC8uF.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as g,bm as v,u as y,j as r,P as f,S as x,R as h}from"./index-CI4dlXTe.js";import{L as S,D as j}from"./download-BH2P43wY.js";import{u as L}from"./useLocalStorage-CoABMXGW.js";import"./ButtonGroup-o6LmfxeX.js";import"./getValidReactChildren-BiC2BfQo.js";function I(){const c=g(),[s,i]=L("server-logs-filter",{name:"abtnode",type:{abtnode:"error"}}),{name:t=s.name}=v(),{info:l}=y(),n=l.routing.provider,a=[{id:"abtnode",name:"Blocklet Server",types:["error","info","access","stdout","stderr","pm2"]},{id:"blocklet-services",name:"Blocklet Services",types:["error","info","access","stdout","stderr"]}];if(n){const e=`Service Gateway(${n})`;a.push({id:`service-gateway-${n}`,name:e,types:["error","access","security"]})}const d=e=>{i({...s,name:e.target.value}),c(`/logs/${e.target.value}`)},m=r.jsx(f,{sx:{minWidth:240},children:r.jsx(x,{value:t,onChange:d,size:"small",children:a.map(e=>r.jsx(h,{value:e.id,children:e.name},e.id))})}),o=a.find(e=>e.id===t)||a[0],p=o.types.indexOf(s.type[t]||"error"),u=e=>{i({name:t,type:{...s.type,[t]:e}})};return r.jsx(S,{name:o.name,logId:o.id,types:o.types,prepend:m,postpend:r.jsx(j,{id:l.did,name:"blocklet-server"}),defaultTypeIndex:p,onTypeChange:u},o.id)}export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,g as n,j as t,s as r}from"./index-
|
|
1
|
+
import{r as o,g as n,j as t,s as r}from"./index-CI4dlXTe.js";import{p as a}from"./index-C5HHk93s.js";function c(){const{t:s}=o.useContext(n);return t.jsx(e,{style:{paddingTop:"25vh"},children:t.jsx(a,{status:"404",description:s("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const e=r.main``;export{c as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o,T as i,dm as x,dn as d,de as f}from"./index-
|
|
1
|
+
import{j as o,T as i,dm as x,dn as d,de as f}from"./index-CI4dlXTe.js";function w({name:t,nameFormatter:r=e=>typeof e=="string"?e.split(" ").map(c=>x(d(c))).join(" "):e,layout:n="horizontal",children:a,valueComponent:l="div",nameWidth:m=90,...s}){return o.jsxs(p,{layout:n,width:m,...s,children:[o.jsx(i,{color:"textSecondary",className:"info-row__name",children:r(t)}),a&&o.jsx(i,{color:"textPrimary",component:l,className:"info-row__value",children:a})]})}const p=f("div")`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: ${t=>t.layout==="vertical"?"column":"row"};
|
|
4
4
|
justify-content: flex-start;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cF as $m,bd as jL,h4 as oT,ba as Xm,bb as Zm,cS as qm,be as JL,r as QL}from"./index-
|
|
1
|
+
import{cF as $m,bd as jL,h4 as oT,ba as Xm,bb as Zm,cS as qm,be as JL,r as QL}from"./index-CI4dlXTe.js";/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c1 as c,r as S,cs as _,gx as f,cS as r}from"./index-CI4dlXTe.js";var m=function(n){var s=c(S.useState(n),2),u=s[0],o=s[1],i=_(function(t){o(function(e){var a=f(t)?t(e):t;return a?r(r({},e),a):e})});return[u,i]};export{m as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aj as ee,A as T,r as f,a as te,b as se,m as j,u as S,x as re,av as A,I as F,j as t,w as q,aw as oe,T as C,y as k,$,o as m,ax as ne,ay as ae,v as _,C as N,az as ie,H as W,X as M,aA as le,aB as ce,M as E,aC as ue,L as de,aD as pe,a9 as he,s as O,a6 as fe,a7 as me,aE as ge,a8 as xe}from"./index-
|
|
1
|
+
import{aj as ee,A as T,r as f,a as te,b as se,m as j,u as S,x as re,av as A,I as F,j as t,w as q,aw as oe,T as C,y as k,$,o as m,ax as ne,ay as ae,v as _,C as N,az as ie,H as W,X as M,aA as le,aB as ce,M as E,aC as ue,L as de,aD as pe,a9 as he,s as O,a6 as fe,a7 as me,aE as ge,a8 as xe}from"./index-CI4dlXTe.js";import{u as L}from"./useLocalStorage-CoABMXGW.js";import{C as be,c as ke,e as ye,_ as je,a as Se,d as we,s as ve,S as z,b as Pe,A as Ce}from"./item-gJv-5KQT.js";import{e as D}from"./engine-BcZHSV9-.js";import{g as U}from"./get-safe-url-CwiNWKY8.js";import{P as V}from"./permission-CY9xhitI.js";import{A as Re}from"./ArrowDropDown-190S9d7I.js";import{B as Le}from"./Breadcrumbs-NrwCYnz0.js";import"./Verified-DmBfm1uD.js";import"./ChevronLeft-D4CgzTJY.js";import"./ChevronRight-DXz-F6L7.js";import"./Search-CGTjTzzo.js";import"./index-w_ABp53I.js";import"./blocklet-DwOY6PM2.js";import"./Autocomplete-BW388eBP.js";import"./ListSubheader-CA8Y4o8o.js";import"./VerifiedUser-mZGHgzQb.js";import"./Add-CzkO3Pzz.js";import"./Launch-COjBPQdg.js";import"./Done-D4PPkPui.js";import"./DeleteOutline-DsnSViGb.js";import"./delete-confirm-DFLlapHl.js";import"./click-to-copy-QDhx8_BO.js";import"./MoreVert-BQ022_rm.js";import"./ButtonGroup-o6LmfxeX.js";import"./getValidReactChildren-BiC2BfQo.js";function Be(e){const r=ee(),c=T(),[s,o]=L(`sid:blocklet:purchase:${e}`),[l,u]=f.useState(!1),[d,a]=f.useState(null),p=()=>{const{pathname:n,searchParams:b}=new URL(window.location.href),g=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";b.get("sid")&&(o(""),c(n.replace(g,"/"),{replace:!0}))},i=!!(r.get("assetDid")&&s&&r.get("sid")===s);return te(se.BlockletEvents.purchaseChange,n=>{n.did===e&&(a(n.session),["declined","confirmed","error"].includes(n.session.status)&&(u(!0),setTimeout(p,2e3)))}),f.useEffect(()=>{d&&d.id!==s&&o(d.id)},[d]),{hasCompleted:l,hasPurchased:i,session:d,setSession:a,doRedirect:p}}function De(e){setTimeout(()=>{window.location.href=U(e,{allowDomains:null})},1e3)}function H({meta:e,onCancel:r,handlePaySuccess:c=De,storeUrl:s}){const{t:o}=j(),{info:l}=S(),[u,d]=f.useState("both"),[a,p]=f.useState(1),i=re(l),n=A(e,l,s),b=P=>{P!==u&&d(P)},g=()=>{u&&(p(2),u==="verify"&&(window.location.href=U(n)))},w=(P,B)=>{B!=="backdropClick"&&r()},x=()=>{c(n)},h=F.getDisplayName({meta:e});if(u==="purchase"&&a===2)return t.jsx(q,{open:!0,popup:!0,baseUrl:s,action:"acquire-asset",checkFn:oe.create({baseURL:k(s,"/store")}).get,onSuccess:x,onClose:r,checkTimeout:60*5e3,extraParams:{factory:e.nftFactory},webWalletUrl:i,disableClose:!0,saveConnect:!1,showDownload:!1,messages:{title:o("store.purchase.auth.title",{name:h}),scan:o("store.purchase.auth.scan"),confirm:o("store.purchase.auth.confirm"),success:t.jsxs(t.Fragment,{children:[t.jsx(C,{gutterBottom:!0,children:o("store.purchase.auth.success")}),t.jsxs(C,{variant:"subtitle2",children:[" ",o("store.purchase.autoLaunch",{name:h})]})]})}});const v=$;return t.jsx(v,{title:o("store.purchase.title",{name:h}),disableEscapeKeyDown:!0,open:!0,fullWidth:!0,onClose:w,children:t.jsx("div",{style:{marginBottom:16},children:t.jsx(be,{action:u,onNext:g,onSelect:b})})})}H.propTypes={...ke,storeUrl:m.string.isRequired,handlePaySuccess:m.func};function K({meta:e,buttonText:r,storeUrl:c,isResource:s=!1}){const{t:o}=j(),l=T(),{info:u}=S(),{api:d}=ne(),a=F.isFreeBlocklet(e)===!1,[p,i]=f.useState(!1),{hasPurchased:n}=Be(e.did),[b,g]=f.useState(!1),[w]=L("instant-blocklet-install",!1),[x,h]=f.useState(!1),v=f.useMemo(()=>p?o(a?"blocklet.status.purchasing":"blocklet.status.waiting"):"",[p,o,a]),P=f.useMemo(()=>s?o("blocklet.status.resource"):a?r.purchase:r.launch,[a,r,s]),B=y=>{y.preventDefault(),y.stopPropagation();try{if(i(!0),a){g(!0);return}if(w){h(!0);return}if(!a){const R=A(e,u,c);window.location.href=U(R)}}catch(R){W.error(M(R),{autoHideDuration:5e3}),console.error("Blocklet installed failed",R)}finally{i(!1)}},Y=()=>{i(!1),g(!1)},J=y=>{i(!1),h(!1),l(`/blocklets/${y.appDid}/components`)},Z=()=>{i(!1),h(!1)};return t.jsxs(t.Fragment,{children:[t.jsx(ye,{children:t.jsx(V,{permission:"mutate_blocklets",children:y=>t.jsx(ae,{title:s?o("launchBlocklet.error.resourceBlocklet"):"",children:t.jsx(_,{onClick:B,size:"small",sx:{cursor:s?"not-allowed":"pointer",overflow:"hidden"},disabled:!!(v||!y),variant:"outlined",color:"primary","data-cy":"install-blocklet",children:v?t.jsxs(t.Fragment,{children:[t.jsx(N,{size:16,style:{marginRight:3}}),v]}):P},e.did)})})}),(n||b)&&t.jsx(H,{method:"launch",meta:e,mode:"both",onCancel:Y,storeUrl:c}),x&&t.jsx(q,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:d.get,checkTimeout:5*60*1e3,onSuccess:J,extraParams:{title:e.title,blockletMetaUrl:decodeURIComponent(ie(c,e.did).trim())},messages:{title:o("setup.keyPair.title"),scan:o("setup.keyPair.scan"),confirm:o("setup.keyPair.confirm"),success:o("setup.keyPair.success")},onClose:Z})]})}K.propTypes={isResource:m.bool,meta:m.object.isRequired,buttonText:m.shape({purchase:m.string.isRequired,launch:m.string.isRequired}).isRequired,storeUrl:m.string.isRequired};const Ee=(e,r,c)=>{const s=he(r);return k(c,`/blocklets/${e.did}/?server-url=${s}`)},I=({meta:e,attribute:r,value:c})=>e._formatted?e._formatted[r]:c,Ue=(e,r)=>{if(!e||!r)return"";try{return k(r,e)}catch(c){return console.warn("Failed to construct avatar URL:",c),""}};function G({blocklet:e,endpoint:r="",serverVersion:c=""}){const{t:s}=j(),o=S();let l=k(o.imgPrefix,"blocklet.png");const u=r;if(u.startsWith("http")&&e.logo)l=k(u,ue(e.did,e.logo,e.version));else{let n=(window.env.apiPrefix||"/").replace(/^\/+/,"").replace(/\/+$/,"");n&&(n=`/${n}`),l=k(n,`/blocklet/logo/${e.did}`)}try{const i=new URL(l);i.searchParams.set("v",e.version||+new Date),l=i.href}catch{}const d=i=>i.currentTarget.contains(i.target)?!0:(i.preventDefault(),!1),a={meta:e,buttonText:{purchase:s("common.purchase"),launch:s("common.launch")},storeUrl:u},p=t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(Se,{serverVersion:c,requirementVersion:e.requirements?.server,size:"small",children:t.jsx(K,{isResource:!(D.hasStartEngine(e)||D.isGatewayBlocklet(e)||D.isPackBlocklet(e)),...a})})});return t.jsx(de,{href:Ee(e,o.info,r),style:{color:"initial",textDecoration:"none"},onClick:d,target:"_blank",children:t.jsx(Ie,{title:I({meta:e,attribute:"title",value:e.title||e.name}),did:e.did,description:I({meta:e,attribute:"description",value:e.description}),cover:e.logo?l:"",version:e.version,onButtonClick:null,icons:e.docker?.image?[{key:"docker",icon:t.jsx(E,{sx:{display:"flex",color:"primary.main"},children:t.jsx(pe,{icon:we})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,author:e.owner.fullName,avatar:Ue(e.owner.avatar,r),download:e.stats.downloads,button:p})})}G.propTypes={blocklet:m.object.isRequired,serverVersion:m.string,endpoint:m.string};function Q({storeUrl:e,handleSearchSelect:r=null,extraFilter:c=void 0,...s}){const{locale:o}=j(),l=S(),[u,d]=f.useState({}),a=n=>{d(n)},p=e,i=l?.info?.version;return f.useEffect(()=>{d({})},[p]),t.jsx(le,{FallbackComponent:ce,resetKeys:[p],children:t.jsx(E,{...s,sx:{"& .title-bar":{pt:0},".blocklet-list":{mt:0},"& h2":{display:"none"}},children:t.jsx(je,{layout:{showExplore:!1,showTitle:!0},blockletRender:n=>t.jsx(G,{...n,endpoint:p}),baseSearch:!0,endpoint:p,locale:o,onFilterChange:a,onSearchSelect:r,filters:u,extraFilter:c,serverVersion:i})})})}Q.propTypes={storeUrl:m.string.isRequired,handleSearchSelect:m.func,extraFilter:m.func};const Ie=O(ve)`
|
|
2
2
|
.ms-highlight {
|
|
3
3
|
color: ${e=>e.theme.palette.primary.main};
|
|
4
4
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
2
|
-
import{r as t,g as n,j as r,bF as i,d2 as a}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-B93qsZTj.js","./index-CI4dlXTe.js","./index-DGkT7afN.css","./decode-DPztD6kB.js","./index-CX3PrUL2.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as t,g as n,j as r,bF as i,d2 as a}from"./index-CI4dlXTe.js";const s=t.lazy(()=>i(()=>import("./index-B93qsZTj.js").then(o=>o.i),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),d=`{
|
|
3
3
|
getNodeInfo {
|
|
4
4
|
code
|
|
5
5
|
info {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as f,j as s,C as d,A as w,ax as v,cr as C,cs as u,ae as j,aH as I,M as P,bx as S}from"./index-
|
|
1
|
+
import{u as f,j as s,C as d,A as w,ax as v,cr as C,cs as u,ae as j,aH as I,M as P,bx as S}from"./index-CI4dlXTe.js";import{I as E}from"./invitation-DbyKhAZm.js";import{g as R}from"./get-safe-url-CwiNWKY8.js";import"./index-C5HHk93s.js";import"./index-phRP0JhX.js";import"./emotion-cache.browser.esm-BVx7paDx.js";import"./sdk-BEqYN1lC.js";import"./wrap-locale-Ba4TE2iy.js";function T(n){const{searchParams:a}=new URL(window.location.href),g=w(),{api:i,session:r}=v(),{info:l}=f(),c=a.get("redirect"),p=a.get("id"),o=C(async()=>{if(!p)return null;const{data:t}=await i.get("/api/invitation",{params:{inviteId:p,mode:"issue-passport"}});return t}),m=u(()=>{if(o.error)throw o.error;return o?.data}),x=u(async(t,h=e=>e)=>{t&&(t.sessionToken&&j(h(t.sessionToken)),await r.refresh()),setTimeout(()=>{if(c){const e=decodeURIComponent(c);e.startsWith(I.WELLKNOWN_SERVICE_PATH_PREFIX)?g(e,{replace:!0}):window.location.href=R(e)}else window.location.href=window.env.pathPrefix||"/"},50)});return o.loading?s.jsx(d,{}):s.jsx(P,{className:"page-invite",sx:{width:"100vw",height:"100%",minHeight:"100vh",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"#f6f8fa",overflow:"auto",padding:"20px"},children:s.jsx(E,{...n,action:"issue-passport",getDataFn:m,createPassportSvg:t=>S(t,l),checkFn:i.get,onLoginSuccess:x,passportColor:"default",onLogin:r.login})})}function _(){return f().loading?s.jsx(d,{}):s.jsx(T,{})}export{_ as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aF as v,j as n,M as a,de as w,m as z,f as p,dl as F}from"./index-
|
|
1
|
+
import{aF as v,j as n,M as a,de as w,m as z,f as p,dl as F}from"./index-CI4dlXTe.js";const k=v(n.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m4.3 14.3c-.39.39-1.02.39-1.41 0L12 13.41 9.11 16.3c-.39.39-1.02.39-1.41 0a.996.996 0 0 1 0-1.41L10.59 12 7.7 9.11a.996.996 0 0 1 0-1.41c.39-.39 1.02-.39 1.41 0L12 10.59l2.89-2.89c.39-.39 1.02-.39 1.41 0s.39 1.02 0 1.41L13.41 12l2.89 2.89c.38.38.38 1.02 0 1.41"}));function r({icon:e=null,title:t="",description:o="",extra:y=null,...b}){return n.jsxs(E,{...b,children:[e,typeof t=="string"?n.jsx(a,{sx:{mt:3,fontSize:22,fontWeight:400,color:"text.primary",textAlign:"center"},children:t}):t,typeof o=="string"?n.jsx(a,{sx:{mt:1,fontSize:14,color:"text.secondary",textAlign:"center"},children:o}):o,n.jsx(a,{sx:{mt:3},children:y})]})}const E=w("div")`
|
|
2
2
|
box-sizing: border-box;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aF as Ge,j as e,bn as gt,r as g,bz as X,bf as H,H as U,aH as D,p as xt,o as d,h as te,at as bt,ay as jt,M as y,T as $,m as Q,eO as Fe,P as Pe,il as Ye,bj as Te,aU as Ie,U as Ee,dI as we,b3 as qe,b1 as Ae,C as Xe,f as Qe,f0 as Je,aP as De,W as yt,as as Ze,im as et,v as Oe,f2 as tt,fo as ye,fI as st,dC as St,s as ie,af as pe,G as Ue,au as vt,io as Ct,ip as Nt,$ as nt,iq as wt,ir as Rt,is as Tt,it as It,O as Et,bu as it,K as At,Q as Dt,S as Ot,R as $e,iu as Lt,a3 as kt}from"./index-DTgUL_kq.js";import{d as Ft,H as at,g as Pt}from"./index-CqyxuFxM.js";import{R as _e,S as _t}from"./actions-BSoY8XcA.js";import{B as Bt}from"./index-CtUHsvTQ.js";import{S as me}from"./shorten-label-qUYJropg.js";import{v as ot}from"./index-Cmrtk-04.js";import{T as zt}from"./html-title-BKasCGZJ.js";import{R as Wt}from"./Refresh-B8uvuAS9.js";import{D as Mt,g as Kt}from"./traffic-QqCF1YrQ.js";import{u as Ht}from"./use-mobile-DsnimkNQ.js";import"./FilterList-Cfx770te.js";import"./CSSTransition-CfJLD8on.js";import"./emotion-cache.browser.esm-DRbBs3XS.js";import"./index-wkMHahcA.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-nDl4Jb8n.js";import"./index-DC1eDdhF.js";import"./TableSearch-DvRPn5Nk.js";import"./Search-Djv8dYGS.js";import"./Clear-BLlKzOYZ.js";import"./MoreVert-Dgq_vg7Y.js";import"./useLocalStorage-CM-c3Psr.js";import"./url-evaluation-CT0SPpn4.js";import"./get-safe-url-73euyU4H.js";import"./ButtonGroup-B8UFaNni.js";import"./getValidReactChildren-RYNnEL64.js";import"./permission-Cjh6O_vg.js";import"./index.esm-DZjUBqeE.js";import"./collapse-CzUrkZT7.js";import"./blocklet-IAGGMJGV.js";import"./Switch-BtvxAY3n.js";import"./iframe-BuacfLs-.js";import"./ChevronLeft-DTV9VYLb.js";import"./ChevronRight-BV25Yw2E.js";import"./index-DBii9-f-.js";import"./base-chart-BBdPuf36.js";import"./index-BFfavAgR.js";import"./AdapterDayjs-C_fZicyZ.js";import"./useThemeProps-Cnj5mhqW.js";import"./visuallyHidden-Dan1xhjv.js";const qt=Ge(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"})),Ut=Ge(e.jsx("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),rt=g.createContext({}),{Provider:$t,Consumer:an}=rt;function Vt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:a}}=gt(),[l,x]=g.useState([]),[u,T]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),f=X(()=>s.meta?.did,[s]),[v,C]=g.useState([]),[F,_]=g.useState({}),N=X(()=>l.length?new Set(l.map(h=>h.id)):new Set,[l]),V=async({page:h=1,pageSize:S=20,...I}={})=>{if(!f)return[];try{const w={paging:{page:h,pageSize:S},...I,teamDid:f,dateRange:I.dateRange?[H(I.dateRange[0]).toISOString(),H(I.dateRange[1]).toISOString()]:void 0},{dids:E,...k}=w;let B="";E&&E.includes("system")&&(B="system");const ae=E?E.filter(oe=>oe!=="system"):[],ne={...k,source:B,componentDids:ae},ee=await n.getNotificationSendLog({input:ne});return _(ne),x(ee.list),T(ee.paging),ee.list}catch(w){return U.error(w.message),[]}},P=async()=>{const h=await n.getNotificationComponents({input:{teamDid:f}});C(h.componentDids)},L=g.useCallback(h=>{const S=s.children.find(I=>I.meta?.did===h);if(S)return S.ancestors=[s],S},[s]),W=async({notificationId:h,receivers:S,channels:I,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:h,receivers:S,channels:I.map(E=>E==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:E==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:E),...w}})},q=g.useCallback(async h=>(await n.getUser({input:{teamDid:f,user:{did:h},options:{enableConnectedAccount:!0}}})).user,[n,f]),Y=g.useCallback(async({page:h=1,pageSize:S=20,...I}={})=>{try{const w={paging:{page:h,pageSize:S},...I,userName:I.searchText||"",teamDid:f,dateRange:I.dateRange?[H(I.dateRange[0]).toISOString(),H(I.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw U.error(w.message),w}},[n,f]);g.useEffect(()=>{f&&P()},[f]),a(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{N.has(h.notificationId)&&V(F)},[N,F]),a(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{N.has(h.id)||V(F)},[N,F]);const Z={fetch:V,data:l,paging:u,blocklet:s,getComponent:L,resendNotification:W,getUser:q,componentDids:v,getReceivers:Y,inService:r,teamDid:f};return e.jsx($t,{value:{notificationRecords:Z},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Gt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Gt[t],children:t})}const Yt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:a,reason:l="",channel:x="wallet"}=n,u=a?t("notification.sendStatus.sentTime",{date:bt(a,s)}):"",T=Yt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:T}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:T,sentTime:u}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Xt=(t,s)=>{const n=te(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Qt=(t,s)=>{const n=te(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Jt=t=>({enabled:te(t,"extra.notifications.wallet",!0)}),Zt=t=>({enabled:te(t,"extra.webhooks",[]).length>0}),be=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),es=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],je=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},ts=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=te(t,l,[]);return je(x)}const n=te(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return je(l)}const a={};return ke.forEach(l=>{const x=`${l}SendRecord`,u=te(t,x,[]),T=je(u);a[l]=T}),r.length>0&&r.forEach(l=>{const x=n[l]??[],u=je(x);a[l]=u}),a},Se=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ss=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function se({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:a,title:l="",sentTime:x="",reason:u=""}=t,T=[l,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"inherit",sx:{fontSize:12},children:T}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(y,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(y,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(y,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[a]}}),e.jsx(y,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[a]}})]}),e.jsx($,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}se.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Ce.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Ce({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:a}=Q();return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs($,{children:[s,": "]}),t.map(l=>{const x=lt(r,a,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(se,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,l)},l)})]})}ze.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function ze({filterList:t,onChange:s,index:n,column:r,filterValues:a,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:a.map(u=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(u.value??u)>-1,onChange:T=>{const f=[...t];T.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(v=>v!==(u.value??u)),s(f[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(se,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:a}){const{t:l,locale:x}=Q(),u=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(se,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:a,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=H().toDate(),[a,l]=g.useState(null),x=g.useCallback(f=>{l(a?null:f.currentTarget)},[a]),u=!!a,T=g.useCallback(f=>{if(!f.startDate||!f.endDate){U.error("Please select a date range");return}if(H(f.startDate).isAfter(f.endDate)||!H(f.startDate).isValid()||!H(f.endDate).isValid()){U.error("Invalid date range");return}s([f.startDate,f.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx($,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(we,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ae,{open:u,anchorEl:a,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Mt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Kt(r),onChange:T})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(a=>a.length).length?null:e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Ft.TableFilterList,{...s,ItemComponent:t})})]})}function Ke({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const a=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...a&&l?{onDelete:a}:{}})}Ke.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const ns=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[a,l]=g.useState(ns),[x,u]=g.useState(!0),T=(v,C)=>{C.checked=v.target.checked;const F=a.map(_=>({..._,checked:_.value===C.value?C.checked:_.checked}));l(F)},f=v=>{v.stopPropagation(),n({channels:a.filter(C=>C.checked).map(C=>C.value),isResendFailedOnly:x})};return e.jsxs(y,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx($,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(y,{className:"choose-channel",children:e.jsxs(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:a.map(v=>e.jsx(Ie,{control:e.jsx(Ee,{checked:v.checked,onChange:C=>T(C,v),name:v.value}),label:v.label},v.value))})]})}),e.jsx(y,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:v=>u(v.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(y,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(we,{onClick:v=>{v.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Xe,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:a}=Q(),l=Qe(),x=g.useMemo(()=>Je(l,ut()),[l]),{getReceivers:u,inService:T,teamDid:f,getUser:v,blocklet:C}=Be(),[F,_]=g.useState(!1),[N,V]=g.useState([]),P=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[W,q]=g.useState(null),[Y,Z]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[h,S]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[I,w]=g.useState([]),E=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],k=async()=>{if(!F&&t)try{_(!0);const i=await u({notificationId:t,...h}),o=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,f,T)}}));V(o),Z(i.paging),_(!1)}catch(i){U.error(i.message),_(!1)}};g.useEffect(()=>{k()},[h]);const B=i=>{i.stopPropagation();const o=i.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,ne={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:Y.page-1,rowsPerPage:Y.pageSize,count:Y.total,searchText:h.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:I,onRowSelectionChange:(i,o)=>{w(o.map(c=>c.dataIndex))},customToolbarSelect:ae},ee=({page:i,rowsPerPage:o,searchText:c,filterList:j})=>{const[,z=[],G=[],K=[]]=j;h.pageSize!==o?S(M=>({...M,pageSize:o,page:1})):h.page!==i+1?S(M=>({...M,page:i+1})):h.searchText!==c?S(M=>({...M,searchText:c,page:1})):pe(z,h.walletSendStatus)?pe(G,h.pushKitSendStatus)?pe(K,h.emailSendStatus)||S(M=>({...M,emailSendStatus:K,page:1})):S(M=>({...M,pushKitSendStatus:G,page:1})):S(M=>({...M,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,o)=>{if(!o)return!1;const c=await v(o);return c?i==="wallet"?Jt(c):i==="email"?Xt(C,c):i==="pushKit"?Qt(C,c):i==="webhook"?Zt(c):!0:!1},[v,C]),ge=g.useCallback(i=>es(r,i),[r]),re=()=>{P.anchorEl=null,P.position=null,q(null)},le=()=>{L.anchorEl=null,L.position=null},m=async(i,o,c=!0,j="")=>{if(!(!o.length||!i.length))try{s(i,o,c,j),L.anchorEl||(await be(.5),re())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:o})=>{const c=I.map(j=>N[j].receiver);await m(i,c,o),await be(.5),le(),w([])},b=async(i,o=[],c=!0)=>{try{await m(["webhook"],[i.receiver],c,o)}catch(j){U.error(j.response?j.response.statusText:j.message)}},R=async(i,o,c,j=[],z=!0)=>{if(i.stopPropagation(),ts(o,c)>=4){U.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await b(o,j,z);return}if(i){const K=i.currentTarget,M=K.getBoundingClientRect();P.anchorEl=K,P.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}q({channel:c});try{const K=await oe(c,o.receiver);await be(1),q({channel:c,result:K}),(typeof K=="boolean"&&K||St(K)&&Object.values(K).every(M=>!!M))&&(await s([c],[o.receiver],z),L.anchorEl||(await be(.5),re()))}catch(K){U.error(K.message)}},O=i=>{S(o=>({...o,dateRange:i,page:1}))},A=(i,o,c,j)=>{i.stopPropagation();const z=c.filter(G=>G!==o);S(G=>({...G,[j]:z,page:1}))},J=X(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:o,receiver:c}=N[i];return o?e.jsxs(y,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(yt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:h.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[1].options.filterList,"walletSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:o,index:c,column:j,filterValues:E})},customBodyRenderLite:i=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"wallet",onResend:z=>R(z,N[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"pushkit",onResend:z=>R(z,N[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:h.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[2].options.filterList,"pushKitSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"email",onResend:z=>R(z,N[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:h.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[3].options.filterList,"emailSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Email",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:o}=N[i];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[j,z]=c,G=z[0];return e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(y,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:j},j),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:K=>R(K,N[i],"webhook",[j],!1)})]},j)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:o}=N[i];return e.jsx(et,{value:o,locale:a,shouldUpdate:!0})}}}],[N,a,h,r]),xe=[e.jsx(We,{value:h.dateRange,onChange:O},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:F,startIcon:e.jsx(Wt,{}),onClick:()=>k(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(y,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(as,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:a,loading:F,columns:J,data:N,onChange:ee,options:ne,customButtons:xe,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:o=>e.jsx(Ke,{...o,canDelete:()=>!1})})}}),P.anchorEl&&e.jsx(Ae,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(os,{children:[e.jsxs($,{variant:"body1",component:"div",className:"check-title",children:[W?.channel," Checking"]}),e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:ge(W?.channel).map(i=>{const{type:o,pass:c,fail:j}=i;return!W?.result||W?.result?.[o]?e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:W?.result?.[o]?ye.success.main:"inherit"},children:[W?.result?e.jsx(Ut,{}):e.jsx(Xe,{size:12,sx:{color:ye.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:ye.error.main},children:[e.jsx(qt,{}),e.jsx("span",{children:j})]},o)})})]})}),L.anchorEl&&e.jsx(Ae,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:le,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:le,onConfirm:p})})]})})})}const is=g.memo(ft),as=ie.div`
|
|
1
|
+
import{aF as Ge,j as e,bn as gt,r as g,bz as X,bf as H,H as U,aH as D,p as xt,o as d,h as te,at as bt,ay as jt,M as y,T as $,m as Q,eO as Fe,P as Pe,ik as Ye,bj as Te,aU as Ie,U as Ee,dI as we,b3 as qe,b1 as Ae,C as Xe,f as Qe,f0 as Je,aP as De,W as yt,as as Ze,il as et,v as Oe,f2 as tt,fo as ye,fI as st,dC as St,s as ie,af as pe,G as Ue,au as vt,im as Ct,io as Nt,$ as nt,ip as wt,iq as Rt,ir as Tt,is as It,O as Et,bu as it,K as At,Q as Dt,S as Ot,R as $e,it as Lt,a3 as kt}from"./index-CI4dlXTe.js";import{d as Ft,H as at,g as Pt}from"./index-h_zu579g.js";import{R as _e,S as _t}from"./actions-DheKYBlc.js";import{B as Bt}from"./index-CzA1rttv.js";import{S as me}from"./shorten-label-DTPTvpJ1.js";import{v as ot}from"./index-BkM0NufG.js";import{T as zt}from"./html-title-8eEQvwSm.js";import{R as Wt}from"./Refresh-r7y4CgN5.js";import{D as Mt,g as Kt}from"./traffic-wbGiv6hW.js";import{u as Ht}from"./use-mobile-CuAbTch1.js";import"./FilterList-Y719g2Zi.js";import"./CSSTransition-DsMKw-p5.js";import"./emotion-cache.browser.esm-BVx7paDx.js";import"./index-_d7QPgTP.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-CHA3TYmk.js";import"./index-w_ABp53I.js";import"./TableSearch-BwtXbQG-.js";import"./Search-CGTjTzzo.js";import"./Clear-NASbJHS6.js";import"./MoreVert-BQ022_rm.js";import"./useLocalStorage-CoABMXGW.js";import"./url-evaluation-Bsg9-ill.js";import"./get-safe-url-CwiNWKY8.js";import"./ButtonGroup-o6LmfxeX.js";import"./getValidReactChildren-BiC2BfQo.js";import"./permission-CY9xhitI.js";import"./index.esm-ItCPJOAO.js";import"./collapse-C5JgD0iT.js";import"./blocklet-DwOY6PM2.js";import"./Switch-DYjTi7gg.js";import"./iframe-BS88FRwX.js";import"./ChevronLeft-D4CgzTJY.js";import"./ChevronRight-DXz-F6L7.js";import"./index-DBii9-f-.js";import"./base-chart-DWjEmmtF.js";import"./index-BlmPoc3t.js";import"./AdapterDayjs-V0ywFO6Q.js";import"./useThemeProps-DJWWp5kh.js";import"./visuallyHidden-Dan1xhjv.js";const qt=Ge(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"})),Ut=Ge(e.jsx("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),rt=g.createContext({}),{Provider:$t,Consumer:an}=rt;function Vt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:a}}=gt(),[l,x]=g.useState([]),[u,T]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),f=X(()=>s.meta?.did,[s]),[v,C]=g.useState([]),[F,_]=g.useState({}),N=X(()=>l.length?new Set(l.map(h=>h.id)):new Set,[l]),V=async({page:h=1,pageSize:S=20,...I}={})=>{if(!f)return[];try{const w={paging:{page:h,pageSize:S},...I,teamDid:f,dateRange:I.dateRange?[H(I.dateRange[0]).toISOString(),H(I.dateRange[1]).toISOString()]:void 0},{dids:E,...k}=w;let B="";E&&E.includes("system")&&(B="system");const ae=E?E.filter(oe=>oe!=="system"):[],ne={...k,source:B,componentDids:ae},ee=await n.getNotificationSendLog({input:ne});return _(ne),x(ee.list),T(ee.paging),ee.list}catch(w){return U.error(w.message),[]}},P=async()=>{const h=await n.getNotificationComponents({input:{teamDid:f}});C(h.componentDids)},L=g.useCallback(h=>{const S=s.children.find(I=>I.meta?.did===h);if(S)return S.ancestors=[s],S},[s]),W=async({notificationId:h,receivers:S,channels:I,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:h,receivers:S,channels:I.map(E=>E==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:E==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:E),...w}})},q=g.useCallback(async h=>(await n.getUser({input:{teamDid:f,user:{did:h},options:{enableConnectedAccount:!0}}})).user,[n,f]),Y=g.useCallback(async({page:h=1,pageSize:S=20,...I}={})=>{try{const w={paging:{page:h,pageSize:S},...I,userName:I.searchText||"",teamDid:f,dateRange:I.dateRange?[H(I.dateRange[0]).toISOString(),H(I.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw U.error(w.message),w}},[n,f]);g.useEffect(()=>{f&&P()},[f]),a(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{N.has(h.notificationId)&&V(F)},[N,F]),a(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{N.has(h.id)||V(F)},[N,F]);const Z={fetch:V,data:l,paging:u,blocklet:s,getComponent:L,resendNotification:W,getUser:q,componentDids:v,getReceivers:Y,inService:r,teamDid:f};return e.jsx($t,{value:{notificationRecords:Z},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Gt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Gt[t],children:t})}const Yt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:a,reason:l="",channel:x="wallet"}=n,u=a?t("notification.sendStatus.sentTime",{date:bt(a,s)}):"",T=Yt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:T}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:T,sentTime:u}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Xt=(t,s)=>{const n=te(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Qt=(t,s)=>{const n=te(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Jt=t=>({enabled:te(t,"extra.notifications.wallet",!0)}),Zt=t=>({enabled:te(t,"extra.webhooks",[]).length>0}),be=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),es=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],je=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},ts=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=te(t,l,[]);return je(x)}const n=te(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return je(l)}const a={};return ke.forEach(l=>{const x=`${l}SendRecord`,u=te(t,x,[]),T=je(u);a[l]=T}),r.length>0&&r.forEach(l=>{const x=n[l]??[],u=je(x);a[l]=u}),a},Se=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ss=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function se({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:a,title:l="",sentTime:x="",reason:u=""}=t,T=[l,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"inherit",sx:{fontSize:12},children:T}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(y,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(y,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(y,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[a]}}),e.jsx(y,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[a]}})]}),e.jsx($,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}se.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Ce.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Ce({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:a}=Q();return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs($,{children:[s,": "]}),t.map(l=>{const x=lt(r,a,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(se,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,l)},l)})]})}ze.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function ze({filterList:t,onChange:s,index:n,column:r,filterValues:a,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:a.map(u=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(u.value??u)>-1,onChange:T=>{const f=[...t];T.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(v=>v!==(u.value??u)),s(f[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(se,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:a}){const{t:l,locale:x}=Q(),u=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(se,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:a,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=H().toDate(),[a,l]=g.useState(null),x=g.useCallback(f=>{l(a?null:f.currentTarget)},[a]),u=!!a,T=g.useCallback(f=>{if(!f.startDate||!f.endDate){U.error("Please select a date range");return}if(H(f.startDate).isAfter(f.endDate)||!H(f.startDate).isValid()||!H(f.endDate).isValid()){U.error("Invalid date range");return}s([f.startDate,f.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx($,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(we,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ae,{open:u,anchorEl:a,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Mt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Kt(r),onChange:T})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(a=>a.length).length?null:e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Ft.TableFilterList,{...s,ItemComponent:t})})]})}function Ke({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const a=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...a&&l?{onDelete:a}:{}})}Ke.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const ns=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[a,l]=g.useState(ns),[x,u]=g.useState(!0),T=(v,C)=>{C.checked=v.target.checked;const F=a.map(_=>({..._,checked:_.value===C.value?C.checked:_.checked}));l(F)},f=v=>{v.stopPropagation(),n({channels:a.filter(C=>C.checked).map(C=>C.value),isResendFailedOnly:x})};return e.jsxs(y,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx($,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(y,{className:"choose-channel",children:e.jsxs(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:a.map(v=>e.jsx(Ie,{control:e.jsx(Ee,{checked:v.checked,onChange:C=>T(C,v),name:v.value}),label:v.label},v.value))})]})}),e.jsx(y,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:v=>u(v.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(y,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(we,{onClick:v=>{v.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Xe,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:a}=Q(),l=Qe(),x=g.useMemo(()=>Je(l,ut()),[l]),{getReceivers:u,inService:T,teamDid:f,getUser:v,blocklet:C}=Be(),[F,_]=g.useState(!1),[N,V]=g.useState([]),P=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[W,q]=g.useState(null),[Y,Z]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[h,S]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[I,w]=g.useState([]),E=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],k=async()=>{if(!F&&t)try{_(!0);const i=await u({notificationId:t,...h}),o=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,f,T)}}));V(o),Z(i.paging),_(!1)}catch(i){U.error(i.message),_(!1)}};g.useEffect(()=>{k()},[h]);const B=i=>{i.stopPropagation();const o=i.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,ne={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:Y.page-1,rowsPerPage:Y.pageSize,count:Y.total,searchText:h.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:I,onRowSelectionChange:(i,o)=>{w(o.map(c=>c.dataIndex))},customToolbarSelect:ae},ee=({page:i,rowsPerPage:o,searchText:c,filterList:j})=>{const[,z=[],G=[],K=[]]=j;h.pageSize!==o?S(M=>({...M,pageSize:o,page:1})):h.page!==i+1?S(M=>({...M,page:i+1})):h.searchText!==c?S(M=>({...M,searchText:c,page:1})):pe(z,h.walletSendStatus)?pe(G,h.pushKitSendStatus)?pe(K,h.emailSendStatus)||S(M=>({...M,emailSendStatus:K,page:1})):S(M=>({...M,pushKitSendStatus:G,page:1})):S(M=>({...M,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,o)=>{if(!o)return!1;const c=await v(o);return c?i==="wallet"?Jt(c):i==="email"?Xt(C,c):i==="pushKit"?Qt(C,c):i==="webhook"?Zt(c):!0:!1},[v,C]),ge=g.useCallback(i=>es(r,i),[r]),re=()=>{P.anchorEl=null,P.position=null,q(null)},le=()=>{L.anchorEl=null,L.position=null},m=async(i,o,c=!0,j="")=>{if(!(!o.length||!i.length))try{s(i,o,c,j),L.anchorEl||(await be(.5),re())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:o})=>{const c=I.map(j=>N[j].receiver);await m(i,c,o),await be(.5),le(),w([])},b=async(i,o=[],c=!0)=>{try{await m(["webhook"],[i.receiver],c,o)}catch(j){U.error(j.response?j.response.statusText:j.message)}},R=async(i,o,c,j=[],z=!0)=>{if(i.stopPropagation(),ts(o,c)>=4){U.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await b(o,j,z);return}if(i){const K=i.currentTarget,M=K.getBoundingClientRect();P.anchorEl=K,P.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}q({channel:c});try{const K=await oe(c,o.receiver);await be(1),q({channel:c,result:K}),(typeof K=="boolean"&&K||St(K)&&Object.values(K).every(M=>!!M))&&(await s([c],[o.receiver],z),L.anchorEl||(await be(.5),re()))}catch(K){U.error(K.message)}},O=i=>{S(o=>({...o,dateRange:i,page:1}))},A=(i,o,c,j)=>{i.stopPropagation();const z=c.filter(G=>G!==o);S(G=>({...G,[j]:z,page:1}))},J=X(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:o,receiver:c}=N[i];return o?e.jsxs(y,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(yt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:h.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[1].options.filterList,"walletSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:o,index:c,column:j,filterValues:E})},customBodyRenderLite:i=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"wallet",onResend:z=>R(z,N[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"pushkit",onResend:z=>R(z,N[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:h.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[2].options.filterList,"pushKitSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"email",onResend:z=>R(z,N[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:h.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[3].options.filterList,"emailSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Email",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:o}=N[i];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[j,z]=c,G=z[0];return e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(y,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:j},j),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:K=>R(K,N[i],"webhook",[j],!1)})]},j)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:o}=N[i];return e.jsx(et,{value:o,locale:a,shouldUpdate:!0})}}}],[N,a,h,r]),xe=[e.jsx(We,{value:h.dateRange,onChange:O},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:F,startIcon:e.jsx(Wt,{}),onClick:()=>k(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(y,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(as,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:a,loading:F,columns:J,data:N,onChange:ee,options:ne,customButtons:xe,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:o=>e.jsx(Ke,{...o,canDelete:()=>!1})})}}),P.anchorEl&&e.jsx(Ae,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(os,{children:[e.jsxs($,{variant:"body1",component:"div",className:"check-title",children:[W?.channel," Checking"]}),e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:ge(W?.channel).map(i=>{const{type:o,pass:c,fail:j}=i;return!W?.result||W?.result?.[o]?e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:W?.result?.[o]?ye.success.main:"inherit"},children:[W?.result?e.jsx(Ut,{}):e.jsx(Xe,{size:12,sx:{color:ye.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:ye.error.main},children:[e.jsx(qt,{}),e.jsx("span",{children:j})]},o)})})]})}),L.anchorEl&&e.jsx(Ae,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:le,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:le,onConfirm:p})})]})})})}const is=g.memo(ft),as=ie.div`
|
|
2
2
|
td.MuiTableCell-footer {
|
|
3
3
|
border: none !important;
|
|
4
4
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
2
|
-
import{aF as qe,j as e,ds as ws,gD as _s,ix as Ss,m as ce,bn as ye,M as O,ay as je,H as V,o as g,f as gt,r as R,g as we,bB as st,b as Ce,I as ee,V as Bn,bA as ft,X as xe,iy as Es,t as ve,s as oe,a3 as me,aV as so,T as le,$ as Yt,dH as mt,y as ke,b8 as ks,bF as Rs,aH as H,b1 as Ts,gp as Ps,gq as Is,C as be,f5 as io,hz as qn,x as Ds,aw as Gt,w as Bs,iz as Os,iA as Us,v as Be,iB as Ns,Y as Ls,_ as As,iC as ao,bo as lo,R as Ne,f7 as Ms,f2 as zs,aA as qs,aB as Fs,bk as $s,aC as Ws,aD as fe,aO as Hs,cO as Gs,S as Ks,eO as or,bi as Vs,h as Ys,dw as It,iD as Zs,g2 as co,iE as Qs,iF as Xs,ez as pe,iG as uo,dF as Js,gS as ei,he as ti,fS as ni,iH as ri,cF as sr,hu as Fn,au as oi,dI as Zt,dp as Me,br as si,bs as ir,z as po,cr as ii,G as ze,aP as ar,fP as fo,cs as Ke,ha as ai,bz as kt,ck as lr,hC as li,fm as cr,bg as ci,L as xt,E as mo,bm as di,Z as ui,N as Rt,aZ as $n,iI as pi,a_ as Le,az as dr,cM as fi,ac as it,aM as ho,bT as Wn,cx as mi,iJ as hi,b9 as gi,A as go,aU as On,p as xi,aS as ut,O as un,W as yi,bC as xo,aJ as vi,bu as Ci,aR as bi,fd as ur,ga as pr,gb as fr,U as mr,cL as ji,gc as wi,bS as _i,iK as Si}from"./index-DTgUL_kq.js";import{y as Ei}from"./index-DC1eDdhF.js";import{a as ki,c as Ri,d as Ti,u as Hn,R as Pi}from"./actions-BSoY8XcA.js";import{S as Ii}from"./switch-control-DaLS546c.js";import{u as De}from"./blocklet-IAGGMJGV.js";import{P as Un,w as Qt}from"./permission-Cjh6O_vg.js";import{E as yo}from"./Edit-DrhdrT5r.js";import{T as Di,M as Bi,t as Oi}from"./table-icons-BkGCumri.js";import{s as Ui,F as vo,L as Ni,I as Li,a as Tt,S as Ai,B as Mi}from"./preference-DmDF-9zQ.js";import{C as hr}from"./click-to-copy-B8TemOOI.js";import{v as pn}from"./index-CLfLgOcG.js";import{A as zi}from"./Add-CPP2iq1t.js";import{A as Xt}from"./Link-CbeDJYWI.js";import{C as qi,c as Fi,b as $i,f as Co,A as Wi,_ as Hi,a as Gi,e as Ki,d as bo,s as Vi,L as Yi,u as Zi,g as Qi,S as Xi}from"./item-rv42JECv.js";import{T as Ji,L as ea,a as Nn,u as gr,W as ta,P as na}from"./index-CV7nG2ul.js";import{e as jo}from"./engine-BskDM1z4.js";import{u as ra,C as oa,D as sa,a as ia,b as aa}from"./connect-to-CVSL3PnV.js";import{C as la,u as ca,A as da}from"./agreement-DKUxCfnZ.js";import{A as ua,a as pa,b as fa,c as ma,R as ot,S as dt}from"./collapse-CzUrkZT7.js";import{D as wo}from"./Done-CV1WQndD.js";import{C as ha}from"./Google-BzDCB92M.js";import{I as _o,f as ga,a as xa,B as ya}from"./install-from-url-CcBy5URE.js";import{a as xr}from"./api-NQY55sw9.js";import{v as So,e as va,a as Kt}from"./util-697UkaoT.js";import{u as Eo}from"./use-mobile-DsnimkNQ.js";import{A as Ca}from"./ArrowDropDown-WDxAjlut.js";import{u as ba}from"./useLocalStorage-CM-c3Psr.js";import{r as Jt}from"./index-XZFG9Nmo.js";import{b as en}from"./without-wallet-B_mB7V7Y.js";import{E as ko}from"./ErrorOutline-CTbGiGqZ.js";import{H as ja}from"./HelpOutline-lLOp8ZZO.js";import{C as wa}from"./lock.svg-CW50QWyX.js";import{D as tn,R as _a,a as yr}from"./url-evaluation-CT0SPpn4.js";import{L as Ro}from"./Launch-C8YfDHGR.js";import{D as Sa}from"./delete-confirm-BtX2gH4O.js";import{W as ht,B as To}from"./status-BsrsqdGC.js";import{A as Po}from"./actions-D3Odd9Yn.js";import{v as fn}from"./index-Cmrtk-04.js";import{t as Ea}from"./toUpper-C_yFC8uF.js";import{S as ka}from"./Switch-BtvxAY3n.js";import{a as Ra}from"./team-D7kOXsCz.js";import"./MoreVert-Dgq_vg7Y.js";import"./get-safe-url-73euyU4H.js";import"./ButtonGroup-B8UFaNni.js";import"./getValidReactChildren-RYNnEL64.js";import"./FilterList-Cfx770te.js";import"./CSSTransition-CfJLD8on.js";import"./emotion-cache.browser.esm-DRbBs3XS.js";import"./index-DBii9-f-.js";import"./typeof-QjJsDpFa.js";import"./raf-schd.esm-DhD0av-m.js";import"./redux-DfszZyTl.js";import"./useThemeProps-Cnj5mhqW.js";import"./html-title-BKasCGZJ.js";import"./Clear-BLlKzOYZ.js";import"./ChevronRight-BV25Yw2E.js";import"./ChevronLeft-DTV9VYLb.js";import"./Search-Djv8dYGS.js";import"./omit-Bo6UNg3a.js";import"./edit.svg-sU05Ggc3.js";import"./index-DXCxMet4.js";import"./iframe-BuacfLs-.js";import"./Verified-Bq_Wx0qC.js";import"./Autocomplete-BxF5Rvbu.js";import"./ListSubheader-BdUpkkMj.js";import"./VerifiedUser-Dib9C-dd.js";import"./DeleteOutline-1ia7MYDd.js";import"./url-join-C5dWHLIk.js";import"./index-BojVbZw0.js";import"./spaces-CPJZ8D5i.js";import"./OpenInNew-qKGRXQvM.js";import"./index-DRYJ0xIl.js";import"./index-BaMKae63.js";import"./decode-DPztD6kB.js";import"./cloneDeep-DrGysqIa.js";import"./ListItemButton-DnyaGhp1.js";import"./Stepper-CNcPZVkm.js";import"./is-path-prefix-equal-lXhGy4Qe.js";const Ta=qe(e.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"})),Pa=qe(e.jsx("path",{d:"m19 8-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4z"})),Io=qe(e.jsx("path",{d:"M22 5.18 10.59 16.6l-4.24-4.24 1.41-1.41 2.83 2.83 10-10zm-2.21 5.04c.13.57.21 1.17.21 1.78 0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8c1.58 0 3.04.46 4.28 1.25l1.44-1.44C16.1 2.67 14.13 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-1.19-.22-2.33-.6-3.39z"})),Ia=qe(e.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"})),Do=qe(e.jsx("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"})),Da=qe(e.jsx("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"})),Ba=qe(e.jsx("path",{d:"M5 20h14v-2H5zm0-10h4v6h6v-6h4l-7-7z"})),Oa=qe(e.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"})),Ua=qe(e.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}));function vr(t,r){var n={};return r=ws(r),_s(t,function(i,a,s){Ss(n,a,r(i,a,s))}),n}function Bo({children:t=null,...r}){const{t:n}=ce(),{api:i}=ye(),{blocklet:a}=De(),s=a?.settings?.autoCheckUpdate,m=async l=>{await i.updateAutoCheckUpdate({input:{did:a.meta.did,autoCheckUpdate:l}})},c=async()=>{try{const l=!s?.enabled;await m({enabled:l}),V.success(n(l?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(l){V.error(l.message)}},d=!!s?.enabled;return e.jsxs(O,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[t,e.jsx(je,{title:n("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:e.jsx("div",{children:e.jsx(Ii,{checked:d,onChange:c,name:"enableWelcomePage",style:{...r.style,zoom:.8}})})})]})}Bo.propTypes={children:g.any};function Cr(t){function r({sx:n,...i}){return e.jsx(t,{...i,sx:{color:"text.primary",...n}})}return r}const Na={...vr(Oi,Cr),...vr(ki,Cr)},La=(t,r)=>{let{description:n}=t;return(Object.values(Ce.CHAIN_PROP_MAP).includes(t.key)||ee.isEnvShareable(t))&&(n?n=`${n} (${r("blocklet.config.sharedToAllComponents")})`:n=r("blocklet.config.sharedToAllComponents")),n&&e.jsx("div",{style:{marginLeft:12},children:n})},mn=(t,r,n=[])=>!n?.length&&!t.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(t.key)&&!r.meta.environments.find(i=>i.name===t.key)&&r.children.every(i=>!i.meta.environments.find(a=>a.name===t.key))?!0:t.custom,br=t=>[Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)?!0:!(t.startsWith("BLOCKLET_")||t.startsWith("COMPONENT_")),hn=t=>[Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)===!1;function Oo({blocklet:t,ancestors:r=[]}){const n=ye(),{palette:i}=gt(),{inService:a}=n,{t:s}=R.useContext(we),m=[...r.map(o=>o.meta.did),t.meta.did],c=()=>V.success(s("blocklet.config.changedTip")),d=o=>mn(o,t,r);if(st(t.status)||t.status==="unknown"&&st(t.status))return null;const l=o=>new Promise(async(h,b)=>{if(!o.key.trim()||!o.value.trim()){V.error(s("blocklet.config.environment.keyValueRequired")),b();return}if(br(o.key)===!1){V.error(s("blocklet.config.environment.invalidKey")),b();return}o.custom=hn(o.key);try{const T=await n.api.configBlocklet({input:{did:m,configs:[o]}});c(T.blocklet),h()}catch(T){V.error(xe(T)),b()}}),y=(o,h)=>new Promise(async(b,T)=>{if(o.required&&(!o.key.trim()||!o.value.trim())){V.error(s("blocklet.config.environment.keyValueRequired")),T();return}if(br(o.key)===!1){V.error(s("blocklet.config.environment.invalidKey")),T();return}if(o.key===Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const M=Es(o);if(M){V.error(M),T();return}}const E=[{...o,value:o.secure&&o.value==="__encrypted__"?"":o.value}];if(o.key!==h.key){if(!mn(o,t,r)){V.error("Only key of custom env can be changed"),T();return}E.push({key:h.key,custom:hn(o.key)})}try{const M=await n.api.configBlocklet({input:{did:m,configs:E}});c(M.blocklet),b()}catch(M){V.error(xe(M)),T()}}),p=o=>new Promise(async(h,b)=>{if(o.required){V.error(s("blocklet.config.environment.deleteForbidden")),b();return}if(!mn(o,t,r)){V.error("Only key of custom env can be changed"),b();return}try{const T=await n.api.configBlocklet({input:{did:m,configs:[{key:o.key,custom:hn(o.key)}]}});c(T.blocklet),h()}catch(T){V.error(xe(T)),b()}}),C=(t.configs||[]).filter(o=>!Ce.BLOCKLET_CONFIGURABLE_KEY[o.key]||[Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(o.key)),f=ee.getSharedConfigObj(r[0],t),x=ee.getComponentMissingConfigs(t,r[0]),_=C.map(o=>({...o,value:Object.values(Ce.CHAIN_PROP_MAP).includes(o.key)&&Object.keys(f).includes(o.key)?f[o.key]:f[o.key]||o.value})),w=_.some(o=>o.key&&o.key.startsWith("BWA_")),S={onRowAdd:l,onRowUpdate:y,onRowDelete:p,isDeletable:d},u=()=>[{title:s("common.key"),field:"key",initialEditValue:"",width:"30%",render:o=>e.jsx(hr,{value:o.value,style:{color:o.required&&!o.value?i.error.main:i.text.primary,fontWeight:o.required?"bold":"normal"},children:o.key}),editComponent:o=>{const{value:h,rowData:b,onChange:T}=o;return e.jsx(jr,{children:e.jsx(ve,{fullWidth:!0,size:"small",value:Ui.escapeTag(h),onChange:E=>T(E.target.value),variant:"outlined",label:"Key",placeholder:s("blocklet.config.environment.key"),margin:"dense",autoFocus:!0,slotProps:{input:{readOnly:d(b)===!1}}})})}},{title:s("common.value"),field:"value",initialEditValue:"",width:"calc((100% - (96px + 30%)) / 1)",render:o=>o.value?o.secure?"******":e.jsx(hr,{unstyled:!0,value:o.value,style:{wordBreak:"break-all"},children:o.value}):null,editComponent:o=>{const{value:h,rowData:b,onChange:T}=o;return e.jsxs(jr,{children:[e.jsx(ve,{fullWidth:!0,size:"small",value:h==="__encrypted__"?"":h,onChange:E=>T(E.target.value),variant:"outlined",label:s("common.value"),placeholder:s("blocklet.config.environment.value"),margin:"dense"}),La(b,s)]})}}];return e.jsxs(Aa,{children:[!!x.length&&e.jsx(Bn,{severity:"error",style:{marginTop:24},children:s("blocklet.config.missingRequired")}),w&&e.jsx(Bn,{severity:"info",children:s("blocklet.config.environment.tip")}),e.jsx(Un,{permission:a?"":"mutate_blocklets",role:a?ft:[],children:o=>e.jsx(Di,{className:"config-table",children:e.jsx(Bi,{title:e.jsx(O,{sx:{fontWeight:"bold"},children:s("common.environments")}),columns:u(),icons:Na,options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1,actionsCellStyle:{padding:"0",textAlign:"right",width:"80px"}},localization:{header:{actions:s("common.actions")},body:{emptyDataSourceMessage:s("common.noData")}},data:_,editable:o?S:{}})})})]})}Oo.propTypes={blocklet:g.object.isRequired,ancestors:g.array};const Aa=oe.div`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CT8o9Y85.js","./index-CI4dlXTe.js","./index-DGkT7afN.css","./url-join-DpnUEv7-.js","./index-DgZWZUlS.js","./_createAggregator-nGamgeOn.js","./depsEqual-CHA3TYmk.js","./index-Cw4aE7m_.js","./index-DRYJ0xIl.js","./toUpper-jya-zxKt.js","./index-B5LvOF-F.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{aF as qe,j as e,ds as ws,gD as _s,iw as Ss,m as ce,bn as ye,M as O,ay as je,H as V,o as g,f as gt,r as R,g as we,bB as st,b as Ce,I as ee,V as Bn,bA as ft,X as xe,ix as Es,t as ve,s as oe,a3 as me,aV as so,T as le,$ as Yt,dH as mt,y as ke,b8 as ks,bF as Rs,aH as H,b1 as Ts,gp as Ps,gq as Is,C as be,f5 as io,hz as qn,x as Ds,aw as Gt,w as Bs,iy as Os,iz as Us,v as Be,iA as Ns,Y as Ls,_ as As,iB as ao,bo as lo,R as Ne,f7 as Ms,f2 as zs,aA as qs,aB as Fs,bk as $s,aC as Ws,aD as fe,aO as Hs,cO as Gs,S as Ks,eO as or,bi as Vs,h as Ys,dw as It,iC as Zs,g2 as co,iD as Qs,iE as Xs,ez as pe,iF as uo,dF as Js,gS as ei,he as ti,fS as ni,iG as ri,cF as sr,hu as Fn,au as oi,dI as Zt,dp as Me,br as si,bs as ir,z as po,cr as ii,G as ze,aP as ar,fP as fo,cs as Ke,ha as ai,bz as kt,ck as lr,hC as li,fm as cr,bg as ci,L as xt,E as mo,bm as di,Z as ui,N as Rt,aZ as $n,iH as pi,a_ as Le,az as dr,cM as fi,ac as it,aM as ho,bT as Wn,cx as mi,iI as hi,b9 as gi,A as go,aU as On,p as xi,aS as ut,O as un,W as yi,bC as xo,aJ as vi,bu as Ci,aR as bi,fd as ur,ga as pr,gb as fr,U as mr,cL as ji,gc as wi,bS as _i,iJ as Si}from"./index-CI4dlXTe.js";import{y as Ei}from"./index-w_ABp53I.js";import{a as ki,c as Ri,d as Ti,u as Hn,R as Pi}from"./actions-DheKYBlc.js";import{S as Ii}from"./switch-control-D1F-cHNq.js";import{u as De}from"./blocklet-DwOY6PM2.js";import{P as Un,w as Qt}from"./permission-CY9xhitI.js";import{E as yo}from"./Edit-V0eiBsGU.js";import{T as Di,M as Bi,t as Oi}from"./table-icons-CcdGfjTh.js";import{s as Ui,F as vo,L as Ni,I as Li,a as Tt,S as Ai,B as Mi}from"./preference-DV6_upOl.js";import{C as hr}from"./click-to-copy-QDhx8_BO.js";import{v as pn}from"./index-DGINP96S.js";import{A as zi}from"./Add-CzkO3Pzz.js";import{A as Xt}from"./Link-qCg-dCX5.js";import{C as qi,c as Fi,b as $i,f as Co,A as Wi,_ as Hi,a as Gi,e as Ki,d as bo,s as Vi,L as Yi,u as Zi,g as Qi,S as Xi}from"./item-gJv-5KQT.js";import{T as Ji,L as ea,a as Nn,u as gr,W as ta,P as na}from"./index-nOMeb0Cp.js";import{e as jo}from"./engine-BcZHSV9-.js";import{u as ra,C as oa,D as sa,a as ia,b as aa}from"./connect-to-CKdf31e5.js";import{C as la,u as ca,A as da}from"./agreement-CHm-YwcP.js";import{A as ua,a as pa,b as fa,c as ma,R as ot,S as dt}from"./collapse-C5JgD0iT.js";import{D as wo}from"./Done-D4PPkPui.js";import{C as ha}from"./Google-B3YPvJDV.js";import{I as _o,f as ga,a as xa,B as ya}from"./install-from-url-DvUzVhpS.js";import{a as xr}from"./api-D4aKRawp.js";import{v as So,e as va,a as Kt}from"./util-BdUmm2ZH.js";import{u as Eo}from"./use-mobile-CuAbTch1.js";import{A as Ca}from"./ArrowDropDown-190S9d7I.js";import{u as ba}from"./useLocalStorage-CoABMXGW.js";import{r as Jt}from"./index-DgZWZUlS.js";import{b as en}from"./without-wallet-v9tjrlHV.js";import{E as ko}from"./ErrorOutline-DA3_RUVz.js";import{H as ja}from"./HelpOutline-c-XuWHxw.js";import{C as wa}from"./lock.svg-Dml_SUcw.js";import{D as tn,R as _a,a as yr}from"./url-evaluation-Bsg9-ill.js";import{L as Ro}from"./Launch-COjBPQdg.js";import{D as Sa}from"./delete-confirm-DFLlapHl.js";import{W as ht,B as To}from"./status-DX1yJUTs.js";import{A as Po}from"./actions-6ll7jsa3.js";import{v as fn}from"./index-BkM0NufG.js";import{t as Ea}from"./toUpper-jya-zxKt.js";import{S as ka}from"./Switch-DYjTi7gg.js";import{a as Ra}from"./team-BrSgmhmc.js";import"./MoreVert-BQ022_rm.js";import"./get-safe-url-CwiNWKY8.js";import"./ButtonGroup-o6LmfxeX.js";import"./getValidReactChildren-BiC2BfQo.js";import"./FilterList-Y719g2Zi.js";import"./CSSTransition-DsMKw-p5.js";import"./emotion-cache.browser.esm-BVx7paDx.js";import"./index-DBii9-f-.js";import"./typeof-QjJsDpFa.js";import"./raf-schd.esm-pJPdUflv.js";import"./redux-DfszZyTl.js";import"./useThemeProps-DJWWp5kh.js";import"./html-title-8eEQvwSm.js";import"./Clear-NASbJHS6.js";import"./ChevronRight-DXz-F6L7.js";import"./ChevronLeft-D4CgzTJY.js";import"./Search-CGTjTzzo.js";import"./omit-VPuIA8hg.js";import"./edit.svg-CkS6r8rY.js";import"./index-Cw4aE7m_.js";import"./iframe-BS88FRwX.js";import"./Verified-DmBfm1uD.js";import"./Autocomplete-BW388eBP.js";import"./ListSubheader-CA8Y4o8o.js";import"./VerifiedUser-mZGHgzQb.js";import"./DeleteOutline-DsnSViGb.js";import"./url-join-DpnUEv7-.js";import"./index-BojVbZw0.js";import"./spaces-DH7TZUlN.js";import"./OpenInNew-BB6MBnzE.js";import"./index-DRYJ0xIl.js";import"./index-CQ74V8K8.js";import"./decode-DPztD6kB.js";import"./cloneDeep-BGXXbqSz.js";import"./ListItemButton-BTbVPhQ8.js";import"./Stepper-CfXniFN2.js";import"./is-path-prefix-equal-BvAHrQj-.js";const Ta=qe(e.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"})),Pa=qe(e.jsx("path",{d:"m19 8-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4z"})),Io=qe(e.jsx("path",{d:"M22 5.18 10.59 16.6l-4.24-4.24 1.41-1.41 2.83 2.83 10-10zm-2.21 5.04c.13.57.21 1.17.21 1.78 0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8c1.58 0 3.04.46 4.28 1.25l1.44-1.44C16.1 2.67 14.13 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-1.19-.22-2.33-.6-3.39z"})),Ia=qe(e.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"})),Do=qe(e.jsx("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"})),Da=qe(e.jsx("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"})),Ba=qe(e.jsx("path",{d:"M5 20h14v-2H5zm0-10h4v6h6v-6h4l-7-7z"})),Oa=qe(e.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"})),Ua=qe(e.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}));function vr(t,r){var n={};return r=ws(r),_s(t,function(i,a,s){Ss(n,a,r(i,a,s))}),n}function Bo({children:t=null,...r}){const{t:n}=ce(),{api:i}=ye(),{blocklet:a}=De(),s=a?.settings?.autoCheckUpdate,m=async l=>{await i.updateAutoCheckUpdate({input:{did:a.meta.did,autoCheckUpdate:l}})},c=async()=>{try{const l=!s?.enabled;await m({enabled:l}),V.success(n(l?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(l){V.error(l.message)}},d=!!s?.enabled;return e.jsxs(O,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[t,e.jsx(je,{title:n("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:e.jsx("div",{children:e.jsx(Ii,{checked:d,onChange:c,name:"enableWelcomePage",style:{...r.style,zoom:.8}})})})]})}Bo.propTypes={children:g.any};function Cr(t){function r({sx:n,...i}){return e.jsx(t,{...i,sx:{color:"text.primary",...n}})}return r}const Na={...vr(Oi,Cr),...vr(ki,Cr)},La=(t,r)=>{let{description:n}=t;return(Object.values(Ce.CHAIN_PROP_MAP).includes(t.key)||ee.isEnvShareable(t))&&(n?n=`${n} (${r("blocklet.config.sharedToAllComponents")})`:n=r("blocklet.config.sharedToAllComponents")),n&&e.jsx("div",{style:{marginLeft:12},children:n})},mn=(t,r,n=[])=>!n?.length&&!t.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(t.key)&&!r.meta.environments.find(i=>i.name===t.key)&&r.children.every(i=>!i.meta.environments.find(a=>a.name===t.key))?!0:t.custom,br=t=>[Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)?!0:!(t.startsWith("BLOCKLET_")||t.startsWith("COMPONENT_")),hn=t=>[Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)===!1;function Oo({blocklet:t,ancestors:r=[]}){const n=ye(),{palette:i}=gt(),{inService:a}=n,{t:s}=R.useContext(we),m=[...r.map(o=>o.meta.did),t.meta.did],c=()=>V.success(s("blocklet.config.changedTip")),d=o=>mn(o,t,r);if(st(t.status)||t.status==="unknown"&&st(t.status))return null;const l=o=>new Promise(async(h,b)=>{if(!o.key.trim()||!o.value.trim()){V.error(s("blocklet.config.environment.keyValueRequired")),b();return}if(br(o.key)===!1){V.error(s("blocklet.config.environment.invalidKey")),b();return}o.custom=hn(o.key);try{const T=await n.api.configBlocklet({input:{did:m,configs:[o]}});c(T.blocklet),h()}catch(T){V.error(xe(T)),b()}}),y=(o,h)=>new Promise(async(b,T)=>{if(o.required&&(!o.key.trim()||!o.value.trim())){V.error(s("blocklet.config.environment.keyValueRequired")),T();return}if(br(o.key)===!1){V.error(s("blocklet.config.environment.invalidKey")),T();return}if(o.key===Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const M=Es(o);if(M){V.error(M),T();return}}const E=[{...o,value:o.secure&&o.value==="__encrypted__"?"":o.value}];if(o.key!==h.key){if(!mn(o,t,r)){V.error("Only key of custom env can be changed"),T();return}E.push({key:h.key,custom:hn(o.key)})}try{const M=await n.api.configBlocklet({input:{did:m,configs:E}});c(M.blocklet),b()}catch(M){V.error(xe(M)),T()}}),p=o=>new Promise(async(h,b)=>{if(o.required){V.error(s("blocklet.config.environment.deleteForbidden")),b();return}if(!mn(o,t,r)){V.error("Only key of custom env can be changed"),b();return}try{const T=await n.api.configBlocklet({input:{did:m,configs:[{key:o.key,custom:hn(o.key)}]}});c(T.blocklet),h()}catch(T){V.error(xe(T)),b()}}),C=(t.configs||[]).filter(o=>!Ce.BLOCKLET_CONFIGURABLE_KEY[o.key]||[Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(o.key)),f=ee.getSharedConfigObj(r[0],t),x=ee.getComponentMissingConfigs(t,r[0]),_=C.map(o=>({...o,value:Object.values(Ce.CHAIN_PROP_MAP).includes(o.key)&&Object.keys(f).includes(o.key)?f[o.key]:f[o.key]||o.value})),w=_.some(o=>o.key&&o.key.startsWith("BWA_")),S={onRowAdd:l,onRowUpdate:y,onRowDelete:p,isDeletable:d},u=()=>[{title:s("common.key"),field:"key",initialEditValue:"",width:"30%",render:o=>e.jsx(hr,{value:o.value,style:{color:o.required&&!o.value?i.error.main:i.text.primary,fontWeight:o.required?"bold":"normal"},children:o.key}),editComponent:o=>{const{value:h,rowData:b,onChange:T}=o;return e.jsx(jr,{children:e.jsx(ve,{fullWidth:!0,size:"small",value:Ui.escapeTag(h),onChange:E=>T(E.target.value),variant:"outlined",label:"Key",placeholder:s("blocklet.config.environment.key"),margin:"dense",autoFocus:!0,slotProps:{input:{readOnly:d(b)===!1}}})})}},{title:s("common.value"),field:"value",initialEditValue:"",width:"calc((100% - (96px + 30%)) / 1)",render:o=>o.value?o.secure?"******":e.jsx(hr,{unstyled:!0,value:o.value,style:{wordBreak:"break-all"},children:o.value}):null,editComponent:o=>{const{value:h,rowData:b,onChange:T}=o;return e.jsxs(jr,{children:[e.jsx(ve,{fullWidth:!0,size:"small",value:h==="__encrypted__"?"":h,onChange:E=>T(E.target.value),variant:"outlined",label:s("common.value"),placeholder:s("blocklet.config.environment.value"),margin:"dense"}),La(b,s)]})}}];return e.jsxs(Aa,{children:[!!x.length&&e.jsx(Bn,{severity:"error",style:{marginTop:24},children:s("blocklet.config.missingRequired")}),w&&e.jsx(Bn,{severity:"info",children:s("blocklet.config.environment.tip")}),e.jsx(Un,{permission:a?"":"mutate_blocklets",role:a?ft:[],children:o=>e.jsx(Di,{className:"config-table",children:e.jsx(Bi,{title:e.jsx(O,{sx:{fontWeight:"bold"},children:s("common.environments")}),columns:u(),icons:Na,options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1,actionsCellStyle:{padding:"0",textAlign:"right",width:"80px"}},localization:{header:{actions:s("common.actions")},body:{emptyDataSourceMessage:s("common.noData")}},data:_,editable:o?S:{}})})})]})}Oo.propTypes={blocklet:g.object.isRequired,ancestors:g.array};const Aa=oe.div`
|
|
3
3
|
.config-table {
|
|
4
4
|
margin-bottom: 24px;
|
|
5
5
|
position: relative;
|
|
@@ -66,7 +66,7 @@ import{aF as qe,j as e,ds as ws,gD as _s,ix as Ss,m as ce,bn as ye,M as O,ay as
|
|
|
66
66
|
.ux-dialog_closeButton {
|
|
67
67
|
margin: 0;
|
|
68
68
|
}
|
|
69
|
-
`,za=R.lazy(()=>Rs(()=>import("./index-
|
|
69
|
+
`,za=R.lazy(()=>Rs(()=>import("./index-CT8o9Y85.js").then(t=>t.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url).then(t=>({default:t.Uploader}))),qa="/blocklet/component/upload",wr=[".html",".htm",".tgz",".zip"],Fa=Number(window.env?.MAX_UPLOAD_FILE_SIZE)||H.MAX_UPLOAD_FILE_SIZE,$a=Fa*1024*1024;function Uo({did:t,prefix:r,headers:n=()=>({}),onUploaded:i=mt,open:a=!1,onClose:s=mt}){const{t:m,locale:c}=ce(),d=R.useRef(null),l=R.useCallback(y=>{const{status:p,data:C}=y;if(p===200){i(C);return}V.error(m("blocklet.component.addComponentTip.uploadFailed"))},[i,m]);return R.useEffect(()=>{a?d.current?.open():d.current?.close()},[a]),e.jsx(Wa,{id:`component-uploader-${t}`,children:e.jsx(za,{ref:d,locale:c,popup:!0,onUploadFinish:l,plugins:[],onClose:s,installerProps:{disabled:!0},apiPathProps:{uploader:ke(r,qa,t),disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:wr,maxFileSize:$a,maxNumberOfFiles:1}},tusProps:{headers:n},dashboardProps:{note:m("blocklet.component.addComponentTip.allowedFileTypes",{types:wr.map(y=>y.replace(".","")).join(", ")})}})},`component-uploader-${t}`)}Uo.propTypes={did:g.string.isRequired,prefix:g.string.isRequired,open:g.bool,headers:g.func,onUploaded:g.func,onClose:g.func};const Wa=ks(O)`
|
|
70
70
|
.uploader-wrapper {
|
|
71
71
|
display: inline-flex;
|
|
72
72
|
position: relative;
|