@abtnode/webapp 1.17.0-beta-20251105-030013-0c24dbf6 → 1.17.0-beta-20251106-075812-7c2fdd58
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-Dsdzg0fF.js → AdapterDayjs-DalMJwhD.js} +7 -7
- package/dist/assets/{Add-l70J_4yZ.js → Add-BJaOHr9s.js} +1 -1
- package/dist/assets/ArrowDropDown-BvfsnZmc.js +1 -0
- package/dist/assets/{Autocomplete-BGzNUg3v.js → Autocomplete-BtpXOuNf.js} +1 -1
- package/dist/assets/{Breadcrumbs-qX1unYdA.js → Breadcrumbs-CtDi2J-M.js} +1 -1
- package/dist/assets/{ButtonGroup-DWV84mOp.js → ButtonGroup-DPiY53vd.js} +1 -1
- package/dist/assets/{CSSTransition-D0ZJqc3V.js → CSSTransition-Bw2ddZTQ.js} +1 -1
- package/dist/assets/{CallMerge-47e0SFej.js → CallMerge-CGVsnRYH.js} +1 -1
- package/dist/assets/{CardContent-049bCJeP.js → CardContent-ByDsC3UC.js} +1 -1
- package/dist/assets/{ChevronLeft-xNPAnZUM.js → ChevronLeft-gcWuOwnw.js} +1 -1
- package/dist/assets/{ChevronRight-hEVn0ieo.js → ChevronRight-Czhq6YeB.js} +1 -1
- package/dist/assets/{Clear-DmQaaBy1.js → Clear-CKva4eBi.js} +1 -1
- package/dist/assets/{DeleteOutline-CvnvGjYc.js → DeleteOutline-CpaciU3x.js} +1 -1
- package/dist/assets/{Done-rLg9w1bb.js → Done-CLU5BqYw.js} +1 -1
- package/dist/assets/{Edit-BLWQBSLN.js → Edit-BjbXvYad.js} +1 -1
- package/dist/assets/{ErrorOutline-wpxhPFAL.js → ErrorOutline-CSXVYe6M.js} +1 -1
- package/dist/assets/{FilterList-CBCl7dbD.js → FilterList-BJOykCHp.js} +1 -1
- package/dist/assets/{Google--H7JIVD-.js → Google-SHWTgP_i.js} +1 -1
- package/dist/assets/{HelpOutline-dwnyWw6W.js → HelpOutline-EW7qBW6g.js} +1 -1
- package/dist/assets/{KeyboardArrowDown-CqHZKzOB.js → KeyboardArrowDown-BpcBmZwq.js} +1 -1
- package/dist/assets/{Launch-D-brFkhF.js → Launch-DjhPb7Xi.js} +1 -1
- package/dist/assets/{Link-D4UceNDZ.js → Link-sU5sIdSA.js} +1 -1
- package/dist/assets/{ListItemButton-BbKr2tws.js → ListItemButton-BLIqko7v.js} +1 -1
- package/dist/assets/{ListSubheader-CPl5W-Om.js → ListSubheader-Dv-UJcm5.js} +1 -1
- package/dist/assets/{LoadingButton-yUpEuEJK.js → LoadingButton-BZ1m9RXg.js} +1 -1
- package/dist/assets/{MoreVert-Cy81E-t5.js → MoreVert-DDyUOkUj.js} +1 -1
- package/dist/assets/{OpenInNew-B2F4Jqwb.js → OpenInNew-DQYN8Nx1.js} +1 -1
- package/dist/assets/{Refresh-C7TD1E1-.js → Refresh-B0XmjeJ3.js} +1 -1
- package/dist/assets/{Search-nsuHiAfr.js → Search-DhSwmkQ1.js} +1 -1
- package/dist/assets/{Stepper-N4JW-HWm.js → Stepper-Tm_IonK9.js} +1 -1
- package/dist/assets/{Switch-Ch-Dpg3J.js → Switch-C5R2keD_.js} +1 -1
- package/dist/assets/{TableSearch-B7cAFRBU.js → TableSearch-ChIn3Aak.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-BEbdhUkr.js → ToggleButtonGroup-XnP8cE92.js} +1 -1
- package/dist/assets/{UnfoldMore-BJCswty9.js → UnfoldMore-C9BUwV8E.js} +1 -1
- package/dist/assets/{Verified-Cj9BE95b.js → Verified-CHOSEVtj.js} +1 -1
- package/dist/assets/{VerifiedUser-CzoOgILE.js → VerifiedUser-Dixnu8-0.js} +1 -1
- package/dist/assets/{ViewList-DII-BNLQ.js → ViewList-D7yxj6An.js} +1 -1
- package/dist/assets/{_createAggregator-C4guq0cF.js → _createAggregator-DfK7n_7j.js} +1 -1
- package/dist/assets/{actions-C9R61uoD.js → actions-5Y9-88Ql.js} +1 -1
- package/dist/assets/actions-ZeE8iUOI.js +1 -0
- package/dist/assets/{agreement-DtxuiQja.js → agreement-CGBcE16y.js} +1 -1
- package/dist/assets/api-DSc3pJRw.js +1 -0
- package/dist/assets/{appearance-B_sMk1g7.js → appearance-D-m6CFfC.js} +1 -1
- package/dist/assets/{audit-logs-DHuwThvE.js → audit-logs-CWTz8UN2.js} +1 -1
- package/dist/assets/{base-chart-BuPD5Oqs.js → base-chart-7GQt2N1M.js} +1 -1
- package/dist/assets/{blocklet-BMb-DKa8.js → blocklet-CPwKiPX6.js} +1 -1
- package/dist/assets/{chain-DG7hV9jl.js → chain-DjrPrtvj.js} +1 -1
- package/dist/assets/{click-to-copy-BlUoHpyD.js → click-to-copy-DLb2iRRo.js} +1 -1
- package/dist/assets/cloneDeep-DRoc_4OI.js +1 -0
- package/dist/assets/{collapse-DKt3eXVz.js → collapse-CC77PAqz.js} +1 -1
- package/dist/assets/{config-navigation-C1LKuM9I.js → config-navigation-DCTgQWGc.js} +3 -3
- package/dist/assets/{connect-to-UN--0_6w.js → connect-to-CYP6ST4F.js} +2 -2
- package/dist/assets/{cssMode-CLw2RNKf.js → cssMode-BmZ3qBXS.js} +1 -1
- package/dist/assets/{delete-confirm-CCfwND5U.js → delete-confirm-DSvSyiD8.js} +1 -1
- package/dist/assets/{depsEqual-DZ2epQ9y.js → depsEqual-UJplX9mU.js} +1 -1
- package/dist/assets/{detail-DT3mxGBF.js → detail-WlrzKwWy.js} +3 -3
- package/dist/assets/{domains-ByJxly5j.js → domains-CfqnBD4I.js} +2 -2
- package/dist/assets/{download-DYcl5mTN.js → download-H2XmdQXI.js} +1 -1
- package/dist/assets/{edit.svg-DYKibMjZ.js → edit.svg-DVuUM3KB.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-CHmknBa-.js +1 -0
- package/dist/assets/engine-CIf2Bmdn.js +1 -0
- package/dist/assets/{freemarker2-l0VGQqvD.js → freemarker2-DvTkFCdy.js} +1 -1
- package/dist/assets/{get-safe-url-I2vTcMcF.js → get-safe-url-BjGmijAx.js} +1 -1
- package/dist/assets/getValidReactChildren-DJbrx6gC.js +1 -0
- package/dist/assets/{graphqlMode-CA_yndFf.js → graphqlMode-CkxoJJG0.js} +2 -2
- package/dist/assets/{handlebars-BILq1CrH.js → handlebars-DACautrS.js} +1 -1
- package/dist/assets/{html-CoOIbPZt.js → html-CU4f7WqH.js} +1 -1
- package/dist/assets/{html-title-CRD93SB4.js → html-title-Ca-JgCsh.js} +1 -1
- package/dist/assets/{htmlMode-C2G2f8dC.js → htmlMode-DqJjXVio.js} +1 -1
- package/dist/assets/{iframe-SmTUaAma.js → iframe-2aVrQOtY.js} +1 -1
- package/dist/assets/{index-BE13FI7n.js → index-12hGIPsK.js} +1 -1
- package/dist/assets/{index-B78zCe1U.js → index-29YXcG1w.js} +1 -1
- package/dist/assets/{index-NTEIlaHw.js → index-9LSsWDb7.js} +1 -1
- package/dist/assets/{index-CyeREPie.js → index-B2ArczGg.js} +1 -1
- package/dist/assets/{index-BJzB0IwK.js → index-B6TuxWTr.js} +1 -1
- package/dist/assets/{index-CqGdRTFr.js → index-B83_MINe.js} +1 -1
- package/dist/assets/{index-DfDQYXHJ.js → index-BDQcjWHA.js} +1 -1
- package/dist/assets/{index-SpBKG2cj.js → index-BN0b1Gve.js} +1 -1
- package/dist/assets/{index-Ee8S2Bwe.js → index-BRp5NVGY.js} +1 -1
- package/dist/assets/{index-BBJPyEqY.js → index-BgYR95Zy.js} +1 -1
- package/dist/assets/{index-CL4In6gd.js → index-Bi0eEFvN.js} +2 -2
- package/dist/assets/{index-By5xDEFZ.js → index-BiLgRbWh.js} +1 -1
- package/dist/assets/{index-_nnYDXM-.js → index-Bl14cNgY.js} +1 -1
- package/dist/assets/{index-1q_fL1CO.js → index-Blu10up0.js} +1 -1
- package/dist/assets/{index-CeSi6fPS.js → index-BohzE0_G.js} +1 -1
- package/dist/assets/{index-BqE2dSbo.js → index-BqA6qopG.js} +1 -1
- package/dist/assets/{index-9AtlSAca.js → index-BtreM3NC.js} +1 -1
- package/dist/assets/{index-B7UU2Xx3.js → index-C-_TOagw.js} +1 -1
- package/dist/assets/{index-C8GO1leJ.js → index-C9qZuSIK.js} +4 -4
- package/dist/assets/{index-CCyFCqBE.js → index-CL7r8f7t.js} +1 -1
- package/dist/assets/{index-DjgzvzkV.js → index-CTRqTltQ.js} +1 -1
- package/dist/assets/{index-f_-DLUob.js → index-CVfrZI-X.js} +1 -1
- package/dist/assets/index-CcyWzATh.js +1 -0
- package/dist/assets/{index-_RQVek-9.js → index-CiCnkusy.js} +1 -1
- package/dist/assets/{index-DWBKwIO3.js → index-ClN0pNgG.js} +1 -1
- package/dist/assets/{index-BKgXnbrz.js → index-CppKRVHi.js} +1 -1
- package/dist/assets/{index-BiowOJQr.js → index-DBf8PBYJ.js} +3 -3
- package/dist/assets/{index-DFZr7N5Q.js → index-DDhMAVFM.js} +1 -1
- package/dist/assets/{index-BcyBYFKw.js → index-DED1KN0e.js} +1 -1
- package/dist/assets/{index-cI3GtZiR.js → index-DOMzSGye.js} +1 -1
- package/dist/assets/{index-Brhgisql.js → index-DS4UEAMl.js} +3 -3
- package/dist/assets/{index-C5xxqnjy.js → index-DVNXXPps.js} +1 -1
- package/dist/assets/{index-Di7TwMAz.js → index-DiOAy3AN.js} +1 -1
- package/dist/assets/{index-BEjzeaWf.js → index-DmXLaJkF.js} +11 -11
- package/dist/assets/{index-B2OP4n2J.js → index-DnM_VmsZ.js} +1 -1
- package/dist/assets/{index-DiSjj8dD.js → index-DqVv93zN.js} +1 -1
- package/dist/assets/{index-COM-tUig.js → index-DrY1ehLI.js} +1 -1
- package/dist/assets/{index-BXhWMfbn.js → index-DsEBS9e4.js} +268 -270
- package/dist/assets/{index-BpLexnAZ.js → index-Qsq8NN2R.js} +3 -3
- package/dist/assets/index-TbMNXftL.js +375 -0
- package/dist/assets/{index-Bz-PgJMC.js → index-ZGyZk2OZ.js} +9 -9
- package/dist/assets/{index-CuAcM2e2.js → index-amAPPuMu.js} +1 -1
- package/dist/assets/{index-DEOQ0jcQ.js → index-fNQPtBuc.js} +28 -32
- package/dist/assets/{index-D4AEyg0i.js → index-hA-y-TpL.js} +1 -1
- package/dist/assets/{index-BvBppb16.js → index-imazHEHp.js} +1 -1
- package/dist/assets/{index-Cl_OUu5V.js → index-jjbeseev.js} +2 -2
- package/dist/assets/{index.esm-DLVaVv6G.js → index.esm-BANIJT6f.js} +1 -1
- package/dist/assets/{install-from-url-B-_Dp6ah.js → install-from-url-D1NOT4Pv.js} +1 -1
- package/dist/assets/{invitation-BgD3_vhn.js → invitation-O2oACqkb.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-BSoCAT8S.js → is-path-prefix-equal-O0yEMjd_.js} +1 -1
- package/dist/assets/{item-Cq6FTbYA.js → item-h3ruRo-H.js} +1 -1
- package/dist/assets/{javascript-C-FROqLb.js → javascript-DcJGEfYw.js} +1 -1
- package/dist/assets/{jsonMode-DPJOjZF1.js → jsonMode-BHZ8m-ds.js} +1 -1
- package/dist/assets/{liquid-C2IF5DcJ.js → liquid-DWbey1H2.js} +1 -1
- package/dist/assets/{list-header-CGaXNTl1.js → list-header-DyI0QsIk.js} +1 -1
- package/dist/assets/{lock.svg-chUJBTRM.js → lock.svg-S4G8_hPn.js} +1 -1
- package/dist/assets/{log-CQYCsC7O.js → log-CKSZu6u8.js} +1 -1
- package/dist/assets/{lottie-react.esm-BDZ_FnV5.js → lottie-react.esm-Bm0zPrgB.js} +1 -1
- package/dist/assets/{mdx-DN-yyYQV.js → mdx-BGp37W7-.js} +1 -1
- package/dist/assets/{memory-Cp2D5Xn4.js → memory-CWPB8_i3.js} +1 -1
- package/dist/assets/{metric-D8boeqOT.js → metric-DWK7z3FN.js} +1 -1
- package/dist/assets/omit-3k34emjP.js +1 -0
- package/dist/assets/{overview-CmJ-twrW.js → overview-STHknBJ9.js} +1 -1
- package/dist/assets/{permission-yeSmXMT8.js → permission-CW0DzNy6.js} +1 -1
- package/dist/assets/{preference-B8o0Jhqm.js → preference-COoVLSH3.js} +4 -4
- package/dist/assets/{python-dlp0zMNM.js → python-BC35IEku.js} +1 -1
- package/dist/assets/{raf-schd.esm-CrHfyPhA.js → raf-schd.esm-CIAiFP0D.js} +1 -1
- package/dist/assets/{razor-BShM2kTq.js → razor-B6vnh7Vd.js} +1 -1
- package/dist/assets/{rotate-session-key-cXEhy_K2.js → rotate-session-key-DU1HsGd_.js} +1 -1
- package/dist/assets/{runtime-BkYiwqrJ.js → runtime-DUURaTXH.js} +1 -1
- package/dist/assets/schema-CqOuaGVk.js +1 -0
- package/dist/assets/sdk-BQM2VdGY.js +1 -0
- package/dist/assets/{service-CZ6mQjKM.js → service-BJKQP96S.js} +1 -1
- package/dist/assets/{shorten-label-B41dh7aP.js → shorten-label-DA5be4J4.js} +1 -1
- package/dist/assets/{simple-select-BvGPk5Cy.js → simple-select-CLUHLnUl.js} +1 -1
- package/dist/assets/{spaces-C-llvyn7.js → spaces-D-45kKRl.js} +1 -1
- package/dist/assets/{status-BX4NNsVD.js → status-CEUgb3XC.js} +1 -1
- package/dist/assets/{status-PYw3sa-W.js → status-wht8PoB0.js} +1 -1
- package/dist/assets/{switch-control-IXycQg7u.js → switch-control-DiEhPK-D.js} +1 -1
- package/dist/assets/{table-icons-PekhxfR1.js → table-icons-OH5JefYD.js} +1 -1
- package/dist/assets/{team-C3mY0ELl.js → team-DOKbCs1u.js} +1 -1
- package/dist/assets/{toLower-B1XYGfB3.js → toLower-L52TDGAI.js} +1 -1
- package/dist/assets/toUpper-s5XxN3Cm.js +1 -0
- package/dist/assets/{traffic-Bj6CYWfW.js → traffic-8l-nBZJu.js} +1 -1
- package/dist/assets/{tsMode-O71ldBJ0.js → tsMode-rhnC4GCm.js} +1 -1
- package/dist/assets/{typescript-awLwl-Q4.js → typescript-C6f--cpD.js} +1 -1
- package/dist/assets/{url-evaluation-Dt0gDvx3.js → url-evaluation-DkReRdN8.js} +1 -1
- package/dist/assets/{url-join--yrZIt5c.js → url-join-jtosGTU1.js} +1 -1
- package/dist/assets/{use-mobile-CMlrBzPG.js → use-mobile-CIJO5Cwx.js} +1 -1
- package/dist/assets/{use-mobile-0LaImk5H.js → use-mobile-DDVf02JR.js} +1 -1
- package/dist/assets/{useAsync-Drf6IH2B.js → useAsync-CDB8iS9O.js} +1 -1
- package/dist/assets/{useAsyncRetry-C9hqas1l.js → useAsyncRetry-D1fZm-7x.js} +1 -1
- package/dist/assets/{useLocalStorage-pzfOZ90P.js → useLocalStorage-g990sECo.js} +1 -1
- package/dist/assets/useThemeProps-CWahcrog.js +1 -0
- package/dist/assets/{util-CHsC18AZ.js → util-BlJo7yLZ.js} +1 -1
- package/dist/assets/{wait-container-D-JLmV2c.js → wait-container-Cq3P4_HW.js} +1 -1
- package/dist/assets/{without-wallet-BVl72vUK.js → without-wallet-BzSI0Ui2.js} +1 -1
- package/dist/assets/wrap-locale-9aJSq-p0.js +1 -0
- package/dist/assets/{xml-clTeeJoN.js → xml-BWOkBtfO.js} +1 -1
- package/dist/assets/{yaml-D17cEXW_.js → yaml-B2eMN024.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-C4ph_aC2.js +0 -1
- package/dist/assets/actions-D2ujhOWD.js +0 -1
- package/dist/assets/api-W7sKIR80.js +0 -1
- package/dist/assets/cloneDeep-yO838gNj.js +0 -1
- package/dist/assets/emotion-cache.browser.esm-Bm19UyCk.js +0 -1
- package/dist/assets/engine-BX2tPglZ.js +0 -1
- package/dist/assets/getValidReactChildren-Ao387m76.js +0 -1
- package/dist/assets/index-4__iBGFR.js +0 -376
- package/dist/assets/index-CZlN1gWv.js +0 -1
- package/dist/assets/omit-BtJfXKsY.js +0 -1
- package/dist/assets/schema-CJmd8wL1.js +0 -1
- package/dist/assets/sdk-B9JEpY9l.js +0 -1
- package/dist/assets/toUpper-BnIypMIu.js +0 -1
- package/dist/assets/useThemeProps-BgkGtCgI.js +0 -1
- package/dist/assets/wrap-locale-C5BuyfxR.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
2
|
-
import{aF as ze,j as t,ds as ws,gH as _s,iD as Ss,V as ce,bn as ge,K as U,ay as be,H as G,o as x,f as gt,r as R,p as je,bE as st,b as ve,i as Q,U as On,bD as ft,X as ye,iE as Es,t as xe,s as oe,a3 as me,aV as ao,T as le,$ as Yt,dH as mt,y as Ee,b8 as ks,bI as Rs,aH as W,b1 as Ps,gv as Ts,gw as Is,C as Ce,f5 as lo,hD as $n,x as Ds,aw as Gt,w as Bs,iF as Os,iG as Us,v as Be,iH as Ns,Y as Ls,_ as As,iI as co,bo as uo,Q as Ne,f7 as Ms,f2 as Fs,aA as zs,aB as qs,bk as $s,aC as Ws,aD as fe,aO as Hs,cR as Gs,S as Ks,eO as ir,bi as Vs,h as Ys,dw as It,iJ as Zs,f_ as po,g2 as Qs,iK as Js,ez as pe,iL as fo,dF as Xs,iM as ei,hi as ti,fO as ni,iN as ri,cI as ar,hy as Wn,au as oi,dI as Zt,dp as Me,bu as si,bv as lr,z as mo,cu as ii,G as Fe,aP as cr,gr as ho,cv as Ke,he as ai,bC as kt,cn as dr,hG as li,fn as ur,bg as ci,L as xt,E as go,bm as di,Z as ui,M as Rt,aZ as Hn,iO as pi,a_ as Le,az as pr,cP as fi,ac as it,aM as xo,bW as Gn,cA as mi,iP as hi,b9 as gi,A as yo,aU as Un,g as xi,aS as ut,N as pn,W as yi,bF as vo,aJ as vi,bx as Ci,aR as bi,fe as fr,ge as mr,gf as hr,R as gr,cO as ji,gg as wi,bV as _i,iQ as Si}from"./index-BXhWMfbn.js";import{y as Ei}from"./index-_nnYDXM-.js";import{a as ki,c as Ri,d as Pi,u as Kn,R as Ti}from"./actions-C9R61uoD.js";import{S as Ii}from"./switch-control-IXycQg7u.js";import{u as De}from"./blocklet-BMb-DKa8.js";import{P as Nn,w as Qt}from"./permission-yeSmXMT8.js";import{E as Co}from"./Edit-BLWQBSLN.js";import{T as Di,M as Bi,t as Oi}from"./table-icons-PekhxfR1.js";import{s as Ui,F as bo,L as Ni,I as Li,a as Pt,S as Ai,B as Mi}from"./preference-B8o0Jhqm.js";import{C as xr}from"./click-to-copy-BlUoHpyD.js";import{v as fn}from"./index-Di7TwMAz.js";import{A as Fi}from"./Add-l70J_4yZ.js";import{A as Jt}from"./Link-D4UceNDZ.js";import{C as zi,c as qi,b as $i,f as jo,A as Wi,_ as Hi,a as Gi,e as Ki,d as wo,s as Vi,L as Yi,u as Zi,g as Qi,S as Ji}from"./item-Cq6FTbYA.js";import{T as Xi,L as ea,a as Ln,u as yr,W as ta,P as na}from"./index-DWBKwIO3.js";import{e as _o}from"./engine-BX2tPglZ.js";import{u as ra,C as oa,D as sa,a as ia,b as aa}from"./connect-to-UN--0_6w.js";import{C as la,u as ca,A as da}from"./agreement-DtxuiQja.js";import{A as ua,a as pa,b as fa,c as ma,R as ot,S as dt}from"./collapse-DKt3eXVz.js";import{D as So}from"./Done-rLg9w1bb.js";import{C as ha}from"./Google--H7JIVD-.js";import{I as Eo,f as ga,a as xa,B as ya}from"./install-from-url-B-_Dp6ah.js";import{a as vr}from"./api-W7sKIR80.js";import{v as ko,e as va,a as Kt}from"./util-CHsC18AZ.js";import{u as Ro}from"./use-mobile-CMlrBzPG.js";import{A as Ca}from"./ArrowDropDown-C4ph_aC2.js";import{u as ba}from"./useLocalStorage-pzfOZ90P.js";import{r as Xt}from"./index-CCyFCqBE.js";import{b as en}from"./without-wallet-BVl72vUK.js";import{E as Po}from"./ErrorOutline-wpxhPFAL.js";import{H as ja}from"./HelpOutline-dwnyWw6W.js";import{C as wa}from"./lock.svg-chUJBTRM.js";import{D as tn,R as _a,a as Cr}from"./url-evaluation-Dt0gDvx3.js";import{L as To}from"./Launch-D-brFkhF.js";import{D as Sa}from"./delete-confirm-CCfwND5U.js";import{W as ht,B as An}from"./status-PYw3sa-W.js";import{A as Io}from"./actions-D2ujhOWD.js";import{v as mn}from"./index-_RQVek-9.js";import{t as Ea}from"./toUpper-BnIypMIu.js";import{S as ka}from"./Switch-Ch-Dpg3J.js";import{a as Ra}from"./team-C3mY0ELl.js";import"./MoreVert-Cy81E-t5.js";import"./get-safe-url-I2vTcMcF.js";import"./ButtonGroup-DWV84mOp.js";import"./getValidReactChildren-Ao387m76.js";import"./FilterList-CBCl7dbD.js";import"./CSSTransition-D0ZJqc3V.js";import"./emotion-cache.browser.esm-Bm19UyCk.js";import"./index-DBii9-f-.js";import"./typeof-QjJsDpFa.js";import"./raf-schd.esm-CrHfyPhA.js";import"./redux-DfszZyTl.js";import"./useThemeProps-BgkGtCgI.js";import"./html-title-CRD93SB4.js";import"./Clear-DmQaaBy1.js";import"./ChevronRight-hEVn0ieo.js";import"./ChevronLeft-xNPAnZUM.js";import"./Search-nsuHiAfr.js";import"./omit-BtJfXKsY.js";import"./edit.svg-DYKibMjZ.js";import"./index-BJzB0IwK.js";import"./iframe-SmTUaAma.js";import"./index-DjgzvzkV.js";import"./KeyboardArrowDown-CqHZKzOB.js";import"./Autocomplete-BGzNUg3v.js";import"./ListSubheader-CPl5W-Om.js";import"./Verified-Cj9BE95b.js";import"./VerifiedUser-CzoOgILE.js";import"./DeleteOutline-CvnvGjYc.js";import"./url-join--yrZIt5c.js";import"./index-BojVbZw0.js";import"./spaces-C-llvyn7.js";import"./OpenInNew-B2F4Jqwb.js";import"./index-DRYJ0xIl.js";import"./index-BBJPyEqY.js";import"./decode-DPztD6kB.js";import"./cloneDeep-yO838gNj.js";import"./ListItemButton-BbKr2tws.js";import"./Stepper-N4JW-HWm.js";import"./is-path-prefix-equal-BSoCAT8S.js";const Pa=ze(t.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"})),Ta=ze(t.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"})),Do=ze(t.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=ze(t.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"})),Bo=ze(t.jsx("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"})),Da=ze(t.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=ze(t.jsx("path",{d:"M5 20h14v-2H5zm0-10h4v6h6v-6h4l-7-7z"})),Oa=ze(t.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=ze(t.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 br(e,n){var r={};return n=ws(n),_s(e,function(i,a,o){Ss(r,a,n(i,a,o))}),r}function Oo({children:e=null,...n}){const{t:r}=ce(),{api:i}=ge(),{blocklet:a}=De(),o=a?.settings?.autoCheckUpdate,m=async l=>{await i.updateAutoCheckUpdate({input:{did:a.meta.did,autoCheckUpdate:l}})},c=async()=>{try{const l=!o?.enabled;await m({enabled:l}),G.success(r(l?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(l){G.error(l.message)}},d=!!o?.enabled;return t.jsxs(U,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e,t.jsx(be,{title:r("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:t.jsx("div",{children:t.jsx(Ii,{checked:d,onChange:c,name:"enableWelcomePage",style:{...n.style,zoom:.8}})})})]})}Oo.propTypes={children:x.any};function jr(e){function n({sx:r,...i}){return t.jsx(e,{...i,sx:{color:"text.primary",...r}})}return n}const Na={...br(Oi,jr),...br(ki,jr)},La=(e,n)=>{let{description:r}=e;return(Object.values(ve.CHAIN_PROP_MAP).includes(e.key)||Q.isEnvShareable(e))&&(r?r=`${r} (${n("blocklet.config.sharedToAllComponents")})`:r=n("blocklet.config.sharedToAllComponents")),r&&t.jsx("div",{style:{marginLeft:12},children:r})},hn=(e,n,r=[])=>!r?.length&&!e.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(e.key)&&!n.meta.environments.find(i=>i.name===e.key)&&n.children.every(i=>!i.meta.environments.find(a=>a.name===e.key))?!0:e.custom,wr=e=>[ve.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)?!0:!(e.startsWith("BLOCKLET_")||e.startsWith("COMPONENT_")),gn=e=>[ve.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)===!1;function Uo({blocklet:e,ancestors:n=[]}){const r=ge(),{palette:i}=gt(),{inService:a}=r,{t:o}=R.useContext(je),m=[...n.map(s=>s.meta.did),e.meta.did],c=()=>G.success(o("blocklet.config.changedTip")),d=s=>hn(s,e,n);if(st(e.status)||e.status==="unknown"&&st(e.status))return null;const l=s=>new Promise(async(h,b)=>{if(!s.key.trim()||!s.value.trim()){G.error(o("blocklet.config.environment.keyValueRequired")),b();return}if(wr(s.key)===!1){G.error(o("blocklet.config.environment.invalidKey")),b();return}s.custom=gn(s.key);try{const P=await r.api.configBlocklet({input:{did:m,configs:[s]}});c(P.blocklet),h()}catch(P){G.error(ye(P)),b()}}),v=(s,h)=>new Promise(async(b,P)=>{if(s.required&&(!s.key.trim()||!s.value.trim())){G.error(o("blocklet.config.environment.keyValueRequired")),P();return}if(wr(s.key)===!1){G.error(o("blocklet.config.environment.invalidKey")),P();return}if(s.key===ve.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const M=Es(s);if(M){G.error(M),P();return}}const k=[{...s,value:s.secure&&s.value==="__encrypted__"?"":s.value}];if(s.key!==h.key){if(!hn(s,e,n)){G.error("Only key of custom env can be changed"),P();return}k.push({key:h.key,custom:gn(s.key)})}try{const M=await r.api.configBlocklet({input:{did:m,configs:k}});c(M.blocklet),b()}catch(M){G.error(ye(M)),P()}}),p=s=>new Promise(async(h,b)=>{if(s.required){G.error(o("blocklet.config.environment.deleteForbidden")),b();return}if(!hn(s,e,n)){G.error(o("environmentTips.deleteForbidden")),b();return}try{const P=await r.api.configBlocklet({input:{did:m,configs:[{key:s.key,custom:gn(s.key)}]}});c(P.blocklet),h()}catch(P){G.error(ye(P)),b()}}),C=(e.configs||[]).filter(s=>!ve.BLOCKLET_CONFIGURABLE_KEY[s.key]||[ve.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(s.key)),f=Q.getSharedConfigObj(n[0],e),y=Q.getComponentMissingConfigs(e,n[0]),w=C.map(s=>({...s,value:Object.values(ve.CHAIN_PROP_MAP).includes(s.key)&&Object.keys(f).includes(s.key)?f[s.key]:f[s.key]||s.value})),j=w.some(s=>s.key&&s.key.startsWith("BWA_")),E={onRowAdd:l,onRowUpdate:v,onRowDelete:p,isDeletable:d},u=()=>[{title:o("common.key"),field:"key",initialEditValue:"",width:"30%",render:s=>t.jsx(xr,{value:s.value,style:{color:s.required&&!s.value?i.error.main:i.text.primary,fontWeight:s.required?"bold":"normal"},children:s.key}),editComponent:s=>{const{value:h,rowData:b,onChange:P}=s;return t.jsx(_r,{children:t.jsx(xe,{fullWidth:!0,size:"small",value:Ui.escapeTag(h),onChange:k=>P(k.target.value),variant:"outlined",label:"Key",placeholder:o("blocklet.config.environment.key"),margin:"dense",autoFocus:!0,slotProps:{input:{readOnly:d(b)===!1}}})})}},{title:o("common.value"),field:"value",initialEditValue:"",width:"calc((100% - (96px + 30%)) / 1)",render:s=>s.value?s.secure?"******":t.jsx(xr,{unstyled:!0,value:s.value,style:{wordBreak:"break-all"},children:s.value}):null,editComponent:s=>{const{value:h,rowData:b,onChange:P}=s;return t.jsxs(_r,{children:[t.jsx(xe,{fullWidth:!0,size:"small",value:h==="__encrypted__"?"":h,onChange:k=>P(k.target.value),variant:"outlined",label:o("common.value"),placeholder:o("blocklet.config.environment.value"),margin:"dense"}),La(b,o)]})}}];return t.jsxs(Aa,{children:[!!y.length&&t.jsx(On,{severity:"error",style:{marginTop:24},children:o("blocklet.config.missingRequired")}),j&&t.jsx(On,{severity:"info",children:o("blocklet.config.environment.tip")}),t.jsx(Nn,{permission:a?"":"mutate_blocklets",role:a?ft:[],children:s=>t.jsx(Di,{className:"config-table",children:t.jsx(Bi,{title:t.jsx(U,{sx:{fontWeight:"bold"},children:o("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:o("common.actions")},body:{emptyDataSourceMessage:o("common.noData"),editRow:{deleteText:o("environmentTips.delete")}}},data:w,editable:s?E:{}})})})]})}Uo.propTypes={blocklet:x.object.isRequired,ancestors:x.array};const Aa=oe.div`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DS4UEAMl.js","./index-DsEBS9e4.js","./index-DGkT7afN.css","./url-join-jtosGTU1.js","./index-CL7r8f7t.js","./_createAggregator-DfK7n_7j.js","./depsEqual-UJplX9mU.js","./index-B6TuxWTr.js","./index-DRYJ0xIl.js","./toUpper-s5XxN3Cm.js","./index-B5LvOF-F.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{aF as Fe,j as t,ds as ws,gz as _s,iv as Ss,V as ce,bn as xe,K as U,ay as be,H as G,o as x,f as gt,r as R,p as je,bE as st,b as ve,i as Z,U as On,bD as ft,X as ge,iw as Es,t as ye,s as oe,a3 as me,aV as ao,T as le,$ as Yt,dH as mt,y as Ee,b8 as ks,bI as Rs,aH as W,b1 as Ps,gn as Ts,go as Is,C as Ce,f5 as lo,hv as $n,x as Ds,aw as Gt,w as Bs,ix as Os,iy as Us,v as Be,iz as Ns,Y as Ls,_ as As,iA as co,bo as uo,Q as Ne,f7 as Ms,f2 as zs,aA as Fs,aB as qs,bk as $s,aC as Ws,aD as fe,aO as Hs,cR as Gs,S as Ks,eO as ir,bi as Vs,h as Ys,dw as It,iB as Zs,f_ as po,iC as Qs,iD as Xs,ez as pe,iE as fo,dF as Js,iF as ei,ha as ti,fO as ni,iG as ri,cI as ar,hq as Wn,au as oi,dI as Zt,dp as Me,bu as si,bv as lr,z as mo,cu as ii,G as ze,aP as cr,gj as ho,cv as Ke,h6 as ai,bC as kt,cn as dr,hy as li,fn as ur,bg as ci,L as xt,E as go,bm as di,Z as ui,M as Rt,aZ as Hn,iH as pi,a_ as Le,az as pr,cP as fi,ac as it,aM as xo,bW as Gn,cA as mi,iI as hi,b9 as gi,A as yo,aU as Un,g as xi,aS as ut,N as pn,W as yi,bF as vo,aJ as vi,bx as Ci,aR as bi,fe as fr,g6 as mr,g7 as hr,R as gr,cO as ji,g8 as wi,bV as _i,iJ as Si}from"./index-DsEBS9e4.js";import{y as Ei}from"./index-Bl14cNgY.js";import{a as ki,c as Ri,d as Pi,u as Kn,R as Ti}from"./actions-5Y9-88Ql.js";import{S as Ii}from"./switch-control-DiEhPK-D.js";import{u as De}from"./blocklet-CPwKiPX6.js";import{P as Nn,w as Qt}from"./permission-CW0DzNy6.js";import{E as Co}from"./Edit-BjbXvYad.js";import{T as Di,M as Bi,t as Oi}from"./table-icons-OH5JefYD.js";import{s as Ui,F as bo,L as Ni,I as Li,a as Pt,S as Ai,B as Mi}from"./preference-COoVLSH3.js";import{C as xr}from"./click-to-copy-DLb2iRRo.js";import{v as fn}from"./index-DiOAy3AN.js";import{A as zi}from"./Add-BJaOHr9s.js";import{A as Xt}from"./Link-sU5sIdSA.js";import{C as Fi,c as qi,b as $i,f as jo,A as Wi,_ as Hi,a as Gi,e as Ki,d as wo,s as Vi,L as Yi,u as Zi,g as Qi,S as Xi}from"./item-h3ruRo-H.js";import{T as Ji,L as ea,a as Ln,u as yr,W as ta,P as na}from"./index-ClN0pNgG.js";import{e as _o}from"./engine-CIf2Bmdn.js";import{u as ra,C as oa,D as sa,a as ia,b as aa}from"./connect-to-CYP6ST4F.js";import{C as la,u as ca,A as da}from"./agreement-CGBcE16y.js";import{A as ua,a as pa,b as fa,c as ma,R as ot,S as dt}from"./collapse-CC77PAqz.js";import{D as So}from"./Done-CLU5BqYw.js";import{C as ha}from"./Google-SHWTgP_i.js";import{I as Eo,f as ga,a as xa,B as ya}from"./install-from-url-D1NOT4Pv.js";import{a as vr}from"./api-DSc3pJRw.js";import{v as ko,e as va,a as Kt}from"./util-BlJo7yLZ.js";import{u as Ro}from"./use-mobile-CIJO5Cwx.js";import{A as Ca}from"./ArrowDropDown-BvfsnZmc.js";import{u as ba}from"./useLocalStorage-g990sECo.js";import{r as Jt}from"./index-CL7r8f7t.js";import{b as en}from"./without-wallet-BzSI0Ui2.js";import{E as Po}from"./ErrorOutline-CSXVYe6M.js";import{H as ja}from"./HelpOutline-EW7qBW6g.js";import{C as wa}from"./lock.svg-S4G8_hPn.js";import{D as tn,R as _a,a as Cr}from"./url-evaluation-DkReRdN8.js";import{L as To}from"./Launch-DjhPb7Xi.js";import{D as Sa}from"./delete-confirm-DSvSyiD8.js";import{W as ht,B as An}from"./status-wht8PoB0.js";import{A as Io}from"./actions-ZeE8iUOI.js";import{v as mn}from"./index-CiCnkusy.js";import{t as Ea}from"./toUpper-s5XxN3Cm.js";import{S as ka}from"./Switch-C5R2keD_.js";import{a as Ra}from"./team-DOKbCs1u.js";import"./MoreVert-DDyUOkUj.js";import"./get-safe-url-BjGmijAx.js";import"./ButtonGroup-DPiY53vd.js";import"./getValidReactChildren-DJbrx6gC.js";import"./FilterList-BJOykCHp.js";import"./CSSTransition-Bw2ddZTQ.js";import"./emotion-cache.browser.esm-CHmknBa-.js";import"./index-DBii9-f-.js";import"./typeof-QjJsDpFa.js";import"./raf-schd.esm-CIAiFP0D.js";import"./redux-DfszZyTl.js";import"./useThemeProps-CWahcrog.js";import"./html-title-Ca-JgCsh.js";import"./Clear-CKva4eBi.js";import"./ChevronRight-Czhq6YeB.js";import"./ChevronLeft-gcWuOwnw.js";import"./Search-DhSwmkQ1.js";import"./omit-3k34emjP.js";import"./edit.svg-DVuUM3KB.js";import"./index-B6TuxWTr.js";import"./iframe-2aVrQOtY.js";import"./index-CTRqTltQ.js";import"./KeyboardArrowDown-BpcBmZwq.js";import"./Autocomplete-BtpXOuNf.js";import"./ListSubheader-Dv-UJcm5.js";import"./Verified-CHOSEVtj.js";import"./VerifiedUser-Dixnu8-0.js";import"./DeleteOutline-CpaciU3x.js";import"./url-join-jtosGTU1.js";import"./index-BojVbZw0.js";import"./spaces-D-45kKRl.js";import"./OpenInNew-DQYN8Nx1.js";import"./index-DRYJ0xIl.js";import"./index-BgYR95Zy.js";import"./decode-DPztD6kB.js";import"./cloneDeep-DRoc_4OI.js";import"./ListItemButton-BLIqko7v.js";import"./Stepper-Tm_IonK9.js";import"./is-path-prefix-equal-O0yEMjd_.js";const Pa=Fe(t.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"})),Ta=Fe(t.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"})),Do=Fe(t.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=Fe(t.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"})),Bo=Fe(t.jsx("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"})),Da=Fe(t.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=Fe(t.jsx("path",{d:"M5 20h14v-2H5zm0-10h4v6h6v-6h4l-7-7z"})),Oa=Fe(t.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=Fe(t.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 br(e,n){var r={};return n=ws(n),_s(e,function(i,a,o){Ss(r,a,n(i,a,o))}),r}function Oo({children:e=null,...n}){const{t:r}=ce(),{api:i}=xe(),{blocklet:a}=De(),o=a?.settings?.autoCheckUpdate,f=async l=>{await i.updateAutoCheckUpdate({input:{did:a.meta.did,autoCheckUpdate:l}})},c=async()=>{try{const l=!o?.enabled;await f({enabled:l}),G.success(r(l?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(l){G.error(l.message)}},d=!!o?.enabled;return t.jsxs(U,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e,t.jsx(be,{title:r("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:t.jsx("div",{children:t.jsx(Ii,{checked:d,onChange:c,name:"enableWelcomePage",style:{...n.style,zoom:.8}})})})]})}Oo.propTypes={children:x.any};function jr(e){function n({sx:r,...i}){return t.jsx(e,{...i,sx:{color:"text.primary",...r}})}return n}const Na={...br(Oi,jr),...br(ki,jr)},La=(e,n)=>{let{description:r}=e;return(Object.values(ve.CHAIN_PROP_MAP).includes(e.key)||Z.isEnvShareable(e))&&(r?r=`${r} (${n("blocklet.config.sharedToAllComponents")})`:r=n("blocklet.config.sharedToAllComponents")),r&&t.jsx("div",{style:{marginLeft:12},children:r})},hn=(e,n,r=[])=>!r?.length&&!e.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(e.key)&&!n.meta.environments.find(i=>i.name===e.key)&&n.children.every(i=>!i.meta.environments.find(a=>a.name===e.key))?!0:e.custom,wr=e=>[ve.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)?!0:!(e.startsWith("BLOCKLET_")||e.startsWith("COMPONENT_")),gn=e=>[ve.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)===!1;function Uo({blocklet:e,ancestors:n=[]}){const r=xe(),{palette:i}=gt(),{inService:a}=r,{t:o}=R.useContext(je),f=[...n.map(s=>s.meta.did),e.meta.did],c=()=>G.success(o("blocklet.config.changedTip")),d=s=>hn(s,e,n);if(st(e.status)||e.status==="unknown"&&st(e.status))return null;const l=s=>new Promise(async(h,b)=>{if(!s.key.trim()||!s.value.trim()){G.error(o("blocklet.config.environment.keyValueRequired")),b();return}if(wr(s.key)===!1){G.error(o("blocklet.config.environment.invalidKey")),b();return}s.custom=gn(s.key);try{const P=await r.api.configBlocklet({input:{did:f,configs:[s]}});c(P.blocklet),h()}catch(P){G.error(ge(P)),b()}}),v=(s,h)=>new Promise(async(b,P)=>{if(s.required&&(!s.key.trim()||!s.value.trim())){G.error(o("blocklet.config.environment.keyValueRequired")),P();return}if(wr(s.key)===!1){G.error(o("blocklet.config.environment.invalidKey")),P();return}if(s.key===ve.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const M=Es(s);if(M){G.error(M),P();return}}const k=[{...s,value:s.secure&&s.value==="__encrypted__"?"":s.value}];if(s.key!==h.key){if(!hn(s,e,n)){G.error("Only key of custom env can be changed"),P();return}k.push({key:h.key,custom:gn(s.key)})}try{const M=await r.api.configBlocklet({input:{did:f,configs:k}});c(M.blocklet),b()}catch(M){G.error(ge(M)),P()}}),p=s=>new Promise(async(h,b)=>{if(s.required){G.error(o("blocklet.config.environment.deleteForbidden")),b();return}if(!hn(s,e,n)){G.error(o("environmentTips.deleteForbidden")),b();return}try{const P=await r.api.configBlocklet({input:{did:f,configs:[{key:s.key,custom:gn(s.key)}]}});c(P.blocklet),h()}catch(P){G.error(ge(P)),b()}}),C=(e.configs||[]).filter(s=>!ve.BLOCKLET_CONFIGURABLE_KEY[s.key]||[ve.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(s.key)),m=Z.getSharedConfigObj(n[0],e),y=Z.getComponentMissingConfigs(e,n[0]),j=C.map(s=>({...s,value:Object.values(ve.CHAIN_PROP_MAP).includes(s.key)&&Object.keys(m).includes(s.key)?m[s.key]:m[s.key]||s.value})),w=j.some(s=>s.key&&s.key.startsWith("BWA_")),E={onRowAdd:l,onRowUpdate:v,onRowDelete:p,isDeletable:d},u=()=>[{title:o("common.key"),field:"key",initialEditValue:"",width:"30%",render:s=>t.jsx(xr,{value:s.value,style:{color:s.required&&!s.value?i.error.main:i.text.primary,fontWeight:s.required?"bold":"normal"},children:s.key}),editComponent:s=>{const{value:h,rowData:b,onChange:P}=s;return t.jsx(_r,{children:t.jsx(ye,{fullWidth:!0,size:"small",value:Ui.escapeTag(h),onChange:k=>P(k.target.value),variant:"outlined",label:"Key",placeholder:o("blocklet.config.environment.key"),margin:"dense",autoFocus:!0,slotProps:{input:{readOnly:d(b)===!1}}})})}},{title:o("common.value"),field:"value",initialEditValue:"",width:"calc((100% - (96px + 30%)) / 1)",render:s=>s.value?s.secure?"******":t.jsx(xr,{unstyled:!0,value:s.value,style:{wordBreak:"break-all"},children:s.value}):null,editComponent:s=>{const{value:h,rowData:b,onChange:P}=s;return t.jsxs(_r,{children:[t.jsx(ye,{fullWidth:!0,size:"small",value:h==="__encrypted__"?"":h,onChange:k=>P(k.target.value),variant:"outlined",label:o("common.value"),placeholder:o("blocklet.config.environment.value"),margin:"dense"}),La(b,o)]})}}];return t.jsxs(Aa,{children:[!!y.length&&t.jsx(On,{severity:"error",style:{marginTop:24},children:o("blocklet.config.missingRequired")}),w&&t.jsx(On,{severity:"info",children:o("blocklet.config.environment.tip")}),t.jsx(Nn,{permission:a?"":"mutate_blocklets",role:a?ft:[],children:s=>t.jsx(Di,{className:"config-table",children:t.jsx(Bi,{title:t.jsx(U,{sx:{fontWeight:"bold"},children:o("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:o("common.actions")},body:{emptyDataSourceMessage:o("common.noData"),editRow:{deleteText:o("environmentTips.delete")}}},data:j,editable:s?E:{}})})})]})}Uo.propTypes={blocklet:x.object.isRequired,ancestors:x.array};const Aa=oe.div`
|
|
3
3
|
.config-table {
|
|
4
4
|
margin-bottom: 24px;
|
|
5
5
|
position: relative;
|
|
@@ -53,7 +53,7 @@ import{aF as ze,j as t,ds as ws,gH as _s,iD as Ss,V as ce,bn as ge,K as U,ay as
|
|
|
53
53
|
}
|
|
54
54
|
`,_r=oe.div`
|
|
55
55
|
height: 60px;
|
|
56
|
-
`;function Vn({open:e=!1,onClose:n=null,hiddenChildren:r=!1,blocklet:i,ancestors:a=[],children:o=null}){const[
|
|
56
|
+
`;function Vn({open:e=!1,onClose:n=null,hiddenChildren:r=!1,blocklet:i,ancestors:a=[],children:o=null}){const[f,c]=R.useState(!1),{t:d}=ce(),l=d("environmentFor",{name:Z.getDisplayName(i,!0)});if(st(i.status)||i.status==="unknown"&&st(i.status))return null;const v=()=>{n?.(),c(!1)},p=m=>{m.stopPropagation(),c(!0)};let C=null;return r||(C=typeof o=="function"?o({open:p}):t.jsx(me,{onClick:p,"data-cy":"action-config-component",children:t.jsx(Co,{})})),t.jsxs(t.Fragment,{children:[C,(e||f)&&t.jsx(Ma,{open:!0,fullWidth:!0,maxWidth:"md",title:l,onClose:v,PaperProps:{style:{minHeight:"auto",backgroundImage:"none"}},children:t.jsxs(ao,{sx:{gap:0},children:[t.jsx(le,{sx:{fontSize:12,color:"text.secondary",mb:.5},children:d("description.environment",{name:Z.getDisplayName(i,!0)})}),t.jsx(Uo,{blocklet:i,ancestors:a})]})})]})}Vn.propTypes={blocklet:x.object.isRequired,ancestors:x.array,children:x.any,open:x.bool,onClose:x.func,hiddenChildren:x.bool};const Ma=oe(Yt)`
|
|
57
57
|
.MuiDialogContent-root {
|
|
58
58
|
padding-top: 0;
|
|
59
59
|
padding-bottom: 24px;
|
|
@@ -66,7 +66,7 @@ import{aF as ze,j as t,ds as ws,gH as _s,iD as Ss,V as ce,bn as ge,K as U,ay as
|
|
|
66
66
|
.ux-dialog_closeButton {
|
|
67
67
|
margin: 0;
|
|
68
68
|
}
|
|
69
|
-
`,
|
|
69
|
+
`,za=R.lazy(()=>Rs(()=>import("./index-DS4UEAMl.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url).then(e=>({default:e.Uploader}))),Fa="/blocklet/component/upload",Sr=[".html",".htm",".tgz",".zip"],qa=Number(window.env?.MAX_UPLOAD_FILE_SIZE)||W.MAX_UPLOAD_FILE_SIZE,$a=qa*1024*1024;function No({did:e,prefix:n,headers:r=()=>({}),onUploaded:i=mt,open:a=!1,onClose:o=mt}){const{t:f,locale:c}=ce(),d=R.useRef(null),l=R.useCallback(v=>{const{status:p,data:C}=v;if(p===200){i(C);return}G.error(f("blocklet.component.addComponentTip.uploadFailed"))},[i,f]);return R.useEffect(()=>{a?d.current?.open():d.current?.close()},[a]),t.jsx(Wa,{id:`component-uploader-${e}`,children:t.jsx(za,{ref:d,locale:c,popup:!0,onUploadFinish:l,plugins:[],onClose:o,installerProps:{disabled:!0},apiPathProps:{uploader:Ee(n,Fa,e),disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:Sr,maxFileSize:$a,maxNumberOfFiles:1}},tusProps:{headers:r},dashboardProps:{note:f("blocklet.component.addComponentTip.allowedFileTypes",{types:Sr.map(v=>v.replace(".","")).join(", ")})}})},`component-uploader-${e}`)}No.propTypes={did:x.string.isRequired,prefix:x.string.isRequired,open:x.bool,headers:x.func,onUploaded:x.func,onClose:x.func};const Wa=ks(U)`
|
|
70
70
|
.uploader-wrapper {
|
|
71
71
|
display: inline-flex;
|
|
72
72
|
position: relative;
|
|
@@ -94,7 +94,7 @@ import{aF as ze,j as t,ds as ws,gH as _s,iD as Ss,V as ce,bn as ge,K as U,ay as
|
|
|
94
94
|
transition: opacity 0.3s ease;
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
`,Yn={description:x.string,editing:x.bool,onChange:x.func,required:x.bool,value:x.any,componentProps:x.object,render:x.func,renderFormItem:x.func};function Zn({editing:e,value:n,onChange:r}){const[i,a]=R.useState(!1),o=R.useRef(),
|
|
97
|
+
`,Yn={description:x.string,editing:x.bool,onChange:x.func,required:x.bool,value:x.any,componentProps:x.object,render:x.func,renderFormItem:x.func};function Zn({editing:e,value:n,onChange:r}){const[i,a]=R.useState(!1),o=R.useRef(),f=R.useRef(n);R.useEffect(()=>{let p=null;return e&&(p=setTimeout(()=>{a(!0)},50)),()=>{clearTimeout(p)}},[e]);const c=p=>{f.current=p,r(p)},d=()=>{a(!1),r(f.current)},l=t.jsx(U,{className:"form-item-input slot",sx:{px:1},children:t.jsxs(U,{sx:{display:"flex",alignItems:"center"},children:[n,n!=="auto"&&t.jsx("div",{style:{marginLeft:4,backgroundColor:n,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),v=t.jsxs(U,{onKeyDown:d,sx:{display:"flex",flexGrow:1,alignItems:"center",height:"40px"},children:[t.jsx(U,{onClick:()=>a(!0),sx:{display:"flex",alignItems:"center"},children:t.jsx("div",{ref:o,style:{flexShrink:0,marginLeft:"8px",backgroundColor:n,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:n==="auto"?"default":"pointer"}})}),t.jsx(Ps,{open:i,anchorEl:o.current,onClose:()=>a(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:t.jsx(ha,{color:n,onChange:p=>c(p.hex)})})]});return e?v:l}Zn.propTypes=Yn;function Lo({editing:e,description:n,value:r,onChange:i,componentProps:a={},...o}){const{placeholder:f}=a,c=R.useRef(r),{t:d}=R.useContext(je),l=p=>{p.key==="Enter"&&i(c.current,"confirm")},v=p=>{c.current=p,i(p)};return e?t.jsx(ye,{style:{flex:1},fullWidth:!0,value:r,onChange:p=>{p.persist(),v(p.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:n||f,onKeyDown:l,...o}):t.jsx(U,{className:"form-item-input slot",sx:{px:1},children:r||t.jsx("span",{className:"placeholder",children:d("common.requiredInputPlaceholder",{name:n||f})})})}Lo.propTypes=Yn;function Ao({editing:e,value:n,onChange:r,componentProps:i,...a}){const{blocklet:o}=i,f=n==="auto"?Ts(o.appDid):n;return t.jsxs(U,{sx:{display:"flex",alignItems:"center"},children:[t.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Is({title:"Owner",issuer:Z.getDisplayName(o),issuerDid:o.appDid,ownerName:"Your Name",ownerDid:o.appDid,preferredColor:n||"auto"})}}),t.jsx(Zn,{...a,editing:e,value:e?f:n,onChange:r,componentProps:i})]})}Ao.propTypes={...Yn,componentProps:x.shape({blocklet:x.object.isRequired}).isRequired};const Ha=$n`
|
|
98
98
|
0%, 100% {
|
|
99
99
|
transform: scale(1) translateX(0);
|
|
100
100
|
}
|
|
@@ -104,7 +104,7 @@ import{aF as ze,j as t,ds as ws,gH as _s,iD as Ss,V as ce,bn as ge,K as U,ay as
|
|
|
104
104
|
25%, 75% {
|
|
105
105
|
transform: scale(1.1) translateX(3px);
|
|
106
106
|
}
|
|
107
|
-
`,Ga={input:Lo,color:Zn,passport:Ao,uploader:e=>t.jsx(Ni,{...e.componentProps})};function Ka(e,{editing:n=!1}){const{componentType:r="input",render:i,renderFormItem:a}=e;return n&&a?a:!n&&i?i:Ga[r?.toLowerCase()]}Qn.propTypes={item:x.object.isRequired,findEditingItem:x.func.isRequired,getItemValue:x.func.isRequired,onFormItemChange:x.func.isRequired,onFocusOut:x.func.isRequired,disabled:x.bool,loading:x.bool,onCancel:x.func,formValues:x.object.isRequired};function Qn({item:e,findEditingItem:n,getItemValue:r,onFormItemChange:i,onFocusOut:a,disabled:o=!1,loading:
|
|
107
|
+
`,Ga={input:Lo,color:Zn,passport:Ao,uploader:e=>t.jsx(Ni,{...e.componentProps})};function Ka(e,{editing:n=!1}){const{componentType:r="input",render:i,renderFormItem:a}=e;return n&&a?a:!n&&i?i:Ga[r?.toLowerCase()]}Qn.propTypes={item:x.object.isRequired,findEditingItem:x.func.isRequired,getItemValue:x.func.isRequired,onFormItemChange:x.func.isRequired,onFocusOut:x.func.isRequired,disabled:x.bool,loading:x.bool,onCancel:x.func,formValues:x.object.isRequired};function Qn({item:e,findEditingItem:n,getItemValue:r,onFormItemChange:i,onFocusOut:a,disabled:o=!1,loading:f=!1,onCancel:c=()=>{},formValues:d}){const{key:l,description:v,required:p,solo:C=!1,hidden:m=!1,componentProps:y={},skipButtonDisabled:j=!1}=e;if(m)return null;const w=n(l),{editing:E,shaking:u}=w??{},s=r(e,{editing:E}),h=Ka(e,{editing:E}),b={inputProps:{"data-cy":"schema-form-item-component"},key:l,description:v,editing:E,value:s,onChange:(P,k="change")=>i(e,P,k),componentProps:y,skipButtonDisabled:j,onBlur:()=>a(e)};return e.componentType==="collapse"&&e.children?.length>0?t.jsxs(ua,{children:[t.jsx(pa,{expandIcon:t.jsx(fa,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:e.description}),t.jsx(ma,{children:e.children.map(P=>t.jsx(Qn,{item:P,findEditingItem:n,getItemValue:r,onFormItemChange:i,onFocusOut:a,formValues:d,disabled:o,loading:f,onCancel:c},P.key))})]}):t.jsxs(U,{className:"form-item",children:[!C&&t.jsxs(U,{className:"form-item-label",sx:{color:p&&!s?"error.main":"text.secondary"},children:[v,p&&t.jsx(ot,{})]}),t.jsxs(U,{className:"form-item-body",children:[t.jsx(U,{className:"form-item-input","data-cy":"schema-form-item-edit",sx:{textAlign:C?"center":"left"},style:{cursor:"text"},onClick:()=>{o||w?.edited||j||i(e,d[l],"edit")},children:t.jsx(h,{...b})}),!C&&t.jsx(U,{className:"form-item-action",style:{marginLeft:0},children:E?t.jsxs(t.Fragment,{children:[w.edited?t.jsx(me,{"data-cy":"schema-form-item-confirm",onClick:()=>{i(e,s,"confirm")},disabled:o||f,sx:{animation:u?`${Ha} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:f?t.jsx(Ce,{size:24}):t.jsx(So,{})}):null,t.jsx(me,{"data-cy":"schema-form-item-cancel",onClick:()=>c(e),style:{paddingLeft:w.edited?4:8},disabled:o||f,size:"large",children:t.jsx(lo,{})})]}):null})]})]},l)}function Mo({schema:e,loading:n=!1,value:r=void 0,defaultValue:i={},onChange:a,style:o={},disabled:f=!1}){const c=Object.prototype.toString.call(r)==="[object Object]",[d,l]=R.useState([]),[v,p]=R.useState(c?r:i),C=R.useMemo(()=>e.length===1,[e]),m=R.useCallback(h=>d.find(b=>b.key===h),[d]);R.useEffect(()=>{C&&e[0]?.required&&l([{key:e[0].key,editing:!0,initialValue:i[e[0].key]}])},[e,C,i]);const y=R.useCallback(h=>{l(b=>b.find(k=>k.key===h.key)?b.map(k=>k.key===h.key?h:{...k}):[h].concat(b))},[]),j=R.useCallback((h,b,P)=>{const{key:k,secure:M}=h,z=m(k)??{...h};z.editing=!0;const B=v[k]!==b;z.edited=b&&z.initialValue!==b,z.initialValue=i[k];const D={...v,[k]:b};B&&p(D),a({[k]:b},{allValues:D,action:P,currentItem:h}),P==="confirm"&&M&&p({...v,[k]:"__encrypted__"}),P==="confirm"&&(z.initialValue=v[k]),["confirm","cancel"].includes(P)&&(z.editing=!1,z.edited=!1),y(z)},[i,v,a,y,m]),w=R.useCallback((h,{editing:b=!1})=>{const{key:P}=h,k=c?r[P]:v[P];return k==="__encrypted__"?b?"":"******":k},[c,r,v]),E=R.useCallback(h=>{const b=m(h.key);b&&j(h,b.initialValue,"cancel")},[m,j]),u=R.useCallback(h=>{const b=m(h.key);!b||!b.edited||(b.shaking=!0,y(b),setTimeout(()=>{b.shaking=!1,y(b)},500))},[m,y]),s=R.useCallback(h=>{const b=m(h.key);!b||!b.edited?E(h):u(h)},[m,u,E]);return t.jsx(Va,{className:"form",style:o,children:e?.map(h=>{const{hidden:b=!1}=h;return b?null:t.jsx(Qn,{item:h,findEditingItem:m,getItemValue:w,onFormItemChange:j,onFocusOut:s,formValues:v,disabled:f,loading:n,onCancel:E})})})}Mo.propTypes={schema:x.array.isRequired,loading:x.bool,onChange:x.func.isRequired,value:x.object,defaultValue:x.object,style:x.object,disabled:x.bool};const Va=oe(bo)``;function zo({meta:e,onCancel:n,mode:r,handlePaySuccess:i=()=>{}}){const{t:a,locale:o}=ce(),{info:f}=xe(),c=Ds(f),[d,l]=R.useState(null),v=new URL(e?.registryUrl).origin,p=Z.getDisplayName({meta:e}),C=async(y,j)=>{const w=({downloadTokenList:s})=>{i({downloadTokenList:s})},E=s=>{G.error(s),n(s)};function u(s){return Us(()=>vr.get(s).then(async({data:h})=>{const b=h?.downloadTokenList;if(h.status==="succeed"){if(b&&b.length)await w({downloadTokenList:b});else return await E(a("blocklet.component.missDownloadTokenTip")),!0;return!0}return h.status==="error"?(console.error("vc error: ",h),await E(h?.error),!0):!1}),{interval:1e3})}if(r==="purchase"&&d){const{statusUrl:s}=Os(d);await u(s)}else await w({downloadTokenList:y.downloadTokenList&&j(y.downloadTokenList)})};if(R.useEffect(()=>{if(r==="purchase"){const y=new URL(v);y.pathname="/api/did/verify-purchase-blocklet/token",y.searchParams.set("serverDid",f.did),y.searchParams.set("blockletDid",e?.did);try{vr.get(y.href).then(({data:j})=>{const w=`${j.url}`;l(w)})}catch(j){console.error("get next workflow url error: ",j)}}return()=>{l(null)}},[r]),r==="purchase"&&!d)return"";const m={verify:{action:"verify-purchase-blocklet",checkFn:Gt.create({baseURL:v}).get,extraParams:{serverDid:f.did,blockletDid:e?.did},messages:{title:a("store.purchase.verify.auth.title",{name:p}),scan:a("store.purchase.verify.auth.scan"),confirm:a("store.purchase.verify.auth.confirm"),success:a("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:Gt.create({baseURL:Ee(v,"/store")}).get,extraParams:{factory:e.nftFactory,nw:d},messages:{title:a("store.purchase.auth.title",{name:p}),scan:a("store.purchase.auth.scan"),confirm:a("store.purchase.auth.confirm"),success:t.jsxs(t.Fragment,{children:[t.jsx("p",{children:a("store.purchase.auth.success")}),t.jsx("p",{children:a("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return t.jsx(Bs,{open:!0,locale:o,popup:!1,saveConnect:!1,className:"connect",baseUrl:v,onSuccess:C,cancelWhenScanned:n,onClose:n,checkTimeout:60*5e3,webWalletUrl:c,disableClose:!0,showDownload:!1,...m[r]})}zo.propTypes={...qi,handlePaySuccess:x.func,mode:x.oneOf(["verify","purchase"]).isRequired};function Fo({ref:e=null,mode:n,...r}){const[i,a]=R.useState(n!=="both"?n:"verify"),[o,f]=R.useState(n!=="both"?2:1),c=l=>{l!==i&&a(l)},d=()=>{i&&o!==2&&f(2)};return R.useImperativeHandle(e,()=>({onNext:d,getCurrentStep:()=>o})),o===1?t.jsx("div",{style:{maxWidth:520},children:t.jsx(Fi,{action:i,onNext:null,onSelect:c})}):t.jsx(zo,{...r,mode:i})}Fo.propTypes={mode:x.oneOf(["both","verify","purchase"]).isRequired,ref:x.any};function Ya({...e}){return t.jsx(Be,{className:"bottom-button",variant:"contained",color:"primary",...e})}function qo({blocklet:e=null,onStartNow:n=()=>{},children:r=null,disabled:i=!1}){const{t:a}=ce(),o=Ro();return!e||Ns(e.meta)?t.jsx(Za,{children:r}):t.jsxs(Qa,{isMobile:o,children:[t.jsx(Ya,{className:"start-now",variant:"contained",color:"primary",disabled:i,onClick:()=>n(),children:a("setup.startNow")}),t.jsx(U,{sx:{display:"flex",alignItems:"center"},children:r})]})}qo.propTypes={blocklet:x.object,onStartNow:x.func,children:x.any,disabled:x.bool};const Za=oe(U)`
|
|
108
108
|
width: 100%;
|
|
109
109
|
margin-top: auto;
|
|
110
110
|
padding-top: 24px;
|
|
@@ -149,12 +149,12 @@ import{aF as ze,j as t,ds as ws,gH as _s,iD as Ss,V as ce,bn as ge,K as U,ay as
|
|
|
149
149
|
justify-content: space-between;
|
|
150
150
|
gap: '32px',
|
|
151
151
|
}}
|
|
152
|
-
`;function $o({blockletMeta:e,onEndpointUpdate:n=()=>{}}){const r=Ro(),{blocklet:i}=De(),{updateSpaceGateway:a,loading:o,hasStorageEndpoint:
|
|
152
|
+
`;function $o({blockletMeta:e,onEndpointUpdate:n=()=>{}}){const r=Ro(),{blocklet:i}=De(),{updateSpaceGateway:a,loading:o,hasStorageEndpoint:f}=ra();return R.useEffect(()=>{n?.()},[i]),o?t.jsx(Ls,{relative:"parent",children:t.jsx(Ce,{})}):t.jsxs(Xa,{children:[t.jsx(U,{sx:{width:r?"360px":"720px"},children:f?t.jsx(oa,{}):t.jsx(sa,{})}),e?.capabilities?.didSpace==="required"&&t.jsx(qo,{mt:8,children:t.jsx(ia,{onConnect:a})})]})}$o.propTypes={blockletMeta:x.any.isRequired,onEndpointUpdate:As.func};const Xa=oe(la)`
|
|
153
153
|
height: 100%;
|
|
154
154
|
overflow-y: auto;
|
|
155
155
|
padding-bottom: 32px;
|
|
156
156
|
overflow-x: hidden;
|
|
157
|
-
`;function Wo({onChange:e=()=>{},loading:n=!1,children:r,extra:i="",stores:a=[],storageKey:o=""}){const{t:
|
|
157
|
+
`;function Wo({onChange:e=()=>{},loading:n=!1,children:r,extra:i="",stores:a=[],storageKey:o=""}){const{t:f}=ce(),{info:c,inService:d}=xe(),{blocklet:l}=De(),[v,p]=R.useState(!1),C=R.useRef(null),[m,y]=R.useState(),[j,w]=ba(o||"tmp"),[E,u]=o?[j,w]:[m,y],{storeList:s,teamDid:h}=co({fromBlocklet:d,blocklet:l,nodeInfo:c}),b=uo([...a.map(k=>({...k,protected:!0})),...s],"url"),P=E&&b.find(k=>E===k.url)||b[0];return t.jsxs(t.Fragment,{children:[t.jsxs(Ja,{children:[t.jsx(Be,{ref:C,color:"primary","data-cy":"add-component-select-store",endIcon:t.jsx(Ca,{color:"primary"}),onClick:()=>{p(!0)},style:{padding:"0 2px"},children:t.jsx(le,{color:"primary",children:P.name})}),t.jsx(le,{color:"primary",children:i})]}),t.jsxs(ye,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:f("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:P,autoFocus:!0,onChange:k=>{const M=k.target.value;u(M.url),e(M)},style:{display:"none"},margin:"normal",slotProps:{select:{open:v,MenuProps:{anchorEl:C.current},renderValue:k=>k?.name,onClose:()=>{p(!1)}}},children:[b?.map(k=>t.jsx(Ne,{sx:{width:"400px",maxWidth:"90vw"},value:k,"data-cy":k.url,children:t.jsx($i,{teamDid:h,store:k,onDelete:()=>{E===k.url&&u(b[0]?.url)}})},k.url)),!jo.isInServerlessMode(c)&&t.jsx(Wi,{disabled:n,storeList:b,teamDid:h,onAdd:k=>{u(k)}})]}),r({currentRegistry:P})]})}Wo.propTypes={onChange:x.func,loading:x.bool,children:x.any.isRequired,extra:x.node,storageKey:x.string,stores:x.arrayOf(x.shape({name:x.string.isRequired,url:x.string.isRequired}))};const Ja=oe.div`
|
|
158
158
|
display: flex;
|
|
159
159
|
justify-content: space-between;
|
|
160
160
|
align-items: center;
|
|
@@ -165,11 +165,11 @@ import{aF as ze,j as t,ds as ws,gH as _s,iD as Ss,V as ce,bn as ge,K as U,ay as
|
|
|
165
165
|
color: ${e=>e.theme.palette.text.primary};
|
|
166
166
|
// font-weight: bold;
|
|
167
167
|
}
|
|
168
|
-
`,el={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm0 10a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm10 0a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1zm0-8h6m-3-3v6"/>'},tl={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m17 10l-2-6m-8 6l2-6m4 16H7.244a3 3 0 0 1-2.965-2.544l-1.255-7.152A2 2 0 0 1 5.001 8H19a2 2 0 0 1 1.977 2.304"/><path d="M10 14a2 2 0 1 0 4 0a2 2 0 0 0-4 0m11 1h-2.5a1.5 1.5 0 0 0 0 3h1a1.5 1.5 0 0 1 0 3H17m2 0v1m0-8v1"/></g>'},nl={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m7 11l5-5l5 5M7 17l5-5l5 5"/>'},rl=(e,n)=>Ee(n,`/blocklets/${e.did}`),Er=({blocklet:e,attribute:n,value:r})=>e._formatted?e._formatted[n]:r,ol=e=>e.inStore&&
|
|
168
|
+
`,el={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm0 10a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm10 0a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1zm0-8h6m-3-3v6"/>'},tl={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m17 10l-2-6m-8 6l2-6m4 16H7.244a3 3 0 0 1-2.965-2.544l-1.255-7.152A2 2 0 0 1 5.001 8H19a2 2 0 0 1 1.977 2.304"/><path d="M10 14a2 2 0 1 0 4 0a2 2 0 0 0-4 0m11 1h-2.5a1.5 1.5 0 0 0 0 3h1a1.5 1.5 0 0 1 0 3H17m2 0v1m0-8v1"/></g>'},nl={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m7 11l5-5l5 5M7 17l5-5l5 5"/>'},rl=(e,n)=>Ee(n,`/blocklets/${e.did}`),Er=({blocklet:e,attribute:n,value:r})=>e._formatted?e._formatted[n]:r,ol=e=>e.inStore&&Z.isFreeBlocklet(e)===!1;function Ho({blocklet:e,blocklets:n=[],handleButtonClick:r=null,endpoint:i="",serverVersion:a=""}){const{t:o}=ce();let f=Ee(i,Ws(e.did,e.logo||""));try{const w=new URL(f);w.searchParams.set("v",e.version||+new Date),f=w.href}catch{}const[c,d]=R.useState(!1),l=async()=>{try{d(!0),await r({meta:e,registryUrl:i,blocklets:n})}catch(w){G.error(w.message)}finally{d(!1)}},{blocklet:v}=De(),p=()=>(v?.children||[]).find(u=>u.meta.bundleDid===e.did).meta.version,m=(()=>{const w=(v?.children||[]).find(E=>E.meta.bundleDid===e.did);if(w){try{const E=w.meta.version,u=e.version;if(Hs.gt(u,E))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),y=e.requirements?.server,j=[];return m==="upgrade"?j.push({key:"upgrade",icon:t.jsx(fe,{icon:nl,color:"success.light",width:20,height:20},"version"),title:`${p()} -> ${e.version}`,align:"right",color:"success.light",maxWidth:300,text:t.jsx(U,{sx:{fontWeight:"bold"},children:o("blocklet.component.upgradeAvailable")})}):m==="disable"?j.push({key:"disable",icon:t.jsx(fe,{icon:el,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:o("blocklet.component.installed")}):ol(e)&&j.push({key:"purchase",icon:t.jsx(fe,{icon:tl,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:o("blocklet.component.needBuy")}),t.jsx(sl,{title:Er({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:Er({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?f:"",version:e.version,onButtonClick:null,"data-cy":"install-blocklet",sx:m!=="disable"?{"&:hover, && *":{cursor:"pointer"}}:{"&:after, &:before":{content:'""',opacity:"0 !important"}},onMainClick:m==="disable"?void 0:l,icons:e.docker?.image?[{key:"docker",icon:t.jsx(U,{sx:{display:"flex",color:"primary.main"},children:t.jsx(fe,{icon:wo})}),title:o("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:o("blocklet.component.isOfficial")}:void 0,download:e.stats.downloads,status:j,button:t.jsx(Gi,{serverVersion:a,requirementVersion:y,size:"small",children:t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(Ki,{children:t.jsx(Be,{size:"small",disabled:c,variant:"outlined",color:"primary",onClick:w=>{w.preventDefault(),w.stopPropagation();const E=rl(e,i);E&&window.open(E,"_blank","noopener,noreferrer")},children:o("common.detail")},e.did)})})})})}Ho.propTypes={blocklet:x.object.isRequired,blocklets:x.array,handleButtonClick:x.func,endpoint:x.string,serverVersion:x.string};function Go({handleButtonClick:e=null,handleSearchSelect:n=null,storeUrl:r,handleBlockletRender:i=null,extraFilter:a=void 0,serverVersion:o="",resourceType:f="",resourceDid:c="",showResourcesSwitch:d=!0,showCategory:l=!0,compact:v=!1,...p}){const C=gt(),{locale:m}=ce(),[y,j]=R.useState(!1),[w,E]=R.useState({}),u=b=>{E(b)},s=r,h=R.useMemo(()=>Ms(C,{palette:{background:{default:C.palette.background.paper}}}),[C]);return R.useEffect(()=>{E({showResources:!0,resourceType:f,resourceDid:c})},[s,f,c]),R.useEffect(()=>{j(!0),E({showResources:!0,resourceType:f,resourceDid:c})},[]),t.jsx(zs,{theme:h,children:t.jsx(Fs,{FallbackComponent:qs,resetKeys:[s],children:t.jsxs(U,{...p,sx:$s({overflow:"auto",".title-bar + div":{height:"unset"}},p.sx),children:[y&&t.jsx(Hi,{showCategory:l,showResourcesSwitch:d,blockletRender:b=>{const P={...b,handleButtonClick:e,endpoint:s};return i({...b,defaultRender:t.jsx(Ho,{...P})})},compact:v,minItemWidth:300,baseSearch:!0,endpoint:s,locale:m,onFilterChange:u,onSearchSelect:n,filters:w,extraFilter:a,serverVersion:o,fetchCategoryDelay:500}),t.jsx(U,{sx:{mt:2},children:" "})]})})})}Go.propTypes={storeUrl:x.string.isRequired,handleButtonClick:x.func,handleSearchSelect:x.func,handleBlockletRender:x.func,extraFilter:x.func,serverVersion:x.string,resourceType:x.string,resourceDid:x.string,showResourcesSwitch:x.bool,showCategory:x.bool,compact:x.bool};const sl=oe(Vi)`
|
|
169
169
|
.ms-highlight {
|
|
170
170
|
color: ${e=>e.theme.palette.primary.main};
|
|
171
171
|
}
|
|
172
|
-
`;function Ko({ref:e=null,meta:n=null,isMobile:r,onStepChange:i}){const a=gt(),{steps:o,activeStep:
|
|
172
|
+
`;function Ko({ref:e=null,meta:n=null,isMobile:r,onStepChange:i}){const a=gt(),{steps:o,activeStep:f,setActiveStepByKey:c,setActiveStepByIndex:d}=Ji(),{t:l,locale:v}=ce(),p=o[f];return R.useEffect(()=>{i(f)},[i,f]),R.useImperativeHandle(e,()=>({setActiveStepByKey:c,setActiveStepByIndex:d})),t.jsx(al,{component:"div",className:r?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-of-type":{flex:{md:1}}},children:t.jsx(ea,{locale:v,blockletMeta:{title:" ",...n},pcWidth:"100%",pcHeight:"100%",logoUrl:n&&n.logo&&n.registryUrl?Gs({did:n.did,version:n.version,baseUrl:n.registryUrl,logoPath:n.logo}):null,theme:a,stepTip:l("blocklet.component.add"),children:t.jsx(il,{children:typeof p?.body=="function"?p.body():p?.body})})})}Ko.propTypes={ref:x.any,meta:x.any,onStepChange:x.func.isRequired,isMobile:x.bool.isRequired};const kr=e=>e.isMobile?`
|
|
173
173
|
height: calc(100vh - 56px - 64px - 48px);
|
|
174
174
|
`:"",il=oe.div`
|
|
175
175
|
width: 100%;
|
|
@@ -320,11 +320,7 @@ import{aF as ze,j as t,ds as ws,gH as _s,iD as Ss,V as ce,bn as ge,K as U,ay as
|
|
|
320
320
|
25%, 75% {
|
|
321
321
|
transform: scale(1.1) translateX(3px);
|
|
322
322
|
}
|
|
323
|
-
`;function Dt({src:e,alt:n,size:r=20}){return t.jsx("img",{src:e,alt:n,style:{width:r,height:r,display:"block",objectFit:"contain",borderRadius:"2px",flexShrink:0},onError:i=>{i.target.style.display="none"}})}Dt.propTypes={src:x.string.isRequired,alt:x.string.isRequired,size:x.number};const cl=48,dl=8,Rr={PaperProps:{style:{maxHeight:cl*4.5+dl,width:250}}},ul=(e,n,r)=>({fontWeight:n.indexOf(e)===-1?r.typography.fontWeightRegular:r.typography.fontWeightMedium});function Vo({label:e="",disabled:n=!1,required:r=!1,initialValue:i="",onChange:a=()=>{},sx:o={},onSubmit:m=()=>{},triggers:c=[],options:d=[],formatterBeforeSubmit:l=w=>w.join(","),helperText:v="",config:p={},directEditing:C=!1,searchable:f=!0,...y}){const w=gt(),[j,E]=R.useState(C),[u,s]=R.useState(!1),[h,b]=R.useState(""),{multiple:P=!1,labelField:k="name",valueField:M="code"}=p,[F,I]=R.useState(i),[B,D]=R.useState(F),[L,z]=R.useState(!1),[$,H]=R.useState(!1),J=R.useCallback(()=>{H(!0),setTimeout(()=>{H(!1)},500)},[]),se=async()=>{s(!0);try{await m(typeof l=="function"&&P?l(B):B)===!1?D(F):(D(B),I(B),z(!1))}catch{D(F)}finally{s(!1),E(!1)}},O=R.useCallback(()=>{C&&!n&&!u&&se(),L&&J(),!L&&!n&&!u&&(E(!1),z(!1))},[C,n,u,L,J]);R.useEffect(()=>{const g=i;g!==F&&(I(g),D(g),z(!1))},[i,F]);const te=d.filter(g=>{if(!h)return!0;const S=h.toLowerCase();return g[k]?.toLowerCase().includes(S)||g[M]?.toLowerCase().includes(S)}),_=g=>{let{value:S}=g.target;P&&(S=typeof S=="string"?S.split(","):S),z(S!==B),D(S),a(S)},T=j||C?t.jsxs(Ks,{value:B,onChange:_,fullWidth:!0,multiple:P,variant:"outlined",margin:"dense",onBlur:O,disabled:n,renderValue:g=>{if(P)return t.jsx(U,{sx:{display:"flex",flexWrap:"wrap"},children:g.filter(N=>d.some(K=>K[M]===N)).map(N=>t.jsx(ir,{label:d.find(K=>K[M]===N)[k],style:{marginRight:8},size:"small"},N))});if(!g)return null;const S=d.find(N=>N[M]===g);return t.jsxs(U,{sx:{display:"flex",alignItems:"center",gap:1},children:[S?.logo&&t.jsx(Dt,{src:S.logo,alt:S[k],size:20}),t.jsx("span",{children:S?S[k]:""})]})},MenuProps:{...Rr,PaperProps:{...Rr.PaperProps}},error:!!v,...y,children:[f?t.jsx(U,{sx:{p:1,borderBottom:1,borderColor:"divider"},children:t.jsx(xe,{size:"small",placeholder:"Search...",value:h,onChange:g=>b(g.target.value),onClick:g=>g.stopPropagation(),onKeyDown:g=>g.stopPropagation(),fullWidth:!0,variant:"outlined"})}):null,te.map(g=>t.jsx(Ne,{value:g[M],style:ul(g[M],B,w),children:t.jsxs(U,{sx:{display:"flex",alignItems:"center",gap:1},children:[g.logo&&t.jsx(Dt,{src:g.logo,alt:g[k],size:20}),t.jsx("span",{children:g[k]})]})},g[M]))]}):t.jsx(U,{"data-cy":"schema-form-item-edit",className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},sx:{px:1},onClick:()=>{n||E(!0)},children:P?B.filter(g=>d.some(S=>S[M]===g)).map(g=>t.jsx(ir,{label:d.find(S=>S[M]===g)[k],style:{marginRight:8},size:"small"},g)):B&&d.some(g=>g[M]===B)&&t.jsxs(U,{sx:{display:"flex",alignItems:"center",gap:1},children:[(()=>{const g=d.find(S=>S[M]===B);return g?.logo?t.jsx(Dt,{src:g.logo,alt:g[k],size:20}):null})(),t.jsx("span",{children:d.find(g=>g[M]===B)[k]})]})});return t.jsx(bo,{className:"form",sx:o,children:t.jsxs(U,{className:"form-item",children:[t.jsxs(U,{className:"form-item-label",children:[e,r&&t.jsx(ot,{})]}),t.jsxs(U,{className:"form-item-body",children:[t.jsx(U,{className:"form-item-input",children:T}),t.jsx(U,{className:"form-item-action",style:!j||C?{marginLeft:0}:{},children:j&&!C?t.jsxs(t.Fragment,{children:[L?t.jsx(me,{"data-cy":"schema-form-item-confirm",onClick:se,disabled:n||u,sx:{animation:$?`${ll} 0.5s linear`:"none"},size:"large",children:u?t.jsx(Ce,{size:24}):t.jsx(So,{})}):null,t.jsx(me,{"data-cy":"schema-form-item-cancel",onClick:()=>{D(F),E(!1)},disabled:n||u,size:"large",children:t.jsx(lo,{})})]}):t.jsx(U,{children:c.length?t.jsx(Li,{triggers:c,disabled:n}):null})})]}),j&&v&&t.jsx(Vs,{error:!0,children:v})]})})}Vo.propTypes={sx:x.object,onSubmit:x.func,onChange:x.func,label:x.string,initialValue:x.string,required:x.bool,disabled:x.bool,triggers:x.array,options:x.array,helperText:x.string,formatterBeforeSubmit:x.func,config:x.object,directEditing:x.bool,searchable:x.bool};const He={};function pl(e){He[e]&&(clearTimeout(He[e]),delete He[e])}async function fl(e,{interval:n=1e3,maxDuration:r=120*1e3,intervalFirst:i=4e3,timerKey:a=""}){He[a]&&clearTimeout(He[a]),await new Promise(c=>setTimeout(c,i));const o=Date.now(),m=async(c,d)=>{try{const l=await e();c(l)}catch(l){Date.now()-o>r?d(l):a?He[a]=setTimeout(()=>m(c,d),n):setTimeout(()=>m(c,d),n)}};return new Promise(m)}function ml(e,{did:n,refresh:r,t:i,providerName:a,values:o,timerKey:m}){return fl(async()=>{const{blocklet:c}=await e.getBlocklet({input:{did:n}}),d=Ys(c,"settings.aigne",{}),{url:l,key:v,provider:p}=d||{},{key:C}=o;if(p==="aigneHub"){if(!l||!v)throw new Error(i("setting.aigne.connectTimeOut",{provider:a}));if(C&&C===v)throw new Error(i("setting.aigne.connectTimeOut",{provider:a}));await r(),clearTimeout(He[`connect-aigne-${n}`])}else{if(!C||C!==v)throw new Error(i("setting.aigne.connectTimeOut",{provider:a}));await r(),clearTimeout(He[`connect-aigne-${n}`])}},{timerKey:m,maxDuration:3*60*1e3})}var Se={},Bt={exports:{}},Ot={exports:{}},hl=Ot.exports,Pr;function Oe(){return Pr||(Pr=1,function(e,n){(function(r,i){e.exports=i()})(hl,function(){var r=r||function(i,a){var o;if(typeof window<"u"&&window.crypto&&(o=window.crypto),typeof self<"u"&&self.crypto&&(o=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window<"u"&&window.msCrypto&&(o=window.msCrypto),!o&&typeof It<"u"&&It.crypto&&(o=It.crypto),!o&&typeof Zs=="function")try{o=po()}catch{}var m=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},c=Object.create||function(){function u(){}return function(s){var h;return u.prototype=s,h=new u,u.prototype=null,h}}(),d={},l=d.lib={},v=l.Base=function(){return{extend:function(u){var s=c(this);return u&&s.mixIn(u),(!s.hasOwnProperty("init")||this.init===s.init)&&(s.init=function(){s.$super.init.apply(this,arguments)}),s.init.prototype=s,s.$super=this,s},create:function(){var u=this.extend();return u.init.apply(u,arguments),u},init:function(){},mixIn:function(u){for(var s in u)u.hasOwnProperty(s)&&(this[s]=u[s]);u.hasOwnProperty("toString")&&(this.toString=u.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),p=l.WordArray=v.extend({init:function(u,s){u=this.words=u||[],s!=a?this.sigBytes=s:this.sigBytes=u.length*4},toString:function(u){return(u||f).stringify(this)},concat:function(u){var s=this.words,h=u.words,b=this.sigBytes,P=u.sigBytes;if(this.clamp(),b%4)for(var k=0;k<P;k++){var M=h[k>>>2]>>>24-k%4*8&255;s[b+k>>>2]|=M<<24-(b+k)%4*8}else for(var F=0;F<P;F+=4)s[b+F>>>2]=h[F>>>2];return this.sigBytes+=P,this},clamp:function(){var u=this.words,s=this.sigBytes;u[s>>>2]&=4294967295<<32-s%4*8,u.length=i.ceil(s/4)},clone:function(){var u=v.clone.call(this);return u.words=this.words.slice(0),u},random:function(u){for(var s=[],h=0;h<u;h+=4)s.push(m());return new p.init(s,u)}}),C=d.enc={},f=C.Hex={stringify:function(u){for(var s=u.words,h=u.sigBytes,b=[],P=0;P<h;P++){var k=s[P>>>2]>>>24-P%4*8&255;b.push((k>>>4).toString(16)),b.push((k&15).toString(16))}return b.join("")},parse:function(u){for(var s=u.length,h=[],b=0;b<s;b+=2)h[b>>>3]|=parseInt(u.substr(b,2),16)<<24-b%8*4;return new p.init(h,s/2)}},y=C.Latin1={stringify:function(u){for(var s=u.words,h=u.sigBytes,b=[],P=0;P<h;P++){var k=s[P>>>2]>>>24-P%4*8&255;b.push(String.fromCharCode(k))}return b.join("")},parse:function(u){for(var s=u.length,h=[],b=0;b<s;b++)h[b>>>2]|=(u.charCodeAt(b)&255)<<24-b%4*8;return new p.init(h,s)}},w=C.Utf8={stringify:function(u){try{return decodeURIComponent(escape(y.stringify(u)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(u){return y.parse(unescape(encodeURIComponent(u)))}},j=l.BufferedBlockAlgorithm=v.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(u){typeof u=="string"&&(u=w.parse(u)),this._data.concat(u),this._nDataBytes+=u.sigBytes},_process:function(u){var s,h=this._data,b=h.words,P=h.sigBytes,k=this.blockSize,M=k*4,F=P/M;u?F=i.ceil(F):F=i.max((F|0)-this._minBufferSize,0);var I=F*k,B=i.min(I*4,P);if(I){for(var D=0;D<I;D+=k)this._doProcessBlock(b,D);s=b.splice(0,I),h.sigBytes-=B}return new p.init(s,B)},clone:function(){var u=v.clone.call(this);return u._data=this._data.clone(),u},_minBufferSize:0});l.Hasher=j.extend({cfg:v.extend(),init:function(u){this.cfg=this.cfg.extend(u),this.reset()},reset:function(){j.reset.call(this),this._doReset()},update:function(u){return this._append(u),this._process(),this},finalize:function(u){u&&this._append(u);var s=this._doFinalize();return s},blockSize:16,_createHelper:function(u){return function(s,h){return new u.init(h).finalize(s)}},_createHmacHelper:function(u){return function(s,h){return new E.HMAC.init(u,h).finalize(s)}}});var E=d.algo={};return d}(Math);return r})}(Ot)),Ot.exports}var Ut={exports:{}},gl=Ut.exports,Tr;function Yo(){return Tr||(Tr=1,function(e,n){(function(r,i){e.exports=i(Oe())})(gl,function(r){return function(){var i=r,a=i.lib,o=a.WordArray,m=i.enc;m.Base64={stringify:function(d){var l=d.words,v=d.sigBytes,p=this._map;d.clamp();for(var C=[],f=0;f<v;f+=3)for(var y=l[f>>>2]>>>24-f%4*8&255,w=l[f+1>>>2]>>>24-(f+1)%4*8&255,j=l[f+2>>>2]>>>24-(f+2)%4*8&255,E=y<<16|w<<8|j,u=0;u<4&&f+u*.75<v;u++)C.push(p.charAt(E>>>6*(3-u)&63));var s=p.charAt(64);if(s)for(;C.length%4;)C.push(s);return C.join("")},parse:function(d){var l=d.length,v=this._map,p=this._reverseMap;if(!p){p=this._reverseMap=[];for(var C=0;C<v.length;C++)p[v.charCodeAt(C)]=C}var f=v.charAt(64);if(f){var y=d.indexOf(f);y!==-1&&(l=y)}return c(d,l,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function c(d,l,v){for(var p=[],C=0,f=0;f<l;f++)if(f%4){var y=v[d.charCodeAt(f-1)]<<f%4*2,w=v[d.charCodeAt(f)]>>>6-f%4*2,j=y|w;p[C>>>2]|=j<<24-C%4*8,C++}return o.create(p,C)}}(),r.enc.Base64})}(Ut)),Ut.exports}var Nt={exports:{}},xl=Nt.exports,Ir;function yl(){return Ir||(Ir=1,function(e,n){(function(r,i){e.exports=i(Oe())})(xl,function(r){return function(i){var a=r,o=a.lib,m=o.WordArray,c=o.Hasher,d=a.algo,l=[];(function(){for(var w=0;w<64;w++)l[w]=i.abs(i.sin(w+1))*4294967296|0})();var v=d.MD5=c.extend({_doReset:function(){this._hash=new m.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(w,j){for(var E=0;E<16;E++){var u=j+E,s=w[u];w[u]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360}var h=this._hash.words,b=w[j+0],P=w[j+1],k=w[j+2],M=w[j+3],F=w[j+4],I=w[j+5],B=w[j+6],D=w[j+7],L=w[j+8],z=w[j+9],$=w[j+10],H=w[j+11],J=w[j+12],se=w[j+13],O=w[j+14],te=w[j+15],_=h[0],T=h[1],g=h[2],S=h[3];_=p(_,T,g,S,b,7,l[0]),S=p(S,_,T,g,P,12,l[1]),g=p(g,S,_,T,k,17,l[2]),T=p(T,g,S,_,M,22,l[3]),_=p(_,T,g,S,F,7,l[4]),S=p(S,_,T,g,I,12,l[5]),g=p(g,S,_,T,B,17,l[6]),T=p(T,g,S,_,D,22,l[7]),_=p(_,T,g,S,L,7,l[8]),S=p(S,_,T,g,z,12,l[9]),g=p(g,S,_,T,$,17,l[10]),T=p(T,g,S,_,H,22,l[11]),_=p(_,T,g,S,J,7,l[12]),S=p(S,_,T,g,se,12,l[13]),g=p(g,S,_,T,O,17,l[14]),T=p(T,g,S,_,te,22,l[15]),_=C(_,T,g,S,P,5,l[16]),S=C(S,_,T,g,B,9,l[17]),g=C(g,S,_,T,H,14,l[18]),T=C(T,g,S,_,b,20,l[19]),_=C(_,T,g,S,I,5,l[20]),S=C(S,_,T,g,$,9,l[21]),g=C(g,S,_,T,te,14,l[22]),T=C(T,g,S,_,F,20,l[23]),_=C(_,T,g,S,z,5,l[24]),S=C(S,_,T,g,O,9,l[25]),g=C(g,S,_,T,M,14,l[26]),T=C(T,g,S,_,L,20,l[27]),_=C(_,T,g,S,se,5,l[28]),S=C(S,_,T,g,k,9,l[29]),g=C(g,S,_,T,D,14,l[30]),T=C(T,g,S,_,J,20,l[31]),_=f(_,T,g,S,I,4,l[32]),S=f(S,_,T,g,L,11,l[33]),g=f(g,S,_,T,H,16,l[34]),T=f(T,g,S,_,O,23,l[35]),_=f(_,T,g,S,P,4,l[36]),S=f(S,_,T,g,F,11,l[37]),g=f(g,S,_,T,D,16,l[38]),T=f(T,g,S,_,$,23,l[39]),_=f(_,T,g,S,se,4,l[40]),S=f(S,_,T,g,b,11,l[41]),g=f(g,S,_,T,M,16,l[42]),T=f(T,g,S,_,B,23,l[43]),_=f(_,T,g,S,z,4,l[44]),S=f(S,_,T,g,J,11,l[45]),g=f(g,S,_,T,te,16,l[46]),T=f(T,g,S,_,k,23,l[47]),_=y(_,T,g,S,b,6,l[48]),S=y(S,_,T,g,D,10,l[49]),g=y(g,S,_,T,O,15,l[50]),T=y(T,g,S,_,I,21,l[51]),_=y(_,T,g,S,J,6,l[52]),S=y(S,_,T,g,M,10,l[53]),g=y(g,S,_,T,$,15,l[54]),T=y(T,g,S,_,P,21,l[55]),_=y(_,T,g,S,L,6,l[56]),S=y(S,_,T,g,te,10,l[57]),g=y(g,S,_,T,B,15,l[58]),T=y(T,g,S,_,se,21,l[59]),_=y(_,T,g,S,F,6,l[60]),S=y(S,_,T,g,H,10,l[61]),g=y(g,S,_,T,k,15,l[62]),T=y(T,g,S,_,z,21,l[63]),h[0]=h[0]+_|0,h[1]=h[1]+T|0,h[2]=h[2]+g|0,h[3]=h[3]+S|0},_doFinalize:function(){var w=this._data,j=w.words,E=this._nDataBytes*8,u=w.sigBytes*8;j[u>>>5]|=128<<24-u%32;var s=i.floor(E/4294967296),h=E;j[(u+64>>>9<<4)+15]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,j[(u+64>>>9<<4)+14]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360,w.sigBytes=(j.length+1)*4,this._process();for(var b=this._hash,P=b.words,k=0;k<4;k++){var M=P[k];P[k]=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360}return b},clone:function(){var w=c.clone.call(this);return w._hash=this._hash.clone(),w}});function p(w,j,E,u,s,h,b){var P=w+(j&E|~j&u)+s+b;return(P<<h|P>>>32-h)+j}function C(w,j,E,u,s,h,b){var P=w+(j&u|E&~u)+s+b;return(P<<h|P>>>32-h)+j}function f(w,j,E,u,s,h,b){var P=w+(j^E^u)+s+b;return(P<<h|P>>>32-h)+j}function y(w,j,E,u,s,h,b){var P=w+(E^(j|~u))+s+b;return(P<<h|P>>>32-h)+j}a.MD5=c._createHelper(v),a.HmacMD5=c._createHmacHelper(v)}(Math),r.MD5})}(Nt)),Nt.exports}var Lt={exports:{}},At={exports:{}},vl=At.exports,Dr;function Cl(){return Dr||(Dr=1,function(e,n){(function(r,i){e.exports=i(Oe())})(vl,function(r){return function(){var i=r,a=i.lib,o=a.WordArray,m=a.Hasher,c=i.algo,d=[],l=c.SHA1=m.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(v,p){for(var C=this._hash.words,f=C[0],y=C[1],w=C[2],j=C[3],E=C[4],u=0;u<80;u++){if(u<16)d[u]=v[p+u]|0;else{var s=d[u-3]^d[u-8]^d[u-14]^d[u-16];d[u]=s<<1|s>>>31}var h=(f<<5|f>>>27)+E+d[u];u<20?h+=(y&w|~y&j)+1518500249:u<40?h+=(y^w^j)+1859775393:u<60?h+=(y&w|y&j|w&j)-1894007588:h+=(y^w^j)-899497514,E=j,j=w,w=y<<30|y>>>2,y=f,f=h}C[0]=C[0]+f|0,C[1]=C[1]+y|0,C[2]=C[2]+w|0,C[3]=C[3]+j|0,C[4]=C[4]+E|0},_doFinalize:function(){var v=this._data,p=v.words,C=this._nDataBytes*8,f=v.sigBytes*8;return p[f>>>5]|=128<<24-f%32,p[(f+64>>>9<<4)+14]=Math.floor(C/4294967296),p[(f+64>>>9<<4)+15]=C,v.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var v=m.clone.call(this);return v._hash=this._hash.clone(),v}});i.SHA1=m._createHelper(l),i.HmacSHA1=m._createHmacHelper(l)}(),r.SHA1})}(At)),At.exports}var Mt={exports:{}},bl=Mt.exports,Br;function jl(){return Br||(Br=1,function(e,n){(function(r,i){e.exports=i(Oe())})(bl,function(r){(function(){var i=r,a=i.lib,o=a.Base,m=i.enc,c=m.Utf8,d=i.algo;d.HMAC=o.extend({init:function(l,v){l=this._hasher=new l.init,typeof v=="string"&&(v=c.parse(v));var p=l.blockSize,C=p*4;v.sigBytes>C&&(v=l.finalize(v)),v.clamp();for(var f=this._oKey=v.clone(),y=this._iKey=v.clone(),w=f.words,j=y.words,E=0;E<p;E++)w[E]^=1549556828,j[E]^=909522486;f.sigBytes=y.sigBytes=C,this.reset()},reset:function(){var l=this._hasher;l.reset(),l.update(this._iKey)},update:function(l){return this._hasher.update(l),this},finalize:function(l){var v=this._hasher,p=v.finalize(l);v.reset();var C=v.finalize(this._oKey.clone().concat(p));return C}})})()})}(Mt)),Mt.exports}var wl=Lt.exports,Or;function Zo(){return Or||(Or=1,function(e,n){(function(r,i,a){e.exports=i(Oe(),Cl(),jl())})(wl,function(r){return function(){var i=r,a=i.lib,o=a.Base,m=a.WordArray,c=i.algo,d=c.MD5,l=c.EvpKDF=o.extend({cfg:o.extend({keySize:128/32,hasher:d,iterations:1}),init:function(v){this.cfg=this.cfg.extend(v)},compute:function(v,p){for(var C,f=this.cfg,y=f.hasher.create(),w=m.create(),j=w.words,E=f.keySize,u=f.iterations;j.length<E;){C&&y.update(C),C=y.update(v).finalize(p),y.reset();for(var s=1;s<u;s++)C=y.finalize(C),y.reset();w.concat(C)}return w.sigBytes=E*4,w}});i.EvpKDF=function(v,p,C){return l.create(C).compute(v,p)}}(),r.EvpKDF})}(Lt)),Lt.exports}var Ft={exports:{}},_l=Ft.exports,Ur;function Sl(){return Ur||(Ur=1,function(e,n){(function(r,i,a){e.exports=i(Oe(),Zo())})(_l,function(r){r.lib.Cipher||function(i){var a=r,o=a.lib,m=o.Base,c=o.WordArray,d=o.BufferedBlockAlgorithm,l=a.enc;l.Utf8;var v=l.Base64,p=a.algo,C=p.EvpKDF,f=o.Cipher=d.extend({cfg:m.extend(),createEncryptor:function(I,B){return this.create(this._ENC_XFORM_MODE,I,B)},createDecryptor:function(I,B){return this.create(this._DEC_XFORM_MODE,I,B)},init:function(I,B,D){this.cfg=this.cfg.extend(D),this._xformMode=I,this._key=B,this.reset()},reset:function(){d.reset.call(this),this._doReset()},process:function(I){return this._append(I),this._process()},finalize:function(I){I&&this._append(I);var B=this._doFinalize();return B},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function I(B){return typeof B=="string"?F:P}return function(B){return{encrypt:function(D,L,z){return I(L).encrypt(B,D,L,z)},decrypt:function(D,L,z){return I(L).decrypt(B,D,L,z)}}}}()});o.StreamCipher=f.extend({_doFinalize:function(){var I=this._process(!0);return I},blockSize:1});var y=a.mode={},w=o.BlockCipherMode=m.extend({createEncryptor:function(I,B){return this.Encryptor.create(I,B)},createDecryptor:function(I,B){return this.Decryptor.create(I,B)},init:function(I,B){this._cipher=I,this._iv=B}}),j=y.CBC=function(){var I=w.extend();I.Encryptor=I.extend({processBlock:function(D,L){var z=this._cipher,$=z.blockSize;B.call(this,D,L,$),z.encryptBlock(D,L),this._prevBlock=D.slice(L,L+$)}}),I.Decryptor=I.extend({processBlock:function(D,L){var z=this._cipher,$=z.blockSize,H=D.slice(L,L+$);z.decryptBlock(D,L),B.call(this,D,L,$),this._prevBlock=H}});function B(D,L,z){var $,H=this._iv;H?($=H,this._iv=i):$=this._prevBlock;for(var J=0;J<z;J++)D[L+J]^=$[J]}return I}(),E=a.pad={},u=E.Pkcs7={pad:function(I,B){for(var D=B*4,L=D-I.sigBytes%D,z=L<<24|L<<16|L<<8|L,$=[],H=0;H<L;H+=4)$.push(z);var J=c.create($,L);I.concat(J)},unpad:function(I){var B=I.words[I.sigBytes-1>>>2]&255;I.sigBytes-=B}};o.BlockCipher=f.extend({cfg:f.cfg.extend({mode:j,padding:u}),reset:function(){var I;f.reset.call(this);var B=this.cfg,D=B.iv,L=B.mode;this._xformMode==this._ENC_XFORM_MODE?I=L.createEncryptor:(I=L.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==I?this._mode.init(this,D&&D.words):(this._mode=I.call(L,this,D&&D.words),this._mode.__creator=I)},_doProcessBlock:function(I,B){this._mode.processBlock(I,B)},_doFinalize:function(){var I,B=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(B.pad(this._data,this.blockSize),I=this._process(!0)):(I=this._process(!0),B.unpad(I)),I},blockSize:128/32});var s=o.CipherParams=m.extend({init:function(I){this.mixIn(I)},toString:function(I){return(I||this.formatter).stringify(this)}}),h=a.format={},b=h.OpenSSL={stringify:function(I){var B,D=I.ciphertext,L=I.salt;return L?B=c.create([1398893684,1701076831]).concat(L).concat(D):B=D,B.toString(v)},parse:function(I){var B,D=v.parse(I),L=D.words;return L[0]==1398893684&&L[1]==1701076831&&(B=c.create(L.slice(2,4)),L.splice(0,4),D.sigBytes-=16),s.create({ciphertext:D,salt:B})}},P=o.SerializableCipher=m.extend({cfg:m.extend({format:b}),encrypt:function(I,B,D,L){L=this.cfg.extend(L);var z=I.createEncryptor(D,L),$=z.finalize(B),H=z.cfg;return s.create({ciphertext:$,key:D,iv:H.iv,algorithm:I,mode:H.mode,padding:H.padding,blockSize:I.blockSize,formatter:L.format})},decrypt:function(I,B,D,L){L=this.cfg.extend(L),B=this._parse(B,L.format);var z=I.createDecryptor(D,L).finalize(B.ciphertext);return z},_parse:function(I,B){return typeof I=="string"?B.parse(I,this):I}}),k=a.kdf={},M=k.OpenSSL={execute:function(I,B,D,L,z){if(L||(L=c.random(64/8)),z)var $=C.create({keySize:B+D,hasher:z}).compute(I,L);else var $=C.create({keySize:B+D}).compute(I,L);var H=c.create($.words.slice(B),D*4);return $.sigBytes=B*4,s.create({key:$,iv:H,salt:L})}},F=o.PasswordBasedCipher=P.extend({cfg:P.cfg.extend({kdf:M}),encrypt:function(I,B,D,L){L=this.cfg.extend(L);var z=L.kdf.execute(D,I.keySize,I.ivSize,L.salt,L.hasher);L.iv=z.iv;var $=P.encrypt.call(this,I,B,z.key,L);return $.mixIn(z),$},decrypt:function(I,B,D,L){L=this.cfg.extend(L),B=this._parse(B,L.format);var z=L.kdf.execute(D,I.keySize,I.ivSize,B.salt,L.hasher);L.iv=z.iv;var $=P.decrypt.call(this,I,B,z.key,L);return $}})}()})}(Ft)),Ft.exports}var El=Bt.exports,Nr;function kl(){return Nr||(Nr=1,function(e,n){(function(r,i,a){e.exports=i(Oe(),Yo(),yl(),Zo(),Sl())})(El,function(r){return function(){var i=r,a=i.lib,o=a.BlockCipher,m=i.algo,c=[],d=[],l=[],v=[],p=[],C=[],f=[],y=[],w=[],j=[];(function(){for(var s=[],h=0;h<256;h++)h<128?s[h]=h<<1:s[h]=h<<1^283;for(var b=0,P=0,h=0;h<256;h++){var k=P^P<<1^P<<2^P<<3^P<<4;k=k>>>8^k&255^99,c[b]=k,d[k]=b;var M=s[b],F=s[M],I=s[F],B=s[k]*257^k*16843008;l[b]=B<<24|B>>>8,v[b]=B<<16|B>>>16,p[b]=B<<8|B>>>24,C[b]=B;var B=I*16843009^F*65537^M*257^b*16843008;f[k]=B<<24|B>>>8,y[k]=B<<16|B>>>16,w[k]=B<<8|B>>>24,j[k]=B,b?(b=M^s[s[s[I^M]]],P^=s[s[P]]):b=P=1}})();var E=[0,1,2,4,8,16,32,64,128,27,54],u=m.AES=o.extend({_doReset:function(){var s;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var h=this._keyPriorReset=this._key,b=h.words,P=h.sigBytes/4,k=this._nRounds=P+6,M=(k+1)*4,F=this._keySchedule=[],I=0;I<M;I++)I<P?F[I]=b[I]:(s=F[I-1],I%P?P>6&&I%P==4&&(s=c[s>>>24]<<24|c[s>>>16&255]<<16|c[s>>>8&255]<<8|c[s&255]):(s=s<<8|s>>>24,s=c[s>>>24]<<24|c[s>>>16&255]<<16|c[s>>>8&255]<<8|c[s&255],s^=E[I/P|0]<<24),F[I]=F[I-P]^s);for(var B=this._invKeySchedule=[],D=0;D<M;D++){var I=M-D;if(D%4)var s=F[I];else var s=F[I-4];D<4||I<=4?B[D]=s:B[D]=f[c[s>>>24]]^y[c[s>>>16&255]]^w[c[s>>>8&255]]^j[c[s&255]]}}},encryptBlock:function(s,h){this._doCryptBlock(s,h,this._keySchedule,l,v,p,C,c)},decryptBlock:function(s,h){var b=s[h+1];s[h+1]=s[h+3],s[h+3]=b,this._doCryptBlock(s,h,this._invKeySchedule,f,y,w,j,d);var b=s[h+1];s[h+1]=s[h+3],s[h+3]=b},_doCryptBlock:function(s,h,b,P,k,M,F,I){for(var B=this._nRounds,D=s[h]^b[0],L=s[h+1]^b[1],z=s[h+2]^b[2],$=s[h+3]^b[3],H=4,J=1;J<B;J++){var se=P[D>>>24]^k[L>>>16&255]^M[z>>>8&255]^F[$&255]^b[H++],O=P[L>>>24]^k[z>>>16&255]^M[$>>>8&255]^F[D&255]^b[H++],te=P[z>>>24]^k[$>>>16&255]^M[D>>>8&255]^F[L&255]^b[H++],_=P[$>>>24]^k[D>>>16&255]^M[L>>>8&255]^F[z&255]^b[H++];D=se,L=O,z=te,$=_}var se=(I[D>>>24]<<24|I[L>>>16&255]<<16|I[z>>>8&255]<<8|I[$&255])^b[H++],O=(I[L>>>24]<<24|I[z>>>16&255]<<16|I[$>>>8&255]<<8|I[D&255])^b[H++],te=(I[z>>>24]<<24|I[$>>>16&255]<<16|I[D>>>8&255]<<8|I[L&255])^b[H++],_=(I[$>>>24]<<24|I[D>>>16&255]<<16|I[L>>>8&255]<<8|I[z&255])^b[H++];s[h]=se,s[h+1]=O,s[h+2]=te,s[h+3]=_},keySize:256/32});i.AES=o._createHelper(u)}(),r.AES})}(Bt)),Bt.exports}var zt={exports:{}},Rl=zt.exports,Lr;function Pl(){return Lr||(Lr=1,function(e,n){(function(r,i){e.exports=i(Oe())})(Rl,function(r){return r.enc.Latin1})}(zt)),zt.exports}var qt={exports:{}},Tl=qt.exports,Ar;function Il(){return Ar||(Ar=1,function(e,n){(function(r,i){e.exports=i(Oe())})(Tl,function(r){return r.enc.Utf8})}(qt)),qt.exports}var $t={exports:{}},Dl=$t.exports,Mr;function Bl(){return Mr||(Mr=1,function(e,n){(function(r,i){e.exports=i(Oe())})(Dl,function(r){return function(){var i=r,a=i.lib,o=a.WordArray,m=i.enc;m.Utf16=m.Utf16BE={stringify:function(d){for(var l=d.words,v=d.sigBytes,p=[],C=0;C<v;C+=2){var f=l[C>>>2]>>>16-C%4*8&65535;p.push(String.fromCharCode(f))}return p.join("")},parse:function(d){for(var l=d.length,v=[],p=0;p<l;p++)v[p>>>1]|=d.charCodeAt(p)<<16-p%2*16;return o.create(v,l*2)}},m.Utf16LE={stringify:function(d){for(var l=d.words,v=d.sigBytes,p=[],C=0;C<v;C+=2){var f=c(l[C>>>2]>>>16-C%4*8&65535);p.push(String.fromCharCode(f))}return p.join("")},parse:function(d){for(var l=d.length,v=[],p=0;p<l;p++)v[p>>>1]|=c(d.charCodeAt(p)<<16-p%2*16);return o.create(v,l*2)}};function c(d){return d<<8&4278255360|d>>>8&16711935}}(),r.enc.Utf16})}($t)),$t.exports}var Wt={exports:{}},Ol=Wt.exports,Fr;function Ul(){return Fr||(Fr=1,function(e,n){(function(r,i){e.exports=i(Oe())})(Ol,function(r){return r.enc.Hex})}(Wt)),Wt.exports}var tt={},zr;function Nl(){if(zr)return tt;zr=1;var e=tt&&tt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(tt,"__esModule",{value:!0});const n=e(Qs());return tt.default=n.default.create("encrypt","decrypt"),tt}var qr;function Ll(){if(qr)return Se;qr=1;var e=Se&&Se.__createBinding||(Object.create?function(f,y,w,j){j===void 0&&(j=w);var E=Object.getOwnPropertyDescriptor(y,w);(!E||("get"in E?!y.__esModule:E.writable||E.configurable))&&(E={enumerable:!0,get:function(){return y[w]}}),Object.defineProperty(f,j,E)}:function(f,y,w,j){j===void 0&&(j=w),f[j]=y[w]}),n=Se&&Se.__setModuleDefault||(Object.create?function(f,y){Object.defineProperty(f,"default",{enumerable:!0,value:y})}:function(f,y){f.default=y}),r=Se&&Se.__importStar||function(f){if(f&&f.__esModule)return f;var y={};if(f!=null)for(var w in f)w!=="default"&&Object.prototype.hasOwnProperty.call(f,w)&&e(y,f,w);return n(y,f),y},i=Se&&Se.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(Se,"__esModule",{value:!0}),Se.AesCrypter=void 0;const a=r(kl()),o=i(Pl()),m=i(Il()),c=i(Bl()),d=i(Yo()),l=i(Ul()),v=i(Nl()),p={latin1:o.default,utf8:m.default,hex:l.default,utf16:c.default,base64:d.default};class C extends v.default{encrypt(y,w){const j=typeof y=="string"?y:JSON.stringify(y);return a.encrypt(j,w).toString()}decrypt(y,w,j="utf8"){return a.decrypt(y,w).toString(p[j])}}return Se.AesCrypter=C,Se.default=new C,Se}const Al=!0,Ml=">= 8",Fl=">= 0.5 && < 0.9.7",zl=!0,ql=!0,$l=">= 0.5",Wl=!0,Hl=!0,Gl=!0,Kl=">= 1 && < 8",Vl="< 8",Yl=!0,Zl=[">= 14.17 && < 15",">= 15.1"],Ql=!0,Jl=">= 0.7.12",Xl=!0,ec="< 6",tc=!0,nc=">= 0.11.1",rc=">= 0.11.1",oc=">= 0.11.1",sc=">= 0.11.1",ic=">= 0.11.1",ac=">= 0.11.1",lc=!0,cc=">= 8.8",dc=!0,uc=">= 8",pc="< 8",fc=!0,mc=!0,hc=!0,gc=!0,xc=">= 8.5",yc=">= 1",vc=">= 0.5",Cc=!0,bc=!0,jc=!0,wc=">= 0.11.5 && < 3",_c=">= 0.9.4",Sc=">= 0.9.4",Ec=">= 1.4.1",kc=">= 0.9.4",Rc=">= 0.9.4",Pc=">= 0.9.4",Tc=!0,Ic=!0,Dc=[">= 0.4 && < 0.7",">= 0.8"],Bc=!0,Oc=">= 0.11.13",Uc=">= 0.11.3 && < 10",Nc=">= 0.11.3",Lc=!0,Ac=">= 10",Mc=!0,Fc=!0,zc=!0,qc=">= 1",$c=!0,Wc=[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],Hc=">= 11.7",Gc=">= 0.5",Kc={assert:Al,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:Ml,"node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:Fl,buffer:zl,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:ql,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:$l,"node:cluster":[">= 14.18 && < 15",">= 16"],console:Wl,"node:console":[">= 14.18 && < 15",">= 16"],constants:Hl,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:Gl,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:Kl,_debugger:Vl,dgram:Yl,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:Zl,"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:Ql,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:Jl,"node:domain":[">= 14.18 && < 15",">= 16"],events:Xl,"node:events":[">= 14.18 && < 15",">= 16"],freelist:ec,fs:tc,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:nc,"node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:rc,"node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:oc,"node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:sc,"node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:ic,"node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:ac,"node:_http_server":[">= 14.18 && < 15",">= 16"],http:lc,"node:http":[">= 14.18 && < 15",">= 16"],http2:cc,"node:http2":[">= 14.18 && < 15",">= 16"],https:dc,"node:https":[">= 14.18 && < 15",">= 16"],inspector:uc,"node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:pc,module:fc,"node:module":[">= 14.18 && < 15",">= 16"],net:mc,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:hc,"node:os":[">= 14.18 && < 15",">= 16"],path:gc,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:xc,"node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:yc,"node:process":[">= 14.18 && < 15",">= 16"],punycode:vc,"node:punycode":[">= 14.18 && < 15",">= 16"],querystring:Cc,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:bc,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:jc,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:wc,_stream_duplex:_c,"node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:Sc,"node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:Ec,"node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:kc,"node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:Rc,"node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:Pc,"node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:Tc,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:Ic,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:Dc,"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:Bc,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:Oc,"node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:Uc,_tls_wrap:Nc,"node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:Lc,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:Ac,"node:trace_events":[">= 14.18 && < 15",">= 16"],tty:Mc,"node:tty":[">= 14.18 && < 15",">= 16"],url:Fc,"node:url":[">= 14.18 && < 15",">= 16"],util:zc,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:qc,"node:v8":[">= 14.18 && < 15",">= 16"],vm:$c,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:Wc,"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:Hc,"node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:Gc,"node:zlib":[">= 14.18 && < 15",">= 16"]};var xn,$r;function Vc(){if($r)return xn;$r=1;var e=Js();function n(o,m){for(var c=o.split("."),d=m.split(" "),l=d.length>1?d[0]:"=",v=(d.length>1?d[1]:d[0]).split("."),p=0;p<3;++p){var C=parseInt(c[p]||0,10),f=parseInt(v[p]||0,10);if(C!==f)return l==="<"?C<f:l===">="?C>=f:!1}return l===">="}function r(o,m){var c=m.split(/ ?&& ?/);if(c.length===0)return!1;for(var d=0;d<c.length;++d)if(!n(o,c[d]))return!1;return!0}function i(o,m){if(typeof m=="boolean")return m;var c=typeof o>"u"?pe.versions&&pe.versions.node:o;if(typeof c!="string")throw new TypeError(typeof o>"u"?"Unable to determine current node version":"If provided, a valid node version is required");if(m&&typeof m=="object"){for(var d=0;d<m.length;++d)if(r(c,m[d]))return!0;return!1}return r(c,m)}var a=Kc;return xn=function(m,c){return e(a,m)&&i(c,a[m])},xn}var yn,Wr;function Yc(){if(Wr)return yn;Wr=1;var e={},n=fo();return yn=n.homedir||function(){var i=e.HOME,a=e.LOGNAME||e.USER||e.LNAME||e.USERNAME;return pe.platform==="win32"?e.USERPROFILE||e.HOMEDRIVE+e.HOMEPATH||i||null:pe.platform==="darwin"?i||(a?"/Users/"+a:null):pe.platform==="linux"?i||(pe.getuid()===0?"/root":a?"/home/"+a:null):i||null},yn}var vn,Hr;function Zc(){return Hr||(Hr=1,vn=function(){var e=Error.prepareStackTrace;Error.prepareStackTrace=function(r,i){return i};var n=new Error().stack;return Error.prepareStackTrace=e,n[2].getFileName()}),vn}var nt={exports:{}},Gr;function Qc(){if(Gr)return nt.exports;Gr=1;var e=pe.platform==="win32",n=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,r={};function i(c){return n.exec(c).slice(1)}r.parse=function(c){if(typeof c!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof c);var d=i(c);if(!d||d.length!==5)throw new TypeError("Invalid path '"+c+"'");return{root:d[1],dir:d[0]===d[1]?d[0]:d[0].slice(0,-1),base:d[2],ext:d[4],name:d[3]}};var a=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,o={};function m(c){return a.exec(c).slice(1)}return o.parse=function(c){if(typeof c!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof c);var d=m(c);if(!d||d.length!==5)throw new TypeError("Invalid path '"+c+"'");return{root:d[1],dir:d[0].slice(0,-1),base:d[2],ext:d[4],name:d[3]}},e?nt.exports=r.parse:nt.exports=o.parse,nt.exports.posix=o.parse,nt.exports.win32=r.parse,nt.exports}var Cn,Kr;function Jc(){if(Kr)return Cn;Kr=1;var e=Xt(),n=e.parse||Qc(),r=function(a,o){var m="/";/^([A-Za-z]:)/.test(a)?m="":/^\\\\/.test(a)&&(m="\\\\");for(var c=[a],d=n(a);d.dir!==c[c.length-1];)c.push(d.dir),d=n(d.dir);return c.reduce(function(l,v){return l.concat(o.map(function(p){return e.resolve(m,v,p)}))},[])};return Cn=function(a,o,m){var c=o&&o.moduleDirectory?[].concat(o.moduleDirectory):["node_modules"];if(o&&typeof o.paths=="function")return o.paths(m,a,function(){return r(a,c)},o);var d=r(a,c);return o&&o.paths?d.concat(o.paths):d},Cn}var bn,Vr;function Xc(){return Vr||(Vr=1,bn=function(e,n){return n||{}}),bn}var jn,Yr;function ed(){if(Yr)return jn;Yr=1;var e=Vc(),n=en,r=Xt(),i=Yc(),a=Zc(),o=Jc(),m=Xc(),c=pe.platform!=="win32"&&n.realpathSync&&typeof n.realpathSync.native=="function"?n.realpathSync.native:n.realpathSync,d=i(),l=function(){return[r.join(d,".node_modules"),r.join(d,".node_libraries")]},v=function(E){try{var u=n.statSync(E,{throwIfNoEntry:!1})}catch(s){if(s&&(s.code==="ENOENT"||s.code==="ENOTDIR"))return!1;throw s}return!!u&&(u.isFile()||u.isFIFO())},p=function(E){try{var u=n.statSync(E,{throwIfNoEntry:!1})}catch(s){if(s&&(s.code==="ENOENT"||s.code==="ENOTDIR"))return!1;throw s}return!!u&&u.isDirectory()},C=function(E){try{return c(E)}catch(u){if(u.code!=="ENOENT")throw u}return E},f=function(E,u,s){return s&&s.preserveSymlinks===!1?E(u):u},y=function(E,u){var s=E(u);try{var h=JSON.parse(s);return h}catch{}},w=function(E,u,s){for(var h=o(u,s,E),b=0;b<h.length;b++)h[b]=r.join(h[b],E);return h};return jn=function(E,u){if(typeof E!="string")throw new TypeError("Path must be a string.");var s=m(E,u),h=s.isFile||v,b=s.readFileSync||n.readFileSync,P=s.isDirectory||p,k=s.realpathSync||C,M=s.readPackageSync||y;if(s.readFileSync&&s.readPackageSync)throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");var F=s.packageIterator,I=s.extensions||[".js"],B=s.includeCoreModules!==!1,D=s.basedir||r.dirname(a()),L=s.filename||D;s.paths=s.paths||l();var z=f(k,r.resolve(D),s);if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(E)){var $=r.resolve(z,E);(E==="."||E===".."||E.slice(-1)==="/")&&($+="/");var H=O($)||_($);if(H)return f(k,H,s)}else{if(B&&e(E))return E;var J=T(E,z);if(J)return f(k,J,s)}var se=new Error("Cannot find module '"+E+"' from '"+L+"'");throw se.code="MODULE_NOT_FOUND",se;function O(g){var S=te(r.dirname(g));if(S&&S.dir&&S.pkg&&s.pathFilter){var N=r.relative(S.dir,g),K=s.pathFilter(S.pkg,g,N);K&&(g=r.resolve(S.dir,K))}if(h(g))return g;for(var ee=0;ee<I.length;ee++){var V=g+I[ee];if(h(V))return V}}function te(g){if(!(g===""||g==="/")&&!(pe.platform==="win32"&&/^\w:[/\\]*$/.test(g))&&!/[/\\]node_modules[/\\]*$/.test(g)){var S=r.join(f(k,g,s),"package.json");if(!h(S))return te(r.dirname(g));var N=M(b,S);return N&&s.packageFilter&&(N=s.packageFilter(N,g)),{pkg:N,dir:g}}}function _(g){var S=r.join(f(k,g,s),"/package.json");if(h(S)){try{var N=M(b,S)}catch{}if(N&&s.packageFilter&&(N=s.packageFilter(N,g)),N&&N.main){if(typeof N.main!="string"){var K=new TypeError("package “"+N.name+"” `main` must be a string");throw K.code="INVALID_PACKAGE_MAIN",K}(N.main==="."||N.main==="./")&&(N.main="index");try{var ee=O(r.resolve(g,N.main));if(ee)return ee;var V=_(r.resolve(g,N.main));if(V)return V}catch{}}}return O(r.join(g,"/index"))}function T(g,S){for(var N=function(){return w(g,S,s)},K=F?F(g,S,N,s):N(),ee=0;ee<K.length;ee++){var V=K[ee];if(P(r.dirname(V))){var ie=O(V);if(ie)return ie;var re=_(V);if(re)return re}}}},jn}var wn,Zr;function td(){return Zr||(Zr=1,wn=ed()),wn}var _n,Qr;function nd(){if(Qr)return _n;Qr=1;var e={};_n=a,a.sync=o;var n=en;function r(m,c){var d=c.pathExt!==void 0?c.pathExt:e.PATHEXT;if(!d||(d=d.split(";"),d.indexOf("")!==-1))return!0;for(var l=0;l<d.length;l++){var v=d[l].toLowerCase();if(v&&m.substr(-v.length).toLowerCase()===v)return!0}return!1}function i(m,c,d){return!m.isSymbolicLink()&&!m.isFile()?!1:r(c,d)}function a(m,c,d){n.stat(m,function(l,v){d(l,l?!1:i(v,m,c))})}function o(m,c){return i(n.statSync(m),m,c)}return _n}var Sn,Jr;function rd(){if(Jr)return Sn;Jr=1,Sn=n,n.sync=r;var e=en;function n(o,m,c){e.stat(o,function(d,l){c(d,d?!1:i(l,m))})}function r(o,m){return i(e.statSync(o),m)}function i(o,m){return o.isFile()&&a(o,m)}function a(o,m){var c=o.mode,d=o.uid,l=o.gid,v=m.uid!==void 0?m.uid:pe.getuid&&pe.getuid(),p=m.gid!==void 0?m.gid:pe.getgid&&pe.getgid(),C=parseInt("100",8),f=parseInt("010",8),y=parseInt("001",8),w=C|f,j=c&y||c&f&&l===p||c&C&&d===v||c&w&&v===0;return j}return Sn}var En,Xr;function od(){if(Xr)return En;Xr=1;var e;pe.platform==="win32"||It.TESTING_WINDOWS?e=nd():e=rd(),En=n,n.sync=r;function n(i,a,o){if(typeof a=="function"&&(o=a,a={}),!o){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(m,c){n(i,a||{},function(d,l){d?c(d):m(l)})})}e(i,a||{},function(m,c){m&&(m.code==="EACCES"||a&&a.ignoreErrors)&&(m=null,c=!1),o(m,c)})}function r(i,a){try{return e.sync(i,a||{})}catch(o){if(a&&a.ignoreErrors||o.code==="EACCES")return!1;throw o}}return En}var kn,eo;function sd(){if(eo)return kn;eo=1;var e={};const n=pe.platform==="win32"||e.OSTYPE==="cygwin"||e.OSTYPE==="msys",r=Xt(),i=n?";":":",a=od(),o=l=>Object.assign(new Error(`not found: ${l}`),{code:"ENOENT"}),m=(l,v)=>{const p=v.colon||i,C=l.match(/\//)||n&&l.match(/\\/)?[""]:[...n?[pe.cwd()]:[],...(v.path||e.PATH||"").split(p)],f=n?v.pathExt||e.PATHEXT||".EXE;.CMD;.BAT;.COM":"",y=n?f.split(p):[""];return n&&l.indexOf(".")!==-1&&y[0]!==""&&y.unshift(""),{pathEnv:C,pathExt:y,pathExtExe:f}},c=(l,v,p)=>{typeof v=="function"&&(p=v,v={}),v||(v={});const{pathEnv:C,pathExt:f,pathExtExe:y}=m(l,v),w=[],j=u=>new Promise((s,h)=>{if(u===C.length)return v.all&&w.length?s(w):h(o(l));const b=C[u],P=/^".*"$/.test(b)?b.slice(1,-1):b,k=r.join(P,l),M=!P&&/^\.[\\\/]/.test(l)?l.slice(0,2)+k:k;s(E(M,u,0))}),E=(u,s,h)=>new Promise((b,P)=>{if(h===f.length)return b(j(s+1));const k=f[h];a(u+k,{pathExt:y},(M,F)=>{if(!M&&F)if(v.all)w.push(u+k);else return b(u+k);return b(E(u,s,h+1))})});return p?j(0).then(u=>p(null,u),p):j(0)},d=(l,v)=>{v=v||{};const{pathEnv:p,pathExt:C,pathExtExe:f}=m(l,v),y=[];for(let w=0;w<p.length;w++){const j=p[w],E=/^".*"$/.test(j)?j.slice(1,-1):j,u=r.join(E,l),s=!E&&/^\.[\\\/]/.test(l)?l.slice(0,2)+u:u;for(let h=0;h<C.length;h++){const b=s+C[h];try{if(a.sync(b,{pathExt:f}))if(v.all)y.push(b);else return b}catch{}}}if(v.all&&y.length)return y;if(v.nothrow)return null;throw o(l)};return kn=c,c.sync=d,kn}var Rn,to;function id(){if(to)return Rn;to=1;function e(n){if(!(typeof n>"u"))return JSON.parse(JSON.stringify(n))}return Rn=e,Rn}var Pn,no;function ad(){if(no)return Pn;no=1;var e={};const{BLOCKLET_MODES:n}=Xs(),r=po(),i=Ll().default,a=ei(),o=ri,{dirname:m,join:c,sep:d}=Xt(),l=td(),{tmpdir:v,homedir:p}=fo(),C=sd(),{withHttps:f}=ti(),{exec:y}=en,{promisify:w}=ni(),j=id(),E=(_,T,g)=>i.encrypt(_,r.pbkdf2Sync(g,T,256,32,"sha512").toString("hex")),u=(_,T,g)=>i.decrypt(_,r.pbkdf2Sync(g,T,256,32,"sha512").toString("hex")),s=(_,T=!0)=>{let g=_;return Array.isArray(g)&&g.every(S=>S.originFileObj&&S.url)&&(g=g.map(S=>S.url),g.length===1&&([g]=g)),T&&g&&typeof g=="object"&&(g=JSON.stringify(g)),g&&typeof g=="string"&&(g=g.replace(/(\r\n|\n|\r)/gm," ")),g},h=_=>_.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),b=_=>h(ar.from(_).toString("base64")),P=_=>(_+"===".slice((_.length+3)%4)).replace(/-/g,"+").replace(/_/g,"/"),k=_=>new Uint8Array(ar.from(P(_),"base64")),M="v21.6.0",F=()=>a.gte(pe.version,M),I=()=>{try{return l("@arcblock/pm2",{basedir:__dirname})}catch{return null}};function B(_){try{return C.sync(_)}catch{return null}}const D=new Map;async function L(){const _=w(y),T=pe.version;if(D.has(T))return D.get(T);try{const{stdout:g}=await _("node -h");let S;if(g.includes("--permission"))S="--permission";else if(g.includes("--experimental-permission"))S="--experimental-permission";else throw new Error(`Can not get permission options for this Node.js version: ${T}`);return D.set(T,S),S}catch(g){throw console.error(g),g}}const z=async(_,T=!0)=>{const g=e.NODE_OPTIONS??"";if(g.includes("--experimental-permission")||g.includes("--permission")||g.includes("--allow-fs-read")||g.includes("--allow-fs-write")||g.includes("--allow-addons")||g.includes("--allow-child-process")||g.includes("--allow-worker"))throw console.error("getSecurityNodeOptions",{nodeOptions:g}),new Error("process.env.NODE_OPTIONS should not include --experimental-permission or --permission or --allow-fs-read or --allow-fs-write or --allow-addons or --allow-child-process or --allow-worker");if(!_)throw new Error("blocklet is not defined");if(g.includes("ms-vscode.js-debug/src/bootloader.js")&&(_.mode===n.DEVELOPMENT||_.environmentObj.BLOCKLET_MODE===n.DEVELOPMENT))return g;const S=[g].filter(ne=>!!ne&&ne!=="undefined");if(!F()||!T)return S.join(" ").trim();const N=I(),K=B("meilisearch"),ee="/data/bin/meilisearch",V=B("blocklet"),ie=[e.XDG_DATA_HOME?c(e.XDG_DATA_HOME,"pnpm/global/"):"",e.PNPM_HOME?c(e.PNPM_HOME,"global/"):""],re=await L();return S.push(re,...[_.environmentObj.BLOCKLET_DATA_DIR,_.environmentObj.BLOCKLET_APP_DIR,_.environmentObj.BLOCKLET_LOG_DIR,_.environmentObj.BLOCKLET_CACHE_DIR,_.environmentObj.BLOCKLET_APP_DATA_DIR?c(_.environmentObj.BLOCKLET_APP_DATA_DIR,".projects"):"",v()].filter(Boolean).map(ne=>`--allow-fs-write=${c(ne,"/*")}`),"--allow-addons","--allow-child-process"),_.mode===n.DEVELOPMENT||_.environmentObj.BLOCKLET_MODE===n.DEVELOPMENT?(S.push("--allow-worker","--allow-fs-read=*"),S.push(`--allow-fs-write=${c(p(),".npm","_logs","/*")}`)):S.push(...[_.environmentObj.BLOCKLET_LOG_DIR,_.environmentObj.BLOCKLET_CACHE_DIR,_.environmentObj.BLOCKLET_APP_DATA_DIR,m(m(_.environmentObj.BLOCKLET_APP_DIR)),N&&m(m(m(m(N)))),V,K,ee,m(m(pe.execPath)),pe.cwd(),v(),c(p(),".cursor-server"),"/Applications/Cursor.app",...ie].filter(Boolean).filter(ne=>ne!==d).map(ne=>`--allow-fs-read=${c(ne,"/*")}`)),o(S).join(" ").trim()},$={crossOriginEmbedderPolicy:!1,crossOriginOpenerPolicy:!1,crossOriginResourcePolicy:!1,originAgentCluster:!1,strictTransportSecurity:!0,xContentTypeOptions:!0,xDnsPrefetchControl:!1,xDownloadOptions:!1,xPermittedCrossDomainPolicies:!1,contentSecurityPolicy:!1,referrerPolicy:!1,xFrameOptions:!1,xPoweredBy:!0,xXssProtection:!1};function H(_,T,g){const S=j(_[T]||[]);return S.push(...g),[...new Set(S)]}async function J(_,{node:T,blocklet:g,trustedDomains:S=[]}){if(!_?.contentSecurityPolicy?.directives)return _;const N=j(_);N.contentSecurityPolicy.directives["default-src"]=H(N.contentSecurityPolicy.directives,"default-src",["'self'"]);const K=await T.getNodeInfo({useCache:!0});let ee=await T.getBlockletDomainAliases({blocklet:g,nodeInfo:K});return ee=(ee||[]).map(V=>V.value),N.contentSecurityPolicy.directives["connect-src"]=H(N.contentSecurityPolicy.directives,"connect-src",["'self'",...ee.filter(V=>V).map(V=>`https://${V}/.well-known/ping`),"https://api.simplesvg.com","https://api.iconify.design","https://api.unisvg.com"]),N.contentSecurityPolicy.directives["script-src"]=H(N.contentSecurityPolicy.directives,"script-src",["'self'","https://js.stripe.com"]),N.contentSecurityPolicy.directives["frame-src"]=H(N.contentSecurityPolicy.directives,"frame-src",["'self'","https://js.stripe.com",...S.filter(Boolean).map(V=>`https://${V}`)]),N.contentSecurityPolicy.directives["frame-ancestors"]=H(N.contentSecurityPolicy.directives,"frame-ancestors",["'self'",...(g.settings.userSpaceHosts||[]).map(V=>`https://${V}`),...S.filter(Boolean).map(V=>`https://${V}`)]),N}async function se(_,{node:T,blocklet:g}){const S=j(_);if(S?.origin?.smart){const N=[];N.push(...S.origin?.value||[]);const K=await T.getNodeInfo({useCache:!0});let ee=await T.getBlockletDomainAliases({blocklet:g,nodeInfo:K});ee=(ee||[]).map(ne=>ne.value),N.push(...ee.map(ne=>f(ne)));const ie=((g.settings.federated||{})?.sites||[]).filter(ne=>ne?.isMaster!==!1||ne.status==="approved"),re=[];for(const ne of ie)re.push(new URL(ne.appUrl).hostname),re.push(...ne.aliasDomain||[]);N.push(...re.map(ne=>f(ne))),S.origin.value=[...new Set(N)]}return S}function O(_){const T=j(_);for(const g of Object.keys(T))T[g]=T[g]?.value??T[g];return T}function te(_){const T=j(_);for(const g of Object.keys(T))T[g]=T[g]?.override??!1;return T}return Pn={encrypt:E,decrypt:u,formatEnv:s,encodeEncryptionKey:b,decodeEncryptionKey:k,canUseFileSystemIsolateApi:F,getSecurityNodeOptions:z,patchResponseHeader:J,patchCors:se,cleanConfigOverride:O,keepConfigOverride:te,DEFAULT_HELMET_CONFIG:$,SAFE_NODE_VERSION:M},Pn}var Qo=ad();const Tn=(e,n)=>e&&Qo.encrypt(e,n||W.AIGNE_CONFIG_ENCRYPT_SALT,""),In=(e,n)=>e&&Qo.decrypt(e,n||W.AIGNE_CONFIG_ENCRYPT_SALT,""),pt=e=>e==="aigneHub",Ht=e=>e==="bedrock",ld=e=>{const n=["provider","model"];if(Wn(e))return[...n,"key"];const{provider:r}=e;let i=n;return pt(r)?i=[...n,"key","url"]:Ht(r)?i=[...n,"accessKeyId","secretAccessKey"]:i=[...n,"key"],i.filter(a=>!e[a])},ro=e=>{if(Wn(e)||e==="")return"0";const n=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(n))return"0";if(typeof Intl<"u"&&Intl.NumberFormat)return new Intl.NumberFormat("en-US",{minimumFractionDigits:0,maximumFractionDigits:2}).format(n);const r=n.toFixed(2).split("."),i=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),a=parseFloat(r[1])>0?`.${r[1]}`:"";return`${i}${a}`},cd=e=>[{provider:"aigneHub",name:"AIGNE Hub",baseURL:"https://hub.aigne.io",logo:e?.imgPrefix?Ee(e.imgPrefix,"/aigne-hub.jpg"):"/aigne-hub.jpg",documentation:"https://hub.aigne.io/docs",models:[]}];function dd(e){if(!e)return"Unknown error";if(e?.name==="ZodError")return Array.isArray(e.errors)?e.errors.map(n=>n.message).join(`
|
|
324
|
-
`):"Validation failed";if(Array.isArray(e?.details))return`Validate failed: ${e.details.map(r=>{const i=r.message.replace(/["]/g,"'");return`${r.path.join(".")}: ${i}`}).join(";")}`;if(Array.isArray(e?.errors))return e.errors.map(n=>n.msg||n.message).join(`
|
|
325
|
-
`);if(Array.isArray(e?.constraints))return Object.values(e.constraints).join(`
|
|
326
|
-
`);if(e?.keyword==="validation")return e.message||"Validation error";if(Array.isArray(e?.errors))return e.errors.map(n=>n.message).join(`
|
|
327
|
-
`);if(e instanceof TypeError&&e.message.includes("fetch"))return"Network error: Failed to fetch";if(e?.name==="FetchError")return e.message||"Fetch error occurred";if(e?.isAxiosError){if(e.response?.data){if(e.response.data.message)return e.response.data.message;if(e.response.data.error)return e.response.data.error;const n=typeof e.response.data=="string"?e.response.data.slice(0,200):JSON.stringify(e.response.data);return`Request failed: ${e.response.status} ${e.response.statusText}: ${n}`}return e.message||"Request failed"}if(e?.response){if(e.response.error)return e.response.error;if(e.response.data?.message)return e.response.data.message;if(e.response.data?.error)return e.response.data.error;const n=typeof e.response.data=="string"?e.response.data.slice(0,200):JSON.stringify(e.response.data);return`Request failed: ${e.response.status} ${e.response.statusText}: ${n}`}return e.message||String(e)}const Vt="z8ia3xzq2tMq8CRHfaXj1BTYJyYnEcHbqP8cJ",ud=async e=>{const n=new URL(e);if(typeof window<"u"&&n.origin===window.location.origin)return Jo();const r=Ee(n.origin,"__blocklet__.js?type=json"),i=await Gt.get(r).then(m=>m.data);if((i?.componentId||"").split("/").pop()===Vt)return Ee(n.origin,i.prefix||"/");const o=(i?.componentMountPoints||[]).find(m=>m?.did===Vt);return o?Ee(n.origin,o.mountPoint):e},Jo=()=>{var e,n,r,i;if(typeof window>"u")return"";const a=((e=window.blocklet)===null||e===void 0?void 0:e.prefix)||"/",o=(n=window.location)===null||n===void 0?void 0:n.origin;if((((r=window.blocklet)===null||r===void 0?void 0:r.componentId)||"").split("/").pop()===Vt)return Ee(o,a);const c=(((i=window.blocklet)===null||i===void 0?void 0:i.componentMountPoints)||[]).find(d=>d?.did===Vt);return c?Ee(o,c.mountPoint):Ee(o,a)};async function pd({baseUrl:e="",accessKey:n=""}){let r=Jo();const i=typeof window<"u";try{if(e){const a=new URL(e);(!i||i&&a.origin!==window.location.origin)&&(r=await ud(e))}}catch(a){throw console.warn("Failed to parse baseUrl:",a),new Error(`Failed to parse baseUrl: ${dd(a)}`)}if(!r||!n)throw new Error("baseUrl or accessKey is not set");return Gt.get(Ee(r,"/api/user/info"),{headers:{Authorization:`Bearer ${n}`}}).then(a=>a.data)}const nn=oe.div`
|
|
323
|
+
`;function Dt({src:e,alt:n,size:r=20}){return t.jsx("img",{src:e,alt:n,style:{width:r,height:r,display:"block",objectFit:"contain",borderRadius:"2px",flexShrink:0},onError:i=>{i.target.style.display="none"}})}Dt.propTypes={src:x.string.isRequired,alt:x.string.isRequired,size:x.number};const cl=48,dl=8,Rr={PaperProps:{style:{maxHeight:cl*4.5+dl,width:250}}},ul=(e,n,r)=>({fontWeight:n.indexOf(e)===-1?r.typography.fontWeightRegular:r.typography.fontWeightMedium});function Vo({label:e="",disabled:n=!1,required:r=!1,initialValue:i="",onChange:a=()=>{},sx:o={},onSubmit:f=()=>{},triggers:c=[],options:d=[],formatterBeforeSubmit:l=j=>j.join(","),helperText:v="",config:p={},directEditing:C=!1,searchable:m=!0,...y}){const j=gt(),[w,E]=R.useState(C),[u,s]=R.useState(!1),[h,b]=R.useState(""),{multiple:P=!1,labelField:k="name",valueField:M="code"}=p,[z,I]=R.useState(i),[B,D]=R.useState(z),[L,F]=R.useState(!1),[$,H]=R.useState(!1),X=R.useCallback(()=>{H(!0),setTimeout(()=>{H(!1)},500)},[]),se=async()=>{s(!0);try{await f(typeof l=="function"&&P?l(B):B)===!1?D(z):(D(B),I(B),F(!1))}catch{D(z)}finally{s(!1),E(!1)}},O=R.useCallback(()=>{C&&!n&&!u&&se(),L&&X(),!L&&!n&&!u&&(E(!1),F(!1))},[C,n,u,L,X]);R.useEffect(()=>{const g=i;g!==z&&(I(g),D(g),F(!1))},[i,z]);const te=d.filter(g=>{if(!h)return!0;const S=h.toLowerCase();return g[k]?.toLowerCase().includes(S)||g[M]?.toLowerCase().includes(S)}),_=g=>{let{value:S}=g.target;P&&(S=typeof S=="string"?S.split(","):S),F(S!==B),D(S),a(S)},T=w||C?t.jsxs(Ks,{value:B,onChange:_,fullWidth:!0,multiple:P,variant:"outlined",margin:"dense",onBlur:O,disabled:n,renderValue:g=>{if(P)return t.jsx(U,{sx:{display:"flex",flexWrap:"wrap"},children:g.filter(N=>d.some(K=>K[M]===N)).map(N=>t.jsx(ir,{label:d.find(K=>K[M]===N)[k],style:{marginRight:8},size:"small"},N))});if(!g)return null;const S=d.find(N=>N[M]===g);return t.jsxs(U,{sx:{display:"flex",alignItems:"center",gap:1},children:[S?.logo&&t.jsx(Dt,{src:S.logo,alt:S[k],size:20}),t.jsx("span",{children:S?S[k]:""})]})},MenuProps:{...Rr,PaperProps:{...Rr.PaperProps}},error:!!v,...y,children:[m?t.jsx(U,{sx:{p:1,borderBottom:1,borderColor:"divider"},children:t.jsx(ye,{size:"small",placeholder:"Search...",value:h,onChange:g=>b(g.target.value),onClick:g=>g.stopPropagation(),onKeyDown:g=>g.stopPropagation(),fullWidth:!0,variant:"outlined"})}):null,te.map(g=>t.jsx(Ne,{value:g[M],style:ul(g[M],B,j),children:t.jsxs(U,{sx:{display:"flex",alignItems:"center",gap:1},children:[g.logo&&t.jsx(Dt,{src:g.logo,alt:g[k],size:20}),t.jsx("span",{children:g[k]})]})},g[M]))]}):t.jsx(U,{"data-cy":"schema-form-item-edit",className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},sx:{px:1},onClick:()=>{n||E(!0)},children:P?B.filter(g=>d.some(S=>S[M]===g)).map(g=>t.jsx(ir,{label:d.find(S=>S[M]===g)[k],style:{marginRight:8},size:"small"},g)):B&&d.some(g=>g[M]===B)&&t.jsxs(U,{sx:{display:"flex",alignItems:"center",gap:1},children:[(()=>{const g=d.find(S=>S[M]===B);return g?.logo?t.jsx(Dt,{src:g.logo,alt:g[k],size:20}):null})(),t.jsx("span",{children:d.find(g=>g[M]===B)[k]})]})});return t.jsx(bo,{className:"form",sx:o,children:t.jsxs(U,{className:"form-item",children:[t.jsxs(U,{className:"form-item-label",children:[e,r&&t.jsx(ot,{})]}),t.jsxs(U,{className:"form-item-body",children:[t.jsx(U,{className:"form-item-input",children:T}),t.jsx(U,{className:"form-item-action",style:!w||C?{marginLeft:0}:{},children:w&&!C?t.jsxs(t.Fragment,{children:[L?t.jsx(me,{"data-cy":"schema-form-item-confirm",onClick:se,disabled:n||u,sx:{animation:$?`${ll} 0.5s linear`:"none"},size:"large",children:u?t.jsx(Ce,{size:24}):t.jsx(So,{})}):null,t.jsx(me,{"data-cy":"schema-form-item-cancel",onClick:()=>{D(z),E(!1)},disabled:n||u,size:"large",children:t.jsx(lo,{})})]}):t.jsx(U,{children:c.length?t.jsx(Li,{triggers:c,disabled:n}):null})})]}),w&&v&&t.jsx(Vs,{error:!0,children:v})]})})}Vo.propTypes={sx:x.object,onSubmit:x.func,onChange:x.func,label:x.string,initialValue:x.string,required:x.bool,disabled:x.bool,triggers:x.array,options:x.array,helperText:x.string,formatterBeforeSubmit:x.func,config:x.object,directEditing:x.bool,searchable:x.bool};const He={};function pl(e){He[e]&&(clearTimeout(He[e]),delete He[e])}async function fl(e,{interval:n=1e3,maxDuration:r=120*1e3,intervalFirst:i=4e3,timerKey:a=""}){He[a]&&clearTimeout(He[a]),await new Promise(c=>setTimeout(c,i));const o=Date.now(),f=async(c,d)=>{try{const l=await e();c(l)}catch(l){Date.now()-o>r?d(l):a?He[a]=setTimeout(()=>f(c,d),n):setTimeout(()=>f(c,d),n)}};return new Promise(f)}function ml(e,{did:n,refresh:r,t:i,providerName:a,values:o,timerKey:f}){return fl(async()=>{const{blocklet:c}=await e.getBlocklet({input:{did:n}}),d=Ys(c,"settings.aigne",{}),{url:l,key:v,provider:p}=d||{},{key:C}=o;if(p==="aigneHub"){if(!l||!v)throw new Error(i("setting.aigne.connectTimeOut",{provider:a}));if(C&&C===v)throw new Error(i("setting.aigne.connectTimeOut",{provider:a}));await r(),clearTimeout(He[`connect-aigne-${n}`])}else{if(!C||C!==v)throw new Error(i("setting.aigne.connectTimeOut",{provider:a}));await r(),clearTimeout(He[`connect-aigne-${n}`])}},{timerKey:f,maxDuration:3*60*1e3})}var Se={},Bt={exports:{}},Ot={exports:{}},hl=Ot.exports,Pr;function Oe(){return Pr||(Pr=1,function(e,n){(function(r,i){e.exports=i()})(hl,function(){var r=r||function(i,a){var o;if(typeof window<"u"&&window.crypto&&(o=window.crypto),typeof self<"u"&&self.crypto&&(o=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window<"u"&&window.msCrypto&&(o=window.msCrypto),!o&&typeof It<"u"&&It.crypto&&(o=It.crypto),!o&&typeof Zs=="function")try{o=po()}catch{}var f=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},c=Object.create||function(){function u(){}return function(s){var h;return u.prototype=s,h=new u,u.prototype=null,h}}(),d={},l=d.lib={},v=l.Base=function(){return{extend:function(u){var s=c(this);return u&&s.mixIn(u),(!s.hasOwnProperty("init")||this.init===s.init)&&(s.init=function(){s.$super.init.apply(this,arguments)}),s.init.prototype=s,s.$super=this,s},create:function(){var u=this.extend();return u.init.apply(u,arguments),u},init:function(){},mixIn:function(u){for(var s in u)u.hasOwnProperty(s)&&(this[s]=u[s]);u.hasOwnProperty("toString")&&(this.toString=u.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),p=l.WordArray=v.extend({init:function(u,s){u=this.words=u||[],s!=a?this.sigBytes=s:this.sigBytes=u.length*4},toString:function(u){return(u||m).stringify(this)},concat:function(u){var s=this.words,h=u.words,b=this.sigBytes,P=u.sigBytes;if(this.clamp(),b%4)for(var k=0;k<P;k++){var M=h[k>>>2]>>>24-k%4*8&255;s[b+k>>>2]|=M<<24-(b+k)%4*8}else for(var z=0;z<P;z+=4)s[b+z>>>2]=h[z>>>2];return this.sigBytes+=P,this},clamp:function(){var u=this.words,s=this.sigBytes;u[s>>>2]&=4294967295<<32-s%4*8,u.length=i.ceil(s/4)},clone:function(){var u=v.clone.call(this);return u.words=this.words.slice(0),u},random:function(u){for(var s=[],h=0;h<u;h+=4)s.push(f());return new p.init(s,u)}}),C=d.enc={},m=C.Hex={stringify:function(u){for(var s=u.words,h=u.sigBytes,b=[],P=0;P<h;P++){var k=s[P>>>2]>>>24-P%4*8&255;b.push((k>>>4).toString(16)),b.push((k&15).toString(16))}return b.join("")},parse:function(u){for(var s=u.length,h=[],b=0;b<s;b+=2)h[b>>>3]|=parseInt(u.substr(b,2),16)<<24-b%8*4;return new p.init(h,s/2)}},y=C.Latin1={stringify:function(u){for(var s=u.words,h=u.sigBytes,b=[],P=0;P<h;P++){var k=s[P>>>2]>>>24-P%4*8&255;b.push(String.fromCharCode(k))}return b.join("")},parse:function(u){for(var s=u.length,h=[],b=0;b<s;b++)h[b>>>2]|=(u.charCodeAt(b)&255)<<24-b%4*8;return new p.init(h,s)}},j=C.Utf8={stringify:function(u){try{return decodeURIComponent(escape(y.stringify(u)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(u){return y.parse(unescape(encodeURIComponent(u)))}},w=l.BufferedBlockAlgorithm=v.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(u){typeof u=="string"&&(u=j.parse(u)),this._data.concat(u),this._nDataBytes+=u.sigBytes},_process:function(u){var s,h=this._data,b=h.words,P=h.sigBytes,k=this.blockSize,M=k*4,z=P/M;u?z=i.ceil(z):z=i.max((z|0)-this._minBufferSize,0);var I=z*k,B=i.min(I*4,P);if(I){for(var D=0;D<I;D+=k)this._doProcessBlock(b,D);s=b.splice(0,I),h.sigBytes-=B}return new p.init(s,B)},clone:function(){var u=v.clone.call(this);return u._data=this._data.clone(),u},_minBufferSize:0});l.Hasher=w.extend({cfg:v.extend(),init:function(u){this.cfg=this.cfg.extend(u),this.reset()},reset:function(){w.reset.call(this),this._doReset()},update:function(u){return this._append(u),this._process(),this},finalize:function(u){u&&this._append(u);var s=this._doFinalize();return s},blockSize:16,_createHelper:function(u){return function(s,h){return new u.init(h).finalize(s)}},_createHmacHelper:function(u){return function(s,h){return new E.HMAC.init(u,h).finalize(s)}}});var E=d.algo={};return d}(Math);return r})}(Ot)),Ot.exports}var Ut={exports:{}},gl=Ut.exports,Tr;function Yo(){return Tr||(Tr=1,function(e,n){(function(r,i){e.exports=i(Oe())})(gl,function(r){return function(){var i=r,a=i.lib,o=a.WordArray,f=i.enc;f.Base64={stringify:function(d){var l=d.words,v=d.sigBytes,p=this._map;d.clamp();for(var C=[],m=0;m<v;m+=3)for(var y=l[m>>>2]>>>24-m%4*8&255,j=l[m+1>>>2]>>>24-(m+1)%4*8&255,w=l[m+2>>>2]>>>24-(m+2)%4*8&255,E=y<<16|j<<8|w,u=0;u<4&&m+u*.75<v;u++)C.push(p.charAt(E>>>6*(3-u)&63));var s=p.charAt(64);if(s)for(;C.length%4;)C.push(s);return C.join("")},parse:function(d){var l=d.length,v=this._map,p=this._reverseMap;if(!p){p=this._reverseMap=[];for(var C=0;C<v.length;C++)p[v.charCodeAt(C)]=C}var m=v.charAt(64);if(m){var y=d.indexOf(m);y!==-1&&(l=y)}return c(d,l,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function c(d,l,v){for(var p=[],C=0,m=0;m<l;m++)if(m%4){var y=v[d.charCodeAt(m-1)]<<m%4*2,j=v[d.charCodeAt(m)]>>>6-m%4*2,w=y|j;p[C>>>2]|=w<<24-C%4*8,C++}return o.create(p,C)}}(),r.enc.Base64})}(Ut)),Ut.exports}var Nt={exports:{}},xl=Nt.exports,Ir;function yl(){return Ir||(Ir=1,function(e,n){(function(r,i){e.exports=i(Oe())})(xl,function(r){return function(i){var a=r,o=a.lib,f=o.WordArray,c=o.Hasher,d=a.algo,l=[];(function(){for(var j=0;j<64;j++)l[j]=i.abs(i.sin(j+1))*4294967296|0})();var v=d.MD5=c.extend({_doReset:function(){this._hash=new f.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(j,w){for(var E=0;E<16;E++){var u=w+E,s=j[u];j[u]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360}var h=this._hash.words,b=j[w+0],P=j[w+1],k=j[w+2],M=j[w+3],z=j[w+4],I=j[w+5],B=j[w+6],D=j[w+7],L=j[w+8],F=j[w+9],$=j[w+10],H=j[w+11],X=j[w+12],se=j[w+13],O=j[w+14],te=j[w+15],_=h[0],T=h[1],g=h[2],S=h[3];_=p(_,T,g,S,b,7,l[0]),S=p(S,_,T,g,P,12,l[1]),g=p(g,S,_,T,k,17,l[2]),T=p(T,g,S,_,M,22,l[3]),_=p(_,T,g,S,z,7,l[4]),S=p(S,_,T,g,I,12,l[5]),g=p(g,S,_,T,B,17,l[6]),T=p(T,g,S,_,D,22,l[7]),_=p(_,T,g,S,L,7,l[8]),S=p(S,_,T,g,F,12,l[9]),g=p(g,S,_,T,$,17,l[10]),T=p(T,g,S,_,H,22,l[11]),_=p(_,T,g,S,X,7,l[12]),S=p(S,_,T,g,se,12,l[13]),g=p(g,S,_,T,O,17,l[14]),T=p(T,g,S,_,te,22,l[15]),_=C(_,T,g,S,P,5,l[16]),S=C(S,_,T,g,B,9,l[17]),g=C(g,S,_,T,H,14,l[18]),T=C(T,g,S,_,b,20,l[19]),_=C(_,T,g,S,I,5,l[20]),S=C(S,_,T,g,$,9,l[21]),g=C(g,S,_,T,te,14,l[22]),T=C(T,g,S,_,z,20,l[23]),_=C(_,T,g,S,F,5,l[24]),S=C(S,_,T,g,O,9,l[25]),g=C(g,S,_,T,M,14,l[26]),T=C(T,g,S,_,L,20,l[27]),_=C(_,T,g,S,se,5,l[28]),S=C(S,_,T,g,k,9,l[29]),g=C(g,S,_,T,D,14,l[30]),T=C(T,g,S,_,X,20,l[31]),_=m(_,T,g,S,I,4,l[32]),S=m(S,_,T,g,L,11,l[33]),g=m(g,S,_,T,H,16,l[34]),T=m(T,g,S,_,O,23,l[35]),_=m(_,T,g,S,P,4,l[36]),S=m(S,_,T,g,z,11,l[37]),g=m(g,S,_,T,D,16,l[38]),T=m(T,g,S,_,$,23,l[39]),_=m(_,T,g,S,se,4,l[40]),S=m(S,_,T,g,b,11,l[41]),g=m(g,S,_,T,M,16,l[42]),T=m(T,g,S,_,B,23,l[43]),_=m(_,T,g,S,F,4,l[44]),S=m(S,_,T,g,X,11,l[45]),g=m(g,S,_,T,te,16,l[46]),T=m(T,g,S,_,k,23,l[47]),_=y(_,T,g,S,b,6,l[48]),S=y(S,_,T,g,D,10,l[49]),g=y(g,S,_,T,O,15,l[50]),T=y(T,g,S,_,I,21,l[51]),_=y(_,T,g,S,X,6,l[52]),S=y(S,_,T,g,M,10,l[53]),g=y(g,S,_,T,$,15,l[54]),T=y(T,g,S,_,P,21,l[55]),_=y(_,T,g,S,L,6,l[56]),S=y(S,_,T,g,te,10,l[57]),g=y(g,S,_,T,B,15,l[58]),T=y(T,g,S,_,se,21,l[59]),_=y(_,T,g,S,z,6,l[60]),S=y(S,_,T,g,H,10,l[61]),g=y(g,S,_,T,k,15,l[62]),T=y(T,g,S,_,F,21,l[63]),h[0]=h[0]+_|0,h[1]=h[1]+T|0,h[2]=h[2]+g|0,h[3]=h[3]+S|0},_doFinalize:function(){var j=this._data,w=j.words,E=this._nDataBytes*8,u=j.sigBytes*8;w[u>>>5]|=128<<24-u%32;var s=i.floor(E/4294967296),h=E;w[(u+64>>>9<<4)+15]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,w[(u+64>>>9<<4)+14]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360,j.sigBytes=(w.length+1)*4,this._process();for(var b=this._hash,P=b.words,k=0;k<4;k++){var M=P[k];P[k]=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360}return b},clone:function(){var j=c.clone.call(this);return j._hash=this._hash.clone(),j}});function p(j,w,E,u,s,h,b){var P=j+(w&E|~w&u)+s+b;return(P<<h|P>>>32-h)+w}function C(j,w,E,u,s,h,b){var P=j+(w&u|E&~u)+s+b;return(P<<h|P>>>32-h)+w}function m(j,w,E,u,s,h,b){var P=j+(w^E^u)+s+b;return(P<<h|P>>>32-h)+w}function y(j,w,E,u,s,h,b){var P=j+(E^(w|~u))+s+b;return(P<<h|P>>>32-h)+w}a.MD5=c._createHelper(v),a.HmacMD5=c._createHmacHelper(v)}(Math),r.MD5})}(Nt)),Nt.exports}var Lt={exports:{}},At={exports:{}},vl=At.exports,Dr;function Cl(){return Dr||(Dr=1,function(e,n){(function(r,i){e.exports=i(Oe())})(vl,function(r){return function(){var i=r,a=i.lib,o=a.WordArray,f=a.Hasher,c=i.algo,d=[],l=c.SHA1=f.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(v,p){for(var C=this._hash.words,m=C[0],y=C[1],j=C[2],w=C[3],E=C[4],u=0;u<80;u++){if(u<16)d[u]=v[p+u]|0;else{var s=d[u-3]^d[u-8]^d[u-14]^d[u-16];d[u]=s<<1|s>>>31}var h=(m<<5|m>>>27)+E+d[u];u<20?h+=(y&j|~y&w)+1518500249:u<40?h+=(y^j^w)+1859775393:u<60?h+=(y&j|y&w|j&w)-1894007588:h+=(y^j^w)-899497514,E=w,w=j,j=y<<30|y>>>2,y=m,m=h}C[0]=C[0]+m|0,C[1]=C[1]+y|0,C[2]=C[2]+j|0,C[3]=C[3]+w|0,C[4]=C[4]+E|0},_doFinalize:function(){var v=this._data,p=v.words,C=this._nDataBytes*8,m=v.sigBytes*8;return p[m>>>5]|=128<<24-m%32,p[(m+64>>>9<<4)+14]=Math.floor(C/4294967296),p[(m+64>>>9<<4)+15]=C,v.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var v=f.clone.call(this);return v._hash=this._hash.clone(),v}});i.SHA1=f._createHelper(l),i.HmacSHA1=f._createHmacHelper(l)}(),r.SHA1})}(At)),At.exports}var Mt={exports:{}},bl=Mt.exports,Br;function jl(){return Br||(Br=1,function(e,n){(function(r,i){e.exports=i(Oe())})(bl,function(r){(function(){var i=r,a=i.lib,o=a.Base,f=i.enc,c=f.Utf8,d=i.algo;d.HMAC=o.extend({init:function(l,v){l=this._hasher=new l.init,typeof v=="string"&&(v=c.parse(v));var p=l.blockSize,C=p*4;v.sigBytes>C&&(v=l.finalize(v)),v.clamp();for(var m=this._oKey=v.clone(),y=this._iKey=v.clone(),j=m.words,w=y.words,E=0;E<p;E++)j[E]^=1549556828,w[E]^=909522486;m.sigBytes=y.sigBytes=C,this.reset()},reset:function(){var l=this._hasher;l.reset(),l.update(this._iKey)},update:function(l){return this._hasher.update(l),this},finalize:function(l){var v=this._hasher,p=v.finalize(l);v.reset();var C=v.finalize(this._oKey.clone().concat(p));return C}})})()})}(Mt)),Mt.exports}var wl=Lt.exports,Or;function Zo(){return Or||(Or=1,function(e,n){(function(r,i,a){e.exports=i(Oe(),Cl(),jl())})(wl,function(r){return function(){var i=r,a=i.lib,o=a.Base,f=a.WordArray,c=i.algo,d=c.MD5,l=c.EvpKDF=o.extend({cfg:o.extend({keySize:128/32,hasher:d,iterations:1}),init:function(v){this.cfg=this.cfg.extend(v)},compute:function(v,p){for(var C,m=this.cfg,y=m.hasher.create(),j=f.create(),w=j.words,E=m.keySize,u=m.iterations;w.length<E;){C&&y.update(C),C=y.update(v).finalize(p),y.reset();for(var s=1;s<u;s++)C=y.finalize(C),y.reset();j.concat(C)}return j.sigBytes=E*4,j}});i.EvpKDF=function(v,p,C){return l.create(C).compute(v,p)}}(),r.EvpKDF})}(Lt)),Lt.exports}var zt={exports:{}},_l=zt.exports,Ur;function Sl(){return Ur||(Ur=1,function(e,n){(function(r,i,a){e.exports=i(Oe(),Zo())})(_l,function(r){r.lib.Cipher||function(i){var a=r,o=a.lib,f=o.Base,c=o.WordArray,d=o.BufferedBlockAlgorithm,l=a.enc;l.Utf8;var v=l.Base64,p=a.algo,C=p.EvpKDF,m=o.Cipher=d.extend({cfg:f.extend(),createEncryptor:function(I,B){return this.create(this._ENC_XFORM_MODE,I,B)},createDecryptor:function(I,B){return this.create(this._DEC_XFORM_MODE,I,B)},init:function(I,B,D){this.cfg=this.cfg.extend(D),this._xformMode=I,this._key=B,this.reset()},reset:function(){d.reset.call(this),this._doReset()},process:function(I){return this._append(I),this._process()},finalize:function(I){I&&this._append(I);var B=this._doFinalize();return B},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function I(B){return typeof B=="string"?z:P}return function(B){return{encrypt:function(D,L,F){return I(L).encrypt(B,D,L,F)},decrypt:function(D,L,F){return I(L).decrypt(B,D,L,F)}}}}()});o.StreamCipher=m.extend({_doFinalize:function(){var I=this._process(!0);return I},blockSize:1});var y=a.mode={},j=o.BlockCipherMode=f.extend({createEncryptor:function(I,B){return this.Encryptor.create(I,B)},createDecryptor:function(I,B){return this.Decryptor.create(I,B)},init:function(I,B){this._cipher=I,this._iv=B}}),w=y.CBC=function(){var I=j.extend();I.Encryptor=I.extend({processBlock:function(D,L){var F=this._cipher,$=F.blockSize;B.call(this,D,L,$),F.encryptBlock(D,L),this._prevBlock=D.slice(L,L+$)}}),I.Decryptor=I.extend({processBlock:function(D,L){var F=this._cipher,$=F.blockSize,H=D.slice(L,L+$);F.decryptBlock(D,L),B.call(this,D,L,$),this._prevBlock=H}});function B(D,L,F){var $,H=this._iv;H?($=H,this._iv=i):$=this._prevBlock;for(var X=0;X<F;X++)D[L+X]^=$[X]}return I}(),E=a.pad={},u=E.Pkcs7={pad:function(I,B){for(var D=B*4,L=D-I.sigBytes%D,F=L<<24|L<<16|L<<8|L,$=[],H=0;H<L;H+=4)$.push(F);var X=c.create($,L);I.concat(X)},unpad:function(I){var B=I.words[I.sigBytes-1>>>2]&255;I.sigBytes-=B}};o.BlockCipher=m.extend({cfg:m.cfg.extend({mode:w,padding:u}),reset:function(){var I;m.reset.call(this);var B=this.cfg,D=B.iv,L=B.mode;this._xformMode==this._ENC_XFORM_MODE?I=L.createEncryptor:(I=L.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==I?this._mode.init(this,D&&D.words):(this._mode=I.call(L,this,D&&D.words),this._mode.__creator=I)},_doProcessBlock:function(I,B){this._mode.processBlock(I,B)},_doFinalize:function(){var I,B=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(B.pad(this._data,this.blockSize),I=this._process(!0)):(I=this._process(!0),B.unpad(I)),I},blockSize:128/32});var s=o.CipherParams=f.extend({init:function(I){this.mixIn(I)},toString:function(I){return(I||this.formatter).stringify(this)}}),h=a.format={},b=h.OpenSSL={stringify:function(I){var B,D=I.ciphertext,L=I.salt;return L?B=c.create([1398893684,1701076831]).concat(L).concat(D):B=D,B.toString(v)},parse:function(I){var B,D=v.parse(I),L=D.words;return L[0]==1398893684&&L[1]==1701076831&&(B=c.create(L.slice(2,4)),L.splice(0,4),D.sigBytes-=16),s.create({ciphertext:D,salt:B})}},P=o.SerializableCipher=f.extend({cfg:f.extend({format:b}),encrypt:function(I,B,D,L){L=this.cfg.extend(L);var F=I.createEncryptor(D,L),$=F.finalize(B),H=F.cfg;return s.create({ciphertext:$,key:D,iv:H.iv,algorithm:I,mode:H.mode,padding:H.padding,blockSize:I.blockSize,formatter:L.format})},decrypt:function(I,B,D,L){L=this.cfg.extend(L),B=this._parse(B,L.format);var F=I.createDecryptor(D,L).finalize(B.ciphertext);return F},_parse:function(I,B){return typeof I=="string"?B.parse(I,this):I}}),k=a.kdf={},M=k.OpenSSL={execute:function(I,B,D,L,F){if(L||(L=c.random(64/8)),F)var $=C.create({keySize:B+D,hasher:F}).compute(I,L);else var $=C.create({keySize:B+D}).compute(I,L);var H=c.create($.words.slice(B),D*4);return $.sigBytes=B*4,s.create({key:$,iv:H,salt:L})}},z=o.PasswordBasedCipher=P.extend({cfg:P.cfg.extend({kdf:M}),encrypt:function(I,B,D,L){L=this.cfg.extend(L);var F=L.kdf.execute(D,I.keySize,I.ivSize,L.salt,L.hasher);L.iv=F.iv;var $=P.encrypt.call(this,I,B,F.key,L);return $.mixIn(F),$},decrypt:function(I,B,D,L){L=this.cfg.extend(L),B=this._parse(B,L.format);var F=L.kdf.execute(D,I.keySize,I.ivSize,B.salt,L.hasher);L.iv=F.iv;var $=P.decrypt.call(this,I,B,F.key,L);return $}})}()})}(zt)),zt.exports}var El=Bt.exports,Nr;function kl(){return Nr||(Nr=1,function(e,n){(function(r,i,a){e.exports=i(Oe(),Yo(),yl(),Zo(),Sl())})(El,function(r){return function(){var i=r,a=i.lib,o=a.BlockCipher,f=i.algo,c=[],d=[],l=[],v=[],p=[],C=[],m=[],y=[],j=[],w=[];(function(){for(var s=[],h=0;h<256;h++)h<128?s[h]=h<<1:s[h]=h<<1^283;for(var b=0,P=0,h=0;h<256;h++){var k=P^P<<1^P<<2^P<<3^P<<4;k=k>>>8^k&255^99,c[b]=k,d[k]=b;var M=s[b],z=s[M],I=s[z],B=s[k]*257^k*16843008;l[b]=B<<24|B>>>8,v[b]=B<<16|B>>>16,p[b]=B<<8|B>>>24,C[b]=B;var B=I*16843009^z*65537^M*257^b*16843008;m[k]=B<<24|B>>>8,y[k]=B<<16|B>>>16,j[k]=B<<8|B>>>24,w[k]=B,b?(b=M^s[s[s[I^M]]],P^=s[s[P]]):b=P=1}})();var E=[0,1,2,4,8,16,32,64,128,27,54],u=f.AES=o.extend({_doReset:function(){var s;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var h=this._keyPriorReset=this._key,b=h.words,P=h.sigBytes/4,k=this._nRounds=P+6,M=(k+1)*4,z=this._keySchedule=[],I=0;I<M;I++)I<P?z[I]=b[I]:(s=z[I-1],I%P?P>6&&I%P==4&&(s=c[s>>>24]<<24|c[s>>>16&255]<<16|c[s>>>8&255]<<8|c[s&255]):(s=s<<8|s>>>24,s=c[s>>>24]<<24|c[s>>>16&255]<<16|c[s>>>8&255]<<8|c[s&255],s^=E[I/P|0]<<24),z[I]=z[I-P]^s);for(var B=this._invKeySchedule=[],D=0;D<M;D++){var I=M-D;if(D%4)var s=z[I];else var s=z[I-4];D<4||I<=4?B[D]=s:B[D]=m[c[s>>>24]]^y[c[s>>>16&255]]^j[c[s>>>8&255]]^w[c[s&255]]}}},encryptBlock:function(s,h){this._doCryptBlock(s,h,this._keySchedule,l,v,p,C,c)},decryptBlock:function(s,h){var b=s[h+1];s[h+1]=s[h+3],s[h+3]=b,this._doCryptBlock(s,h,this._invKeySchedule,m,y,j,w,d);var b=s[h+1];s[h+1]=s[h+3],s[h+3]=b},_doCryptBlock:function(s,h,b,P,k,M,z,I){for(var B=this._nRounds,D=s[h]^b[0],L=s[h+1]^b[1],F=s[h+2]^b[2],$=s[h+3]^b[3],H=4,X=1;X<B;X++){var se=P[D>>>24]^k[L>>>16&255]^M[F>>>8&255]^z[$&255]^b[H++],O=P[L>>>24]^k[F>>>16&255]^M[$>>>8&255]^z[D&255]^b[H++],te=P[F>>>24]^k[$>>>16&255]^M[D>>>8&255]^z[L&255]^b[H++],_=P[$>>>24]^k[D>>>16&255]^M[L>>>8&255]^z[F&255]^b[H++];D=se,L=O,F=te,$=_}var se=(I[D>>>24]<<24|I[L>>>16&255]<<16|I[F>>>8&255]<<8|I[$&255])^b[H++],O=(I[L>>>24]<<24|I[F>>>16&255]<<16|I[$>>>8&255]<<8|I[D&255])^b[H++],te=(I[F>>>24]<<24|I[$>>>16&255]<<16|I[D>>>8&255]<<8|I[L&255])^b[H++],_=(I[$>>>24]<<24|I[D>>>16&255]<<16|I[L>>>8&255]<<8|I[F&255])^b[H++];s[h]=se,s[h+1]=O,s[h+2]=te,s[h+3]=_},keySize:256/32});i.AES=o._createHelper(u)}(),r.AES})}(Bt)),Bt.exports}var Ft={exports:{}},Rl=Ft.exports,Lr;function Pl(){return Lr||(Lr=1,function(e,n){(function(r,i){e.exports=i(Oe())})(Rl,function(r){return r.enc.Latin1})}(Ft)),Ft.exports}var qt={exports:{}},Tl=qt.exports,Ar;function Il(){return Ar||(Ar=1,function(e,n){(function(r,i){e.exports=i(Oe())})(Tl,function(r){return r.enc.Utf8})}(qt)),qt.exports}var $t={exports:{}},Dl=$t.exports,Mr;function Bl(){return Mr||(Mr=1,function(e,n){(function(r,i){e.exports=i(Oe())})(Dl,function(r){return function(){var i=r,a=i.lib,o=a.WordArray,f=i.enc;f.Utf16=f.Utf16BE={stringify:function(d){for(var l=d.words,v=d.sigBytes,p=[],C=0;C<v;C+=2){var m=l[C>>>2]>>>16-C%4*8&65535;p.push(String.fromCharCode(m))}return p.join("")},parse:function(d){for(var l=d.length,v=[],p=0;p<l;p++)v[p>>>1]|=d.charCodeAt(p)<<16-p%2*16;return o.create(v,l*2)}},f.Utf16LE={stringify:function(d){for(var l=d.words,v=d.sigBytes,p=[],C=0;C<v;C+=2){var m=c(l[C>>>2]>>>16-C%4*8&65535);p.push(String.fromCharCode(m))}return p.join("")},parse:function(d){for(var l=d.length,v=[],p=0;p<l;p++)v[p>>>1]|=c(d.charCodeAt(p)<<16-p%2*16);return o.create(v,l*2)}};function c(d){return d<<8&4278255360|d>>>8&16711935}}(),r.enc.Utf16})}($t)),$t.exports}var Wt={exports:{}},Ol=Wt.exports,zr;function Ul(){return zr||(zr=1,function(e,n){(function(r,i){e.exports=i(Oe())})(Ol,function(r){return r.enc.Hex})}(Wt)),Wt.exports}var tt={},Fr;function Nl(){if(Fr)return tt;Fr=1;var e=tt&&tt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(tt,"__esModule",{value:!0});const n=e(Qs());return tt.default=n.default.create("encrypt","decrypt"),tt}var qr;function Ll(){if(qr)return Se;qr=1;var e=Se&&Se.__createBinding||(Object.create?function(m,y,j,w){w===void 0&&(w=j);var E=Object.getOwnPropertyDescriptor(y,j);(!E||("get"in E?!y.__esModule:E.writable||E.configurable))&&(E={enumerable:!0,get:function(){return y[j]}}),Object.defineProperty(m,w,E)}:function(m,y,j,w){w===void 0&&(w=j),m[w]=y[j]}),n=Se&&Se.__setModuleDefault||(Object.create?function(m,y){Object.defineProperty(m,"default",{enumerable:!0,value:y})}:function(m,y){m.default=y}),r=Se&&Se.__importStar||function(m){if(m&&m.__esModule)return m;var y={};if(m!=null)for(var j in m)j!=="default"&&Object.prototype.hasOwnProperty.call(m,j)&&e(y,m,j);return n(y,m),y},i=Se&&Se.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(Se,"__esModule",{value:!0}),Se.AesCrypter=void 0;const a=r(kl()),o=i(Pl()),f=i(Il()),c=i(Bl()),d=i(Yo()),l=i(Ul()),v=i(Nl()),p={latin1:o.default,utf8:f.default,hex:l.default,utf16:c.default,base64:d.default};class C extends v.default{encrypt(y,j){const w=typeof y=="string"?y:JSON.stringify(y);return a.encrypt(w,j).toString()}decrypt(y,j,w="utf8"){return a.decrypt(y,j).toString(p[w])}}return Se.AesCrypter=C,Se.default=new C,Se}const Al=!0,Ml=">= 8",zl=">= 0.5 && < 0.9.7",Fl=!0,ql=!0,$l=">= 0.5",Wl=!0,Hl=!0,Gl=!0,Kl=">= 1 && < 8",Vl="< 8",Yl=!0,Zl=[">= 14.17 && < 15",">= 15.1"],Ql=!0,Xl=">= 0.7.12",Jl=!0,ec="< 6",tc=!0,nc=">= 0.11.1",rc=">= 0.11.1",oc=">= 0.11.1",sc=">= 0.11.1",ic=">= 0.11.1",ac=">= 0.11.1",lc=!0,cc=">= 8.8",dc=!0,uc=">= 8",pc="< 8",fc=!0,mc=!0,hc=!0,gc=!0,xc=">= 8.5",yc=">= 1",vc=">= 0.5",Cc=!0,bc=!0,jc=!0,wc=">= 0.11.5 && < 3",_c=">= 0.9.4",Sc=">= 0.9.4",Ec=">= 1.4.1",kc=">= 0.9.4",Rc=">= 0.9.4",Pc=">= 0.9.4",Tc=!0,Ic=!0,Dc=[">= 0.4 && < 0.7",">= 0.8"],Bc=!0,Oc=">= 0.11.13",Uc=">= 0.11.3 && < 10",Nc=">= 0.11.3",Lc=!0,Ac=">= 10",Mc=!0,zc=!0,Fc=!0,qc=">= 1",$c=!0,Wc=[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],Hc=">= 11.7",Gc=">= 0.5",Kc={assert:Al,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:Ml,"node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:zl,buffer:Fl,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:ql,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:$l,"node:cluster":[">= 14.18 && < 15",">= 16"],console:Wl,"node:console":[">= 14.18 && < 15",">= 16"],constants:Hl,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:Gl,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:Kl,_debugger:Vl,dgram:Yl,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:Zl,"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:Ql,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:Xl,"node:domain":[">= 14.18 && < 15",">= 16"],events:Jl,"node:events":[">= 14.18 && < 15",">= 16"],freelist:ec,fs:tc,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:nc,"node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:rc,"node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:oc,"node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:sc,"node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:ic,"node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:ac,"node:_http_server":[">= 14.18 && < 15",">= 16"],http:lc,"node:http":[">= 14.18 && < 15",">= 16"],http2:cc,"node:http2":[">= 14.18 && < 15",">= 16"],https:dc,"node:https":[">= 14.18 && < 15",">= 16"],inspector:uc,"node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:pc,module:fc,"node:module":[">= 14.18 && < 15",">= 16"],net:mc,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:hc,"node:os":[">= 14.18 && < 15",">= 16"],path:gc,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:xc,"node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:yc,"node:process":[">= 14.18 && < 15",">= 16"],punycode:vc,"node:punycode":[">= 14.18 && < 15",">= 16"],querystring:Cc,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:bc,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:jc,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:wc,_stream_duplex:_c,"node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:Sc,"node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:Ec,"node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:kc,"node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:Rc,"node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:Pc,"node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:Tc,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:Ic,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:Dc,"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:Bc,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:Oc,"node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:Uc,_tls_wrap:Nc,"node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:Lc,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:Ac,"node:trace_events":[">= 14.18 && < 15",">= 16"],tty:Mc,"node:tty":[">= 14.18 && < 15",">= 16"],url:zc,"node:url":[">= 14.18 && < 15",">= 16"],util:Fc,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:qc,"node:v8":[">= 14.18 && < 15",">= 16"],vm:$c,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:Wc,"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:Hc,"node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:Gc,"node:zlib":[">= 14.18 && < 15",">= 16"]};var xn,$r;function Vc(){if($r)return xn;$r=1;var e=Xs();function n(o,f){for(var c=o.split("."),d=f.split(" "),l=d.length>1?d[0]:"=",v=(d.length>1?d[1]:d[0]).split("."),p=0;p<3;++p){var C=parseInt(c[p]||0,10),m=parseInt(v[p]||0,10);if(C!==m)return l==="<"?C<m:l===">="?C>=m:!1}return l===">="}function r(o,f){var c=f.split(/ ?&& ?/);if(c.length===0)return!1;for(var d=0;d<c.length;++d)if(!n(o,c[d]))return!1;return!0}function i(o,f){if(typeof f=="boolean")return f;var c=typeof o>"u"?pe.versions&&pe.versions.node:o;if(typeof c!="string")throw new TypeError(typeof o>"u"?"Unable to determine current node version":"If provided, a valid node version is required");if(f&&typeof f=="object"){for(var d=0;d<f.length;++d)if(r(c,f[d]))return!0;return!1}return r(c,f)}var a=Kc;return xn=function(f,c){return e(a,f)&&i(c,a[f])},xn}var yn,Wr;function Yc(){if(Wr)return yn;Wr=1;var e={},n=fo();return yn=n.homedir||function(){var i=e.HOME,a=e.LOGNAME||e.USER||e.LNAME||e.USERNAME;return pe.platform==="win32"?e.USERPROFILE||e.HOMEDRIVE+e.HOMEPATH||i||null:pe.platform==="darwin"?i||(a?"/Users/"+a:null):pe.platform==="linux"?i||(pe.getuid()===0?"/root":a?"/home/"+a:null):i||null},yn}var vn,Hr;function Zc(){return Hr||(Hr=1,vn=function(){var e=Error.prepareStackTrace;Error.prepareStackTrace=function(r,i){return i};var n=new Error().stack;return Error.prepareStackTrace=e,n[2].getFileName()}),vn}var nt={exports:{}},Gr;function Qc(){if(Gr)return nt.exports;Gr=1;var e=pe.platform==="win32",n=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,r={};function i(c){return n.exec(c).slice(1)}r.parse=function(c){if(typeof c!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof c);var d=i(c);if(!d||d.length!==5)throw new TypeError("Invalid path '"+c+"'");return{root:d[1],dir:d[0]===d[1]?d[0]:d[0].slice(0,-1),base:d[2],ext:d[4],name:d[3]}};var a=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,o={};function f(c){return a.exec(c).slice(1)}return o.parse=function(c){if(typeof c!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof c);var d=f(c);if(!d||d.length!==5)throw new TypeError("Invalid path '"+c+"'");return{root:d[1],dir:d[0].slice(0,-1),base:d[2],ext:d[4],name:d[3]}},e?nt.exports=r.parse:nt.exports=o.parse,nt.exports.posix=o.parse,nt.exports.win32=r.parse,nt.exports}var Cn,Kr;function Xc(){if(Kr)return Cn;Kr=1;var e=Jt(),n=e.parse||Qc(),r=function(a,o){var f="/";/^([A-Za-z]:)/.test(a)?f="":/^\\\\/.test(a)&&(f="\\\\");for(var c=[a],d=n(a);d.dir!==c[c.length-1];)c.push(d.dir),d=n(d.dir);return c.reduce(function(l,v){return l.concat(o.map(function(p){return e.resolve(f,v,p)}))},[])};return Cn=function(a,o,f){var c=o&&o.moduleDirectory?[].concat(o.moduleDirectory):["node_modules"];if(o&&typeof o.paths=="function")return o.paths(f,a,function(){return r(a,c)},o);var d=r(a,c);return o&&o.paths?d.concat(o.paths):d},Cn}var bn,Vr;function Jc(){return Vr||(Vr=1,bn=function(e,n){return n||{}}),bn}var jn,Yr;function ed(){if(Yr)return jn;Yr=1;var e=Vc(),n=en,r=Jt(),i=Yc(),a=Zc(),o=Xc(),f=Jc(),c=pe.platform!=="win32"&&n.realpathSync&&typeof n.realpathSync.native=="function"?n.realpathSync.native:n.realpathSync,d=i(),l=function(){return[r.join(d,".node_modules"),r.join(d,".node_libraries")]},v=function(E){try{var u=n.statSync(E,{throwIfNoEntry:!1})}catch(s){if(s&&(s.code==="ENOENT"||s.code==="ENOTDIR"))return!1;throw s}return!!u&&(u.isFile()||u.isFIFO())},p=function(E){try{var u=n.statSync(E,{throwIfNoEntry:!1})}catch(s){if(s&&(s.code==="ENOENT"||s.code==="ENOTDIR"))return!1;throw s}return!!u&&u.isDirectory()},C=function(E){try{return c(E)}catch(u){if(u.code!=="ENOENT")throw u}return E},m=function(E,u,s){return s&&s.preserveSymlinks===!1?E(u):u},y=function(E,u){var s=E(u);try{var h=JSON.parse(s);return h}catch{}},j=function(E,u,s){for(var h=o(u,s,E),b=0;b<h.length;b++)h[b]=r.join(h[b],E);return h};return jn=function(E,u){if(typeof E!="string")throw new TypeError("Path must be a string.");var s=f(E,u),h=s.isFile||v,b=s.readFileSync||n.readFileSync,P=s.isDirectory||p,k=s.realpathSync||C,M=s.readPackageSync||y;if(s.readFileSync&&s.readPackageSync)throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");var z=s.packageIterator,I=s.extensions||[".js"],B=s.includeCoreModules!==!1,D=s.basedir||r.dirname(a()),L=s.filename||D;s.paths=s.paths||l();var F=m(k,r.resolve(D),s);if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(E)){var $=r.resolve(F,E);(E==="."||E===".."||E.slice(-1)==="/")&&($+="/");var H=O($)||_($);if(H)return m(k,H,s)}else{if(B&&e(E))return E;var X=T(E,F);if(X)return m(k,X,s)}var se=new Error("Cannot find module '"+E+"' from '"+L+"'");throw se.code="MODULE_NOT_FOUND",se;function O(g){var S=te(r.dirname(g));if(S&&S.dir&&S.pkg&&s.pathFilter){var N=r.relative(S.dir,g),K=s.pathFilter(S.pkg,g,N);K&&(g=r.resolve(S.dir,K))}if(h(g))return g;for(var ee=0;ee<I.length;ee++){var V=g+I[ee];if(h(V))return V}}function te(g){if(!(g===""||g==="/")&&!(pe.platform==="win32"&&/^\w:[/\\]*$/.test(g))&&!/[/\\]node_modules[/\\]*$/.test(g)){var S=r.join(m(k,g,s),"package.json");if(!h(S))return te(r.dirname(g));var N=M(b,S);return N&&s.packageFilter&&(N=s.packageFilter(N,g)),{pkg:N,dir:g}}}function _(g){var S=r.join(m(k,g,s),"/package.json");if(h(S)){try{var N=M(b,S)}catch{}if(N&&s.packageFilter&&(N=s.packageFilter(N,g)),N&&N.main){if(typeof N.main!="string"){var K=new TypeError("package “"+N.name+"” `main` must be a string");throw K.code="INVALID_PACKAGE_MAIN",K}(N.main==="."||N.main==="./")&&(N.main="index");try{var ee=O(r.resolve(g,N.main));if(ee)return ee;var V=_(r.resolve(g,N.main));if(V)return V}catch{}}}return O(r.join(g,"/index"))}function T(g,S){for(var N=function(){return j(g,S,s)},K=z?z(g,S,N,s):N(),ee=0;ee<K.length;ee++){var V=K[ee];if(P(r.dirname(V))){var ie=O(V);if(ie)return ie;var re=_(V);if(re)return re}}}},jn}var wn,Zr;function td(){return Zr||(Zr=1,wn=ed()),wn}var _n,Qr;function nd(){if(Qr)return _n;Qr=1;var e={};_n=a,a.sync=o;var n=en;function r(f,c){var d=c.pathExt!==void 0?c.pathExt:e.PATHEXT;if(!d||(d=d.split(";"),d.indexOf("")!==-1))return!0;for(var l=0;l<d.length;l++){var v=d[l].toLowerCase();if(v&&f.substr(-v.length).toLowerCase()===v)return!0}return!1}function i(f,c,d){return!f.isSymbolicLink()&&!f.isFile()?!1:r(c,d)}function a(f,c,d){n.stat(f,function(l,v){d(l,l?!1:i(v,f,c))})}function o(f,c){return i(n.statSync(f),f,c)}return _n}var Sn,Xr;function rd(){if(Xr)return Sn;Xr=1,Sn=n,n.sync=r;var e=en;function n(o,f,c){e.stat(o,function(d,l){c(d,d?!1:i(l,f))})}function r(o,f){return i(e.statSync(o),f)}function i(o,f){return o.isFile()&&a(o,f)}function a(o,f){var c=o.mode,d=o.uid,l=o.gid,v=f.uid!==void 0?f.uid:pe.getuid&&pe.getuid(),p=f.gid!==void 0?f.gid:pe.getgid&&pe.getgid(),C=parseInt("100",8),m=parseInt("010",8),y=parseInt("001",8),j=C|m,w=c&y||c&m&&l===p||c&C&&d===v||c&j&&v===0;return w}return Sn}var En,Jr;function od(){if(Jr)return En;Jr=1;var e;pe.platform==="win32"||It.TESTING_WINDOWS?e=nd():e=rd(),En=n,n.sync=r;function n(i,a,o){if(typeof a=="function"&&(o=a,a={}),!o){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(f,c){n(i,a||{},function(d,l){d?c(d):f(l)})})}e(i,a||{},function(f,c){f&&(f.code==="EACCES"||a&&a.ignoreErrors)&&(f=null,c=!1),o(f,c)})}function r(i,a){try{return e.sync(i,a||{})}catch(o){if(a&&a.ignoreErrors||o.code==="EACCES")return!1;throw o}}return En}var kn,eo;function sd(){if(eo)return kn;eo=1;var e={};const n=pe.platform==="win32"||e.OSTYPE==="cygwin"||e.OSTYPE==="msys",r=Jt(),i=n?";":":",a=od(),o=l=>Object.assign(new Error(`not found: ${l}`),{code:"ENOENT"}),f=(l,v)=>{const p=v.colon||i,C=l.match(/\//)||n&&l.match(/\\/)?[""]:[...n?[pe.cwd()]:[],...(v.path||e.PATH||"").split(p)],m=n?v.pathExt||e.PATHEXT||".EXE;.CMD;.BAT;.COM":"",y=n?m.split(p):[""];return n&&l.indexOf(".")!==-1&&y[0]!==""&&y.unshift(""),{pathEnv:C,pathExt:y,pathExtExe:m}},c=(l,v,p)=>{typeof v=="function"&&(p=v,v={}),v||(v={});const{pathEnv:C,pathExt:m,pathExtExe:y}=f(l,v),j=[],w=u=>new Promise((s,h)=>{if(u===C.length)return v.all&&j.length?s(j):h(o(l));const b=C[u],P=/^".*"$/.test(b)?b.slice(1,-1):b,k=r.join(P,l),M=!P&&/^\.[\\\/]/.test(l)?l.slice(0,2)+k:k;s(E(M,u,0))}),E=(u,s,h)=>new Promise((b,P)=>{if(h===m.length)return b(w(s+1));const k=m[h];a(u+k,{pathExt:y},(M,z)=>{if(!M&&z)if(v.all)j.push(u+k);else return b(u+k);return b(E(u,s,h+1))})});return p?w(0).then(u=>p(null,u),p):w(0)},d=(l,v)=>{v=v||{};const{pathEnv:p,pathExt:C,pathExtExe:m}=f(l,v),y=[];for(let j=0;j<p.length;j++){const w=p[j],E=/^".*"$/.test(w)?w.slice(1,-1):w,u=r.join(E,l),s=!E&&/^\.[\\\/]/.test(l)?l.slice(0,2)+u:u;for(let h=0;h<C.length;h++){const b=s+C[h];try{if(a.sync(b,{pathExt:m}))if(v.all)y.push(b);else return b}catch{}}}if(v.all&&y.length)return y;if(v.nothrow)return null;throw o(l)};return kn=c,c.sync=d,kn}var Rn,to;function id(){if(to)return Rn;to=1;function e(n){if(!(typeof n>"u"))return JSON.parse(JSON.stringify(n))}return Rn=e,Rn}var Pn,no;function ad(){if(no)return Pn;no=1;var e={};const{BLOCKLET_MODES:n}=Js(),r=po(),i=Ll().default,a=ei(),o=ri,{dirname:f,join:c,sep:d}=Jt(),l=td(),{tmpdir:v,homedir:p}=fo(),C=sd(),{withHttps:m}=ti(),{exec:y}=en,{promisify:j}=ni(),w=id(),E=(_,T,g)=>i.encrypt(_,r.pbkdf2Sync(g,T,256,32,"sha512").toString("hex")),u=(_,T,g)=>i.decrypt(_,r.pbkdf2Sync(g,T,256,32,"sha512").toString("hex")),s=(_,T=!0)=>{let g=_;return Array.isArray(g)&&g.every(S=>S.originFileObj&&S.url)&&(g=g.map(S=>S.url),g.length===1&&([g]=g)),T&&g&&typeof g=="object"&&(g=JSON.stringify(g)),g&&typeof g=="string"&&(g=g.replace(/(\r\n|\n|\r)/gm," ")),g},h=_=>_.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),b=_=>h(ar.from(_).toString("base64")),P=_=>(_+"===".slice((_.length+3)%4)).replace(/-/g,"+").replace(/_/g,"/"),k=_=>new Uint8Array(ar.from(P(_),"base64")),M="v21.6.0",z=()=>a.gte(pe.version,M),I=()=>{try{return l("@arcblock/pm2",{basedir:__dirname})}catch{return null}};function B(_){try{return C.sync(_)}catch{return null}}const D=new Map;async function L(){const _=j(y),T=pe.version;if(D.has(T))return D.get(T);try{const{stdout:g}=await _("node -h");let S;if(g.includes("--permission"))S="--permission";else if(g.includes("--experimental-permission"))S="--experimental-permission";else throw new Error(`Can not get permission options for this Node.js version: ${T}`);return D.set(T,S),S}catch(g){throw console.error(g),g}}const F=async(_,T=!0)=>{const g=e.NODE_OPTIONS??"";if(g.includes("--experimental-permission")||g.includes("--permission")||g.includes("--allow-fs-read")||g.includes("--allow-fs-write")||g.includes("--allow-addons")||g.includes("--allow-child-process")||g.includes("--allow-worker"))throw console.error("getSecurityNodeOptions",{nodeOptions:g}),new Error("process.env.NODE_OPTIONS should not include --experimental-permission or --permission or --allow-fs-read or --allow-fs-write or --allow-addons or --allow-child-process or --allow-worker");if(!_)throw new Error("blocklet is not defined");if(g.includes("ms-vscode.js-debug/src/bootloader.js")&&(_.mode===n.DEVELOPMENT||_.environmentObj.BLOCKLET_MODE===n.DEVELOPMENT))return g;const S=[g].filter(ne=>!!ne&&ne!=="undefined");if(!z()||!T)return S.join(" ").trim();const N=I(),K=B("meilisearch"),ee="/data/bin/meilisearch",V=B("blocklet"),ie=[e.XDG_DATA_HOME?c(e.XDG_DATA_HOME,"pnpm/global/"):"",e.PNPM_HOME?c(e.PNPM_HOME,"global/"):""],re=await L();return S.push(re,...[_.environmentObj.BLOCKLET_DATA_DIR,_.environmentObj.BLOCKLET_APP_DIR,_.environmentObj.BLOCKLET_LOG_DIR,_.environmentObj.BLOCKLET_CACHE_DIR,_.environmentObj.BLOCKLET_APP_DATA_DIR?c(_.environmentObj.BLOCKLET_APP_DATA_DIR,".projects"):"",v()].filter(Boolean).map(ne=>`--allow-fs-write=${c(ne,"/*")}`),"--allow-addons","--allow-child-process"),_.mode===n.DEVELOPMENT||_.environmentObj.BLOCKLET_MODE===n.DEVELOPMENT?(S.push("--allow-worker","--allow-fs-read=*"),S.push(`--allow-fs-write=${c(p(),".npm","_logs","/*")}`)):S.push(...[_.environmentObj.BLOCKLET_LOG_DIR,_.environmentObj.BLOCKLET_CACHE_DIR,_.environmentObj.BLOCKLET_APP_DATA_DIR,f(f(_.environmentObj.BLOCKLET_APP_DIR)),N&&f(f(f(f(N)))),V,K,ee,f(f(pe.execPath)),pe.cwd(),v(),c(p(),".cursor-server"),"/Applications/Cursor.app",...ie].filter(Boolean).filter(ne=>ne!==d).map(ne=>`--allow-fs-read=${c(ne,"/*")}`)),o(S).join(" ").trim()},$={crossOriginEmbedderPolicy:!1,crossOriginOpenerPolicy:!1,crossOriginResourcePolicy:!1,originAgentCluster:!1,strictTransportSecurity:!0,xContentTypeOptions:!0,xDnsPrefetchControl:!1,xDownloadOptions:!1,xPermittedCrossDomainPolicies:!1,contentSecurityPolicy:!1,referrerPolicy:!1,xFrameOptions:!1,xPoweredBy:!0,xXssProtection:!1};function H(_,T,g){const S=w(_[T]||[]);return S.push(...g),[...new Set(S)]}async function X(_,{node:T,blocklet:g,trustedDomains:S=[]}){if(!_?.contentSecurityPolicy?.directives)return _;const N=w(_);N.contentSecurityPolicy.directives["default-src"]=H(N.contentSecurityPolicy.directives,"default-src",["'self'"]);const K=await T.getNodeInfo({useCache:!0});let ee=await T.getBlockletDomainAliases({blocklet:g,nodeInfo:K});return ee=(ee||[]).map(V=>V.value),N.contentSecurityPolicy.directives["connect-src"]=H(N.contentSecurityPolicy.directives,"connect-src",["'self'",...ee.filter(V=>V).map(V=>`https://${V}/.well-known/ping`),"https://api.simplesvg.com","https://api.iconify.design","https://api.unisvg.com"]),N.contentSecurityPolicy.directives["script-src"]=H(N.contentSecurityPolicy.directives,"script-src",["'self'","https://js.stripe.com"]),N.contentSecurityPolicy.directives["frame-src"]=H(N.contentSecurityPolicy.directives,"frame-src",["'self'","https://js.stripe.com",...S.filter(Boolean).map(V=>`https://${V}`)]),N.contentSecurityPolicy.directives["frame-ancestors"]=H(N.contentSecurityPolicy.directives,"frame-ancestors",["'self'",...(g.settings.userSpaceHosts||[]).map(V=>`https://${V}`),...S.filter(Boolean).map(V=>`https://${V}`)]),N}async function se(_,{node:T,blocklet:g}){const S=w(_);if(S?.origin?.smart){const N=[];N.push(...S.origin?.value||[]);const K=await T.getNodeInfo({useCache:!0});let ee=await T.getBlockletDomainAliases({blocklet:g,nodeInfo:K});ee=(ee||[]).map(ne=>ne.value),N.push(...ee.map(ne=>m(ne)));const ie=((g.settings.federated||{})?.sites||[]).filter(ne=>ne?.isMaster!==!1||ne.status==="approved"),re=[];for(const ne of ie)re.push(new URL(ne.appUrl).hostname),re.push(...ne.aliasDomain||[]);N.push(...re.map(ne=>m(ne))),S.origin.value=[...new Set(N)]}return S}function O(_){const T=w(_);for(const g of Object.keys(T))T[g]=T[g]?.value??T[g];return T}function te(_){const T=w(_);for(const g of Object.keys(T))T[g]=T[g]?.override??!1;return T}return Pn={encrypt:E,decrypt:u,formatEnv:s,encodeEncryptionKey:b,decodeEncryptionKey:k,canUseFileSystemIsolateApi:z,getSecurityNodeOptions:F,patchResponseHeader:X,patchCors:se,cleanConfigOverride:O,keepConfigOverride:te,DEFAULT_HELMET_CONFIG:$,SAFE_NODE_VERSION:M},Pn}var Qo=ad();const Tn=(e,n)=>e&&Qo.encrypt(e,n||W.AIGNE_CONFIG_ENCRYPT_SALT,""),In=(e,n)=>e&&Qo.decrypt(e,n||W.AIGNE_CONFIG_ENCRYPT_SALT,""),pt=e=>e==="aigneHub",Ht=e=>e==="bedrock",ld=e=>{const n=["provider","model"];if(Wn(e))return[...n,"key"];const{provider:r}=e;let i=n;return pt(r)?i=[...n,"key","url"]:Ht(r)?i=[...n,"accessKeyId","secretAccessKey"]:i=[...n,"key"],i.filter(a=>!e[a])},ro=e=>{if(Wn(e)||e==="")return"0";const n=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(n))return"0";if(typeof Intl<"u"&&Intl.NumberFormat)return new Intl.NumberFormat("en-US",{minimumFractionDigits:0,maximumFractionDigits:2}).format(n);const r=n.toFixed(2).split("."),i=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),a=parseFloat(r[1])>0?`.${r[1]}`:"";return`${i}${a}`},cd=e=>[{provider:"aigneHub",name:"AIGNE Hub",baseURL:"https://hub.aigne.io",logo:e?.imgPrefix?Ee(e.imgPrefix,"/aigne-hub.jpg"):"/aigne-hub.jpg",documentation:"https://hub.aigne.io/docs",models:[]}],Vt="z8ia3xzq2tMq8CRHfaXj1BTYJyYnEcHbqP8cJ",dd=async e=>{const n=new URL(e);if(typeof window<"u"&&n.origin===window.location.origin)return Xo();const r=Ee(n.origin,"__blocklet__.js?type=json"),i=await Gt.get(r).then(f=>f.data);if((i?.componentId||"").split("/").pop()===Vt)return Ee(n.origin,i.prefix||"/");const o=(i?.componentMountPoints||[]).find(f=>f?.did===Vt);return o?Ee(n.origin,o.mountPoint):e},Xo=()=>{var e,n,r,i;if(typeof window>"u")return"";const a=((e=window.blocklet)===null||e===void 0?void 0:e.prefix)||"/",o=(n=window.location)===null||n===void 0?void 0:n.origin;if((((r=window.blocklet)===null||r===void 0?void 0:r.componentId)||"").split("/").pop()===Vt)return Ee(o,a);const c=(((i=window.blocklet)===null||i===void 0?void 0:i.componentMountPoints)||[]).find(d=>d?.did===Vt);return c?Ee(o,c.mountPoint):Ee(o,a)};async function ud({baseUrl:e="",accessKey:n=""}){let r=Xo();const i=typeof window<"u";try{if(e){const a=new URL(e);(!i||i&&a.origin!==window.location.origin)&&(r=await dd(e))}}catch(a){throw console.warn("Failed to parse baseUrl:",a),new Error(`Failed to parse baseUrl: ${ge(a)}`)}if(!r||!n)throw new Error("baseUrl or accessKey is not set");return Gt.get(Ee(r,"/api/user/info"),{headers:{Authorization:`Bearer ${n}`}}).then(a=>a.data)}const nn=oe.div`
|
|
328
324
|
min-height: ${({minHeight:e})=>e==="none"?"auto":`${e||160}px`};
|
|
329
325
|
height: ${({height:e,minHeight:n})=>e==="none"?"auto":`${e||n||160}px`};
|
|
330
326
|
padding: ${({theme:e})=>e.spacing(2)};
|
|
@@ -333,7 +329,7 @@ import{aF as ze,j as t,ds as ws,gH as _s,iD as Ss,V as ce,bn as ge,K as U,ay as
|
|
|
333
329
|
border-color: ${({theme:e})=>e.palette.divider};
|
|
334
330
|
background-color: ${({theme:e})=>e.palette.background.paper};
|
|
335
331
|
box-shadow: ${({theme:e})=>e.shadows[1]};
|
|
336
|
-
`,
|
|
332
|
+
`,pd={loading:x.bool,authLoading:x.bool,disconnectLoading:x.bool,connecting:x.bool},Mn=oe(Zt)`
|
|
337
333
|
color: ${({theme:e})=>e.palette.text.primary};
|
|
338
334
|
font-weight: 500;
|
|
339
335
|
border-color: ${({theme:e})=>e.palette.grey[300]};
|
|
@@ -341,14 +337,14 @@ import{aF as ze,j as t,ds as ws,gH as _s,iD as Ss,V as ce,bn as ge,K as U,ay as
|
|
|
341
337
|
&:hover {
|
|
342
338
|
background-color: ${({theme:e})=>oi(e.palette.primary.main,.1)};
|
|
343
339
|
}
|
|
344
|
-
`;function
|
|
340
|
+
`;function Jo({loading:e=!1,user:n=null,switchUser:r=mt,connecting:i=!1,url:a=""}){const{t:o}=R.useContext(je);return!n&&!e?null:t.jsx(nn,{children:e?t.jsxs(U,{sx:{display:"flex",justifyContent:"center",alignItems:"flex-start",gap:2,height:"100%"},children:[t.jsx(Me,{variant:"circular",width:48,height:48}),t.jsxs(U,{sx:{display:"flex",flexDirection:"column",gap:1,width:"100%"},children:[t.jsx(Me,{variant:"rounded",sx:{width:"80%",height:20}}),t.jsx(Me,{variant:"rounded",sx:{width:"40%",height:20}}),t.jsx(Me,{variant:"rounded",sx:{width:"30%",height:20}}),t.jsx(Me,{variant:"rounded",sx:{width:"60%",height:20}})]})]}):t.jsxs(U,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",height:"100%"},children:[t.jsx(si,{size:"large",showDid:!0,showHoverCard:!0,user:n,avatarProps:{size:48},infoType:lr.Minimal,popupInfoType:lr.Basic,sx:{border:"none",p:0},onAvatarClick:()=>{a&&window.open(mo(Ee(a,W.WELLKNOWN_BLOCKLET_USER_PATH),{did:n.did}),"_blank")}}),t.jsx(U,{children:t.jsx(Mn,{variant:"outlined",disabled:i,startIcon:i?t.jsx(Ce,{size:16,sx:{mr:1}}):t.jsx(fe,{style:{fontSize:16},icon:"tabler:switch-horizontal"}),onClick:r,children:o("setting.aigne.switchUser")})})]})})}Jo.propTypes={loading:x.bool,user:x.object,switchUser:x.func,url:x.string,...pd};function es({loading:e=!1,credit:n=null,connecting:r=!1,onRefresh:i=()=>{},refreshing:a=!1}){const{t:o}=R.useContext(je),f=$n`
|
|
345
341
|
from {
|
|
346
342
|
transform: rotate(0deg);
|
|
347
343
|
}
|
|
348
344
|
to {
|
|
349
345
|
transform: rotate(360deg);
|
|
350
346
|
}
|
|
351
|
-
`,c=R.useMemo(()=>!n?.enableCredit,[n]),d=R.useMemo(()=>Number(n?.creditBalance?.balance)<=0&&Number(n?.creditBalance?.pendingCredit)>0,[n]);if(!n&&!e)return null;const{creditBalance:l,profileLink:v="",paymentLink:p=""}=n||{};return t.jsx(nn,{children:e?t.jsxs(U,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",gap:2,height:"100%"},children:[t.jsxs(U,{sx:{width:"100%",display:"flex",flexDirection:"column",gap:1},children:[t.jsx(Me,{variant:"rounded",sx:{width:"80%",height:20}}),t.jsx(Me,{variant:"rounded",sx:{width:"50%",height:20}})]}),t.jsxs(U,{sx:{width:"100%",display:"flex",justifyContent:"space-between",gap:1},children:[t.jsx(Me,{variant:"rounded",sx:{width:"100%",height:20}}),t.jsx(Me,{variant:"rounded",sx:{width:"100%",height:20}})]})]}):t.jsxs(U,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",height:"100%",width:"100%"},children:[t.jsxs(U,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[t.jsx(le,{variant:"body1",children:"AIGNE Hub Credits"}),t.jsxs(le,{variant:"h2",sx:{color:!c&&d?"error.main":"text.primary"},children:[t.jsx("span",{children:c?o("setting.aigne.infinite"):d?`- ${ro(l?.pendingCredit)}`:ro(l.balance)}),c?null:t.jsx(be,{title:o("common.refresh"),children:t.jsx(Ta,{sx:{fontSize:14,ml:1,cursor:"pointer",animation:a?`${m} 1s linear infinite`:"none"},onClick:i})})]})]}),c?null:t.jsxs(U,{sx:{width:"100%",display:"flex",gap:1},children:[t.jsx(Mn,{fullWidth:!0,variant:"outlined",disabled:r,onClick:()=>{p&&window.open(p,"_blank")},startIcon:t.jsx(fe,{style:{fontSize:16},icon:"tabler:credit-card"}),children:o("setting.aigne.addCredits")}),t.jsx(Mn,{fullWidth:!0,disabled:r,onClick:()=>{v&&window.open(mo(v,{appDid:window.blocklet.appPid}),"_blank")},variant:"outlined",startIcon:t.jsx(fe,{style:{fontSize:16},icon:"hugeicons:transaction"}),children:o("setting.aigne.transaction")})]})]})})}es.propTypes={loading:x.bool,credit:x.object,connecting:x.bool,onRefresh:x.func,refreshing:x.bool};function ts({url:e,apiKey:n,switchUser:r=mt,connecting:i=!1}){const{t:a}=R.useContext(je),[o,m]=R.useState(!1),{data:c,loading:d,error:l,refresh:v}=ii(()=>pd({baseUrl:e,accessKey:n}),{ready:!!(e&&n),refreshDeps:[e,n],onSuccess:()=>{m(!1)},onError:()=>{m(!1)}}),p=R.useCallback(()=>{d||o||(m(!0),v())},[v,d,o]);return l?null:t.jsxs(U,{children:[t.jsx(le,{variant:"h5",sx:{fontSize:18,mb:2},children:a("setting.aigne.account")}),t.jsxs(Fe,{container:!0,className:"config-container",spacing:2,sx:{width:"100%"},children:[t.jsx(Fe,{size:{xs:12,md:6},children:t.jsx(Xo,{loading:d&&!o,user:c?.user,switchUser:r,connecting:i,url:e})}),t.jsx(Fe,{size:{xs:12,md:6},children:t.jsx(es,{refreshing:o,loading:d&&!o,credit:c,connecting:i,onRefresh:p})})]})]})}ts.propTypes={url:x.string.isRequired,apiKey:x.string.isRequired,connecting:x.bool,switchUser:x.func};function ns({url:e,providerName:n,disconnect:r=mt,disabled:i=!1,loading:a=!1,validationResult:o=""}){const{t:m}=R.useContext(je),c=R.useMemo(()=>o&&o!=="success",[o]);return t.jsx(nn,{minHeight:80,height:"none",children:t.jsxs(U,{sx:{width:"100%",height:"100%",display:"flex",justifyContent:"flex-start",alignItems:"center",gap:2},children:[c?t.jsx(be,{title:o,children:t.jsx(Po,{sx:{fontSize:24,color:"error.main",cursor:"pointer",flexShrink:0}})}):t.jsx(Do,{sx:{fontSize:24,color:"success.main",cursor:"pointer",flexShrink:0}}),t.jsxs(U,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flex:1,flexWrap:"wrap"},children:[t.jsxs(U,{children:[t.jsx(le,{variant:"h5",sx:{fontSize:18},children:c?m("setting.aigne.testFailed"):m("setting.aigne.connected",{provider:n})}),t.jsxs(le,{variant:"body1",sx:{color:"text.secondary",fontSize:14},children:[m("setting.aigne.baseUrl",{provider:n}),": ",e]})]}),t.jsx(Zt,{variant:"outlined",color:"error",startIcon:a?t.jsx(Ce,{size:16,sx:{mr:1}}):t.jsx(Yi,{}),onClick:r,disabled:i||a,sx:{lineHeight:1.5},children:m("setting.aigne.disconnect")})]})]})})}ns.propTypes={url:x.string.isRequired,providerName:x.string.isRequired,disabled:x.bool,disconnect:x.func,loading:x.bool,validationResult:x.string};function rt({desc:e,docLink:n=null,provider:r="",orientation:i="vertical"}){const{t:a}=R.useContext(je);return t.jsxs(le,{variant:"body2",sx:{lineHeight:1.6,color:"text.secondary",fontSize:12,...i==="vertical"&&{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},title:e,children:[e,n&&t.jsx(be,{title:t.jsxs(t.Fragment,{children:[a("setting.aigne.desc.docLink"),n&&t.jsxs(t.Fragment,{children:[":"," ",t.jsx(xt,{href:n,target:"_blank",rel:"noopener noreferrer",sx:{ml:.5},children:r||"documentation"})]})]}),arrow:!0,children:t.jsx(ja,{fontSize:"small",sx:{ml:.25,fontSize:14,cursor:"pointer",verticalAlign:"middle"}})})]})}const Dn={provider:"",model:"",url:"",key:"",accessKeyId:"",testConnection:""};rt.propTypes={desc:x.string.isRequired,docLink:x.string,provider:x.string,orientation:x.oneOf(["vertical","horizontal"])};function rs({orientation:e="vertical",hideDivider:n=!1,source:r="dashboard",forceValidate:i=!1},a){const[o,m]=R.useState(!1),[c,d]=R.useState(!1),[l,v]=R.useState(!1),[p,C]=R.useState(!1),{t:f}=R.useContext(je),y=ge(),{api:w}=y,{did:j,blocklet:E,actions:u}=De(),[s,h]=R.useState(!1),b=cr({...Dn}),P=cr({loading:!1,success:!1}),{confirmApi:k,confirmHolder:M}=ho(),F=R.useMemo(()=>`connect-aigne-${j}`,[j]),I=cd(y),B=Zi({messageType:"connect-aigne-message",onOpen:()=>m(!0),onClose:()=>m(!1)}),D=R.useMemo(()=>o||c||l||P.loading,[o,c,l,P.loading]),L=Ke(A=>I.find(Z=>Z.provider===A)),z=Ke(A=>L(A)?.models||[]);ai(()=>{F&&pl(F)});const $=Ke(A=>{if(A)return A;const Z=I[0]?.provider;return z(Z)[0]?.name||"auto"}),H=Ke(()=>{Object.keys(Dn).forEach(A=>{b[A]=Dn[A]})}),J=kt(()=>{const{aigne:A={}}=E?.settings||{};return A},[E]),se=kt(()=>{const A={...J},Z=A?.provider||I[0]?.provider,X=L(Z),he=pt(Z),vt=Ht(Z);return{...A,url:dr.getOriginUrl(A?.url||he&&X?.baseURL||""),provider:Z,model:$(A?.model),key:In(A?.key,j),accessKeyId:vt?In(A?.accessKeyId,j):A?.accessKeyId,secretAccessKey:vt?In(A?.secretAccessKey,j):A?.secretAccessKey}},[E,L,$]),[O,te]=R.useState(se);R.useEffect(()=>{te(se)},[se]);const _=R.useMemo(()=>O?.url&&O?.key&&O?.provider==="aigneHub",[O]),T=kt(()=>L(O.provider)?.name||O.provider,[O,L]),g=R.useMemo(()=>ld(O),[O]),S=kt(()=>L(O.provider)?.documentation||"",[O,L]),N=async()=>{try{m(!0);const A=new Set(["running","error"]),Z=E.children.filter(X=>A.has(X.status)||A.has(X.greenStatus)).map(X=>X.meta.did);await w.restartBlocklet({input:{did:j,componentDids:Z}}),u.refreshBlocklet()}catch(A){console.error("error",A),G.error(ye(A))}finally{m(!1)}},K=(A=!0)=>{if(r!=="setup")return new Promise(Z=>{k.open({title:f("setting.aigne.restart.title"),content:A?f("setting.aigne.restart.connectedContent",{provider:T}):f("setting.aigne.restart.notConnectedContent",{provider:T}),confirmButtonText:f("setting.aigne.restart.confirm"),cancelButtonText:f("setting.aigne.restart.cancel"),onConfirm(X){X(),N(),Z(!0)},onCancel(){Z(!1)}})})},ee=Ke(()=>new Promise(A=>{k.open({title:f("setting.aigne.revokeUrlAuthTitle",{url:f("setting.aigne.baseUrl",{provider:T})}),content:f("setting.aigne.revokeUrlAuth",{url:f("setting.aigne.baseUrl",{provider:T})}),confirmButtonText:f("common.confirm"),cancelButtonText:f("common.cancel"),onConfirm(Z){Z(),A(!0)},onCancel(){A(!1)}})})),V=async(A,Z)=>{const X={};if(te({...O,[A]:Z}),A==="provider"){const he=z(Z);he.length>0&&(X.model=he[0].name),X.key=""}return _&&A==="url"&&Z!==O.url&&(await ee()?(X.key="",X.validationResult=""):X.url=O.url),setTimeout(()=>{te({...O,[A]:Z,...X})},100),h(!0),!0},ie=R.useMemo(()=>O.provider,[O.provider]),re=Ke(A=>li(A)?"":f("setting.aigne.invalidUrl",{provider:T})),ne=(A=[])=>{const Z=g.filter(he=>!A.includes(he));if(Z.length)return Z.forEach(he=>{b[he]="required"}),!Z.includes("url")&&pt(O.provider)&&(b.url=re(O.url)),!1;const X=pt(O.provider)&&re(O.url);return X?(b.url=X,!1):!0},ke=async()=>{try{v(!0),await w.disconnectToAigne({input:{did:j,url:O.url,key:O.key}}),h(!1),G.success(f("setting.aigne.disconnectSuccess")),setTimeout(()=>{K(!1)},300)}catch(A){console.error("disconnect error:",A),G.error(ye(A)||f("setting.aigne.disconnectFailed"))}finally{v(!1)}},we=()=>{k.open({title:f("setting.aigne.disconnect"),content:f("setting.aigne.disconnectConfirm"),confirmButtonText:f("setting.aigne.disconnect"),cancelButtonText:f("common.cancel"),onConfirm(A){A(),ke()}})},de=async()=>{if(!ne())return;H();const A={...O,model:"auto",key:Tn(O.key,j)};Ht(A.provider)?(A.key="",O.accessKeyId&&(A.accessKeyId=Tn(O.accessKeyId,j)),O.secretAccessKey&&(A.secretAccessKey=Tn(O.secretAccessKey,j))):(A.accessKeyId="",A.secretAccessKey="");const Z=await w.updateBlockletSettings({input:{did:j,aigne:A}});return u.refreshBlocklet(),Z},Ve=async()=>{try{if(!s&&!i)return;m(!0);const A=await de();return A?(h(!1),G.success(f("oauth.saveSuccess")),A):void 0}catch(A){throw console.error("error",A),G.error(ye(A)||f("setting.aigne.failed")),A}finally{m(!1)}},Ye=async(A=!1)=>{b.testConnection="";try{if(P.loading=!0,!A&&(await de())?.code!=="ok")return;await w.verifyAigneConnection({input:{did:j}}),G.success(f("setting.aigne.testSuccess",{provider:T})),P.success=!0}catch(Z){throw console.error("error",Z),b.testConnection=Z.message,G.error(f("setting.aigne.testFailed")),Z}finally{P.loading=!1,u.refreshBlocklet()}},at=async()=>{try{await ml(w,{did:j,refresh:u.refreshBlocklet,t:f,providerName:T,timerKey:F,values:{...J}}).catch(A=>{throw console.error("waitGetConnectedAigne error",A),G.error(ye(A)),A}).then(()=>Ye(!0).catch(A=>{throw console.error("onVerifyConnection error",A),A})),K(!0)}catch(A){console.error("error",A)}finally{h(!1)}},Ze=()=>{ne(["key"])&&(H(),B(async(A,Z)=>{try{d(!0);const X=await w.connectToAigne({input:{did:j,baseUrl:dr.getOriginUrl(O.url||new URL(window.location.origin).origin),provider:O.provider,model:"auto"}});if(!X?.url){G.error("failed to connect to endpoint"),d(!1),m(!1);return}Z(X.url),await at(),d(!1)}catch(X){const he=ye(X);G.error(he),d(!1)}}))};R.useImperativeHandle(a,()=>({onSubmit:Ve,loading:o||c||l})),z(ie);const Qe=ie==="aigneHub",on=()=>{C(!p)},_e=A=>{A.preventDefault()},yt=R.useMemo(()=>b.url==="required"?f("common.requiredErrorText",{name:f("setting.aigne.baseUrl",{provider:T})}):b.url?b.url:b.key==="required"?f("setting.aigne.apiKeyNotAuthorized",{provider:T}):"",[b.url,b.key,f,T]);return t.jsxs(md,{source:r,children:[t.jsx(U,{sx:{mb:3},children:t.jsx(le,{variant:"body2",color:"text.primary",sx:{lineHeight:1.6,"& a":{color:"primary.main"}},dangerouslySetInnerHTML:{__html:f("setting.aigne.configDesc",{url:"https://store.blocklet.dev/blocklets/z8ia3xzq2tMq8CRHfaXj1BTYJyYnEcHbqP8cJ"})}})}),t.jsx(le,{variant:"h5",sx:{fontSize:18},children:f("setting.aigne.authorizeAigneHub",{name:T})}),_&&O.validationResult?t.jsx(ns,{url:O.url,providerName:T,disconnect:we,validationResult:O.validationResult,disabled:D,loading:l}):t.jsx(nn,{height:"none",minHeight:"none",children:t.jsxs(U,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:2},children:[t.jsx(dt,{orientation:e,title:f("setting.aigne.baseUrl",{provider:T}),required:pt(O.provider),desc:t.jsx(rt,{desc:f("setting.aigne.desc.baseUrl",{example:"https://hub.aigne.io"})}),children:t.jsx(Pt,{disabled:D,initialValue:O.url||"",directEditing:!0,onSubmit:A=>{V("url",A)},autoFocus:!1,errorTips:yt,InputProps:_?{endAdornment:t.jsx(ur,{position:"end",children:P.loading||c?t.jsx(Ce,{size:16}):t.jsxs(t.Fragment,{children:[O.validationResult==="success"?t.jsx(be,{title:f("setting.aigne.testSuccess",{provider:T}),children:t.jsx(Do,{sx:{fontSize:16,color:"success.main",cursor:"pointer"}})}):null,O.validationResult&&O.validationResult!=="success"?t.jsx(be,{title:O.validationResult,children:t.jsx(Po,{sx:{fontSize:16,color:"error.main",cursor:"pointer"}})}):null,O.validationResult?null:t.jsx(me,{"aria-label":"test connection",onClick:Ye,edge:"end",children:P.loading?t.jsx(Ce,{size:16}):t.jsx(be,{title:f("setting.aigne.testConnection",{provider:T}),children:t.jsx(fe,{style:{fontSize:16},icon:"tabler:location-check"})})})]})})}:{}})}),t.jsx(Zt,{variant:"contained",onClick:Ze,startIcon:c?t.jsx(Ce,{size:16,sx:{mr:1}}):t.jsx(Jt,{}),disabled:D||!O.url,sx:{flexShrink:0},children:f("setting.aigne.authorizeAigneHub",{name:"AIGNE Hub"})})]})}),t.jsxs(Fe,{container:!0,className:"config-container",spacing:2,sx:{display:"none"},children:[t.jsx(Fe,{size:{xs:12,md:4},children:t.jsx(dt,{orientation:e,title:f("setting.aigne.modelAdapter"),required:!0,desc:t.jsx(rt,{desc:f("setting.aigne.desc.modelAdapter")}),children:t.jsx(Vo,{disabled:D,options:I,config:{multiple:!1,labelField:"name",valueField:"provider"},initialValue:O.provider,directEditing:!0,searchable:!1,helperText:b.provider==="required"?f("common.requiredErrorText",{name:f("setting.aigne.modelAdapter")}):b.provider,onChange:A=>V("provider",A)})})}),null,Qe?null:t.jsx(t.Fragment,{children:Ht(O.provider)?t.jsxs(t.Fragment,{children:[t.jsx(dt,{orientation:e,title:"Access Key ID",required:!0,desc:t.jsx(rt,{desc:f("setting.aigne.desc.accessKeyId"),docLink:S,provider:T}),children:t.jsx(Pt,{disabled:D,initialValue:O.accessKeyId||"",type:p?"text":"password",onChange:A=>V("accessKeyId",A),directEditing:!0,autoFocus:!1})}),!n&&t.jsx(U,{className:"config-form",component:ci,sx:{my:3}}),t.jsx(dt,{orientation:e,title:"Secret Access Key",required:!0,desc:t.jsx(rt,{desc:f("setting.aigne.desc.secretAccessKey"),docLink:S,provider:T}),children:t.jsx(Pt,{disabled:D,initialValue:O.secretAccessKey||"",type:p?"text":"password",onChange:A=>V("secretAccessKey",A),directEditing:!0,autoFocus:!1})})]}):t.jsx(dt,{orientation:e,title:"API Key",required:!0,desc:t.jsx(rt,{desc:f("setting.aigne.desc.key",{provider:T}),docLink:S,provider:T}),children:t.jsx(Pt,{disabled:D,initialValue:O.key||"",type:p?"text":"password",onChange:A=>V("key",A),directEditing:!0,autoFocus:!1,InputProps:{endAdornment:t.jsx(ur,{position:"end",children:t.jsx(me,{"aria-label":"toggle password visibility",onClick:on,onMouseDown:_e,edge:"end",children:p?t.jsx(Oa,{}):t.jsx(Ua,{})})})}})})})]}),_&&O.validationResult==="success"?t.jsx(ts,{switchUser:Ze,url:O.url||"",apiKey:O.key||"",connecting:c||l}):null,r!=="setup"&&t.jsxs(le,{sx:{fontSize:12,color:"text.secondary",mt:3,fontStyle:"italic"},children:["* ",f("setting.aigne.description",{name:Q.getDisplayName(E,!0)})]}),M]})}rs.propTypes={orientation:x.oneOf(["vertical","horizontal"]),hideDivider:x.bool,source:x.oneOf(["dashboard","setup"]),forceValidate:x.bool};const md=oe.div`
|
|
347
|
+
`,c=R.useMemo(()=>!n?.enableCredit,[n]),d=R.useMemo(()=>Number(n?.creditBalance?.balance)<=0&&Number(n?.creditBalance?.pendingCredit)>0,[n]);if(!n&&!e)return null;const{creditBalance:l,profileLink:v="",paymentLink:p=""}=n||{};return t.jsx(nn,{children:e?t.jsxs(U,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",gap:2,height:"100%"},children:[t.jsxs(U,{sx:{width:"100%",display:"flex",flexDirection:"column",gap:1},children:[t.jsx(Me,{variant:"rounded",sx:{width:"80%",height:20}}),t.jsx(Me,{variant:"rounded",sx:{width:"50%",height:20}})]}),t.jsxs(U,{sx:{width:"100%",display:"flex",justifyContent:"space-between",gap:1},children:[t.jsx(Me,{variant:"rounded",sx:{width:"100%",height:20}}),t.jsx(Me,{variant:"rounded",sx:{width:"100%",height:20}})]})]}):t.jsxs(U,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",height:"100%",width:"100%"},children:[t.jsxs(U,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[t.jsx(le,{variant:"body1",children:"AIGNE Hub Credits"}),t.jsxs(le,{variant:"h2",sx:{color:!c&&d?"error.main":"text.primary"},children:[t.jsx("span",{children:c?o("setting.aigne.infinite"):d?`- ${ro(l?.pendingCredit)}`:ro(l.balance)}),c?null:t.jsx(be,{title:o("common.refresh"),children:t.jsx(Ta,{sx:{fontSize:14,ml:1,cursor:"pointer",animation:a?`${f} 1s linear infinite`:"none"},onClick:i})})]})]}),c?null:t.jsxs(U,{sx:{width:"100%",display:"flex",gap:1},children:[t.jsx(Mn,{fullWidth:!0,variant:"outlined",disabled:r,onClick:()=>{p&&window.open(p,"_blank")},startIcon:t.jsx(fe,{style:{fontSize:16},icon:"tabler:credit-card"}),children:o("setting.aigne.addCredits")}),t.jsx(Mn,{fullWidth:!0,disabled:r,onClick:()=>{v&&window.open(mo(v,{appDid:window.blocklet.appPid}),"_blank")},variant:"outlined",startIcon:t.jsx(fe,{style:{fontSize:16},icon:"hugeicons:transaction"}),children:o("setting.aigne.transaction")})]})]})})}es.propTypes={loading:x.bool,credit:x.object,connecting:x.bool,onRefresh:x.func,refreshing:x.bool};function ts({url:e,apiKey:n,switchUser:r=mt,connecting:i=!1}){const{t:a}=R.useContext(je),[o,f]=R.useState(!1),{data:c,loading:d,error:l,refresh:v}=ii(()=>ud({baseUrl:e,accessKey:n}),{ready:!!(e&&n),refreshDeps:[e,n],onSuccess:()=>{f(!1)},onError:()=>{f(!1)}}),p=R.useCallback(()=>{d||o||(f(!0),v())},[v,d,o]);return l?null:t.jsxs(U,{children:[t.jsx(le,{variant:"h5",sx:{fontSize:18,mb:2},children:a("setting.aigne.account")}),t.jsxs(ze,{container:!0,className:"config-container",spacing:2,sx:{width:"100%"},children:[t.jsx(ze,{size:{xs:12,md:6},children:t.jsx(Jo,{loading:d&&!o,user:c?.user,switchUser:r,connecting:i,url:e})}),t.jsx(ze,{size:{xs:12,md:6},children:t.jsx(es,{refreshing:o,loading:d&&!o,credit:c,connecting:i,onRefresh:p})})]})]})}ts.propTypes={url:x.string.isRequired,apiKey:x.string.isRequired,connecting:x.bool,switchUser:x.func};function ns({url:e,providerName:n,disconnect:r=mt,disabled:i=!1,loading:a=!1,validationResult:o=""}){const{t:f}=R.useContext(je),c=R.useMemo(()=>o&&o!=="success",[o]);return t.jsx(nn,{minHeight:80,height:"none",children:t.jsxs(U,{sx:{width:"100%",height:"100%",display:"flex",justifyContent:"flex-start",alignItems:"center",gap:2},children:[c?t.jsx(be,{title:o,children:t.jsx(Po,{sx:{fontSize:24,color:"error.main",cursor:"pointer",flexShrink:0}})}):t.jsx(Do,{sx:{fontSize:24,color:"success.main",cursor:"pointer",flexShrink:0}}),t.jsxs(U,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flex:1,flexWrap:"wrap"},children:[t.jsxs(U,{children:[t.jsx(le,{variant:"h5",sx:{fontSize:18},children:c?f("setting.aigne.testFailed"):f("setting.aigne.connected",{provider:n})}),t.jsxs(le,{variant:"body1",sx:{color:"text.secondary",fontSize:14},children:[f("setting.aigne.baseUrl",{provider:n}),": ",e]})]}),t.jsx(Zt,{variant:"outlined",color:"error",startIcon:a?t.jsx(Ce,{size:16,sx:{mr:1}}):t.jsx(Yi,{}),onClick:r,disabled:i||a,sx:{lineHeight:1.5},children:f("setting.aigne.disconnect")})]})]})})}ns.propTypes={url:x.string.isRequired,providerName:x.string.isRequired,disabled:x.bool,disconnect:x.func,loading:x.bool,validationResult:x.string};function rt({desc:e,docLink:n=null,provider:r="",orientation:i="vertical"}){const{t:a}=R.useContext(je);return t.jsxs(le,{variant:"body2",sx:{lineHeight:1.6,color:"text.secondary",fontSize:12,...i==="vertical"&&{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},title:e,children:[e,n&&t.jsx(be,{title:t.jsxs(t.Fragment,{children:[a("setting.aigne.desc.docLink"),n&&t.jsxs(t.Fragment,{children:[":"," ",t.jsx(xt,{href:n,target:"_blank",rel:"noopener noreferrer",sx:{ml:.5},children:r||"documentation"})]})]}),arrow:!0,children:t.jsx(ja,{fontSize:"small",sx:{ml:.25,fontSize:14,cursor:"pointer",verticalAlign:"middle"}})})]})}const Dn={provider:"",model:"",url:"",key:"",accessKeyId:"",testConnection:""};rt.propTypes={desc:x.string.isRequired,docLink:x.string,provider:x.string,orientation:x.oneOf(["vertical","horizontal"])};function rs({orientation:e="vertical",hideDivider:n=!1,source:r="dashboard",forceValidate:i=!1},a){const[o,f]=R.useState(!1),[c,d]=R.useState(!1),[l,v]=R.useState(!1),[p,C]=R.useState(!1),{t:m}=R.useContext(je),y=xe(),{api:j}=y,{did:w,blocklet:E,actions:u}=De(),[s,h]=R.useState(!1),b=cr({...Dn}),P=cr({loading:!1,success:!1}),{confirmApi:k,confirmHolder:M}=ho(),z=R.useMemo(()=>`connect-aigne-${w}`,[w]),I=cd(y),B=Zi({messageType:"connect-aigne-message",onOpen:()=>f(!0),onClose:()=>f(!1)}),D=R.useMemo(()=>o||c||l||P.loading,[o,c,l,P.loading]),L=Ke(A=>I.find(Q=>Q.provider===A)),F=Ke(A=>L(A)?.models||[]);ai(()=>{z&&pl(z)});const $=Ke(A=>{if(A)return A;const Q=I[0]?.provider;return F(Q)[0]?.name||"auto"}),H=Ke(()=>{Object.keys(Dn).forEach(A=>{b[A]=Dn[A]})}),X=kt(()=>{const{aigne:A={}}=E?.settings||{};return A},[E]),se=kt(()=>{const A={...X},Q=A?.provider||I[0]?.provider,J=L(Q),he=pt(Q),vt=Ht(Q);return{...A,url:dr.getOriginUrl(A?.url||he&&J?.baseURL||""),provider:Q,model:$(A?.model),key:In(A?.key,w),accessKeyId:vt?In(A?.accessKeyId,w):A?.accessKeyId,secretAccessKey:vt?In(A?.secretAccessKey,w):A?.secretAccessKey}},[E,L,$]),[O,te]=R.useState(se);R.useEffect(()=>{te(se)},[se]);const _=R.useMemo(()=>O?.url&&O?.key&&O?.provider==="aigneHub",[O]),T=kt(()=>L(O.provider)?.name||O.provider,[O,L]),g=R.useMemo(()=>ld(O),[O]),S=kt(()=>L(O.provider)?.documentation||"",[O,L]),N=async()=>{try{f(!0);const A=new Set(["running","error"]),Q=E.children.filter(J=>A.has(J.status)||A.has(J.greenStatus)).map(J=>J.meta.did);await j.restartBlocklet({input:{did:w,componentDids:Q}}),u.refreshBlocklet()}catch(A){console.error("error",A),G.error(ge(A))}finally{f(!1)}},K=(A=!0)=>{if(r!=="setup")return new Promise(Q=>{k.open({title:m("setting.aigne.restart.title"),content:A?m("setting.aigne.restart.connectedContent",{provider:T}):m("setting.aigne.restart.notConnectedContent",{provider:T}),confirmButtonText:m("setting.aigne.restart.confirm"),cancelButtonText:m("setting.aigne.restart.cancel"),onConfirm(J){J(),N(),Q(!0)},onCancel(){Q(!1)}})})},ee=Ke(()=>new Promise(A=>{k.open({title:m("setting.aigne.revokeUrlAuthTitle",{url:m("setting.aigne.baseUrl",{provider:T})}),content:m("setting.aigne.revokeUrlAuth",{url:m("setting.aigne.baseUrl",{provider:T})}),confirmButtonText:m("common.confirm"),cancelButtonText:m("common.cancel"),onConfirm(Q){Q(),A(!0)},onCancel(){A(!1)}})})),V=async(A,Q)=>{const J={};if(te({...O,[A]:Q}),A==="provider"){const he=F(Q);he.length>0&&(J.model=he[0].name),J.key=""}return _&&A==="url"&&Q!==O.url&&(await ee()?(J.key="",J.validationResult=""):J.url=O.url),setTimeout(()=>{te({...O,[A]:Q,...J})},100),h(!0),!0},ie=R.useMemo(()=>O.provider,[O.provider]),re=Ke(A=>li(A)?"":m("setting.aigne.invalidUrl",{provider:T})),ne=(A=[])=>{const Q=g.filter(he=>!A.includes(he));if(Q.length)return Q.forEach(he=>{b[he]="required"}),!Q.includes("url")&&pt(O.provider)&&(b.url=re(O.url)),!1;const J=pt(O.provider)&&re(O.url);return J?(b.url=J,!1):!0},ke=async()=>{try{v(!0),await j.disconnectToAigne({input:{did:w,url:O.url,key:O.key}}),h(!1),G.success(m("setting.aigne.disconnectSuccess")),setTimeout(()=>{K(!1)},300)}catch(A){console.error("disconnect error:",A),G.error(ge(A)||m("setting.aigne.disconnectFailed"))}finally{v(!1)}},we=()=>{k.open({title:m("setting.aigne.disconnect"),content:m("setting.aigne.disconnectConfirm"),confirmButtonText:m("setting.aigne.disconnect"),cancelButtonText:m("common.cancel"),onConfirm(A){A(),ke()}})},de=async()=>{if(!ne())return;H();const A={...O,model:"auto",key:Tn(O.key,w)};Ht(A.provider)?(A.key="",O.accessKeyId&&(A.accessKeyId=Tn(O.accessKeyId,w)),O.secretAccessKey&&(A.secretAccessKey=Tn(O.secretAccessKey,w))):(A.accessKeyId="",A.secretAccessKey="");const Q=await j.updateBlockletSettings({input:{did:w,aigne:A}});return u.refreshBlocklet(),Q},Ve=async()=>{try{if(!s&&!i)return;f(!0);const A=await de();return A?(h(!1),G.success(m("oauth.saveSuccess")),A):void 0}catch(A){throw console.error("error",A),G.error(ge(A)||m("setting.aigne.failed")),A}finally{f(!1)}},Ye=async(A=!1)=>{b.testConnection="";try{if(P.loading=!0,!A&&(await de())?.code!=="ok")return;await j.verifyAigneConnection({input:{did:w}}),G.success(m("setting.aigne.testSuccess",{provider:T})),P.success=!0}catch(Q){throw console.error("error",Q),b.testConnection=Q.message,G.error(m("setting.aigne.testFailed")),Q}finally{P.loading=!1,u.refreshBlocklet()}},at=async()=>{try{await ml(j,{did:w,refresh:u.refreshBlocklet,t:m,providerName:T,timerKey:z,values:{...X}}).catch(A=>{throw console.error("waitGetConnectedAigne error",A),G.error(ge(A)),A}).then(()=>Ye(!0).catch(A=>{throw console.error("onVerifyConnection error",A),A})),K(!0)}catch(A){console.error("error",A)}finally{h(!1)}},Ze=()=>{ne(["key"])&&(H(),B(async(A,Q)=>{try{d(!0);const J=await j.connectToAigne({input:{did:w,baseUrl:dr.getOriginUrl(O.url||new URL(window.location.origin).origin),provider:O.provider,model:"auto"}});if(!J?.url){G.error("failed to connect to endpoint"),d(!1),f(!1);return}Q(J.url),await at(),d(!1)}catch(J){const he=ge(J);G.error(he),d(!1)}}))};R.useImperativeHandle(a,()=>({onSubmit:Ve,loading:o||c||l})),F(ie);const Qe=ie==="aigneHub",on=()=>{C(!p)},_e=A=>{A.preventDefault()},yt=R.useMemo(()=>b.url==="required"?m("common.requiredErrorText",{name:m("setting.aigne.baseUrl",{provider:T})}):b.url?b.url:b.key==="required"?m("setting.aigne.apiKeyNotAuthorized",{provider:T}):"",[b.url,b.key,m,T]);return t.jsxs(fd,{source:r,children:[t.jsx(U,{sx:{mb:3},children:t.jsx(le,{variant:"body2",color:"text.primary",sx:{lineHeight:1.6,"& a":{color:"primary.main"}},dangerouslySetInnerHTML:{__html:m("setting.aigne.configDesc",{url:"https://store.blocklet.dev/blocklets/z8ia3xzq2tMq8CRHfaXj1BTYJyYnEcHbqP8cJ"})}})}),t.jsx(le,{variant:"h5",sx:{fontSize:18},children:m("setting.aigne.authorizeAigneHub",{name:T})}),_&&O.validationResult?t.jsx(ns,{url:O.url,providerName:T,disconnect:we,validationResult:O.validationResult,disabled:D,loading:l}):t.jsx(nn,{height:"none",minHeight:"none",children:t.jsxs(U,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:2},children:[t.jsx(dt,{orientation:e,title:m("setting.aigne.baseUrl",{provider:T}),required:pt(O.provider),desc:t.jsx(rt,{desc:m("setting.aigne.desc.baseUrl",{example:"https://hub.aigne.io"})}),children:t.jsx(Pt,{disabled:D,initialValue:O.url||"",directEditing:!0,onSubmit:A=>{V("url",A)},autoFocus:!1,errorTips:yt,InputProps:_?{endAdornment:t.jsx(ur,{position:"end",children:P.loading||c?t.jsx(Ce,{size:16}):t.jsxs(t.Fragment,{children:[O.validationResult==="success"?t.jsx(be,{title:m("setting.aigne.testSuccess",{provider:T}),children:t.jsx(Do,{sx:{fontSize:16,color:"success.main",cursor:"pointer"}})}):null,O.validationResult&&O.validationResult!=="success"?t.jsx(be,{title:O.validationResult,children:t.jsx(Po,{sx:{fontSize:16,color:"error.main",cursor:"pointer"}})}):null,O.validationResult?null:t.jsx(me,{"aria-label":"test connection",onClick:Ye,edge:"end",children:P.loading?t.jsx(Ce,{size:16}):t.jsx(be,{title:m("setting.aigne.testConnection",{provider:T}),children:t.jsx(fe,{style:{fontSize:16},icon:"tabler:location-check"})})})]})})}:{}})}),t.jsx(Zt,{variant:"contained",onClick:Ze,startIcon:c?t.jsx(Ce,{size:16,sx:{mr:1}}):t.jsx(Xt,{}),disabled:D||!O.url,sx:{flexShrink:0},children:m("setting.aigne.authorizeAigneHub",{name:"AIGNE Hub"})})]})}),t.jsxs(ze,{container:!0,className:"config-container",spacing:2,sx:{display:"none"},children:[t.jsx(ze,{size:{xs:12,md:4},children:t.jsx(dt,{orientation:e,title:m("setting.aigne.modelAdapter"),required:!0,desc:t.jsx(rt,{desc:m("setting.aigne.desc.modelAdapter")}),children:t.jsx(Vo,{disabled:D,options:I,config:{multiple:!1,labelField:"name",valueField:"provider"},initialValue:O.provider,directEditing:!0,searchable:!1,helperText:b.provider==="required"?m("common.requiredErrorText",{name:m("setting.aigne.modelAdapter")}):b.provider,onChange:A=>V("provider",A)})})}),null,Qe?null:t.jsx(t.Fragment,{children:Ht(O.provider)?t.jsxs(t.Fragment,{children:[t.jsx(dt,{orientation:e,title:"Access Key ID",required:!0,desc:t.jsx(rt,{desc:m("setting.aigne.desc.accessKeyId"),docLink:S,provider:T}),children:t.jsx(Pt,{disabled:D,initialValue:O.accessKeyId||"",type:p?"text":"password",onChange:A=>V("accessKeyId",A),directEditing:!0,autoFocus:!1})}),!n&&t.jsx(U,{className:"config-form",component:ci,sx:{my:3}}),t.jsx(dt,{orientation:e,title:"Secret Access Key",required:!0,desc:t.jsx(rt,{desc:m("setting.aigne.desc.secretAccessKey"),docLink:S,provider:T}),children:t.jsx(Pt,{disabled:D,initialValue:O.secretAccessKey||"",type:p?"text":"password",onChange:A=>V("secretAccessKey",A),directEditing:!0,autoFocus:!1})})]}):t.jsx(dt,{orientation:e,title:"API Key",required:!0,desc:t.jsx(rt,{desc:m("setting.aigne.desc.key",{provider:T}),docLink:S,provider:T}),children:t.jsx(Pt,{disabled:D,initialValue:O.key||"",type:p?"text":"password",onChange:A=>V("key",A),directEditing:!0,autoFocus:!1,InputProps:{endAdornment:t.jsx(ur,{position:"end",children:t.jsx(me,{"aria-label":"toggle password visibility",onClick:on,onMouseDown:_e,edge:"end",children:p?t.jsx(Oa,{}):t.jsx(Ua,{})})})}})})})]}),_&&O.validationResult==="success"?t.jsx(ts,{switchUser:Ze,url:O.url||"",apiKey:O.key||"",connecting:c||l}):null,r!=="setup"&&t.jsxs(le,{sx:{fontSize:12,color:"text.secondary",mt:3,fontStyle:"italic"},children:["* ",m("setting.aigne.description",{name:Z.getDisplayName(E,!0)})]}),M]})}rs.propTypes={orientation:x.oneOf(["vertical","horizontal"]),hideDivider:x.bool,source:x.oneOf(["dashboard","setup"]),forceValidate:x.bool};const fd=oe.div`
|
|
352
348
|
max-width: 920px;
|
|
353
349
|
display: flex;
|
|
354
350
|
flex-direction: column;
|
|
@@ -366,7 +362,7 @@ import{aF as ze,j as t,ds as ws,gH as _s,iD as Ss,V as ce,bn as ge,K as U,ay as
|
|
|
366
362
|
margin-bottom: 0 !important;
|
|
367
363
|
margin-top: 0 !important;
|
|
368
364
|
}
|
|
369
|
-
`,hd=R.forwardRef(rs),gd=(e,n)=>(e?.children||[]).find(r=>r.mountPoint===n)?.meta,xd=e=>e.inStore&&Q.isFreeBlocklet(e)===!1,yd=e=>[ve.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,ve.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes(e?.capabilities?.didSpace),Bn=e=>e?.configs?.find(n=>n.key===ve.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)?.value||null,vd=e=>(e.environments||[]).some(n=>n.required),oo=(e,n)=>e?.some(r=>r.required&&!n[r.key]),Cd=({params:e,blocklet:n,t:r})=>{const i=e.title||e.name;return i?(n?.children||[]).find(o=>o.meta.bundleDid===e.bundleDid)?r("blocklet.component.upgradeNext",{name:i}):r("blocklet.component.addNext",{name:i}):r("common.next")},so=({componentDid:e,timeout:n=1e3,manual:r=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:r},"*")},n)};function os({onClose:e=()=>{},mode:n="normal",stores:r=[],resourceType:i="",resourceDid:a="",storageKey:o="",inDialog:m=!0,selectedMeta:c=null,storeUrl:d="",showResourcesSwitch:l=!0,showFromUrl:v=!0,enableRunBackground:p=!0,showCategory:C=!0,installFromUrlParams:f=null}){const{t:y,locale:w}=ce(),[j,E]=R.useState(!1),[u,s]=R.useState(null),[h,b]=R.useState(""),[P,k]=R.useState(""),{api:M,ws:{useSubscription:F},inService:I,info:B}=ge(),{blocklet:D,actions:{refreshBlocklet:L}}=De(),[z,$]=R.useState(null),[H,J]=R.useState(!1),se={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1,isUpload:!1,upgradeDid:""},[O,te]=R.useState(se),[_,T]=R.useState(0),g=R.useRef({}),S=R.useRef({}),N=R.useRef({}),K=go(q=>q.breakpoints.down("md")),ee=di(),[V,ie]=R.useState(!0),{meta:re}=g.current,ne=ca(re),ke=R.useRef(!1),we=R.useRef(null),de=q=>te(Y=>({...Y,...q}));R.useEffect(()=>{if(O.pathPrefix){const{errMsg:q}=Z({...O,pathPrefix:O.pathPrefix,locale:w});b(q)}},[O.pathPrefix]),R.useEffect(()=>{_===0&&te(se)},[_]);const Ve=()=>{const q=Bn(D)??"";de({didSpaceEndpoint:q})},Ye=()=>g?.current?.meta?Q.getDisplayName(g.current):"",at=()=>{E(!1),te({}),ke.current=!1,g.current={},e()},Ze=q=>{const Y=ae=>{de({installResultProps:{variant:"error",title:Ye(),subTitle:q,footer:t.jsx(Be,{className:"bottom-button",disabled:ae,"data-cy":"retry-install-component",onClick:async()=>{Y(!0),await A(g.current.installInput)},children:t.jsxs(U,{sx:{display:"flex",alignItems:"center"},children:[ae&&t.jsx(Ce,{size:16,style:{marginRight:8}}),y("common.retry")]})})}})};Y()},Qe=q=>Y=>{(Y?.meta?.did||Y?.meta)===D?.meta?.did&&q(Y)},on=()=>{so({timeout:0,componentDid:ee.componentDid,manual:!0}),at(),setTimeout(()=>{const q=document.getElementsByClassName("dashboard-main")[0];q&&(q.scrollTop=q.scrollHeight)},200)};F(ve.BlockletEvents.componentInstalled,Qe(()=>{de({installResultProps:{variant:"success",title:Ye(),subTitle:y("blocklet.component.installSuccessTip")}}),so({componentDid:ee.componentDid})}),[D?.meta?.did]),F(ve.BlockletEvents.statusChange,Qe(()=>{const q=Bn(D);de(Y=>({...Y,didSpaceEndpoint:q}))}),[D?.meta?.did]),F(ve.BlockletEvents.downloadFailed,Qe(()=>{ke.current=!1,Ze(y("blocklet.component.installComponentError"))}),[D?.meta?.did]),F(ve.BlockletEvents.installFailed,Qe(()=>{ke.current=!1,Ze(y("blocklet.component.installComponentError"))}),[D?.meta?.did]);const _e=[],yt=q=>(D?.children||[]).find(Y=>Y.meta.did===q),A=async q=>{ke.current=!0;const{pathPrefix:Y,bundleDid:ae,title:ue,componentName:Te="",componentDid:qe=""}=O,Ge=g.current?.meta||{},{configs:Je=[],registryUrl:Ue,inStore:Xe,inputUrl:lt,dist:an}=Ge,Ct=g.current?.downloadTokenList,bt=lt||(Xe?pr(Ue,ae,an):"");E(!0);const Re={rootDid:D.meta.did,url:bt,mountPoint:Y?Le.urlPathFriendly(Y):`/${Le.urlPathFriendly(Ge.title||Ge.name)}`,title:ue,name:Te,did:O.isUpload&&O.upgradeDid?O.upgradeDid:qe,dist:{tarball:"",integrity:""},onlyRequired:!V,...O.hasEnvironmentsStep&&Je.length>0?{configs:Je.map(Ae=>({...Ae,value:O.configsValue[Ae.key]||""}))}:{},...Ct?{downloadTokenList:Ct}:{},...q};try{if(await M.installComponent({input:Re}),Ue){const{teamDid:Ae,storeList:$e}=co({fromBlocklet:I,nodeInfo:B,blocklet:D}),{isNew:ct,decoded:jt}=fi(Ue,$e);ct&&M.addBlockletStore({input:{teamDid:Ae,url:jt}}).catch(ln=>{console.error("addBlockletStore error: ",ln)})}de({installResultProps:{}}),L({showError:!1,attachRuntimeInfo:!1})}catch(Ae){const $e=ye(Ae);G.error($e),console.error("installComponent error: ",Ae),Ze($e)}finally{E(!1),g.current.installInput=Re}},Z=q=>{const Y=ko({params:{...q,did:q.bundleDid},blocklets:[D],blocklet:D,locale:w,isUpload:O.isUpload});let ae=Y;const ue=gd(D,O.pathPrefix);if(Y==="overwrite"&&ue&&ue.did!==q.bundleDid?(de({upgradeDid:ue.did}),ae=""):(de({upgradeDid:""}),ae=Y),ae){const Te=yt(q.bundleDid),qe=va({params:{...q,did:q.bundleDid},blocklet:D});if(Te&&Te.mountPoint===qe)return{errMsg:""}}return{errMsg:ae}},X=async q=>{const{errMsg:Y}=Z({...O,locale:w});b(Y),_===_e.length-2&&!ke.current&&await A(q),S.current?.setActiveStepByIndex?.(ae=>ae+1)},he=()=>{S.current?.setActiveStepByIndex?.(q=>q-1)},vt=()=>{const{pathPrefix:q,bundleDid:Y,title:ae,componentName:ue="",componentDid:Te=""}=O,{meta:qe={}}=g.current||{},{registryUrl:Ge,inStore:Je,inputUrl:Ue,dist:Xe}=qe,lt=Je?pr(Ge,Y,Xe):Ue;$({meta:qe,installOpts:{type:"component",rootDid:D.meta.did,mountPoint:q,url:lt,title:ae,name:ue,did:Te}})},or=q=>{J(!1),de({purchaseResultProps:{variant:"error",title:Ye(),subTitle:q,style:{paddingTop:120},footer:t.jsx(Be,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{de({purchaseResultProps:{}})},children:y("common.retry")})}})},ys=({downloadTokenList:q})=>{g.current.downloadTokenList=q,J(!1),X()},sn=({chooseParams:q=g.current,componentDid:Y,isInit:ae=!1,isUpload:ue=!1})=>{const{meta:Te,registryUrl:qe,inStore:Ge,inputUrl:Je}=q,{did:Ue,title:Xe,name:lt}=Te,an=(D.settings?.children||[]).filter(Ie=>Ie.status==="deleted"&&Ie.meta.bundleDid===Ue),Ct=Y||"",bt=Te.environments?.map(Ie=>{const{name:cn,validation:wt,..._t}=Ie,dn={validation:Wn(wt)?"":wt};return{..._t,key:cn,...dn}});g.current={...q,meta:{...Te,configs:bt,registryUrl:qe,inStore:Ge,inputUrl:Je}};let Re={};if(ae){const Ie=[D],cn=bt||[],wt=[],_t=uo(pi([...cn,...wt]),"key").filter(et=>!!et.key).sort((et,St)=>et.required&&!St.required?-1:St.required&&!et.required?1:0),dn=Q.getSharedConfigObj(Ie[0],{configs:_t}),un={},sr=_t.map(et=>{const{default:St,key:Et,...js}=et;return un[Et]=dn[Et]||St,{...js,key:Et,hidden:!!ve.BLOCKLET_CONFIGURABLE_KEY[Et]}});Re={...Re,configsList:sr,configsValue:un,hasMissRequiredConfigs:oo(sr,un)}}const Ae=D.children.some(Ie=>Ie.mountPoint==="/"),$e=an.find(Ie=>Ie.meta.bundleDid===Ue),ct=D.children.find(Ie=>Ie.meta.bundleDid===Ue);Re.title=Xe||"",$e?Re={...Re,pathPrefix:$e.mountPoint||"",componentName:$e.meta.name,hasEnvironmentsStep:!1}:ct?Re={...Re,pathPrefix:ct.mountPoint||"",componentName:ct.meta.name,hasEnvironmentsStep:!1}:Re={...Re,pathPrefix:Ae?`/${Le.urlPathFriendly(Xe)||Le.urlPathFriendly(lt)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:g.current.meta?.environments?.length>0};const jt=xd(g.current.meta),ln=yd(g.current.meta),bs=Bn(D);de({bundleDid:Ue,componentDid:Ct,...Re,hasRequiredEnvironments:vd(g.current.meta),requirePurchase:jt,didSpaceIsRequiredSetup:ln,didSpaceEndpoint:bs,isUpload:ue}),ae&&jt&&vt()},vs=async()=>{if(!we.current.loading)try{E(!0),await we.current.onSubmit()&&X()}catch(q){console.error("error",q)}finally{E(!1)}};R.useEffect(()=>{if(!c&&!f?.meta||_!==0||!D)return;const{meta:q,inputUrl:Y="",inStore:ae=!0,registryUrl:ue="",isUpload:Te=!1}=f||{};sn({chooseParams:{blocklets:[c||q],meta:c||q,registryUrl:ue||d||c.homepage,inStore:ae,inputUrl:Y},isInit:!0,isUpload:Te}),de({showFromUrlDialog:!1}),X()},[c,_,D,f]),_e.push({key:"selectComponent",name:y("blocklet.component.selectComponent"),body:t.jsxs(We,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[v&&O.showFromUrlDialog&&t.jsx(Eo,{mode:"component",onCancel:()=>{de({showFromUrlDialog:!1})},onSuccess:({meta:q,inputUrl:Y,inStore:ae,registryUrl:ue})=>{sn({chooseParams:{meta:q,inputUrl:Y,inStore:ae,registryUrl:ue},isInit:!0}),de({showFromUrlDialog:!1}),X()},handleText:{title:y("blocklet.component.addComponentTip.fromUrl"),confirm:y("blocklet.component.choose")}}),t.jsx(Wo,{stores:r,extra:jo.isInServerlessMode(B)?null:v?t.jsxs(Be,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{de({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[t.jsx(Jt,{style:{fontSize:20,marginRight:4}}),y("blocklet.component.addComponentTip.fromUrl")]}):null,loading:j,onChange:()=>{te({}),g.current={}},storageKey:o,children:({currentRegistry:q})=>t.jsx(Go,{showResourcesSwitch:l,showCategory:C,serverVersion:B?.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:q.url,resourceType:i,resourceDid:a,handleButtonClick:Y=>{sn({chooseParams:{...Y,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:Y,defaultRender:ae})=>{const ue=O?.bundleDid&&O?.bundleDid===Y?.did;return t.jsxs(jd,{children:[t.jsx(U,{className:ue?"choose-blocklet":"",sx:{"& > div":{position:"relative","&:before, &:after":{content:'""',position:"absolute",width:"0",height:"0",opacity:0,transition:"width 0.3s, height 0.3s, opacity 0.3s",borderRadius:"8px",pointerEvents:"none",...ue?{width:"100%",height:"100%",opacity:1}:{}},"&:before":{top:0,left:0,borderTop:"1px solid",borderLeft:"1px solid",borderColor:"primary.main"},"&:after":{bottom:0,right:0,borderBottom:"1px solid",borderRight:"1px solid",borderColor:"primary.main"},"&:hover":{"&:before, &:after":{width:"100%",height:"100%",opacity:1}}}},style:{marginLeft:16},children:ae}),ue&&t.jsx(U,{className:"check-container",children:t.jsx(ui,{className:"check-icon"})})]})}})})]}),cancel:n==="embed"?void 0:y("common.cancel"),confirm:Cd({params:O,blocklet:D,t:y}),onCancel:at,onConfirm:()=>{X()}}),_e.push({key:"agreement",name:y("launchBlocklet.introduction"),body:t.jsxs(We,{component:"div",className:"agreement-wrapper",children:[t.jsx(Ln,{title:y("launchBlocklet.introduction"),subTitle:y("blocklet.component.addComponentTip.introduction")}),re?t.jsx(da,{meta:re,onClickNext:X,installRelated:V,onChangeInstallRelated:ie,handleDescEle:t.jsx("p",{children:y("blocklet.component.addComponentTip.belowInformation")})}):null]}),cancel:c?void 0:y("common.pre"),disabled:!ne,confirm:y(ne?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:c?at:he,onConfirm:()=>{J(!1),X()}}),re&&O.requirePurchase&&_e.push({key:"purchase",name:t.jsxs(t.Fragment,{children:[y("common.verifyNFT"),t.jsx(ot,{})]}),body:t.jsxs(We,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(N.current?.getCurrentStep?.()===2||H)&&t.jsx(Tt,{title:y("common.verifyNFT"),subTitle:y("blocklet.component.addComponentTip.verifyNFT")}),Rt(O.purchaseResultProps)?z&&t.jsx(zo,{ref:N,meta:z.meta,mode:O.componentDid?"verify":"both",onCancel:or,installOpts:z.installOpts,handlePaySuccess:ys}):t.jsx("div",{className:"flex-align-center flex-justify-center",children:t.jsx(yr,{...O.purchaseResultProps})})]}),disabled:N.current?.getCurrentStep?.()===2||H,cancel:y("common.pre"),confirm:y("common.next"),onConfirm:()=>{typeof N.current.onNext=="function"&&(N.current.onNext(),J(!0))},onCancel:()=>{he()}}),Q.hasStartEngine(re)&&_o.hasMountPoint(re)?_e.push({key:"config",name:y("common.config"),error:h,body:t.jsxs(We,{component:"div",children:[t.jsx(Tt,{title:y("common.config"),subTitle:y("blocklet.component.addComponentTip.config")}),t.jsx(xe,{label:y("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",fullWidth:!0,helperText:P||y("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:O.pathPrefix,onChange:q=>{const Y=q.target.value;de({pathPrefix:Y}),k(y("common.slugifyHint",{value:Hn(Y)}))},slotProps:{htmlInput:{"data-cy":"mount-point-input"}}}),!!h&&t.jsx(On,{severity:"error",style:{width:"100%",marginTop:8},children:h})]}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:he,onConfirm:()=>{X()}}):re&&(O.pathPrefix=re.interfaces?.[0]?.path||`/${re.did}`),re&&re?.requirements?.aigne&&_e.push({key:"aigne",name:t.jsxs(le,{component:"div",title:y("setting.aigne.config"),sx:{whiteSpace:"break-spaces"},children:[y("setting.aigne.config")," ",t.jsx(ot,{})]}),body:()=>t.jsxs(We,{component:"div",className:"aigne-config-wrapper",children:[t.jsx(Ln,{title:y("setting.aigne.config")}),t.jsx(U,{className:"form-container",sx:{"> div":{maxWidth:"unset",width:"100%"}},children:t.jsx(hd,{orientation:"vertical",hideSubmitButton:!0,hideDivider:!0,source:"setup",forceValidate:!0,ref:we})})]}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:()=>{we.current.loading||he()},onConfirm:vs,loading:j||we.current?.loading,disabled:j||we.current?.loading}),re&&O?.hasEnvironmentsStep&&_e.push({key:"environment",name:t.jsxs(t.Fragment,{children:[y("common.environment")," ",O.hasRequiredEnvironments&&t.jsx(ot,{})]}),disabled:!!u||O?.hasMissRequiredConfigs,body:()=>t.jsxs(We,{component:"div",style:{overflowY:"auto"},children:[t.jsx(Tt,{title:y("common.environment"),subTitle:y("blocklet.component.addComponentTip.environment")}),t.jsx(Mo,{style:{marginTop:-12,width:"100%"},schema:O.configsList,defaultValue:O.configsValue,onChange:(q,{action:Y,currentItem:ae,allValues:ue})=>{Y==="confirm"&&de({hasMissRequiredConfigs:oo(O.configsList,ue),configsValue:ue}),Y==="edit"?s(ae):["cancel","confirm"].includes(Y)&&s(null)}})]}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:he,onConfirm:X}),re&&O?.didSpaceIsRequiredSetup&&_e.push({key:"didSpace",name:t.jsxs(t.Fragment,{children:[y("blocklet.component.didSpaceConfig")," ",O.didSpaceIsRequiredSetup==="required"&&t.jsx(ot,{})]}),disabled:O?.didSpaceIsRequiredSetup&&!O.didSpaceEndpoint,body:()=>t.jsx(aa,{children:t.jsxs(We,{component:"div",children:[t.jsx(Tt,{title:y("blocklet.component.didSpaceConfig"),subTitle:y("blocklet.component.didSpaceConfigTip")}),t.jsx(U,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:t.jsx($o,{blockletMeta:g.current.meta,onNext:()=>{X()},onEndpointUpdate:Ve})})]})}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:he,onConfirm:X}),_e.push({key:"install",name:yt(re?.did)?y("common.upgrade"):y("common.install"),disabled:p?!1:Rt(O.installResultProps),loading:p?!1:Rt(O.installResultProps),body:t.jsx(We,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:Rt(O.installResultProps)?t.jsx(ta,{message:t.jsx(wd,{children:y(p?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):t.jsx("div",{style:{marginTop:120},children:t.jsx(yr,{...O.installResultProps})})}),confirm:y("common.complete"),onConfirm:on});const Pe=_e[_]||{},Cs=()=>j||Pe.error||!O.bundleDid?!0:_>1?!O.pathPrefix:!1;return D?t.jsxs(bd,{sx:m?{height:{xs:"calc(100vh - 72px - 32px)",md:"72vh"},"&& .ll-header":{p:3},"&& .MuiDialogContent-root":{p:0},"&& .layout-content":{p:0,pl:{xs:0,md:2},pb:0,"& .filter-bar":{pt:0,pl:2}}}:{width:"100%",height:"100vh"},children:[t.jsx(na,{steps:_e,mode:"memory",children:t.jsx(Ko,{ref:S,meta:re,isMobile:K,onStepChange:q=>{T(q)}})}),t.jsxs(U,{className:"action-bar",children:[Pe.cancel&&t.jsx(Be,{onClick:q=>{q.stopPropagation(),Pe.onCancel()},disabled:_===_e.length-2&&j,color:"inherit",children:Pe.cancel||y("common.cancel")}),Pe.confirm&&t.jsx(Be,{onClick:q=>{q.stopPropagation(),Pe.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:j||(typeof Pe.disabled=="boolean"?Pe.disabled:Cs()),variant:"contained",autoFocus:!0,title:Pe.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:t.jsxs(U,{sx:{display:"flex",alignItems:"center",overflow:"hidden"},children:[(typeof Pe.loading=="boolean"?Pe.loading:j)&&t.jsx(Ce,{style:{marginRight:8},size:16}),t.jsx(U,{component:"span",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Pe.confirm})]})})]})]}):null}os.propTypes={onClose:x.func,mode:x.oneOf(["normal","embed"]),inDialog:x.bool,stores:x.arrayOf(x.string),storeUrl:x.string,resourceType:x.string,resourceDid:x.string,storageKey:x.string,selectedMeta:x.object,showResourcesSwitch:x.bool,showFromUrl:x.bool,enableRunBackground:x.bool,showCategory:x.bool,installFromUrlParams:x.object};const bd=oe(U)`
|
|
365
|
+
`,md=R.forwardRef(rs),hd=(e,n)=>(e?.children||[]).find(r=>r.mountPoint===n)?.meta,gd=e=>e.inStore&&Z.isFreeBlocklet(e)===!1,xd=e=>[ve.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,ve.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes(e?.capabilities?.didSpace),Bn=e=>e?.configs?.find(n=>n.key===ve.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)?.value||null,yd=e=>(e.environments||[]).some(n=>n.required),oo=(e,n)=>e?.some(r=>r.required&&!n[r.key]),vd=({params:e,blocklet:n,t:r})=>{const i=e.title||e.name;return i?(n?.children||[]).find(o=>o.meta.bundleDid===e.bundleDid)?r("blocklet.component.upgradeNext",{name:i}):r("blocklet.component.addNext",{name:i}):r("common.next")},so=({componentDid:e,timeout:n=1e3,manual:r=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:r},"*")},n)};function os({onClose:e=()=>{},mode:n="normal",stores:r=[],resourceType:i="",resourceDid:a="",storageKey:o="",inDialog:f=!0,selectedMeta:c=null,storeUrl:d="",showResourcesSwitch:l=!0,showFromUrl:v=!0,enableRunBackground:p=!0,showCategory:C=!0,installFromUrlParams:m=null}){const{t:y,locale:j}=ce(),[w,E]=R.useState(!1),[u,s]=R.useState(null),[h,b]=R.useState(""),[P,k]=R.useState(""),{api:M,ws:{useSubscription:z},inService:I,info:B}=xe(),{blocklet:D,actions:{refreshBlocklet:L}}=De(),[F,$]=R.useState(null),[H,X]=R.useState(!1),se={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1,isUpload:!1,upgradeDid:""},[O,te]=R.useState(se),[_,T]=R.useState(0),g=R.useRef({}),S=R.useRef({}),N=R.useRef({}),K=go(q=>q.breakpoints.down("md")),ee=di(),[V,ie]=R.useState(!0),{meta:re}=g.current,ne=ca(re),ke=R.useRef(!1),we=R.useRef(null),de=q=>te(Y=>({...Y,...q}));R.useEffect(()=>{if(O.pathPrefix){const{errMsg:q}=Q({...O,pathPrefix:O.pathPrefix,locale:j});b(q)}},[O.pathPrefix]),R.useEffect(()=>{_===0&&te(se)},[_]);const Ve=()=>{const q=Bn(D)??"";de({didSpaceEndpoint:q})},Ye=()=>g?.current?.meta?Z.getDisplayName(g.current):"",at=()=>{E(!1),te({}),ke.current=!1,g.current={},e()},Ze=q=>{const Y=ae=>{de({installResultProps:{variant:"error",title:Ye(),subTitle:q,footer:t.jsx(Be,{className:"bottom-button",disabled:ae,"data-cy":"retry-install-component",onClick:async()=>{Y(!0),await A(g.current.installInput)},children:t.jsxs(U,{sx:{display:"flex",alignItems:"center"},children:[ae&&t.jsx(Ce,{size:16,style:{marginRight:8}}),y("common.retry")]})})}})};Y()},Qe=q=>Y=>{(Y?.meta?.did||Y?.meta)===D?.meta?.did&&q(Y)},on=()=>{so({timeout:0,componentDid:ee.componentDid,manual:!0}),at(),setTimeout(()=>{const q=document.getElementsByClassName("dashboard-main")[0];q&&(q.scrollTop=q.scrollHeight)},200)};z(ve.BlockletEvents.componentInstalled,Qe(()=>{de({installResultProps:{variant:"success",title:Ye(),subTitle:y("blocklet.component.installSuccessTip")}}),so({componentDid:ee.componentDid})}),[D?.meta?.did]),z(ve.BlockletEvents.statusChange,Qe(()=>{const q=Bn(D);de(Y=>({...Y,didSpaceEndpoint:q}))}),[D?.meta?.did]),z(ve.BlockletEvents.downloadFailed,Qe(()=>{ke.current=!1,Ze(y("blocklet.component.installComponentError"))}),[D?.meta?.did]),z(ve.BlockletEvents.installFailed,Qe(()=>{ke.current=!1,Ze(y("blocklet.component.installComponentError"))}),[D?.meta?.did]);const _e=[],yt=q=>(D?.children||[]).find(Y=>Y.meta.did===q),A=async q=>{ke.current=!0;const{pathPrefix:Y,bundleDid:ae,title:ue,componentName:Te="",componentDid:qe=""}=O,Ge=g.current?.meta||{},{configs:Xe=[],registryUrl:Ue,inStore:Je,inputUrl:lt,dist:an}=Ge,Ct=g.current?.downloadTokenList,bt=lt||(Je?pr(Ue,ae,an):"");E(!0);const Re={rootDid:D.meta.did,url:bt,mountPoint:Y?Le.urlPathFriendly(Y):`/${Le.urlPathFriendly(Ge.title||Ge.name)}`,title:ue,name:Te,did:O.isUpload&&O.upgradeDid?O.upgradeDid:qe,dist:{tarball:"",integrity:""},onlyRequired:!V,...O.hasEnvironmentsStep&&Xe.length>0?{configs:Xe.map(Ae=>({...Ae,value:O.configsValue[Ae.key]||""}))}:{},...Ct?{downloadTokenList:Ct}:{},...q};try{if(await M.installComponent({input:Re}),Ue){const{teamDid:Ae,storeList:$e}=co({fromBlocklet:I,nodeInfo:B,blocklet:D}),{isNew:ct,decoded:jt}=fi(Ue,$e);ct&&M.addBlockletStore({input:{teamDid:Ae,url:jt}}).catch(ln=>{console.error("addBlockletStore error: ",ln)})}de({installResultProps:{}}),L({showError:!1,attachRuntimeInfo:!1})}catch(Ae){const $e=ge(Ae);G.error($e),console.error("installComponent error: ",Ae),Ze($e)}finally{E(!1),g.current.installInput=Re}},Q=q=>{const Y=ko({params:{...q,did:q.bundleDid},blocklets:[D],blocklet:D,locale:j,isUpload:O.isUpload});let ae=Y;const ue=hd(D,O.pathPrefix);if(Y==="overwrite"&&ue&&ue.did!==q.bundleDid?(de({upgradeDid:ue.did}),ae=""):(de({upgradeDid:""}),ae=Y),ae){const Te=yt(q.bundleDid),qe=va({params:{...q,did:q.bundleDid},blocklet:D});if(Te&&Te.mountPoint===qe)return{errMsg:""}}return{errMsg:ae}},J=async q=>{const{errMsg:Y}=Q({...O,locale:j});b(Y),_===_e.length-2&&!ke.current&&await A(q),S.current?.setActiveStepByIndex?.(ae=>ae+1)},he=()=>{S.current?.setActiveStepByIndex?.(q=>q-1)},vt=()=>{const{pathPrefix:q,bundleDid:Y,title:ae,componentName:ue="",componentDid:Te=""}=O,{meta:qe={}}=g.current||{},{registryUrl:Ge,inStore:Xe,inputUrl:Ue,dist:Je}=qe,lt=Xe?pr(Ge,Y,Je):Ue;$({meta:qe,installOpts:{type:"component",rootDid:D.meta.did,mountPoint:q,url:lt,title:ae,name:ue,did:Te}})},or=q=>{X(!1),de({purchaseResultProps:{variant:"error",title:Ye(),subTitle:q,style:{paddingTop:120},footer:t.jsx(Be,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{de({purchaseResultProps:{}})},children:y("common.retry")})}})},ys=({downloadTokenList:q})=>{g.current.downloadTokenList=q,X(!1),J()},sn=({chooseParams:q=g.current,componentDid:Y,isInit:ae=!1,isUpload:ue=!1})=>{const{meta:Te,registryUrl:qe,inStore:Ge,inputUrl:Xe}=q,{did:Ue,title:Je,name:lt}=Te,an=(D.settings?.children||[]).filter(Ie=>Ie.status==="deleted"&&Ie.meta.bundleDid===Ue),Ct=Y||"",bt=Te.environments?.map(Ie=>{const{name:cn,validation:wt,..._t}=Ie,dn={validation:Wn(wt)?"":wt};return{..._t,key:cn,...dn}});g.current={...q,meta:{...Te,configs:bt,registryUrl:qe,inStore:Ge,inputUrl:Xe}};let Re={};if(ae){const Ie=[D],cn=bt||[],wt=[],_t=uo(pi([...cn,...wt]),"key").filter(et=>!!et.key).sort((et,St)=>et.required&&!St.required?-1:St.required&&!et.required?1:0),dn=Z.getSharedConfigObj(Ie[0],{configs:_t}),un={},sr=_t.map(et=>{const{default:St,key:Et,...js}=et;return un[Et]=dn[Et]||St,{...js,key:Et,hidden:!!ve.BLOCKLET_CONFIGURABLE_KEY[Et]}});Re={...Re,configsList:sr,configsValue:un,hasMissRequiredConfigs:oo(sr,un)}}const Ae=D.children.some(Ie=>Ie.mountPoint==="/"),$e=an.find(Ie=>Ie.meta.bundleDid===Ue),ct=D.children.find(Ie=>Ie.meta.bundleDid===Ue);Re.title=Je||"",$e?Re={...Re,pathPrefix:$e.mountPoint||"",componentName:$e.meta.name,hasEnvironmentsStep:!1}:ct?Re={...Re,pathPrefix:ct.mountPoint||"",componentName:ct.meta.name,hasEnvironmentsStep:!1}:Re={...Re,pathPrefix:Ae?`/${Le.urlPathFriendly(Je)||Le.urlPathFriendly(lt)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:g.current.meta?.environments?.length>0};const jt=gd(g.current.meta),ln=xd(g.current.meta),bs=Bn(D);de({bundleDid:Ue,componentDid:Ct,...Re,hasRequiredEnvironments:yd(g.current.meta),requirePurchase:jt,didSpaceIsRequiredSetup:ln,didSpaceEndpoint:bs,isUpload:ue}),ae&&jt&&vt()},vs=async()=>{if(!we.current.loading)try{E(!0),await we.current.onSubmit()&&J()}catch(q){console.error("error",q)}finally{E(!1)}};R.useEffect(()=>{if(!c&&!m?.meta||_!==0||!D)return;const{meta:q,inputUrl:Y="",inStore:ae=!0,registryUrl:ue="",isUpload:Te=!1}=m||{};sn({chooseParams:{blocklets:[c||q],meta:c||q,registryUrl:ue||d||c.homepage,inStore:ae,inputUrl:Y},isInit:!0,isUpload:Te}),de({showFromUrlDialog:!1}),J()},[c,_,D,m]),_e.push({key:"selectComponent",name:y("blocklet.component.selectComponent"),body:t.jsxs(We,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[v&&O.showFromUrlDialog&&t.jsx(Eo,{mode:"component",onCancel:()=>{de({showFromUrlDialog:!1})},onSuccess:({meta:q,inputUrl:Y,inStore:ae,registryUrl:ue})=>{sn({chooseParams:{meta:q,inputUrl:Y,inStore:ae,registryUrl:ue},isInit:!0}),de({showFromUrlDialog:!1}),J()},handleText:{title:y("blocklet.component.addComponentTip.fromUrl"),confirm:y("blocklet.component.choose")}}),t.jsx(Wo,{stores:r,extra:jo.isInServerlessMode(B)?null:v?t.jsxs(Be,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{de({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[t.jsx(Xt,{style:{fontSize:20,marginRight:4}}),y("blocklet.component.addComponentTip.fromUrl")]}):null,loading:w,onChange:()=>{te({}),g.current={}},storageKey:o,children:({currentRegistry:q})=>t.jsx(Go,{showResourcesSwitch:l,showCategory:C,serverVersion:B?.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:q.url,resourceType:i,resourceDid:a,handleButtonClick:Y=>{sn({chooseParams:{...Y,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:Y,defaultRender:ae})=>{const ue=O?.bundleDid&&O?.bundleDid===Y?.did;return t.jsxs(bd,{children:[t.jsx(U,{className:ue?"choose-blocklet":"",sx:{"& > div":{position:"relative","&:before, &:after":{content:'""',position:"absolute",width:"0",height:"0",opacity:0,transition:"width 0.3s, height 0.3s, opacity 0.3s",borderRadius:"8px",pointerEvents:"none",...ue?{width:"100%",height:"100%",opacity:1}:{}},"&:before":{top:0,left:0,borderTop:"1px solid",borderLeft:"1px solid",borderColor:"primary.main"},"&:after":{bottom:0,right:0,borderBottom:"1px solid",borderRight:"1px solid",borderColor:"primary.main"},"&:hover":{"&:before, &:after":{width:"100%",height:"100%",opacity:1}}}},style:{marginLeft:16},children:ae}),ue&&t.jsx(U,{className:"check-container",children:t.jsx(ui,{className:"check-icon"})})]})}})})]}),cancel:n==="embed"?void 0:y("common.cancel"),confirm:vd({params:O,blocklet:D,t:y}),onCancel:at,onConfirm:()=>{J()}}),_e.push({key:"agreement",name:y("launchBlocklet.introduction"),body:t.jsxs(We,{component:"div",className:"agreement-wrapper",children:[t.jsx(Ln,{title:y("launchBlocklet.introduction"),subTitle:y("blocklet.component.addComponentTip.introduction")}),re?t.jsx(da,{meta:re,onClickNext:J,installRelated:V,onChangeInstallRelated:ie,handleDescEle:t.jsx("p",{children:y("blocklet.component.addComponentTip.belowInformation")})}):null]}),cancel:c?void 0:y("common.pre"),disabled:!ne,confirm:y(ne?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:c?at:he,onConfirm:()=>{X(!1),J()}}),re&&O.requirePurchase&&_e.push({key:"purchase",name:t.jsxs(t.Fragment,{children:[y("common.verifyNFT"),t.jsx(ot,{})]}),body:t.jsxs(We,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(N.current?.getCurrentStep?.()===2||H)&&t.jsx(Tt,{title:y("common.verifyNFT"),subTitle:y("blocklet.component.addComponentTip.verifyNFT")}),Rt(O.purchaseResultProps)?F&&t.jsx(Fo,{ref:N,meta:F.meta,mode:O.componentDid?"verify":"both",onCancel:or,installOpts:F.installOpts,handlePaySuccess:ys}):t.jsx("div",{className:"flex-align-center flex-justify-center",children:t.jsx(yr,{...O.purchaseResultProps})})]}),disabled:N.current?.getCurrentStep?.()===2||H,cancel:y("common.pre"),confirm:y("common.next"),onConfirm:()=>{typeof N.current.onNext=="function"&&(N.current.onNext(),X(!0))},onCancel:()=>{he()}}),Z.hasStartEngine(re)&&_o.hasMountPoint(re)?_e.push({key:"config",name:y("common.config"),error:h,body:t.jsxs(We,{component:"div",children:[t.jsx(Tt,{title:y("common.config"),subTitle:y("blocklet.component.addComponentTip.config")}),t.jsx(ye,{label:y("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",fullWidth:!0,helperText:P||y("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:O.pathPrefix,onChange:q=>{const Y=q.target.value;de({pathPrefix:Y}),k(y("common.slugifyHint",{value:Hn(Y)}))},slotProps:{htmlInput:{"data-cy":"mount-point-input"}}}),!!h&&t.jsx(On,{severity:"error",style:{width:"100%",marginTop:8},children:h})]}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:he,onConfirm:()=>{J()}}):re&&(O.pathPrefix=re.interfaces?.[0]?.path||`/${re.did}`),re&&re?.requirements?.aigne&&_e.push({key:"aigne",name:t.jsxs(le,{component:"div",title:y("setting.aigne.config"),sx:{whiteSpace:"break-spaces"},children:[y("setting.aigne.config")," ",t.jsx(ot,{})]}),body:()=>t.jsxs(We,{component:"div",className:"aigne-config-wrapper",children:[t.jsx(Ln,{title:y("setting.aigne.config")}),t.jsx(U,{className:"form-container",sx:{"> div":{maxWidth:"unset",width:"100%"}},children:t.jsx(md,{orientation:"vertical",hideSubmitButton:!0,hideDivider:!0,source:"setup",forceValidate:!0,ref:we})})]}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:()=>{we.current.loading||he()},onConfirm:vs,loading:w||we.current?.loading,disabled:w||we.current?.loading}),re&&O?.hasEnvironmentsStep&&_e.push({key:"environment",name:t.jsxs(t.Fragment,{children:[y("common.environment")," ",O.hasRequiredEnvironments&&t.jsx(ot,{})]}),disabled:!!u||O?.hasMissRequiredConfigs,body:()=>t.jsxs(We,{component:"div",style:{overflowY:"auto"},children:[t.jsx(Tt,{title:y("common.environment"),subTitle:y("blocklet.component.addComponentTip.environment")}),t.jsx(Mo,{style:{marginTop:-12,width:"100%"},schema:O.configsList,defaultValue:O.configsValue,onChange:(q,{action:Y,currentItem:ae,allValues:ue})=>{Y==="confirm"&&de({hasMissRequiredConfigs:oo(O.configsList,ue),configsValue:ue}),Y==="edit"?s(ae):["cancel","confirm"].includes(Y)&&s(null)}})]}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:he,onConfirm:J}),re&&O?.didSpaceIsRequiredSetup&&_e.push({key:"didSpace",name:t.jsxs(t.Fragment,{children:[y("blocklet.component.didSpaceConfig")," ",O.didSpaceIsRequiredSetup==="required"&&t.jsx(ot,{})]}),disabled:O?.didSpaceIsRequiredSetup&&!O.didSpaceEndpoint,body:()=>t.jsx(aa,{children:t.jsxs(We,{component:"div",children:[t.jsx(Tt,{title:y("blocklet.component.didSpaceConfig"),subTitle:y("blocklet.component.didSpaceConfigTip")}),t.jsx(U,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:t.jsx($o,{blockletMeta:g.current.meta,onNext:()=>{J()},onEndpointUpdate:Ve})})]})}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:he,onConfirm:J}),_e.push({key:"install",name:yt(re?.did)?y("common.upgrade"):y("common.install"),disabled:p?!1:Rt(O.installResultProps),loading:p?!1:Rt(O.installResultProps),body:t.jsx(We,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:Rt(O.installResultProps)?t.jsx(ta,{message:t.jsx(jd,{children:y(p?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):t.jsx("div",{style:{marginTop:120},children:t.jsx(yr,{...O.installResultProps})})}),confirm:y("common.complete"),onConfirm:on});const Pe=_e[_]||{},Cs=()=>w||Pe.error||!O.bundleDid?!0:_>1?!O.pathPrefix:!1;return D?t.jsxs(Cd,{sx:f?{height:{xs:"calc(100vh - 72px - 32px)",md:"72vh"},"&& .ll-header":{p:3},"&& .MuiDialogContent-root":{p:0},"&& .layout-content":{p:0,pl:{xs:0,md:2},pb:0,"& .filter-bar":{pt:0,pl:2}}}:{width:"100%",height:"100vh"},children:[t.jsx(na,{steps:_e,mode:"memory",children:t.jsx(Ko,{ref:S,meta:re,isMobile:K,onStepChange:q=>{T(q)}})}),t.jsxs(U,{className:"action-bar",children:[Pe.cancel&&t.jsx(Be,{onClick:q=>{q.stopPropagation(),Pe.onCancel()},disabled:_===_e.length-2&&w,color:"inherit",children:Pe.cancel||y("common.cancel")}),Pe.confirm&&t.jsx(Be,{onClick:q=>{q.stopPropagation(),Pe.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:w||(typeof Pe.disabled=="boolean"?Pe.disabled:Cs()),variant:"contained",autoFocus:!0,title:Pe.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:t.jsxs(U,{sx:{display:"flex",alignItems:"center",overflow:"hidden"},children:[(typeof Pe.loading=="boolean"?Pe.loading:w)&&t.jsx(Ce,{style:{marginRight:8},size:16}),t.jsx(U,{component:"span",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Pe.confirm})]})})]})]}):null}os.propTypes={onClose:x.func,mode:x.oneOf(["normal","embed"]),inDialog:x.bool,stores:x.arrayOf(x.string),storeUrl:x.string,resourceType:x.string,resourceDid:x.string,storageKey:x.string,selectedMeta:x.object,showResourcesSwitch:x.bool,showFromUrl:x.bool,enableRunBackground:x.bool,showCategory:x.bool,installFromUrlParams:x.object};const Cd=oe(U)`
|
|
370
366
|
.action-bar {
|
|
371
367
|
display: flex;
|
|
372
368
|
justify-content: flex-end;
|
|
@@ -384,7 +380,7 @@ import{aF as ze,j as t,ds as ws,gH as _s,iD as Ss,V as ce,bn as ge,K as U,ay as
|
|
|
384
380
|
height: 100%;
|
|
385
381
|
`,Tt=oe(Ln)`
|
|
386
382
|
margin-bottom: 24px;
|
|
387
|
-
`,
|
|
383
|
+
`,bd=oe.div`
|
|
388
384
|
position: relative;
|
|
389
385
|
|
|
390
386
|
.choose-blocklet {
|
|
@@ -428,7 +424,7 @@ import{aF as ze,j as t,ds as ws,gH as _s,iD as Ss,V as ce,bn as ge,K as U,ay as
|
|
|
428
424
|
transition: all ease 0.2s;
|
|
429
425
|
}
|
|
430
426
|
}
|
|
431
|
-
`,
|
|
427
|
+
`,jd=oe.div`
|
|
432
428
|
color: ${e=>e.theme.palette.primary.main};
|
|
433
429
|
.msg-before {
|
|
434
430
|
display: inline-block;
|
|
@@ -436,14 +432,14 @@ import{aF as ze,j as t,ds as ws,gH as _s,iD as Ss,V as ce,bn as ge,K as U,ay as
|
|
|
436
432
|
font-size: 14px;
|
|
437
433
|
margin-right: 6px;
|
|
438
434
|
}
|
|
439
|
-
`;function
|
|
435
|
+
`;function Xn({blocklet:e,showDialog:n,setShowDialog:r,selectedMeta:i=null,showFromUrl:a=!0,installFromUrlParams:o=null}){const{t:f}=ce(),c=go(v=>v.breakpoints.down("md")),{inService:d}=xe(),l=()=>{r(!1)};return n?t.jsx(wd,{title:f("blocklet.component.addWithName",{name:Z.getDisplayName(e)}),maxWidth:!1,fullWidth:!1,PaperProps:{style:c?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(v,p)=>{p!=="backdropClick"&&l()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:t.jsx(os,{selectedMeta:i,onClose:l,storageKey:d?Qi:Xi,showFromUrl:a,installFromUrlParams:o})}):null}Xn.propTypes={selectedMeta:x.object,showDialog:x.bool.isRequired,setShowDialog:x.func.isRequired,blocklet:x.object.isRequired,showFromUrl:x.bool,installFromUrlParams:x.object};const wd=oe(Yt)`
|
|
440
436
|
.ux-dialog_header {
|
|
441
437
|
background-color: ${({theme:e})=>e.palette.background.paper};
|
|
442
438
|
}
|
|
443
439
|
.MuiDialogContent-root {
|
|
444
440
|
background-color: ${({theme:e})=>e.palette.background.paper};
|
|
445
441
|
}
|
|
446
|
-
`;function ss({blocklet:e,children:n=null,disabled:r=!1}){const{t:i}=ce(),[a,o]=R.useState(!1),[m,c]=R.useState({show:!1,params:null}),[d,l]=R.useState({show:!1,params:null}),{getSessionInHeader:v,prefix:p}=ge(),C=h=>{h.stopPropagation(),o(!0)},f=R.useCallback(()=>{c(h=>({...h,show:!0}))},[]),y=R.useCallback((h=!1)=>{c(h?{params:null,show:!1}:b=>({...b,show:!1}))},[]),w=R.useCallback(()=>{l({params:null,show:!0})},[]),j=R.useCallback(h=>{l({params:{...h,inStore:!1,isUpload:!0},show:!1}),h.meta&&o(!0)},[]),E=R.useCallback((h=!1)=>{l(h?{params:null,show:!1}:b=>({...b,show:!1}))},[]),u=R.useCallback(h=>{o(h),h||(y(!0),E(!0))},[y,E]),s=R.useMemo(()=>[t.jsxs(fn.Item,{"data-cy":"add-component-from-url",onClick:f,style:{fontSize:14,color:"primary.main"},children:[t.jsx(Jt,{style:{fontSize:16,marginRight:4}}),i("blocklet.component.addComponentTip.fromUrl")]},"add-component-from-url"),t.jsxs(fn.Item,{"data-cy":"add-component-from-upload",onClick:w,style:{fontSize:14,color:"primary.main"},children:[t.jsx(Ba,{style:{fontSize:16,marginRight:4}}),i("blocklet.component.addComponentTip.fromUpload")]},"add-component-from-upload")],[w,f,i]);return t.jsxs(t.Fragment,{children:[typeof n=="function"?n({open:C}):t.jsxs(fn,{onClick:C,disabled:r,size:"small",menuButtonProps:{"data-cy":"add-component-more"},menu:s,children:[t.jsx(Fi,{style:{fontSize:"1.3em",marginRight:4}}),i("blocklet.component.add")]}),t.jsx(Jn,{showDialog:a,setShowDialog:u,blocklet:e,selectedMeta:m.params?.meta||d.params?.meta||null,installFromUrlParams:m.params||d.params,showFromUrl:!1}),m.show?t.jsx(Eo,{mode:"component",onCancel:y,onSuccess:({meta:h,inputUrl:b,inStore:P,registryUrl:k})=>{c({show:!1,params:{meta:h,inputUrl:b,inStore:P,registryUrl:k}}),o(!0)},handleText:{title:i("blocklet.component.addComponentTip.fromUrl"),confirm:i("blocklet.component.choose")}}):null,t.jsx(No,{open:d.show,did:e.meta.did,prefix:p,headers:v,onUploaded:j,onClose:E})]})}ss.propTypes={children:x.any,blocklet:x.object.isRequired,disabled:x.bool};const Sd=e=>e.children.filter(n=>n.meta.interfaces.find(r=>r.type===ve.BLOCKLET_INTERFACE_TYPE_WEB));function Xn({params:e={},setParams:n=()=>{},setError:r=()=>{},serviceTypes:i=[{name:"Redirect",value:W.ROUTING_RULE_TYPES.REDIRECT},{name:"Default - User will see the 404 page",value:W.ROUTING_RULE_TYPES.NONE},{name:"Rewrite - Route traffic without redirect",value:W.ROUTING_RULE_TYPES.GENERAL_REWRITE},{name:"Response - Response with provided content",value:W.ROUTING_RULE_TYPES.DIRECT_RESPONSE},{name:"Component - Pass traffic to blocklet component",value:W.ROUTING_RULE_TYPES.COMPONENT}]}){const{t:a}=ce(),{blocklet:o}=De(),m=o.meta.did,c=Sd(o),[d,l]=R.useState([]),v={301:a("common.redirectPermanently"),302:a("common.redirectTemporary"),307:a("common.redirectTemporary"),308:a("common.redirectPermanently")};return R.useEffect(()=>{if(e.type===W.ROUTING_RULE_TYPES.COMPONENT&&e.componentId){const p=c.find(y=>y.meta.did===e.componentId),C=Q.findWebInterface(p.meta),f=(Array.isArray(C?.pageGroups)?C.pageGroups:[]).map(y=>({value:y,label:`${y} pages`}));f.length&&f.unshift({value:"",label:"All pages"}),l(f),e.pageGroup&&f.find(y=>y.value===e.pageGroup)===!1&&n({...e,pageGroups:""})}},[e.componentId,e.type]),t.jsxs(t.Fragment,{children:[t.jsx(xe,{select:!0,label:a("router.domain.add.type"),autoComplete:"off",variant:"outlined",name:"type","data-cy":"domain-add-type",fullWidth:!0,value:e.type,onChange:p=>{r(""),n({...e,type:p.target.value,did:p.target.value===W.ROUTING_RULE_TYPES.BLOCKLET?m:"",__disableConfirm:!1})},style:{marginBottom:32},slotProps:{select:{}},children:i.map(({name:p,value:C})=>t.jsx(Ne,{value:C,children:p},C))}),e.type===W.ROUTING_RULE_TYPES.REDIRECT&&[t.jsx(xe,{select:!0,label:a("router.domain.add.redirect"),autoComplete:"off",variant:"outlined",name:"type",fullWidth:!0,value:e.redirectCode,onChange:p=>n({...e,redirectCode:p.target.value}),style:{marginBottom:32},slotProps:{select:{}},children:Object.keys(v).map(p=>t.jsx(Ne,{value:p,children:`${v[p]} - ${p}`},p))},"redirectCode"),t.jsx(xe,{label:a("common.redirectUrl"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:e.url,helperText:a("router.urlHelperText"),style:{marginBottom:32},onChange:p=>{n({...e,url:p.target.value,__disableConfirm:!p.target.value.trim()}),p.target.value.trim()?r(""):r(a("router.validation.redirectUrlRequired"))},slotProps:{htmlInput:{"data-cy":"redirect-url-input"}}},"redirectUrl")],e.type===W.ROUTING_RULE_TYPES.COMPONENT&&[t.jsx(xe,{select:!0,label:a("router.domain.add.component"),autoComplete:"off",variant:"outlined","data-cy":"select-component-input",name:"componentId",fullWidth:!0,value:e.componentId,onChange:p=>{n({...e,componentId:p.target.value})},style:{marginBottom:32},slotProps:{select:{}},children:c.map(p=>t.jsx(Ne,{value:p.meta.did,selected:p.meta.did===e.componentId,children:Q.getDisplayName(p,!0)},p.meta.did))},"componentId"),d.length?t.jsx(xe,{select:!0,label:a("router.domain.add.pageGroup"),autoComplete:"off",variant:"outlined",name:"pageGroup","data-cy":"route-group-input",fullWidth:!0,value:e.pageGroup,helperText:a("router.domain.add.pageGroupTip"),style:{marginBottom:32},onChange:p=>{n({...e,pageGroup:p.target.value})},slotProps:{select:{}},children:d.map(p=>t.jsx(Ne,{value:p.value,selected:p.value===e.pageGroup,children:p.label},p.label))},"pageGroup"):null].filter(Boolean),e.type===W.ROUTING_RULE_TYPES.GENERAL_REWRITE&&t.jsx(xe,{label:a("common.rewriteUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"rewrite-url-input",fullWidth:!0,value:e.url,helperText:a("router.urlHelperText"),style:{marginBottom:32},onChange:p=>{const C=p.target.value.trim();n({...e,url:p.target.value,__disableConfirm:!C}),r(C?"":a("router.validation.rewriteUrlRequired"))}},"url"),e.type===W.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&[t.jsx(xe,{select:!0,label:a("router.rule.add.responseType"),autoComplete:"off",variant:"outlined",name:"responseType",fullWidth:!0,value:e.responseType,onChange:p=>n({...e,responseType:p.target.value}),style:{marginBottom:32},slotProps:{select:{}},children:W.ROUTING_RESPONSE_TYPES.map(p=>t.jsx(Ne,{value:p.value,children:p.text},p.value))},"responseType"),t.jsx(xe,{label:a("router.rule.add.responseBody"),autoComplete:"off",variant:"outlined",name:"responseBody","data-cy":"response-body-input",fullWidth:!0,multiline:!0,minRows:3,value:e.responseBody,helperText:a("router.rule.add.responseBodyTip"),style:{marginBottom:32},onChange:p=>{const C=p.target.value.trim();n({...e,responseBody:p.target.value,__disableConfirm:!C}),r(C?"":a("router.rule.add.responseBodyRequired"))}},"response-body")]]})}Xn.propTypes={params:x.object,serviceTypes:x.array,setParams:x.func,setError:x.func};function is({children:e=null,hiddenChildren:n=!1,open:r=!1,onClose:i=null}){const{t:a}=ce(),{api:o}=ge(),{blocklet:m}=De(),[c,d]=R.useState(!1),[l,v]=R.useState(!1),p=m.meta.did,C=m.site.id,f=()=>{i?.(),d(!1),v(!1)},y=async u=>{try{const s=await Kt(u,a);if(s)throw s;d(!0);const h={from:{pathPrefix:Le.urlPathFriendly(u.pathPrefix)},to:{type:u.type}};u.type===W.ROUTING_RULE_TYPES.REDIRECT&&(h.to.url=u.url.trim(),h.to.redirectCode=u.redirectCode),u.type===W.ROUTING_RULE_TYPES.COMPONENT&&(h.to.did=p,h.to.componentId=u.componentId,h.to.pageGroup=u.pageGroup),u.type===W.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(h.to.url=Le.urlPathFriendly(u.url)),u.type===W.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(h.to.response={status:200,contentType:u.responseType,body:u.responseBody}),await o.addRoutingRule({input:{id:C,rule:h,teamDid:p}}),i?.()}catch(s){G.error(s.message)}finally{d(!1),v(!1)}},w={title:a("router.rule.add.title"),description:(u,s,h)=>{const b=P=>{if(h(null),Kt(P,a)){s({...P,__disableConfirm:!0});return}s({...P})};return t.jsxs(le,{component:"div",children:[t.jsx(xe,{label:a("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",fullWidth:!0,autoFocus:!0,helperText:u.pathPrefixHint||a("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:u.pathPrefix,onChange:P=>{let k=!1;const M=ko({params:{...u,pathPrefix:P.target.value},blocklets:[m]});h(M),u.type===W.ROUTING_RULE_TYPES.BLOCKLET&&M&&(k=!0),u.type===W.ROUTING_RULE_TYPES.REDIRECT&&!u.url&&(k=!0),u.type===W.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!u.url&&(k=!0),u.type===W.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!u.responseType||!u.responseBody)&&(k=!0),P.target.value.trim()||(k=!0,h(a("router.validation.pathPrefixRequired"))),k||h("");const F=a("common.slugifyHint",{value:Hn(P.target.value)});s({...u,pathPrefix:P.target.value,pathPrefixHint:F,__disableConfirm:k})},slotProps:{htmlInput:{"data-cy":"path-prefix-input"}}}),t.jsx(Xn,{params:u,setParams:b,setError:h})]})},confirm:a("router.rule.add.confirm"),cancel:a("common.cancel"),params:{did:"",pathPrefix:"",type:W.ROUTING_RULE_TYPES.REDIRECT,componentId:"",pageGroup:"",redirectCode:302,responseType:"text/plain",responseBody:"",__disableConfirm:!0},onConfirm:y,onCancel:f},j=u=>{u.stopPropagation(),v(!0)};let E=null;return n||(E=typeof e=="function"?e({open:j}):t.jsxs(Ne,{onClick:j,className:"rule-action","data-cy":"action-add-rule",children:[c?t.jsx(Ce,{size:16}):t.jsx(Jt,{style:{fontSize:18,marginRight:5}}),a("router.rule.add.title")]})),t.jsxs(t.Fragment,{children:[E,(r||l)&&t.jsx(it,{title:w.title,description:w.description,confirm:w.confirm,cancel:w.cancel,params:w.params,onConfirm:w.onConfirm,onCancel:w.onCancel,color:"primary"})]})}is.propTypes={children:x.any,onClose:x.func,hiddenChildren:x.bool,open:x.bool};function rn({depth:e=1,className:n=""}){return t.jsx(U,{className:n,sx:{ml:Math.max((e-1)*2,0),borderBottom:1,borderColor:"rgba(0,0,0,0.12)"}},"group-collapse-box")}rn.propTypes={depth:x.number,className:x.string};function as({id:e,from:n,children:r=null}){const{t:i}=ce(),{api:a}=ge(),{blocklet:o}=De(),[m,c]=R.useState(!1),[d,l]=R.useState(null),v=o.meta.did,p=o.site.id,C=n.pathPrefix,f=()=>{c(!1),l(null)},y=async()=>{c(!0);try{await a.deleteRoutingRule({input:{id:p,ruleId:e,teamDid:v}})}catch(E){G.error(E.message)}finally{l(null),c(!1)}},w={keyName:C,title:i("router.rule.delete.title"),description:i("router.rule.delete.description",{name:`<b>${C}</b>`}),confirmPlaceholder:i("router.rule.delete.confirm_desc",{name:C}),confirm:i("common.delConfirm"),cancel:i("router.rule.delete.cancel"),onConfirm:y,onCancel:f},j=E=>{E.stopPropagation(),l(w)};return t.jsxs(t.Fragment,{children:[typeof r=="function"?r({loading:m,open:j}):t.jsxs(Ne,{onClick:j,className:"rule-action","data-cy":"action-delete-rule",children:[m?t.jsx(Ce,{size:16}):t.jsx(tn,{style:{fontSize:18,marginRight:5}}),i("router.rule.delete.title")]}),d&&t.jsx(Sa,{keyName:d.keyName,title:d.title,description:d.description,confirmPlaceholder:d.confirmPlaceholder,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}as.propTypes={id:x.string.isRequired,from:x.object.isRequired,children:x.any};function ls({id:e,from:n,to:r,children:i=null}){const{t:a}=ce(),{api:o}=ge(),{blocklet:m}=De(),[c,d]=R.useState(!1),[l,v]=R.useState(null),p=m.meta.did,C=m.site.id,f=n.pathPrefix,y=()=>{d(!1),v(null)},w=async u=>{try{const s=await Kt(u,a);if(s)throw s;d(!0);const h={id:e,from:{pathPrefix:Le.urlPathFriendly(u.pathPrefix)},to:{type:u.type}};u.type===W.ROUTING_RULE_TYPES.REDIRECT&&(h.to.url=u.url,h.to.redirectCode=u.redirectCode),u.type===W.ROUTING_RULE_TYPES.COMPONENT&&(h.to.did=p,h.to.componentId=u.componentId,h.to.pageGroup=u.pageGroup),u.type===W.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(h.to.url=Le.urlPathFriendly(u.url)),u.type===W.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(h.to.response={status:200,contentType:u.responseType,body:u.responseBody}),await o.updateRoutingRule({input:{id:C,rule:h,teamDid:p}})}catch(s){G.error(s.message)}finally{d(!1),v(null)}},j={title:a("router.rule.update.title"),description:(u,s,h)=>{const b=P=>{if(Kt(P,a)){s({...P,__disableConfirm:!0});return}s({...P})};return t.jsxs(le,{component:"div",children:[t.jsx(xe,{label:a("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",fullWidth:!0,autoFocus:!0,helperText:u.helperText||a("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:u.pathPrefix,onChange:P=>{let k=!1;u.type===W.ROUTING_RULE_TYPES.REDIRECT&&!u.url&&(k=!0),u.type===W.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!u.url&&(k=!0),u.type===W.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!u.responseType||!u.responseBody)&&(k=!0),P.target.value.trim()||(k=!0,h(a("router.validation.pathPrefixRequired"))),k||h("");const M=a("common.slugifyHint",{value:Hn(P.target.value)});s({...u,pathPrefix:P.target.value,helperText:M,__disableConfirm:k})},slotProps:{htmlInput:{"data-cy":"path-prefix-input"}}}),t.jsx(Xn,{params:u,setParams:b,setError:h})]})},confirm:a("router.rule.update.confirm"),cancel:a("router.rule.update.cancel"),color:"primary",params:{did:r.did||"",pathPrefix:f==="/"?f:f.replace(/^\/+/,"").replace(/\/+$/,""),type:r.type||W.ROUTING_RULE_TYPES.BLOCKLET,redirectCode:r.redirectCode||302,componentId:r.componentId||"",pageGroup:r.pageGroup||"",url:r.url||"",responseType:r.response?.contentType||"",responseBody:(r.response?.body||"").replace(/\\"/g,'"'),__disableConfirm:!1},onConfirm:w,onCancel:y},E=u=>{u.stopPropagation(),v(j)};return t.jsxs(t.Fragment,{children:[typeof i=="function"?i({loading:c,open:E}):t.jsxs(Ne,{onClick:E,className:"rule-action","data-cy":"action-update-rule",children:[c?t.jsx(Ce,{size:16}):t.jsx(Co,{style:{fontSize:18,marginRight:5}}),a("router.rule.update.title")]}),l&&t.jsx(it,{title:l.title,description:l.description,confirm:l.confirm,color:l.color,cancel:l.cancel,params:l.params,onConfirm:l.onConfirm,onCancel:l.onCancel})]})}ls.propTypes={id:x.string.isRequired,from:x.object.isRequired,to:x.object.isRequired,children:x.any};function cs({from:e,isProtected:n=!1,...r}){const{locale:i}=ce(),{blocklet:a,recommendedDomain:o}=De(),m=xo(o,e.pathPrefix,Gn(a,i));return t.jsxs(U,{sx:{display:"flex",alignItems:"center"},children:[t.jsx(U,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:m,rel:"noopener noreferrer",title:m,children:t.jsx(me,{size:"small",children:t.jsx(To,{})})}),t.jsx(ls,{...r,isProtected:n,from:e,children:({open:c})=>t.jsx(me,{size:"small",onClick:c,disabled:n,"data-cy":"action-update-rule",children:t.jsx(Ai,{})})}),t.jsx(as,{...r,isProtected:n,from:e,children:({open:c})=>t.jsx(me,{size:"small",onClick:c,disabled:n,"data-cy":"action-delete-rule",children:t.jsx(tn,{})})})]})}cs.propTypes={isProtected:x.bool};function ds({group:e,...n}){return e?t.jsx(ht,{type:"reverse",...n,children:e}):null}ds.propTypes={group:x.string.isRequired};function Fn({domain:e,isHttps:n=!1,toUrl:r}){const i=n?"https":"http";let a=r;return gi(a)||(a=`${i}://${e}${r}`),t.jsx(xt,{href:a,target:"_blank",style:{fontSize:14},underline:"hover",children:r},a)}Fn.propTypes={domain:x.string.isRequired,toUrl:x.string.isRequired,isHttps:x.bool};function er({hasPermission:e=!1}){const{t:n,locale:r}=ce(),i=gt(),{blocklet:a,recommendedDomain:o}=De();return a.site.rules.filter(c=>c.to.type!==W.ROUTING_RULE_TYPES.BLOCKLET).map(c=>{let d=null,l=null;c.to.type===W.ROUTING_RULE_TYPES.NONE?d="404":c.to.type===W.ROUTING_RULE_TYPES.REDIRECT?d=c.to.redirectCode:c.to.type===W.ROUTING_RULE_TYPES.GENERAL_REWRITE?d="R":c.to.type===W.ROUTING_RULE_TYPES.DIRECT_RESPONSE?d=t.jsx(Ia,{sx:{color:"text.secondary",fontSize:"45px"}}):c.to.type===W.ROUTING_RULE_TYPES.COMPONENT&&(l=a.children.find(p=>p.meta.did===c.to.componentId),d="C");const v=c.isProtected?t.jsx(be,{title:n("blocklet.router.urlLockTooltip"),placement:"top",children:t.jsx("span",{children:t.jsx(me,{disabled:!0,size:"small",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0,margin:"12px 0"},children:t.jsx(wa,{style:{fill:i.palette.text.disabled}})})})}):t.jsx(cs,{...c});return[t.jsxs(U,{className:"component-item",sx:{display:"flex",py:2,justifyContent:"space-between",alignItems:"center"},children:[t.jsxs(U,{sx:{width:{xs:300,md:400},display:"flex",alignItems:"center"},children:[t.jsx(U,{className:"component-item__indent",sx:{width:28}}),typeof d=="object"?d:t.jsx(mi,{children:d}),t.jsxs(U,{sx:{ml:2,flex:1,wordBreak:"break-word"},children:[t.jsxs(U,{style:{color:"text.primary",fontSize:16},children:[c.to.type===W.ROUTING_RULE_TYPES.NONE&&n("common.page404"),c.to.type===W.ROUTING_RULE_TYPES.REDIRECT&&n("common.redirect"),c.to.type===W.ROUTING_RULE_TYPES.GENERAL_REWRITE&&n("common.rewrite"),c.to.type===W.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&W.ROUTING_RESPONSE_TYPES.find(p=>p.value===c.to.response.contentType)?.text,c.to.type===W.ROUTING_RULE_TYPES.COMPONENT&&Q.getDisplayName(l,!0)]}),t.jsxs(U,{sx:{display:"flex",alignItems:"center"},children:[c.to.type===W.ROUTING_RULE_TYPES.REDIRECT&&t.jsx(Fn,{domain:o,toUrl:c.to.url}),c.to.type===W.ROUTING_RULE_TYPES.GENERAL_REWRITE&&t.jsx(Fn,{domain:o,toUrl:c.to.url}),c.to.type===W.ROUTING_RULE_TYPES.COMPONENT&&t.jsx(ds,{group:c.to.pageGroup})]})]})]}),t.jsx(U,{sx:{px:2,alignItems:"center",flexGrow:"1",display:{xs:"none",md:"flex"}},children:t.jsx(xt,{href:xo(o,c.from.pathPrefix,Gn(a,r)),target:"_blank",style:{fontSize:16,color:"inherit"},underline:"hover",children:hi(c.from.pathPrefix,"/")||"/"})},c.from.pathPrefix),t.jsx(U,{children:e&&t.jsx("div",{style:{textAlign:"right"},children:v})},"actions")]},"rule"),t.jsx(rn,{},"divider")]})}er.propTypes={hasPermission:x.bool};const Ed=Qt(er,"mutate_blocklets"),kd=Qt(er,"",ft);function Rd(e){const{inService:n}=ge();return n?t.jsx(kd,{...e}):t.jsx(Ed,{...e})}function Pd(e,n){const r=R.useRef(n);R.useEffect(()=>{const i=a=>r.current(a.detail);return window.addEventListener(e,i),()=>window.removeEventListener(e,i)},[e])}function Td(e){const n=yo(),{t:r}=ce(),i=()=>{const a=new URLSearchParams(window.location.search);a.get("checkUpdate")&&(a.delete("checkUpdate"),n(a.toString()),e(),G.success(r("notification.checkingForUpdates")))};R.useEffect(i,[]),Pd("checkUpdate",i)}function Id({blocklet:e,scrollToComponent:n}={blocklet:null,scrollToComponent:!1}){const r=yo(),{t:i}=ce(),a=R.useRef(null),o=R.useMemo(()=>{if(!e||!e.optionalComponents)return null;const m=new URLSearchParams(window.location.search),c=m.get("install-component");if(c){a.current=c,m.delete("install-component"),r(m.toString());const d=e.optionalComponents.find(v=>v.meta.did===c);if(!d)return G.success(i("notification.installComponentError",{did:c})),null;const{meta:l}=d;if(n){const v=document.getElementById(`optional-component-${c}`),p=document.querySelector(".dashboard-main");if(v){const C=v.getBoundingClientRect(),f=p.getBoundingClientRect();p.scrollTo({top:C.top-f.top+p.scrollTop,behavior:"smooth"})}}return l}return null},[e,r,i,n]);return R.useEffect(()=>{a.current&&window.opener&&window.opener.postMessage({blocklet:e,kind:"component-installer"},window.blocklet?.appUrl)},[e]),o}function tr({open:e=!1,onClose:n=null,blocklet:r,ancestors:i=[]}){const{t:a}=ce(),o=[...(i||[]).map(l=>l?.meta?.did||""),r?.meta?.did||""].filter(Boolean).join("/"),m=a("preferencesFor",{name:Q.getDisplayName(r,!0)}),c=R.useMemo(()=>({position:"relative",minHeight:"50vh",height:"100%",overflow:"hidden",border:0}),[]);if(st(r.status)||r.status==="unknown"&&st(r.status))return null;const d=()=>{n?.()};return t.jsx(Dd,{open:e,fullWidth:!0,maxWidth:"md",title:m,onClose:d,PaperProps:{style:{minHeight:"500px"}},children:t.jsxs(ao,{sx:{gap:1},children:[t.jsx(le,{sx:{fontSize:12,color:"text.secondary",mb:.5},children:a("description.preferences",{name:Q.getDisplayName(r,!0)})}),t.jsx(Mi,{id:o,styles:c})]})})}tr.propTypes={blocklet:x.object.isRequired,ancestors:x.array,open:x.bool,onClose:x.func};const Dd=oe(Yt)`
|
|
442
|
+
`;function ss({blocklet:e,children:n=null,disabled:r=!1}){const{t:i}=ce(),[a,o]=R.useState(!1),[f,c]=R.useState({show:!1,params:null}),[d,l]=R.useState({show:!1,params:null}),{getSessionInHeader:v,prefix:p}=xe(),C=h=>{h.stopPropagation(),o(!0)},m=R.useCallback(()=>{c(h=>({...h,show:!0}))},[]),y=R.useCallback((h=!1)=>{c(h?{params:null,show:!1}:b=>({...b,show:!1}))},[]),j=R.useCallback(()=>{l({params:null,show:!0})},[]),w=R.useCallback(h=>{l({params:{...h,inStore:!1,isUpload:!0},show:!1}),h.meta&&o(!0)},[]),E=R.useCallback((h=!1)=>{l(h?{params:null,show:!1}:b=>({...b,show:!1}))},[]),u=R.useCallback(h=>{o(h),h||(y(!0),E(!0))},[y,E]),s=R.useMemo(()=>[t.jsxs(fn.Item,{"data-cy":"add-component-from-url",onClick:m,style:{fontSize:14,color:"primary.main"},children:[t.jsx(Xt,{style:{fontSize:16,marginRight:4}}),i("blocklet.component.addComponentTip.fromUrl")]},"add-component-from-url"),t.jsxs(fn.Item,{"data-cy":"add-component-from-upload",onClick:j,style:{fontSize:14,color:"primary.main"},children:[t.jsx(Ba,{style:{fontSize:16,marginRight:4}}),i("blocklet.component.addComponentTip.fromUpload")]},"add-component-from-upload")],[j,m,i]);return t.jsxs(t.Fragment,{children:[typeof n=="function"?n({open:C}):t.jsxs(fn,{onClick:C,disabled:r,size:"small",menuButtonProps:{"data-cy":"add-component-more"},menu:s,children:[t.jsx(zi,{style:{fontSize:"1.3em",marginRight:4}}),i("blocklet.component.add")]}),t.jsx(Xn,{showDialog:a,setShowDialog:u,blocklet:e,selectedMeta:f.params?.meta||d.params?.meta||null,installFromUrlParams:f.params||d.params,showFromUrl:!1}),f.show?t.jsx(Eo,{mode:"component",onCancel:y,onSuccess:({meta:h,inputUrl:b,inStore:P,registryUrl:k})=>{c({show:!1,params:{meta:h,inputUrl:b,inStore:P,registryUrl:k}}),o(!0)},handleText:{title:i("blocklet.component.addComponentTip.fromUrl"),confirm:i("blocklet.component.choose")}}):null,t.jsx(No,{open:d.show,did:e.meta.did,prefix:p,headers:v,onUploaded:w,onClose:E})]})}ss.propTypes={children:x.any,blocklet:x.object.isRequired,disabled:x.bool};const _d=e=>e.children.filter(n=>n.meta.interfaces.find(r=>r.type===ve.BLOCKLET_INTERFACE_TYPE_WEB));function Jn({params:e={},setParams:n=()=>{},setError:r=()=>{},serviceTypes:i=[{name:"Redirect",value:W.ROUTING_RULE_TYPES.REDIRECT},{name:"Default - User will see the 404 page",value:W.ROUTING_RULE_TYPES.NONE},{name:"Rewrite - Route traffic without redirect",value:W.ROUTING_RULE_TYPES.GENERAL_REWRITE},{name:"Response - Response with provided content",value:W.ROUTING_RULE_TYPES.DIRECT_RESPONSE},{name:"Component - Pass traffic to blocklet component",value:W.ROUTING_RULE_TYPES.COMPONENT}]}){const{t:a}=ce(),{blocklet:o}=De(),f=o.meta.did,c=_d(o),[d,l]=R.useState([]),v={301:a("common.redirectPermanently"),302:a("common.redirectTemporary"),307:a("common.redirectTemporary"),308:a("common.redirectPermanently")};return R.useEffect(()=>{if(e.type===W.ROUTING_RULE_TYPES.COMPONENT&&e.componentId){const p=c.find(y=>y.meta.did===e.componentId),C=Z.findWebInterface(p.meta),m=(Array.isArray(C?.pageGroups)?C.pageGroups:[]).map(y=>({value:y,label:`${y} pages`}));m.length&&m.unshift({value:"",label:"All pages"}),l(m),e.pageGroup&&m.find(y=>y.value===e.pageGroup)===!1&&n({...e,pageGroups:""})}},[e.componentId,e.type]),t.jsxs(t.Fragment,{children:[t.jsx(ye,{select:!0,label:a("router.domain.add.type"),autoComplete:"off",variant:"outlined",name:"type","data-cy":"domain-add-type",fullWidth:!0,value:e.type,onChange:p=>{r(""),n({...e,type:p.target.value,did:p.target.value===W.ROUTING_RULE_TYPES.BLOCKLET?f:"",__disableConfirm:!1})},style:{marginBottom:32},slotProps:{select:{}},children:i.map(({name:p,value:C})=>t.jsx(Ne,{value:C,children:p},C))}),e.type===W.ROUTING_RULE_TYPES.REDIRECT&&[t.jsx(ye,{select:!0,label:a("router.domain.add.redirect"),autoComplete:"off",variant:"outlined",name:"type",fullWidth:!0,value:e.redirectCode,onChange:p=>n({...e,redirectCode:p.target.value}),style:{marginBottom:32},slotProps:{select:{}},children:Object.keys(v).map(p=>t.jsx(Ne,{value:p,children:`${v[p]} - ${p}`},p))},"redirectCode"),t.jsx(ye,{label:a("common.redirectUrl"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:e.url,helperText:a("router.urlHelperText"),style:{marginBottom:32},onChange:p=>{n({...e,url:p.target.value,__disableConfirm:!p.target.value.trim()}),p.target.value.trim()?r(""):r(a("router.validation.redirectUrlRequired"))},slotProps:{htmlInput:{"data-cy":"redirect-url-input"}}},"redirectUrl")],e.type===W.ROUTING_RULE_TYPES.COMPONENT&&[t.jsx(ye,{select:!0,label:a("router.domain.add.component"),autoComplete:"off",variant:"outlined","data-cy":"select-component-input",name:"componentId",fullWidth:!0,value:e.componentId,onChange:p=>{n({...e,componentId:p.target.value})},style:{marginBottom:32},slotProps:{select:{}},children:c.map(p=>t.jsx(Ne,{value:p.meta.did,selected:p.meta.did===e.componentId,children:Z.getDisplayName(p,!0)},p.meta.did))},"componentId"),d.length?t.jsx(ye,{select:!0,label:a("router.domain.add.pageGroup"),autoComplete:"off",variant:"outlined",name:"pageGroup","data-cy":"route-group-input",fullWidth:!0,value:e.pageGroup,helperText:a("router.domain.add.pageGroupTip"),style:{marginBottom:32},onChange:p=>{n({...e,pageGroup:p.target.value})},slotProps:{select:{}},children:d.map(p=>t.jsx(Ne,{value:p.value,selected:p.value===e.pageGroup,children:p.label},p.label))},"pageGroup"):null].filter(Boolean),e.type===W.ROUTING_RULE_TYPES.GENERAL_REWRITE&&t.jsx(ye,{label:a("common.rewriteUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"rewrite-url-input",fullWidth:!0,value:e.url,helperText:a("router.urlHelperText"),style:{marginBottom:32},onChange:p=>{const C=p.target.value.trim();n({...e,url:p.target.value,__disableConfirm:!C}),r(C?"":a("router.validation.rewriteUrlRequired"))}},"url"),e.type===W.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&[t.jsx(ye,{select:!0,label:a("router.rule.add.responseType"),autoComplete:"off",variant:"outlined",name:"responseType",fullWidth:!0,value:e.responseType,onChange:p=>n({...e,responseType:p.target.value}),style:{marginBottom:32},slotProps:{select:{}},children:W.ROUTING_RESPONSE_TYPES.map(p=>t.jsx(Ne,{value:p.value,children:p.text},p.value))},"responseType"),t.jsx(ye,{label:a("router.rule.add.responseBody"),autoComplete:"off",variant:"outlined",name:"responseBody","data-cy":"response-body-input",fullWidth:!0,multiline:!0,minRows:3,value:e.responseBody,helperText:a("router.rule.add.responseBodyTip"),style:{marginBottom:32},onChange:p=>{const C=p.target.value.trim();n({...e,responseBody:p.target.value,__disableConfirm:!C}),r(C?"":a("router.rule.add.responseBodyRequired"))}},"response-body")]]})}Jn.propTypes={params:x.object,serviceTypes:x.array,setParams:x.func,setError:x.func};function is({children:e=null,hiddenChildren:n=!1,open:r=!1,onClose:i=null}){const{t:a}=ce(),{api:o}=xe(),{blocklet:f}=De(),[c,d]=R.useState(!1),[l,v]=R.useState(!1),p=f.meta.did,C=f.site.id,m=()=>{i?.(),d(!1),v(!1)},y=async u=>{try{const s=await Kt(u,a);if(s)throw s;d(!0);const h={from:{pathPrefix:Le.urlPathFriendly(u.pathPrefix)},to:{type:u.type}};u.type===W.ROUTING_RULE_TYPES.REDIRECT&&(h.to.url=u.url.trim(),h.to.redirectCode=u.redirectCode),u.type===W.ROUTING_RULE_TYPES.COMPONENT&&(h.to.did=p,h.to.componentId=u.componentId,h.to.pageGroup=u.pageGroup),u.type===W.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(h.to.url=Le.urlPathFriendly(u.url)),u.type===W.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(h.to.response={status:200,contentType:u.responseType,body:u.responseBody}),await o.addRoutingRule({input:{id:C,rule:h,teamDid:p}}),i?.()}catch(s){G.error(s.message)}finally{d(!1),v(!1)}},j={title:a("router.rule.add.title"),description:(u,s,h)=>{const b=P=>{if(h(null),Kt(P,a)){s({...P,__disableConfirm:!0});return}s({...P})};return t.jsxs(le,{component:"div",children:[t.jsx(ye,{label:a("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",fullWidth:!0,autoFocus:!0,helperText:u.pathPrefixHint||a("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:u.pathPrefix,onChange:P=>{let k=!1;const M=ko({params:{...u,pathPrefix:P.target.value},blocklets:[f]});h(M),u.type===W.ROUTING_RULE_TYPES.BLOCKLET&&M&&(k=!0),u.type===W.ROUTING_RULE_TYPES.REDIRECT&&!u.url&&(k=!0),u.type===W.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!u.url&&(k=!0),u.type===W.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!u.responseType||!u.responseBody)&&(k=!0),P.target.value.trim()||(k=!0,h(a("router.validation.pathPrefixRequired"))),k||h("");const z=a("common.slugifyHint",{value:Hn(P.target.value)});s({...u,pathPrefix:P.target.value,pathPrefixHint:z,__disableConfirm:k})},slotProps:{htmlInput:{"data-cy":"path-prefix-input"}}}),t.jsx(Jn,{params:u,setParams:b,setError:h})]})},confirm:a("router.rule.add.confirm"),cancel:a("common.cancel"),params:{did:"",pathPrefix:"",type:W.ROUTING_RULE_TYPES.REDIRECT,componentId:"",pageGroup:"",redirectCode:302,responseType:"text/plain",responseBody:"",__disableConfirm:!0},onConfirm:y,onCancel:m},w=u=>{u.stopPropagation(),v(!0)};let E=null;return n||(E=typeof e=="function"?e({open:w}):t.jsxs(Ne,{onClick:w,className:"rule-action","data-cy":"action-add-rule",children:[c?t.jsx(Ce,{size:16}):t.jsx(Xt,{style:{fontSize:18,marginRight:5}}),a("router.rule.add.title")]})),t.jsxs(t.Fragment,{children:[E,(r||l)&&t.jsx(it,{title:j.title,description:j.description,confirm:j.confirm,cancel:j.cancel,params:j.params,onConfirm:j.onConfirm,onCancel:j.onCancel,color:"primary"})]})}is.propTypes={children:x.any,onClose:x.func,hiddenChildren:x.bool,open:x.bool};function rn({depth:e=1,className:n=""}){return t.jsx(U,{className:n,sx:{ml:Math.max((e-1)*2,0),borderBottom:1,borderColor:"rgba(0,0,0,0.12)"}},"group-collapse-box")}rn.propTypes={depth:x.number,className:x.string};function as({id:e,from:n,children:r=null}){const{t:i}=ce(),{api:a}=xe(),{blocklet:o}=De(),[f,c]=R.useState(!1),[d,l]=R.useState(null),v=o.meta.did,p=o.site.id,C=n.pathPrefix,m=()=>{c(!1),l(null)},y=async()=>{c(!0);try{await a.deleteRoutingRule({input:{id:p,ruleId:e,teamDid:v}})}catch(E){G.error(E.message)}finally{l(null),c(!1)}},j={keyName:C,title:i("router.rule.delete.title"),description:i("router.rule.delete.description",{name:`<b>${C}</b>`}),confirmPlaceholder:i("router.rule.delete.confirm_desc",{name:C}),confirm:i("common.delConfirm"),cancel:i("router.rule.delete.cancel"),onConfirm:y,onCancel:m},w=E=>{E.stopPropagation(),l(j)};return t.jsxs(t.Fragment,{children:[typeof r=="function"?r({loading:f,open:w}):t.jsxs(Ne,{onClick:w,className:"rule-action","data-cy":"action-delete-rule",children:[f?t.jsx(Ce,{size:16}):t.jsx(tn,{style:{fontSize:18,marginRight:5}}),i("router.rule.delete.title")]}),d&&t.jsx(Sa,{keyName:d.keyName,title:d.title,description:d.description,confirmPlaceholder:d.confirmPlaceholder,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}as.propTypes={id:x.string.isRequired,from:x.object.isRequired,children:x.any};function ls({id:e,from:n,to:r,children:i=null}){const{t:a}=ce(),{api:o}=xe(),{blocklet:f}=De(),[c,d]=R.useState(!1),[l,v]=R.useState(null),p=f.meta.did,C=f.site.id,m=n.pathPrefix,y=()=>{d(!1),v(null)},j=async u=>{try{const s=await Kt(u,a);if(s)throw s;d(!0);const h={id:e,from:{pathPrefix:Le.urlPathFriendly(u.pathPrefix)},to:{type:u.type}};u.type===W.ROUTING_RULE_TYPES.REDIRECT&&(h.to.url=u.url,h.to.redirectCode=u.redirectCode),u.type===W.ROUTING_RULE_TYPES.COMPONENT&&(h.to.did=p,h.to.componentId=u.componentId,h.to.pageGroup=u.pageGroup),u.type===W.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(h.to.url=Le.urlPathFriendly(u.url)),u.type===W.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(h.to.response={status:200,contentType:u.responseType,body:u.responseBody}),await o.updateRoutingRule({input:{id:C,rule:h,teamDid:p}})}catch(s){G.error(s.message)}finally{d(!1),v(null)}},w={title:a("router.rule.update.title"),description:(u,s,h)=>{const b=P=>{if(Kt(P,a)){s({...P,__disableConfirm:!0});return}s({...P})};return t.jsxs(le,{component:"div",children:[t.jsx(ye,{label:a("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",fullWidth:!0,autoFocus:!0,helperText:u.helperText||a("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:u.pathPrefix,onChange:P=>{let k=!1;u.type===W.ROUTING_RULE_TYPES.REDIRECT&&!u.url&&(k=!0),u.type===W.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!u.url&&(k=!0),u.type===W.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!u.responseType||!u.responseBody)&&(k=!0),P.target.value.trim()||(k=!0,h(a("router.validation.pathPrefixRequired"))),k||h("");const M=a("common.slugifyHint",{value:Hn(P.target.value)});s({...u,pathPrefix:P.target.value,helperText:M,__disableConfirm:k})},slotProps:{htmlInput:{"data-cy":"path-prefix-input"}}}),t.jsx(Jn,{params:u,setParams:b,setError:h})]})},confirm:a("router.rule.update.confirm"),cancel:a("router.rule.update.cancel"),color:"primary",params:{did:r.did||"",pathPrefix:m==="/"?m:m.replace(/^\/+/,"").replace(/\/+$/,""),type:r.type||W.ROUTING_RULE_TYPES.BLOCKLET,redirectCode:r.redirectCode||302,componentId:r.componentId||"",pageGroup:r.pageGroup||"",url:r.url||"",responseType:r.response?.contentType||"",responseBody:(r.response?.body||"").replace(/\\"/g,'"'),__disableConfirm:!1},onConfirm:j,onCancel:y},E=u=>{u.stopPropagation(),v(w)};return t.jsxs(t.Fragment,{children:[typeof i=="function"?i({loading:c,open:E}):t.jsxs(Ne,{onClick:E,className:"rule-action","data-cy":"action-update-rule",children:[c?t.jsx(Ce,{size:16}):t.jsx(Co,{style:{fontSize:18,marginRight:5}}),a("router.rule.update.title")]}),l&&t.jsx(it,{title:l.title,description:l.description,confirm:l.confirm,color:l.color,cancel:l.cancel,params:l.params,onConfirm:l.onConfirm,onCancel:l.onCancel})]})}ls.propTypes={id:x.string.isRequired,from:x.object.isRequired,to:x.object.isRequired,children:x.any};function cs({from:e,isProtected:n=!1,...r}){const{locale:i}=ce(),{blocklet:a,recommendedDomain:o}=De(),f=xo(o,e.pathPrefix,Gn(a,i));return t.jsxs(U,{sx:{display:"flex",alignItems:"center"},children:[t.jsx(U,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:f,rel:"noopener noreferrer",title:f,children:t.jsx(me,{size:"small",children:t.jsx(To,{})})}),t.jsx(ls,{...r,isProtected:n,from:e,children:({open:c})=>t.jsx(me,{size:"small",onClick:c,disabled:n,"data-cy":"action-update-rule",children:t.jsx(Ai,{})})}),t.jsx(as,{...r,isProtected:n,from:e,children:({open:c})=>t.jsx(me,{size:"small",onClick:c,disabled:n,"data-cy":"action-delete-rule",children:t.jsx(tn,{})})})]})}cs.propTypes={isProtected:x.bool};function ds({group:e,...n}){return e?t.jsx(ht,{type:"reverse",...n,children:e}):null}ds.propTypes={group:x.string.isRequired};function zn({domain:e,isHttps:n=!1,toUrl:r}){const i=n?"https":"http";let a=r;return gi(a)||(a=`${i}://${e}${r}`),t.jsx(xt,{href:a,target:"_blank",style:{fontSize:14},underline:"hover",children:r},a)}zn.propTypes={domain:x.string.isRequired,toUrl:x.string.isRequired,isHttps:x.bool};function er({hasPermission:e=!1}){const{t:n,locale:r}=ce(),i=gt(),{blocklet:a,recommendedDomain:o}=De();return a.site.rules.filter(c=>c.to.type!==W.ROUTING_RULE_TYPES.BLOCKLET).map(c=>{let d=null,l=null;c.to.type===W.ROUTING_RULE_TYPES.NONE?d="404":c.to.type===W.ROUTING_RULE_TYPES.REDIRECT?d=c.to.redirectCode:c.to.type===W.ROUTING_RULE_TYPES.GENERAL_REWRITE?d="R":c.to.type===W.ROUTING_RULE_TYPES.DIRECT_RESPONSE?d=t.jsx(Ia,{sx:{color:"text.secondary",fontSize:"45px"}}):c.to.type===W.ROUTING_RULE_TYPES.COMPONENT&&(l=a.children.find(p=>p.meta.did===c.to.componentId),d="C");const v=c.isProtected?t.jsx(be,{title:n("blocklet.router.urlLockTooltip"),placement:"top",children:t.jsx("span",{children:t.jsx(me,{disabled:!0,size:"small",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0,margin:"12px 0"},children:t.jsx(wa,{style:{fill:i.palette.text.disabled}})})})}):t.jsx(cs,{...c});return[t.jsxs(U,{className:"component-item",sx:{display:"flex",py:2,justifyContent:"space-between",alignItems:"center"},children:[t.jsxs(U,{sx:{width:{xs:300,md:400},display:"flex",alignItems:"center"},children:[t.jsx(U,{className:"component-item__indent",sx:{width:28}}),typeof d=="object"?d:t.jsx(mi,{children:d}),t.jsxs(U,{sx:{ml:2,flex:1,wordBreak:"break-word"},children:[t.jsxs(U,{style:{color:"text.primary",fontSize:16},children:[c.to.type===W.ROUTING_RULE_TYPES.NONE&&n("common.page404"),c.to.type===W.ROUTING_RULE_TYPES.REDIRECT&&n("common.redirect"),c.to.type===W.ROUTING_RULE_TYPES.GENERAL_REWRITE&&n("common.rewrite"),c.to.type===W.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&W.ROUTING_RESPONSE_TYPES.find(p=>p.value===c.to.response.contentType)?.text,c.to.type===W.ROUTING_RULE_TYPES.COMPONENT&&Z.getDisplayName(l,!0)]}),t.jsxs(U,{sx:{display:"flex",alignItems:"center"},children:[c.to.type===W.ROUTING_RULE_TYPES.REDIRECT&&t.jsx(zn,{domain:o,toUrl:c.to.url}),c.to.type===W.ROUTING_RULE_TYPES.GENERAL_REWRITE&&t.jsx(zn,{domain:o,toUrl:c.to.url}),c.to.type===W.ROUTING_RULE_TYPES.COMPONENT&&t.jsx(ds,{group:c.to.pageGroup})]})]})]}),t.jsx(U,{sx:{px:2,alignItems:"center",flexGrow:"1",display:{xs:"none",md:"flex"}},children:t.jsx(xt,{href:xo(o,c.from.pathPrefix,Gn(a,r)),target:"_blank",style:{fontSize:16,color:"inherit"},underline:"hover",children:hi(c.from.pathPrefix,"/")||"/"})},c.from.pathPrefix),t.jsx(U,{children:e&&t.jsx("div",{style:{textAlign:"right"},children:v})},"actions")]},"rule"),t.jsx(rn,{},"divider")]})}er.propTypes={hasPermission:x.bool};const Sd=Qt(er,"mutate_blocklets"),Ed=Qt(er,"",ft);function kd(e){const{inService:n}=xe();return n?t.jsx(Ed,{...e}):t.jsx(Sd,{...e})}function Rd(e,n){const r=R.useRef(n);R.useEffect(()=>{const i=a=>r.current(a.detail);return window.addEventListener(e,i),()=>window.removeEventListener(e,i)},[e])}function Pd(e){const n=yo(),{t:r}=ce(),i=()=>{const a=new URLSearchParams(window.location.search);a.get("checkUpdate")&&(a.delete("checkUpdate"),n(a.toString()),e(),G.success(r("notification.checkingForUpdates")))};R.useEffect(i,[]),Rd("checkUpdate",i)}function Td({blocklet:e,scrollToComponent:n}={blocklet:null,scrollToComponent:!1}){const r=yo(),{t:i}=ce(),a=R.useRef(null),o=R.useMemo(()=>{if(!e||!e.optionalComponents)return null;const f=new URLSearchParams(window.location.search),c=f.get("install-component");if(c){a.current=c,f.delete("install-component"),r(f.toString());const d=e.optionalComponents.find(v=>v.meta.did===c);if(!d)return G.success(i("notification.installComponentError",{did:c})),null;const{meta:l}=d;if(n){const v=document.getElementById(`optional-component-${c}`),p=document.querySelector(".dashboard-main");if(v){const C=v.getBoundingClientRect(),m=p.getBoundingClientRect();p.scrollTo({top:C.top-m.top+p.scrollTop,behavior:"smooth"})}}return l}return null},[e,r,i,n]);return R.useEffect(()=>{a.current&&window.opener&&window.opener.postMessage({blocklet:e,kind:"component-installer"},window.blocklet?.appUrl)},[e]),o}function tr({open:e=!1,onClose:n=null,blocklet:r,ancestors:i=[]}){const{t:a}=ce(),o=[...(i||[]).map(l=>l?.meta?.did||""),r?.meta?.did||""].filter(Boolean).join("/"),f=a("preferencesFor",{name:Z.getDisplayName(r,!0)}),c=R.useMemo(()=>({position:"relative",minHeight:"50vh",height:"100%",overflow:"hidden",border:0}),[]);if(st(r.status)||r.status==="unknown"&&st(r.status))return null;const d=()=>{n?.()};return t.jsx(Id,{open:e,fullWidth:!0,maxWidth:"md",title:f,onClose:d,PaperProps:{style:{minHeight:"500px"}},children:t.jsxs(ao,{sx:{gap:1},children:[t.jsx(le,{sx:{fontSize:12,color:"text.secondary",mb:.5},children:a("description.preferences",{name:Z.getDisplayName(r,!0)})}),t.jsx(Mi,{id:o,styles:c})]})})}tr.propTypes={blocklet:x.object.isRequired,ancestors:x.array,open:x.bool,onClose:x.func};const Id=oe(Yt)`
|
|
447
443
|
.MuiDialogContent-root {
|
|
448
444
|
padding-top: 0;
|
|
449
445
|
padding-bottom: 24px;
|
|
@@ -456,15 +452,15 @@ import{aF as ze,j as t,ds as ws,gH as _s,iD as Ss,V as ce,bn as ge,K as U,ay as
|
|
|
456
452
|
.ux-dialog_closeButton {
|
|
457
453
|
margin: 0;
|
|
458
454
|
}
|
|
459
|
-
`;function us({component:e,remove:n=async()=>{},disabled:r=!1,tip:i="",showConfirm:a=!1,hideBtn:o=!1,onCancel:
|
|
455
|
+
`;function us({component:e,remove:n=async()=>{},disabled:r=!1,tip:i="",showConfirm:a=!1,hideBtn:o=!1,onCancel:f=()=>{}}){const{t:c}=R.useContext(je),[d,l]=R.useState(!1),[v,p]=R.useState(null),C=async E=>{l(!0),await n(E.component,E.removeType),l(!1),p(null)},m=r||d,y=()=>{p({title:`${c("common.delete")} ${e.meta.title||e.meta.name}`,description:(E,u)=>t.jsxs(le,{component:"div",children:[t.jsx(le,{gutterBottom:!0,children:c("blocklet.action.removeComponentDescription")}),t.jsxs(_a,{name:"removeType",value:E.removeType,onChange:s=>u({...E,removeType:s.target.value}),children:[t.jsx(Un,{value:"keepData",control:t.jsx(Cr,{}),label:c("blocklet.action.removeComponentKeepData")}),t.jsx(Un,{value:"complete",control:t.jsx(Cr,{}),label:c("blocklet.action.removeComponentComplete")})]})]}),confirm:c("common.confirm"),cancel:c("common.cancel"),params:{component:e,removeType:"keepData"},onConfirm:C,onCancel:()=>{p(null),f()}})};R.useEffect(()=>{a?y():(l(!1),p(null))},[a]);const j=t.jsx(Dd,{size:"small",disabled:m,onClick:()=>y,"data-cy":"delete-component-btn",children:t.jsx(tn,{disabled:m})}),w=t.jsx(be,{title:i||c("common.delete"),children:t.jsx("span",{children:j})});return t.jsxs(t.Fragment,{children:[!o&&w,v&&t.jsx(it,{title:v.title,description:v.description,confirm:v.confirm,cancel:v.cancel,params:v.params,onConfirm:v.onConfirm,onCancel:v.onCancel})]})}us.propTypes={component:x.object.isRequired,remove:x.func,onCancel:x.func,disabled:x.bool,showConfirm:x.bool,hideBtn:x.bool,tip:x.string};const Dd=oe(me)`
|
|
460
456
|
&.Mui-disabled {
|
|
461
457
|
opacity: 0.5;
|
|
462
458
|
}
|
|
463
|
-
`;function ps({component:e,onStart:n=async()=>{},onStop:r=async()=>{},disabled:i=!1,tip:a=""}){const{t:o}=R.useContext(je),[
|
|
459
|
+
`;function ps({component:e,onStart:n=async()=>{},onStop:r=async()=>{},disabled:i=!1,tip:a=""}){const{t:o}=R.useContext(je),[f,c]=R.useState(!1),[d,l]=R.useState(),v=async()=>{c(!0);try{await n(e)}catch(E){G.error(E.message)}c(!1)},p=async()=>{c(!0);try{await r(e)}catch(E){G.error(E.message)}c(!1)},C=i||f,m=["starting","running","stopping"],y=m.includes(e.status)||m.includes(e.greenStatus),j=y?Ri:Pi,w=t.jsx(Bd,{disabled:C,size:"small",onClick:()=>{y?l({title:`${o("common.stop")} ${e?.meta?.title}`,description:o("blocklet.action.stopComponentDescription"),confirm:o("blocklet.action.confirmStop"),cancel:o("common.cancel"),onConfirm:()=>(l(null),p()),onCancel:()=>l(null)}):v()},"data-cy":`${y?"stop":"start"}-component-btn`,children:t.jsx(j,{disabled:C,fontSize:"small"})});return[t.jsx(be,{title:a||o(`common.${y?"stop":"start"}`),children:t.jsx("span",{children:w})},"btn"),d&&t.jsx(it,{title:d.title,description:d.description,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel},"connect")]}ps.propTypes={component:x.object.isRequired,onStart:x.func,onStop:x.func,disabled:x.bool,tip:x.string};const Bd=oe(me)`
|
|
464
460
|
&.Mui-disabled {
|
|
465
461
|
opacity: 0.5;
|
|
466
462
|
}
|
|
467
|
-
`;function fs({sourceInfo:e={},blocklet:n={}}){const{t:r}=R.useContext(je);let{source:i}=e;return i==="registry"&&(i="Blocklet Store"),t.jsxs(U,{sx:{display:"flex",alignItems:"center"},children:[t.jsx(xi,{type:"success",children:Ea(i)},"source"),e.source==="registry"&&t.jsx(xt,{href:Ee(e.deployedFrom,"blocklets",n?.meta?.bundleDid||""),target:"_blank",className:"page-link",underline:"hover",style:{display:"flex",alignItems:"center",marginLeft:8},children:r("blocklet.overview.viewInStore")})]})}fs.propTypes={sourceInfo:x.shape({source:x.string,deployedFrom:x.string}),blocklet:x.object};function nr({blocklet:e,checkUpgrade:n=!1,hasPermission:r=!1,...i}){const{api:a}=
|
|
463
|
+
`;function fs({sourceInfo:e={},blocklet:n={}}){const{t:r}=R.useContext(je);let{source:i}=e;return i==="registry"&&(i="Blocklet Store"),t.jsxs(U,{sx:{display:"flex",alignItems:"center"},children:[t.jsx(xi,{type:"success",children:Ea(i)},"source"),e.source==="registry"&&t.jsx(xt,{href:Ee(e.deployedFrom,"blocklets",n?.meta?.bundleDid||""),target:"_blank",className:"page-link",underline:"hover",style:{display:"flex",alignItems:"center",marginLeft:8},children:r("blocklet.overview.viewInStore")})]})}fs.propTypes={sourceInfo:x.shape({source:x.string,deployedFrom:x.string}),blocklet:x.object};function nr({blocklet:e,checkUpgrade:n=!1,hasPermission:r=!1,...i}){const{api:a}=xe(),{t:o}=R.useContext(je),[f,c]=R.useState(!1),[d,l]=R.useState(""),[v,p]=R.useState(null),[C,m]=R.useState(null);R.useEffect(()=>{p(null),n&&(e.mode,ve.BLOCKLET_MODES.DEVELOPMENT)},[e,n]);const y=()=>{c(!1),m(null)},j=async()=>{c(!0);try{const E={did:e.meta.did,version:v.version,storeUrl:v.registryUrl||""};await ut(2e3),await a.upgradeBlocklet({input:E})}catch(E){G.error(`Blocklet upgrade failed: ${ge(E)}`)}finally{c(!1),m(null)}},w={title:`${o("common.upgrade")} ${o("common.blocklet")} ${Z.getDisplayName(e)}`,description:o("blocklet.action.upgradeDescription"),confirm:o("blocklet.action.confirmUpgrade"),cancel:o("common.cancel"),onConfirm:j,onCancel:y};return r&&v&&!Z.isInProgress(e.status)?t.jsxs(t.Fragment,{children:[t.jsx(ht,{...i,children:e.meta.version}),t.jsx(be,{title:o("common.updateAvailable",{version:v.version}),children:t.jsx(me,{size:"small",style:{marginLeft:8},disabled:f,onClick:()=>m(w),children:f?t.jsx(Ce,{size:16}):t.jsx(Pa,{style:{fontSize:16,color:"red"}})})}),!!d&&t.jsx(G,{variant:"error",message:d,onClose:()=>l("")}),C&&t.jsx(it,{title:C.title,description:C.description,confirm:C.confirm,cancel:C.cancel,params:C.params,onConfirm:C.onConfirm,onCancel:C.onCancel})]}):t.jsx(ht,{...i,children:e.meta.version})}nr.propTypes={blocklet:x.object.isRequired,checkUpgrade:x.bool,hasPermission:x.bool};const Od=Qt(nr,"mutate_blocklets"),Ud=Qt(nr,"",ft);function Nd(e){const{inService:n}=xe();return n?t.jsx(Ud,{...e}):t.jsx(Od,{...e})}const Ld=e=>!e?.meta?.group,Ad=(e,n)=>e?[{name:n("common.name"),value:e.displayName},{name:n("common.description"),value:e.description},{name:n("common.version"),value:t.jsx(ht,{children:e.version})}]:[],Md=e=>{const{source:n,deployedFrom:r,bundleSource:i}=e;if(n)return{source:n,deployedFrom:r};if(!i)return{source:"upload",deployedFrom:r};if(i.url){const a=r||Array.isArray(i.url)?i.url[0]:i.url;return{source:"url",deployedFrom:a,link:a}}if(i.store){const a=r||Array.isArray(i.store)?i.store[0]:i.store;return{source:"registry",deployedFrom:a,link:a}}return{}},zd=(e,n)=>{const r=e.split("/").slice(1);let i=n,a=0;const o=[];for(;i&&a<r.length;){const f=i.children.find(c=>c.meta.did===r[a]);i=f,a++,f&&o.push(f.meta.title)}return o.join(" / ")};function ms({blocklet:e,depth:n=0,componentInfo:r=null,app:i=null,onClose:a}){const{t:o,locale:f}=R.useContext(je),{deletingBlocklets:c}=Kn();let{status:d,greenStatus:l}=e;(d==="running"||l==="running")&&(d="running"),n===1&&c.includes(e.meta.did)&&(d="deleting");const v=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),p=y=>y.map(j=>j.name===o("common.did")||j.name===o("blocklet.appId")?t.jsx(mn,{valueComponent:"div",nameWidth:120,name:j.name,nameFormatter:()=>j.name,children:j.value},j.name):t.jsx(mn,{valueComponent:"div",nameWidth:120,name:j.name,children:j.link?t.jsx(xt,{href:j.link,target:"_blank",className:"page-link",underline:"hover",children:j.value}):j.value},j.name)),C=r?Md(r):{},m=r?[{name:o("common.name"),value:Z.getDisplayName(r,!0)},{name:o("common.version"),value:t.jsx(Nd,{blocklet:r,checkUpgrade:!1})},{name:o("common.status"),value:t.jsx(An,{isResource:Ld(e),status:d,source:r.source,progress:e.progress})},Z.isBlockletRunning(e)?{name:o("blocklet.startedAt"),value:e.startedAt?t.jsx(pn,{value:e.startedAt,type:"all",locale:f}):"-"}:null,Z.isBlockletRunning(e)?null:{name:o("blocklet.stoppedAt"),value:e.stoppedAt?t.jsx(pn,{value:e.stoppedAt,type:"all",locale:f}):"-"},e.installedAt?{name:o("blocklet.installedAt"),value:e.installedAt?t.jsx(pn,{value:e.installedAt,type:"all",locale:f}):"-"}:null,Z.hasStartEngine(e.meta)?{name:o("common.mountPoint"),value:v}:null,r.meta.group?{name:o("common.group"),value:t.jsx(ht,{type:"success",children:r.meta.group})}:null,{name:o("blocklet.overview.source"),value:t.jsx(fs,{sourceInfo:C,blocklet:e})},{name:o("blocklet.overview.deployedFrom"),value:C.deployedFrom||"-",link:C.link??""},{name:o("common.did"),value:t.jsx(yi,{did:r.meta.did,showQrcode:!0})},{name:o("common.author"),value:r.meta.owner?t.jsx(xa,{owner:r.meta.owner,locale:f}):ga.formatPerson(r.meta.author)},{name:o("common.engine"),value:Ad(r.engine,o).map(({name:y,value:j})=>t.jsx(mn,{style:{marginBottom:4},nameWidth:120,name:y,children:j},y))},e.dependents?.length?{name:o("common.dependents"),value:t.jsx(U,{children:e.dependents.map(y=>t.jsx(U,{children:`${zd(y.id,i)} ${y.required?`(${o("common.required")})`:""}`},y.id))})}:null,e.meta.resources?.length?{name:o("common.resource"),value:e.meta.resources.join(", ")}:null].filter(Boolean):[];return r?t.jsx(Yt,{open:!0,title:o("common.componentBasicInfo"),showCloseButton:!0,fullWidth:!0,maxWidth:"md",onClose:()=>{a(null)},children:t.jsx(U,{sx:{paddingBottom:1.5},children:p(m)},"dialog-wrapper")},"base-info-dialog"):null}ms.propTypes={blocklet:x.object.isRequired,depth:x.number,app:x.object,componentInfo:x.object,onClose:x.func.isRequired};oe(vo)`
|
|
468
464
|
.BaseBadge-badge {
|
|
469
465
|
top: ${e=>e.top*8||6}px;
|
|
470
466
|
right: ${e=>e.right*8||6}px;
|
|
@@ -486,7 +482,7 @@ import{aF as ze,j as t,ds as ws,gH as _s,iD as Ss,V as ce,bn as ge,K as U,ay as
|
|
|
486
482
|
margin-left: 4px;
|
|
487
483
|
transform: translateY(-1px);
|
|
488
484
|
}
|
|
489
|
-
`;function hs({blocklet:e,ancestors:n,mountPoint:r,href:i}){const[a,o]=R.useState(!1),[
|
|
485
|
+
`;function hs({blocklet:e,ancestors:n,mountPoint:r,href:i}){const[a,o]=R.useState(!1),[f,c]=R.useState(!1),[d,l]=R.useState(!1),[v,p]=R.useState(r),{api:C}=xe(),m=!n.length,y=m?e.meta.did:n.map(k=>k.meta.did)[0],{t:j}=ce(),{confirmApi:w,confirmHolder:E}=ho();R.useEffect(()=>{c(!1),o(!1),l(!1)},[r]);const u=()=>{o(!1),c(!1),p(r)},s=async()=>{l(!0),o(!1);try{const k={rootDid:y,mountPoint:Le.urlPathFriendly(v)};m||(k.did=e.meta.did),await C.updateComponentMountPoint({input:k})}catch(k){throw k.message=ge(k),G.error(k.message),k}finally{u()}},h=Ke(()=>{w.open({title:j("common.noticeTitle"),content:t.jsxs(U,{sx:{color:"#9397A1","& > li":{listStyle:"disc",ml:1.5}},children:[t.jsx(le,{sx:{mb:1.5},children:j("blocklet.mountPoint.description1")}),t.jsx(le,{component:"li",children:j("blocklet.mountPoint.case1")}),t.jsx(le,{component:"li",children:j("blocklet.mountPoint.case2")}),t.jsx(le,{sx:{mt:1.5},children:j("blocklet.mountPoint.description2")})]}),confirmButtonText:j("common.confirm"),cancelButtonText:j("common.cancel"),async onConfirm(k){await s(),k()},confirmButtonProps:{"data-cy":"edit-mount-point-confirm"}})}),b=k=>{k?.preventDefault(),Le.urlPathFriendly(v)!==r?h():c(!1)},P=f?t.jsxs(U,{sx:{ml:1},children:[t.jsx(me,{size:"medium",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),"data-cy":"edit-mount-point-submit",onClick:b,children:t.jsx(U,{component:fe,icon:"material-symbols:done",sx:{color:"primary.main",transition:"0.3s opacity"}})}),t.jsx(me,{size:"medium",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onClick:u,children:t.jsx(U,{component:fe,icon:"iconoir:cancel",sx:{color:"primary.main",transition:"0.3s opacity"}})})]}):t.jsx(me,{size:"medium",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onClick:()=>c(!0),children:t.jsx(U,{component:fe,"data-cy":"edit-mount-point",icon:"lets-icons:edit-light",sx:{opacity:a?1:0,color:"primary.main",transition:"0.3s opacity"}})});return t.jsxs(U,{sx:{alignItems:"center",flexGrow:"1",display:{xs:"none",md:"flex"}},children:[E,f?t.jsx("form",{onSubmit:b,children:t.jsx(ye,{style:{flex:1},fullWidth:!0,"data-cy":"edit-mount-point-input",value:v,onChange:k=>p(k.target.value),autoFocus:!0,size:"small",variant:"outlined",placeholder:r})}):t.jsx(U,{component:"a",target:"_blank",href:i,rel:"noopener noreferrer",title:i,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:t.jsx(U,{sx:{maxWidth:400,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",color:"primary.main",fontSize:16,px:2},children:vi(r)})}),d?t.jsx(Ce,{size:20,sx:{ml:1}}):P]},r)}hs.propTypes={mountPoint:x.string.isRequired,href:x.string.isRequired,blocklet:x.object.isRequired,ancestors:x.array.isRequired};const Fd=e=>!e?.meta?.group,io=(e,n)=>{const r=e.split("/").slice(1);let i=n,a=0;const o=[];for(;i&&a<r.length;){const f=i.children.find(c=>c.meta.did===r[a]);i=f,a++,f&&o.push(f.meta.title)}return o.join(" / ")},qd=(e,n)=>{window.IS_DEBUG&&console.log("blocklet status","blueStatus:",e,"greenStatus:",n);const r=e==="running"||n==="running",i=e==="stopping"||n==="stopping",a=e==="downloading"&&n==="downloading";let o="",f="";return i?(o="stopping",f=""):r?o="running":o=e||n||"",r&&e!==n&&(f=e==="running"?n:e),a&&(o="running",f="downloading"),o==="running"&&f==="stopped"&&(f=""),e===n&&(o=e,f=""),{primaryStatus:o,secondaryStatus:f}};function Fn({blocklet:e,ancestors:n=[],depth:r=0,onRemove:i=()=>{},onStart:a=()=>{},onStop:o=()=>{},onRestart:f=()=>{},getComponentUrl:c=()=>window.location.origin,app:d=null}){const{t:l}=R.useContext(je),[v,p]=R.useState(),[C,m]=R.useState(!1),[y,j]=R.useState(!1),[w,E]=R.useState(null),{info:u}=xe(),[s,h]=R.useState(!1),[b,P]=R.useState(!1),{deletingBlocklets:k}=Kn();let{status:M}=e;r===1&&k.includes(e.meta.did)&&(M="deleting");const z=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),I=c(z),B=Z.isInProgress(d.status),D=Z.isInProgress(e.status);let L="";if(B||D||r===1&&k.includes(e.meta.did))L=l("blocklet.component.tip.stopBlocklet");else if(e.dependents?.length){const O=e.dependents.filter(te=>te.required);if(O.length){const te=O.map(_=>io(_.id,d));L=l("blocklet.component.tip.requiredBy",{name:te.join(", ")})}}const F=async(...O)=>{j(!0);try{await i(...O)}catch{}j(!1),m(!1)},{usingDocker:$,usingIsolation:H}=R.useMemo(()=>{if(!e.meta.group||e.meta.group==="static")return{usingDocker:!1,usingIsolation:!1};const O=!!u?.enableDocker||window.blocklet?.enableDocker,te=[...d.configs,...e.configs].find(g=>g.key==="SKIP_DOCKER"&&g.value),_=[...d.configs,...e.configs].find(g=>g.key==="USE_DOCKER"&&g.value),T=[...d.configs,...e.configs].find(g=>g.key==="SKIP_DOCKER_NETWORK"&&g.value);return{usingDocker:O?!te:!!_,usingIsolation:O&&!T&&(u?.enableDockerNetwork||window.blocklet?.enableDockerNetwork)}},[e.configs,u?.enableDocker,u?.enableDockerNetwork,d.configs,e.meta.group]),{primaryStatus:X,secondaryStatus:se}=qd(M,e.greenStatus);return t.jsxs(t.Fragment,{children:[t.jsxs(rr,{display:"flex",py:2,className:"component-item",justifyContent:"flex-start",alignItems:"center",children:[t.jsxs(U,{sx:{pl:2,width:{xs:250,sm:400},display:"flex",alignItems:"center"},children:[t.jsx(Ci,{blocklet:e,ancestors:n}),t.jsxs(U,{sx:{ml:"16px",minWidth:0},children:[t.jsxs(U,{className:"component-header",onClick:()=>p(e),children:[t.jsx(U,{className:"component-name",children:Z.getDisplayName(e,!0)}),t.jsx(U,{className:"component-version",children:e?.meta?.version})]}),t.jsxs(U,{sx:{display:"flex",alignItems:"center",gap:.5},children:[X&&t.jsx(An,{style:{whiteSpace:"nowrap"},status:X,source:e.source,progress:e.progress}),se&&t.jsx(An,{style:{whiteSpace:"nowrap"},status:se,source:e.source,progress:e.progress}),t.jsx(ya,{style:{whiteSpace:"nowrap"},mode:e.mode||""}),e.mode!=="development"&&$&&t.jsx(be,{title:l("blocklet.usingDocker"),children:t.jsx(U,{sx:{display:"flex",color:"primary.main",ml:1},children:t.jsx(fe,{icon:wo})})}),e.mode!=="development"&&H&&t.jsx(be,{title:l("blocklet.usingIsolation"),children:t.jsx(U,{sx:{display:"flex",color:"primary.main",ml:1},children:t.jsx(fe,{icon:"streamline:network"})})}),!!e.dependents?.length&&t.jsx(be,{title:[`${l("common.dependents")}: `,e.dependents.map(O=>t.jsx(U,{sx:{pl:1},children:`${io(O.id,d)} ${O.required?`(${l("common.required")})`:""}`},O.id))],children:t.jsx(U,{sx:{display:"flex",color:"primary.main",ml:1},children:t.jsx(fe,{icon:"octicon:package-dependents-16"})})})]})]})]},e),_o.hasMountPoint(e.meta)&&t.jsx(hs,{blocklet:e,ancestors:n,mountPoint:z,href:I},z),t.jsx("div",{style:{flex:1}}),t.jsxs(U,{sx:{display:"flex",alignItems:"center"},children:[Z.hasStartEngine(e.meta)&&t.jsx(be,{title:l("common.visit"),children:t.jsx(U,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:I,rel:"noopener noreferrer",children:t.jsx(me,{size:"small",children:t.jsx(To,{fontSize:"small"})})})}),t.jsx(ps,{blocklet:d,component:e,onStart:a,onStop:o,disabled:!["starting","stopping"].includes(d.status)&&Z.isInProgress(d.status)}),t.jsx(me,{size:"small",onClick:()=>P(!0),disabled:B||D,children:t.jsx(Bo,{fontSize:"small"})}),t.jsx(qn,{color:"error",badgeContent:"",variant:"dot",invisible:!Z.getComponentMissingConfigs(e,n[0]).length,children:t.jsx(Io,{"data-cy":"component-actions",actions:[Z.hasStartEngine(e.meta)||Fd(e)?{icon:t.jsx(bi,{}),text:l("common.detail"),onClick:()=>{p(e)}}:null,{icon:t.jsx(Ti,{}),text:l("common.restart"),onClick:()=>{E({title:`${l("common.restart")} ${e.meta.title}`,description:l("blocklet.action.restartDescription"),confirm:l("blocklet.action.confirmRestart"),cancel:l("common.cancel"),onConfirm:async()=>{j(!0),await f(e),j(!1),E(null)},onCancel:()=>E(null)})},disabled:y||B||D||!Z.isBlockletRunning(e)},{icon:t.jsx(tn,{}),text:l("common.delete"),onClick:()=>{m(!0)},disabled:B||D||!!L,tip:L},{separator:!0},{icon:t.jsx(fe,{icon:"mdi:variable"}),onClick:()=>{h(!0)},text:t.jsx(qn,{color:"error",badgeContent:"",variant:"dot",invisible:!Z.getComponentMissingConfigs(e,n[0]).length,children:t.jsx(U,{sx:{width:"100%"},children:l("common.environments")})}),disabled:B||D}].filter(Boolean)})})]},"actions")]},"group-not-gateway-box"),t.jsx(rn,{},"line"),t.jsx(ms,{componentInfo:v,onClose:p,blocklet:e,app:d,depth:r}),t.jsx(us,{blocklet:d,component:e,remove:F,onCancel:()=>m(!1),hideBtn:!0,showConfirm:C},"delete-component"),w&&t.jsx(it,{title:w.title,description:w.description,confirm:w.confirm,cancel:w.cancel,params:w.params,onConfirm:w.onConfirm,onCancel:w.onCancel},"confirm-setting"),s&&t.jsx(Vn,{open:!0,hiddenChildren:!0,onClose:()=>h(!1),blocklet:e,ancestors:n}),b&&t.jsx(tr,{open:!0,onClose:()=>P(!1),blocklet:e,ancestors:n})]})}Fn.propTypes={blocklet:x.object.isRequired,ancestors:x.array,depth:x.number,onRemove:x.func,onStart:x.func,onStop:x.func,onRestart:x.func,getComponentUrl:x.func,app:x.object};const qn=oe(vo)`
|
|
490
486
|
.BaseBadge-badge {
|
|
491
487
|
top: ${e=>e.top*8||6}px;
|
|
492
488
|
right: ${e=>e.right*8||6}px;
|
|
@@ -515,7 +511,7 @@ import{aF as ze,j as t,ds as ws,gH as _s,iD as Ss,V as ce,bn as ge,K as U,ay as
|
|
|
515
511
|
margin-left: 4px;
|
|
516
512
|
transform: translateY(-1px);
|
|
517
513
|
}
|
|
518
|
-
`;function gs({meta:e,dependencies:n=[],logoUrl:r="",setInstallComponentMeta:i}){const a=
|
|
514
|
+
`;function gs({meta:e,dependencies:n=[],logoUrl:r="",setInstallComponentMeta:i}){const a=xe(),{t:o}=ce(),f=()=>{i(e)},c=40;return t.jsxs($d,{id:`optional-component-${e.did}`,children:[t.jsxs("div",{className:"cell",children:[t.jsxs("div",{className:"component-left",children:[t.jsx("img",{className:"component-logo",src:r,onError:()=>`${a.imgPrefix}/blocklet.png`,alt:e.title,style:{width:c,height:c}}),t.jsxs("div",{className:"component-header",children:[t.jsx("div",{className:"component-name",children:e.title}),t.jsx("div",{className:"component-version",children:e.version})]}),t.jsx(be,{title:[`${o("common.dependents")}: `,n.map(d=>t.jsx(U,{sx:{pl:1},children:`${d.parentTitle} ${d.required?`(${o("common.required")})`:""}`},d.parentName+d.mount_point))],children:t.jsx(U,{sx:{display:"flex",color:"primary.main",ml:1},children:t.jsx(fe,{icon:"octicon:package-dependents-16"})})})]}),t.jsx("div",{style:{flex:1}}),t.jsx(U,{sx:{minWidth:100,display:"flex",justifyContent:"flex-end"},children:t.jsx(Zt,{onClick:f,startIcon:t.jsx(fe,{icon:"ph:download-simple-bold"}),children:o("common.install")})})]}),t.jsx(rn,{class:"line"},"line")]})}gs.propTypes={meta:x.object.isRequired,logoUrl:x.string,setInstallComponentMeta:x.func.isRequired,dependencies:x.arrayOf(x.shape({parentDid:x.string,parentName:x.string,parentPoint:x.string,required:x.bool}))};const $d=oe(rr)`
|
|
519
515
|
.line {
|
|
520
516
|
opacity: 0.5;
|
|
521
517
|
}
|
|
@@ -565,7 +561,7 @@ import{aF as ze,j as t,ds as ws,gH as _s,iD as Ss,V as ce,bn as ge,K as U,ay as
|
|
|
565
561
|
margin-left: 4px;
|
|
566
562
|
transform: translateY(-1px);
|
|
567
563
|
}
|
|
568
|
-
`;function xs({blocklet:e,onUpdate:n=()=>{},getComponentUrl:r=()=>window.location.origin,...i}){const{t:a}=R.useContext(je),{api:o,inService:
|
|
564
|
+
`;function xs({blocklet:e,onUpdate:n=()=>{},getComponentUrl:r=()=>window.location.origin,...i}){const{t:a}=R.useContext(je),{api:o,inService:f,info:c}=xe(),{addDeletingDid:d,removeDeletingDid:l,matchDeletingDid:v}=Kn(),[p,C]=R.useState(!1),[m,y]=R.useState(null),[j,w]=R.useState(null),[E,u]=R.useState(!1),[s,h]=R.useState(!1),[b,P]=R.useState(!1),[k,M]=R.useState(!1),[z,I]=R.useState(null),B=e&&e.structVersion!==W.APP_STRUCT_VERSION,[D,L]=R.useState(!1),F=[...e.children];e.meta.group!=="gateway"&&F.unshift(e),v(F.map(N=>N.meta.did));const $=async()=>{if(!p){C(!0);try{const{updateId:N,updateList:K}=(await o.checkComponentsForUpdates({input:{did:e.meta.did}})).preUpdateInfo||{};if(C(!1),!N){G.info(a("blocklet.component.noUpdate"));return}const ee=[];Z.forEachChildSync(e,(ie,{id:re,ancestors:ne})=>{const ke=K.find(we=>we.id===re);if(ke){const we=ne.slice(1).concat(ie).map(Ve=>Ve.meta.title||Ve.meta.name).join(" / "),de=(ne[1]||ie).meta.did;ee.push({groupId:de,name:we,version:ie.meta.version,newVersion:ke.meta.version})}});const V={};ee.forEach(ie=>{V[ie.groupId]?ie.disabled=!0:V[ie.groupId]=!0}),y({params:{updateId:N},list:ee,checks:V,hasChecks:!0})}catch(N){C(!1),G.error(ge(N))}}},H=async()=>{if(!p)try{C(!0);const N=Object.keys(m.checks).filter(ee=>m.checks[ee]),K={updateId:m.params.updateId,rootDid:e.meta.did,selectedComponents:N};await o.upgradeComponents({input:K}),C(!1),y(null),L(null)}catch(N){C(!1),G.error(ge(N))}},X=async(N,K)=>{d(N.meta.did);try{await o.deleteComponent({input:{did:N.meta.did,keepData:K==="keepData",rootDid:e.meta.did}}),await ut(800)}catch(ee){G.error(ge(ee)),l(N.meta.did)}},se=async N=>{try{await o.startBlocklet({input:{did:e.meta.did,componentDids:[N.meta.did]}}),await ut(800)}catch(K){G.error(ge(K))}},O=async N=>{try{await o.stopBlocklet({input:{did:e.meta.did,componentDids:[N.meta.did]}}),await ut(800)}catch(K){G.error(ge(K))}},te=async N=>{try{await o.restartBlocklet({input:{did:e.meta.did,componentDids:[N.meta.did]}}),await ut(800)}catch(K){G.error(ge(K))}},_=(N,K)=>{const{checked:ee}=N.target;y(V=>{const ie=Object.entries(V.checks).reduce((ne,[ke,we])=>(ne[ke]=K===ke||K==="all"?ee:we,ne),{}),re=Object.values(ie).includes(!0);return{...V,checks:ie,hasChecks:re}})},T=R.useMemo(()=>m?.list.filter(N=>!N.disabled).every(N=>m.checks[N.groupId]),[m]);Pd($);const g=Td({blocklet:e,scrollToComponent:!0}),S=z||g;return t.jsxs(Wd,{component:"div",...i,onUpdate:n,children:[t.jsxs(Hd,{display:"flex",children:[t.jsxs(Gd,{flexDirection:"row",className:"title",display:"flex",alignItems:"center",children:[F?.length?`${a("common.components")} (${F.length})`:`${a("common.components")}`,!B&&t.jsx(Nn,{permission:f?"":"mutate_blocklets",role:f?ft:[],children:t.jsx(Oo,{children:t.jsx(qn,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!D,children:t.jsxs(Be,{disabled:p||Z.isInProgress(e.status),onClick:()=>{$()},"data-cy":"check-for-updates",children:[t.jsx(U,{sx:{ml:.5,mr:.5,display:"flex"},children:p?t.jsx(Ce,{size:16}):t.jsx(Da,{style:{fontSize:"1em"}})}),a("blocklet.component.checkUpdateTitle")]})})})})]}),t.jsx(Nn,{permission:f?"":"mutate_blocklets",role:f?ft:[],children:t.jsxs(U,{sx:{display:"flex",alignItems:"center",gap:.5},children:[!B&&t.jsx(ss,{blocklet:e,serverVersion:c.version,disabled:p||Z.isInProgress(e.status)}),t.jsx(Io,{"data-cy":"component-actions",actions:[{icon:t.jsx(fe,{icon:"fluent:link-20-filled"}),onClick:()=>h(!0),text:a("router.rule.add.title"),disabled:p||Z.isInProgress(e.status)},...B?[]:[{icon:t.jsx(fe,{icon:"mdi:variable"}),onClick:()=>{P(!0)},text:a("common.environments")},{icon:t.jsx(Bo,{}),onClick:()=>{M(!0)},text:a("common.preferences")}]].filter(Boolean)})]})})]}),F?.length?t.jsxs(t.Fragment,{children:[t.jsxs(U,{sx:{mt:2},children:[e.meta.group!=="gateway"&&t.jsx(Fn,{blocklet:e,app:e,onRemove:X,onStart:se,onStop:O,onRestart:te,getComponentUrl:r},`0-${e.meta.did}`),e.children.map(N=>t.jsx(Fn,{depth:1,blocklet:N,ancestors:[e],app:e,onRemove:X,onStart:se,onStop:O,onRestart:te,getComponentUrl:r},`1-${N.meta.did}`))]},`top-blocklet-${e.meta.did}`),e.optionalComponents?.map(N=>t.jsx(rr,{children:t.jsx(gs,{setInstallComponentMeta:I,...N})},N.meta.did))]}):t.jsx(U,{sx:{mt:8},children:t.jsx(Ei,{children:a("blocklet.component.noComponent")})}),!!e.site.rules.length&&t.jsx(U,{sx:{mt:0,".component-item__indent":{pl:2,width:0}},children:t.jsx(kd,{})}),!!m&&t.jsx(fr,{open:!0,fullWidth:!0,children:t.jsxs(U,{sx:{paddingY:1.5},children:[t.jsx(mr,{children:a("blocklet.component.updateTitle")}),t.jsxs(U,{component:hr,sx:{py:4},children:[m.list.filter(N=>!N.disabled).length>1&&t.jsxs(U,{sx:{display:"flex",alignItems:"center"},children:[t.jsx(gr,{checked:T,onChange:N=>_(N,"all")}),t.jsx(U,{children:a(T?"common.unselectAll":"common.selectAll")})]}),m.list.map(N=>t.jsxs(U,{sx:{display:"flex",alignItems:"center",mb:1},children:[t.jsx(gr,{checked:m.checks[N.groupId],onChange:K=>_(K,N.groupId),style:{marginLeft:N.disabled?16:0,alignSelf:"flex-start"},defaultChecked:!0,disabled:N.disabled}),t.jsxs(U,{sx:{flexGrow:1},children:[t.jsx(U,{xs:8,sx:{pt:1},children:N.name}),N.version&&t.jsxs(ze,{container:!0,spacing:2,sx:{fontSize:"h6.fontSize",alignItems:"center"},children:[t.jsx(ze,{size:3,children:N.version}),t.jsx(ze,{size:1,children:t.jsx(ji,{style:{fontSize:"0.9em"}})}),t.jsx(ze,{size:3,children:t.jsx(U,{sx:{color:"secondary.main"},children:N.newVersion})})]})]},`${N.name}-${N.newVersion}`)]},N.name))]}),t.jsxs(wi,{style:{padding:"8px 24px 24px"},children:[t.jsx(Be,{onClick:()=>{y(null)},children:a("common.cancel")}),t.jsxs(Be,{onClick:N=>{N.stopPropagation(),H()},color:"primary",disabled:p||!m.hasChecks,variant:"contained",autoFocus:!0,children:[p&&t.jsx(Ce,{size:16}),a("common.update")]})]})]})}),!!j&&t.jsx(fr,{open:!0,fullWidth:!0,onClose:()=>w(!1),children:t.jsxs(U,{sx:{paddingY:1.5},children:[t.jsx(mr,{children:a("common.configuration")}),t.jsx(hr,{children:t.jsx(U,{sx:{py:2},children:t.jsx(Un,{control:t.jsx(ka,{checked:E,onChange:N=>u(!!N.target.checked)}),label:a("blocklet.component.showContainer")})})})]})}),t.jsx(Xn,{selectedMeta:S,blocklet:e,showDialog:!!S,setShowDialog:()=>I(null)}),s&&t.jsx(is,{hiddenChildren:!0,open:!0,onClose:()=>h(!1)}),b&&t.jsx(Vn,{open:!0,onClose:()=>P(!1),hiddenChildren:!0,blocklet:e,ancestors:[]}),k&&t.jsx(tr,{open:!0,onClose:()=>M(!1),blocklet:e,ancestors:[]})]})}xs.propTypes={blocklet:x.object.isRequired,onUpdate:x.func,getComponentUrl:x.func};const Wd=oe.div`
|
|
569
565
|
.title {
|
|
570
566
|
font-size: 1.2rem;
|
|
571
567
|
font-weight: bold;
|
|
@@ -584,7 +580,7 @@ import{aF as ze,j as t,ds as ws,gH as _s,iD as Ss,V as ce,bn as ge,K as U,ay as
|
|
|
584
580
|
.component-item {
|
|
585
581
|
animation: showDelay 0.75s ease 1;
|
|
586
582
|
}
|
|
587
|
-
`,
|
|
583
|
+
`,Hd=oe(U)`
|
|
588
584
|
${e=>e.theme.breakpoints.up("sm")} {
|
|
589
585
|
flex-direction: row;
|
|
590
586
|
justify-content: space-between;
|
|
@@ -598,9 +594,9 @@ import{aF as ze,j as t,ds as ws,gH as _s,iD as Ss,V as ce,bn as ge,K as U,ay as
|
|
|
598
594
|
display: none;
|
|
599
595
|
}
|
|
600
596
|
}
|
|
601
|
-
`,
|
|
597
|
+
`,Gd=oe(U)`
|
|
602
598
|
${e=>e.theme.breakpoints.down("sm")} {
|
|
603
599
|
width: 100%;
|
|
604
600
|
justify-content: space-between;
|
|
605
601
|
}
|
|
606
|
-
`;function
|
|
602
|
+
`;function vp(e){const{locale:n}=R.useContext(je),{blocklet:r,recommendedDomain:i}=Ra(),a=o=>_i({blocklet:r,domain:{value:i||`${Si.encode(r.appPid)}.${W.DEFAULT_DID_DOMAIN}`},mountPoint:o,params:Gn(r,n)});return t.jsx(xs,{blocklet:r,getComponentUrl:a,...e})}export{vp as default};
|