@abtnode/webapp 1.16.53-beta-20251011-054719-4ed2f6b7 → 1.16.53-beta-20251011-095147-8bd212c5
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-DQepVz3x.js → AdapterDayjs-CeksOrhl.js} +1 -1
- package/dist/assets/{Add-CQt7mq1G.js → Add-C8Lm-hkR.js} +1 -1
- package/dist/assets/ArrowDropDown-D3yioOpG.js +1 -0
- package/dist/assets/{Autocomplete-Bf1Ho3Hd.js → Autocomplete-BQrCutXD.js} +1 -1
- package/dist/assets/{Breadcrumbs-CPilcW9u.js → Breadcrumbs-CjoKrRSd.js} +1 -1
- package/dist/assets/{ButtonGroup-9zvLC_k0.js → ButtonGroup-0m6xN_hM.js} +1 -1
- package/dist/assets/{CSSTransition-dwX1-RMJ.js → CSSTransition-r6UVh1d4.js} +1 -1
- package/dist/assets/{CallMerge-BYCLcH5E.js → CallMerge-Dw8aSOXl.js} +1 -1
- package/dist/assets/{CardContent-C22npYBc.js → CardContent-Dn4qVn0M.js} +1 -1
- package/dist/assets/{ChevronLeft-Bmmo6bzu.js → ChevronLeft-vJUfXHLK.js} +1 -1
- package/dist/assets/{ChevronRight-X_FMXVA4.js → ChevronRight-CBhWmXPb.js} +1 -1
- package/dist/assets/{Clear-B-e33dNn.js → Clear-Dm80eYkN.js} +1 -1
- package/dist/assets/{DeleteOutline-CIuy8JMu.js → DeleteOutline-DBp8IxLy.js} +1 -1
- package/dist/assets/{Done-yHCWLz6K.js → Done-C3L_U1d0.js} +1 -1
- package/dist/assets/{Edit-CLiO2h_l.js → Edit-T8wWfQhn.js} +1 -1
- package/dist/assets/{ErrorOutline-B_qBOUnI.js → ErrorOutline-DDgW0IIs.js} +1 -1
- package/dist/assets/{FilterList-BOMn8eqm.js → FilterList-DOx5uN4S.js} +1 -1
- package/dist/assets/{Google-KOeLJ7n-.js → Google-DT749Dih.js} +1 -1
- package/dist/assets/{HelpOutline-BXdmHwaP.js → HelpOutline-Y8yJx9_1.js} +1 -1
- package/dist/assets/{KeyboardArrowDown-CdK82Qsb.js → KeyboardArrowDown-Vjm82N0l.js} +1 -1
- package/dist/assets/{Launch-cxvym2iP.js → Launch-CbU-zIFy.js} +1 -1
- package/dist/assets/{Link-DKb1MvxW.js → Link-C1xLiB79.js} +1 -1
- package/dist/assets/{ListItemButton-E5H4lrRx.js → ListItemButton-ClnowAwh.js} +1 -1
- package/dist/assets/{ListSubheader-FJVGwx1O.js → ListSubheader-DBKVdByu.js} +1 -1
- package/dist/assets/{LoadingButton-C7IcO9Nb.js → LoadingButton-Cyu7epth.js} +1 -1
- package/dist/assets/{MoreVert-bx--E19j.js → MoreVert-Dt9p1lZE.js} +1 -1
- package/dist/assets/{OpenInNew-BdVhgoOc.js → OpenInNew-SrFDopIl.js} +1 -1
- package/dist/assets/{Refresh-mYLoMEkT.js → Refresh-DibDVagJ.js} +1 -1
- package/dist/assets/{Search-Dm2dt-Sr.js → Search-DUF2osvO.js} +1 -1
- package/dist/assets/{Stepper-B1wBWjZo.js → Stepper-CTMouRdp.js} +1 -1
- package/dist/assets/{Switch-CE03jZ_8.js → Switch-DVmHUng5.js} +1 -1
- package/dist/assets/{TableSearch-Bj41g7St.js → TableSearch-x3y0kzP6.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-BEjde42R.js → ToggleButtonGroup-CDxsnBYJ.js} +1 -1
- package/dist/assets/{UnfoldMore-zrMTJNOp.js → UnfoldMore-DfHvwMX2.js} +1 -1
- package/dist/assets/{Verified-B-cFyGP0.js → Verified-RZDxPBl3.js} +1 -1
- package/dist/assets/{VerifiedUser-aSWRZr_Y.js → VerifiedUser-C5GKL4NI.js} +1 -1
- package/dist/assets/{ViewList-BbDrtZvr.js → ViewList-BIasqeLT.js} +1 -1
- package/dist/assets/{_createAggregator-OKIbDBKF.js → _createAggregator-CT54gRWr.js} +1 -1
- package/dist/assets/{actions-DaOidt88.js → actions-BTo9FCWY.js} +1 -1
- package/dist/assets/{actions-BBls_wa0.js → actions-Bkf_XgjE.js} +1 -1
- package/dist/assets/{agreement-B9tSzjmL.js → agreement-V0j80REH.js} +1 -1
- package/dist/assets/api-CUhmsggO.js +1 -0
- package/dist/assets/{appearance-BOeNpo6Y.js → appearance-CaphgLyB.js} +1 -1
- package/dist/assets/{audit-logs-Bdg8Eitt.js → audit-logs-BwQjwQRC.js} +1 -1
- package/dist/assets/{base-chart-D7y6qq9u.js → base-chart-C5PdAmLw.js} +1 -1
- package/dist/assets/{blocklet-C67aFvl7.js → blocklet-qrkDxr_e.js} +1 -1
- package/dist/assets/{chain-se1xvUDC.js → chain-CA7TjYnf.js} +1 -1
- package/dist/assets/{click-to-copy-D50kkiW4.js → click-to-copy-Pl4hIypx.js} +1 -1
- package/dist/assets/client-CPdeHHs9.js +1 -0
- package/dist/assets/cloneDeep-LYTwa-JV.js +1 -0
- package/dist/assets/{collapse-UPIFGGD9.js → collapse-DASgp2d0.js} +1 -1
- package/dist/assets/{config-navigation-CutTRHe-.js → config-navigation-DDLekmi-.js} +3 -3
- package/dist/assets/{connect-to-Dz9eH_td.js → connect-to-Bi6Hyl3q.js} +1 -1
- package/dist/assets/{cssMode-73_XXe8t.js → cssMode-C7ESlTK9.js} +1 -1
- package/dist/assets/{delete-confirm-cbt-tN11.js → delete-confirm-B-r93j03.js} +1 -1
- package/dist/assets/{depsEqual-BaUhqVSn.js → depsEqual-DfTLPdgg.js} +1 -1
- package/dist/assets/{detail-BR9P1Yx6.js → detail-BD2IFxMv.js} +3 -3
- package/dist/assets/{domains-BDMd9S2d.js → domains-C4W6m2uy.js} +1 -1
- package/dist/assets/{download-Oh1d5P58.js → download-CehHaiXA.js} +1 -1
- package/dist/assets/{edit.svg-BHG50OdM.js → edit.svg-BLR5epzr.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-DZEVfVIs.js +1 -0
- package/dist/assets/engine-CXYcW8tV.js +1 -0
- package/dist/assets/{freemarker2-BQ02ePgw.js → freemarker2-DfzPp9s6.js} +1 -1
- package/dist/assets/{get-safe-url-CteWIr5a.js → get-safe-url-CumOcp7c.js} +1 -1
- package/dist/assets/getValidReactChildren-BKEsPaXS.js +1 -0
- package/dist/assets/{graphqlMode-BTvp4HDh.js → graphqlMode-CsAQlaEf.js} +2 -2
- package/dist/assets/{handlebars-DPMLBiwS.js → handlebars-CA_-cqDJ.js} +1 -1
- package/dist/assets/{html-iuKRS8o1.js → html-C9RxEE-e.js} +1 -1
- package/dist/assets/{html-title-vsl-TT26.js → html-title-3CG5UyIt.js} +1 -1
- package/dist/assets/{htmlMode-CvGrTtxZ.js → htmlMode-uPtGYFj3.js} +1 -1
- package/dist/assets/{iframe-Dl-yNrp9.js → iframe-aJ3sDUVb.js} +1 -1
- package/dist/assets/{index-C-1MOEs6.js → index-0Dj9yC88.js} +1 -1
- package/dist/assets/{index-BGSPRFxN.js → index-0slfmis0.js} +1 -1
- package/dist/assets/{index-GerkFFyW.js → index-3bOYCU_O.js} +3 -3
- package/dist/assets/{index-BtY4M62T.js → index-3tLE8Mjd.js} +3 -3
- package/dist/assets/{index-BYQEC6o1.js → index-5b60aMk8.js} +1 -1
- package/dist/assets/{index-ClSpNPOh.js → index-B0iEGhMY.js} +1 -1
- package/dist/assets/{index-B2jTgxcq.js → index-B27Mzk9d.js} +1 -1
- package/dist/assets/{index-DfEAejxd.js → index-B2EpuvFX.js} +1 -1
- package/dist/assets/{index-2UXtfcoT.js → index-BIbaiVup.js} +30 -30
- package/dist/assets/{index-CC45e4UO.js → index-BOjR9vg6.js} +1 -1
- package/dist/assets/{index-W1Jg0zqO.js → index-BPsgcLTY.js} +1 -1
- package/dist/assets/{index-DnNVPfHo.js → index-BXCHVLcm.js} +1 -1
- package/dist/assets/{index-BvVI7Mxo.js → index-B_DdwI_f.js} +1 -1
- package/dist/assets/{index-oHwXuk_n.js → index-Bb2FNNL0.js} +1 -1
- package/dist/assets/{index-8DgiLFWe.js → index-BdNOQK8-.js} +1 -1
- package/dist/assets/{index-D9p6b5Uq.js → index-BiOrweAN.js} +1 -1
- package/dist/assets/{index-DsOZQCxX.js → index-BmgIzODJ.js} +1 -1
- package/dist/assets/{index-DfPrMmoZ.js → index-BsMctdy8.js} +1 -1
- package/dist/assets/{index-BxxgnmFX.js → index-BuQjZmfi.js} +1 -1
- package/dist/assets/{index-eYZIsLRo.js → index-C-p8VUs-.js} +1 -1
- package/dist/assets/{index-D_jr-SDL.js → index-CAv2tOhi.js} +1 -1
- package/dist/assets/{index-CHmcCDqZ.js → index-CEfdMhRs.js} +1 -1
- package/dist/assets/{index-CpuUG8Z1.js → index-CLAxAmz7.js} +1 -1
- package/dist/assets/{index-DWy1kjL1.js → index-CLPR7ihj.js} +1 -1
- package/dist/assets/{index-BzM5LY8-.js → index-CS7Cpww7.js} +1 -1
- package/dist/assets/{index-Cwp0FKW3.js → index-CeEola33.js} +2 -2
- package/dist/assets/{index-BIIfr0Cp.js → index-CoZAeEqA.js} +1 -1
- package/dist/assets/{index-Cisz7h7X.js → index-CsTazi5p.js} +1 -1
- package/dist/assets/{index-CRZ7_NI2.js → index-CtVrHc87.js} +1 -1
- package/dist/assets/{index-BDFC1sP1.js → index-CuYfzE9Z.js} +1 -1
- package/dist/assets/{index-ClxIMfsM.js → index-CyD53ctP.js} +1 -1
- package/dist/assets/{index-AKf23glP.js → index-DD8ntqdX.js} +1 -1
- package/dist/assets/{index-BP0DWBRY.js → index-DIS4k28C.js} +1 -1
- package/dist/assets/{index-C7egXf_h.js → index-DJuZ9nhg.js} +2 -2
- package/dist/assets/{index-rrAKD-3O.js → index-DQ7-a_Yl.js} +1 -1
- package/dist/assets/index-DQq1Zt3Z.js +1 -0
- package/dist/assets/{index-C31TKs2j.js → index-DUhy4qU3.js} +1 -1
- package/dist/assets/{index-B28OSLEk.js → index-DW2RdjBK.js} +1 -1
- package/dist/assets/{index-Dxww66F8.js → index-DX626HNP.js} +1 -1
- package/dist/assets/{index-CFw_f03A.js → index-DmvJyGWn.js} +1 -1
- package/dist/assets/{index-DbXGWrH9.js → index-DzOEPYi6.js} +9 -9
- package/dist/assets/{index-DnZwjPBr.js → index-E_CTV0v0.js} +1 -1
- package/dist/assets/{index-B5Z2178w.js → index-UhL8ZNVc.js} +3 -3
- package/dist/assets/{index-CgJV4oal.js → index-ZGV5ibHs.js} +1 -1
- package/dist/assets/{index-BkGL3dW2.js → index-apvSg0Un.js} +1 -1
- package/dist/assets/{index-BOBzLa1k.js → index-w74fQNNd.js} +1 -1
- package/dist/assets/{index.esm-DkqB0mnE.js → index.esm-CUQzywxe.js} +1 -1
- package/dist/assets/{install-from-url-DOR8ZaEG.js → install-from-url-D1dFcWCR.js} +1 -1
- package/dist/assets/{invitation-BOK3Xmtg.js → invitation-DFyK6TJC.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-Cl2onSKX.js → is-path-prefix-equal-CiLM8lGB.js} +1 -1
- package/dist/assets/{item-BQYMoVUI.js → item-TSYlBggO.js} +1 -1
- package/dist/assets/{javascript-BaLTUeT9.js → javascript-EM--ygX_.js} +1 -1
- package/dist/assets/{jsonMode-P_9C43Nc.js → jsonMode-DH-rRMEi.js} +1 -1
- package/dist/assets/{liquid-amkaEf3E.js → liquid-CPNnvOnm.js} +1 -1
- package/dist/assets/{list-header-DAiEDwhs.js → list-header-CSkrCQnJ.js} +1 -1
- package/dist/assets/{lock.svg-CNAb9wZc.js → lock.svg-f30K2Q3n.js} +1 -1
- package/dist/assets/{log-1_m4xF_N.js → log-BNvsxBZM.js} +1 -1
- package/dist/assets/{lottie-react.esm-BmVAhuIy.js → lottie-react.esm-DrKTtVJH.js} +1 -1
- package/dist/assets/{mdx-Bd0pfo5p.js → mdx-D8UbuZxT.js} +1 -1
- package/dist/assets/{memory-UJLIVuot.js → memory-C-FNQnOM.js} +1 -1
- package/dist/assets/{metric-DNUD7jbr.js → metric-DLT0xGvO.js} +1 -1
- package/dist/assets/omit-Cok1Xpup.js +1 -0
- package/dist/assets/{overview-DqrKT2dL.js → overview-BlGEtn8-.js} +1 -1
- package/dist/assets/{permission-ycsOOBwp.js → permission-DNpvmcDO.js} +1 -1
- package/dist/assets/{preference-BhfekBAB.js → preference-u7m9CcMY.js} +3 -3
- package/dist/assets/{python-B5XVaf0B.js → python-B8mnJBlR.js} +1 -1
- package/dist/assets/{raf-schd.esm-yET3NUrL.js → raf-schd.esm-YM3QK6AK.js} +1 -1
- package/dist/assets/{razor-TLp_5QYQ.js → razor-DojlprmT.js} +1 -1
- package/dist/assets/{rotate-session-key-B90qT4kq.js → rotate-session-key-CeXBuq4a.js} +1 -1
- package/dist/assets/{runtime-D_DvOf5h.js → runtime-DGPwslIs.js} +1 -1
- package/dist/assets/schema-KXHYgx_0.js +1 -0
- package/dist/assets/sdk-DfZRIh46.js +1 -0
- package/dist/assets/{service-DjmXGMON.js → service-MFlOMoBK.js} +1 -1
- package/dist/assets/{shorten-label-BOfK6p4p.js → shorten-label-DZAvaXjZ.js} +1 -1
- package/dist/assets/{simple-select-BZu6cCw3.js → simple-select-BOihC2wB.js} +1 -1
- package/dist/assets/{spaces-CNd41sir.js → spaces-C9qYfO4e.js} +1 -1
- package/dist/assets/{status-C32bwmXC.js → status-DD9VFS3g.js} +1 -1
- package/dist/assets/{status-DnBUY_P3.js → status-Mggvc_gJ.js} +1 -1
- package/dist/assets/{switch-control-Ce2o9ffJ.js → switch-control-C6Td5SBH.js} +1 -1
- package/dist/assets/{table-icons-BYT0kQuz.js → table-icons-LMjLX7nG.js} +1 -1
- package/dist/assets/{team-CxcPF7A7.js → team-CMHYwDgb.js} +1 -1
- package/dist/assets/{toLower-DJOalyNw.js → toLower-CTEP5nFX.js} +1 -1
- package/dist/assets/toUpper-BtDx3pcE.js +1 -0
- package/dist/assets/{traffic-C17ygInL.js → traffic-z7f03zNE.js} +1 -1
- package/dist/assets/{tsMode-YA-whx9N.js → tsMode-lGeC_vCj.js} +1 -1
- package/dist/assets/{typescript-Balm-M-7.js → typescript-DiGD7n7I.js} +1 -1
- package/dist/assets/{url-evaluation-w8X_lgzG.js → url-evaluation-PoqA_faF.js} +1 -1
- package/dist/assets/{url-join-3aXvW59g.js → url-join-C-ehcRI1.js} +1 -1
- package/dist/assets/{use-mobile-BxUSznYk.js → use-mobile-GbhQCYjE.js} +1 -1
- package/dist/assets/{use-mobile-IHqsUzt1.js → use-mobile-v5_YeznP.js} +1 -1
- package/dist/assets/{useAsync-Bkh8Rg6Z.js → useAsync-C9kvrJTF.js} +1 -1
- package/dist/assets/{useAsyncRetry-CwoOKXPC.js → useAsyncRetry-C1G4OCyZ.js} +1 -1
- package/dist/assets/{useLocalStorage-DZYDHTFQ.js → useLocalStorage-rIF260NZ.js} +1 -1
- package/dist/assets/{useThemeProps-Bs1lG48z.js → useThemeProps-CIXT-uHm.js} +1 -1
- package/dist/assets/{util-CC0K7Xya.js → util-daXkBzvl.js} +1 -1
- package/dist/assets/{wait-container-DeaT7Cuc.js → wait-container-DcvUvcI3.js} +1 -1
- package/dist/assets/{without-wallet-B5UEEmrQ.js → without-wallet-Cifhravr.js} +1 -1
- package/dist/assets/{wrap-locale-gBhiwBoM.js → wrap-locale-CTx-eXFm.js} +1 -1
- package/dist/assets/{xml-CZ5H3llM.js → xml-PLx49qdR.js} +1 -1
- package/dist/assets/{yaml-CL1tqltg.js → yaml-DrWuPUdc.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-aNeHE2A2.js +0 -1
- package/dist/assets/api-r-_fEWsI.js +0 -1
- package/dist/assets/client-Dj0WAiOq.js +0 -1
- package/dist/assets/cloneDeep-Dqj81-8-.js +0 -1
- package/dist/assets/emotion-cache.browser.esm-B4ZmPeHk.js +0 -1
- package/dist/assets/engine-BWGbIQAy.js +0 -1
- package/dist/assets/getValidReactChildren-DDB1J2y7.js +0 -1
- package/dist/assets/index-DVAwbdhJ.js +0 -1
- package/dist/assets/omit-DVVVCRDp.js +0 -1
- package/dist/assets/schema-Db5OWlWL.js +0 -1
- package/dist/assets/sdk-BZ4-wJ5p.js +0 -1
- package/dist/assets/toUpper-B5TzdczN.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 qe,j as t,ds as ws,gC as _s,ix as Ss,n as ce,bn as ye,M as O,ay as je,H as K,o as g,f as gt,r as R,g as we,bB as st,b as Ce,i as X,V as Bn,bA as ft,X as xe,iy as Es,v as ve,s as oe,a3 as me,aV as io,T as le,$ as Yt,dH as mt,z as ke,b8 as ks,bF as Rs,aH as H,b1 as Ts,gp as Ps,gq as Is,C as be,f5 as ao,hz as Fn,y as Ds,aw as Gt,x as Bs,iz as Os,iA as Us,w as Be,iB as Ns,Y as Ls,_ as As,iC as lo,bo as co,R as Ne,f7 as Ms,f2 as zs,aA as qs,aB as Fs,bk as $s,aC as Ws,aD as fe,aO as Hs,cO as Gs,S as Ks,eO as sr,bi as Vs,h as Ys,dw as It,iD as Zs,g2 as uo,iE as Qs,iF as Xs,ez as pe,iG as po,dF as Js,gR as ei,he as ti,fS as ni,iH as ri,cF as ir,hu as $n,au as oi,dI as Zt,dp as Me,br as si,bs as ar,A as fo,cr as ii,G as ze,aP as lr,fP as mo,cs as Ke,ha as ai,bz as kt,ck as cr,hC as li,fm as dr,bg as ci,L as xt,F as ho,bm as di,Z as ui,N as Rt,aZ as Wn,iI as pi,a_ as Le,az as ur,cM as fi,ac as it,aM as go,bT as Hn,cx as mi,iJ as hi,b9 as gi,B as xo,aU as On,p as xi,aS as ut,O as un,W as yi,bC as yo,aJ as vi,bu as Ci,aR as bi,fd as pr,ga as fr,gb as mr,U as hr,cL as ji,gc as wi,bS as _i,iK as Si}from"./index-C7egXf_h.js";import{y as Ei}from"./index-BxxgnmFX.js";import{a as ki,c as Ri,d as Ti,u as Gn,R as Pi}from"./actions-BBls_wa0.js";import{S as Ii}from"./switch-control-Ce2o9ffJ.js";import{u as De}from"./blocklet-C67aFvl7.js";import{P as Un,w as Qt}from"./permission-ycsOOBwp.js";import{E as vo}from"./Edit-CLiO2h_l.js";import{T as Di,M as Bi,t as Oi}from"./table-icons-BYT0kQuz.js";import{s as Ui,F as Co,L as Ni,I as Li,a as Tt,S as Ai,B as Mi}from"./preference-BhfekBAB.js";import{C as gr}from"./click-to-copy-D50kkiW4.js";import{v as pn}from"./index-C-1MOEs6.js";import{A as zi}from"./Add-CQt7mq1G.js";import{A as Xt}from"./Link-DKb1MvxW.js";import{C as qi,c as Fi,b as $i,f as bo,A as Wi,_ as Hi,a as Gi,e as Ki,d as jo,s as Vi,L as Yi,u as Zi,g as Qi,S as Xi}from"./item-BQYMoVUI.js";import{T as Ji,L as ea,a as Nn,u as xr,W as ta,P as na}from"./index-BIIfr0Cp.js";import{e as wo}from"./engine-BWGbIQAy.js";import{u as ra,C as oa,D as sa,a as ia,b as aa}from"./connect-to-Dz9eH_td.js";import{C as la,u as ca,A as da}from"./agreement-B9tSzjmL.js";import{A as ua,a as pa,b as fa,c as ma,R as ot,S as dt}from"./collapse-UPIFGGD9.js";import{D as _o}from"./Done-yHCWLz6K.js";import{C as ha}from"./Google-KOeLJ7n-.js";import{I as So,f as ga,a as xa,B as ya}from"./install-from-url-DOR8ZaEG.js";import{a as yr}from"./api-r-_fEWsI.js";import{v as Eo,e as va,a as Kt}from"./util-CC0K7Xya.js";import{u as ko}from"./use-mobile-BxUSznYk.js";import{A as Ca}from"./ArrowDropDown-aNeHE2A2.js";import{u as ba}from"./useLocalStorage-DZYDHTFQ.js";import{r as Jt}from"./index-AKf23glP.js";import{b as en}from"./without-wallet-B5UEEmrQ.js";import{E as Ro}from"./ErrorOutline-B_qBOUnI.js";import{H as ja}from"./HelpOutline-BXdmHwaP.js";import{C as wa}from"./lock.svg-CNAb9wZc.js";import{D as tn,R as _a,a as vr}from"./url-evaluation-w8X_lgzG.js";import{L as To}from"./Launch-cxvym2iP.js";import{D as Sa}from"./delete-confirm-cbt-tN11.js";import{W as ht,B as Ln}from"./status-C32bwmXC.js";import{A as Po}from"./actions-DaOidt88.js";import{v as fn}from"./index-DWy1kjL1.js";import{t as Ea}from"./toUpper-B5TzdczN.js";import{S as ka}from"./Switch-CE03jZ_8.js";import{a as Ra}from"./team-CxcPF7A7.js";import"./MoreVert-bx--E19j.js";import"./get-safe-url-CteWIr5a.js";import"./ButtonGroup-9zvLC_k0.js";import"./getValidReactChildren-DDB1J2y7.js";import"./FilterList-BOMn8eqm.js";import"./CSSTransition-dwX1-RMJ.js";import"./emotion-cache.browser.esm-B4ZmPeHk.js";import"./index-DBii9-f-.js";import"./typeof-QjJsDpFa.js";import"./raf-schd.esm-yET3NUrL.js";import"./redux-DfszZyTl.js";import"./useThemeProps-Bs1lG48z.js";import"./html-title-vsl-TT26.js";import"./Clear-B-e33dNn.js";import"./ChevronRight-X_FMXVA4.js";import"./ChevronLeft-Bmmo6bzu.js";import"./Search-Dm2dt-Sr.js";import"./omit-DVVVCRDp.js";import"./edit.svg-BHG50OdM.js";import"./index-DnZwjPBr.js";import"./iframe-Dl-yNrp9.js";import"./index-CC45e4UO.js";import"./KeyboardArrowDown-CdK82Qsb.js";import"./Autocomplete-Bf1Ho3Hd.js";import"./ListSubheader-FJVGwx1O.js";import"./Verified-B-cFyGP0.js";import"./VerifiedUser-aSWRZr_Y.js";import"./DeleteOutline-CIuy8JMu.js";import"./url-join-3aXvW59g.js";import"./index-BojVbZw0.js";import"./spaces-CNd41sir.js";import"./OpenInNew-BdVhgoOc.js";import"./index-DRYJ0xIl.js";import"./index-Cisz7h7X.js";import"./decode-DPztD6kB.js";import"./cloneDeep-Dqj81-8-.js";import"./ListItemButton-E5H4lrRx.js";import"./Stepper-B1wBWjZo.js";import"./is-path-prefix-equal-Cl2onSKX.js";const Ta=qe(t.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"})),Pa=qe(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"})),Io=qe(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=qe(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"})),Do=qe(t.jsx("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"})),Da=qe(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=qe(t.jsx("path",{d:"M5 20h14v-2H5zm0-10h4v6h6v-6h4l-7-7z"})),Oa=qe(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=qe(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 Cr(e,n){var r={};return n=ws(n),_s(e,function(i,a,o){Ss(r,a,n(i,a,o))}),r}function Bo({children:e=null,...n}){const{t:r}=ce(),{api:i}=ye(),{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}),K.success(r(l?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(l){K.error(l.message)}},d=!!o?.enabled;return t.jsxs(O,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e,t.jsx(je,{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}})})})]})}Bo.propTypes={children:g.any};function br(e){function n({sx:r,...i}){return t.jsx(e,{...i,sx:{color:"text.primary",...r}})}return n}const Na={...Cr(Oi,br),...Cr(ki,br)},La=(e,n)=>{let{description:r}=e;return(Object.values(Ce.CHAIN_PROP_MAP).includes(e.key)||X.isEnvShareable(e))&&(r?r=`${r} (${n("blocklet.config.sharedToAllComponents")})`:r=n("blocklet.config.sharedToAllComponents")),r&&t.jsx("div",{style:{marginLeft:12},children:r})},mn=(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,jr=e=>[Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)?!0:!(e.startsWith("BLOCKLET_")||e.startsWith("COMPONENT_")),hn=e=>[Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)===!1;function Oo({blocklet:e,ancestors:n=[]}){const r=ye(),{palette:i}=gt(),{inService:a}=r,{t:o}=R.useContext(we),m=[...n.map(s=>s.meta.did),e.meta.did],c=()=>K.success(o("blocklet.config.changedTip")),d=s=>mn(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()){K.error(o("blocklet.config.environment.keyValueRequired")),b();return}if(jr(s.key)===!1){K.error(o("blocklet.config.environment.invalidKey")),b();return}s.custom=hn(s.key);try{const T=await r.api.configBlocklet({input:{did:m,configs:[s]}});c(T.blocklet),h()}catch(T){K.error(xe(T)),b()}}),v=(s,h)=>new Promise(async(b,T)=>{if(s.required&&(!s.key.trim()||!s.value.trim())){K.error(o("blocklet.config.environment.keyValueRequired")),T();return}if(jr(s.key)===!1){K.error(o("blocklet.config.environment.invalidKey")),T();return}if(s.key===Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const M=Es(s);if(M){K.error(M),T();return}}const k=[{...s,value:s.secure&&s.value==="__encrypted__"?"":s.value}];if(s.key!==h.key){if(!mn(s,e,n)){K.error("Only key of custom env can be changed"),T();return}k.push({key:h.key,custom:hn(s.key)})}try{const M=await r.api.configBlocklet({input:{did:m,configs:k}});c(M.blocklet),b()}catch(M){K.error(xe(M)),T()}}),p=s=>new Promise(async(h,b)=>{if(s.required){K.error(o("blocklet.config.environment.deleteForbidden")),b();return}if(!mn(s,e,n)){K.error(o("environmentTips.deleteForbidden")),b();return}try{const T=await r.api.configBlocklet({input:{did:m,configs:[{key:s.key,custom:hn(s.key)}]}});c(T.blocklet),h()}catch(T){K.error(xe(T)),b()}}),C=(e.configs||[]).filter(s=>!Ce.BLOCKLET_CONFIGURABLE_KEY[s.key]||[Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(s.key)),f=X.getSharedConfigObj(n[0],e),x=X.getComponentMissingConfigs(e,n[0]),_=C.map(s=>({...s,value:Object.values(Ce.CHAIN_PROP_MAP).includes(s.key)&&Object.keys(f).includes(s.key)?f[s.key]:f[s.key]||s.value})),w=_.some(s=>s.key&&s.key.startsWith("BWA_")),S={onRowAdd:l,onRowUpdate:v,onRowDelete:p,isDeletable:d},u=()=>[{title:o("common.key"),field:"key",initialEditValue:"",width:"30%",render:s=>t.jsx(gr,{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:T}=s;return t.jsx(wr,{children:t.jsx(ve,{fullWidth:!0,size:"small",value:Ui.escapeTag(h),onChange:k=>T(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(gr,{unstyled:!0,value:s.value,style:{wordBreak:"break-all"},children:s.value}):null,editComponent:s=>{const{value:h,rowData:b,onChange:T}=s;return t.jsxs(wr,{children:[t.jsx(ve,{fullWidth:!0,size:"small",value:h==="__encrypted__"?"":h,onChange:k=>T(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:[!!x.length&&t.jsx(Bn,{severity:"error",style:{marginTop:24},children:o("blocklet.config.missingRequired")}),w&&t.jsx(Bn,{severity:"info",children:o("blocklet.config.environment.tip")}),t.jsx(Un,{permission:a?"":"mutate_blocklets",role:a?ft:[],children:s=>t.jsx(Di,{className:"config-table",children:t.jsx(Bi,{title:t.jsx(O,{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:_,editable:s?S:{}})})})]})}Oo.propTypes={blocklet:g.object.isRequired,ancestors:g.array};const Aa=oe.div`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-UhL8ZNVc.js","./index-DJuZ9nhg.js","./index-DGkT7afN.css","./url-join-C-ehcRI1.js","./index-DD8ntqdX.js","./_createAggregator-CT54gRWr.js","./depsEqual-DfTLPdgg.js","./index-E_CTV0v0.js","./index-DRYJ0xIl.js","./toUpper-BtDx3pcE.js","./index-B5LvOF-F.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{aF as qe,j as t,ds as ws,gC as _s,ix as Ss,n as ce,bn as ye,M as O,ay as je,H as K,o as g,f as gt,r as R,g as we,bB as st,b as Ce,i as X,V as On,bA as ft,X as xe,iy as Es,v as ve,s as oe,a3 as me,aV as ao,T as le,$ as Yt,dH as mt,z as ke,b8 as ks,bF as Rs,aH as H,b1 as Ts,gp as Ps,gq as Is,C as be,f5 as lo,hz as $n,y as Ds,aw as Gt,x as Bs,iz as Os,iA as Us,w as Be,iB as Ns,Y as Ls,_ as As,iC as co,bo as uo,R as Ne,f7 as Ms,f2 as zs,aA as qs,aB as Fs,bk as $s,aC as Ws,aD as fe,aO as Hs,cO as Gs,S as Ks,eO as ir,bi as Vs,h as Ys,dw as It,iD as Zs,g2 as po,iE as Qs,iF as Xs,ez as pe,iG as fo,dF as Js,gR as ei,he as ti,fS as ni,iH as ri,cF as ar,hu as Wn,au as oi,dI as Zt,dp as Me,br as si,bs as lr,A as mo,cr as ii,G as ze,aP as cr,fP as ho,cs as Ke,ha as ai,bz as kt,ck as dr,hC as li,fm as ur,bg as ci,L as xt,F as go,bm as di,Z as ui,N as Rt,aZ as Hn,iI as pi,a_ as Le,az as pr,cM as fi,ac as it,aM as xo,bT as Gn,cx as mi,iJ as hi,b9 as gi,B as yo,aU as Un,p as xi,aS as ut,O as pn,W as yi,bC as vo,aJ as vi,bu as Ci,aR as bi,fd as fr,ga as mr,gb as hr,U as gr,cL as ji,gc as wi,bS as _i,iK as Si}from"./index-DJuZ9nhg.js";import{y as Ei}from"./index-BuQjZmfi.js";import{a as ki,c as Ri,d as Ti,u as Kn,R as Pi}from"./actions-Bkf_XgjE.js";import{S as Ii}from"./switch-control-C6Td5SBH.js";import{u as De}from"./blocklet-qrkDxr_e.js";import{P as Nn,w as Qt}from"./permission-DNpvmcDO.js";import{E as Co}from"./Edit-T8wWfQhn.js";import{T as Di,M as Bi,t as Oi}from"./table-icons-LMjLX7nG.js";import{s as Ui,F as bo,L as Ni,I as Li,a as Tt,S as Ai,B as Mi}from"./preference-u7m9CcMY.js";import{C as xr}from"./click-to-copy-Pl4hIypx.js";import{v as fn}from"./index-0Dj9yC88.js";import{A as zi}from"./Add-C8Lm-hkR.js";import{A as Xt}from"./Link-C1xLiB79.js";import{C as qi,c as Fi,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-TSYlBggO.js";import{T as Ji,L as ea,a as Ln,u as yr,W as ta,P as na}from"./index-CoZAeEqA.js";import{e as _o}from"./engine-CXYcW8tV.js";import{u as ra,C as oa,D as sa,a as ia,b as aa}from"./connect-to-Bi6Hyl3q.js";import{C as la,u as ca,A as da}from"./agreement-V0j80REH.js";import{A as ua,a as pa,b as fa,c as ma,R as ot,S as dt}from"./collapse-DASgp2d0.js";import{D as So}from"./Done-C3L_U1d0.js";import{C as ha}from"./Google-DT749Dih.js";import{I as Eo,f as ga,a as xa,B as ya}from"./install-from-url-D1dFcWCR.js";import{a as vr}from"./api-CUhmsggO.js";import{v as ko,e as va,a as Kt}from"./util-daXkBzvl.js";import{u as Ro}from"./use-mobile-GbhQCYjE.js";import{A as Ca}from"./ArrowDropDown-D3yioOpG.js";import{u as ba}from"./useLocalStorage-rIF260NZ.js";import{r as Jt}from"./index-DD8ntqdX.js";import{b as en}from"./without-wallet-Cifhravr.js";import{E as To}from"./ErrorOutline-DDgW0IIs.js";import{H as ja}from"./HelpOutline-Y8yJx9_1.js";import{C as wa}from"./lock.svg-f30K2Q3n.js";import{D as tn,R as _a,a as Cr}from"./url-evaluation-PoqA_faF.js";import{L as Po}from"./Launch-CbU-zIFy.js";import{D as Sa}from"./delete-confirm-B-r93j03.js";import{W as ht,B as An}from"./status-DD9VFS3g.js";import{A as Io}from"./actions-BTo9FCWY.js";import{v as mn}from"./index-CLPR7ihj.js";import{t as Ea}from"./toUpper-BtDx3pcE.js";import{S as ka}from"./Switch-DVmHUng5.js";import{a as Ra}from"./team-CMHYwDgb.js";import"./MoreVert-Dt9p1lZE.js";import"./get-safe-url-CumOcp7c.js";import"./ButtonGroup-0m6xN_hM.js";import"./getValidReactChildren-BKEsPaXS.js";import"./FilterList-DOx5uN4S.js";import"./CSSTransition-r6UVh1d4.js";import"./emotion-cache.browser.esm-DZEVfVIs.js";import"./index-DBii9-f-.js";import"./typeof-QjJsDpFa.js";import"./raf-schd.esm-YM3QK6AK.js";import"./redux-DfszZyTl.js";import"./useThemeProps-CIXT-uHm.js";import"./html-title-3CG5UyIt.js";import"./Clear-Dm80eYkN.js";import"./ChevronRight-CBhWmXPb.js";import"./ChevronLeft-vJUfXHLK.js";import"./Search-DUF2osvO.js";import"./omit-Cok1Xpup.js";import"./edit.svg-BLR5epzr.js";import"./index-E_CTV0v0.js";import"./iframe-aJ3sDUVb.js";import"./index-BOjR9vg6.js";import"./KeyboardArrowDown-Vjm82N0l.js";import"./Autocomplete-BQrCutXD.js";import"./ListSubheader-DBKVdByu.js";import"./Verified-RZDxPBl3.js";import"./VerifiedUser-C5GKL4NI.js";import"./DeleteOutline-DBp8IxLy.js";import"./url-join-C-ehcRI1.js";import"./index-BojVbZw0.js";import"./spaces-C9qYfO4e.js";import"./OpenInNew-SrFDopIl.js";import"./index-DRYJ0xIl.js";import"./index-CsTazi5p.js";import"./decode-DPztD6kB.js";import"./cloneDeep-LYTwa-JV.js";import"./ListItemButton-ClnowAwh.js";import"./Stepper-CTMouRdp.js";import"./is-path-prefix-equal-CiLM8lGB.js";const Ta=qe(t.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"})),Pa=qe(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=qe(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=qe(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=qe(t.jsx("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"})),Da=qe(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=qe(t.jsx("path",{d:"M5 20h14v-2H5zm0-10h4v6h6v-6h4l-7-7z"})),Oa=qe(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=qe(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}=ye(),{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}),K.success(r(l?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(l){K.error(l.message)}},d=!!o?.enabled;return t.jsxs(O,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e,t.jsx(je,{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:g.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(Ce.CHAIN_PROP_MAP).includes(e.key)||X.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=>[Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)?!0:!(e.startsWith("BLOCKLET_")||e.startsWith("COMPONENT_")),gn=e=>[Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)===!1;function Uo({blocklet:e,ancestors:n=[]}){const r=ye(),{palette:i}=gt(),{inService:a}=r,{t:o}=R.useContext(we),m=[...n.map(s=>s.meta.did),e.meta.did],c=()=>K.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()){K.error(o("blocklet.config.environment.keyValueRequired")),b();return}if(wr(s.key)===!1){K.error(o("blocklet.config.environment.invalidKey")),b();return}s.custom=gn(s.key);try{const T=await r.api.configBlocklet({input:{did:m,configs:[s]}});c(T.blocklet),h()}catch(T){K.error(xe(T)),b()}}),v=(s,h)=>new Promise(async(b,T)=>{if(s.required&&(!s.key.trim()||!s.value.trim())){K.error(o("blocklet.config.environment.keyValueRequired")),T();return}if(wr(s.key)===!1){K.error(o("blocklet.config.environment.invalidKey")),T();return}if(s.key===Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const M=Es(s);if(M){K.error(M),T();return}}const k=[{...s,value:s.secure&&s.value==="__encrypted__"?"":s.value}];if(s.key!==h.key){if(!hn(s,e,n)){K.error("Only key of custom env can be changed"),T();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){K.error(xe(M)),T()}}),p=s=>new Promise(async(h,b)=>{if(s.required){K.error(o("blocklet.config.environment.deleteForbidden")),b();return}if(!hn(s,e,n)){K.error(o("environmentTips.deleteForbidden")),b();return}try{const T=await r.api.configBlocklet({input:{did:m,configs:[{key:s.key,custom:gn(s.key)}]}});c(T.blocklet),h()}catch(T){K.error(xe(T)),b()}}),C=(e.configs||[]).filter(s=>!Ce.BLOCKLET_CONFIGURABLE_KEY[s.key]||[Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(s.key)),f=X.getSharedConfigObj(n[0],e),x=X.getComponentMissingConfigs(e,n[0]),_=C.map(s=>({...s,value:Object.values(Ce.CHAIN_PROP_MAP).includes(s.key)&&Object.keys(f).includes(s.key)?f[s.key]:f[s.key]||s.value})),w=_.some(s=>s.key&&s.key.startsWith("BWA_")),S={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:T}=s;return t.jsx(_r,{children:t.jsx(ve,{fullWidth:!0,size:"small",value:Ui.escapeTag(h),onChange:k=>T(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:T}=s;return t.jsxs(_r,{children:[t.jsx(ve,{fullWidth:!0,size:"small",value:h==="__encrypted__"?"":h,onChange:k=>T(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:[!!x.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(O,{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:_,editable:s?S:{}})})})]})}Uo.propTypes={blocklet:g.object.isRequired,ancestors:g.array};const Aa=oe.div`
|
|
3
3
|
.config-table {
|
|
4
4
|
margin-bottom: 24px;
|
|
5
5
|
position: relative;
|
|
@@ -51,9 +51,9 @@ import{aF as qe,j as t,ds as ws,gC as _s,ix as Ss,n as ce,bn as ye,M as O,ay as
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
`,
|
|
54
|
+
`,_r=oe.div`
|
|
55
55
|
height: 60px;
|
|
56
|
-
`;function
|
|
56
|
+
`;function Vn({open:e=!1,onClose:n=null,hiddenChildren:r=!1,blocklet:i,ancestors:a=[],children:o=null}){const[m,c]=R.useState(!1),{t:d}=ce(),l=d("environmentFor",{name:X.getDisplayName(i,!0)});if(st(i.status)||i.status==="unknown"&&st(i.status))return null;const v=()=>{n?.(),c(!1)},p=f=>{f.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||m)&&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:X.getDisplayName(i,!0)})}),t.jsx(Uo,{blocklet:i,ancestors:a})]})})]})}Vn.propTypes={blocklet:g.object.isRequired,ancestors:g.array,children:g.any,open:g.bool,onClose:g.func,hiddenChildren:g.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 qe,j as t,ds as ws,gC as _s,ix as Ss,n as ce,bn as ye,M as O,ay as
|
|
|
66
66
|
.ux-dialog_closeButton {
|
|
67
67
|
margin: 0;
|
|
68
68
|
}
|
|
69
|
-
`,za=R.lazy(()=>Rs(()=>import("./index-
|
|
69
|
+
`,za=R.lazy(()=>Rs(()=>import("./index-UhL8ZNVc.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}))),qa="/blocklet/component/upload",Sr=[".html",".htm",".tgz",".zip"],Fa=Number(window.env?.MAX_UPLOAD_FILE_SIZE)||H.MAX_UPLOAD_FILE_SIZE,$a=Fa*1024*1024;function No({did:e,prefix:n,headers:r=()=>({}),onUploaded:i=mt,open:a=!1,onClose:o=mt}){const{t:m,locale:c}=ce(),d=R.useRef(null),l=R.useCallback(v=>{const{status:p,data:C}=v;if(p===200){i(C);return}K.error(m("blocklet.component.addComponentTip.uploadFailed"))},[i,m]);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:ke(n,qa,e),disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:Sr,maxFileSize:$a,maxNumberOfFiles:1}},tusProps:{headers:r},dashboardProps:{note:m("blocklet.component.addComponentTip.allowedFileTypes",{types:Sr.map(v=>v.replace(".","")).join(", ")})}})},`component-uploader-${e}`)}No.propTypes={did:g.string.isRequired,prefix:g.string.isRequired,open:g.bool,headers:g.func,onUploaded:g.func,onClose:g.func};const Wa=ks(O)`
|
|
70
70
|
.uploader-wrapper {
|
|
71
71
|
display: inline-flex;
|
|
72
72
|
position: relative;
|
|
@@ -94,7 +94,7 @@ import{aF as qe,j as t,ds as ws,gC as _s,ix as Ss,n as ce,bn as ye,M as O,ay as
|
|
|
94
94
|
transition: opacity 0.3s ease;
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
`,
|
|
97
|
+
`,Yn={description:g.string,editing:g.bool,onChange:g.func,required:g.bool,value:g.any,componentProps:g.object,render:g.func,renderFormItem:g.func};function Zn({editing:e,value:n,onChange:r}){const[i,a]=R.useState(!1),o=R.useRef(),m=R.useRef(n);R.useEffect(()=>{let p=null;return e&&(p=setTimeout(()=>{a(!0)},50)),()=>{clearTimeout(p)}},[e]);const c=p=>{m.current=p,r(p)},d=()=>{a(!1),r(m.current)},l=t.jsx(O,{className:"form-item-input slot",sx:{px:1},children:t.jsxs(O,{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(O,{onKeyDown:d,sx:{display:"flex",flexGrow:1,alignItems:"center",height:"40px"},children:[t.jsx(O,{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(Ts,{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:m}=a,c=R.useRef(r),{t:d}=R.useContext(we),l=p=>{p.key==="Enter"&&i(c.current,"confirm")},v=p=>{c.current=p,i(p)};return e?t.jsx(ve,{style:{flex:1},fullWidth:!0,value:r,onChange:p=>{p.persist(),v(p.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:n||m,onKeyDown:l,...o}):t.jsx(O,{className:"form-item-input slot",sx:{px:1},children:r||t.jsx("span",{className:"placeholder",children:d("common.requiredInputPlaceholder",{name:n||m})})})}Lo.propTypes=Yn;function Ao({editing:e,value:n,onChange:r,componentProps:i,...a}){const{blocklet:o}=i,m=n==="auto"?Ps(o.appDid):n;return t.jsxs(O,{sx:{display:"flex",alignItems:"center"},children:[t.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Is({title:"Owner",issuer:X.getDisplayName(o),issuerDid:o.appDid,ownerName:"Your Name",ownerDid:o.appDid,preferredColor:n||"auto"})}}),t.jsx(Zn,{...a,editing:e,value:e?m:n,onChange:r,componentProps:i})]})}Ao.propTypes={...Yn,componentProps:g.shape({blocklet:g.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 qe,j as t,ds as ws,gC as _s,ix as Ss,n as ce,bn as ye,M as O,ay as
|
|
|
104
104
|
25%, 75% {
|
|
105
105
|
transform: scale(1.1) translateX(3px);
|
|
106
106
|
}
|
|
107
|
-
`,Ga={input:
|
|
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:g.object.isRequired,findEditingItem:g.func.isRequired,getItemValue:g.func.isRequired,onFormItemChange:g.func.isRequired,onFocusOut:g.func.isRequired,disabled:g.bool,loading:g.bool,onCancel:g.func,formValues:g.object.isRequired};function Qn({item:e,findEditingItem:n,getItemValue:r,onFormItemChange:i,onFocusOut:a,disabled:o=!1,loading:m=!1,onCancel:c=()=>{},formValues:d}){const{key:l,description:v,required:p,solo:C=!1,hidden:f=!1,componentProps:x={},skipButtonDisabled:_=!1}=e;if(f)return null;const w=n(l),{editing:S,shaking:u}=w??{},s=r(e,{editing:S}),h=Ka(e,{editing:S}),b={inputProps:{"data-cy":"schema-form-item-component"},key:l,description:v,editing:S,value:s,onChange:(T,k="change")=>i(e,T,k),componentProps:x,skipButtonDisabled:_,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(T=>t.jsx(Qn,{item:T,findEditingItem:n,getItemValue:r,onFormItemChange:i,onFocusOut:a,formValues:d,disabled:o,loading:m,onCancel:c},T.key))})]}):t.jsxs(O,{className:"form-item",children:[!C&&t.jsxs(O,{className:"form-item-label",sx:{color:p&&!s?"error.main":"text.secondary"},children:[v,p&&t.jsx(ot,{})]}),t.jsxs(O,{className:"form-item-body",children:[t.jsx(O,{className:"form-item-input","data-cy":"schema-form-item-edit",sx:{textAlign:C?"center":"left"},style:{cursor:"text"},onClick:()=>{o||w?.edited||_||i(e,d[l],"edit")},children:t.jsx(h,{...b})}),!C&&t.jsx(O,{className:"form-item-action",style:{marginLeft:0},children:S?t.jsxs(t.Fragment,{children:[w.edited?t.jsx(me,{"data-cy":"schema-form-item-confirm",onClick:()=>{i(e,s,"confirm")},disabled:o||m,sx:{animation:u?`${Ha} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:m?t.jsx(be,{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||m,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:m=!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]),f=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 x=R.useCallback(h=>{l(b=>b.find(k=>k.key===h.key)?b.map(k=>k.key===h.key?h:{...k}):[h].concat(b))},[]),_=R.useCallback((h,b,T)=>{const{key:k,secure:M}=h,z=f(k)??{...h};z.editing=!0;const D=v[k]!==b;z.edited=b&&z.initialValue!==b,z.initialValue=i[k];const I={...v,[k]:b};D&&p(I),a({[k]:b},{allValues:I,action:T,currentItem:h}),T==="confirm"&&M&&p({...v,[k]:"__encrypted__"}),T==="confirm"&&(z.initialValue=v[k]),["confirm","cancel"].includes(T)&&(z.editing=!1,z.edited=!1),x(z)},[i,v,a,x,f]),w=R.useCallback((h,{editing:b=!1})=>{const{key:T}=h,k=c?r[T]:v[T];return k==="__encrypted__"?b?"":"******":k},[c,r,v]),S=R.useCallback(h=>{const b=f(h.key);b&&_(h,b.initialValue,"cancel")},[f,_]),u=R.useCallback(h=>{const b=f(h.key);!b||!b.edited||(b.shaking=!0,x(b),setTimeout(()=>{b.shaking=!1,x(b)},500))},[f,x]),s=R.useCallback(h=>{const b=f(h.key);!b||!b.edited?S(h):u(h)},[f,u,S]);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:f,getItemValue:w,onFormItemChange:_,onFocusOut:s,formValues:v,disabled:m,loading:n,onCancel:S})})})}Mo.propTypes={schema:g.array.isRequired,loading:g.bool,onChange:g.func.isRequired,value:g.object,defaultValue:g.object,style:g.object,disabled:g.bool};const Va=oe(bo)``;function zo({meta:e,onCancel:n,mode:r,handlePaySuccess:i=()=>{}}){const{t:a,locale:o}=ce(),{info:m}=ye(),c=Ds(m),[d,l]=R.useState(null),v=new URL(e?.registryUrl).origin,p=X.getDisplayName({meta:e}),C=async(x,_)=>{const w=({downloadTokenList:s})=>{i({downloadTokenList:s})},S=s=>{K.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 S(a("blocklet.component.missDownloadTokenTip")),!0;return!0}return h.status==="error"?(console.error("vc error: ",h),await S(h?.error),!0):!1}),{interval:1e3})}if(r==="purchase"&&d){const{statusUrl:s}=Os(d);await u(s)}else await w({downloadTokenList:x.downloadTokenList&&_(x.downloadTokenList)})};if(R.useEffect(()=>{if(r==="purchase"){const x=new URL(v);x.pathname="/api/did/verify-purchase-blocklet/token",x.searchParams.set("serverDid",m.did),x.searchParams.set("blockletDid",e?.did);try{vr.get(x.href).then(({data:_})=>{const w=`${_.url}`;l(w)})}catch(_){console.error("get next workflow url error: ",_)}}return()=>{l(null)}},[r]),r==="purchase"&&!d)return"";const f={verify:{action:"verify-purchase-blocklet",checkFn:Gt.create({baseURL:v}).get,extraParams:{serverDid:m.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:ke(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,...f[r]})}zo.propTypes={...Fi,handlePaySuccess:g.func,mode:g.oneOf(["verify","purchase"]).isRequired};function qo({ref:e=null,mode:n,...r}){const[i,a]=R.useState(n!=="both"?n:"verify"),[o,m]=R.useState(n!=="both"?2:1),c=l=>{l!==i&&a(l)},d=()=>{i&&o!==2&&m(2)};return R.useImperativeHandle(e,()=>({onNext:d,getCurrentStep:()=>o})),o===1?t.jsx("div",{style:{maxWidth:520},children:t.jsx(qi,{action:i,onNext:null,onSelect:c})}):t.jsx(zo,{...r,mode:i})}qo.propTypes={mode:g.oneOf(["both","verify","purchase"]).isRequired,ref:g.any};function Ya({...e}){return t.jsx(Be,{className:"bottom-button",variant:"contained",color:"primary",...e})}function Fo({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(O,{sx:{display:"flex",alignItems:"center"},children:r})]})}Fo.propTypes={blocklet:g.object,onStartNow:g.func,children:g.any,disabled:g.bool};const Za=oe(O)`
|
|
108
108
|
width: 100%;
|
|
109
109
|
margin-top: auto;
|
|
110
110
|
padding-top: 24px;
|
|
@@ -149,12 +149,12 @@ import{aF as qe,j as t,ds as ws,gC as _s,ix as Ss,n as ce,bn as ye,M as O,ay as
|
|
|
149
149
|
justify-content: space-between;
|
|
150
150
|
gap: '32px',
|
|
151
151
|
}}
|
|
152
|
-
`;function
|
|
152
|
+
`;function $o({blockletMeta:e,onEndpointUpdate:n=()=>{}}){const r=Ro(),{blocklet:i}=De(),{updateSpaceGateway:a,loading:o,hasStorageEndpoint:m}=ra();return R.useEffect(()=>{n?.()},[i]),o?t.jsx(Ls,{relative:"parent",children:t.jsx(be,{})}):t.jsxs(Xa,{children:[t.jsx(O,{sx:{width:r?"360px":"720px"},children:m?t.jsx(oa,{}):t.jsx(sa,{})}),e?.capabilities?.didSpace==="required"&&t.jsx(Fo,{mt:8,children:t.jsx(ia,{onConnect:a})})]})}$o.propTypes={blockletMeta:g.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
|
|
157
|
+
`;function Wo({onChange:e=()=>{},loading:n=!1,children:r,extra:i="",stores:a=[],storageKey:o=""}){const{t:m}=ce(),{info:c,inService:d}=ye(),{blocklet:l}=De(),[v,p]=R.useState(!1),C=R.useRef(null),[f,x]=R.useState(),[_,w]=ba(o||"tmp"),[S,u]=o?[_,w]:[f,x],{storeList:s,teamDid:h}=co({fromBlocklet:d,blocklet:l,nodeInfo:c}),b=uo([...a.map(k=>({...k,protected:!0})),...s],"url"),T=S&&b.find(k=>S===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:T.name})}),t.jsx(le,{color:"primary",children:i})]}),t.jsxs(ve,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:m("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:T,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:()=>{S===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:T})]})}Wo.propTypes={onChange:g.func,loading:g.bool,children:g.any.isRequired,extra:g.node,storageKey:g.string,stores:g.arrayOf(g.shape({name:g.string.isRequired,url:g.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 qe,j as t,ds as ws,gC as _s,ix as Ss,n as ce,bn as ye,M as O,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)=>ke(n,`/blocklets/${e.did}`),
|
|
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)=>ke(n,`/blocklets/${e.did}`),Er=({blocklet:e,attribute:n,value:r})=>e._formatted?e._formatted[n]:r,ol=e=>e.inStore&&X.isFreeBlocklet(e)===!1;function Ho({blocklet:e,blocklets:n=[],handleButtonClick:r=null,endpoint:i="",serverVersion:a=""}){const{t:o}=ce();let m=ke(i,Ws(e.did,e.logo||""));try{const w=new URL(m);w.searchParams.set("v",e.version||+new Date),m=w.href}catch{}const[c,d]=R.useState(!1),l=async()=>{try{d(!0),await r({meta:e,registryUrl:i,blocklets:n})}catch(w){K.error(w.message)}finally{d(!1)}},{blocklet:v}=De(),p=()=>(v?.children||[]).find(u=>u.meta.bundleDid===e.did).meta.version,f=(()=>{const w=(v?.children||[]).find(S=>S.meta.bundleDid===e.did);if(w){try{const S=w.meta.version,u=e.version;if(Hs.gt(u,S))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),x=e.requirements?.server,_=[];return f==="upgrade"?_.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(O,{sx:{fontWeight:"bold"},children:o("blocklet.component.upgradeAvailable")})}):f==="disable"?_.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)&&_.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?m:"",version:e.version,onButtonClick:null,"data-cy":"install-blocklet",sx:f!=="disable"?{"&:hover, && *":{cursor:"pointer"}}:{"&:after, &:before":{content:'""',opacity:"0 !important"}},onMainClick:f==="disable"?void 0:l,icons:e.docker?.image?[{key:"docker",icon:t.jsx(O,{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:_,button:t.jsx(Gi,{serverVersion:a,requirementVersion:x,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 S=rl(e,i);S&&window.open(S,"_blank","noopener,noreferrer")},children:o("common.detail")},e.did)})})})})}Ho.propTypes={blocklet:g.object.isRequired,blocklets:g.array,handleButtonClick:g.func,endpoint:g.string,serverVersion:g.string};function Go({handleButtonClick:e=null,handleSearchSelect:n=null,storeUrl:r,handleBlockletRender:i=null,extraFilter:a=void 0,serverVersion:o="",resourceType:m="",resourceDid:c="",showResourcesSwitch:d=!0,showCategory:l=!0,compact:v=!1,...p}){const C=gt(),{locale:f}=ce(),[x,_]=R.useState(!1),[w,S]=R.useState({}),u=b=>{S(b)},s=r,h=R.useMemo(()=>Ms(C,{palette:{background:{default:C.palette.background.paper}}}),[C]);return R.useEffect(()=>{S({showResources:!0,resourceType:m,resourceDid:c})},[s,m,c]),R.useEffect(()=>{_(!0),S({showResources:!0,resourceType:m,resourceDid:c})},[]),t.jsx(zs,{theme:h,children:t.jsx(qs,{FallbackComponent:Fs,resetKeys:[s],children:t.jsxs(O,{...p,sx:$s({overflow:"auto",".title-bar + div":{height:"unset"}},p.sx),children:[x&&t.jsx(Hi,{showCategory:l,showResourcesSwitch:d,blockletRender:b=>{const T={...b,handleButtonClick:e,endpoint:s};return i({...b,defaultRender:t.jsx(Ho,{...T})})},compact:v,minItemWidth:300,baseSearch:!0,endpoint:s,locale:f,onFilterChange:u,onSearchSelect:n,filters:w,extraFilter:a,serverVersion:o,fetchCategoryDelay:500}),t.jsx(O,{sx:{mt:2},children:" "})]})})})}Go.propTypes={storeUrl:g.string.isRequired,handleButtonClick:g.func,handleSearchSelect:g.func,handleBlockletRender:g.func,extraFilter:g.func,serverVersion:g.string,resourceType:g.string,resourceDid:g.string,showResourcesSwitch:g.bool,showCategory:g.bool,compact:g.bool};const sl=oe(Vi)`
|
|
169
169
|
.ms-highlight {
|
|
170
170
|
color: ${e=>e.theme.palette.primary.main};
|
|
171
171
|
}
|
|
172
|
-
`;function
|
|
172
|
+
`;function Ko({ref:e=null,meta:n=null,isMobile:r,onStepChange:i}){const a=gt(),{steps:o,activeStep:m,setActiveStepByKey:c,setActiveStepByIndex:d}=Ji(),{t:l,locale:v}=ce(),p=o[m];return R.useEffect(()=>{i(m)},[i,m]),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:g.any,meta:g.any,onStepChange:g.func.isRequired,isMobile:g.bool.isRequired};const kr=e=>e.isMobile?`
|
|
173
173
|
height: calc(100vh - 56px - 64px - 48px);
|
|
174
174
|
`:"",il=oe.div`
|
|
175
175
|
width: 100%;
|
|
@@ -293,11 +293,11 @@ import{aF as qe,j as t,ds as ws,gC as _s,ix as Ss,n as ce,bn as ye,M as O,ay as
|
|
|
293
293
|
display: flex;
|
|
294
294
|
height: 100%;
|
|
295
295
|
align-items: center;
|
|
296
|
-
${e=>
|
|
296
|
+
${e=>kr(e)}
|
|
297
297
|
}
|
|
298
298
|
|
|
299
299
|
& .agreement-wrapper {
|
|
300
|
-
${e=>
|
|
300
|
+
${e=>kr(e)}
|
|
301
301
|
max-height: 60vh;
|
|
302
302
|
.eula-trigger {
|
|
303
303
|
padding-right: 0;
|
|
@@ -310,7 +310,7 @@ import{aF as qe,j as t,ds as ws,gC as _s,ix as Ss,n as ce,bn as ye,M as O,ay as
|
|
|
310
310
|
& .connect {
|
|
311
311
|
background: white;
|
|
312
312
|
}
|
|
313
|
-
`,ll
|
|
313
|
+
`,ll=$n`
|
|
314
314
|
0%, 100% {
|
|
315
315
|
transform: scale(1) translateX(0);
|
|
316
316
|
}
|
|
@@ -320,7 +320,7 @@ import{aF as qe,j as t,ds as ws,gC as _s,ix as Ss,n as ce,bn as ye,M as O,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:g.string.isRequired,alt:g.string.isRequired,size:g.number};const cl=48,dl=8,kr={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 Ko({label:e="",disabled:n=!1,required:r=!1,initialValue:i="",onChange:a=()=>{},sx:o={},onSubmit:m=()=>{},triggers:c=[],options:d=[],formatterBeforeSubmit:l=_=>_.join(","),helperText:v="",config:p={},directEditing:C=!1,searchable:f=!0,...x}){const _=gt(),[w,S]=R.useState(C),[u,s]=R.useState(!1),[h,b]=R.useState(""),{multiple:T=!1,labelField:k="name",valueField:M="code"}=p,[z,P]=R.useState(i),[D,I]=R.useState(z),[L,q]=R.useState(!1),[$,G]=R.useState(!1),V=R.useCallback(()=>{G(!0),setTimeout(()=>{G(!1)},500)},[]),se=async()=>{s(!0);try{await m(typeof l=="function"&&T?l(D):D)===!1?I(z):(I(D),P(D),q(!1))}catch{I(z)}finally{s(!1),S(!1)}},B=R.useCallback(()=>{C&&!n&&!u&&se(),L&&V(),!L&&!n&&!u&&(S(!1),q(!1))},[C,n,u,L,V]);R.useEffect(()=>{const y=i;y!==z&&(P(y),I(y),q(!1))},[i,z]);const te=d.filter(y=>{if(!h)return!0;const j=h.toLowerCase();return y[k]?.toLowerCase().includes(j)||y[M]?.toLowerCase().includes(j)}),N=y=>{let{value:j}=y.target;T&&(j=typeof j=="string"?j.split(","):j),q(j!==D),I(j),a(j)},E=w||C?t.jsxs(Ks,{value:D,onChange:N,fullWidth:!0,multiple:T,variant:"outlined",margin:"dense",onBlur:B,disabled:n,renderValue:y=>{if(T)return t.jsx(O,{sx:{display:"flex",flexWrap:"wrap"},children:y.filter(U=>d.some(W=>W[M]===U)).map(U=>t.jsx(sr,{label:d.find(W=>W[M]===U)[k],style:{marginRight:8},size:"small"},U))});if(!y)return null;const j=d.find(U=>U[M]===y);return t.jsxs(O,{sx:{display:"flex",alignItems:"center",gap:1},children:[j?.logo&&t.jsx(Dt,{src:j.logo,alt:j[k],size:20}),t.jsx("span",{children:j?j[k]:""})]})},MenuProps:{...kr,PaperProps:{...kr.PaperProps}},error:!!v,...x,children:[f?t.jsx(O,{sx:{p:1,borderBottom:1,borderColor:"divider"},children:t.jsx(ve,{size:"small",placeholder:"Search...",value:h,onChange:y=>b(y.target.value),onClick:y=>y.stopPropagation(),onKeyDown:y=>y.stopPropagation(),fullWidth:!0,variant:"outlined"})}):null,te.map(y=>t.jsx(Ne,{value:y[M],style:ul(y[M],D,_),children:t.jsxs(O,{sx:{display:"flex",alignItems:"center",gap:1},children:[y.logo&&t.jsx(Dt,{src:y.logo,alt:y[k],size:20}),t.jsx("span",{children:y[k]})]})},y[M]))]}):t.jsx(O,{"data-cy":"schema-form-item-edit",className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},sx:{px:1},onClick:()=>{n||S(!0)},children:T?D.filter(y=>d.some(j=>j[M]===y)).map(y=>t.jsx(sr,{label:d.find(j=>j[M]===y)[k],style:{marginRight:8},size:"small"},y)):D&&d.some(y=>y[M]===D)&&t.jsxs(O,{sx:{display:"flex",alignItems:"center",gap:1},children:[(()=>{const y=d.find(j=>j[M]===D);return y?.logo?t.jsx(Dt,{src:y.logo,alt:y[k],size:20}):null})(),t.jsx("span",{children:d.find(y=>y[M]===D)[k]})]})});return t.jsx(Co,{className:"form",sx:o,children:t.jsxs(O,{className:"form-item",children:[t.jsxs(O,{className:"form-item-label",children:[e,r&&t.jsx(ot,{})]}),t.jsxs(O,{className:"form-item-body",children:[t.jsx(O,{className:"form-item-input",children:E}),t.jsx(O,{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(be,{size:24}):t.jsx(_o,{})}):null,t.jsx(me,{"data-cy":"schema-form-item-cancel",onClick:()=>{I(z),S(!1)},disabled:n||u,size:"large",children:t.jsx(ao,{})})]}):t.jsx(O,{children:c.length?t.jsx(Li,{triggers:c,disabled:n}):null})})]}),w&&v&&t.jsx(Vs,{error:!0,children:v})]})})}Ko.propTypes={sx:g.object,onSubmit:g.func,onChange:g.func,label:g.string,initialValue:g.string,required:g.bool,disabled:g.bool,triggers:g.array,options:g.array,helperText:g.string,formatterBeforeSubmit:g.func,config:g.object,directEditing:g.bool,searchable:g.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 Ee={},Bt={exports:{}},Ot={exports:{}},hl=Ot.exports,Rr;function Oe(){return Rr||(Rr=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=uo()}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,T=u.sigBytes;if(this.clamp(),b%4)for(var k=0;k<T;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<T;z+=4)s[b+z>>>2]=h[z>>>2];return this.sigBytes+=T,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=[],T=0;T<h;T++){var k=s[T>>>2]>>>24-T%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)}},x=C.Latin1={stringify:function(u){for(var s=u.words,h=u.sigBytes,b=[],T=0;T<h;T++){var k=s[T>>>2]>>>24-T%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)}},_=C.Utf8={stringify:function(u){try{return decodeURIComponent(escape(x.stringify(u)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(u){return x.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=_.parse(u)),this._data.concat(u),this._nDataBytes+=u.sigBytes},_process:function(u){var s,h=this._data,b=h.words,T=h.sigBytes,k=this.blockSize,M=k*4,z=T/M;u?z=i.ceil(z):z=i.max((z|0)-this._minBufferSize,0);var P=z*k,D=i.min(P*4,T);if(P){for(var I=0;I<P;I+=k)this._doProcessBlock(b,I);s=b.splice(0,P),h.sigBytes-=D}return new p.init(s,D)},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 S.HMAC.init(u,h).finalize(s)}}});var S=d.algo={};return d}(Math);return r})}(Ot)),Ot.exports}var Ut={exports:{}},gl=Ut.exports,Tr;function Vo(){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 x=l[f>>>2]>>>24-f%4*8&255,_=l[f+1>>>2]>>>24-(f+1)%4*8&255,w=l[f+2>>>2]>>>24-(f+2)%4*8&255,S=x<<16|_<<8|w,u=0;u<4&&f+u*.75<v;u++)C.push(p.charAt(S>>>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 x=d.indexOf(f);x!==-1&&(l=x)}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 x=v[d.charCodeAt(f-1)]<<f%4*2,_=v[d.charCodeAt(f)]>>>6-f%4*2,w=x|_;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,Pr;function yl(){return Pr||(Pr=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 _=0;_<64;_++)l[_]=i.abs(i.sin(_+1))*4294967296|0})();var v=d.MD5=c.extend({_doReset:function(){this._hash=new m.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(_,w){for(var S=0;S<16;S++){var u=w+S,s=_[u];_[u]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360}var h=this._hash.words,b=_[w+0],T=_[w+1],k=_[w+2],M=_[w+3],z=_[w+4],P=_[w+5],D=_[w+6],I=_[w+7],L=_[w+8],q=_[w+9],$=_[w+10],G=_[w+11],V=_[w+12],se=_[w+13],B=_[w+14],te=_[w+15],N=h[0],E=h[1],y=h[2],j=h[3];N=p(N,E,y,j,b,7,l[0]),j=p(j,N,E,y,T,12,l[1]),y=p(y,j,N,E,k,17,l[2]),E=p(E,y,j,N,M,22,l[3]),N=p(N,E,y,j,z,7,l[4]),j=p(j,N,E,y,P,12,l[5]),y=p(y,j,N,E,D,17,l[6]),E=p(E,y,j,N,I,22,l[7]),N=p(N,E,y,j,L,7,l[8]),j=p(j,N,E,y,q,12,l[9]),y=p(y,j,N,E,$,17,l[10]),E=p(E,y,j,N,G,22,l[11]),N=p(N,E,y,j,V,7,l[12]),j=p(j,N,E,y,se,12,l[13]),y=p(y,j,N,E,B,17,l[14]),E=p(E,y,j,N,te,22,l[15]),N=C(N,E,y,j,T,5,l[16]),j=C(j,N,E,y,D,9,l[17]),y=C(y,j,N,E,G,14,l[18]),E=C(E,y,j,N,b,20,l[19]),N=C(N,E,y,j,P,5,l[20]),j=C(j,N,E,y,$,9,l[21]),y=C(y,j,N,E,te,14,l[22]),E=C(E,y,j,N,z,20,l[23]),N=C(N,E,y,j,q,5,l[24]),j=C(j,N,E,y,B,9,l[25]),y=C(y,j,N,E,M,14,l[26]),E=C(E,y,j,N,L,20,l[27]),N=C(N,E,y,j,se,5,l[28]),j=C(j,N,E,y,k,9,l[29]),y=C(y,j,N,E,I,14,l[30]),E=C(E,y,j,N,V,20,l[31]),N=f(N,E,y,j,P,4,l[32]),j=f(j,N,E,y,L,11,l[33]),y=f(y,j,N,E,G,16,l[34]),E=f(E,y,j,N,B,23,l[35]),N=f(N,E,y,j,T,4,l[36]),j=f(j,N,E,y,z,11,l[37]),y=f(y,j,N,E,I,16,l[38]),E=f(E,y,j,N,$,23,l[39]),N=f(N,E,y,j,se,4,l[40]),j=f(j,N,E,y,b,11,l[41]),y=f(y,j,N,E,M,16,l[42]),E=f(E,y,j,N,D,23,l[43]),N=f(N,E,y,j,q,4,l[44]),j=f(j,N,E,y,V,11,l[45]),y=f(y,j,N,E,te,16,l[46]),E=f(E,y,j,N,k,23,l[47]),N=x(N,E,y,j,b,6,l[48]),j=x(j,N,E,y,I,10,l[49]),y=x(y,j,N,E,B,15,l[50]),E=x(E,y,j,N,P,21,l[51]),N=x(N,E,y,j,V,6,l[52]),j=x(j,N,E,y,M,10,l[53]),y=x(y,j,N,E,$,15,l[54]),E=x(E,y,j,N,T,21,l[55]),N=x(N,E,y,j,L,6,l[56]),j=x(j,N,E,y,te,10,l[57]),y=x(y,j,N,E,D,15,l[58]),E=x(E,y,j,N,se,21,l[59]),N=x(N,E,y,j,z,6,l[60]),j=x(j,N,E,y,G,10,l[61]),y=x(y,j,N,E,k,15,l[62]),E=x(E,y,j,N,q,21,l[63]),h[0]=h[0]+N|0,h[1]=h[1]+E|0,h[2]=h[2]+y|0,h[3]=h[3]+j|0},_doFinalize:function(){var _=this._data,w=_.words,S=this._nDataBytes*8,u=_.sigBytes*8;w[u>>>5]|=128<<24-u%32;var s=i.floor(S/4294967296),h=S;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,_.sigBytes=(w.length+1)*4,this._process();for(var b=this._hash,T=b.words,k=0;k<4;k++){var M=T[k];T[k]=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360}return b},clone:function(){var _=c.clone.call(this);return _._hash=this._hash.clone(),_}});function p(_,w,S,u,s,h,b){var T=_+(w&S|~w&u)+s+b;return(T<<h|T>>>32-h)+w}function C(_,w,S,u,s,h,b){var T=_+(w&u|S&~u)+s+b;return(T<<h|T>>>32-h)+w}function f(_,w,S,u,s,h,b){var T=_+(w^S^u)+s+b;return(T<<h|T>>>32-h)+w}function x(_,w,S,u,s,h,b){var T=_+(S^(w|~u))+s+b;return(T<<h|T>>>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,Ir;function Cl(){return Ir||(Ir=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],x=C[1],_=C[2],w=C[3],S=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)+S+d[u];u<20?h+=(x&_|~x&w)+1518500249:u<40?h+=(x^_^w)+1859775393:u<60?h+=(x&_|x&w|_&w)-1894007588:h+=(x^_^w)-899497514,S=w,w=_,_=x<<30|x>>>2,x=f,f=h}C[0]=C[0]+f|0,C[1]=C[1]+x|0,C[2]=C[2]+_|0,C[3]=C[3]+w|0,C[4]=C[4]+S|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,Dr;function jl(){return Dr||(Dr=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(),x=this._iKey=v.clone(),_=f.words,w=x.words,S=0;S<p;S++)_[S]^=1549556828,w[S]^=909522486;f.sigBytes=x.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,Br;function Yo(){return Br||(Br=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,x=f.hasher.create(),_=m.create(),w=_.words,S=f.keySize,u=f.iterations;w.length<S;){C&&x.update(C),C=x.update(v).finalize(p),x.reset();for(var s=1;s<u;s++)C=x.finalize(C),x.reset();_.concat(C)}return _.sigBytes=S*4,_}});i.EvpKDF=function(v,p,C){return l.create(C).compute(v,p)}}(),r.EvpKDF})}(Lt)),Lt.exports}var zt={exports:{}},_l=zt.exports,Or;function Sl(){return Or||(Or=1,function(e,n){(function(r,i,a){e.exports=i(Oe(),Yo())})(_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(P,D){return this.create(this._ENC_XFORM_MODE,P,D)},createDecryptor:function(P,D){return this.create(this._DEC_XFORM_MODE,P,D)},init:function(P,D,I){this.cfg=this.cfg.extend(I),this._xformMode=P,this._key=D,this.reset()},reset:function(){d.reset.call(this),this._doReset()},process:function(P){return this._append(P),this._process()},finalize:function(P){P&&this._append(P);var D=this._doFinalize();return D},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function P(D){return typeof D=="string"?z:T}return function(D){return{encrypt:function(I,L,q){return P(L).encrypt(D,I,L,q)},decrypt:function(I,L,q){return P(L).decrypt(D,I,L,q)}}}}()});o.StreamCipher=f.extend({_doFinalize:function(){var P=this._process(!0);return P},blockSize:1});var x=a.mode={},_=o.BlockCipherMode=m.extend({createEncryptor:function(P,D){return this.Encryptor.create(P,D)},createDecryptor:function(P,D){return this.Decryptor.create(P,D)},init:function(P,D){this._cipher=P,this._iv=D}}),w=x.CBC=function(){var P=_.extend();P.Encryptor=P.extend({processBlock:function(I,L){var q=this._cipher,$=q.blockSize;D.call(this,I,L,$),q.encryptBlock(I,L),this._prevBlock=I.slice(L,L+$)}}),P.Decryptor=P.extend({processBlock:function(I,L){var q=this._cipher,$=q.blockSize,G=I.slice(L,L+$);q.decryptBlock(I,L),D.call(this,I,L,$),this._prevBlock=G}});function D(I,L,q){var $,G=this._iv;G?($=G,this._iv=i):$=this._prevBlock;for(var V=0;V<q;V++)I[L+V]^=$[V]}return P}(),S=a.pad={},u=S.Pkcs7={pad:function(P,D){for(var I=D*4,L=I-P.sigBytes%I,q=L<<24|L<<16|L<<8|L,$=[],G=0;G<L;G+=4)$.push(q);var V=c.create($,L);P.concat(V)},unpad:function(P){var D=P.words[P.sigBytes-1>>>2]&255;P.sigBytes-=D}};o.BlockCipher=f.extend({cfg:f.cfg.extend({mode:w,padding:u}),reset:function(){var P;f.reset.call(this);var D=this.cfg,I=D.iv,L=D.mode;this._xformMode==this._ENC_XFORM_MODE?P=L.createEncryptor:(P=L.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==P?this._mode.init(this,I&&I.words):(this._mode=P.call(L,this,I&&I.words),this._mode.__creator=P)},_doProcessBlock:function(P,D){this._mode.processBlock(P,D)},_doFinalize:function(){var P,D=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(D.pad(this._data,this.blockSize),P=this._process(!0)):(P=this._process(!0),D.unpad(P)),P},blockSize:128/32});var s=o.CipherParams=m.extend({init:function(P){this.mixIn(P)},toString:function(P){return(P||this.formatter).stringify(this)}}),h=a.format={},b=h.OpenSSL={stringify:function(P){var D,I=P.ciphertext,L=P.salt;return L?D=c.create([1398893684,1701076831]).concat(L).concat(I):D=I,D.toString(v)},parse:function(P){var D,I=v.parse(P),L=I.words;return L[0]==1398893684&&L[1]==1701076831&&(D=c.create(L.slice(2,4)),L.splice(0,4),I.sigBytes-=16),s.create({ciphertext:I,salt:D})}},T=o.SerializableCipher=m.extend({cfg:m.extend({format:b}),encrypt:function(P,D,I,L){L=this.cfg.extend(L);var q=P.createEncryptor(I,L),$=q.finalize(D),G=q.cfg;return s.create({ciphertext:$,key:I,iv:G.iv,algorithm:P,mode:G.mode,padding:G.padding,blockSize:P.blockSize,formatter:L.format})},decrypt:function(P,D,I,L){L=this.cfg.extend(L),D=this._parse(D,L.format);var q=P.createDecryptor(I,L).finalize(D.ciphertext);return q},_parse:function(P,D){return typeof P=="string"?D.parse(P,this):P}}),k=a.kdf={},M=k.OpenSSL={execute:function(P,D,I,L,q){if(L||(L=c.random(64/8)),q)var $=C.create({keySize:D+I,hasher:q}).compute(P,L);else var $=C.create({keySize:D+I}).compute(P,L);var G=c.create($.words.slice(D),I*4);return $.sigBytes=D*4,s.create({key:$,iv:G,salt:L})}},z=o.PasswordBasedCipher=T.extend({cfg:T.cfg.extend({kdf:M}),encrypt:function(P,D,I,L){L=this.cfg.extend(L);var q=L.kdf.execute(I,P.keySize,P.ivSize,L.salt,L.hasher);L.iv=q.iv;var $=T.encrypt.call(this,P,D,q.key,L);return $.mixIn(q),$},decrypt:function(P,D,I,L){L=this.cfg.extend(L),D=this._parse(D,L.format);var q=L.kdf.execute(I,P.keySize,P.ivSize,D.salt,L.hasher);L.iv=q.iv;var $=T.decrypt.call(this,P,D,q.key,L);return $}})}()})}(zt)),zt.exports}var El=Bt.exports,Ur;function kl(){return Ur||(Ur=1,function(e,n){(function(r,i,a){e.exports=i(Oe(),Vo(),yl(),Yo(),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=[],x=[],_=[],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,T=0,h=0;h<256;h++){var k=T^T<<1^T<<2^T<<3^T<<4;k=k>>>8^k&255^99,c[b]=k,d[k]=b;var M=s[b],z=s[M],P=s[z],D=s[k]*257^k*16843008;l[b]=D<<24|D>>>8,v[b]=D<<16|D>>>16,p[b]=D<<8|D>>>24,C[b]=D;var D=P*16843009^z*65537^M*257^b*16843008;f[k]=D<<24|D>>>8,x[k]=D<<16|D>>>16,_[k]=D<<8|D>>>24,w[k]=D,b?(b=M^s[s[s[P^M]]],T^=s[s[T]]):b=T=1}})();var S=[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,T=h.sigBytes/4,k=this._nRounds=T+6,M=(k+1)*4,z=this._keySchedule=[],P=0;P<M;P++)P<T?z[P]=b[P]:(s=z[P-1],P%T?T>6&&P%T==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^=S[P/T|0]<<24),z[P]=z[P-T]^s);for(var D=this._invKeySchedule=[],I=0;I<M;I++){var P=M-I;if(I%4)var s=z[P];else var s=z[P-4];I<4||P<=4?D[I]=s:D[I]=f[c[s>>>24]]^x[c[s>>>16&255]]^_[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,f,x,_,w,d);var b=s[h+1];s[h+1]=s[h+3],s[h+3]=b},_doCryptBlock:function(s,h,b,T,k,M,z,P){for(var D=this._nRounds,I=s[h]^b[0],L=s[h+1]^b[1],q=s[h+2]^b[2],$=s[h+3]^b[3],G=4,V=1;V<D;V++){var se=T[I>>>24]^k[L>>>16&255]^M[q>>>8&255]^z[$&255]^b[G++],B=T[L>>>24]^k[q>>>16&255]^M[$>>>8&255]^z[I&255]^b[G++],te=T[q>>>24]^k[$>>>16&255]^M[I>>>8&255]^z[L&255]^b[G++],N=T[$>>>24]^k[I>>>16&255]^M[L>>>8&255]^z[q&255]^b[G++];I=se,L=B,q=te,$=N}var se=(P[I>>>24]<<24|P[L>>>16&255]<<16|P[q>>>8&255]<<8|P[$&255])^b[G++],B=(P[L>>>24]<<24|P[q>>>16&255]<<16|P[$>>>8&255]<<8|P[I&255])^b[G++],te=(P[q>>>24]<<24|P[$>>>16&255]<<16|P[I>>>8&255]<<8|P[L&255])^b[G++],N=(P[$>>>24]<<24|P[I>>>16&255]<<16|P[L>>>8&255]<<8|P[q&255])^b[G++];s[h]=se,s[h+1]=B,s[h+2]=te,s[h+3]=N},keySize:256/32});i.AES=o._createHelper(u)}(),r.AES})}(Bt)),Bt.exports}var qt={exports:{}},Rl=qt.exports,Nr;function Tl(){return Nr||(Nr=1,function(e,n){(function(r,i){e.exports=i(Oe())})(Rl,function(r){return r.enc.Latin1})}(qt)),qt.exports}var Ft={exports:{}},Pl=Ft.exports,Lr;function Il(){return Lr||(Lr=1,function(e,n){(function(r,i){e.exports=i(Oe())})(Pl,function(r){return r.enc.Utf8})}(Ft)),Ft.exports}var $t={exports:{}},Dl=$t.exports,Ar;function Bl(){return Ar||(Ar=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,Mr;function Ul(){return Mr||(Mr=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 Ee;qr=1;var e=Ee&&Ee.__createBinding||(Object.create?function(f,x,_,w){w===void 0&&(w=_);var S=Object.getOwnPropertyDescriptor(x,_);(!S||("get"in S?!x.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return x[_]}}),Object.defineProperty(f,w,S)}:function(f,x,_,w){w===void 0&&(w=_),f[w]=x[_]}),n=Ee&&Ee.__setModuleDefault||(Object.create?function(f,x){Object.defineProperty(f,"default",{enumerable:!0,value:x})}:function(f,x){f.default=x}),r=Ee&&Ee.__importStar||function(f){if(f&&f.__esModule)return f;var x={};if(f!=null)for(var _ in f)_!=="default"&&Object.prototype.hasOwnProperty.call(f,_)&&e(x,f,_);return n(x,f),x},i=Ee&&Ee.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.AesCrypter=void 0;const a=r(kl()),o=i(Tl()),m=i(Il()),c=i(Bl()),d=i(Vo()),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(x,_){const w=typeof x=="string"?x:JSON.stringify(x);return a.encrypt(w,_).toString()}decrypt(x,_,w="utf8"){return a.decrypt(x,_).toString(p[w])}}return Ee.AesCrypter=C,Ee.default=new C,Ee}const Al=!0,Ml=">= 8",zl=">= 0.5 && < 0.9.7",ql=!0,Fl=!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",Tc=">= 0.9.4",Pc=!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,qc=!0,Fc=">= 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:ql,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:Fl,"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:Tc,"node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:Pc,"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:qc,"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:Fc,"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 gn,Fr;function Vc(){if(Fr)return gn;Fr=1;var e=Xs();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 gn=function(m,c){return e(a,m)&&i(c,a[m])},gn}var xn,$r;function Yc(){if($r)return xn;$r=1;var e={},n=po();return xn=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},xn}var yn,Wr;function Zc(){return Wr||(Wr=1,yn=function(){var e=Error.prepareStackTrace;Error.prepareStackTrace=function(r,i){return i};var n=new Error().stack;return Error.prepareStackTrace=e,n[2].getFileName()}),yn}var nt={exports:{}},Hr;function Qc(){if(Hr)return nt.exports;Hr=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 vn,Gr;function Xc(){if(Gr)return vn;Gr=1;var e=Jt(),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 vn=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},vn}var Cn,Kr;function Jc(){return Kr||(Kr=1,Cn=function(e,n){return n||{}}),Cn}var bn,Vr;function ed(){if(Vr)return bn;Vr=1;var e=Vc(),n=en,r=Jt(),i=Yc(),a=Zc(),o=Xc(),m=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(S){try{var u=n.statSync(S,{throwIfNoEntry:!1})}catch(s){if(s&&(s.code==="ENOENT"||s.code==="ENOTDIR"))return!1;throw s}return!!u&&(u.isFile()||u.isFIFO())},p=function(S){try{var u=n.statSync(S,{throwIfNoEntry:!1})}catch(s){if(s&&(s.code==="ENOENT"||s.code==="ENOTDIR"))return!1;throw s}return!!u&&u.isDirectory()},C=function(S){try{return c(S)}catch(u){if(u.code!=="ENOENT")throw u}return S},f=function(S,u,s){return s&&s.preserveSymlinks===!1?S(u):u},x=function(S,u){var s=S(u);try{var h=JSON.parse(s);return h}catch{}},_=function(S,u,s){for(var h=o(u,s,S),b=0;b<h.length;b++)h[b]=r.join(h[b],S);return h};return bn=function(S,u){if(typeof S!="string")throw new TypeError("Path must be a string.");var s=m(S,u),h=s.isFile||v,b=s.readFileSync||n.readFileSync,T=s.isDirectory||p,k=s.realpathSync||C,M=s.readPackageSync||x;if(s.readFileSync&&s.readPackageSync)throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");var z=s.packageIterator,P=s.extensions||[".js"],D=s.includeCoreModules!==!1,I=s.basedir||r.dirname(a()),L=s.filename||I;s.paths=s.paths||l();var q=f(k,r.resolve(I),s);if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(S)){var $=r.resolve(q,S);(S==="."||S===".."||S.slice(-1)==="/")&&($+="/");var G=B($)||N($);if(G)return f(k,G,s)}else{if(D&&e(S))return S;var V=E(S,q);if(V)return f(k,V,s)}var se=new Error("Cannot find module '"+S+"' from '"+L+"'");throw se.code="MODULE_NOT_FOUND",se;function B(y){var j=te(r.dirname(y));if(j&&j.dir&&j.pkg&&s.pathFilter){var U=r.relative(j.dir,y),W=s.pathFilter(j.pkg,y,U);W&&(y=r.resolve(j.dir,W))}if(h(y))return y;for(var re=0;re<P.length;re++){var J=y+P[re];if(h(J))return J}}function te(y){if(!(y===""||y==="/")&&!(pe.platform==="win32"&&/^\w:[/\\]*$/.test(y))&&!/[/\\]node_modules[/\\]*$/.test(y)){var j=r.join(f(k,y,s),"package.json");if(!h(j))return te(r.dirname(y));var U=M(b,j);return U&&s.packageFilter&&(U=s.packageFilter(U,y)),{pkg:U,dir:y}}}function N(y){var j=r.join(f(k,y,s),"/package.json");if(h(j)){try{var U=M(b,j)}catch{}if(U&&s.packageFilter&&(U=s.packageFilter(U,y)),U&&U.main){if(typeof U.main!="string"){var W=new TypeError("package “"+U.name+"” `main` must be a string");throw W.code="INVALID_PACKAGE_MAIN",W}(U.main==="."||U.main==="./")&&(U.main="index");try{var re=B(r.resolve(y,U.main));if(re)return re;var J=N(r.resolve(y,U.main));if(J)return J}catch{}}}return B(r.join(y,"/index"))}function E(y,j){for(var U=function(){return _(y,j,s)},W=z?z(y,j,U,s):U(),re=0;re<W.length;re++){var J=W[re];if(T(r.dirname(J))){var ne=B(J);if(ne)return ne;var ie=N(J);if(ie)return ie}}}},bn}var jn,Yr;function td(){return Yr||(Yr=1,jn=ed()),jn}var wn,Zr;function nd(){if(Zr)return wn;Zr=1;var e={};wn=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 wn}var _n,Qr;function rd(){if(Qr)return _n;Qr=1,_n=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),x=parseInt("001",8),_=C|f,w=c&x||c&f&&l===p||c&C&&d===v||c&_&&v===0;return w}return _n}var Sn,Xr;function od(){if(Xr)return Sn;Xr=1;var e;pe.platform==="win32"||It.TESTING_WINDOWS?e=nd():e=rd(),Sn=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 Sn}var En,Jr;function sd(){if(Jr)return En;Jr=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"}),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":"",x=n?f.split(p):[""];return n&&l.indexOf(".")!==-1&&x[0]!==""&&x.unshift(""),{pathEnv:C,pathExt:x,pathExtExe:f}},c=(l,v,p)=>{typeof v=="function"&&(p=v,v={}),v||(v={});const{pathEnv:C,pathExt:f,pathExtExe:x}=m(l,v),_=[],w=u=>new Promise((s,h)=>{if(u===C.length)return v.all&&_.length?s(_):h(o(l));const b=C[u],T=/^".*"$/.test(b)?b.slice(1,-1):b,k=r.join(T,l),M=!T&&/^\.[\\\/]/.test(l)?l.slice(0,2)+k:k;s(S(M,u,0))}),S=(u,s,h)=>new Promise((b,T)=>{if(h===f.length)return b(w(s+1));const k=f[h];a(u+k,{pathExt:x},(M,z)=>{if(!M&&z)if(v.all)_.push(u+k);else return b(u+k);return b(S(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:f}=m(l,v),x=[];for(let _=0;_<p.length;_++){const w=p[_],S=/^".*"$/.test(w)?w.slice(1,-1):w,u=r.join(S,l),s=!S&&/^\.[\\\/]/.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)x.push(b);else return b}catch{}}}if(v.all&&x.length)return x;if(v.nothrow)return null;throw o(l)};return En=c,c.sync=d,En}var kn,eo;function id(){if(eo)return kn;eo=1;function e(n){if(!(typeof n>"u"))return JSON.parse(JSON.stringify(n))}return kn=e,kn}var Rn,to;function ad(){if(to)return Rn;to=1;var e={};const{BLOCKLET_MODES:n}=Js(),r=uo(),i=Ll().default,a=ei(),o=ri,{dirname:m,join:c,sep:d}=Jt(),l=td(),{tmpdir:v,homedir:p}=po(),C=sd(),{withHttps:f,withHttp:x}=ti(),{exec:_}=en,{promisify:w}=ni(),S=id(),u=(E,y,j)=>i.encrypt(E,r.pbkdf2Sync(j,y,256,32,"sha512").toString("hex")),s=(E,y,j)=>i.decrypt(E,r.pbkdf2Sync(j,y,256,32,"sha512").toString("hex")),h=(E,y=!0)=>{let j=E;return Array.isArray(j)&&j.every(U=>U.originFileObj&&U.url)&&(j=j.map(U=>U.url),j.length===1&&([j]=j)),y&&j&&typeof j=="object"&&(j=JSON.stringify(j)),j&&typeof j=="string"&&(j=j.replace(/(\r\n|\n|\r)/gm," ")),j},b=E=>E.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),T=E=>b(ir.from(E).toString("base64")),k=E=>(E+"===".slice((E.length+3)%4)).replace(/-/g,"+").replace(/_/g,"/"),M=E=>new Uint8Array(ir.from(k(E),"base64")),z="v21.6.0",P=()=>a.gte(pe.version,z),D=()=>{try{return l("@arcblock/pm2",{basedir:__dirname})}catch{return null}};function I(E){try{return C.sync(E)}catch{return null}}const L=new Map;async function q(){const E=w(_),y=pe.version;if(L.has(y))return L.get(y);try{const{stdout:j}=await E("node -h");let U;if(j.includes("--permission"))U="--permission";else if(j.includes("--experimental-permission"))U="--experimental-permission";else throw new Error(`Can not get permission options for this Node.js version: ${y}`);return L.set(y,U),U}catch(j){throw console.error(j),j}}const $=async(E,y=!0)=>{const j=e.NODE_OPTIONS??"";if(j.includes("--experimental-permission")||j.includes("--permission")||j.includes("--allow-fs-read")||j.includes("--allow-fs-write")||j.includes("--allow-addons")||j.includes("--allow-child-process")||j.includes("--allow-worker"))throw console.error("getSecurityNodeOptions",{nodeOptions:j}),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(!E)throw new Error("blocklet is not defined");if(j.includes("ms-vscode.js-debug/src/bootloader.js")&&(E.mode===n.DEVELOPMENT||E.environmentObj.BLOCKLET_MODE===n.DEVELOPMENT))return j;const U=[j].filter(Z=>!!Z&&Z!=="undefined");if(!P()||!y)return U.join(" ").trim();const W=D(),re=I("meilisearch"),J="/data/bin/meilisearch",ne=I("blocklet"),ie=[e.XDG_DATA_HOME?c(e.XDG_DATA_HOME,"pnpm/global/"):"",e.PNPM_HOME?c(e.PNPM_HOME,"global/"):""],he=await q();return U.push(he,...[E.environmentObj.BLOCKLET_DATA_DIR,E.environmentObj.BLOCKLET_APP_DIR,E.environmentObj.BLOCKLET_LOG_DIR,E.environmentObj.BLOCKLET_CACHE_DIR,E.environmentObj.BLOCKLET_APP_DATA_DIR?c(E.environmentObj.BLOCKLET_APP_DATA_DIR,".projects"):"",v()].filter(Boolean).map(Z=>`--allow-fs-write=${c(Z,"/*")}`),"--allow-addons","--allow-child-process"),E.mode===n.DEVELOPMENT||E.environmentObj.BLOCKLET_MODE===n.DEVELOPMENT?(U.push("--allow-worker","--allow-fs-read=*"),U.push(`--allow-fs-write=${c(p(),".npm","_logs","/*")}`)):U.push(...[E.environmentObj.BLOCKLET_LOG_DIR,E.environmentObj.BLOCKLET_CACHE_DIR,E.environmentObj.BLOCKLET_APP_DATA_DIR,m(m(E.environmentObj.BLOCKLET_APP_DIR)),W&&m(m(m(m(W)))),ne,re,J,m(m(pe.execPath)),pe.cwd(),v(),c(p(),".cursor-server"),"/Applications/Cursor.app",...ie].filter(Boolean).filter(Z=>Z!==d).map(Z=>`--allow-fs-read=${c(Z,"/*")}`)),o(U).join(" ").trim()},G={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 V(E,y,j){const U=S(E[y]||[]);return U.push(...j),[...new Set(U)]}async function se(E,{node:y,blocklet:j,trustedDomains:U=[]}){if(!E?.contentSecurityPolicy?.directives)return E;const W=S(E);W.contentSecurityPolicy.directives["default-src"]=V(W.contentSecurityPolicy.directives,"default-src",["'self'"]);const re=await y.getNodeInfo({useCache:!0});let J=await y.getBlockletDomainAliases({blocklet:j,nodeInfo:re});return J=(J||[]).map(ne=>ne.value),W.contentSecurityPolicy.directives["connect-src"]=V(W.contentSecurityPolicy.directives,"connect-src",["'self'",...J.filter(ne=>ne).map(ne=>`http://${ne}/.well-known/ping`),"https://api.simplesvg.com","https://api.iconify.design","https://api.unisvg.com"]),W.contentSecurityPolicy.directives["script-src"]=V(W.contentSecurityPolicy.directives,"script-src",["'self'","https://js.stripe.com"]),W.contentSecurityPolicy.directives["frame-src"]=V(W.contentSecurityPolicy.directives,"frame-src",["'self'","https://js.stripe.com"]),W.contentSecurityPolicy.directives["frame-ancestors"]=V(W.contentSecurityPolicy.directives,"frame-ancestors",["'self'",...(j.settings.userSpaceHosts||[]).map(ne=>`https://${ne}`),...U.filter(Boolean).map(ne=>`http://${ne}`)]),W}async function B(E,{node:y,blocklet:j}){const U=S(E);if(U?.origin?.smart){const W=[];W.push(...U.origin?.value||[]);const re=await y.getNodeInfo({useCache:!0});let J=await y.getBlockletDomainAliases({blocklet:j,nodeInfo:re});J=(J||[]).map(Z=>Z.value),W.push(...J.map(Z=>f(Z)),...J.map(Z=>x(Z)));const ie=((j.settings.federated||{})?.sites||[]).filter(Z=>Z?.isMaster!==!1||Z.status==="approved"),he=[];for(const Z of ie)he.push(new URL(Z.appUrl).hostname),he.push(...Z.aliasDomain||[]);W.push(...he.map(Z=>f(Z)),...he.map(Z=>x(Z))),U.origin.value=[...new Set(W)]}return U}function te(E){const y=S(E);for(const j of Object.keys(y))y[j]=y[j]?.value??y[j];return y}function N(E){const y=S(E);for(const j of Object.keys(y))y[j]=y[j]?.override??!1;return y}return Rn={encrypt:u,decrypt:s,formatEnv:h,encodeEncryptionKey:T,decodeEncryptionKey:M,canUseFileSystemIsolateApi:P,getSecurityNodeOptions:$,patchResponseHeader:se,patchCors:B,cleanConfigOverride:te,keepConfigOverride:N,DEFAULT_HELMET_CONFIG:G,SAFE_NODE_VERSION:z},Rn}var Zo=ad();const Tn=(e,n)=>e&&Zo.encrypt(e,n||H.AIGNE_CONFIG_ENCRYPT_SALT,""),Pn=(e,n)=>e&&Zo.decrypt(e,n||H.AIGNE_CONFIG_ENCRYPT_SALT,""),pt=e=>e==="aigneHub",Ht=e=>e==="bedrock",ld=e=>{const n=["provider","model"];if($n(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])},no=e=>{if($n(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?ke(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 Qo();const r=ke(n.origin,"__blocklet__.js?type=json"),i=await Gt.get(r).then(m=>m.data);if((i?.componentId||"").split("/").pop()===Vt)return ke(n.origin,i.prefix||"/");const o=(i?.componentMountPoints||[]).find(m=>m?.did===Vt);return o?ke(n.origin,o.mountPoint):e},Qo=()=>{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 ke(o,a);const c=(((i=window.blocklet)===null||i===void 0?void 0:i.componentMountPoints)||[]).find(d=>d?.did===Vt);return c?ke(o,c.mountPoint):ke(o,a)};async function ud({baseUrl:e="",accessKey:n=""}){let r=Qo();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: ${xe(a)}`)}if(!r||!n)throw new Error("baseUrl or accessKey is not set");return Gt.get(ke(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:g.string.isRequired,alt:g.string.isRequired,size:g.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=_=>_.join(","),helperText:v="",config:p={},directEditing:C=!1,searchable:f=!0,...x}){const _=gt(),[w,S]=R.useState(C),[u,s]=R.useState(!1),[h,b]=R.useState(""),{multiple:T=!1,labelField:k="name",valueField:M="code"}=p,[z,P]=R.useState(i),[D,I]=R.useState(z),[L,q]=R.useState(!1),[$,G]=R.useState(!1),V=R.useCallback(()=>{G(!0),setTimeout(()=>{G(!1)},500)},[]),se=async()=>{s(!0);try{await m(typeof l=="function"&&T?l(D):D)===!1?I(z):(I(D),P(D),q(!1))}catch{I(z)}finally{s(!1),S(!1)}},B=R.useCallback(()=>{C&&!n&&!u&&se(),L&&V(),!L&&!n&&!u&&(S(!1),q(!1))},[C,n,u,L,V]);R.useEffect(()=>{const y=i;y!==z&&(P(y),I(y),q(!1))},[i,z]);const te=d.filter(y=>{if(!h)return!0;const j=h.toLowerCase();return y[k]?.toLowerCase().includes(j)||y[M]?.toLowerCase().includes(j)}),N=y=>{let{value:j}=y.target;T&&(j=typeof j=="string"?j.split(","):j),q(j!==D),I(j),a(j)},E=w||C?t.jsxs(Ks,{value:D,onChange:N,fullWidth:!0,multiple:T,variant:"outlined",margin:"dense",onBlur:B,disabled:n,renderValue:y=>{if(T)return t.jsx(O,{sx:{display:"flex",flexWrap:"wrap"},children:y.filter(U=>d.some(W=>W[M]===U)).map(U=>t.jsx(ir,{label:d.find(W=>W[M]===U)[k],style:{marginRight:8},size:"small"},U))});if(!y)return null;const j=d.find(U=>U[M]===y);return t.jsxs(O,{sx:{display:"flex",alignItems:"center",gap:1},children:[j?.logo&&t.jsx(Dt,{src:j.logo,alt:j[k],size:20}),t.jsx("span",{children:j?j[k]:""})]})},MenuProps:{...Rr,PaperProps:{...Rr.PaperProps}},error:!!v,...x,children:[f?t.jsx(O,{sx:{p:1,borderBottom:1,borderColor:"divider"},children:t.jsx(ve,{size:"small",placeholder:"Search...",value:h,onChange:y=>b(y.target.value),onClick:y=>y.stopPropagation(),onKeyDown:y=>y.stopPropagation(),fullWidth:!0,variant:"outlined"})}):null,te.map(y=>t.jsx(Ne,{value:y[M],style:ul(y[M],D,_),children:t.jsxs(O,{sx:{display:"flex",alignItems:"center",gap:1},children:[y.logo&&t.jsx(Dt,{src:y.logo,alt:y[k],size:20}),t.jsx("span",{children:y[k]})]})},y[M]))]}):t.jsx(O,{"data-cy":"schema-form-item-edit",className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},sx:{px:1},onClick:()=>{n||S(!0)},children:T?D.filter(y=>d.some(j=>j[M]===y)).map(y=>t.jsx(ir,{label:d.find(j=>j[M]===y)[k],style:{marginRight:8},size:"small"},y)):D&&d.some(y=>y[M]===D)&&t.jsxs(O,{sx:{display:"flex",alignItems:"center",gap:1},children:[(()=>{const y=d.find(j=>j[M]===D);return y?.logo?t.jsx(Dt,{src:y.logo,alt:y[k],size:20}):null})(),t.jsx("span",{children:d.find(y=>y[M]===D)[k]})]})});return t.jsx(bo,{className:"form",sx:o,children:t.jsxs(O,{className:"form-item",children:[t.jsxs(O,{className:"form-item-label",children:[e,r&&t.jsx(ot,{})]}),t.jsxs(O,{className:"form-item-body",children:[t.jsx(O,{className:"form-item-input",children:E}),t.jsx(O,{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(be,{size:24}):t.jsx(So,{})}):null,t.jsx(me,{"data-cy":"schema-form-item-cancel",onClick:()=>{I(z),S(!1)},disabled:n||u,size:"large",children:t.jsx(lo,{})})]}):t.jsx(O,{children:c.length?t.jsx(Li,{triggers:c,disabled:n}):null})})]}),w&&v&&t.jsx(Vs,{error:!0,children:v})]})})}Vo.propTypes={sx:g.object,onSubmit:g.func,onChange:g.func,label:g.string,initialValue:g.string,required:g.bool,disabled:g.bool,triggers:g.array,options:g.array,helperText:g.string,formatterBeforeSubmit:g.func,config:g.object,directEditing:g.bool,searchable:g.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 Ee={},Bt={exports:{}},Ot={exports:{}},hl=Ot.exports,Tr;function Oe(){return Tr||(Tr=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,T=u.sigBytes;if(this.clamp(),b%4)for(var k=0;k<T;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<T;z+=4)s[b+z>>>2]=h[z>>>2];return this.sigBytes+=T,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=[],T=0;T<h;T++){var k=s[T>>>2]>>>24-T%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)}},x=C.Latin1={stringify:function(u){for(var s=u.words,h=u.sigBytes,b=[],T=0;T<h;T++){var k=s[T>>>2]>>>24-T%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)}},_=C.Utf8={stringify:function(u){try{return decodeURIComponent(escape(x.stringify(u)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(u){return x.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=_.parse(u)),this._data.concat(u),this._nDataBytes+=u.sigBytes},_process:function(u){var s,h=this._data,b=h.words,T=h.sigBytes,k=this.blockSize,M=k*4,z=T/M;u?z=i.ceil(z):z=i.max((z|0)-this._minBufferSize,0);var P=z*k,D=i.min(P*4,T);if(P){for(var I=0;I<P;I+=k)this._doProcessBlock(b,I);s=b.splice(0,P),h.sigBytes-=D}return new p.init(s,D)},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 S.HMAC.init(u,h).finalize(s)}}});var S=d.algo={};return d}(Math);return r})}(Ot)),Ot.exports}var Ut={exports:{}},gl=Ut.exports,Pr;function Yo(){return Pr||(Pr=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 x=l[f>>>2]>>>24-f%4*8&255,_=l[f+1>>>2]>>>24-(f+1)%4*8&255,w=l[f+2>>>2]>>>24-(f+2)%4*8&255,S=x<<16|_<<8|w,u=0;u<4&&f+u*.75<v;u++)C.push(p.charAt(S>>>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 x=d.indexOf(f);x!==-1&&(l=x)}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 x=v[d.charCodeAt(f-1)]<<f%4*2,_=v[d.charCodeAt(f)]>>>6-f%4*2,w=x|_;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,m=o.WordArray,c=o.Hasher,d=a.algo,l=[];(function(){for(var _=0;_<64;_++)l[_]=i.abs(i.sin(_+1))*4294967296|0})();var v=d.MD5=c.extend({_doReset:function(){this._hash=new m.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(_,w){for(var S=0;S<16;S++){var u=w+S,s=_[u];_[u]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360}var h=this._hash.words,b=_[w+0],T=_[w+1],k=_[w+2],M=_[w+3],z=_[w+4],P=_[w+5],D=_[w+6],I=_[w+7],L=_[w+8],q=_[w+9],$=_[w+10],G=_[w+11],V=_[w+12],se=_[w+13],B=_[w+14],te=_[w+15],N=h[0],E=h[1],y=h[2],j=h[3];N=p(N,E,y,j,b,7,l[0]),j=p(j,N,E,y,T,12,l[1]),y=p(y,j,N,E,k,17,l[2]),E=p(E,y,j,N,M,22,l[3]),N=p(N,E,y,j,z,7,l[4]),j=p(j,N,E,y,P,12,l[5]),y=p(y,j,N,E,D,17,l[6]),E=p(E,y,j,N,I,22,l[7]),N=p(N,E,y,j,L,7,l[8]),j=p(j,N,E,y,q,12,l[9]),y=p(y,j,N,E,$,17,l[10]),E=p(E,y,j,N,G,22,l[11]),N=p(N,E,y,j,V,7,l[12]),j=p(j,N,E,y,se,12,l[13]),y=p(y,j,N,E,B,17,l[14]),E=p(E,y,j,N,te,22,l[15]),N=C(N,E,y,j,T,5,l[16]),j=C(j,N,E,y,D,9,l[17]),y=C(y,j,N,E,G,14,l[18]),E=C(E,y,j,N,b,20,l[19]),N=C(N,E,y,j,P,5,l[20]),j=C(j,N,E,y,$,9,l[21]),y=C(y,j,N,E,te,14,l[22]),E=C(E,y,j,N,z,20,l[23]),N=C(N,E,y,j,q,5,l[24]),j=C(j,N,E,y,B,9,l[25]),y=C(y,j,N,E,M,14,l[26]),E=C(E,y,j,N,L,20,l[27]),N=C(N,E,y,j,se,5,l[28]),j=C(j,N,E,y,k,9,l[29]),y=C(y,j,N,E,I,14,l[30]),E=C(E,y,j,N,V,20,l[31]),N=f(N,E,y,j,P,4,l[32]),j=f(j,N,E,y,L,11,l[33]),y=f(y,j,N,E,G,16,l[34]),E=f(E,y,j,N,B,23,l[35]),N=f(N,E,y,j,T,4,l[36]),j=f(j,N,E,y,z,11,l[37]),y=f(y,j,N,E,I,16,l[38]),E=f(E,y,j,N,$,23,l[39]),N=f(N,E,y,j,se,4,l[40]),j=f(j,N,E,y,b,11,l[41]),y=f(y,j,N,E,M,16,l[42]),E=f(E,y,j,N,D,23,l[43]),N=f(N,E,y,j,q,4,l[44]),j=f(j,N,E,y,V,11,l[45]),y=f(y,j,N,E,te,16,l[46]),E=f(E,y,j,N,k,23,l[47]),N=x(N,E,y,j,b,6,l[48]),j=x(j,N,E,y,I,10,l[49]),y=x(y,j,N,E,B,15,l[50]),E=x(E,y,j,N,P,21,l[51]),N=x(N,E,y,j,V,6,l[52]),j=x(j,N,E,y,M,10,l[53]),y=x(y,j,N,E,$,15,l[54]),E=x(E,y,j,N,T,21,l[55]),N=x(N,E,y,j,L,6,l[56]),j=x(j,N,E,y,te,10,l[57]),y=x(y,j,N,E,D,15,l[58]),E=x(E,y,j,N,se,21,l[59]),N=x(N,E,y,j,z,6,l[60]),j=x(j,N,E,y,G,10,l[61]),y=x(y,j,N,E,k,15,l[62]),E=x(E,y,j,N,q,21,l[63]),h[0]=h[0]+N|0,h[1]=h[1]+E|0,h[2]=h[2]+y|0,h[3]=h[3]+j|0},_doFinalize:function(){var _=this._data,w=_.words,S=this._nDataBytes*8,u=_.sigBytes*8;w[u>>>5]|=128<<24-u%32;var s=i.floor(S/4294967296),h=S;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,_.sigBytes=(w.length+1)*4,this._process();for(var b=this._hash,T=b.words,k=0;k<4;k++){var M=T[k];T[k]=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360}return b},clone:function(){var _=c.clone.call(this);return _._hash=this._hash.clone(),_}});function p(_,w,S,u,s,h,b){var T=_+(w&S|~w&u)+s+b;return(T<<h|T>>>32-h)+w}function C(_,w,S,u,s,h,b){var T=_+(w&u|S&~u)+s+b;return(T<<h|T>>>32-h)+w}function f(_,w,S,u,s,h,b){var T=_+(w^S^u)+s+b;return(T<<h|T>>>32-h)+w}function x(_,w,S,u,s,h,b){var T=_+(S^(w|~u))+s+b;return(T<<h|T>>>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,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],x=C[1],_=C[2],w=C[3],S=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)+S+d[u];u<20?h+=(x&_|~x&w)+1518500249:u<40?h+=(x^_^w)+1859775393:u<60?h+=(x&_|x&w|_&w)-1894007588:h+=(x^_^w)-899497514,S=w,w=_,_=x<<30|x>>>2,x=f,f=h}C[0]=C[0]+f|0,C[1]=C[1]+x|0,C[2]=C[2]+_|0,C[3]=C[3]+w|0,C[4]=C[4]+S|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(),x=this._iKey=v.clone(),_=f.words,w=x.words,S=0;S<p;S++)_[S]^=1549556828,w[S]^=909522486;f.sigBytes=x.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,x=f.hasher.create(),_=m.create(),w=_.words,S=f.keySize,u=f.iterations;w.length<S;){C&&x.update(C),C=x.update(v).finalize(p),x.reset();for(var s=1;s<u;s++)C=x.finalize(C),x.reset();_.concat(C)}return _.sigBytes=S*4,_}});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,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(P,D){return this.create(this._ENC_XFORM_MODE,P,D)},createDecryptor:function(P,D){return this.create(this._DEC_XFORM_MODE,P,D)},init:function(P,D,I){this.cfg=this.cfg.extend(I),this._xformMode=P,this._key=D,this.reset()},reset:function(){d.reset.call(this),this._doReset()},process:function(P){return this._append(P),this._process()},finalize:function(P){P&&this._append(P);var D=this._doFinalize();return D},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function P(D){return typeof D=="string"?z:T}return function(D){return{encrypt:function(I,L,q){return P(L).encrypt(D,I,L,q)},decrypt:function(I,L,q){return P(L).decrypt(D,I,L,q)}}}}()});o.StreamCipher=f.extend({_doFinalize:function(){var P=this._process(!0);return P},blockSize:1});var x=a.mode={},_=o.BlockCipherMode=m.extend({createEncryptor:function(P,D){return this.Encryptor.create(P,D)},createDecryptor:function(P,D){return this.Decryptor.create(P,D)},init:function(P,D){this._cipher=P,this._iv=D}}),w=x.CBC=function(){var P=_.extend();P.Encryptor=P.extend({processBlock:function(I,L){var q=this._cipher,$=q.blockSize;D.call(this,I,L,$),q.encryptBlock(I,L),this._prevBlock=I.slice(L,L+$)}}),P.Decryptor=P.extend({processBlock:function(I,L){var q=this._cipher,$=q.blockSize,G=I.slice(L,L+$);q.decryptBlock(I,L),D.call(this,I,L,$),this._prevBlock=G}});function D(I,L,q){var $,G=this._iv;G?($=G,this._iv=i):$=this._prevBlock;for(var V=0;V<q;V++)I[L+V]^=$[V]}return P}(),S=a.pad={},u=S.Pkcs7={pad:function(P,D){for(var I=D*4,L=I-P.sigBytes%I,q=L<<24|L<<16|L<<8|L,$=[],G=0;G<L;G+=4)$.push(q);var V=c.create($,L);P.concat(V)},unpad:function(P){var D=P.words[P.sigBytes-1>>>2]&255;P.sigBytes-=D}};o.BlockCipher=f.extend({cfg:f.cfg.extend({mode:w,padding:u}),reset:function(){var P;f.reset.call(this);var D=this.cfg,I=D.iv,L=D.mode;this._xformMode==this._ENC_XFORM_MODE?P=L.createEncryptor:(P=L.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==P?this._mode.init(this,I&&I.words):(this._mode=P.call(L,this,I&&I.words),this._mode.__creator=P)},_doProcessBlock:function(P,D){this._mode.processBlock(P,D)},_doFinalize:function(){var P,D=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(D.pad(this._data,this.blockSize),P=this._process(!0)):(P=this._process(!0),D.unpad(P)),P},blockSize:128/32});var s=o.CipherParams=m.extend({init:function(P){this.mixIn(P)},toString:function(P){return(P||this.formatter).stringify(this)}}),h=a.format={},b=h.OpenSSL={stringify:function(P){var D,I=P.ciphertext,L=P.salt;return L?D=c.create([1398893684,1701076831]).concat(L).concat(I):D=I,D.toString(v)},parse:function(P){var D,I=v.parse(P),L=I.words;return L[0]==1398893684&&L[1]==1701076831&&(D=c.create(L.slice(2,4)),L.splice(0,4),I.sigBytes-=16),s.create({ciphertext:I,salt:D})}},T=o.SerializableCipher=m.extend({cfg:m.extend({format:b}),encrypt:function(P,D,I,L){L=this.cfg.extend(L);var q=P.createEncryptor(I,L),$=q.finalize(D),G=q.cfg;return s.create({ciphertext:$,key:I,iv:G.iv,algorithm:P,mode:G.mode,padding:G.padding,blockSize:P.blockSize,formatter:L.format})},decrypt:function(P,D,I,L){L=this.cfg.extend(L),D=this._parse(D,L.format);var q=P.createDecryptor(I,L).finalize(D.ciphertext);return q},_parse:function(P,D){return typeof P=="string"?D.parse(P,this):P}}),k=a.kdf={},M=k.OpenSSL={execute:function(P,D,I,L,q){if(L||(L=c.random(64/8)),q)var $=C.create({keySize:D+I,hasher:q}).compute(P,L);else var $=C.create({keySize:D+I}).compute(P,L);var G=c.create($.words.slice(D),I*4);return $.sigBytes=D*4,s.create({key:$,iv:G,salt:L})}},z=o.PasswordBasedCipher=T.extend({cfg:T.cfg.extend({kdf:M}),encrypt:function(P,D,I,L){L=this.cfg.extend(L);var q=L.kdf.execute(I,P.keySize,P.ivSize,L.salt,L.hasher);L.iv=q.iv;var $=T.encrypt.call(this,P,D,q.key,L);return $.mixIn(q),$},decrypt:function(P,D,I,L){L=this.cfg.extend(L),D=this._parse(D,L.format);var q=L.kdf.execute(I,P.keySize,P.ivSize,D.salt,L.hasher);L.iv=q.iv;var $=T.decrypt.call(this,P,D,q.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,m=i.algo,c=[],d=[],l=[],v=[],p=[],C=[],f=[],x=[],_=[],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,T=0,h=0;h<256;h++){var k=T^T<<1^T<<2^T<<3^T<<4;k=k>>>8^k&255^99,c[b]=k,d[k]=b;var M=s[b],z=s[M],P=s[z],D=s[k]*257^k*16843008;l[b]=D<<24|D>>>8,v[b]=D<<16|D>>>16,p[b]=D<<8|D>>>24,C[b]=D;var D=P*16843009^z*65537^M*257^b*16843008;f[k]=D<<24|D>>>8,x[k]=D<<16|D>>>16,_[k]=D<<8|D>>>24,w[k]=D,b?(b=M^s[s[s[P^M]]],T^=s[s[T]]):b=T=1}})();var S=[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,T=h.sigBytes/4,k=this._nRounds=T+6,M=(k+1)*4,z=this._keySchedule=[],P=0;P<M;P++)P<T?z[P]=b[P]:(s=z[P-1],P%T?T>6&&P%T==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^=S[P/T|0]<<24),z[P]=z[P-T]^s);for(var D=this._invKeySchedule=[],I=0;I<M;I++){var P=M-I;if(I%4)var s=z[P];else var s=z[P-4];I<4||P<=4?D[I]=s:D[I]=f[c[s>>>24]]^x[c[s>>>16&255]]^_[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,f,x,_,w,d);var b=s[h+1];s[h+1]=s[h+3],s[h+3]=b},_doCryptBlock:function(s,h,b,T,k,M,z,P){for(var D=this._nRounds,I=s[h]^b[0],L=s[h+1]^b[1],q=s[h+2]^b[2],$=s[h+3]^b[3],G=4,V=1;V<D;V++){var se=T[I>>>24]^k[L>>>16&255]^M[q>>>8&255]^z[$&255]^b[G++],B=T[L>>>24]^k[q>>>16&255]^M[$>>>8&255]^z[I&255]^b[G++],te=T[q>>>24]^k[$>>>16&255]^M[I>>>8&255]^z[L&255]^b[G++],N=T[$>>>24]^k[I>>>16&255]^M[L>>>8&255]^z[q&255]^b[G++];I=se,L=B,q=te,$=N}var se=(P[I>>>24]<<24|P[L>>>16&255]<<16|P[q>>>8&255]<<8|P[$&255])^b[G++],B=(P[L>>>24]<<24|P[q>>>16&255]<<16|P[$>>>8&255]<<8|P[I&255])^b[G++],te=(P[q>>>24]<<24|P[$>>>16&255]<<16|P[I>>>8&255]<<8|P[L&255])^b[G++],N=(P[$>>>24]<<24|P[I>>>16&255]<<16|P[L>>>8&255]<<8|P[q&255])^b[G++];s[h]=se,s[h+1]=B,s[h+2]=te,s[h+3]=N},keySize:256/32});i.AES=o._createHelper(u)}(),r.AES})}(Bt)),Bt.exports}var qt={exports:{}},Rl=qt.exports,Lr;function Tl(){return Lr||(Lr=1,function(e,n){(function(r,i){e.exports=i(Oe())})(Rl,function(r){return r.enc.Latin1})}(qt)),qt.exports}var Ft={exports:{}},Pl=Ft.exports,Ar;function Il(){return Ar||(Ar=1,function(e,n){(function(r,i){e.exports=i(Oe())})(Pl,function(r){return r.enc.Utf8})}(Ft)),Ft.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,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={},qr;function Nl(){if(qr)return tt;qr=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 Fr;function Ll(){if(Fr)return Ee;Fr=1;var e=Ee&&Ee.__createBinding||(Object.create?function(f,x,_,w){w===void 0&&(w=_);var S=Object.getOwnPropertyDescriptor(x,_);(!S||("get"in S?!x.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return x[_]}}),Object.defineProperty(f,w,S)}:function(f,x,_,w){w===void 0&&(w=_),f[w]=x[_]}),n=Ee&&Ee.__setModuleDefault||(Object.create?function(f,x){Object.defineProperty(f,"default",{enumerable:!0,value:x})}:function(f,x){f.default=x}),r=Ee&&Ee.__importStar||function(f){if(f&&f.__esModule)return f;var x={};if(f!=null)for(var _ in f)_!=="default"&&Object.prototype.hasOwnProperty.call(f,_)&&e(x,f,_);return n(x,f),x},i=Ee&&Ee.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.AesCrypter=void 0;const a=r(kl()),o=i(Tl()),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(x,_){const w=typeof x=="string"?x:JSON.stringify(x);return a.encrypt(w,_).toString()}decrypt(x,_,w="utf8"){return a.decrypt(x,_).toString(p[w])}}return Ee.AesCrypter=C,Ee.default=new C,Ee}const Al=!0,Ml=">= 8",zl=">= 0.5 && < 0.9.7",ql=!0,Fl=!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",Tc=">= 0.9.4",Pc=!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,qc=!0,Fc=">= 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:ql,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:Fl,"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:Tc,"node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:Pc,"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:qc,"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:Fc,"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,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 Xc(){if(Kr)return Cn;Kr=1;var e=Jt(),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 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(),m=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(S){try{var u=n.statSync(S,{throwIfNoEntry:!1})}catch(s){if(s&&(s.code==="ENOENT"||s.code==="ENOTDIR"))return!1;throw s}return!!u&&(u.isFile()||u.isFIFO())},p=function(S){try{var u=n.statSync(S,{throwIfNoEntry:!1})}catch(s){if(s&&(s.code==="ENOENT"||s.code==="ENOTDIR"))return!1;throw s}return!!u&&u.isDirectory()},C=function(S){try{return c(S)}catch(u){if(u.code!=="ENOENT")throw u}return S},f=function(S,u,s){return s&&s.preserveSymlinks===!1?S(u):u},x=function(S,u){var s=S(u);try{var h=JSON.parse(s);return h}catch{}},_=function(S,u,s){for(var h=o(u,s,S),b=0;b<h.length;b++)h[b]=r.join(h[b],S);return h};return jn=function(S,u){if(typeof S!="string")throw new TypeError("Path must be a string.");var s=m(S,u),h=s.isFile||v,b=s.readFileSync||n.readFileSync,T=s.isDirectory||p,k=s.realpathSync||C,M=s.readPackageSync||x;if(s.readFileSync&&s.readPackageSync)throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");var z=s.packageIterator,P=s.extensions||[".js"],D=s.includeCoreModules!==!1,I=s.basedir||r.dirname(a()),L=s.filename||I;s.paths=s.paths||l();var q=f(k,r.resolve(I),s);if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(S)){var $=r.resolve(q,S);(S==="."||S===".."||S.slice(-1)==="/")&&($+="/");var G=B($)||N($);if(G)return f(k,G,s)}else{if(D&&e(S))return S;var V=E(S,q);if(V)return f(k,V,s)}var se=new Error("Cannot find module '"+S+"' from '"+L+"'");throw se.code="MODULE_NOT_FOUND",se;function B(y){var j=te(r.dirname(y));if(j&&j.dir&&j.pkg&&s.pathFilter){var U=r.relative(j.dir,y),W=s.pathFilter(j.pkg,y,U);W&&(y=r.resolve(j.dir,W))}if(h(y))return y;for(var re=0;re<P.length;re++){var J=y+P[re];if(h(J))return J}}function te(y){if(!(y===""||y==="/")&&!(pe.platform==="win32"&&/^\w:[/\\]*$/.test(y))&&!/[/\\]node_modules[/\\]*$/.test(y)){var j=r.join(f(k,y,s),"package.json");if(!h(j))return te(r.dirname(y));var U=M(b,j);return U&&s.packageFilter&&(U=s.packageFilter(U,y)),{pkg:U,dir:y}}}function N(y){var j=r.join(f(k,y,s),"/package.json");if(h(j)){try{var U=M(b,j)}catch{}if(U&&s.packageFilter&&(U=s.packageFilter(U,y)),U&&U.main){if(typeof U.main!="string"){var W=new TypeError("package “"+U.name+"” `main` must be a string");throw W.code="INVALID_PACKAGE_MAIN",W}(U.main==="."||U.main==="./")&&(U.main="index");try{var re=B(r.resolve(y,U.main));if(re)return re;var J=N(r.resolve(y,U.main));if(J)return J}catch{}}}return B(r.join(y,"/index"))}function E(y,j){for(var U=function(){return _(y,j,s)},W=z?z(y,j,U,s):U(),re=0;re<W.length;re++){var J=W[re];if(T(r.dirname(J))){var ne=B(J);if(ne)return ne;var ie=N(J);if(ie)return ie}}}},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,Xr;function rd(){if(Xr)return Sn;Xr=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),x=parseInt("001",8),_=C|f,w=c&x||c&f&&l===p||c&C&&d===v||c&_&&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(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=Jt(),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":"",x=n?f.split(p):[""];return n&&l.indexOf(".")!==-1&&x[0]!==""&&x.unshift(""),{pathEnv:C,pathExt:x,pathExtExe:f}},c=(l,v,p)=>{typeof v=="function"&&(p=v,v={}),v||(v={});const{pathEnv:C,pathExt:f,pathExtExe:x}=m(l,v),_=[],w=u=>new Promise((s,h)=>{if(u===C.length)return v.all&&_.length?s(_):h(o(l));const b=C[u],T=/^".*"$/.test(b)?b.slice(1,-1):b,k=r.join(T,l),M=!T&&/^\.[\\\/]/.test(l)?l.slice(0,2)+k:k;s(S(M,u,0))}),S=(u,s,h)=>new Promise((b,T)=>{if(h===f.length)return b(w(s+1));const k=f[h];a(u+k,{pathExt:x},(M,z)=>{if(!M&&z)if(v.all)_.push(u+k);else return b(u+k);return b(S(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:f}=m(l,v),x=[];for(let _=0;_<p.length;_++){const w=p[_],S=/^".*"$/.test(w)?w.slice(1,-1):w,u=r.join(S,l),s=!S&&/^\.[\\\/]/.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)x.push(b);else return b}catch{}}}if(v.all&&x.length)return x;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 Tn,no;function ad(){if(no)return Tn;no=1;var e={};const{BLOCKLET_MODES:n}=Js(),r=po(),i=Ll().default,a=ei(),o=ri,{dirname:m,join:c,sep:d}=Jt(),l=td(),{tmpdir:v,homedir:p}=fo(),C=sd(),{withHttps:f,withHttp:x}=ti(),{exec:_}=en,{promisify:w}=ni(),S=id(),u=(E,y,j)=>i.encrypt(E,r.pbkdf2Sync(j,y,256,32,"sha512").toString("hex")),s=(E,y,j)=>i.decrypt(E,r.pbkdf2Sync(j,y,256,32,"sha512").toString("hex")),h=(E,y=!0)=>{let j=E;return Array.isArray(j)&&j.every(U=>U.originFileObj&&U.url)&&(j=j.map(U=>U.url),j.length===1&&([j]=j)),y&&j&&typeof j=="object"&&(j=JSON.stringify(j)),j&&typeof j=="string"&&(j=j.replace(/(\r\n|\n|\r)/gm," ")),j},b=E=>E.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),T=E=>b(ar.from(E).toString("base64")),k=E=>(E+"===".slice((E.length+3)%4)).replace(/-/g,"+").replace(/_/g,"/"),M=E=>new Uint8Array(ar.from(k(E),"base64")),z="v21.6.0",P=()=>a.gte(pe.version,z),D=()=>{try{return l("@arcblock/pm2",{basedir:__dirname})}catch{return null}};function I(E){try{return C.sync(E)}catch{return null}}const L=new Map;async function q(){const E=w(_),y=pe.version;if(L.has(y))return L.get(y);try{const{stdout:j}=await E("node -h");let U;if(j.includes("--permission"))U="--permission";else if(j.includes("--experimental-permission"))U="--experimental-permission";else throw new Error(`Can not get permission options for this Node.js version: ${y}`);return L.set(y,U),U}catch(j){throw console.error(j),j}}const $=async(E,y=!0)=>{const j=e.NODE_OPTIONS??"";if(j.includes("--experimental-permission")||j.includes("--permission")||j.includes("--allow-fs-read")||j.includes("--allow-fs-write")||j.includes("--allow-addons")||j.includes("--allow-child-process")||j.includes("--allow-worker"))throw console.error("getSecurityNodeOptions",{nodeOptions:j}),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(!E)throw new Error("blocklet is not defined");if(j.includes("ms-vscode.js-debug/src/bootloader.js")&&(E.mode===n.DEVELOPMENT||E.environmentObj.BLOCKLET_MODE===n.DEVELOPMENT))return j;const U=[j].filter(Z=>!!Z&&Z!=="undefined");if(!P()||!y)return U.join(" ").trim();const W=D(),re=I("meilisearch"),J="/data/bin/meilisearch",ne=I("blocklet"),ie=[e.XDG_DATA_HOME?c(e.XDG_DATA_HOME,"pnpm/global/"):"",e.PNPM_HOME?c(e.PNPM_HOME,"global/"):""],he=await q();return U.push(he,...[E.environmentObj.BLOCKLET_DATA_DIR,E.environmentObj.BLOCKLET_APP_DIR,E.environmentObj.BLOCKLET_LOG_DIR,E.environmentObj.BLOCKLET_CACHE_DIR,E.environmentObj.BLOCKLET_APP_DATA_DIR?c(E.environmentObj.BLOCKLET_APP_DATA_DIR,".projects"):"",v()].filter(Boolean).map(Z=>`--allow-fs-write=${c(Z,"/*")}`),"--allow-addons","--allow-child-process"),E.mode===n.DEVELOPMENT||E.environmentObj.BLOCKLET_MODE===n.DEVELOPMENT?(U.push("--allow-worker","--allow-fs-read=*"),U.push(`--allow-fs-write=${c(p(),".npm","_logs","/*")}`)):U.push(...[E.environmentObj.BLOCKLET_LOG_DIR,E.environmentObj.BLOCKLET_CACHE_DIR,E.environmentObj.BLOCKLET_APP_DATA_DIR,m(m(E.environmentObj.BLOCKLET_APP_DIR)),W&&m(m(m(m(W)))),ne,re,J,m(m(pe.execPath)),pe.cwd(),v(),c(p(),".cursor-server"),"/Applications/Cursor.app",...ie].filter(Boolean).filter(Z=>Z!==d).map(Z=>`--allow-fs-read=${c(Z,"/*")}`)),o(U).join(" ").trim()},G={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 V(E,y,j){const U=S(E[y]||[]);return U.push(...j),[...new Set(U)]}async function se(E,{node:y,blocklet:j,trustedDomains:U=[]}){if(!E?.contentSecurityPolicy?.directives)return E;const W=S(E);W.contentSecurityPolicy.directives["default-src"]=V(W.contentSecurityPolicy.directives,"default-src",["'self'"]);const re=await y.getNodeInfo({useCache:!0});let J=await y.getBlockletDomainAliases({blocklet:j,nodeInfo:re});return J=(J||[]).map(ne=>ne.value),W.contentSecurityPolicy.directives["connect-src"]=V(W.contentSecurityPolicy.directives,"connect-src",["'self'",...J.filter(ne=>ne).map(ne=>`http://${ne}/.well-known/ping`),"https://api.simplesvg.com","https://api.iconify.design","https://api.unisvg.com"]),W.contentSecurityPolicy.directives["script-src"]=V(W.contentSecurityPolicy.directives,"script-src",["'self'","https://js.stripe.com"]),W.contentSecurityPolicy.directives["frame-src"]=V(W.contentSecurityPolicy.directives,"frame-src",["'self'","https://js.stripe.com"]),W.contentSecurityPolicy.directives["frame-ancestors"]=V(W.contentSecurityPolicy.directives,"frame-ancestors",["'self'",...(j.settings.userSpaceHosts||[]).map(ne=>`https://${ne}`),...U.filter(Boolean).map(ne=>`http://${ne}`)]),W}async function B(E,{node:y,blocklet:j}){const U=S(E);if(U?.origin?.smart){const W=[];W.push(...U.origin?.value||[]);const re=await y.getNodeInfo({useCache:!0});let J=await y.getBlockletDomainAliases({blocklet:j,nodeInfo:re});J=(J||[]).map(Z=>Z.value),W.push(...J.map(Z=>f(Z)),...J.map(Z=>x(Z)));const ie=((j.settings.federated||{})?.sites||[]).filter(Z=>Z?.isMaster!==!1||Z.status==="approved"),he=[];for(const Z of ie)he.push(new URL(Z.appUrl).hostname),he.push(...Z.aliasDomain||[]);W.push(...he.map(Z=>f(Z)),...he.map(Z=>x(Z))),U.origin.value=[...new Set(W)]}return U}function te(E){const y=S(E);for(const j of Object.keys(y))y[j]=y[j]?.value??y[j];return y}function N(E){const y=S(E);for(const j of Object.keys(y))y[j]=y[j]?.override??!1;return y}return Tn={encrypt:u,decrypt:s,formatEnv:h,encodeEncryptionKey:T,decodeEncryptionKey:M,canUseFileSystemIsolateApi:P,getSecurityNodeOptions:$,patchResponseHeader:se,patchCors:B,cleanConfigOverride:te,keepConfigOverride:N,DEFAULT_HELMET_CONFIG:G,SAFE_NODE_VERSION:z},Tn}var Qo=ad();const Pn=(e,n)=>e&&Qo.encrypt(e,n||H.AIGNE_CONFIG_ENCRYPT_SALT,""),In=(e,n)=>e&&Qo.decrypt(e,n||H.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?ke(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=ke(n.origin,"__blocklet__.js?type=json"),i=await Gt.get(r).then(m=>m.data);if((i?.componentId||"").split("/").pop()===Vt)return ke(n.origin,i.prefix||"/");const o=(i?.componentMountPoints||[]).find(m=>m?.did===Vt);return o?ke(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 ke(o,a);const c=(((i=window.blocklet)===null||i===void 0?void 0:i.componentMountPoints)||[]).find(d=>d?.did===Vt);return c?ke(o,c.mountPoint):ke(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: ${xe(a)}`)}if(!r||!n)throw new Error("baseUrl or accessKey is not set");return Gt.get(ke(r,"/api/user/info"),{headers:{Authorization:`Bearer ${n}`}}).then(a=>a.data)}const nn=oe.div`
|
|
324
324
|
min-height: ${({minHeight:e})=>e==="none"?"auto":`${e||160}px`};
|
|
325
325
|
height: ${({height:e,minHeight:n})=>e==="none"?"auto":`${e||n||160}px`};
|
|
326
326
|
padding: ${({theme:e})=>e.spacing(2)};
|
|
@@ -329,7 +329,7 @@ import{aF as qe,j as t,ds as ws,gC as _s,ix as Ss,n as ce,bn as ye,M as O,ay as
|
|
|
329
329
|
border-color: ${({theme:e})=>e.palette.divider};
|
|
330
330
|
background-color: ${({theme:e})=>e.palette.background.paper};
|
|
331
331
|
box-shadow: ${({theme:e})=>e.shadows[1]};
|
|
332
|
-
`,pd={loading:g.bool,authLoading:g.bool,disconnectLoading:g.bool,connecting:g.bool},
|
|
332
|
+
`,pd={loading:g.bool,authLoading:g.bool,disconnectLoading:g.bool,connecting:g.bool},Mn=oe(Zt)`
|
|
333
333
|
color: ${({theme:e})=>e.palette.text.primary};
|
|
334
334
|
font-weight: 500;
|
|
335
335
|
border-color: ${({theme:e})=>e.palette.grey[300]};
|
|
@@ -337,14 +337,14 @@ import{aF as qe,j as t,ds as ws,gC as _s,ix as Ss,n as ce,bn as ye,M as O,ay as
|
|
|
337
337
|
&:hover {
|
|
338
338
|
background-color: ${({theme:e})=>oi(e.palette.primary.main,.1)};
|
|
339
339
|
}
|
|
340
|
-
`;function
|
|
340
|
+
`;function Jo({loading:e=!1,user:n=null,switchUser:r=mt,connecting:i=!1,url:a=""}){const{t:o}=R.useContext(we);return!n&&!e?null:t.jsx(nn,{children:e?t.jsxs(O,{sx:{display:"flex",justifyContent:"center",alignItems:"flex-start",gap:2,height:"100%"},children:[t.jsx(Me,{variant:"circular",width:48,height:48}),t.jsxs(O,{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(O,{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(ke(a,H.WELLKNOWN_BLOCKLET_USER_PATH),{did:n.did}),"_blank")}}),t.jsx(O,{children:t.jsx(Mn,{variant:"outlined",disabled:i,startIcon:i?t.jsx(be,{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:g.bool,user:g.object,switchUser:g.func,url:g.string,...pd};function es({loading:e=!1,credit:n=null,connecting:r=!1,onRefresh:i=()=>{},refreshing:a=!1}){const{t:o}=R.useContext(we),m=$n`
|
|
341
341
|
from {
|
|
342
342
|
transform: rotate(0deg);
|
|
343
343
|
}
|
|
344
344
|
to {
|
|
345
345
|
transform: rotate(360deg);
|
|
346
346
|
}
|
|
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(O,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",gap:2,height:"100%"},children:[t.jsxs(O,{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(O,{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(O,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",height:"100%",width:"100%"},children:[t.jsxs(O,{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?`- ${no(l?.pendingCredit)}`:no(l.balance)}),c?null:t.jsx(je,{title:o("common.refresh"),children:t.jsx(Pa,{sx:{fontSize:14,ml:1,cursor:"pointer",animation:a?`${m} 1s linear infinite`:"none"},onClick:i})})]})]}),c?null:t.jsxs(O,{sx:{width:"100%",display:"flex",gap:1},children:[t.jsx(An,{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(An,{fullWidth:!0,disabled:r,onClick:()=>{v&&window.open(fo(v,{appDid:window.blocklet.appPid}),"_blank")},variant:"outlined",startIcon:t.jsx(fe,{style:{fontSize:16},icon:"hugeicons:transaction"}),children:o("setting.aigne.transaction")})]})]})})}Jo.propTypes={loading:g.bool,credit:g.object,connecting:g.bool,onRefresh:g.func,refreshing:g.bool};function es({url:e,apiKey:n,switchUser:r=mt,connecting:i=!1}){const{t:a}=R.useContext(we),[o,m]=R.useState(!1),{data:c,loading:d,error:l,refresh:v}=ii(()=>ud({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(O,{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(Xo,{loading:d&&!o,user:c?.user,switchUser:r,connecting:i,url:e})}),t.jsx(ze,{size:{xs:12,md:6},children:t.jsx(Jo,{refreshing:o,loading:d&&!o,credit:c,connecting:i,onRefresh:p})})]})]})}es.propTypes={url:g.string.isRequired,apiKey:g.string.isRequired,connecting:g.bool,switchUser:g.func};function ts({url:e,providerName:n,disconnect:r=mt,disabled:i=!1,loading:a=!1,validationResult:o=""}){const{t:m}=R.useContext(we),c=R.useMemo(()=>o&&o!=="success",[o]);return t.jsx(nn,{minHeight:80,height:"none",children:t.jsxs(O,{sx:{width:"100%",height:"100%",display:"flex",justifyContent:"flex-start",alignItems:"center",gap:2},children:[c?t.jsx(je,{title:o,children:t.jsx(Ro,{sx:{fontSize:24,color:"error.main",cursor:"pointer",flexShrink:0}})}):t.jsx(Io,{sx:{fontSize:24,color:"success.main",cursor:"pointer",flexShrink:0}}),t.jsxs(O,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flex:1,flexWrap:"wrap"},children:[t.jsxs(O,{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(be,{size:16,sx:{mr:1}}):t.jsx(Yi,{}),onClick:r,disabled:i||a,sx:{lineHeight:1.5},children:m("setting.aigne.disconnect")})]})]})})}ts.propTypes={url:g.string.isRequired,providerName:g.string.isRequired,disabled:g.bool,disconnect:g.func,loading:g.bool,validationResult:g.string};function rt({desc:e,docLink:n=null,provider:r="",orientation:i="vertical"}){const{t:a}=R.useContext(we);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(je,{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 In={provider:"",model:"",url:"",key:"",accessKeyId:"",testConnection:""};rt.propTypes={desc:g.string.isRequired,docLink:g.string,provider:g.string,orientation:g.oneOf(["vertical","horizontal"])};function ns({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(we),x=ye(),{api:_}=x,{did:w,blocklet:S,actions:u}=De(),[s,h]=R.useState(!1),b=lr({...In}),T=lr({loading:!1,success:!1}),{confirmApi:k,confirmHolder:M}=mo(),z=R.useMemo(()=>`connect-aigne-${w}`,[w]),P=cd(x),D=Zi({messageType:"connect-aigne-message",onOpen:()=>m(!0),onClose:()=>m(!1)}),I=R.useMemo(()=>o||c||l||T.loading,[o,c,l,T.loading]),L=Ke(A=>P.find(Q=>Q.provider===A)),q=Ke(A=>L(A)?.models||[]);ai(()=>{z&&pl(z)});const $=Ke(A=>{if(A)return A;const Q=P[0]?.provider;return q(Q)[0]?.name||"auto"}),G=Ke(()=>{Object.keys(In).forEach(A=>{b[A]=In[A]})}),V=kt(()=>{const{aigne:A={}}=S?.settings||{};return A},[S]),se=kt(()=>{const A={...V},Q=A?.provider||P[0]?.provider,ee=L(Q),ge=pt(Q),vt=Ht(Q);return{...A,url:cr.getOriginUrl(A?.url||ge&&ee?.baseURL||""),provider:Q,model:$(A?.model),key:Pn(A?.key,w),accessKeyId:vt?Pn(A?.accessKeyId,w):A?.accessKeyId,secretAccessKey:vt?Pn(A?.secretAccessKey,w):A?.secretAccessKey}},[S,L,$]),[B,te]=R.useState(se);R.useEffect(()=>{te(se)},[se]);const N=R.useMemo(()=>B?.url&&B?.key&&B?.provider==="aigneHub",[B]),E=kt(()=>L(B.provider)?.name||B.provider,[B,L]),y=R.useMemo(()=>ld(B),[B]),j=kt(()=>L(B.provider)?.documentation||"",[B,L]),U=async()=>{try{m(!0);const A=new Set(["running","error"]),Q=S.children.filter(ee=>A.has(ee.status)||A.has(ee.greenStatus)).map(ee=>ee.meta.did);await _.restartBlocklet({input:{did:w,componentDids:Q}}),u.refreshBlocklet()}catch(A){console.error("error",A),K.error(xe(A))}finally{m(!1)}},W=(A=!0)=>{if(r!=="setup")return new Promise(Q=>{k.open({title:f("setting.aigne.restart.title"),content:A?f("setting.aigne.restart.connectedContent",{provider:E}):f("setting.aigne.restart.notConnectedContent",{provider:E}),confirmButtonText:f("setting.aigne.restart.confirm"),cancelButtonText:f("setting.aigne.restart.cancel"),onConfirm(ee){ee(),U(),Q(!0)},onCancel(){Q(!1)}})})},re=Ke(()=>new Promise(A=>{k.open({title:f("setting.aigne.revokeUrlAuthTitle",{url:f("setting.aigne.baseUrl",{provider:E})}),content:f("setting.aigne.revokeUrlAuth",{url:f("setting.aigne.baseUrl",{provider:E})}),confirmButtonText:f("common.confirm"),cancelButtonText:f("common.cancel"),onConfirm(Q){Q(),A(!0)},onCancel(){A(!1)}})})),J=async(A,Q)=>{const ee={};if(te({...B,[A]:Q}),A==="provider"){const ge=q(Q);ge.length>0&&(ee.model=ge[0].name),ee.key=""}return N&&A==="url"&&Q!==B.url&&(await re()?(ee.key="",ee.validationResult=""):ee.url=B.url),setTimeout(()=>{te({...B,[A]:Q,...ee})},100),h(!0),!0},ne=R.useMemo(()=>B.provider,[B.provider]),ie=Ke(A=>li(A)?"":f("setting.aigne.invalidUrl",{provider:E})),he=(A=[])=>{const Q=y.filter(ge=>!A.includes(ge));if(Q.length)return Q.forEach(ge=>{b[ge]="required"}),!Q.includes("url")&&pt(B.provider)&&(b.url=ie(B.url)),!1;const ee=pt(B.provider)&&ie(B.url);return ee?(b.url=ee,!1):!0},Z=async()=>{try{v(!0),await _.disconnectToAigne({input:{did:w,url:B.url,key:B.key}}),h(!1),K.success(f("setting.aigne.disconnectSuccess")),setTimeout(()=>{W(!1)},300)}catch(A){console.error("disconnect error:",A),K.error(xe(A)||f("setting.aigne.disconnectFailed"))}finally{v(!1)}},_e=()=>{k.open({title:f("setting.aigne.disconnect"),content:f("setting.aigne.disconnectConfirm"),confirmButtonText:f("setting.aigne.disconnect"),cancelButtonText:f("common.cancel"),onConfirm(A){A(),Z()}})},de=async()=>{if(!he())return;G();const A={...B,model:"auto",key:Tn(B.key,w)};Ht(A.provider)?(A.key="",B.accessKeyId&&(A.accessKeyId=Tn(B.accessKeyId,w)),B.secretAccessKey&&(A.secretAccessKey=Tn(B.secretAccessKey,w))):(A.accessKeyId="",A.secretAccessKey="");const Q=await _.updateBlockletSettings({input:{did:w,aigne:A}});return u.refreshBlocklet(),Q},Ve=async()=>{try{if(!s&&!i)return;m(!0);const A=await de();return A?(h(!1),K.success(f("oauth.saveSuccess")),A):void 0}catch(A){throw console.error("error",A),K.error(xe(A)||f("setting.aigne.failed")),A}finally{m(!1)}},Ye=async(A=!1)=>{b.testConnection="";try{if(T.loading=!0,!A&&(await de())?.code!=="ok")return;await _.verifyAigneConnection({input:{did:w}}),K.success(f("setting.aigne.testSuccess",{provider:E})),T.success=!0}catch(Q){throw console.error("error",Q),b.testConnection=Q.message,K.error(f("setting.aigne.testFailed")),Q}finally{T.loading=!1,u.refreshBlocklet()}},at=async()=>{try{await ml(_,{did:w,refresh:u.refreshBlocklet,t:f,providerName:E,timerKey:z,values:{...V}}).catch(A=>{throw console.error("waitGetConnectedAigne error",A),K.error(xe(A)),A}).then(()=>Ye(!0).catch(A=>{throw console.error("onVerifyConnection error",A),A})),W(!0)}catch(A){console.error("error",A)}finally{h(!1)}},Ze=()=>{he(["key"])&&(G(),D(async(A,Q)=>{try{d(!0);const ee=await _.connectToAigne({input:{did:w,baseUrl:cr.getOriginUrl(B.url||new URL(window.location.origin).origin),provider:B.provider,model:"auto"}});if(!ee?.url){K.error("failed to connect to endpoint"),d(!1),m(!1);return}Q(ee.url),await at(),d(!1)}catch(ee){const ge=xe(ee);K.error(ge),d(!1)}}))};R.useImperativeHandle(a,()=>({onSubmit:Ve,loading:o||c||l})),q(ne);const Qe=ne==="aigneHub",on=()=>{C(!p)},Se=A=>{A.preventDefault()},yt=R.useMemo(()=>b.url==="required"?f("common.requiredErrorText",{name:f("setting.aigne.baseUrl",{provider:E})}):b.url?b.url:b.key==="required"?f("setting.aigne.apiKeyNotAuthorized",{provider:E}):"",[b.url,b.key,f,E]);return t.jsxs(fd,{source:r,children:[t.jsx(O,{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:E})}),N&&B.validationResult?t.jsx(ts,{url:B.url,providerName:E,disconnect:_e,validationResult:B.validationResult,disabled:I,loading:l}):t.jsx(nn,{height:"none",minHeight:"none",children:t.jsxs(O,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:2},children:[t.jsx(dt,{orientation:e,title:f("setting.aigne.baseUrl",{provider:E}),required:pt(B.provider),desc:t.jsx(rt,{desc:f("setting.aigne.desc.baseUrl",{example:"https://hub.aigne.io"})}),children:t.jsx(Tt,{disabled:I,initialValue:B.url||"",directEditing:!0,onSubmit:A=>{J("url",A)},autoFocus:!1,errorTips:yt,InputProps:N?{endAdornment:t.jsx(dr,{position:"end",children:T.loading||c?t.jsx(be,{size:16}):t.jsxs(t.Fragment,{children:[B.validationResult==="success"?t.jsx(je,{title:f("setting.aigne.testSuccess",{provider:E}),children:t.jsx(Io,{sx:{fontSize:16,color:"success.main",cursor:"pointer"}})}):null,B.validationResult&&B.validationResult!=="success"?t.jsx(je,{title:B.validationResult,children:t.jsx(Ro,{sx:{fontSize:16,color:"error.main",cursor:"pointer"}})}):null,B.validationResult?null:t.jsx(me,{"aria-label":"test connection",onClick:Ye,edge:"end",children:T.loading?t.jsx(be,{size:16}):t.jsx(je,{title:f("setting.aigne.testConnection",{provider:E}),children:t.jsx(fe,{style:{fontSize:16},icon:"tabler:location-check"})})})]})})}:{}})}),t.jsx(Zt,{variant:"contained",onClick:Ze,startIcon:c?t.jsx(be,{size:16,sx:{mr:1}}):t.jsx(Xt,{}),disabled:I||!B.url,sx:{flexShrink:0},children:f("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:f("setting.aigne.modelAdapter"),required:!0,desc:t.jsx(rt,{desc:f("setting.aigne.desc.modelAdapter")}),children:t.jsx(Ko,{disabled:I,options:P,config:{multiple:!1,labelField:"name",valueField:"provider"},initialValue:B.provider,directEditing:!0,searchable:!1,helperText:b.provider==="required"?f("common.requiredErrorText",{name:f("setting.aigne.modelAdapter")}):b.provider,onChange:A=>J("provider",A)})})}),null,Qe?null:t.jsx(t.Fragment,{children:Ht(B.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:j,provider:E}),children:t.jsx(Tt,{disabled:I,initialValue:B.accessKeyId||"",type:p?"text":"password",onChange:A=>J("accessKeyId",A),directEditing:!0,autoFocus:!1})}),!n&&t.jsx(O,{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:j,provider:E}),children:t.jsx(Tt,{disabled:I,initialValue:B.secretAccessKey||"",type:p?"text":"password",onChange:A=>J("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:E}),docLink:j,provider:E}),children:t.jsx(Tt,{disabled:I,initialValue:B.key||"",type:p?"text":"password",onChange:A=>J("key",A),directEditing:!0,autoFocus:!1,InputProps:{endAdornment:t.jsx(dr,{position:"end",children:t.jsx(me,{"aria-label":"toggle password visibility",onClick:on,onMouseDown:Se,edge:"end",children:p?t.jsx(Oa,{}):t.jsx(Ua,{})})})}})})})]}),N&&B.validationResult==="success"?t.jsx(es,{switchUser:Ze,url:B.url||"",apiKey:B.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:X.getDisplayName(S,!0)})]}),M]})}ns.propTypes={orientation:g.oneOf(["vertical","horizontal"]),hideDivider:g.bool,source:g.oneOf(["dashboard","setup"]),forceValidate:g.bool};const fd=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(O,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",gap:2,height:"100%"},children:[t.jsxs(O,{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(O,{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(O,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",height:"100%",width:"100%"},children:[t.jsxs(O,{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(je,{title:o("common.refresh"),children:t.jsx(Pa,{sx:{fontSize:14,ml:1,cursor:"pointer",animation:a?`${m} 1s linear infinite`:"none"},onClick:i})})]})]}),c?null:t.jsxs(O,{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:g.bool,credit:g.object,connecting:g.bool,onRefresh:g.func,refreshing:g.bool};function ts({url:e,apiKey:n,switchUser:r=mt,connecting:i=!1}){const{t:a}=R.useContext(we),[o,m]=R.useState(!1),{data:c,loading:d,error:l,refresh:v}=ii(()=>ud({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(O,{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:g.string.isRequired,apiKey:g.string.isRequired,connecting:g.bool,switchUser:g.func};function ns({url:e,providerName:n,disconnect:r=mt,disabled:i=!1,loading:a=!1,validationResult:o=""}){const{t:m}=R.useContext(we),c=R.useMemo(()=>o&&o!=="success",[o]);return t.jsx(nn,{minHeight:80,height:"none",children:t.jsxs(O,{sx:{width:"100%",height:"100%",display:"flex",justifyContent:"flex-start",alignItems:"center",gap:2},children:[c?t.jsx(je,{title:o,children:t.jsx(To,{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(O,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flex:1,flexWrap:"wrap"},children:[t.jsxs(O,{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(be,{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:g.string.isRequired,providerName:g.string.isRequired,disabled:g.bool,disconnect:g.func,loading:g.bool,validationResult:g.string};function rt({desc:e,docLink:n=null,provider:r="",orientation:i="vertical"}){const{t:a}=R.useContext(we);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(je,{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:g.string.isRequired,docLink:g.string,provider:g.string,orientation:g.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(we),x=ye(),{api:_}=x,{did:w,blocklet:S,actions:u}=De(),[s,h]=R.useState(!1),b=cr({...Dn}),T=cr({loading:!1,success:!1}),{confirmApi:k,confirmHolder:M}=ho(),z=R.useMemo(()=>`connect-aigne-${w}`,[w]),P=cd(x),D=Zi({messageType:"connect-aigne-message",onOpen:()=>m(!0),onClose:()=>m(!1)}),I=R.useMemo(()=>o||c||l||T.loading,[o,c,l,T.loading]),L=Ke(A=>P.find(Q=>Q.provider===A)),q=Ke(A=>L(A)?.models||[]);ai(()=>{z&&pl(z)});const $=Ke(A=>{if(A)return A;const Q=P[0]?.provider;return q(Q)[0]?.name||"auto"}),G=Ke(()=>{Object.keys(Dn).forEach(A=>{b[A]=Dn[A]})}),V=kt(()=>{const{aigne:A={}}=S?.settings||{};return A},[S]),se=kt(()=>{const A={...V},Q=A?.provider||P[0]?.provider,ee=L(Q),ge=pt(Q),vt=Ht(Q);return{...A,url:dr.getOriginUrl(A?.url||ge&&ee?.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}},[S,L,$]),[B,te]=R.useState(se);R.useEffect(()=>{te(se)},[se]);const N=R.useMemo(()=>B?.url&&B?.key&&B?.provider==="aigneHub",[B]),E=kt(()=>L(B.provider)?.name||B.provider,[B,L]),y=R.useMemo(()=>ld(B),[B]),j=kt(()=>L(B.provider)?.documentation||"",[B,L]),U=async()=>{try{m(!0);const A=new Set(["running","error"]),Q=S.children.filter(ee=>A.has(ee.status)||A.has(ee.greenStatus)).map(ee=>ee.meta.did);await _.restartBlocklet({input:{did:w,componentDids:Q}}),u.refreshBlocklet()}catch(A){console.error("error",A),K.error(xe(A))}finally{m(!1)}},W=(A=!0)=>{if(r!=="setup")return new Promise(Q=>{k.open({title:f("setting.aigne.restart.title"),content:A?f("setting.aigne.restart.connectedContent",{provider:E}):f("setting.aigne.restart.notConnectedContent",{provider:E}),confirmButtonText:f("setting.aigne.restart.confirm"),cancelButtonText:f("setting.aigne.restart.cancel"),onConfirm(ee){ee(),U(),Q(!0)},onCancel(){Q(!1)}})})},re=Ke(()=>new Promise(A=>{k.open({title:f("setting.aigne.revokeUrlAuthTitle",{url:f("setting.aigne.baseUrl",{provider:E})}),content:f("setting.aigne.revokeUrlAuth",{url:f("setting.aigne.baseUrl",{provider:E})}),confirmButtonText:f("common.confirm"),cancelButtonText:f("common.cancel"),onConfirm(Q){Q(),A(!0)},onCancel(){A(!1)}})})),J=async(A,Q)=>{const ee={};if(te({...B,[A]:Q}),A==="provider"){const ge=q(Q);ge.length>0&&(ee.model=ge[0].name),ee.key=""}return N&&A==="url"&&Q!==B.url&&(await re()?(ee.key="",ee.validationResult=""):ee.url=B.url),setTimeout(()=>{te({...B,[A]:Q,...ee})},100),h(!0),!0},ne=R.useMemo(()=>B.provider,[B.provider]),ie=Ke(A=>li(A)?"":f("setting.aigne.invalidUrl",{provider:E})),he=(A=[])=>{const Q=y.filter(ge=>!A.includes(ge));if(Q.length)return Q.forEach(ge=>{b[ge]="required"}),!Q.includes("url")&&pt(B.provider)&&(b.url=ie(B.url)),!1;const ee=pt(B.provider)&&ie(B.url);return ee?(b.url=ee,!1):!0},Z=async()=>{try{v(!0),await _.disconnectToAigne({input:{did:w,url:B.url,key:B.key}}),h(!1),K.success(f("setting.aigne.disconnectSuccess")),setTimeout(()=>{W(!1)},300)}catch(A){console.error("disconnect error:",A),K.error(xe(A)||f("setting.aigne.disconnectFailed"))}finally{v(!1)}},_e=()=>{k.open({title:f("setting.aigne.disconnect"),content:f("setting.aigne.disconnectConfirm"),confirmButtonText:f("setting.aigne.disconnect"),cancelButtonText:f("common.cancel"),onConfirm(A){A(),Z()}})},de=async()=>{if(!he())return;G();const A={...B,model:"auto",key:Pn(B.key,w)};Ht(A.provider)?(A.key="",B.accessKeyId&&(A.accessKeyId=Pn(B.accessKeyId,w)),B.secretAccessKey&&(A.secretAccessKey=Pn(B.secretAccessKey,w))):(A.accessKeyId="",A.secretAccessKey="");const Q=await _.updateBlockletSettings({input:{did:w,aigne:A}});return u.refreshBlocklet(),Q},Ve=async()=>{try{if(!s&&!i)return;m(!0);const A=await de();return A?(h(!1),K.success(f("oauth.saveSuccess")),A):void 0}catch(A){throw console.error("error",A),K.error(xe(A)||f("setting.aigne.failed")),A}finally{m(!1)}},Ye=async(A=!1)=>{b.testConnection="";try{if(T.loading=!0,!A&&(await de())?.code!=="ok")return;await _.verifyAigneConnection({input:{did:w}}),K.success(f("setting.aigne.testSuccess",{provider:E})),T.success=!0}catch(Q){throw console.error("error",Q),b.testConnection=Q.message,K.error(f("setting.aigne.testFailed")),Q}finally{T.loading=!1,u.refreshBlocklet()}},at=async()=>{try{await ml(_,{did:w,refresh:u.refreshBlocklet,t:f,providerName:E,timerKey:z,values:{...V}}).catch(A=>{throw console.error("waitGetConnectedAigne error",A),K.error(xe(A)),A}).then(()=>Ye(!0).catch(A=>{throw console.error("onVerifyConnection error",A),A})),W(!0)}catch(A){console.error("error",A)}finally{h(!1)}},Ze=()=>{he(["key"])&&(G(),D(async(A,Q)=>{try{d(!0);const ee=await _.connectToAigne({input:{did:w,baseUrl:dr.getOriginUrl(B.url||new URL(window.location.origin).origin),provider:B.provider,model:"auto"}});if(!ee?.url){K.error("failed to connect to endpoint"),d(!1),m(!1);return}Q(ee.url),await at(),d(!1)}catch(ee){const ge=xe(ee);K.error(ge),d(!1)}}))};R.useImperativeHandle(a,()=>({onSubmit:Ve,loading:o||c||l})),q(ne);const Qe=ne==="aigneHub",on=()=>{C(!p)},Se=A=>{A.preventDefault()},yt=R.useMemo(()=>b.url==="required"?f("common.requiredErrorText",{name:f("setting.aigne.baseUrl",{provider:E})}):b.url?b.url:b.key==="required"?f("setting.aigne.apiKeyNotAuthorized",{provider:E}):"",[b.url,b.key,f,E]);return t.jsxs(fd,{source:r,children:[t.jsx(O,{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:E})}),N&&B.validationResult?t.jsx(ns,{url:B.url,providerName:E,disconnect:_e,validationResult:B.validationResult,disabled:I,loading:l}):t.jsx(nn,{height:"none",minHeight:"none",children:t.jsxs(O,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:2},children:[t.jsx(dt,{orientation:e,title:f("setting.aigne.baseUrl",{provider:E}),required:pt(B.provider),desc:t.jsx(rt,{desc:f("setting.aigne.desc.baseUrl",{example:"https://hub.aigne.io"})}),children:t.jsx(Tt,{disabled:I,initialValue:B.url||"",directEditing:!0,onSubmit:A=>{J("url",A)},autoFocus:!1,errorTips:yt,InputProps:N?{endAdornment:t.jsx(ur,{position:"end",children:T.loading||c?t.jsx(be,{size:16}):t.jsxs(t.Fragment,{children:[B.validationResult==="success"?t.jsx(je,{title:f("setting.aigne.testSuccess",{provider:E}),children:t.jsx(Do,{sx:{fontSize:16,color:"success.main",cursor:"pointer"}})}):null,B.validationResult&&B.validationResult!=="success"?t.jsx(je,{title:B.validationResult,children:t.jsx(To,{sx:{fontSize:16,color:"error.main",cursor:"pointer"}})}):null,B.validationResult?null:t.jsx(me,{"aria-label":"test connection",onClick:Ye,edge:"end",children:T.loading?t.jsx(be,{size:16}):t.jsx(je,{title:f("setting.aigne.testConnection",{provider:E}),children:t.jsx(fe,{style:{fontSize:16},icon:"tabler:location-check"})})})]})})}:{}})}),t.jsx(Zt,{variant:"contained",onClick:Ze,startIcon:c?t.jsx(be,{size:16,sx:{mr:1}}):t.jsx(Xt,{}),disabled:I||!B.url,sx:{flexShrink:0},children:f("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:f("setting.aigne.modelAdapter"),required:!0,desc:t.jsx(rt,{desc:f("setting.aigne.desc.modelAdapter")}),children:t.jsx(Vo,{disabled:I,options:P,config:{multiple:!1,labelField:"name",valueField:"provider"},initialValue:B.provider,directEditing:!0,searchable:!1,helperText:b.provider==="required"?f("common.requiredErrorText",{name:f("setting.aigne.modelAdapter")}):b.provider,onChange:A=>J("provider",A)})})}),null,Qe?null:t.jsx(t.Fragment,{children:Ht(B.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:j,provider:E}),children:t.jsx(Tt,{disabled:I,initialValue:B.accessKeyId||"",type:p?"text":"password",onChange:A=>J("accessKeyId",A),directEditing:!0,autoFocus:!1})}),!n&&t.jsx(O,{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:j,provider:E}),children:t.jsx(Tt,{disabled:I,initialValue:B.secretAccessKey||"",type:p?"text":"password",onChange:A=>J("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:E}),docLink:j,provider:E}),children:t.jsx(Tt,{disabled:I,initialValue:B.key||"",type:p?"text":"password",onChange:A=>J("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:Se,edge:"end",children:p?t.jsx(Oa,{}):t.jsx(Ua,{})})})}})})})]}),N&&B.validationResult==="success"?t.jsx(ts,{switchUser:Ze,url:B.url||"",apiKey:B.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:X.getDisplayName(S,!0)})]}),M]})}rs.propTypes={orientation:g.oneOf(["vertical","horizontal"]),hideDivider:g.bool,source:g.oneOf(["dashboard","setup"]),forceValidate:g.bool};const fd=oe.div`
|
|
348
348
|
max-width: 920px;
|
|
349
349
|
display: flex;
|
|
350
350
|
flex-direction: column;
|
|
@@ -362,7 +362,7 @@ import{aF as qe,j as t,ds as ws,gC as _s,ix as Ss,n as ce,bn as ye,M as O,ay as
|
|
|
362
362
|
margin-bottom: 0 !important;
|
|
363
363
|
margin-top: 0 !important;
|
|
364
364
|
}
|
|
365
|
-
`,md=R.forwardRef(ns),hd=(e,n)=>(e?.children||[]).find(r=>r.mountPoint===n)?.meta,gd=e=>e.inStore&&X.isFreeBlocklet(e)===!1,xd=e=>[Ce.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,Ce.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes(e?.capabilities?.didSpace),Dn=e=>e?.configs?.find(n=>n.key===Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)?.value||null,yd=e=>(e.environments||[]).some(n=>n.required),ro=(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")},oo=({componentDid:e,timeout:n=1e3,manual:r=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:r},"*")},n)};function rs({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:x,locale:_}=ce(),[w,S]=R.useState(!1),[u,s]=R.useState(null),[h,b]=R.useState(""),[T,k]=R.useState(""),{api:M,ws:{useSubscription:z},inService:P,info:D}=ye(),{blocklet:I,actions:{refreshBlocklet:L}}=De(),[q,$]=R.useState(null),[G,V]=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:""},[B,te]=R.useState(se),[N,E]=R.useState(0),y=R.useRef({}),j=R.useRef({}),U=R.useRef({}),W=ho(F=>F.breakpoints.down("md")),re=di(),[J,ne]=R.useState(!0),{meta:ie}=y.current,he=ca(ie),Z=R.useRef(!1),_e=R.useRef(null),de=F=>te(Y=>({...Y,...F}));R.useEffect(()=>{if(B.pathPrefix){const{errMsg:F}=Q({...B,pathPrefix:B.pathPrefix,locale:_});b(F)}},[B.pathPrefix]),R.useEffect(()=>{N===0&&te(se)},[N]);const Ve=()=>{const F=Dn(I)??"";de({didSpaceEndpoint:F})},Ye=()=>y?.current?.meta?X.getDisplayName(y.current):"",at=()=>{S(!1),te({}),Z.current=!1,y.current={},e()},Ze=F=>{const Y=ae=>{de({installResultProps:{variant:"error",title:Ye(),subTitle:F,footer:t.jsx(Be,{className:"bottom-button",disabled:ae,"data-cy":"retry-install-component",onClick:async()=>{Y(!0),await A(y.current.installInput)},children:t.jsxs(O,{sx:{display:"flex",alignItems:"center"},children:[ae&&t.jsx(be,{size:16,style:{marginRight:8}}),x("common.retry")]})})}})};Y()},Qe=F=>Y=>{(Y?.meta?.did||Y?.meta)===I?.meta?.did&&F(Y)},on=()=>{oo({timeout:0,componentDid:re.componentDid,manual:!0}),at(),setTimeout(()=>{const F=document.getElementsByClassName("dashboard-main")[0];F&&(F.scrollTop=F.scrollHeight)},200)};z(Ce.BlockletEvents.componentInstalled,Qe(()=>{de({installResultProps:{variant:"success",title:Ye(),subTitle:x("blocklet.component.installSuccessTip")}}),oo({componentDid:re.componentDid})}),[I?.meta?.did]),z(Ce.BlockletEvents.statusChange,Qe(()=>{const F=Dn(I);de(Y=>({...Y,didSpaceEndpoint:F}))}),[I?.meta?.did]),z(Ce.BlockletEvents.downloadFailed,Qe(()=>{Z.current=!1,Ze(x("blocklet.component.installComponentError"))}),[I?.meta?.did]),z(Ce.BlockletEvents.installFailed,Qe(()=>{Z.current=!1,Ze(x("blocklet.component.installComponentError"))}),[I?.meta?.did]);const Se=[],yt=F=>(I?.children||[]).find(Y=>Y.meta.did===F),A=async F=>{Z.current=!0;const{pathPrefix:Y,bundleDid:ae,title:ue,componentName:Pe="",componentDid:Fe=""}=B,Ge=y.current?.meta||{},{configs:Xe=[],registryUrl:Ue,inStore:Je,inputUrl:lt,dist:an}=Ge,Ct=y.current?.downloadTokenList,bt=lt||(Je?ur(Ue,ae,an):"");S(!0);const Re={rootDid:I.meta.did,url:bt,mountPoint:Y?Le(Y):`/${Le(Ge.title||Ge.name)}`,title:ue,name:Pe,did:B.isUpload&&B.upgradeDid?B.upgradeDid:Fe,dist:{tarball:"",integrity:""},onlyRequired:!J,...B.hasEnvironmentsStep&&Xe.length>0?{configs:Xe.map(Ae=>({...Ae,value:B.configsValue[Ae.key]||""}))}:{},...Ct?{downloadTokenList:Ct}:{},...F};try{if(await M.installComponent({input:Re}),Ue){const{teamDid:Ae,storeList:$e}=lo({fromBlocklet:P,nodeInfo:D,blocklet:I}),{isNew:ct,decoded:jt}=fi(Ue,$e);ct&&await M.addBlockletStore({input:{teamDid:Ae,url:jt}})}de({installResultProps:{}}),L({showError:!1,attachRuntimeInfo:!1})}catch(Ae){const $e=xe(Ae);K.error($e),console.error("installComponent error: ",Ae),Ze($e)}finally{S(!1),y.current.installInput=Re}},Q=F=>{const Y=Eo({params:{...F,did:F.bundleDid},blocklets:[I],blocklet:I,locale:_,isUpload:B.isUpload});let ae=Y;const ue=hd(I,B.pathPrefix);if(Y==="overwrite"&&ue&&ue.did!==F.bundleDid?(de({upgradeDid:ue.did}),ae=""):(de({upgradeDid:""}),ae=Y),ae){const Pe=yt(F.bundleDid),Fe=va({params:{...F,did:F.bundleDid},blocklet:I});if(Pe&&Pe.mountPoint===Fe)return{errMsg:""}}return{errMsg:ae}},ee=async F=>{const{errMsg:Y}=Q({...B,locale:_});b(Y),N===Se.length-2&&!Z.current&&await A(F),j.current?.setActiveStepByIndex?.(ae=>ae+1)},ge=()=>{j.current?.setActiveStepByIndex?.(F=>F-1)},vt=()=>{const{pathPrefix:F,bundleDid:Y,title:ae,componentName:ue="",componentDid:Pe=""}=B,{meta:Fe={}}=y.current||{},{registryUrl:Ge,inStore:Xe,inputUrl:Ue,dist:Je}=Fe,lt=Xe?ur(Ge,Y,Je):Ue;$({meta:Fe,installOpts:{type:"component",rootDid:I.meta.did,mountPoint:F,url:lt,title:ae,name:ue,did:Pe}})},rr=F=>{V(!1),de({purchaseResultProps:{variant:"error",title:Ye(),subTitle:F,style:{paddingTop:120},footer:t.jsx(Be,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{de({purchaseResultProps:{}})},children:x("common.retry")})}})},xs=({downloadTokenList:F})=>{y.current.downloadTokenList=F,V(!1),ee()},sn=({chooseParams:F=y.current,componentDid:Y,isInit:ae=!1,isUpload:ue=!1})=>{const{meta:Pe,registryUrl:Fe,inStore:Ge,inputUrl:Xe}=F,{did:Ue,title:Je,name:lt}=Pe,an=(I.settings?.children||[]).filter(Ie=>Ie.status==="deleted"&&Ie.meta.bundleDid===Ue),Ct=Y||"",bt=Pe.environments?.map(Ie=>{const{name:ln,validation:wt,..._t}=Ie,cn={validation:$n(wt)?"":wt};return{..._t,key:ln,...cn}});y.current={...F,meta:{...Pe,configs:bt,registryUrl:Fe,inStore:Ge,inputUrl:Xe}};let Re={};if(ae){const Ie=[I],ln=bt||[],wt=[],_t=co(pi([...ln,...wt]),"key").filter(et=>!!et.key).sort((et,St)=>et.required&&!St.required?-1:St.required&&!et.required?1:0),cn=X.getSharedConfigObj(Ie[0],{configs:_t}),dn={},or=_t.map(et=>{const{default:St,key:Et,...js}=et;return dn[Et]=cn[Et]||St,{...js,key:Et,hidden:!!Ce.BLOCKLET_CONFIGURABLE_KEY[Et]}});Re={...Re,configsList:or,configsValue:dn,hasMissRequiredConfigs:ro(or,dn)}}const Ae=I.children.some(Ie=>Ie.mountPoint==="/"),$e=an.find(Ie=>Ie.meta.bundleDid===Ue),ct=I.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(Je)||Le(lt)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:y.current.meta?.environments?.length>0};const jt=gd(y.current.meta),Cs=xd(y.current.meta),bs=Dn(I);de({bundleDid:Ue,componentDid:Ct,...Re,hasRequiredEnvironments:yd(y.current.meta),requirePurchase:jt,didSpaceIsRequiredSetup:Cs,didSpaceEndpoint:bs,isUpload:ue}),ae&&jt&&vt()},ys=async()=>{if(!_e.current.loading)try{S(!0),await _e.current.onSubmit()&&ee()}catch(F){console.error("error",F)}finally{S(!1)}};R.useEffect(()=>{if(!c&&!f?.meta||N!==0||!I)return;const{meta:F,inputUrl:Y="",inStore:ae=!0,registryUrl:ue="",isUpload:Pe=!1}=f||{};sn({chooseParams:{blocklets:[c||F],meta:c||F,registryUrl:ue||d||c.homepage,inStore:ae,inputUrl:Y},isInit:!0,isUpload:Pe}),de({showFromUrlDialog:!1}),ee()},[c,N,I,f]),Se.push({key:"selectComponent",name:x("blocklet.component.selectComponent"),body:t.jsxs(We,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[v&&B.showFromUrlDialog&&t.jsx(So,{mode:"component",onCancel:()=>{de({showFromUrlDialog:!1})},onSuccess:({meta:F,inputUrl:Y,inStore:ae,registryUrl:ue})=>{sn({chooseParams:{meta:F,inputUrl:Y,inStore:ae,registryUrl:ue},isInit:!0}),de({showFromUrlDialog:!1}),ee()},handleText:{title:x("blocklet.component.addComponentTip.fromUrl"),confirm:x("blocklet.component.choose")}}),t.jsx($o,{stores:r,extra:bo.isInServerlessMode(D)?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}}),x("blocklet.component.addComponentTip.fromUrl")]}):null,loading:w,onChange:()=>{te({}),y.current={}},storageKey:o,children:({currentRegistry:F})=>t.jsx(Ho,{showResourcesSwitch:l,showCategory:C,serverVersion:D?.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:F.url,resourceType:i,resourceDid:a,handleButtonClick:Y=>{sn({chooseParams:{...Y,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:Y,defaultRender:ae})=>{const ue=B?.bundleDid&&B?.bundleDid===Y?.did;return t.jsxs(bd,{children:[t.jsx(O,{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(O,{className:"check-container",children:t.jsx(ui,{className:"check-icon"})})]})}})})]}),cancel:n==="embed"?void 0:x("common.cancel"),confirm:vd({params:B,blocklet:I,t:x}),onCancel:at,onConfirm:()=>{ee()}}),Se.push({key:"agreement",name:x("launchBlocklet.introduction"),body:t.jsxs(We,{component:"div",className:"agreement-wrapper",children:[t.jsx(Nn,{title:x("launchBlocklet.introduction"),subTitle:x("blocklet.component.addComponentTip.introduction")}),ie?t.jsx(da,{meta:ie,onClickNext:ee,installRelated:J,onChangeInstallRelated:ne,handleDescEle:t.jsx("p",{children:x("blocklet.component.addComponentTip.belowInformation")})}):null]}),cancel:c?void 0:x("common.pre"),disabled:!he,confirm:x(he?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:c?at:ge,onConfirm:()=>{V(!1),ee()}}),ie&&B.requirePurchase&&Se.push({key:"purchase",name:t.jsxs(t.Fragment,{children:[x("common.verifyNFT"),t.jsx(ot,{})]}),body:t.jsxs(We,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(U.current?.getCurrentStep?.()===2||G)&&t.jsx(Pt,{title:x("common.verifyNFT"),subTitle:x("blocklet.component.addComponentTip.verifyNFT")}),Rt(B.purchaseResultProps)?q&&t.jsx(zo,{ref:U,meta:q.meta,mode:B.componentDid?"verify":"both",onCancel:rr,installOpts:q.installOpts,handlePaySuccess:xs}):t.jsx("div",{className:"flex-align-center flex-justify-center",children:t.jsx(xr,{...B.purchaseResultProps})})]}),disabled:U.current?.getCurrentStep?.()===2||G,cancel:x("common.pre"),confirm:x("common.next"),onConfirm:()=>{typeof U.current.onNext=="function"&&(U.current.onNext(),V(!0))},onCancel:()=>{ge()}}),X.hasStartEngine(ie)&&wo.hasMountPoint(ie)?Se.push({key:"config",name:x("common.config"),error:h,body:t.jsxs(We,{component:"div",children:[t.jsx(Pt,{title:x("common.config"),subTitle:x("blocklet.component.addComponentTip.config")}),t.jsx(ve,{label:x("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",fullWidth:!0,helperText:T||x("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:B.pathPrefix,onChange:F=>{const Y=F.target.value;de({pathPrefix:Y}),k(x("common.slugifyHint",{value:Wn(Y)}))},slotProps:{htmlInput:{"data-cy":"mount-point-input"}}}),!!h&&t.jsx(Bn,{severity:"error",style:{width:"100%",marginTop:8},children:h})]}),cancel:x("common.pre"),confirm:x("common.next"),onCancel:ge,onConfirm:()=>{ee()}}):ie&&(B.pathPrefix=ie.interfaces?.[0]?.path||`/${ie.did}`),ie&&ie?.requirements?.aigne&&Se.push({key:"aigne",name:t.jsxs(le,{component:"div",title:x("setting.aigne.config"),sx:{whiteSpace:"break-spaces"},children:[x("setting.aigne.config")," ",t.jsx(ot,{})]}),body:()=>t.jsxs(We,{component:"div",className:"aigne-config-wrapper",children:[t.jsx(Nn,{title:x("setting.aigne.config")}),t.jsx(O,{className:"form-container",sx:{"> div":{maxWidth:"unset",width:"100%"}},children:t.jsx(md,{orientation:"vertical",hideSubmitButton:!0,hideDivider:!0,source:"setup",forceValidate:!0,ref:_e})})]}),cancel:x("common.pre"),confirm:x("common.next"),onCancel:()=>{_e.current.loading||ge()},onConfirm:ys,loading:w||_e.current?.loading,disabled:w||_e.current?.loading}),ie&&B?.hasEnvironmentsStep&&Se.push({key:"environment",name:t.jsxs(t.Fragment,{children:[x("common.environment")," ",B.hasRequiredEnvironments&&t.jsx(ot,{})]}),disabled:!!u||B?.hasMissRequiredConfigs,body:()=>t.jsxs(We,{component:"div",style:{overflowY:"auto"},children:[t.jsx(Pt,{title:x("common.environment"),subTitle:x("blocklet.component.addComponentTip.environment")}),t.jsx(Ao,{style:{marginTop:-12,width:"100%"},schema:B.configsList,defaultValue:B.configsValue,onChange:(F,{action:Y,currentItem:ae,allValues:ue})=>{Y==="confirm"&&de({hasMissRequiredConfigs:ro(B.configsList,ue),configsValue:ue}),Y==="edit"?s(ae):["cancel","confirm"].includes(Y)&&s(null)}})]}),cancel:x("common.pre"),confirm:x("common.next"),onCancel:ge,onConfirm:ee}),ie&&B?.didSpaceIsRequiredSetup&&Se.push({key:"didSpace",name:t.jsxs(t.Fragment,{children:[x("blocklet.component.didSpaceConfig")," ",B.didSpaceIsRequiredSetup==="required"&&t.jsx(ot,{})]}),disabled:B?.didSpaceIsRequiredSetup&&!B.didSpaceEndpoint,body:()=>t.jsx(aa,{children:t.jsxs(We,{component:"div",children:[t.jsx(Pt,{title:x("blocklet.component.didSpaceConfig"),subTitle:x("blocklet.component.didSpaceConfigTip")}),t.jsx(O,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:t.jsx(Fo,{blockletMeta:y.current.meta,onNext:()=>{ee()},onEndpointUpdate:Ve})})]})}),cancel:x("common.pre"),confirm:x("common.next"),onCancel:ge,onConfirm:ee}),Se.push({key:"install",name:yt(ie?.did)?x("common.upgrade"):x("common.install"),disabled:p?!1:Rt(B.installResultProps),loading:p?!1:Rt(B.installResultProps),body:t.jsx(We,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:Rt(B.installResultProps)?t.jsx(ta,{message:t.jsx(jd,{children:x(p?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):t.jsx("div",{style:{marginTop:120},children:t.jsx(xr,{...B.installResultProps})})}),confirm:x("common.complete"),onConfirm:on});const Te=Se[N]||{},vs=()=>w||Te.error||!B.bundleDid?!0:N>1?!B.pathPrefix:!1;return I?t.jsxs(Cd,{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:Se,mode:"memory",children:t.jsx(Go,{ref:j,meta:ie,isMobile:W,onStepChange:F=>{E(F)}})}),t.jsxs(O,{className:"action-bar",children:[Te.cancel&&t.jsx(Be,{onClick:F=>{F.stopPropagation(),Te.onCancel()},disabled:N===Se.length-2&&w,color:"inherit",children:Te.cancel||x("common.cancel")}),Te.confirm&&t.jsx(Be,{onClick:F=>{F.stopPropagation(),Te.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:w||(typeof Te.disabled=="boolean"?Te.disabled:vs()),variant:"contained",autoFocus:!0,title:Te.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:t.jsxs(O,{sx:{display:"flex",alignItems:"center",overflow:"hidden"},children:[(typeof Te.loading=="boolean"?Te.loading:w)&&t.jsx(be,{style:{marginRight:8},size:16}),t.jsx(O,{component:"span",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Te.confirm})]})})]})]}):null}rs.propTypes={onClose:g.func,mode:g.oneOf(["normal","embed"]),inDialog:g.bool,stores:g.arrayOf(g.string),storeUrl:g.string,resourceType:g.string,resourceDid:g.string,storageKey:g.string,selectedMeta:g.object,showResourcesSwitch:g.bool,showFromUrl:g.bool,enableRunBackground:g.bool,showCategory:g.bool,installFromUrlParams:g.object};const Cd=oe(O)`
|
|
365
|
+
`,md=R.forwardRef(rs),hd=(e,n)=>(e?.children||[]).find(r=>r.mountPoint===n)?.meta,gd=e=>e.inStore&&X.isFreeBlocklet(e)===!1,xd=e=>[Ce.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,Ce.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes(e?.capabilities?.didSpace),Bn=e=>e?.configs?.find(n=>n.key===Ce.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:m=!0,selectedMeta:c=null,storeUrl:d="",showResourcesSwitch:l=!0,showFromUrl:v=!0,enableRunBackground:p=!0,showCategory:C=!0,installFromUrlParams:f=null}){const{t:x,locale:_}=ce(),[w,S]=R.useState(!1),[u,s]=R.useState(null),[h,b]=R.useState(""),[T,k]=R.useState(""),{api:M,ws:{useSubscription:z},inService:P,info:D}=ye(),{blocklet:I,actions:{refreshBlocklet:L}}=De(),[q,$]=R.useState(null),[G,V]=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:""},[B,te]=R.useState(se),[N,E]=R.useState(0),y=R.useRef({}),j=R.useRef({}),U=R.useRef({}),W=go(F=>F.breakpoints.down("md")),re=di(),[J,ne]=R.useState(!0),{meta:ie}=y.current,he=ca(ie),Z=R.useRef(!1),_e=R.useRef(null),de=F=>te(Y=>({...Y,...F}));R.useEffect(()=>{if(B.pathPrefix){const{errMsg:F}=Q({...B,pathPrefix:B.pathPrefix,locale:_});b(F)}},[B.pathPrefix]),R.useEffect(()=>{N===0&&te(se)},[N]);const Ve=()=>{const F=Bn(I)??"";de({didSpaceEndpoint:F})},Ye=()=>y?.current?.meta?X.getDisplayName(y.current):"",at=()=>{S(!1),te({}),Z.current=!1,y.current={},e()},Ze=F=>{const Y=ae=>{de({installResultProps:{variant:"error",title:Ye(),subTitle:F,footer:t.jsx(Be,{className:"bottom-button",disabled:ae,"data-cy":"retry-install-component",onClick:async()=>{Y(!0),await A(y.current.installInput)},children:t.jsxs(O,{sx:{display:"flex",alignItems:"center"},children:[ae&&t.jsx(be,{size:16,style:{marginRight:8}}),x("common.retry")]})})}})};Y()},Qe=F=>Y=>{(Y?.meta?.did||Y?.meta)===I?.meta?.did&&F(Y)},on=()=>{so({timeout:0,componentDid:re.componentDid,manual:!0}),at(),setTimeout(()=>{const F=document.getElementsByClassName("dashboard-main")[0];F&&(F.scrollTop=F.scrollHeight)},200)};z(Ce.BlockletEvents.componentInstalled,Qe(()=>{de({installResultProps:{variant:"success",title:Ye(),subTitle:x("blocklet.component.installSuccessTip")}}),so({componentDid:re.componentDid})}),[I?.meta?.did]),z(Ce.BlockletEvents.statusChange,Qe(()=>{const F=Bn(I);de(Y=>({...Y,didSpaceEndpoint:F}))}),[I?.meta?.did]),z(Ce.BlockletEvents.downloadFailed,Qe(()=>{Z.current=!1,Ze(x("blocklet.component.installComponentError"))}),[I?.meta?.did]),z(Ce.BlockletEvents.installFailed,Qe(()=>{Z.current=!1,Ze(x("blocklet.component.installComponentError"))}),[I?.meta?.did]);const Se=[],yt=F=>(I?.children||[]).find(Y=>Y.meta.did===F),A=async F=>{Z.current=!0;const{pathPrefix:Y,bundleDid:ae,title:ue,componentName:Pe="",componentDid:Fe=""}=B,Ge=y.current?.meta||{},{configs:Xe=[],registryUrl:Ue,inStore:Je,inputUrl:lt,dist:an}=Ge,Ct=y.current?.downloadTokenList,bt=lt||(Je?pr(Ue,ae,an):"");S(!0);const Re={rootDid:I.meta.did,url:bt,mountPoint:Y?Le(Y):`/${Le(Ge.title||Ge.name)}`,title:ue,name:Pe,did:B.isUpload&&B.upgradeDid?B.upgradeDid:Fe,dist:{tarball:"",integrity:""},onlyRequired:!J,...B.hasEnvironmentsStep&&Xe.length>0?{configs:Xe.map(Ae=>({...Ae,value:B.configsValue[Ae.key]||""}))}:{},...Ct?{downloadTokenList:Ct}:{},...F};try{if(await M.installComponent({input:Re}),Ue){const{teamDid:Ae,storeList:$e}=co({fromBlocklet:P,nodeInfo:D,blocklet:I}),{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=xe(Ae);K.error($e),console.error("installComponent error: ",Ae),Ze($e)}finally{S(!1),y.current.installInput=Re}},Q=F=>{const Y=ko({params:{...F,did:F.bundleDid},blocklets:[I],blocklet:I,locale:_,isUpload:B.isUpload});let ae=Y;const ue=hd(I,B.pathPrefix);if(Y==="overwrite"&&ue&&ue.did!==F.bundleDid?(de({upgradeDid:ue.did}),ae=""):(de({upgradeDid:""}),ae=Y),ae){const Pe=yt(F.bundleDid),Fe=va({params:{...F,did:F.bundleDid},blocklet:I});if(Pe&&Pe.mountPoint===Fe)return{errMsg:""}}return{errMsg:ae}},ee=async F=>{const{errMsg:Y}=Q({...B,locale:_});b(Y),N===Se.length-2&&!Z.current&&await A(F),j.current?.setActiveStepByIndex?.(ae=>ae+1)},ge=()=>{j.current?.setActiveStepByIndex?.(F=>F-1)},vt=()=>{const{pathPrefix:F,bundleDid:Y,title:ae,componentName:ue="",componentDid:Pe=""}=B,{meta:Fe={}}=y.current||{},{registryUrl:Ge,inStore:Xe,inputUrl:Ue,dist:Je}=Fe,lt=Xe?pr(Ge,Y,Je):Ue;$({meta:Fe,installOpts:{type:"component",rootDid:I.meta.did,mountPoint:F,url:lt,title:ae,name:ue,did:Pe}})},or=F=>{V(!1),de({purchaseResultProps:{variant:"error",title:Ye(),subTitle:F,style:{paddingTop:120},footer:t.jsx(Be,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{de({purchaseResultProps:{}})},children:x("common.retry")})}})},ys=({downloadTokenList:F})=>{y.current.downloadTokenList=F,V(!1),ee()},sn=({chooseParams:F=y.current,componentDid:Y,isInit:ae=!1,isUpload:ue=!1})=>{const{meta:Pe,registryUrl:Fe,inStore:Ge,inputUrl:Xe}=F,{did:Ue,title:Je,name:lt}=Pe,an=(I.settings?.children||[]).filter(Ie=>Ie.status==="deleted"&&Ie.meta.bundleDid===Ue),Ct=Y||"",bt=Pe.environments?.map(Ie=>{const{name:cn,validation:wt,..._t}=Ie,dn={validation:Wn(wt)?"":wt};return{..._t,key:cn,...dn}});y.current={...F,meta:{...Pe,configs:bt,registryUrl:Fe,inStore:Ge,inputUrl:Xe}};let Re={};if(ae){const Ie=[I],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=X.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:!!Ce.BLOCKLET_CONFIGURABLE_KEY[Et]}});Re={...Re,configsList:sr,configsValue:un,hasMissRequiredConfigs:oo(sr,un)}}const Ae=I.children.some(Ie=>Ie.mountPoint==="/"),$e=an.find(Ie=>Ie.meta.bundleDid===Ue),ct=I.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(Je)||Le(lt)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:y.current.meta?.environments?.length>0};const jt=gd(y.current.meta),ln=xd(y.current.meta),bs=Bn(I);de({bundleDid:Ue,componentDid:Ct,...Re,hasRequiredEnvironments:yd(y.current.meta),requirePurchase:jt,didSpaceIsRequiredSetup:ln,didSpaceEndpoint:bs,isUpload:ue}),ae&&jt&&vt()},vs=async()=>{if(!_e.current.loading)try{S(!0),await _e.current.onSubmit()&&ee()}catch(F){console.error("error",F)}finally{S(!1)}};R.useEffect(()=>{if(!c&&!f?.meta||N!==0||!I)return;const{meta:F,inputUrl:Y="",inStore:ae=!0,registryUrl:ue="",isUpload:Pe=!1}=f||{};sn({chooseParams:{blocklets:[c||F],meta:c||F,registryUrl:ue||d||c.homepage,inStore:ae,inputUrl:Y},isInit:!0,isUpload:Pe}),de({showFromUrlDialog:!1}),ee()},[c,N,I,f]),Se.push({key:"selectComponent",name:x("blocklet.component.selectComponent"),body:t.jsxs(We,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[v&&B.showFromUrlDialog&&t.jsx(Eo,{mode:"component",onCancel:()=>{de({showFromUrlDialog:!1})},onSuccess:({meta:F,inputUrl:Y,inStore:ae,registryUrl:ue})=>{sn({chooseParams:{meta:F,inputUrl:Y,inStore:ae,registryUrl:ue},isInit:!0}),de({showFromUrlDialog:!1}),ee()},handleText:{title:x("blocklet.component.addComponentTip.fromUrl"),confirm:x("blocklet.component.choose")}}),t.jsx(Wo,{stores:r,extra:jo.isInServerlessMode(D)?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}}),x("blocklet.component.addComponentTip.fromUrl")]}):null,loading:w,onChange:()=>{te({}),y.current={}},storageKey:o,children:({currentRegistry:F})=>t.jsx(Go,{showResourcesSwitch:l,showCategory:C,serverVersion:D?.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:F.url,resourceType:i,resourceDid:a,handleButtonClick:Y=>{sn({chooseParams:{...Y,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:Y,defaultRender:ae})=>{const ue=B?.bundleDid&&B?.bundleDid===Y?.did;return t.jsxs(bd,{children:[t.jsx(O,{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(O,{className:"check-container",children:t.jsx(ui,{className:"check-icon"})})]})}})})]}),cancel:n==="embed"?void 0:x("common.cancel"),confirm:vd({params:B,blocklet:I,t:x}),onCancel:at,onConfirm:()=>{ee()}}),Se.push({key:"agreement",name:x("launchBlocklet.introduction"),body:t.jsxs(We,{component:"div",className:"agreement-wrapper",children:[t.jsx(Ln,{title:x("launchBlocklet.introduction"),subTitle:x("blocklet.component.addComponentTip.introduction")}),ie?t.jsx(da,{meta:ie,onClickNext:ee,installRelated:J,onChangeInstallRelated:ne,handleDescEle:t.jsx("p",{children:x("blocklet.component.addComponentTip.belowInformation")})}):null]}),cancel:c?void 0:x("common.pre"),disabled:!he,confirm:x(he?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:c?at:ge,onConfirm:()=>{V(!1),ee()}}),ie&&B.requirePurchase&&Se.push({key:"purchase",name:t.jsxs(t.Fragment,{children:[x("common.verifyNFT"),t.jsx(ot,{})]}),body:t.jsxs(We,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(U.current?.getCurrentStep?.()===2||G)&&t.jsx(Pt,{title:x("common.verifyNFT"),subTitle:x("blocklet.component.addComponentTip.verifyNFT")}),Rt(B.purchaseResultProps)?q&&t.jsx(qo,{ref:U,meta:q.meta,mode:B.componentDid?"verify":"both",onCancel:or,installOpts:q.installOpts,handlePaySuccess:ys}):t.jsx("div",{className:"flex-align-center flex-justify-center",children:t.jsx(yr,{...B.purchaseResultProps})})]}),disabled:U.current?.getCurrentStep?.()===2||G,cancel:x("common.pre"),confirm:x("common.next"),onConfirm:()=>{typeof U.current.onNext=="function"&&(U.current.onNext(),V(!0))},onCancel:()=>{ge()}}),X.hasStartEngine(ie)&&_o.hasMountPoint(ie)?Se.push({key:"config",name:x("common.config"),error:h,body:t.jsxs(We,{component:"div",children:[t.jsx(Pt,{title:x("common.config"),subTitle:x("blocklet.component.addComponentTip.config")}),t.jsx(ve,{label:x("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",fullWidth:!0,helperText:T||x("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:B.pathPrefix,onChange:F=>{const Y=F.target.value;de({pathPrefix:Y}),k(x("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:x("common.pre"),confirm:x("common.next"),onCancel:ge,onConfirm:()=>{ee()}}):ie&&(B.pathPrefix=ie.interfaces?.[0]?.path||`/${ie.did}`),ie&&ie?.requirements?.aigne&&Se.push({key:"aigne",name:t.jsxs(le,{component:"div",title:x("setting.aigne.config"),sx:{whiteSpace:"break-spaces"},children:[x("setting.aigne.config")," ",t.jsx(ot,{})]}),body:()=>t.jsxs(We,{component:"div",className:"aigne-config-wrapper",children:[t.jsx(Ln,{title:x("setting.aigne.config")}),t.jsx(O,{className:"form-container",sx:{"> div":{maxWidth:"unset",width:"100%"}},children:t.jsx(md,{orientation:"vertical",hideSubmitButton:!0,hideDivider:!0,source:"setup",forceValidate:!0,ref:_e})})]}),cancel:x("common.pre"),confirm:x("common.next"),onCancel:()=>{_e.current.loading||ge()},onConfirm:vs,loading:w||_e.current?.loading,disabled:w||_e.current?.loading}),ie&&B?.hasEnvironmentsStep&&Se.push({key:"environment",name:t.jsxs(t.Fragment,{children:[x("common.environment")," ",B.hasRequiredEnvironments&&t.jsx(ot,{})]}),disabled:!!u||B?.hasMissRequiredConfigs,body:()=>t.jsxs(We,{component:"div",style:{overflowY:"auto"},children:[t.jsx(Pt,{title:x("common.environment"),subTitle:x("blocklet.component.addComponentTip.environment")}),t.jsx(Mo,{style:{marginTop:-12,width:"100%"},schema:B.configsList,defaultValue:B.configsValue,onChange:(F,{action:Y,currentItem:ae,allValues:ue})=>{Y==="confirm"&&de({hasMissRequiredConfigs:oo(B.configsList,ue),configsValue:ue}),Y==="edit"?s(ae):["cancel","confirm"].includes(Y)&&s(null)}})]}),cancel:x("common.pre"),confirm:x("common.next"),onCancel:ge,onConfirm:ee}),ie&&B?.didSpaceIsRequiredSetup&&Se.push({key:"didSpace",name:t.jsxs(t.Fragment,{children:[x("blocklet.component.didSpaceConfig")," ",B.didSpaceIsRequiredSetup==="required"&&t.jsx(ot,{})]}),disabled:B?.didSpaceIsRequiredSetup&&!B.didSpaceEndpoint,body:()=>t.jsx(aa,{children:t.jsxs(We,{component:"div",children:[t.jsx(Pt,{title:x("blocklet.component.didSpaceConfig"),subTitle:x("blocklet.component.didSpaceConfigTip")}),t.jsx(O,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:t.jsx($o,{blockletMeta:y.current.meta,onNext:()=>{ee()},onEndpointUpdate:Ve})})]})}),cancel:x("common.pre"),confirm:x("common.next"),onCancel:ge,onConfirm:ee}),Se.push({key:"install",name:yt(ie?.did)?x("common.upgrade"):x("common.install"),disabled:p?!1:Rt(B.installResultProps),loading:p?!1:Rt(B.installResultProps),body:t.jsx(We,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:Rt(B.installResultProps)?t.jsx(ta,{message:t.jsx(jd,{children:x(p?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):t.jsx("div",{style:{marginTop:120},children:t.jsx(yr,{...B.installResultProps})})}),confirm:x("common.complete"),onConfirm:on});const Te=Se[N]||{},Cs=()=>w||Te.error||!B.bundleDid?!0:N>1?!B.pathPrefix:!1;return I?t.jsxs(Cd,{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:Se,mode:"memory",children:t.jsx(Ko,{ref:j,meta:ie,isMobile:W,onStepChange:F=>{E(F)}})}),t.jsxs(O,{className:"action-bar",children:[Te.cancel&&t.jsx(Be,{onClick:F=>{F.stopPropagation(),Te.onCancel()},disabled:N===Se.length-2&&w,color:"inherit",children:Te.cancel||x("common.cancel")}),Te.confirm&&t.jsx(Be,{onClick:F=>{F.stopPropagation(),Te.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:w||(typeof Te.disabled=="boolean"?Te.disabled:Cs()),variant:"contained",autoFocus:!0,title:Te.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:t.jsxs(O,{sx:{display:"flex",alignItems:"center",overflow:"hidden"},children:[(typeof Te.loading=="boolean"?Te.loading:w)&&t.jsx(be,{style:{marginRight:8},size:16}),t.jsx(O,{component:"span",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Te.confirm})]})})]})]}):null}os.propTypes={onClose:g.func,mode:g.oneOf(["normal","embed"]),inDialog:g.bool,stores:g.arrayOf(g.string),storeUrl:g.string,resourceType:g.string,resourceDid:g.string,storageKey:g.string,selectedMeta:g.object,showResourcesSwitch:g.bool,showFromUrl:g.bool,enableRunBackground:g.bool,showCategory:g.bool,installFromUrlParams:g.object};const Cd=oe(O)`
|
|
366
366
|
.action-bar {
|
|
367
367
|
display: flex;
|
|
368
368
|
justify-content: flex-end;
|
|
@@ -378,7 +378,7 @@ import{aF as qe,j as t,ds as ws,gC as _s,ix as Ss,n as ce,bn as ye,M as O,ay as
|
|
|
378
378
|
`,We=oe(le)`
|
|
379
379
|
width: 100%;
|
|
380
380
|
height: 100%;
|
|
381
|
-
`,Pt=oe(
|
|
381
|
+
`,Pt=oe(Ln)`
|
|
382
382
|
margin-bottom: 24px;
|
|
383
383
|
`,bd=oe.div`
|
|
384
384
|
position: relative;
|
|
@@ -432,14 +432,14 @@ import{aF as qe,j as t,ds as ws,gC as _s,ix as Ss,n as ce,bn as ye,M as O,ay as
|
|
|
432
432
|
font-size: 14px;
|
|
433
433
|
margin-right: 6px;
|
|
434
434
|
}
|
|
435
|
-
`;function
|
|
435
|
+
`;function Xn({blocklet:e,showDialog:n,setShowDialog:r,selectedMeta:i=null,showFromUrl:a=!0,installFromUrlParams:o=null}){const{t:m}=ce(),c=go(v=>v.breakpoints.down("md")),{inService:d}=ye(),l=()=>{r(!1)};return n?t.jsx(wd,{title:m("blocklet.component.addWithName",{name:X.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:g.object,showDialog:g.bool.isRequired,setShowDialog:g.func.isRequired,blocklet:g.object.isRequired,showFromUrl:g.bool,installFromUrlParams:g.object};const wd=oe(Yt)`
|
|
436
436
|
.ux-dialog_header {
|
|
437
437
|
background-color: ${({theme:e})=>e.palette.background.paper};
|
|
438
438
|
}
|
|
439
439
|
.MuiDialogContent-root {
|
|
440
440
|
background-color: ${({theme:e})=>e.palette.background.paper};
|
|
441
441
|
}
|
|
442
|
-
`;function os({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}=ye(),C=h=>{h.stopPropagation(),o(!0)},f=R.useCallback(()=>{c(h=>({...h,show:!0}))},[]),x=R.useCallback((h=!1)=>{c(h?{params:null,show:!1}:b=>({...b,show:!1}))},[]),_=R.useCallback(()=>{l({params:null,show:!0})},[]),w=R.useCallback(h=>{l({params:{...h,inStore:!1,isUpload:!0},show:!1}),h.meta&&o(!0)},[]),S=R.useCallback((h=!1)=>{l(h?{params:null,show:!1}:b=>({...b,show:!1}))},[]),u=R.useCallback(h=>{o(h),h||(x(!0),S(!0))},[x,S]),s=R.useMemo(()=>[t.jsxs(pn.Item,{"data-cy":"add-component-from-url",onClick:f,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(pn.Item,{"data-cy":"add-component-from-upload",onClick:_,style:{fontSize:14,color:"primary.main"},children:[t.jsx(Ba,{style:{fontSize:16,marginRight:4}}),i("blocklet.component.addComponentTip.fromUpload")]},"add-component-from-upload")],[_,f,i]);return t.jsxs(t.Fragment,{children:[typeof n=="function"?n({open:C}):t.jsxs(pn,{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(Qn,{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(So,{mode:"component",onCancel:x,onSuccess:({meta:h,inputUrl:b,inStore:T,registryUrl:k})=>{c({show:!1,params:{meta:h,inputUrl:b,inStore:T,registryUrl:k}}),o(!0)},handleText:{title:i("blocklet.component.addComponentTip.fromUrl"),confirm:i("blocklet.component.choose")}}):null,t.jsx(Uo,{open:d.show,did:e.meta.did,prefix:p,headers:v,onUploaded:w,onClose:S})]})}os.propTypes={children:g.any,blocklet:g.object.isRequired,disabled:g.bool};const _d=e=>e.children.filter(n=>n.meta.interfaces.find(r=>r.type===Ce.BLOCKLET_INTERFACE_TYPE_WEB));function Xn({params:e={},setParams:n=()=>{},setError:r=()=>{},serviceTypes:i=[{name:"Redirect",value:H.ROUTING_RULE_TYPES.REDIRECT},{name:"Default - User will see the 404 page",value:H.ROUTING_RULE_TYPES.NONE},{name:"Rewrite - Route traffic without redirect",value:H.ROUTING_RULE_TYPES.GENERAL_REWRITE},{name:"Response - Response with provided content",value:H.ROUTING_RULE_TYPES.DIRECT_RESPONSE},{name:"Component - Pass traffic to blocklet component",value:H.ROUTING_RULE_TYPES.COMPONENT}]}){const{t:a}=ce(),{blocklet:o}=De(),m=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===H.ROUTING_RULE_TYPES.COMPONENT&&e.componentId){const p=c.find(x=>x.meta.did===e.componentId),C=X.findWebInterface(p.meta),f=(Array.isArray(C?.pageGroups)?C.pageGroups:[]).map(x=>({value:x,label:`${x} pages`}));f.length&&f.unshift({value:"",label:"All pages"}),l(f),e.pageGroup&&f.find(x=>x.value===e.pageGroup)===!1&&n({...e,pageGroups:""})}},[e.componentId,e.type]),t.jsxs(t.Fragment,{children:[t.jsx(ve,{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===H.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===H.ROUTING_RULE_TYPES.REDIRECT&&[t.jsx(ve,{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(ve,{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===H.ROUTING_RULE_TYPES.COMPONENT&&[t.jsx(ve,{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:X.getDisplayName(p,!0)},p.meta.did))},"componentId"),d.length?t.jsx(ve,{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===H.ROUTING_RULE_TYPES.GENERAL_REWRITE&&t.jsx(ve,{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===H.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&[t.jsx(ve,{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:H.ROUTING_RESPONSE_TYPES.map(p=>t.jsx(Ne,{value:p.value,children:p.text},p.value))},"responseType"),t.jsx(ve,{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:g.object,serviceTypes:g.array,setParams:g.func,setError:g.func};function ss({children:e=null,hiddenChildren:n=!1,open:r=!1,onClose:i=null}){const{t:a}=ce(),{api:o}=ye(),{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)},x=async u=>{try{const s=await Kt(u,a);if(s)throw s;d(!0);const h={from:{pathPrefix:Le(u.pathPrefix)},to:{type:u.type}};u.type===H.ROUTING_RULE_TYPES.REDIRECT&&(h.to.url=u.url.trim(),h.to.redirectCode=u.redirectCode),u.type===H.ROUTING_RULE_TYPES.COMPONENT&&(h.to.did=p,h.to.componentId=u.componentId,h.to.pageGroup=u.pageGroup),u.type===H.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(h.to.url=Le(u.url)),u.type===H.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){K.error(s.message)}finally{d(!1),v(!1)}},_={title:a("router.rule.add.title"),description:(u,s,h)=>{const b=T=>{if(h(null),Kt(T,a)){s({...T,__disableConfirm:!0});return}s({...T})};return t.jsxs(le,{component:"div",children:[t.jsx(ve,{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:T=>{let k=!1;const M=Eo({params:{...u,pathPrefix:T.target.value},blocklets:[m]});h(M),u.type===H.ROUTING_RULE_TYPES.BLOCKLET&&M&&(k=!0),u.type===H.ROUTING_RULE_TYPES.REDIRECT&&!u.url&&(k=!0),u.type===H.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!u.url&&(k=!0),u.type===H.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!u.responseType||!u.responseBody)&&(k=!0),T.target.value.trim()||(k=!0,h(a("router.validation.pathPrefixRequired"))),k||h("");const z=a("common.slugifyHint",{value:Wn(T.target.value)});s({...u,pathPrefix:T.target.value,pathPrefixHint:z,__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:H.ROUTING_RULE_TYPES.REDIRECT,componentId:"",pageGroup:"",redirectCode:302,responseType:"text/plain",responseBody:"",__disableConfirm:!0},onConfirm:x,onCancel:f},w=u=>{u.stopPropagation(),v(!0)};let S=null;return n||(S=typeof e=="function"?e({open:w}):t.jsxs(Ne,{onClick:w,className:"rule-action","data-cy":"action-add-rule",children:[c?t.jsx(be,{size:16}):t.jsx(Xt,{style:{fontSize:18,marginRight:5}}),a("router.rule.add.title")]})),t.jsxs(t.Fragment,{children:[S,(r||l)&&t.jsx(it,{title:_.title,description:_.description,confirm:_.confirm,cancel:_.cancel,params:_.params,onConfirm:_.onConfirm,onCancel:_.onCancel,color:"primary"})]})}ss.propTypes={children:g.any,onClose:g.func,hiddenChildren:g.bool,open:g.bool};function rn({depth:e=1,className:n=""}){return t.jsx(O,{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:g.number,className:g.string};function is({id:e,from:n,children:r=null}){const{t:i}=ce(),{api:a}=ye(),{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)},x=async()=>{c(!0);try{await a.deleteRoutingRule({input:{id:p,ruleId:e,teamDid:v}})}catch(S){K.error(S.message)}finally{l(null),c(!1)}},_={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:x,onCancel:f},w=S=>{S.stopPropagation(),l(_)};return t.jsxs(t.Fragment,{children:[typeof r=="function"?r({loading:m,open:w}):t.jsxs(Ne,{onClick:w,className:"rule-action","data-cy":"action-delete-rule",children:[m?t.jsx(be,{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})]})}is.propTypes={id:g.string.isRequired,from:g.object.isRequired,children:g.any};function as({id:e,from:n,to:r,children:i=null}){const{t:a}=ce(),{api:o}=ye(),{blocklet:m}=De(),[c,d]=R.useState(!1),[l,v]=R.useState(null),p=m.meta.did,C=m.site.id,f=n.pathPrefix,x=()=>{d(!1),v(null)},_=async u=>{try{const s=await Kt(u,a);if(s)throw s;d(!0);const h={id:e,from:{pathPrefix:Le(u.pathPrefix)},to:{type:u.type}};u.type===H.ROUTING_RULE_TYPES.REDIRECT&&(h.to.url=u.url,h.to.redirectCode=u.redirectCode),u.type===H.ROUTING_RULE_TYPES.COMPONENT&&(h.to.did=p,h.to.componentId=u.componentId,h.to.pageGroup=u.pageGroup),u.type===H.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(h.to.url=Le(u.url)),u.type===H.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){K.error(s.message)}finally{d(!1),v(null)}},w={title:a("router.rule.update.title"),description:(u,s,h)=>{const b=T=>{if(Kt(T,a)){s({...T,__disableConfirm:!0});return}s({...T})};return t.jsxs(le,{component:"div",children:[t.jsx(ve,{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:T=>{let k=!1;u.type===H.ROUTING_RULE_TYPES.REDIRECT&&!u.url&&(k=!0),u.type===H.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!u.url&&(k=!0),u.type===H.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!u.responseType||!u.responseBody)&&(k=!0),T.target.value.trim()||(k=!0,h(a("router.validation.pathPrefixRequired"))),k||h("");const M=a("common.slugifyHint",{value:Wn(T.target.value)});s({...u,pathPrefix:T.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||H.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:_,onCancel:x},S=u=>{u.stopPropagation(),v(w)};return t.jsxs(t.Fragment,{children:[typeof i=="function"?i({loading:c,open:S}):t.jsxs(Ne,{onClick:S,className:"rule-action","data-cy":"action-update-rule",children:[c?t.jsx(be,{size:16}):t.jsx(vo,{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})]})}as.propTypes={id:g.string.isRequired,from:g.object.isRequired,to:g.object.isRequired,children:g.any};function ls({from:e,isProtected:n=!1,...r}){const{locale:i}=ce(),{blocklet:a,recommendedDomain:o}=De(),m=go(o,e.pathPrefix,Hn(a,i));return t.jsxs(O,{sx:{display:"flex",alignItems:"center"},children:[t.jsx(O,{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(as,{...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(is,{...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,{})})})]})}ls.propTypes={isProtected:g.bool};function cs({group:e,...n}){return e?t.jsx(ht,{type:"reverse",...n,children:e}):null}cs.propTypes={group:g.string.isRequired};function Mn({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)}Mn.propTypes={domain:g.string.isRequired,toUrl:g.string.isRequired,isHttps:g.bool};function Jn({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!==H.ROUTING_RULE_TYPES.BLOCKLET).map(c=>{let d=null,l=null;c.to.type===H.ROUTING_RULE_TYPES.NONE?d="404":c.to.type===H.ROUTING_RULE_TYPES.REDIRECT?d=c.to.redirectCode:c.to.type===H.ROUTING_RULE_TYPES.GENERAL_REWRITE?d="R":c.to.type===H.ROUTING_RULE_TYPES.DIRECT_RESPONSE?d=t.jsx(Ia,{sx:{color:"text.secondary",fontSize:"45px"}}):c.to.type===H.ROUTING_RULE_TYPES.COMPONENT&&(l=a.children.find(p=>p.meta.did===c.to.componentId),d="C");const v=c.isProtected?t.jsx(je,{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(ls,{...c});return[t.jsxs(O,{className:"component-item",sx:{display:"flex",py:2,justifyContent:"space-between",alignItems:"center"},children:[t.jsxs(O,{sx:{width:{xs:300,md:400},display:"flex",alignItems:"center"},children:[t.jsx(O,{className:"component-item__indent",sx:{width:28}}),typeof d=="object"?d:t.jsx(mi,{children:d}),t.jsxs(O,{sx:{ml:2,flex:1,wordBreak:"break-word"},children:[t.jsxs(O,{style:{color:"text.primary",fontSize:16},children:[c.to.type===H.ROUTING_RULE_TYPES.NONE&&n("common.page404"),c.to.type===H.ROUTING_RULE_TYPES.REDIRECT&&n("common.redirect"),c.to.type===H.ROUTING_RULE_TYPES.GENERAL_REWRITE&&n("common.rewrite"),c.to.type===H.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&H.ROUTING_RESPONSE_TYPES.find(p=>p.value===c.to.response.contentType)?.text,c.to.type===H.ROUTING_RULE_TYPES.COMPONENT&&X.getDisplayName(l,!0)]}),t.jsxs(O,{sx:{display:"flex",alignItems:"center"},children:[c.to.type===H.ROUTING_RULE_TYPES.REDIRECT&&t.jsx(Mn,{domain:o,toUrl:c.to.url}),c.to.type===H.ROUTING_RULE_TYPES.GENERAL_REWRITE&&t.jsx(Mn,{domain:o,toUrl:c.to.url}),c.to.type===H.ROUTING_RULE_TYPES.COMPONENT&&t.jsx(cs,{group:c.to.pageGroup})]})]})]}),t.jsx(O,{sx:{px:2,alignItems:"center",flexGrow:"1",display:{xs:"none",md:"flex"}},children:t.jsx(xt,{href:go(o,c.from.pathPrefix,Hn(a,r)),target:"_blank",style:{fontSize:16,color:"inherit"},underline:"hover",children:hi(c.from.pathPrefix,"/")||"/"})},c.from.pathPrefix),t.jsx(O,{children:e&&t.jsx("div",{style:{textAlign:"right"},children:v})},"actions")]},"rule"),t.jsx(rn,{},"divider")]})}Jn.propTypes={hasPermission:g.bool};const Sd=Qt(Jn,"mutate_blocklets"),Ed=Qt(Jn,"",ft);function kd(e){const{inService:n}=ye();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 Td(e){const n=xo(),{t:r}=ce(),i=()=>{const a=new URLSearchParams(window.location.search);a.get("checkUpdate")&&(a.delete("checkUpdate"),n(a.toString()),e(),K.success(r("notification.checkingForUpdates")))};R.useEffect(i,[]),Rd("checkUpdate",i)}function Pd({blocklet:e,scrollToComponent:n}={blocklet:null,scrollToComponent:!1}){const r=xo(),{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 K.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 er({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:X.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:m,onClose:d,PaperProps:{style:{minHeight:"500px"}},children:t.jsxs(io,{sx:{gap:1},children:[t.jsx(le,{sx:{fontSize:12,color:"text.secondary",mb:.5},children:a("description.preferences",{name:X.getDisplayName(r,!0)})}),t.jsx(Mi,{id:o,styles:c})]})})}er.propTypes={blocklet:g.object.isRequired,ancestors:g.array,open:g.bool,onClose:g.func};const Id=oe(Yt)`
|
|
442
|
+
`;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}=ye(),C=h=>{h.stopPropagation(),o(!0)},f=R.useCallback(()=>{c(h=>({...h,show:!0}))},[]),x=R.useCallback((h=!1)=>{c(h?{params:null,show:!1}:b=>({...b,show:!1}))},[]),_=R.useCallback(()=>{l({params:null,show:!0})},[]),w=R.useCallback(h=>{l({params:{...h,inStore:!1,isUpload:!0},show:!1}),h.meta&&o(!0)},[]),S=R.useCallback((h=!1)=>{l(h?{params:null,show:!1}:b=>({...b,show:!1}))},[]),u=R.useCallback(h=>{o(h),h||(x(!0),S(!0))},[x,S]),s=R.useMemo(()=>[t.jsxs(fn.Item,{"data-cy":"add-component-from-url",onClick:f,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:_,style:{fontSize:14,color:"primary.main"},children:[t.jsx(Ba,{style:{fontSize:16,marginRight:4}}),i("blocklet.component.addComponentTip.fromUpload")]},"add-component-from-upload")],[_,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(zi,{style:{fontSize:"1.3em",marginRight:4}}),i("blocklet.component.add")]}),t.jsx(Xn,{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:x,onSuccess:({meta:h,inputUrl:b,inStore:T,registryUrl:k})=>{c({show:!1,params:{meta:h,inputUrl:b,inStore:T,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:S})]})}ss.propTypes={children:g.any,blocklet:g.object.isRequired,disabled:g.bool};const _d=e=>e.children.filter(n=>n.meta.interfaces.find(r=>r.type===Ce.BLOCKLET_INTERFACE_TYPE_WEB));function Jn({params:e={},setParams:n=()=>{},setError:r=()=>{},serviceTypes:i=[{name:"Redirect",value:H.ROUTING_RULE_TYPES.REDIRECT},{name:"Default - User will see the 404 page",value:H.ROUTING_RULE_TYPES.NONE},{name:"Rewrite - Route traffic without redirect",value:H.ROUTING_RULE_TYPES.GENERAL_REWRITE},{name:"Response - Response with provided content",value:H.ROUTING_RULE_TYPES.DIRECT_RESPONSE},{name:"Component - Pass traffic to blocklet component",value:H.ROUTING_RULE_TYPES.COMPONENT}]}){const{t:a}=ce(),{blocklet:o}=De(),m=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===H.ROUTING_RULE_TYPES.COMPONENT&&e.componentId){const p=c.find(x=>x.meta.did===e.componentId),C=X.findWebInterface(p.meta),f=(Array.isArray(C?.pageGroups)?C.pageGroups:[]).map(x=>({value:x,label:`${x} pages`}));f.length&&f.unshift({value:"",label:"All pages"}),l(f),e.pageGroup&&f.find(x=>x.value===e.pageGroup)===!1&&n({...e,pageGroups:""})}},[e.componentId,e.type]),t.jsxs(t.Fragment,{children:[t.jsx(ve,{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===H.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===H.ROUTING_RULE_TYPES.REDIRECT&&[t.jsx(ve,{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(ve,{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===H.ROUTING_RULE_TYPES.COMPONENT&&[t.jsx(ve,{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:X.getDisplayName(p,!0)},p.meta.did))},"componentId"),d.length?t.jsx(ve,{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===H.ROUTING_RULE_TYPES.GENERAL_REWRITE&&t.jsx(ve,{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===H.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&[t.jsx(ve,{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:H.ROUTING_RESPONSE_TYPES.map(p=>t.jsx(Ne,{value:p.value,children:p.text},p.value))},"responseType"),t.jsx(ve,{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:g.object,serviceTypes:g.array,setParams:g.func,setError:g.func};function is({children:e=null,hiddenChildren:n=!1,open:r=!1,onClose:i=null}){const{t:a}=ce(),{api:o}=ye(),{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)},x=async u=>{try{const s=await Kt(u,a);if(s)throw s;d(!0);const h={from:{pathPrefix:Le(u.pathPrefix)},to:{type:u.type}};u.type===H.ROUTING_RULE_TYPES.REDIRECT&&(h.to.url=u.url.trim(),h.to.redirectCode=u.redirectCode),u.type===H.ROUTING_RULE_TYPES.COMPONENT&&(h.to.did=p,h.to.componentId=u.componentId,h.to.pageGroup=u.pageGroup),u.type===H.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(h.to.url=Le(u.url)),u.type===H.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){K.error(s.message)}finally{d(!1),v(!1)}},_={title:a("router.rule.add.title"),description:(u,s,h)=>{const b=T=>{if(h(null),Kt(T,a)){s({...T,__disableConfirm:!0});return}s({...T})};return t.jsxs(le,{component:"div",children:[t.jsx(ve,{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:T=>{let k=!1;const M=ko({params:{...u,pathPrefix:T.target.value},blocklets:[m]});h(M),u.type===H.ROUTING_RULE_TYPES.BLOCKLET&&M&&(k=!0),u.type===H.ROUTING_RULE_TYPES.REDIRECT&&!u.url&&(k=!0),u.type===H.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!u.url&&(k=!0),u.type===H.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!u.responseType||!u.responseBody)&&(k=!0),T.target.value.trim()||(k=!0,h(a("router.validation.pathPrefixRequired"))),k||h("");const z=a("common.slugifyHint",{value:Hn(T.target.value)});s({...u,pathPrefix:T.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:H.ROUTING_RULE_TYPES.REDIRECT,componentId:"",pageGroup:"",redirectCode:302,responseType:"text/plain",responseBody:"",__disableConfirm:!0},onConfirm:x,onCancel:f},w=u=>{u.stopPropagation(),v(!0)};let S=null;return n||(S=typeof e=="function"?e({open:w}):t.jsxs(Ne,{onClick:w,className:"rule-action","data-cy":"action-add-rule",children:[c?t.jsx(be,{size:16}):t.jsx(Xt,{style:{fontSize:18,marginRight:5}}),a("router.rule.add.title")]})),t.jsxs(t.Fragment,{children:[S,(r||l)&&t.jsx(it,{title:_.title,description:_.description,confirm:_.confirm,cancel:_.cancel,params:_.params,onConfirm:_.onConfirm,onCancel:_.onCancel,color:"primary"})]})}is.propTypes={children:g.any,onClose:g.func,hiddenChildren:g.bool,open:g.bool};function rn({depth:e=1,className:n=""}){return t.jsx(O,{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:g.number,className:g.string};function as({id:e,from:n,children:r=null}){const{t:i}=ce(),{api:a}=ye(),{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)},x=async()=>{c(!0);try{await a.deleteRoutingRule({input:{id:p,ruleId:e,teamDid:v}})}catch(S){K.error(S.message)}finally{l(null),c(!1)}},_={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:x,onCancel:f},w=S=>{S.stopPropagation(),l(_)};return t.jsxs(t.Fragment,{children:[typeof r=="function"?r({loading:m,open:w}):t.jsxs(Ne,{onClick:w,className:"rule-action","data-cy":"action-delete-rule",children:[m?t.jsx(be,{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:g.string.isRequired,from:g.object.isRequired,children:g.any};function ls({id:e,from:n,to:r,children:i=null}){const{t:a}=ce(),{api:o}=ye(),{blocklet:m}=De(),[c,d]=R.useState(!1),[l,v]=R.useState(null),p=m.meta.did,C=m.site.id,f=n.pathPrefix,x=()=>{d(!1),v(null)},_=async u=>{try{const s=await Kt(u,a);if(s)throw s;d(!0);const h={id:e,from:{pathPrefix:Le(u.pathPrefix)},to:{type:u.type}};u.type===H.ROUTING_RULE_TYPES.REDIRECT&&(h.to.url=u.url,h.to.redirectCode=u.redirectCode),u.type===H.ROUTING_RULE_TYPES.COMPONENT&&(h.to.did=p,h.to.componentId=u.componentId,h.to.pageGroup=u.pageGroup),u.type===H.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(h.to.url=Le(u.url)),u.type===H.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){K.error(s.message)}finally{d(!1),v(null)}},w={title:a("router.rule.update.title"),description:(u,s,h)=>{const b=T=>{if(Kt(T,a)){s({...T,__disableConfirm:!0});return}s({...T})};return t.jsxs(le,{component:"div",children:[t.jsx(ve,{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:T=>{let k=!1;u.type===H.ROUTING_RULE_TYPES.REDIRECT&&!u.url&&(k=!0),u.type===H.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!u.url&&(k=!0),u.type===H.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!u.responseType||!u.responseBody)&&(k=!0),T.target.value.trim()||(k=!0,h(a("router.validation.pathPrefixRequired"))),k||h("");const M=a("common.slugifyHint",{value:Hn(T.target.value)});s({...u,pathPrefix:T.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:f==="/"?f:f.replace(/^\/+/,"").replace(/\/+$/,""),type:r.type||H.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:_,onCancel:x},S=u=>{u.stopPropagation(),v(w)};return t.jsxs(t.Fragment,{children:[typeof i=="function"?i({loading:c,open:S}):t.jsxs(Ne,{onClick:S,className:"rule-action","data-cy":"action-update-rule",children:[c?t.jsx(be,{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:g.string.isRequired,from:g.object.isRequired,to:g.object.isRequired,children:g.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(O,{sx:{display:"flex",alignItems:"center"},children:[t.jsx(O,{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(Po,{})})}),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:g.bool};function ds({group:e,...n}){return e?t.jsx(ht,{type:"reverse",...n,children:e}):null}ds.propTypes={group:g.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:g.string.isRequired,toUrl:g.string.isRequired,isHttps:g.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!==H.ROUTING_RULE_TYPES.BLOCKLET).map(c=>{let d=null,l=null;c.to.type===H.ROUTING_RULE_TYPES.NONE?d="404":c.to.type===H.ROUTING_RULE_TYPES.REDIRECT?d=c.to.redirectCode:c.to.type===H.ROUTING_RULE_TYPES.GENERAL_REWRITE?d="R":c.to.type===H.ROUTING_RULE_TYPES.DIRECT_RESPONSE?d=t.jsx(Ia,{sx:{color:"text.secondary",fontSize:"45px"}}):c.to.type===H.ROUTING_RULE_TYPES.COMPONENT&&(l=a.children.find(p=>p.meta.did===c.to.componentId),d="C");const v=c.isProtected?t.jsx(je,{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(O,{className:"component-item",sx:{display:"flex",py:2,justifyContent:"space-between",alignItems:"center"},children:[t.jsxs(O,{sx:{width:{xs:300,md:400},display:"flex",alignItems:"center"},children:[t.jsx(O,{className:"component-item__indent",sx:{width:28}}),typeof d=="object"?d:t.jsx(mi,{children:d}),t.jsxs(O,{sx:{ml:2,flex:1,wordBreak:"break-word"},children:[t.jsxs(O,{style:{color:"text.primary",fontSize:16},children:[c.to.type===H.ROUTING_RULE_TYPES.NONE&&n("common.page404"),c.to.type===H.ROUTING_RULE_TYPES.REDIRECT&&n("common.redirect"),c.to.type===H.ROUTING_RULE_TYPES.GENERAL_REWRITE&&n("common.rewrite"),c.to.type===H.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&H.ROUTING_RESPONSE_TYPES.find(p=>p.value===c.to.response.contentType)?.text,c.to.type===H.ROUTING_RULE_TYPES.COMPONENT&&X.getDisplayName(l,!0)]}),t.jsxs(O,{sx:{display:"flex",alignItems:"center"},children:[c.to.type===H.ROUTING_RULE_TYPES.REDIRECT&&t.jsx(zn,{domain:o,toUrl:c.to.url}),c.to.type===H.ROUTING_RULE_TYPES.GENERAL_REWRITE&&t.jsx(zn,{domain:o,toUrl:c.to.url}),c.to.type===H.ROUTING_RULE_TYPES.COMPONENT&&t.jsx(ds,{group:c.to.pageGroup})]})]})]}),t.jsx(O,{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(O,{children:e&&t.jsx("div",{style:{textAlign:"right"},children:v})},"actions")]},"rule"),t.jsx(rn,{},"divider")]})}er.propTypes={hasPermission:g.bool};const Sd=Qt(er,"mutate_blocklets"),Ed=Qt(er,"",ft);function kd(e){const{inService:n}=ye();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 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(),K.success(r("notification.checkingForUpdates")))};R.useEffect(i,[]),Rd("checkUpdate",i)}function Pd({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 K.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:X.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: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:X.getDisplayName(r,!0)})}),t.jsx(Mi,{id:o,styles:c})]})})}tr.propTypes={blocklet:g.object.isRequired,ancestors:g.array,open:g.bool,onClose:g.func};const Id=oe(Yt)`
|
|
443
443
|
.MuiDialogContent-root {
|
|
444
444
|
padding-top: 0;
|
|
445
445
|
padding-bottom: 24px;
|
|
@@ -452,15 +452,15 @@ import{aF as qe,j as t,ds as ws,gC as _s,ix as Ss,n as ce,bn as ye,M as O,ay as
|
|
|
452
452
|
.ux-dialog_closeButton {
|
|
453
453
|
margin: 0;
|
|
454
454
|
}
|
|
455
|
-
`;function
|
|
455
|
+
`;function us({component:e,remove:n=async()=>{},disabled:r=!1,tip:i="",showConfirm:a=!1,hideBtn:o=!1,onCancel:m=()=>{}}){const{t:c}=R.useContext(we),[d,l]=R.useState(!1),[v,p]=R.useState(null),C=async S=>{l(!0),await n(S.component,S.removeType),l(!1),p(null)},f=r||d,x=()=>{p({title:`${c("common.delete")} ${e.meta.title||e.meta.name}`,description:(S,u)=>t.jsxs(le,{component:"div",children:[t.jsx(le,{gutterBottom:!0,children:c("blocklet.action.removeComponentDescription")}),t.jsxs(_a,{name:"removeType",value:S.removeType,onChange:s=>u({...S,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),m()}})};R.useEffect(()=>{a?x():(l(!1),p(null))},[a]);const _=t.jsx(Dd,{size:"small",disabled:f,onClick:()=>x,"data-cy":"delete-component-btn",children:t.jsx(tn,{disabled:f})}),w=t.jsx(je,{title:i||c("common.delete"),children:t.jsx("span",{children:_})});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:g.object.isRequired,remove:g.func,onCancel:g.func,disabled:g.bool,showConfirm:g.bool,hideBtn:g.bool,tip:g.string};const Dd=oe(me)`
|
|
456
456
|
&.Mui-disabled {
|
|
457
457
|
opacity: 0.5;
|
|
458
458
|
}
|
|
459
|
-
`;function
|
|
459
|
+
`;function ps({component:e,onStart:n=async()=>{},onStop:r=async()=>{},disabled:i=!1,tip:a=""}){const{t:o}=R.useContext(we),[m,c]=R.useState(!1),[d,l]=R.useState(),v=async()=>{c(!0);try{await n(e)}catch(S){K.error(S.message)}c(!1)},p=async()=>{c(!0);try{await r(e)}catch(S){K.error(S.message)}c(!1)},C=i||m,f=["starting","running","stopping"],x=f.includes(e.status)||f.includes(e.greenStatus),_=x?Ri:Ti,w=t.jsx(Bd,{disabled:C,size:"small",onClick:()=>{x?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":`${x?"stop":"start"}-component-btn`,children:t.jsx(_,{disabled:C,fontSize:"small"})});return[t.jsx(je,{title:a||o(`common.${x?"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:g.object.isRequired,onStart:g.func,onStop:g.func,disabled:g.bool,tip:g.string};const Bd=oe(me)`
|
|
460
460
|
&.Mui-disabled {
|
|
461
461
|
opacity: 0.5;
|
|
462
462
|
}
|
|
463
|
-
`;function
|
|
463
|
+
`;function fs({sourceInfo:e={},blocklet:n={}}){const{t:r}=R.useContext(we);let{source:i}=e;return i==="registry"&&(i="Blocklet Store"),t.jsxs(O,{sx:{display:"flex",alignItems:"center"},children:[t.jsx(xi,{type:"success",children:Ea(i)},"source"),e.source==="registry"&&t.jsx(xt,{href:ke(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:g.shape({source:g.string,deployedFrom:g.string}),blocklet:g.object};function nr({blocklet:e,checkUpgrade:n=!1,hasPermission:r=!1,...i}){const{api:a}=ye(),{t:o}=R.useContext(we),[m,c]=R.useState(!1),[d,l]=R.useState(""),[v,p]=R.useState(null),[C,f]=R.useState(null);R.useEffect(()=>{p(null),n&&(e.mode,Ce.BLOCKLET_MODES.DEVELOPMENT)},[e,n]);const x=()=>{c(!1),f(null)},_=async()=>{c(!0);try{const S={did:e.meta.did,version:v.version,storeUrl:v.registryUrl||""};await ut(2e3),await a.upgradeBlocklet({input:S})}catch(S){K.error(`Blocklet upgrade failed: ${xe(S)}`)}finally{c(!1),f(null)}},w={title:`${o("common.upgrade")} ${o("common.blocklet")} ${X.getDisplayName(e)}`,description:o("blocklet.action.upgradeDescription"),confirm:o("blocklet.action.confirmUpgrade"),cancel:o("common.cancel"),onConfirm:_,onCancel:x};return r&&v&&!X.isInProgress(e.status)?t.jsxs(t.Fragment,{children:[t.jsx(ht,{...i,children:e.meta.version}),t.jsx(je,{title:o("common.updateAvailable",{version:v.version}),children:t.jsx(me,{size:"small",style:{marginLeft:8},disabled:m,onClick:()=>f(w),children:m?t.jsx(be,{size:16}):t.jsx(Ta,{style:{fontSize:16,color:"red"}})})}),!!d&&t.jsx(K,{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:g.object.isRequired,checkUpgrade:g.bool,hasPermission:g.bool};const Od=Qt(nr,"mutate_blocklets"),Ud=Qt(nr,"",ft);function Nd(e){const{inService:n}=ye();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 m=i.children.find(c=>c.meta.did===r[a]);i=m,a++,m&&o.push(m.meta.title)}return o.join(" / ")};function ms({blocklet:e,depth:n=0,componentInfo:r=null,app:i=null,onClose:a}){const{t:o,locale:m}=R.useContext(we),{deletingBlocklets:c}=Kn();let{status:d}=e;n===1&&c.includes(e.meta.did)&&(d="deleting");const l=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),v=f=>f.map(x=>x.name===o("common.did")||x.name===o("blocklet.appId")?t.jsx(mn,{valueComponent:"div",nameWidth:120,name:x.name,nameFormatter:()=>x.name,children:x.value},x.name):t.jsx(mn,{valueComponent:"div",nameWidth:120,name:x.name,children:x.link?t.jsx(xt,{href:x.link,target:"_blank",className:"page-link",underline:"hover",children:x.value}):x.value},x.name)),p=r?Md(r):{},C=r?[{name:o("common.name"),value:X.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})},X.isBlockletRunning(e)?{name:o("blocklet.startedAt"),value:e.startedAt?t.jsx(pn,{value:e.startedAt,type:"all",locale:m}):"-"}:null,e.status!=="running"?{name:o("blocklet.stoppedAt"),value:e.stoppedAt?t.jsx(pn,{value:e.stoppedAt,type:"all",locale:m}):"-"}:null,e.installedAt?{name:o("blocklet.installedAt"),value:e.installedAt?t.jsx(pn,{value:e.installedAt,type:"all",locale:m}):"-"}:null,X.hasStartEngine(e.meta)?{name:o("common.mountPoint"),value:l}: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:p,blocklet:e})},{name:o("blocklet.overview.deployedFrom"),value:p.deployedFrom||"-",link:p.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:m}):ga.formatPerson(r.meta.author)},{name:o("common.engine"),value:Ad(r.engine,o).map(({name:f,value:x})=>t.jsx(mn,{style:{marginBottom:4},nameWidth:120,name:f,children:x},f))},e.dependents?.length?{name:o("common.dependents"),value:t.jsx(O,{children:e.dependents.map(f=>t.jsx(O,{children:`${zd(f.id,i)} ${f.required?`(${o("common.required")})`:""}`},f.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(O,{sx:{paddingBottom:1.5},children:v(C)},"dialog-wrapper")},"base-info-dialog"):null}ms.propTypes={blocklet:g.object.isRequired,depth:g.number,app:g.object,componentInfo:g.object,onClose:g.func.isRequired};oe(vo)`
|
|
464
464
|
.BaseBadge-badge {
|
|
465
465
|
top: ${e=>e.top*8||6}px;
|
|
466
466
|
right: ${e=>e.right*8||6}px;
|
|
@@ -482,12 +482,12 @@ import{aF as qe,j as t,ds as ws,gC as _s,ix as Ss,n as ce,bn as ye,M as O,ay as
|
|
|
482
482
|
margin-left: 4px;
|
|
483
483
|
transform: translateY(-1px);
|
|
484
484
|
}
|
|
485
|
-
`;function
|
|
485
|
+
`;function hs({blocklet:e,ancestors:n,mountPoint:r,href:i}){const[a,o]=R.useState(!1),[m,c]=R.useState(!1),[d,l]=R.useState(!1),[v,p]=R.useState(r),{api:C}=ye(),f=!n.length,x=f?e.meta.did:n.map(k=>k.meta.did)[0],{t:_}=ce(),{confirmApi:w,confirmHolder:S}=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:x,mountPoint:Le(v)};f||(k.did=e.meta.did),await C.updateComponentMountPoint({input:k})}catch(k){throw k.message=xe(k),K.error(k.message),k}finally{u()}},h=Ke(()=>{w.open({title:_("common.noticeTitle"),content:t.jsxs(O,{sx:{color:"#9397A1","& > li":{listStyle:"disc",ml:1.5}},children:[t.jsx(le,{sx:{mb:1.5},children:_("blocklet.mountPoint.description1")}),t.jsx(le,{component:"li",children:_("blocklet.mountPoint.case1")}),t.jsx(le,{component:"li",children:_("blocklet.mountPoint.case2")}),t.jsx(le,{sx:{mt:1.5},children:_("blocklet.mountPoint.description2")})]}),confirmButtonText:_("common.confirm"),cancelButtonText:_("common.cancel"),async onConfirm(k){await s(),k()},confirmButtonProps:{"data-cy":"edit-mount-point-confirm"}})}),b=k=>{k?.preventDefault(),Le(v)!==r?h():c(!1)},T=m?t.jsxs(O,{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(O,{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(O,{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(O,{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(O,{sx:{alignItems:"center",flexGrow:"1",display:{xs:"none",md:"flex"}},children:[S,m?t.jsx("form",{onSubmit:b,children:t.jsx(ve,{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(O,{component:"a",target:"_blank",href:i,rel:"noopener noreferrer",title:i,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:t.jsx(O,{sx:{maxWidth:400,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",color:"primary.main",fontSize:16,px:2},children:vi(r)})}),d?t.jsx(be,{size:20,sx:{ml:1}}):T]},r)}hs.propTypes={mountPoint:g.string.isRequired,href:g.string.isRequired,blocklet:g.object.isRequired,ancestors:g.array.isRequired};const qd=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 m=i.children.find(c=>c.meta.did===r[a]);i=m,a++,m&&o.push(m.meta.title)}return o.join(" / ")},Fd=(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="",m="";return i?(o="stopping",m=""):r?o="running":o=e||n||"",r&&e!==n&&(m=e==="running"?n:e),a&&(o="running",m="downloading"),o==="running"&&m==="stopped"&&(m=""),e===n&&(o=e,m=""),{primaryStatus:o,secondaryStatus:m}};function qn({blocklet:e,ancestors:n=[],depth:r=0,onRemove:i=()=>{},onStart:a=()=>{},onStop:o=()=>{},onRestart:m=()=>{},getComponentUrl:c=()=>window.location.origin,app:d=null}){const{t:l}=R.useContext(we),[v,p]=R.useState(),[C,f]=R.useState(!1),[x,_]=R.useState(!1),[w,S]=R.useState(null),{info:u}=ye(),[s,h]=R.useState(!1),[b,T]=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,"/"),P=c(z),D=X.isInProgress(d.status),I=X.isInProgress(e.status);let L="";if(D||I||r===1&&k.includes(e.meta.did))L=l("blocklet.component.tip.stopBlocklet");else if(e.dependents?.length){const B=e.dependents.filter(te=>te.required);if(B.length){const te=B.map(N=>io(N.id,d));L=l("blocklet.component.tip.requiredBy",{name:te.join(", ")})}}const q=async(...B)=>{_(!0);try{await i(...B)}catch{}_(!1),f(!1)},{usingDocker:$,usingIsolation:G}=R.useMemo(()=>{if(!e.meta.group||e.meta.group==="static")return{usingDocker:!1,usingIsolation:!1};const B=!!u?.enableDocker||window.blocklet?.enableDocker,te=[...d.configs,...e.configs].find(y=>y.key==="SKIP_DOCKER"&&y.value),N=[...d.configs,...e.configs].find(y=>y.key==="USE_DOCKER"&&y.value),E=[...d.configs,...e.configs].find(y=>y.key==="SKIP_DOCKER_NETWORK"&&y.value);return{usingDocker:B?!te:!!N,usingIsolation:B&&!E&&(u?.enableDockerNetwork||window.blocklet?.enableDockerNetwork)}},[e.configs,u?.enableDocker,u?.enableDockerNetwork,d.configs,e.meta.group]),{primaryStatus:V,secondaryStatus:se}=Fd(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(O,{sx:{pl:2,width:{xs:250,sm:400},display:"flex",alignItems:"center"},children:[t.jsx(Ci,{blocklet:e,ancestors:n}),t.jsxs(O,{sx:{ml:"16px",minWidth:0},children:[t.jsxs(O,{className:"component-header",onClick:()=>p(e),children:[t.jsx(O,{className:"component-name",children:X.getDisplayName(e,!0)}),t.jsx(O,{className:"component-version",children:e?.meta?.version})]}),t.jsxs(O,{sx:{display:"flex",alignItems:"center",gap:.5},children:[V&&t.jsx(An,{style:{whiteSpace:"nowrap"},status:V,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(je,{title:l("blocklet.usingDocker"),children:t.jsx(O,{sx:{display:"flex",color:"primary.main",ml:1},children:t.jsx(fe,{icon:wo})})}),e.mode!=="development"&&G&&t.jsx(je,{title:l("blocklet.usingIsolation"),children:t.jsx(O,{sx:{display:"flex",color:"primary.main",ml:1},children:t.jsx(fe,{icon:"streamline:network"})})}),!!e.dependents?.length&&t.jsx(je,{title:[`${l("common.dependents")}: `,e.dependents.map(B=>t.jsx(O,{sx:{pl:1},children:`${io(B.id,d)} ${B.required?`(${l("common.required")})`:""}`},B.id))],children:t.jsx(O,{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:P},z),t.jsx("div",{style:{flex:1}}),t.jsxs(O,{sx:{display:"flex",alignItems:"center"},children:[X.hasStartEngine(e.meta)&&t.jsx(je,{title:l("common.visit"),children:t.jsx(O,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:P,rel:"noopener noreferrer",children:t.jsx(me,{size:"small",children:t.jsx(Po,{fontSize:"small"})})})}),t.jsx(ps,{blocklet:d,component:e,onStart:a,onStop:o,disabled:!["starting","stopping"].includes(d.status)&&X.isInProgress(d.status)}),t.jsx(me,{size:"small",onClick:()=>T(!0),disabled:D||I,children:t.jsx(Bo,{fontSize:"small"})}),t.jsx(Fn,{color:"error",badgeContent:"",variant:"dot",invisible:!X.getComponentMissingConfigs(e,n[0]).length,children:t.jsx(Io,{"data-cy":"component-actions",actions:[X.hasStartEngine(e.meta)||qd(e)?{icon:t.jsx(bi,{}),text:l("common.detail"),onClick:()=>{p(e)}}:null,{icon:t.jsx(Pi,{}),text:l("common.restart"),onClick:()=>{S({title:`${l("common.restart")} ${e.meta.title}`,description:l("blocklet.action.restartDescription"),confirm:l("blocklet.action.confirmRestart"),cancel:l("common.cancel"),onConfirm:async()=>{_(!0),await m(e),_(!1),S(null)},onCancel:()=>S(null)})},disabled:x||D||I||!X.isBlockletRunning(e)},{icon:t.jsx(tn,{}),text:l("common.delete"),onClick:()=>{f(!0)},disabled:D||I||!!L,tip:L},{separator:!0},{icon:t.jsx(fe,{icon:"mdi:variable"}),onClick:()=>{h(!0)},text:t.jsx(Fn,{color:"error",badgeContent:"",variant:"dot",invisible:!X.getComponentMissingConfigs(e,n[0]).length,children:t.jsx(O,{sx:{width:"100%"},children:l("common.environments")})}),disabled:D||I}].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:q,onCancel:()=>f(!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:()=>T(!1),blocklet:e,ancestors:n})]})}qn.propTypes={blocklet:g.object.isRequired,ancestors:g.array,depth:g.number,onRemove:g.func,onStart:g.func,onStop:g.func,onRestart:g.func,getComponentUrl:g.func,app:g.object};const Fn=oe(vo)`
|
|
486
486
|
.BaseBadge-badge {
|
|
487
487
|
top: ${e=>e.top*8||6}px;
|
|
488
488
|
right: ${e=>e.right*8||6}px;
|
|
489
489
|
}
|
|
490
|
-
`,
|
|
490
|
+
`,rr=oe(O)`
|
|
491
491
|
&:hover {
|
|
492
492
|
background-color: rgba(0, 0, 0, 0.05);
|
|
493
493
|
}
|
|
@@ -511,7 +511,7 @@ import{aF as qe,j as t,ds as ws,gC as _s,ix as Ss,n as ce,bn as ye,M as O,ay as
|
|
|
511
511
|
margin-left: 4px;
|
|
512
512
|
transform: translateY(-1px);
|
|
513
513
|
}
|
|
514
|
-
`;function
|
|
514
|
+
`;function gs({meta:e,dependencies:n=[],logoUrl:r="",setInstallComponentMeta:i}){const a=ye(),{t:o}=ce(),m=()=>{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(je,{title:[`${o("common.dependents")}: `,n.map(d=>t.jsx(O,{sx:{pl:1},children:`${d.parentTitle} ${d.required?`(${o("common.required")})`:""}`},d.parentName+d.mount_point))],children:t.jsx(O,{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(O,{sx:{minWidth:100,display:"flex",justifyContent:"flex-end"},children:t.jsx(Zt,{onClick:m,startIcon:t.jsx(fe,{icon:"ph:download-simple-bold"}),children:o("common.install")})})]}),t.jsx(rn,{class:"line"},"line")]})}gs.propTypes={meta:g.object.isRequired,logoUrl:g.string,setInstallComponentMeta:g.func.isRequired,dependencies:g.arrayOf(g.shape({parentDid:g.string,parentName:g.string,parentPoint:g.string,required:g.bool}))};const $d=oe(rr)`
|
|
515
515
|
.line {
|
|
516
516
|
opacity: 0.5;
|
|
517
517
|
}
|
|
@@ -561,7 +561,7 @@ import{aF as qe,j as t,ds as ws,gC as _s,ix as Ss,n as ce,bn as ye,M as O,ay as
|
|
|
561
561
|
margin-left: 4px;
|
|
562
562
|
transform: translateY(-1px);
|
|
563
563
|
}
|
|
564
|
-
`;function
|
|
564
|
+
`;function xs({blocklet:e,onUpdate:n=()=>{},getComponentUrl:r=()=>window.location.origin,...i}){const{t:a}=R.useContext(we),{api:o,inService:m,info:c}=ye(),{addDeletingDid:d,removeDeletingDid:l,matchDeletingDid:v}=Kn(),[p,C]=R.useState(!1),[f,x]=R.useState(null),[_,w]=R.useState(null),[S,u]=R.useState(!1),[s,h]=R.useState(!1),[b,T]=R.useState(!1),[k,M]=R.useState(!1),[z,P]=R.useState(null),D=e&&e.structVersion!==H.APP_STRUCT_VERSION,[I,L]=R.useState(!1),q=[...e.children];e.meta.group!=="gateway"&&q.unshift(e),v(q.map(U=>U.meta.did));const $=async()=>{if(!p){C(!0);try{const{updateId:U,updateList:W}=(await o.checkComponentsForUpdates({input:{did:e.meta.did}})).preUpdateInfo||{};if(C(!1),!U){K.info(a("blocklet.component.noUpdate"));return}const re=[];X.forEachChildSync(e,(ne,{id:ie,ancestors:he})=>{const Z=W.find(_e=>_e.id===ie);if(Z){const _e=he.slice(1).concat(ne).map(Ve=>Ve.meta.title||Ve.meta.name).join(" / "),de=(he[1]||ne).meta.did;re.push({groupId:de,name:_e,version:ne.meta.version,newVersion:Z.meta.version})}});const J={};re.forEach(ne=>{J[ne.groupId]?ne.disabled=!0:J[ne.groupId]=!0}),x({params:{updateId:U},list:re,checks:J,hasChecks:!0})}catch(U){C(!1),K.error(xe(U))}}},G=async()=>{if(!p)try{C(!0);const U=Object.keys(f.checks).filter(re=>f.checks[re]),W={updateId:f.params.updateId,rootDid:e.meta.did,selectedComponents:U};await o.upgradeComponents({input:W}),C(!1),x(null),L(null)}catch(U){C(!1),K.error(xe(U))}},V=async(U,W)=>{d(U.meta.did);try{await o.deleteComponent({input:{did:U.meta.did,keepData:W==="keepData",rootDid:e.meta.did}}),await ut(800)}catch(re){K.error(xe(re)),l(U.meta.did)}},se=async U=>{try{await o.startBlocklet({input:{did:e.meta.did,componentDids:[U.meta.did]}}),await ut(800)}catch(W){K.error(xe(W))}},B=async U=>{try{await o.stopBlocklet({input:{did:e.meta.did,componentDids:[U.meta.did]}}),await ut(800)}catch(W){K.error(xe(W))}},te=async U=>{try{await o.restartBlocklet({input:{did:e.meta.did,componentDids:[U.meta.did]}}),await ut(800)}catch(W){K.error(xe(W))}},N=(U,W)=>{const{checked:re}=U.target;x(J=>{const ne=Object.entries(J.checks).reduce((he,[Z,_e])=>(he[Z]=W===Z||W==="all"?re:_e,he),{}),ie=Object.values(ne).includes(!0);return{...J,checks:ne,hasChecks:ie}})},E=R.useMemo(()=>f?.list.filter(U=>!U.disabled).every(U=>f.checks[U.groupId]),[f]);Td($);const y=Pd({blocklet:e,scrollToComponent:!0}),j=z||y;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:[q?.length?`${a("common.components")} (${q.length})`:`${a("common.components")}`,!D&&t.jsx(Nn,{permission:m?"":"mutate_blocklets",role:m?ft:[],children:t.jsx(Oo,{children:t.jsx(Fn,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!I,children:t.jsxs(Be,{disabled:p||X.isInProgress(e.status),onClick:()=>{$()},"data-cy":"check-for-updates",children:[t.jsx(O,{sx:{ml:.5,mr:.5,display:"flex"},children:p?t.jsx(be,{size:16}):t.jsx(Da,{style:{fontSize:"1em"}})}),a("blocklet.component.checkUpdateTitle")]})})})})]}),t.jsx(Nn,{permission:m?"":"mutate_blocklets",role:m?ft:[],children:t.jsxs(O,{sx:{display:"flex",alignItems:"center",gap:.5},children:[!D&&t.jsx(ss,{blocklet:e,serverVersion:c.version,disabled:p||X.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||X.isInProgress(e.status)},...D?[]:[{icon:t.jsx(fe,{icon:"mdi:variable"}),onClick:()=>{T(!0)},text:a("common.environments")},{icon:t.jsx(Bo,{}),onClick:()=>{M(!0)},text:a("common.preferences")}]].filter(Boolean)})]})})]}),q?.length?t.jsxs(t.Fragment,{children:[t.jsxs(O,{sx:{mt:2},children:[e.meta.group!=="gateway"&&t.jsx(qn,{blocklet:e,app:e,onRemove:V,onStart:se,onStop:B,onRestart:te,getComponentUrl:r},`0-${e.meta.did}`),e.children.map(U=>t.jsx(qn,{depth:1,blocklet:U,ancestors:[e],app:e,onRemove:V,onStart:se,onStop:B,onRestart:te,getComponentUrl:r},`1-${U.meta.did}`))]},`top-blocklet-${e.meta.did}`),e.optionalComponents?.map(U=>t.jsx(rr,{children:t.jsx(gs,{setInstallComponentMeta:P,...U})},U.meta.did))]}):t.jsx(O,{sx:{mt:8},children:t.jsx(Ei,{children:a("blocklet.component.noComponent")})}),!!e.site.rules.length&&t.jsx(O,{sx:{mt:0,".component-item__indent":{pl:2,width:0}},children:t.jsx(kd,{})}),!!f&&t.jsx(fr,{open:!0,fullWidth:!0,children:t.jsxs(O,{sx:{paddingY:1.5},children:[t.jsx(mr,{children:a("blocklet.component.updateTitle")}),t.jsxs(O,{component:hr,sx:{py:4},children:[f.list.filter(U=>!U.disabled).length>1&&t.jsxs(O,{sx:{display:"flex",alignItems:"center"},children:[t.jsx(gr,{checked:E,onChange:U=>N(U,"all")}),t.jsx(O,{children:a(E?"common.unselectAll":"common.selectAll")})]}),f.list.map(U=>t.jsxs(O,{sx:{display:"flex",alignItems:"center",mb:1},children:[t.jsx(gr,{checked:f.checks[U.groupId],onChange:W=>N(W,U.groupId),style:{marginLeft:U.disabled?16:0,alignSelf:"flex-start"},defaultChecked:!0,disabled:U.disabled}),t.jsxs(O,{sx:{flexGrow:1},children:[t.jsx(O,{xs:8,sx:{pt:1},children:U.name}),U.version&&t.jsxs(ze,{container:!0,spacing:2,sx:{fontSize:"h6.fontSize",alignItems:"center"},children:[t.jsx(ze,{size:3,children:U.version}),t.jsx(ze,{size:1,children:t.jsx(ji,{style:{fontSize:"0.9em"}})}),t.jsx(ze,{size:3,children:t.jsx(O,{sx:{color:"secondary.main"},children:U.newVersion})})]})]},`${U.name}-${U.newVersion}`)]},U.name))]}),t.jsxs(wi,{style:{padding:"8px 24px 24px"},children:[t.jsx(Be,{onClick:()=>{x(null)},children:a("common.cancel")}),t.jsxs(Be,{onClick:U=>{U.stopPropagation(),G()},color:"primary",disabled:p||!f.hasChecks,variant:"contained",autoFocus:!0,children:[p&&t.jsx(be,{size:16}),a("common.update")]})]})]})}),!!_&&t.jsx(fr,{open:!0,fullWidth:!0,onClose:()=>w(!1),children:t.jsxs(O,{sx:{paddingY:1.5},children:[t.jsx(mr,{children:a("common.configuration")}),t.jsx(hr,{children:t.jsx(O,{sx:{py:2},children:t.jsx(Un,{control:t.jsx(ka,{checked:S,onChange:U=>u(!!U.target.checked)}),label:a("blocklet.component.showContainer")})})})]})}),t.jsx(Xn,{selectedMeta:j,blocklet:e,showDialog:!!j,setShowDialog:()=>P(null)}),s&&t.jsx(is,{hiddenChildren:!0,open:!0,onClose:()=>h(!1)}),b&&t.jsx(Vn,{open:!0,onClose:()=>T(!1),hiddenChildren:!0,blocklet:e,ancestors:[]}),k&&t.jsx(tr,{open:!0,onClose:()=>M(!1),blocklet:e,ancestors:[]})]})}xs.propTypes={blocklet:g.object.isRequired,onUpdate:g.func,getComponentUrl:g.func};const Wd=oe.div`
|
|
565
565
|
.title {
|
|
566
566
|
font-size: 1.2rem;
|
|
567
567
|
font-weight: bold;
|
|
@@ -599,4 +599,4 @@ import{aF as qe,j as t,ds as ws,gC as _s,ix as Ss,n as ce,bn as ye,M as O,ay as
|
|
|
599
599
|
width: 100%;
|
|
600
600
|
justify-content: space-between;
|
|
601
601
|
}
|
|
602
|
-
`;function vp(e){const{locale:n}=R.useContext(we),{blocklet:r,recommendedDomain:i}=Ra(),a=o=>_i({blocklet:r,domain:{value:i||`${Si.encode(r.appPid)}.${H.DEFAULT_DID_DOMAIN}`},mountPoint:o,params:
|
|
602
|
+
`;function vp(e){const{locale:n}=R.useContext(we),{blocklet:r,recommendedDomain:i}=Ra(),a=o=>_i({blocklet:r,domain:{value:i||`${Si.encode(r.appPid)}.${H.DEFAULT_DID_DOMAIN}`},mountPoint:o,params:Gn(r,n)});return t.jsx(xs,{blocklet:r,getComponentUrl:a,...e})}export{vp as default};
|